orangeadam3 / terra121

A Minecraft Terrain Generating Mod for Cubic Chunks 1.12.2. attempting to generate real terrain, biomes, and features on a 1:1 scale
MIT License
282 stars 40 forks source link

Localization in command classes #151

Open SmylerMC opened 4 years ago

SmylerMC commented 4 years ago

The TerraCommand class imports I18n, which is not present on the dedicated server. This prevents /terra from working on dedicated servers. Translation needs to be done on the client, or not at all.

Console output when running /terra on a dedicated server:



[16:45:26] [Server thread/WARN] [net.minecraft.command.CommandHandler]: Couldn't process command: terra
java.lang.NoClassDefFoundError: net/minecraft/client/resources/I18n

    at io.github.terra121.control.TerraCommand.func_184881_a(TerraCommand.java:67) ~[TerraCommand.class:?]

    at net.minecraft.command.CommandHandler.func_175786_a(CommandHandler.java:123) ~[bj.class:?]

    at net.minecraft.command.CommandHandler.func_71556_a(CommandHandler.java:95) ~[bj.class:?]

    at org.bukkit.craftbukkit.v1_12_R1.command.CraftSimpleCommandMap.dispatch(CraftSimpleCommandMap.java:48) ~[CraftSimpleCommandMap.class:1.12.2-c950429]

    at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchVanillaCommand(CraftServer.java:765) ~[CraftServer.class:1.12.2-c950429]

    at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:760) ~[CraftServer.class:1.12.2-c950429]

    at net.minecraft.network.NetHandlerPlayServer.func_147361_d(NetHandlerPlayServer.java:1589) ~[pa.class:?]

    at net.minecraft.network.NetHandlerPlayServer.func_147354_a(NetHandlerPlayServer.java:1428) ~[pa.class:?]

    at net.minecraft.network.play.client.CPacketChatMessage.func_148833_a(CPacketChatMessage.java:46) ~[la.class:?]

    at net.minecraft.network.play.client.CPacketChatMessage.func_148833_a(CPacketChatMessage.java:9) ~[la.class:?]

    at net.minecraft.network.PacketThreadUtil.lambda$checkThreadAndEnqueue$0(PacketThreadUtil.java:16) ~[hv.class:?]

    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_251]

    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_251]

    at net.minecraft.util.Util.func_181617_a(SourceFile:46) [h.class:?]

    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:843) [MinecraftServer.class:?]

    at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:471) [nz.class:?]

    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:781) [MinecraftServer.class:?]

    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:627) [MinecraftServer.class:?]

    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_251]

Caused by: java.lang.ClassNotFoundException: net.minecraft.client.resources.I18n

    at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) ~[launchwrapper-1.12.jar:?]

    at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[?:1.8.0_251]

    at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_251]

    ... 19 more

Caused by: java.lang.NullPointerException```

Note this is a Mohist Forge/Bukkit hybrid server, but it shouldn't change anything. Localization should never been done on the server.