diff --git a/src/main/java/com/cricketcraft/chisel/api/rendering/ISubmapManager.java b/src/main/java/com/cricketcraft/chisel/api/rendering/ISubmapManager.java index 700bc532..0bd7a468 100644 --- a/src/main/java/com/cricketcraft/chisel/api/rendering/ISubmapManager.java +++ b/src/main/java/com/cricketcraft/chisel/api/rendering/ISubmapManager.java @@ -1,5 +1,7 @@ package com.cricketcraft.chisel.api.rendering; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.texture.IIconRegister; @@ -35,11 +37,15 @@ public interface ISubmapManager { * @param register * The IIconRegister instance. */ + @SideOnly(Side.CLIENT) void registerIcons(String modName, Block block, IIconRegister register); - + + @SideOnly(Side.CLIENT) T createRenderContext(RenderBlocks rendererOld, IBlockAccess world); - + + @SideOnly(Side.CLIENT) void preRenderSide(T renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side); - + + @SideOnly(Side.CLIENT) void postRenderSide(T renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side); } \ No newline at end of file diff --git a/src/main/java/com/cricketcraft/chisel/client/render/SubmapManagerAntiblock.java b/src/main/java/com/cricketcraft/chisel/client/render/SubmapManagerAntiblock.java index fb76e8fc..10ac6759 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/SubmapManagerAntiblock.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/SubmapManagerAntiblock.java @@ -9,9 +9,13 @@ import net.minecraft.world.IBlockAccess; import com.cricketcraft.chisel.api.rendering.RenderBlocksCTM; import com.cricketcraft.chisel.api.rendering.TextureSubmap; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class SubmapManagerAntiblock extends SubmapManagerBase { - private static final RenderBlocksCTM rb = new RenderBlocksCTM() { + @SideOnly(Side.CLIENT) + private static class RenderBlocksCTMFullbright extends RenderBlocksCTM { @Override protected void fillLightmap(int bottomLeft, int bottomRight, int topRight, int topLeft) { @@ -26,11 +30,15 @@ public class SubmapManagerAntiblock extends SubmapManagerBase { } }; + @SideOnly(Side.CLIENT) + private RenderBlocksCTMFullbright rb; + private String color; private TextureSubmap submap, submapSmall; public SubmapManagerAntiblock(String color) { this.color = color; + this.rb = new RenderBlocksCTMFullbright(); } @Override @@ -39,12 +47,14 @@ public class SubmapManagerAntiblock extends SubmapManagerBase { } @Override + @SideOnly(Side.CLIENT) public void registerIcons(String modName, Block block, IIconRegister register) { submap = new TextureSubmap(register.registerIcon(modName + ":antiblock/" + color + "-antiBlock-ctm"), 4, 4); submapSmall = new TextureSubmap(register.registerIcon(modName + ":antiblock/" + color + "-antiBlock"), 2, 2); } @Override + @SideOnly(Side.CLIENT) public RenderBlocksCTM createRenderContext(RenderBlocks rendererOld, IBlockAccess world) { rb.submap = submap; rb.submapSmall = submapSmall; diff --git a/src/main/java/com/cricketcraft/chisel/client/render/SubmapManagerBase.java b/src/main/java/com/cricketcraft/chisel/client/render/SubmapManagerBase.java index cc6ed76f..6e2eaa6c 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/SubmapManagerBase.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/SubmapManagerBase.java @@ -7,6 +7,9 @@ import net.minecraftforge.common.util.ForgeDirection; import com.cricketcraft.chisel.api.rendering.ISubmapManager; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public abstract class SubmapManagerBase implements ISubmapManager { @@ -16,15 +19,18 @@ public abstract class SubmapManagerBase implements ISubm } @Override + @SideOnly(Side.CLIENT) public T createRenderContext(RenderBlocks rendererOld, IBlockAccess world) { return null; } @Override + @SideOnly(Side.CLIENT) public void preRenderSide(T renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) { } @Override + @SideOnly(Side.CLIENT) public void postRenderSide(T renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) { } } diff --git a/src/main/java/com/cricketcraft/chisel/client/render/SubmapManagerCarpetFloor.java b/src/main/java/com/cricketcraft/chisel/client/render/SubmapManagerCarpetFloor.java index 49f7803c..7267a898 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/SubmapManagerCarpetFloor.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/SubmapManagerCarpetFloor.java @@ -9,9 +9,13 @@ import net.minecraft.world.IBlockAccess; import com.cricketcraft.chisel.api.rendering.RenderBlocksCTM; import com.cricketcraft.chisel.api.rendering.TextureSubmap; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class SubmapManagerCarpetFloor extends SubmapManagerBase { - private static RenderBlocksCTM rb = new RenderBlocksCTM(); + @SideOnly(Side.CLIENT) + private RenderBlocksCTM rb; private TextureSubmap submap; private TextureSubmap submapSmall; @@ -19,6 +23,7 @@ public class SubmapManagerCarpetFloor extends SubmapManagerBase public SubmapManagerCarpetFloor(String color) { this.color = color; + this.rb = new RenderBlocksCTM(); } @Override @@ -32,6 +37,7 @@ public class SubmapManagerCarpetFloor extends SubmapManagerBase } @Override + @SideOnly(Side.CLIENT) public void registerIcons(String modName, Block block, IIconRegister register) { String path = modName + ":carpet/" + color; submap = new TextureSubmap(register.registerIcon(path + "-ctm"), 4, 4); @@ -39,6 +45,7 @@ public class SubmapManagerCarpetFloor extends SubmapManagerBase } @Override + @SideOnly(Side.CLIENT) public RenderBlocksCTM createRenderContext(RenderBlocks rendererOld, IBlockAccess world) { rb.renderMaxY = 1f / 16f; rb.submap = submap; diff --git a/src/main/java/com/cricketcraft/chisel/client/render/SubmapManagerFakeController.java b/src/main/java/com/cricketcraft/chisel/client/render/SubmapManagerFakeController.java index 6dec75df..29f4a3ab 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/SubmapManagerFakeController.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/SubmapManagerFakeController.java @@ -10,6 +10,8 @@ import com.cricketcraft.chisel.api.rendering.CTM; import com.cricketcraft.chisel.api.rendering.TextureSubmap; import com.cricketcraft.chisel.init.ChiselBlocks; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import static com.cricketcraft.chisel.api.rendering.Dir.*; public class SubmapManagerFakeController extends SubmapManagerBase { @@ -41,6 +43,7 @@ public class SubmapManagerFakeController extends SubmapManagerBase } @Override + @SideOnly(Side.CLIENT) public void registerIcons(String modName, Block block, IIconRegister register) { map = new TextureSubmap(register.registerIcon(modName + ":futura/WIP/controllerWIP-ctm"), 2, 2); } diff --git a/src/main/java/com/cricketcraft/chisel/client/render/SubmapManagerSlab.java b/src/main/java/com/cricketcraft/chisel/client/render/SubmapManagerSlab.java index e19de84b..990c7f11 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/SubmapManagerSlab.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/SubmapManagerSlab.java @@ -11,9 +11,13 @@ import com.cricketcraft.chisel.api.rendering.ISubmapManager; import com.cricketcraft.chisel.api.rendering.RenderBlocksCTM; import com.cricketcraft.chisel.api.rendering.TextureSubmap; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class SubmapManagerSlab implements ISubmapManager { - private static RenderBlocksCTM rb = new RenderBlocksCTM(); + @SideOnly(Side.CLIENT) + private RenderBlocksCTM rb; private TextureSubmap submap; private TextureSubmap submapSmall; @@ -22,6 +26,7 @@ public class SubmapManagerSlab implements ISubmapManager { public SubmapManagerSlab(String texture) { this.texture = texture; + this.rb = new RenderBlocksCTM(); } @Override @@ -35,6 +40,7 @@ public class SubmapManagerSlab implements ISubmapManager { } @Override + @SideOnly(Side.CLIENT) public void registerIcons(String modName, Block block, IIconRegister register) { String path = modName + ":" + texture; submap = new TextureSubmap(register.registerIcon(path + "-ctm"), 4, 4); @@ -43,6 +49,7 @@ public class SubmapManagerSlab implements ISubmapManager { } @Override + @SideOnly(Side.CLIENT) public RenderBlocksCTM createRenderContext(RenderBlocks rendererOld, IBlockAccess world) { rb.renderMaxY = 1f / 2f; rb.submap = submap; @@ -53,6 +60,7 @@ public class SubmapManagerSlab implements ISubmapManager { private boolean hadOverride = false; @Override + @SideOnly(Side.CLIENT) public void preRenderSide(RenderBlocksCTM renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) { if (side.ordinal() < 2 && !renderer.rendererOld.hasOverrideBlockTexture()) { renderer.rendererOld.setOverrideBlockTexture(sideTexture); @@ -63,6 +71,7 @@ public class SubmapManagerSlab implements ISubmapManager { } @Override + @SideOnly(Side.CLIENT) public void postRenderSide(RenderBlocksCTM renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) { if (!hadOverride) { renderer.rendererOld.clearOverrideBlockTexture();