Update for minecraft 1.5
|
@ -18,6 +18,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import net.minecraft.block.BlockContainer;
|
import net.minecraft.block.BlockContainer;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLiving;
|
||||||
|
@ -38,6 +39,9 @@ public class BlockIronChest extends BlockContainer {
|
||||||
|
|
||||||
private Random random;
|
private Random random;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private Icon[][] icons;
|
||||||
|
|
||||||
public BlockIronChest(int id)
|
public BlockIronChest(int id)
|
||||||
{
|
{
|
||||||
super(id, Material.iron);
|
super(id, Material.iron);
|
||||||
|
@ -108,21 +112,17 @@ public class BlockIronChest extends BlockContainer {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// @Override
|
@SideOnly(Side.CLIENT)
|
||||||
// public Icon getBlockTextureFromSideAndMetadata(int i, int j)
|
@Override
|
||||||
// {
|
public Icon getBlockTextureFromSideAndMetadata(int i, int j)
|
||||||
// IronChestType typ = IronChestType.values()[j];
|
{
|
||||||
// switch (i)
|
if (j < IronChestType.values().length)
|
||||||
// {
|
{
|
||||||
// case 0:
|
IronChestType type = IronChestType.values()[j];
|
||||||
// case 1:
|
return type.getIcon(i);
|
||||||
// return typ.getTextureRow() * 16 + 1;
|
}
|
||||||
// case 3:
|
return null;
|
||||||
// return typ.getTextureRow() * 16 + 2;
|
}
|
||||||
// default:
|
|
||||||
// return typ.getTextureRow() * 16;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer player, int i1, float f1, float f2, float f3)
|
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer player, int i1, float f1, float f2, float f3)
|
||||||
|
@ -271,4 +271,13 @@ public class BlockIronChest extends BlockContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void func_94332_a(IconRegister par1IconRegister)
|
||||||
|
{
|
||||||
|
for (IronChestType typ: IronChestType.values())
|
||||||
|
{
|
||||||
|
typ.makeIcons(par1IconRegister);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,10 +15,14 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||||
|
|
||||||
public enum IronChestType {
|
public enum IronChestType {
|
||||||
|
@ -47,7 +51,7 @@ public enum IronChestType {
|
||||||
this.rowLength = rowLength;
|
this.rowLength = rowLength;
|
||||||
this.tieredChest = tieredChest;
|
this.tieredChest = tieredChest;
|
||||||
this.friendlyName = friendlyName;
|
this.friendlyName = friendlyName;
|
||||||
this.modelTexture = "/cpw/mods/ironchest/sprites/" + modelTexture;
|
this.modelTexture = "/mods/ironchest/textures/model/" + modelTexture;
|
||||||
this.textureRow = textureRow;
|
this.textureRow = textureRow;
|
||||||
this.clazz = clazz;
|
this.clazz = clazz;
|
||||||
this.recipes = recipes;
|
this.recipes = recipes;
|
||||||
|
@ -199,4 +203,30 @@ public enum IronChestType {
|
||||||
return this == OBSIDIAN;
|
return this == OBSIDIAN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private Icon[] icons;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void makeIcons(IconRegister par1IconRegister)
|
||||||
|
{
|
||||||
|
if (isValidForCreativeMode())
|
||||||
|
{
|
||||||
|
icons = new Icon[3];
|
||||||
|
int i = 0;
|
||||||
|
for (String s : sideNames)
|
||||||
|
{
|
||||||
|
icons[i++] = par1IconRegister.func_94245_a(String.format("ironchest:%s_%s",name().toLowerCase(),s));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public Icon getIcon(int side)
|
||||||
|
{
|
||||||
|
|
||||||
|
return icons[sideMapping[side]];
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String[] sideNames = { "top", "front", "side" };
|
||||||
|
private static int[] sideMapping = { 0, 0, 2, 1, 2, 2, 2 };
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,8 +26,6 @@ public class ClientProxy extends CommonProxy {
|
||||||
public void registerRenderInformation()
|
public void registerRenderInformation()
|
||||||
{
|
{
|
||||||
ChestItemRenderHelper.instance = new IronChestRenderHelper();
|
ChestItemRenderHelper.instance = new IronChestRenderHelper();
|
||||||
MinecraftForgeClient.preloadTexture("/cpw/mods/ironchest/sprites/block_textures.png");
|
|
||||||
MinecraftForgeClient.preloadTexture("/cpw/mods/ironchest/sprites/item_textures.png");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -22,13 +22,13 @@ import cpw.mods.ironchest.TileEntityIronChest;
|
||||||
|
|
||||||
public class GUIChest extends GuiContainer {
|
public class GUIChest extends GuiContainer {
|
||||||
public enum GUI {
|
public enum GUI {
|
||||||
IRON(184, 202, "/cpw/mods/ironchest/sprites/ironcontainer.png", IronChestType.IRON),
|
IRON(184, 202, "/mods/ironchest/textures/gui/ironcontainer.png", IronChestType.IRON),
|
||||||
GOLD(184, 256, "/cpw/mods/ironchest/sprites/goldcontainer.png", IronChestType.GOLD),
|
GOLD(184, 256, "/mods/ironchest/textures/gui/goldcontainer.png", IronChestType.GOLD),
|
||||||
DIAMOND(238, 256, "/cpw/mods/ironchest/sprites/diamondcontainer.png", IronChestType.DIAMOND),
|
DIAMOND(238, 256, "/mods/ironchest/textures/gui/diamondcontainer.png", IronChestType.DIAMOND),
|
||||||
COPPER(184, 184, "/cpw/mods/ironchest/sprites/coppercontainer.png", IronChestType.COPPER),
|
COPPER(184, 184, "/mods/ironchest/textures/gui/coppercontainer.png", IronChestType.COPPER),
|
||||||
SILVER(184, 238, "/cpw/mods/ironchest/sprites/silvercontainer.png", IronChestType.SILVER),
|
SILVER(184, 238, "/mods/ironchest/textures/gui/silvercontainer.png", IronChestType.SILVER),
|
||||||
CRYSTAL(238, 256, "/cpw/mods/ironchest/sprites/diamondcontainer.png", IronChestType.CRYSTAL),
|
CRYSTAL(238, 256, "/mods/ironchest/textures/gui/diamondcontainer.png", IronChestType.CRYSTAL),
|
||||||
OBSIDIAN(238, 256, "/cpw/mods/ironchest/sprites/diamondcontainer.png", IronChestType.OBSIDIAN);
|
OBSIDIAN(238, 256, "/mods/ironchest/textures/gui/diamondcontainer.png", IronChestType.OBSIDIAN);
|
||||||
|
|
||||||
private int xSize;
|
private int xSize;
|
||||||
private int ySize;
|
private int ySize;
|
||||||
|
|
Before Width: | Height: | Size: 679 B After Width: | Height: | Size: 679 B |
Before Width: | Height: | Size: 661 B After Width: | Height: | Size: 661 B |
Before Width: | Height: | Size: 546 B After Width: | Height: | Size: 546 B |
Before Width: | Height: | Size: 396 B After Width: | Height: | Size: 396 B |
Before Width: | Height: | Size: 396 B After Width: | Height: | Size: 396 B |
Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 382 B |
Before Width: | Height: | Size: 762 B After Width: | Height: | Size: 762 B |
Before Width: | Height: | Size: 719 B After Width: | Height: | Size: 719 B |
Before Width: | Height: | Size: 572 B After Width: | Height: | Size: 572 B |
Before Width: | Height: | Size: 784 B After Width: | Height: | Size: 784 B |
Before Width: | Height: | Size: 726 B After Width: | Height: | Size: 726 B |
Before Width: | Height: | Size: 572 B After Width: | Height: | Size: 572 B |
Before Width: | Height: | Size: 787 B After Width: | Height: | Size: 787 B |
Before Width: | Height: | Size: 726 B After Width: | Height: | Size: 726 B |
Before Width: | Height: | Size: 572 B After Width: | Height: | Size: 572 B |
Before Width: | Height: | Size: 748 B After Width: | Height: | Size: 748 B |
Before Width: | Height: | Size: 768 B After Width: | Height: | Size: 768 B |
Before Width: | Height: | Size: 924 B After Width: | Height: | Size: 924 B |
Before Width: | Height: | Size: 625 B After Width: | Height: | Size: 625 B |
Before Width: | Height: | Size: 608 B After Width: | Height: | Size: 608 B |
Before Width: | Height: | Size: 527 B After Width: | Height: | Size: 527 B |