Jump to content

Do I have to anything special to make a mod multiplayer?


Zeretul4

Recommended Posts

Hey everyone, just a quick question. I'm just about done with my mod but am wondering if it can be played on multiplayer as is. I've followed the basic tutorials on here so I'm not sure what else I would have to do to make it multiplayer. I have only joined a few of my friends servers so I have no idea how the process works with multiplayer mods. I would assume it's as simple as installing the mod and joining a server that also has it installed, but this probably isn't the case ha ha. Thanks guys!

Link to comment
Share on other sites

If it's a forge mod and it's correctly setup with @Networkmod and the ClientProxy/CommonPorxy classes.

Then it's good to go.

 

Actually as long as it's a real forge mod, it is MP compatible from the start ;)

If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

It depends. What does your mod do?

I second this. Technically speaking, you can put the mod on your server and client and it should work (assuming you have correctly put all @SideOnly annotations as well to prevent the mod from referencing nonexistent classes.) If all your mod does is add simple blocks and items, it should work fine. In most cases, if your mod works in single player (since it actually runs an internal server), it'll work in multiplayer too.

 

So if you want the question fully answered, you have to tell us what your mod does.

width=336 height=83http://img836.imageshack.us/img836/1237/cooltext624963071.png[/img]

I make games, minecraft mods/plugins, and some graphic art.

 

Current Project: LoECraft - An industrial minecraft server with its own modpack and custom launcher.

Link to comment
Share on other sites

It depends. What does your mod do?

I second this. Technically speaking, you can put the mod on your server and client and it should work (assuming you have correctly put all @SideOnly annotations as well to prevent the mod from referencing nonexistent classes.) If all your mod does is add simple blocks and items, it should work fine. In most cases, if your mod works in single player (since it actually runs an internal server), it'll work in multiplayer too.

 

So if you want the question fully answered, you have to tell us what your mod does.

width=336 height=83http://img836.imageshack.us/img836/1237/cooltext624963071.png[/img]

I make games, minecraft mods/plugins, and some graphic art.

 

Current Project: LoECraft - An industrial minecraft server with its own modpack and custom launcher.

Link to comment
Share on other sites

It depends. What does your mod do?

I second this. Technically speaking, you can put the mod on your server and client and it should work (assuming you have correctly put all @SideOnly annotations as well to prevent the mod from referencing nonexistent classes.) If all your mod does is add simple blocks and items, it should work fine. In most cases, if your mod works in single player (since it actually runs an internal server), it'll work in multiplayer too.

 

So if you want the question fully answered, you have to tell us what your mod does.

I agree with this. If it is a more complicated mod, however, you may need to pass packets back and forth between client and server, and it would be easier to make separate mods for singleplayer and multiplayer.

Link to comment
Share on other sites

It depends. What does your mod do?

I second this. Technically speaking, you can put the mod on your server and client and it should work (assuming you have correctly put all @SideOnly annotations as well to prevent the mod from referencing nonexistent classes.) If all your mod does is add simple blocks and items, it should work fine. In most cases, if your mod works in single player (since it actually runs an internal server), it'll work in multiplayer too.

 

So if you want the question fully answered, you have to tell us what your mod does.

I agree with this. If it is a more complicated mod, however, you may need to pass packets back and forth between client and server, and it would be easier to make separate mods for singleplayer and multiplayer.

Link to comment
Share on other sites

I agree with this. If it is a more complicated mod, however, you may need to pass packets back and forth between client and server, and it would be easier to make separate mods for singleplayer and multiplayer.

Right. I'm assuming this isn't the case, though, since he would have figured out that he needs to do this in a singleplayer test as well, unless he has residual bugs that he doesn't even know about :P.

width=336 height=83http://img836.imageshack.us/img836/1237/cooltext624963071.png[/img]

I make games, minecraft mods/plugins, and some graphic art.

 

Current Project: LoECraft - An industrial minecraft server with its own modpack and custom launcher.

Link to comment
Share on other sites

I agree with this. If it is a more complicated mod, however, you may need to pass packets back and forth between client and server, and it would be easier to make separate mods for singleplayer and multiplayer.

Right. I'm assuming this isn't the case, though, since he would have figured out that he needs to do this in a singleplayer test as well, unless he has residual bugs that he doesn't even know about :P.

width=336 height=83http://img836.imageshack.us/img836/1237/cooltext624963071.png[/img]

I make games, minecraft mods/plugins, and some graphic art.

 

Current Project: LoECraft - An industrial minecraft server with its own modpack and custom launcher.

Link to comment
Share on other sites

Thank for the replies everyone. My mod adds the basics like blocks, items tools, etc and a few tile entities. I don't have any plans to make it more complicated than this, but what should I look out for? Also, how do I know which methods/classes I have to put @sideonly or @clientside or whatever? Is there a tutorial for that? Thanks a lot guys!

Link to comment
Share on other sites

Thank for the replies everyone. My mod adds the basics like blocks, items tools, etc and a few tile entities. I don't have any plans to make it more complicated than this, but what should I look out for? Also, how do I know which methods/classes I have to put @sideonly or @clientside or whatever? Is there a tutorial for that? Thanks a lot guys!

Link to comment
Share on other sites

Thank for the replies everyone. My mod adds the basics like blocks, items tools, etc and a few tile entities. I don't have any plans to make it more complicated than this, but what should I look out for? Also, how do I know which methods/classes I have to put @sideonly or @clientside or whatever? Is there a tutorial for that? Thanks a lot guys!

Depending on what your tile entities do, you may need to employ custom packets, but since I'm assuming your single-player tests have worked out fine, you probably don't. If your blocks that use tile entities become desynced between the client and server, you'll need to implement a packet handler and sync data that way.

 

The only real things that need @SideOnly(Side.CLIENT) are GUIs and KeyHandlers. There are probably a couple other things too, but I haven't come across them yet. It's unlikely that you need to worry about it based on what you said, though. If you start up a server and it says that it can't find a class, but it works fine in single-player, you probably need to use SideOnly(SIDE.CLIENT) on that class.

width=336 height=83http://img836.imageshack.us/img836/1237/cooltext624963071.png[/img]

I make games, minecraft mods/plugins, and some graphic art.

 

Current Project: LoECraft - An industrial minecraft server with its own modpack and custom launcher.

Link to comment
Share on other sites

Thank for the replies everyone. My mod adds the basics like blocks, items tools, etc and a few tile entities. I don't have any plans to make it more complicated than this, but what should I look out for? Also, how do I know which methods/classes I have to put @sideonly or @clientside or whatever? Is there a tutorial for that? Thanks a lot guys!

Depending on what your tile entities do, you may need to employ custom packets, but since I'm assuming your single-player tests have worked out fine, you probably don't. If your blocks that use tile entities become desynced between the client and server, you'll need to implement a packet handler and sync data that way.

 

The only real things that need @SideOnly(Side.CLIENT) are GUIs and KeyHandlers. There are probably a couple other things too, but I haven't come across them yet. It's unlikely that you need to worry about it based on what you said, though. If you start up a server and it says that it can't find a class, but it works fine in single-player, you probably need to use SideOnly(SIDE.CLIENT) on that class.

width=336 height=83http://img836.imageshack.us/img836/1237/cooltext624963071.png[/img]

I make games, minecraft mods/plugins, and some graphic art.

 

Current Project: LoECraft - An industrial minecraft server with its own modpack and custom launcher.

Link to comment
Share on other sites

Thank for the replies everyone. My mod adds the basics like blocks, items tools, etc and a few tile entities. I don't have any plans to make it more complicated than this, but what should I look out for? Also, how do I know which methods/classes I have to put @sideonly or @clientside or whatever? Is there a tutorial for that? Thanks a lot guys!

Depending on what your tile entities do, you may need to employ custom packets, but since I'm assuming your single-player tests have worked out fine, you probably don't. If your blocks that use tile entities become desynced between the client and server, you'll need to implement a packet handler and sync data that way.

 

The only real things that need @SideOnly(Side.CLIENT) are GUIs and KeyHandlers. There are probably a couple other things too, but I haven't come across them yet. It's unlikely that you need to worry about it based on what you said, though. If you start up a server and it says that it can't find a class, but it works fine in single-player, you probably need to use SideOnly(SIDE.CLIENT) on that class.

 

I am having an annoying issue with getting mine to work on multiplayer: Heres the error report

 

 

---- Minecraft Crash Report ----
// Don't be sad, have a hug! <3

Time: 4/15/13 11:52 PM
Description: Exception in server tick loop

java.lang.NoClassDefFoundError: net/minecraft/client/gui/GuiScreen
at mods.cc.rock.block.ModBlocks.init(ModBlocks.java:28)
at mods.cc.rock.mod_CookingCraft.load(mod_CookingCraft.java:59)
at cpw.mods.fml.common.modloader.ModLoaderModContainer.init(ModLoaderModContainer.java:537)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:689)
at cpw.mods.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:93)
at cpw.mods.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:357)
at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:140)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:429)
at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:573)
Caused by: java.lang.ClassNotFoundException: net.minecraft.client.gui.GuiScreen
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:211)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 29 more
Caused by: java.lang.NullPointerException
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:200)
... 31 more


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
Minecraft Version: 1.5.1
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_15, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 257796264 bytes (245 MB) / 365953024 bytes (349 MB) up to 1897725952 bytes (1809 MB)
JVM Flags: 0 total; 
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v7.44 FML v5.1.8.611 Minecraft Forge 7.7.1.611 4 mods loaded, 4 mods active
mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
mod_CookingCraft [CookingCraft] (CookingCraft.zip) Unloaded->Constructed->Pre-initialized
Profiler Position: N/A (disabled)
Is Modded: Definitely; Server brand changed to 'fml'
Type: Dedicated Server (map_server.txt)

 

 

The line it traces back to is

basicRefridgerator = new BlockBasicRefridgerator(1104).setCreativeTab(CreativeTabs.tabBlock).setUnlocalizedName("basicRefridgerator").setHardness(2.0F).setResistance(5.0F);

but BlockBasicRefridgerator doesn't use net.minecraft.client.gui.GuiScreen -- in fact NONE of my code does. The thing it does use is net.minecraft.client.gui.inventory.GuiContainer; but the whole GUI class for the refridgerator is SideOnly(Side.CLIENT) I need some help with this.

 

And yes I know I spelt refrigerator wrong -- minor error in the scheme of things.

Link to comment
Share on other sites

Thank for the replies everyone. My mod adds the basics like blocks, items tools, etc and a few tile entities. I don't have any plans to make it more complicated than this, but what should I look out for? Also, how do I know which methods/classes I have to put @sideonly or @clientside or whatever? Is there a tutorial for that? Thanks a lot guys!

Depending on what your tile entities do, you may need to employ custom packets, but since I'm assuming your single-player tests have worked out fine, you probably don't. If your blocks that use tile entities become desynced between the client and server, you'll need to implement a packet handler and sync data that way.

 

The only real things that need @SideOnly(Side.CLIENT) are GUIs and KeyHandlers. There are probably a couple other things too, but I haven't come across them yet. It's unlikely that you need to worry about it based on what you said, though. If you start up a server and it says that it can't find a class, but it works fine in single-player, you probably need to use SideOnly(SIDE.CLIENT) on that class.

 

I am having an annoying issue with getting mine to work on multiplayer: Heres the error report

 

 

---- Minecraft Crash Report ----
// Don't be sad, have a hug! <3

Time: 4/15/13 11:52 PM
Description: Exception in server tick loop

java.lang.NoClassDefFoundError: net/minecraft/client/gui/GuiScreen
at mods.cc.rock.block.ModBlocks.init(ModBlocks.java:28)
at mods.cc.rock.mod_CookingCraft.load(mod_CookingCraft.java:59)
at cpw.mods.fml.common.modloader.ModLoaderModContainer.init(ModLoaderModContainer.java:537)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:689)
at cpw.mods.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:93)
at cpw.mods.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:357)
at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:140)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:429)
at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:573)
Caused by: java.lang.ClassNotFoundException: net.minecraft.client.gui.GuiScreen
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:211)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 29 more
Caused by: java.lang.NullPointerException
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:200)
... 31 more


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
Minecraft Version: 1.5.1
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_15, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 257796264 bytes (245 MB) / 365953024 bytes (349 MB) up to 1897725952 bytes (1809 MB)
JVM Flags: 0 total; 
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v7.44 FML v5.1.8.611 Minecraft Forge 7.7.1.611 4 mods loaded, 4 mods active
mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
mod_CookingCraft [CookingCraft] (CookingCraft.zip) Unloaded->Constructed->Pre-initialized
Profiler Position: N/A (disabled)
Is Modded: Definitely; Server brand changed to 'fml'
Type: Dedicated Server (map_server.txt)

 

 

The line it traces back to is

basicRefridgerator = new BlockBasicRefridgerator(1104).setCreativeTab(CreativeTabs.tabBlock).setUnlocalizedName("basicRefridgerator").setHardness(2.0F).setResistance(5.0F);

but BlockBasicRefridgerator doesn't use net.minecraft.client.gui.GuiScreen -- in fact NONE of my code does. The thing it does use is net.minecraft.client.gui.inventory.GuiContainer; but the whole GUI class for the refridgerator is SideOnly(Side.CLIENT) I need some help with this.

 

And yes I know I spelt refrigerator wrong -- minor error in the scheme of things.

Link to comment
Share on other sites

It makes no sense why the initialization of a Block should cause a gui error. I have a feeling you set your block up wrong. Blocks should only extend Block or BlockContainer, not any gui classes. The only "gui" code a block should really have is player.openGui(). Guis are handled by a gui handler, not the block. I'll need to see your class code. From the looks of it, your frigerator extends ModBlocks? If that's the case, I'll need to see that too.

width=336 height=83http://img836.imageshack.us/img836/1237/cooltext624963071.png[/img]

I make games, minecraft mods/plugins, and some graphic art.

 

Current Project: LoECraft - An industrial minecraft server with its own modpack and custom launcher.

Link to comment
Share on other sites

It makes no sense why the initialization of a Block should cause a gui error. I have a feeling you set your block up wrong. Blocks should only extend Block or BlockContainer, not any gui classes. The only "gui" code a block should really have is player.openGui(). Guis are handled by a gui handler, not the block. I'll need to see your class code. From the looks of it, your frigerator extends ModBlocks? If that's the case, I'll need to see that too.

width=336 height=83http://img836.imageshack.us/img836/1237/cooltext624963071.png[/img]

I make games, minecraft mods/plugins, and some graphic art.

 

Current Project: LoECraft - An industrial minecraft server with its own modpack and custom launcher.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.