Lothrazar / RootsClassic

Port of Roots 1 originally by Elucent (based on latest public MIT version, with permission from EpicSquid)
MIT License
3 stars 13 forks source link

Calling client code on a server #32

Closed PPAChao closed 3 years ago

PPAChao commented 5 years ago

Minecraft version & Mod Version: 1.12.2 & RootsClassic-1.12.2-1.1.5

Single player or Server: Server

Describe problem (what you were doing / what happened): I attempted to use CraftTweaker2 to change the recipe of a Roots Classic spell. The script I wrote works in singleplayer, but upon attempting to implement it on a server, it failed. According to the logs, one of the mods involved is trying to call client code, rather than server code. Another test script for CraftTweaker2 that did not reference Roots Classic worked fine, so I assume the latter is where the problem lies.

Crash log (if any): Not a crash, but:

[INITIALIZATION][SERVER][ERROR] [crafttweaker]: Error executing {[0:crafttweaker]: shatter.zs}: net/minecraft/client/resources/I18n java.lang.NoClassDefFoundError: net/minecraft/client/resources/I18n at elucent.rootsclassic.component.ComponentRecipe.getLocalizedName(ComponentRecipe.java:24) at elucent.rootsclassic.compat.SpellZen.setSpellItems(SpellZen.java:31) at Shatter.script(shatter.zs:4) at ZenMain.run(Shatter) at crafttweaker.runtime.CrTTweaker.loadScript(CrTTweaker.java:221) at crafttweaker.runtime.CrTTweaker.loadScript(CrTTweaker.java:101) at crafttweaker.mc1120.events.CommonEventHandler.registerRecipes(CommonEventHandler.java:69) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_159_CommonEventHandler_registerRecipes_Register.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:144) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:762) at net.minecraftforge.common.crafting.CraftingHelper.loadRecipes(CraftingHelper.java:623) at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:742) at net.minecraftforge.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:108) at net.minecraftforge.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:338) at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:219) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:486) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: net.minecraft.client.resources.I18n at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 19 more Caused by: java.lang.NullPointerException

(If this is a suggestion and not a bug report, delete all this and just write your suggestion!)