ironbarrels/IronChests2/common/cpw/mods/ironchest/client/IronChestRenderHelper.java

49 lines
1.6 KiB
Java
Raw Normal View History

/*******************************************************************************
* 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
*
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
2012-01-27 22:38:21 +01:00
package cpw.mods.ironchest.client;
2012-08-12 06:38:28 +02:00
import java.util.Map;
2012-12-13 14:02:41 +01:00
import net.minecraft.block.Block;
import net.minecraft.client.renderer.ChestItemRenderHelper;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
2012-08-12 06:38:28 +02:00
import com.google.common.collect.Maps;
2012-08-11 07:46:49 +02:00
import cpw.mods.ironchest.IronChest;
2012-08-12 06:38:28 +02:00
import cpw.mods.ironchest.IronChestType;
import cpw.mods.ironchest.TileEntityIronChest;
2012-01-27 22:38:21 +01:00
public class IronChestRenderHelper extends ChestItemRenderHelper {
private Map<Integer, TileEntityIronChest> itemRenders = Maps.newHashMap();
2012-08-12 06:38:28 +02:00
public IronChestRenderHelper()
{
for (IronChestType typ : IronChestType.values())
{
itemRenders.put(typ.ordinal(), (TileEntityIronChest) IronChest.ironChestBlock.createTileEntity(null, typ.ordinal()));
}
}
@Override
public void renderChest(Block block, int i, float f)
{
if (block == IronChest.ironChestBlock)
{
TileEntityRenderer.instance.renderTileEntityAt(itemRenders.get(i), 0.0D, 0.0D, 0.0D, 0.0F);
}
else
{
super.renderChest(block, i, f);
}
}
2012-01-27 22:38:21 +01:00
}