summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorbspkrs <bspkrs@gmail.com>2013-12-15 23:17:46 -0500
committerbspkrs <bspkrs@gmail.com>2013-12-15 23:17:46 -0500
commit1f718427162fa59a22c08a32e68e133fb411aa37 (patch)
treee4339d0e1e1b80b1f7a8bb2159e8caafe32c19e6 /common
parentcd270875b6b9b5f26e444a0e683fefa3495e2784 (diff)
moved renderer registry to ClientProxy.java
Diffstat (limited to 'common')
-rw-r--r--common/darkknight/jewelrycraft/CommonProxy.java22
-rw-r--r--common/darkknight/jewelrycraft/JewelrycraftMod.java57
-rw-r--r--common/darkknight/jewelrycraft/block/BlockList.java6
-rw-r--r--common/darkknight/jewelrycraft/client/ClientProxy.java14
4 files changed, 45 insertions, 54 deletions
diff --git a/common/darkknight/jewelrycraft/CommonProxy.java b/common/darkknight/jewelrycraft/CommonProxy.java
index 28ca770..923828a 100644
--- a/common/darkknight/jewelrycraft/CommonProxy.java
+++ b/common/darkknight/jewelrycraft/CommonProxy.java
@@ -1,24 +1,10 @@
package darkknight.jewelrycraft;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.world.World;
-import cpw.mods.fml.common.network.IGuiHandler;
-public class CommonProxy implements IGuiHandler
+public class CommonProxy
{
-
- @Override
- public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
- {
- // TODO Auto-generated method stub
- return null;
+ public void registerRenderers()
+ {
+
}
-
}
diff --git a/common/darkknight/jewelrycraft/JewelrycraftMod.java b/common/darkknight/jewelrycraft/JewelrycraftMod.java
index 2a63509..ae8a229 100644
--- a/common/darkknight/jewelrycraft/JewelrycraftMod.java
+++ b/common/darkknight/jewelrycraft/JewelrycraftMod.java
@@ -33,29 +33,29 @@ import darkknight.jewelrycraft.worldGen.Generation;
@Mod(modid = Reference.MODID, name = Reference.MODNAME, version = Reference.VERSION)
@NetworkMod(clientSideRequired = false, serverSideRequired = false,
-clientPacketHandlerSpec = @SidedPacketHandler(channels = { Reference.PACKET_CHANNEL }, packetHandler = JewelryCraftClient.class),
-serverPacketHandlerSpec = @SidedPacketHandler(channels = { Reference.PACKET_CHANNEL }, packetHandler = JewelryCraftServer.class),
-connectionHandler = JewelrycraftMod.class)
+ clientPacketHandlerSpec = @SidedPacketHandler(channels = { Reference.PACKET_CHANNEL }, packetHandler = JewelryCraftClient.class),
+ serverPacketHandlerSpec = @SidedPacketHandler(channels = { Reference.PACKET_CHANNEL }, packetHandler = JewelryCraftServer.class),
+ connectionHandler = JewelrycraftMod.class)
public class JewelrycraftMod implements IConnectionHandler
{
@Instance(Reference.MODID)
public static JewelrycraftMod instance;
-
+
@Metadata(Reference.MODID)
public static ModMetadata metadata;
-
+
@SidedProxy(clientSide = "darkknight.jewelrycraft.client.ClientProxy", serverSide = "darkknight.jewelrycraft.CommonProxy")
public static CommonProxy proxy;
-
+
public static CreativeTabs jewelrycraft = new CreativeTabs("JewelryCraft")
- {
- @Override
- public ItemStack getIconItemStack()
- {
- return new ItemStack(ItemList.shadowIngot, 1, 0);
- }
- };
-
+ {
+ @Override
+ public ItemStack getIconItemStack()
+ {
+ return new ItemStack(ItemList.shadowIngot, 1, 0);
+ }
+ };
+
@EventHandler
public void preInit(FMLPreInitializationEvent e)
{
@@ -63,8 +63,9 @@ public class JewelrycraftMod implements IConnectionHandler
ItemList.preInit(e);
BlockList.preInit(e);
CraftingRecipes.preInit(e);
+ proxy.registerRenderers();
}
-
+
@EventHandler
public void init(FMLInitializationEvent e)
{
@@ -72,52 +73,52 @@ public class JewelrycraftMod implements IConnectionHandler
OreDictionary.registerOre("oreShadow", new ItemStack(BlockList.shadowOre));
GameRegistry.registerWorldGenerator(new Generation());
}
-
+
@EventHandler
public void postInit(FMLPostInitializationEvent e)
{
-
+
}
-
+
@Override
// 2) Called when a player logs into the server SERVER SIDE
public void playerLoggedIn(Player player, NetHandler netHandler, INetworkManager manager)
{
-
+
}
-
+
@Override
// If you don't want the connection to continue, return a non-empty string here SERVER SIDE
public String connectionReceived(NetLoginHandler netHandler, INetworkManager manager)
{
return null;
}
-
+
@Override
// 1) Fired when a remote connection is opened CLIENT SIDE
public void connectionOpened(NetHandler netClientHandler, String server, int port, INetworkManager manager)
{
-
+
}
-
+
@Override
// 1) Fired when a local connection is opened CLIENT SIDE
public void connectionOpened(NetHandler netClientHandler, MinecraftServer server, INetworkManager manager)
{
-
+
}
-
+
@Override
// Fired when a connection closes ALL SIDES
public void connectionClosed(INetworkManager manager)
{
-
+
}
-
+
@Override
// 3) Fired when the client established the connection to the server CLIENT SIDE
public void clientLoggedIn(NetHandler clientHandler, INetworkManager manager, Packet1Login login)
{
-
+
}
}
diff --git a/common/darkknight/jewelrycraft/block/BlockList.java b/common/darkknight/jewelrycraft/block/BlockList.java
index f783d84..a1dc3a1 100644
--- a/common/darkknight/jewelrycraft/block/BlockList.java
+++ b/common/darkknight/jewelrycraft/block/BlockList.java
@@ -2,13 +2,10 @@ package darkknight.jewelrycraft.block;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
-import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import darkknight.jewelrycraft.JewelrycraftMod;
import darkknight.jewelrycraft.config.ConfigHandler;
-import darkknight.jewelrycraft.renders.TileEntityMolderRender;
-import darkknight.jewelrycraft.renders.TileEntitySmelterRender;
import darkknight.jewelrycraft.tileentity.TileEntityMolder;
import darkknight.jewelrycraft.tileentity.TileEntitySmelter;
@@ -37,9 +34,6 @@ public class BlockList
GameRegistry.registerTileEntity(TileEntitySmelter.class, "30");
GameRegistry.registerTileEntity(TileEntityMolder.class, "31");
-
- ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmelter.class, new TileEntitySmelterRender());
- ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMolder.class, new TileEntityMolderRender());
}
}
}
diff --git a/common/darkknight/jewelrycraft/client/ClientProxy.java b/common/darkknight/jewelrycraft/client/ClientProxy.java
index e280402..fc19fff 100644
--- a/common/darkknight/jewelrycraft/client/ClientProxy.java
+++ b/common/darkknight/jewelrycraft/client/ClientProxy.java
@@ -1,8 +1,18 @@
package darkknight.jewelrycraft.client;
+import cpw.mods.fml.client.registry.ClientRegistry;
import darkknight.jewelrycraft.CommonProxy;
+import darkknight.jewelrycraft.renders.TileEntityMolderRender;
+import darkknight.jewelrycraft.renders.TileEntitySmelterRender;
+import darkknight.jewelrycraft.tileentity.TileEntityMolder;
+import darkknight.jewelrycraft.tileentity.TileEntitySmelter;
public class ClientProxy extends CommonProxy
-{
-
+{
+ @Override
+ public void registerRenderers()
+ {
+ ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmelter.class, new TileEntitySmelterRender());
+ ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMolder.class, new TileEntityMolderRender());
+ }
}