Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Client side mod not working on server


Stenbergcsgo
 Share

Recommended Posts

I made what I thought was purely client-side: A mod where the player have 3 custom items that can be used as replacement of posting strings to chat. The plugin works fine when using it locally, but when I try to use the mod in a server, I have the items, but using them yields no results at all.

 

An example of one of my item classes:

package com.mta.utzonmod.items;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import com.mta.utzonmod.client.gui.signInputGui;

import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.command.ICommandManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.gui.MinecraftServerGui;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.World;

public class Paste extends ItemBase{ 
    public Paste(String name) {
        
        super(name);
    }
    
    static boolean canPlace = false;
    
    @Override
    public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer player, EnumHand handIn) {
            if(canPlace == true) {
                EntityPlayerSP playerSP = Minecraft.getMinecraft().player;
                playerSP.sendChatMessage("//paste");
                canPlace = false;
                Undo.setCanUndo(true);
            }
        return super.onItemRightClick(worldIn, player, handIn);    
    }
    
    public static void setCanPlace(boolean cPlace) {
        canPlace = cPlace;
    }
}

 

Am I using something that's server sided?
 

Link to comment
Share on other sites

19 minutes ago, diesieben07 said:

The code you posted above is completely broken.

Sponge is not needed, you need a Forge server.

As it's been working fine locally, how can it be completely broken?

 

Edit: Just tried running it on my server and it is indeed absolutely broken - would however like to know why so I can fix it =)

 

Edit2: Added log if it helps in any way.

[11:58:05] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLServerTweaker
[11:58:05] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLServerTweaker
[11:58:05] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLServerTweaker
[11:58:05] [main/INFO] [FML]: Forge Mod Loader version 14.23.3.2655 for Minecraft 1.12.2 loading
[11:58:05] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_131, running on Windows 8.1:amd64:6.3, installed at C:\Program Files\Java\jre1.8.0_131
[11:58:06] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[11:58:06] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[11:58:06] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[11:58:06] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[11:58:06] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[11:58:09] [main/INFO] [FML]: Found valid fingerprint for Minecraft Forge. Certificate fingerprint e3c3d50c7c986df74c645c0ac54639741c90a557
[11:58:09] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[11:58:09] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[11:58:11] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[11:58:11] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[11:58:11] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.server.MinecraftServer}
[11:58:18] [Server thread/INFO] [net.minecraft.server.dedicated.DedicatedServer]: Starting minecraft server version 1.12.2
[11:58:18] [Server thread/INFO] [FML]: MinecraftForge v14.23.3.2655 Initialized
[11:58:18] [Server thread/INFO] [FML]: Starts to replace vanilla recipe ingredients with ore ingredients.
[11:58:18] [Server thread/INFO] [FML]: Replaced 1036 ore ingredients
[11:58:19] [Server thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer
[11:58:19] [Server thread/INFO] [FML]: Searching C:\Users\Frederik\Desktop\Forge server\mods for mods
[11:58:19] [Server thread/INFO] [FML]: Forge Mod Loader has identified 5 mods to load
[11:58:19] [Server thread/WARN] [FML]: Missing English translation for FML: assets/fml/lang/en_us.lang
[11:58:20] [Server thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, um] at CLIENT
[11:58:20] [Server thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, um] at SERVER
[11:58:21] [Server thread/INFO] [FML]: Processing ObjectHolder annotations
[11:58:21] [Server thread/INFO] [FML]: Found 1168 ObjectHolder annotations
[11:58:21] [Server thread/INFO] [FML]: Identifying ItemStackHolder annotations
[11:58:21] [Server thread/INFO] [FML]: Found 0 ItemStackHolder annotations
[11:58:21] [Server thread/INFO] [FML]: Configured a dormant chunk cache size of 0
[11:58:21] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[11:58:21] [Server thread/INFO] [FML]: Applying holder lookups
[11:58:22] [Server thread/INFO] [FML]: Holder lookups applied
[11:58:22] [Server thread/ERROR] [FML]: Exception caught during firing event net.minecraftforge.event.RegistryEvent$Register@67fc26f6:
java.lang.NoClassDefFoundError: com/mta/utzonmod/client/gui/signInputGui
	at com.mta.utzonmod.items.SchematicSign.<init>(SchematicSign.java:21) ~[SchematicSign.class:?]
	at com.mta.utzonmod.init.ModItems.<clinit>(ModItems.java:15) ~[ModItems.class:?]
	at com.mta.utzonmod.util.handlers.RegistryHandler.onItemRegister(RegistryHandler.java:16) ~[RegistryHandler.class:?]
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_5_RegistryHandler_onItemRegister_Register.invoke(.dynamic) ~[?:?]
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?]
	at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:143) ~[EventBus$1.class:?]
	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179) [EventBus.class:?]
	at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:739) [GameData.class:?]
	at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:604) [Loader.class:?]
	at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:98) [FMLServerHandler.class:?]
	at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:332) [FMLCommonHandler.class:?]
	at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:125) [nz.class:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:484) [MinecraftServer.class:?]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
Caused by: java.lang.ClassNotFoundException: com.mta.utzonmod.client.gui.signInputGui
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) ~[launchwrapper-1.12.jar:?]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
	... 14 more
Caused by: net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerException: Exception in class transformer net.minecraftforge.fml.common.asm.transformers.SideTransformer@28a2a3e7 from coremod FMLCorePlugin
	at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:262) ~[forge-1.12.2-14.23.3.2655-universal.jar:?]
	at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) ~[launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ~[launchwrapper-1.12.jar:?]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
	... 14 more
Caused by: java.lang.RuntimeException: Attempted to load class com/mta/utzonmod/client/gui/signInputGui for invalid side SERVER
	at net.minecraftforge.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:62) ~[forge-1.12.2-14.23.3.2655-universal.jar:?]
	at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:258) ~[forge-1.12.2-14.23.3.2655-universal.jar:?]
	at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) ~[launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ~[launchwrapper-1.12.jar:?]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
	... 14 more
[11:58:22] [Server thread/ERROR] [FML]: Index: 2 Listeners:
[11:58:22] [Server thread/ERROR] [FML]: 0: NORMAL
[11:58:22] [Server thread/ERROR] [FML]: 1: net.minecraftforge.fml.common.eventhandler.EventBus$1@26df43d6
[11:58:22] [Server thread/ERROR] [FML]: 2: net.minecraftforge.fml.common.eventhandler.EventBus$1@56679711
[11:58:22] [Server thread/ERROR] [net.minecraft.server.MinecraftServer]: Encountered an unexpected exception
java.lang.NoClassDefFoundError: com/mta/utzonmod/client/gui/signInputGui
	at com.mta.utzonmod.items.SchematicSign.<init>(SchematicSign.java:21) ~[SchematicSign.class:?]
	at com.mta.utzonmod.init.ModItems.<clinit>(ModItems.java:15) ~[ModItems.class:?]
	at com.mta.utzonmod.util.handlers.RegistryHandler.onItemRegister(RegistryHandler.java:16) ~[RegistryHandler.class:?]
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_5_RegistryHandler_onItemRegister_Register.invoke(.dynamic) ~[?:?]
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?]
	at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:143) ~[EventBus$1.class:?]
	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179) ~[EventBus.class:?]
	at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:739) ~[GameData.class:?]
	at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:604) ~[Loader.class:?]
	at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:98) ~[FMLServerHandler.class:?]
	at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:332) ~[FMLCommonHandler.class:?]
	at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:125) ~[nz.class:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:484) [MinecraftServer.class:?]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
Caused by: java.lang.ClassNotFoundException: com.mta.utzonmod.client.gui.signInputGui
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) ~[launchwrapper-1.12.jar:?]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
	... 14 more
Caused by: net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerException: Exception in class transformer net.minecraftforge.fml.common.asm.transformers.SideTransformer@28a2a3e7 from coremod FMLCorePlugin
	at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:262) ~[forge-1.12.2-14.23.3.2655-universal.jar:?]
	at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) ~[launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ~[launchwrapper-1.12.jar:?]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
	... 14 more
Caused by: java.lang.RuntimeException: Attempted to load class com/mta/utzonmod/client/gui/signInputGui for invalid side SERVER
	at net.minecraftforge.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:62) ~[forge-1.12.2-14.23.3.2655-universal.jar:?]
	at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:258) ~[forge-1.12.2-14.23.3.2655-universal.jar:?]
	at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) ~[launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ~[launchwrapper-1.12.jar:?]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
	... 14 more
[11:58:22] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Found status: UP_TO_DATE Target: null
[11:58:22] [Server thread/ERROR] [net.minecraft.server.MinecraftServer]: This crash report has been saved to: C:\Users\Frederik\Desktop\Forge server\.\crash-reports\crash-2018-05-03_11.58.22-server.txt
[11:58:22] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: Stopping server
[11:58:22] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: Saving worlds
[11:58:22] [Server thread/WARN] [FML]: Can't revert to frozen GameData state without freezing first.
[11:58:22] [Server thread/INFO] [FML]: The state engine was in incorrect state INITIALIZATION and forced into state SERVER_STOPPED. Errors may have been discarded.
[11:58:22] [Server Shutdown Thread/INFO] [net.minecraft.server.MinecraftServer]: Stopping server
[11:58:22] [Server Shutdown Thread/INFO] [net.minecraft.server.MinecraftServer]: Saving worlds

 

Edited by Stenbergcsgo
Link to comment
Share on other sites

50 minutes ago, Stenbergcsgo said:

[11:58:22] [Server thread/ERROR] [FML]: Exception caught during firing event net.minecraftforge.event.RegistryEvent$Register@67fc26f6: java.lang.NoClassDefFoundError: com/mta/utzonmod/client/gui/signInputGui

You cannot have any references to any client side classes outside of your ClientProxy on the server, otherwise it will crash, as the server does not know about those classes.

http://mcforge.readthedocs.io/en/latest/concepts/sides/

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
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.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.