From efeeb06b7793c7caada333bea5ddbc90c0111b60 Mon Sep 17 00:00:00 2001 From: Ben Spiers Date: Wed, 18 Mar 2015 21:39:01 +0000 Subject: [PATCH] Move rendering IDs to Common Proxy classes to appease ExtraUtils. --- src/main/java/mekanism/client/ClientProxy.java | 5 ----- src/main/java/mekanism/common/CommonProxy.java | 7 +++++++ src/main/java/mekanism/common/block/BlockBasic.java | 3 +-- src/main/java/mekanism/common/block/BlockMachine.java | 3 +-- src/main/java/mekanism/common/block/BlockPlastic.java | 3 +-- .../mekanism/generators/client/GeneratorsClientProxy.java | 2 -- .../mekanism/generators/common/GeneratorsCommonProxy.java | 3 +++ .../mekanism/generators/common/block/BlockGenerator.java | 3 +-- .../mekanism/generators/common/block/BlockReactor.java | 2 +- 9 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/main/java/mekanism/client/ClientProxy.java b/src/main/java/mekanism/client/ClientProxy.java index 73aa0f4cb..65c035fdb 100644 --- a/src/main/java/mekanism/client/ClientProxy.java +++ b/src/main/java/mekanism/client/ClientProxy.java @@ -197,11 +197,6 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class ClientProxy extends CommonProxy { - public static int MACHINE_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); - public static int BASIC_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); - public static int PLASTIC_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); - public static int CTM_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); - @Override public void loadConfiguration() { diff --git a/src/main/java/mekanism/common/CommonProxy.java b/src/main/java/mekanism/common/CommonProxy.java index d4e6dcbfc..02af36e51 100644 --- a/src/main/java/mekanism/common/CommonProxy.java +++ b/src/main/java/mekanism/common/CommonProxy.java @@ -113,6 +113,7 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; import cpw.mods.fml.common.registry.GameRegistry; @@ -125,6 +126,12 @@ import cpw.mods.fml.relauncher.FMLInjectionData; */ public class CommonProxy { + public static int MACHINE_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); + public static int BASIC_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); + public static int PLASTIC_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); + public static int CTM_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); + + /** * Register tile entities that have special models. Overwritten in client to register TESRs. */ diff --git a/src/main/java/mekanism/common/block/BlockBasic.java b/src/main/java/mekanism/common/block/BlockBasic.java index 9749d8819..645b983ab 100644 --- a/src/main/java/mekanism/common/block/BlockBasic.java +++ b/src/main/java/mekanism/common/block/BlockBasic.java @@ -715,10 +715,9 @@ public class BlockBasic extends Block implements IBlockCTM, ICustomBlockIcon } @Override - @SideOnly(Side.CLIENT) public int getRenderType() { - return ClientProxy.CTM_RENDER_ID; + return Mekanism.proxy.CTM_RENDER_ID; } @Override diff --git a/src/main/java/mekanism/common/block/BlockMachine.java b/src/main/java/mekanism/common/block/BlockMachine.java index c7809c6c7..0a47e0b75 100644 --- a/src/main/java/mekanism/common/block/BlockMachine.java +++ b/src/main/java/mekanism/common/block/BlockMachine.java @@ -752,10 +752,9 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer } @Override - @SideOnly(Side.CLIENT) public int getRenderType() { - return ClientProxy.MACHINE_RENDER_ID; + return Mekanism.proxy.MACHINE_RENDER_ID; } @Override diff --git a/src/main/java/mekanism/common/block/BlockPlastic.java b/src/main/java/mekanism/common/block/BlockPlastic.java index e1c19dbea..3942a9395 100644 --- a/src/main/java/mekanism/common/block/BlockPlastic.java +++ b/src/main/java/mekanism/common/block/BlockPlastic.java @@ -129,9 +129,8 @@ public class BlockPlastic extends Block } @Override - @SideOnly(Side.CLIENT) public int getRenderType() { - return ClientProxy.PLASTIC_RENDER_ID; + return Mekanism.proxy.PLASTIC_RENDER_ID; } } diff --git a/src/main/java/mekanism/generators/client/GeneratorsClientProxy.java b/src/main/java/mekanism/generators/client/GeneratorsClientProxy.java index c6bef7594..0fd3a8560 100644 --- a/src/main/java/mekanism/generators/client/GeneratorsClientProxy.java +++ b/src/main/java/mekanism/generators/client/GeneratorsClientProxy.java @@ -40,8 +40,6 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GeneratorsClientProxy extends GeneratorsCommonProxy { - public static int GENERATOR_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); - @Override public void registerSpecialTileEntities() { diff --git a/src/main/java/mekanism/generators/common/GeneratorsCommonProxy.java b/src/main/java/mekanism/generators/common/GeneratorsCommonProxy.java index 73b45da08..c6ea83c61 100644 --- a/src/main/java/mekanism/generators/common/GeneratorsCommonProxy.java +++ b/src/main/java/mekanism/generators/common/GeneratorsCommonProxy.java @@ -27,6 +27,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.registry.GameRegistry; /** @@ -36,6 +37,8 @@ import cpw.mods.fml.common.registry.GameRegistry; */ public class GeneratorsCommonProxy { + public static int GENERATOR_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); + /** * Register normal tile entities */ diff --git a/src/main/java/mekanism/generators/common/block/BlockGenerator.java b/src/main/java/mekanism/generators/common/block/BlockGenerator.java index fb7f3d8f0..0b843634c 100644 --- a/src/main/java/mekanism/generators/common/block/BlockGenerator.java +++ b/src/main/java/mekanism/generators/common/block/BlockGenerator.java @@ -398,10 +398,9 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IP } @Override - @SideOnly(Side.CLIENT) public int getRenderType() { - return GeneratorsClientProxy.GENERATOR_RENDER_ID; + return MekanismGenerators.proxy.GENERATOR_RENDER_ID; } /*This method is not used, metadata manipulation is required to create a Tile Entity.*/ diff --git a/src/main/java/mekanism/generators/common/block/BlockReactor.java b/src/main/java/mekanism/generators/common/block/BlockReactor.java index 1d92835e8..a5dcfca1a 100644 --- a/src/main/java/mekanism/generators/common/block/BlockReactor.java +++ b/src/main/java/mekanism/generators/common/block/BlockReactor.java @@ -275,7 +275,7 @@ public class BlockReactor extends BlockContainer implements IBlockCTM @Override public int getRenderType() { - return ClientProxy.CTM_RENDER_ID; + return Mekanism.proxy.CTM_RENDER_ID; } @Override