Calculator

Calculator

6M Downloads

[1.10] Serverside trying to reference net.minecraft.client.Minecraft via RenderHelper

pobiega opened this issue ยท 2 comments

commented

Full log: http://pastebin.com/6XaFz2nL

Server crash.

Relevant lines:

java.lang.NoClassDefFoundError: net/minecraft/client/Minecraft
    at sonar.core.helpers.RenderHelper.<clinit>(RenderHelper.java:30)
    at sonar.calculator.mod.common.tileentity.TileEntityGreenhouse.func_73660_a(TileEntityGreenhouse.java:78)
    at sonar.calculator.mod.common.tileentity.TileEntityBuildingGreenhouse.func_73660_a(TileEntityBuildingGreenhouse.java:54)
    at sonar.calculator.mod.common.tileentity.machines.TileEntityAdvancedGreenhouse.func_73660_a(TileEntityAdvancedGreenhouse.java:45)

The problem is that TileEntityGreenhouse, while running on the server, is using RenderHelper, a class that depends on being clientside. The method it uses is

horizontal = RenderHelper.getHorizontal(forward);

Since this method only shifts the direction and doesn't need any clientside information, simply moving it to a helper class that does not import anything from net.minecraft.client should solve this problem.

commented

Whoops, meant to be using the one in SonarHelper. Thanks for doing my job for me :)
Got some double methods going on

commented

Just posted the fix :)