Update for 1.5 texturing changes
|
@ -41,7 +41,7 @@ public class BlockIronChest extends BlockContainer {
|
||||||
public BlockIronChest(int id)
|
public BlockIronChest(int id)
|
||||||
{
|
{
|
||||||
super(id, Material.iron);
|
super(id, Material.iron);
|
||||||
setBlockName("IronChest");
|
setUnlocalizedName("IronChest");
|
||||||
setHardness(3.0F);
|
setHardness(3.0F);
|
||||||
setBlockBounds(0.0625F, 0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
|
setBlockBounds(0.0625F, 0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
|
||||||
random = new Random();
|
random = new Random();
|
||||||
|
@ -79,7 +79,7 @@ public class BlockIronChest extends BlockContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int metadata)
|
public TileEntity createTileEntity(World world, int metadata)
|
||||||
{
|
{
|
||||||
return IronChestType.makeEntity(metadata);
|
return IronChestType.makeEntity(metadata);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package cpw.mods.ironchest;
|
package cpw.mods.ironchest;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
@ -18,6 +19,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.tileentity.TileEntityChest;
|
import net.minecraft.tileentity.TileEntityChest;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ItemChestChanger extends Item {
|
public class ItemChestChanger extends Item {
|
||||||
|
|
||||||
|
@ -28,10 +31,17 @@ public class ItemChestChanger extends Item {
|
||||||
super(id);
|
super(id);
|
||||||
setMaxStackSize(1);
|
setMaxStackSize(1);
|
||||||
this.type = type;
|
this.type = type;
|
||||||
setItemName(type.itemName);
|
setUnlocalizedName(type.itemName);
|
||||||
setCreativeTab(CreativeTabs.tabMisc);
|
setCreativeTab(CreativeTabs.tabMisc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void func_94581_a(IconRegister par1IconRegister)
|
||||||
|
{
|
||||||
|
this.iconIndex = par1IconRegister.func_94245_a("ironchest:"+type.itemName);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int X, int Y, int Z, int side, float hitX, float hitY, float hitZ)
|
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int X, int Y, int Z, int side, float hitX, float hitY, float hitZ)
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class ItemIronChest extends ItemBlock {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getItemNameIS(ItemStack itemstack)
|
public String getUnlocalizedName(ItemStack itemstack)
|
||||||
{
|
{
|
||||||
return IronChestType.values()[itemstack.getItemDamage()].name();
|
return IronChestType.values()[itemstack.getItemDamage()].name();
|
||||||
}
|
}
|
||||||
|
|
|
@ -314,7 +314,7 @@ public class TileEntityIronChest extends TileEntity implements IInventory {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receiveClientEvent(int i, int j)
|
public boolean receiveClientEvent(int i, int j)
|
||||||
{
|
{
|
||||||
if (i == 1)
|
if (i == 1)
|
||||||
{
|
{
|
||||||
|
@ -329,6 +329,7 @@ public class TileEntityIronChest extends TileEntity implements IInventory {
|
||||||
facing = (byte) (j & 0x7);
|
facing = (byte) (j & 0x7);
|
||||||
numUsingPlayers = (j & 0xF8) >> 3;
|
numUsingPlayers = (j & 0xF8) >> 3;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -73,9 +73,9 @@ public class GUIChest extends GuiContainer {
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float f, int i, int j)
|
protected void drawGuiContainerBackgroundLayer(float f, int i, int j)
|
||||||
{
|
{
|
||||||
int tex = mc.renderEngine.getTexture(type.guiTexture);
|
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
mc.renderEngine.bindTexture(tex);
|
// new "bind tex"
|
||||||
|
mc.renderEngine.func_98187_b(type.guiTexture);
|
||||||
int x = (width - xSize) / 2;
|
int x = (width - xSize) / 2;
|
||||||
int y = (height - ySize) / 2;
|
int y = (height - ySize) / 2;
|
||||||
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
|
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
|
||||||
|
|
|
@ -168,7 +168,7 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer {
|
||||||
glTranslatef(shiftX, shiftY, shiftZ);
|
glTranslatef(shiftX, shiftY, shiftZ);
|
||||||
glRotatef(timeD, 0.0F, 1.0F, 0.0F);
|
glRotatef(timeD, 0.0F, 1.0F, 0.0F);
|
||||||
glScalef(blockScale, blockScale, blockScale);
|
glScalef(blockScale, blockScale, blockScale);
|
||||||
customitem.func_92058_a(item);
|
customitem.setEntityItemStack(item);
|
||||||
itemRenderer.doRenderItem(customitem, 0, 0, 0, 0, 0);
|
itemRenderer.doRenderItem(customitem, 0, 0, 0, 0, 0);
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
After Width: | Height: | Size: 480 B |
After Width: | Height: | Size: 480 B |
After Width: | Height: | Size: 418 B |
After Width: | Height: | Size: 466 B |
After Width: | Height: | Size: 480 B |
After Width: | Height: | Size: 526 B |
After Width: | Height: | Size: 526 B |
After Width: | Height: | Size: 480 B |
After Width: | Height: | Size: 480 B |