2012-04-25 03:17:23 +02:00
|
|
|
/*******************************************************************************
|
|
|
|
* Copyright (c) 2012 cpw.
|
|
|
|
* All rights reserved. This program and the accompanying materials
|
|
|
|
* are made available under the terms of the GNU Public License v3.0
|
|
|
|
* which accompanies this distribution, and is available at
|
|
|
|
* http://www.gnu.org/licenses/gpl.html
|
2012-08-11 07:46:49 +02:00
|
|
|
*
|
2012-04-25 03:17:23 +02:00
|
|
|
* Contributors:
|
|
|
|
* cpw - initial API and implementation
|
|
|
|
******************************************************************************/
|
2012-01-29 22:12:06 +01:00
|
|
|
package cpw.mods.ironchest.client;
|
|
|
|
|
|
|
|
import net.minecraft.src.ChestItemRenderHelper;
|
2012-10-21 21:12:25 +02:00
|
|
|
import net.minecraft.src.EntityPlayer;
|
|
|
|
import net.minecraft.src.TileEntity;
|
2012-03-29 06:31:46 +02:00
|
|
|
import net.minecraft.src.World;
|
2012-08-11 07:46:49 +02:00
|
|
|
import net.minecraftforge.client.MinecraftForgeClient;
|
|
|
|
import cpw.mods.fml.client.FMLClientHandler;
|
|
|
|
import cpw.mods.fml.client.registry.ClientRegistry;
|
|
|
|
import cpw.mods.ironchest.CommonProxy;
|
2012-01-29 22:12:06 +01:00
|
|
|
import cpw.mods.ironchest.IronChestType;
|
2012-10-21 21:12:25 +02:00
|
|
|
import cpw.mods.ironchest.TileEntityIronChest;
|
2012-01-29 22:12:06 +01:00
|
|
|
|
2012-08-11 07:46:49 +02:00
|
|
|
public class ClientProxy extends CommonProxy {
|
|
|
|
@Override
|
|
|
|
public void registerRenderInformation() {
|
|
|
|
ChestItemRenderHelper.instance = new IronChestRenderHelper();
|
|
|
|
MinecraftForgeClient.preloadTexture("/cpw/mods/ironchest/sprites/block_textures.png");
|
|
|
|
MinecraftForgeClient.preloadTexture("/cpw/mods/ironchest/sprites/item_textures.png");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void registerTileEntitySpecialRenderer(IronChestType typ) {
|
|
|
|
ClientRegistry.bindTileEntitySpecialRenderer(typ.clazz, new TileEntityIronChestRenderer());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public World getClientWorld() {
|
|
|
|
return FMLClientHandler.instance().getClient().theWorld;
|
|
|
|
}
|
2012-10-21 21:12:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
|
|
|
TileEntity te = world.getBlockTileEntity(x, y, z);
|
|
|
|
if (te != null && te instanceof TileEntityIronChest) {
|
|
|
|
return GUIChest.GUI.buildGUI(IronChestType.values()[ID], player.inventory, (TileEntityIronChest) te);
|
|
|
|
} else {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
2012-01-29 22:12:06 +01:00
|
|
|
}
|