diff --git a/18 Mappings.txt b/18 Mappings.txt deleted file mode 100644 index c22f2840..00000000 --- a/18 Mappings.txt +++ /dev/null @@ -1,52 +0,0 @@ -—MAPPINGS NOW IN MCPBOT— - -—————————— -FIXES -—————————— -—GameData— - - private int registerBlock(Block block, String name, int idHint) - { - // handle ItemBlock-before-Block registrations - ItemBlock itemBlock = null; - - for (Item item : iItemRegistry.typeSafeIterable()) // find matching ItemBlock - { - if (item instanceof ItemBlock && ((ItemBlock) item).blockInstance == block) - { - itemBlock = (ItemBlock) item; - break; - } - } - - if (itemBlock != null) // has ItemBlock, adjust id and clear the slot already occupied by the corresponding item - { - idHint = iItemRegistry.getId(itemBlock); - FMLLog.fine("Found matching ItemBlock %s for Block %s at id %d", itemBlock, block, idHint); - freeSlot(idHint, block); // temporarily free the slot occupied by the Item for the block registration - } - - // add - int blockId = iBlockRegistry.add(idHint, name, block, availabilityMap); - - if (itemBlock != null) // verify - { - if (blockId != idHint) throw new IllegalStateException(String.format("Block at itemblock id %d insertion failed, got id %d.", idHint, blockId)); - verifyItemBlockName(itemBlock); - } - - //Hackery added by me which probably shouldn't be done - Iterator iterator1 = block.getBlockState().getValidStates().iterator(); - - while (iterator1.hasNext()) - { - IBlockState iblockstate = (IBlockState)iterator1.next(); - int i = blockRegistry.getIDForObject(block) << 4 | block.getMetaFromBlockState(iblockstate); - Block.field_176229_d.func_148746_a(iblockstate, i); - } - //End hackery - - useSlot(blockId); - ((RegistryDelegate.Delegate) block.delegate).setName(name); - return blockId; - } \ No newline at end of file diff --git a/src/main/java/cpw/mods/ironchest/BlockIronChest.java b/src/main/java/cpw/mods/ironchest/BlockIronChest.java index d9cdeb52..a34cf1c7 100755 --- a/src/main/java/cpw/mods/ironchest/BlockIronChest.java +++ b/src/main/java/cpw/mods/ironchest/BlockIronChest.java @@ -49,9 +49,9 @@ public class BlockIronChest extends BlockContainer public BlockIronChest() { super(Material.iron); - + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT_PROP, IronChestType.IRON)); - + this.setBlockBounds(0.0625F, 0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); this.setHardness(3.0F); this.setUnlocalizedName("IronChest"); @@ -69,13 +69,7 @@ public boolean isFullCube() { return false; } - - @Override - public int getRenderType() - { - return 2; - } - + @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState blockState, EntityPlayer player, EnumFacing direction, float p_180639_6_, float p_180639_7_, float p_180639_8_) { @@ -99,13 +93,13 @@ public boolean onBlockActivated(World world, BlockPos pos, IBlockState blockStat player.openGui(IronChest.instance, ((TileEntityIronChest) te).getType().ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); return true; } - + @Override public TileEntity createNewTileEntity(World world, int metadata) { return IronChestType.makeEntity(metadata); } - + @Override @SideOnly(Side.CLIENT) public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) @@ -118,7 +112,7 @@ public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) } } } - + @Override public IBlockState getStateFromMeta(int meta) { @@ -128,9 +122,9 @@ public IBlockState getStateFromMeta(int meta) @Override public int getMetaFromState(IBlockState blockState) { - return ((IronChestType)blockState.getValue(VARIANT_PROP)).ordinal(); + return ((IronChestType) blockState.getValue(VARIANT_PROP)).ordinal(); } - + @Override protected BlockState createBlockState() { @@ -141,7 +135,7 @@ protected BlockState createBlockState() public ArrayList getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { ArrayList items = Lists.newArrayList(); - ItemStack stack = new ItemStack(this,1,getMetaFromState(state)); + ItemStack stack = new ItemStack(this, 1, getMetaFromState(state)); IronChestType.values()[IronChestType.validateMeta(getMetaFromState(state))].adornItemDrop(stack); items.add(stack); return items; @@ -158,7 +152,7 @@ public void onBlockAdded(World world, BlockPos pos, IBlockState blockState) public void onBlockPlacedBy(World world, BlockPos pos, IBlockState blockState, EntityLivingBase entityliving, ItemStack itemStack) { byte chestFacing = 0; - int facing = MathHelper.floor_double((double) ((entityliving.rotationYaw * 4F) / 360F) + 0.5D) & 3; + int facing = MathHelper.floor_double((entityliving.rotationYaw * 4F) / 360F + 0.5D) & 3; if (facing == 0) { chestFacing = 2; @@ -188,7 +182,7 @@ public void onBlockPlacedBy(World world, BlockPos pos, IBlockState blockState, E @Override public int damageDropped(IBlockState state) { - return IronChestType.validateMeta(((IronChestType)state.getValue(VARIANT_PROP)).ordinal()); + return IronChestType.validateMeta(((IronChestType) state.getValue(VARIANT_PROP)).ordinal()); } @Override @@ -206,7 +200,7 @@ public void breakBlock(World world, BlockPos pos, IBlockState blockState) public void dropContent(int newSize, IInventory chest, World world, BlockPos pos) { Random random = world.rand; - + for (int l = newSize; l < chest.getSizeInventory(); l++) { ItemStack itemstack = chest.getStackInSlot(l); @@ -225,8 +219,7 @@ public void dropContent(int newSize, IInventory chest, World world, BlockPos pos i1 = itemstack.stackSize; } itemstack.stackSize -= i1; - EntityItem entityitem = new EntityItem(world, (float) pos.getX() + f, (float) pos.getY() + (newSize > 0 ? 1 : 0) + f1, (float) pos.getZ() + f2, - new ItemStack(itemstack.getItem(), i1, itemstack.getMetadata())); + EntityItem entityitem = new EntityItem(world, pos.getX() + f, (float) pos.getY() + (newSize > 0 ? 1 : 0) + f1, pos.getZ() + f2, new ItemStack(itemstack.getItem(), i1, itemstack.getMetadata())); float f3 = 0.05F; entityitem.motionX = (float) random.nextGaussian() * f3; entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F; @@ -243,20 +236,21 @@ public void dropContent(int newSize, IInventory chest, World world, BlockPos pos @Override public float getExplosionResistance(World world, BlockPos pos, Entity exploder, Explosion explosion) { - TileEntity te = world.getTileEntity(pos); - if (te instanceof TileEntityIronChest) - { - TileEntityIronChest teic = (TileEntityIronChest) te; - if (teic.getType().isExplosionResistant()) - { - return 10000F; - } - } - return super.getExplosionResistance(world, pos, exploder, explosion); + TileEntity te = world.getTileEntity(pos); + if (te instanceof TileEntityIronChest) + { + TileEntityIronChest teic = (TileEntityIronChest) te; + if (teic.getType().isExplosionResistant()) + { + return 10000F; + } + } + return super.getExplosionResistance(world, pos, exploder, explosion); } @Override - public boolean hasComparatorInputOverride() { + public boolean hasComparatorInputOverride() + { return true; } @@ -266,12 +260,13 @@ public int getComparatorInputOverride(World world, BlockPos pos) TileEntity te = world.getTileEntity(pos); if (te instanceof IInventory) { - return Container.calcRedstoneFromInventory((IInventory)te); + return Container.calcRedstoneFromInventory((IInventory) te); } return 0; } private static final EnumFacing[] validRotationAxes = new EnumFacing[] { EnumFacing.UP, EnumFacing.DOWN }; + @Override public EnumFacing[] getValidRotations(World worldObj, BlockPos pos) { @@ -288,7 +283,8 @@ public boolean rotateBlock(World worldObj, BlockPos pos, EnumFacing axis) if (axis == EnumFacing.UP || axis == EnumFacing.DOWN) { TileEntity tileEntity = worldObj.getTileEntity(pos); - if (tileEntity instanceof TileEntityIronChest) { + if (tileEntity instanceof TileEntityIronChest) + { TileEntityIronChest icte = (TileEntityIronChest) tileEntity; icte.rotateAround(); } diff --git a/src/main/java/cpw/mods/ironchest/IronChest.java b/src/main/java/cpw/mods/ironchest/IronChest.java index 6ecfe739..cf6cf97a 100755 --- a/src/main/java/cpw/mods/ironchest/IronChest.java +++ b/src/main/java/cpw/mods/ironchest/IronChest.java @@ -10,8 +10,6 @@ ******************************************************************************/ package cpw.mods.ironchest; -import net.minecraft.client.Minecraft; -import net.minecraft.init.Blocks; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; @@ -21,12 +19,9 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.registry.GameRegistry; -import net.minecraftforge.oredict.OreDictionary; -import net.minecraftforge.fml.common.FMLCommonHandler; -import net.minecraftforge.fml.relauncher.Side; @Mod(modid = "IronChest", name = "Iron Chests", dependencies = "required-after:FML@[7.2,)") -public class IronChest +public class IronChest { public static BlockIronChest ironChestBlock; @SidedProxy(clientSide = "cpw.mods.ironchest.client.ClientProxy", serverSide = "cpw.mods.ironchest.CommonProxy") @@ -39,27 +34,22 @@ public void preInit(FMLPreInitializationEvent event) { Version.init(event.getVersionProperties()); event.getModMetadata().version = Version.fullVersionString(); - - PacketHandler.INSTANCE.ordinal(); } @EventHandler public void load(FMLInitializationEvent evt) { - //Registration has been moved to init to account for the registration of inventory models - //Minecraft.getRenderItem() returns null before this stage + // Registration has been moved to init to account for the registration of inventory models + // Minecraft.getRenderItem() returns null before this stage ChestChangerType.buildItems(); ironChestBlock = new BlockIronChest(); - RegistryHelper.registerBlock(ironChestBlock, ItemIronChest.class, "BlockIronChest"); - - if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getModelManager().getBlockModelShapes().registerBuiltInBlocks(ironChestBlock); - + GameRegistry.registerBlock(ironChestBlock, ItemIronChest.class, "BlockIronChest"); + for (IronChestType typ : IronChestType.values()) { GameRegistry.registerTileEntityWithAlternatives(typ.clazz, "IronChest." + typ.name(), typ.name()); proxy.registerTileEntitySpecialRenderer(typ); } - OreDictionary.registerOre("chestWood", Blocks.chest); IronChestType.registerBlocksAndRecipes(ironChestBlock); ChestChangerType.generateRecipes(); NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy); diff --git a/src/main/java/cpw/mods/ironchest/MappableItemStackWrapper.java b/src/main/java/cpw/mods/ironchest/MappableItemStackWrapper.java deleted file mode 100755 index 95a8a408..00000000 --- a/src/main/java/cpw/mods/ironchest/MappableItemStackWrapper.java +++ /dev/null @@ -1,33 +0,0 @@ -package cpw.mods.ironchest; - -import net.minecraft.item.ItemStack; - -public class MappableItemStackWrapper { - private ItemStack wrap; - - public MappableItemStackWrapper(ItemStack toWrap) - { - wrap = toWrap; - } - - @Override - public boolean equals(Object obj) - { - if (!(obj instanceof MappableItemStackWrapper)) return false; - MappableItemStackWrapper isw = (MappableItemStackWrapper) obj; - if (wrap.getHasSubtypes()) - { - return isw.wrap.isItemEqual(wrap); - } - else - { - return isw.wrap == wrap; - } - } - - @Override - public int hashCode() - { - return System.identityHashCode(wrap); - } -} diff --git a/src/main/java/cpw/mods/ironchest/PacketHandler.java b/src/main/java/cpw/mods/ironchest/PacketHandler.java deleted file mode 100755 index da04a4d8..00000000 --- a/src/main/java/cpw/mods/ironchest/PacketHandler.java +++ /dev/null @@ -1,203 +0,0 @@ -/******************************************************************************* - * 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 - * - * Contributors: - * cpw - initial API and implementation - ******************************************************************************/ -package cpw.mods.ironchest; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.SimpleChannelInboundHandler; - -import java.util.EnumMap; - -import net.minecraft.item.ItemStack; -import net.minecraft.network.Packet; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.fml.common.FMLCommonHandler; -import net.minecraftforge.fml.common.network.ByteBufUtils; -import net.minecraftforge.fml.common.network.FMLEmbeddedChannel; -import net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec; -import net.minecraftforge.fml.common.network.NetworkRegistry; -import net.minecraftforge.fml.common.network.internal.FMLProxyPacket; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -/** - * Handles the packet wrangling for IronChest - * @author cpw - * - */ -public enum PacketHandler { - INSTANCE; - - /** - * Our channel "pair" from {@link NetworkRegistry} - */ - private EnumMap channels; - - /** - * Make our packet handler, and add an {@link IronChestCodec} always - */ - private PacketHandler() - { - // request a channel pair for IronChest from the network registry - // Add the IronChestCodec as a member of both channel pipelines - this.channels = NetworkRegistry.INSTANCE.newChannel("IronChest", new IronChestCodec()); - if (FMLCommonHandler.instance().getSide() == Side.CLIENT) - { - addClientHandler(); - } - } - - /** - * This is only called on the client side - it adds an - * {@link IronChestMessageHandler} to the client side pipeline, since the - * only place we expect to handle messages is on the client. - */ - @SideOnly(Side.CLIENT) - private void addClientHandler() { - FMLEmbeddedChannel clientChannel = this.channels.get(Side.CLIENT); - // These two lines find the existing codec (Ironchestcodec) and insert our message handler after it - // in the pipeline - String codec = clientChannel.findChannelHandlerNameForType(IronChestCodec.class); - clientChannel.pipeline().addAfter(codec, "ClientHandler", new IronChestMessageHandler()); - } - - /** - * This class simply handles the {@link IronChestMessage} when it's received - * at the client side It can contain client only code, because it's only run - * on the client. - * - * @author cpw - * - */ - private static class IronChestMessageHandler extends SimpleChannelInboundHandler - { - @Override - protected void channelRead0(ChannelHandlerContext ctx, IronChestMessage msg) throws Exception - { - World world = IronChest.proxy.getClientWorld(); - TileEntity te = world.getTileEntity(new BlockPos(msg.x, msg.y, msg.z)); - if (te instanceof TileEntityIronChest) - { - TileEntityIronChest icte = (TileEntityIronChest) te; - icte.setFacing(msg.facing); - icte.handlePacketData(msg.type, msg.itemStacks); - } - } - } - - /** - * This is our "message". In fact, {@link FMLIndexedMessageToMessageCodec} - * can handle many messages on the same channel at once, using a - * discriminator byte. But for IronChest, we only need the one message, so - * we have just this. - * - * @author cpw - * - */ - public static class IronChestMessage - { - int x; - int y; - int z; - int type; - int facing; - ItemStack[] itemStacks; - } - - /** - * This is the codec that automatically transforms the - * {@link FMLProxyPacket} which wraps the client and server custom payload - * packets into a message we care about. - * - * @author cpw - * - */ - private class IronChestCodec extends FMLIndexedMessageToMessageCodec - { - /** - * We register our discriminator bytes here. We only have the one type, so we only - * register one. - */ - public IronChestCodec() - { - addDiscriminator(0, IronChestMessage.class); - } - @Override - public void encodeInto(ChannelHandlerContext ctx, IronChestMessage msg, ByteBuf target) throws Exception - { - target.writeInt(msg.x); - target.writeInt(msg.y); - target.writeInt(msg.z); - int typeAndFacing = ((msg.type & 0x0F) | ((msg.facing & 0x0F) << 4)) & 0xFF; - target.writeByte(typeAndFacing); - target.writeBoolean(msg.itemStacks != null); - if (msg.itemStacks != null) - { - for (ItemStack i: msg.itemStacks) - { - ByteBufUtils.writeItemStack(target, i); - } - } - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf dat, IronChestMessage msg) - { - msg.x = dat.readInt(); - msg.y = dat.readInt(); - msg.z = dat.readInt(); - int typDat = dat.readByte(); - msg.type = (byte)(typDat & 0xf); - msg.facing = (byte)((typDat >> 4) & 0xf); - boolean hasStacks = dat.readBoolean(); - msg.itemStacks = new ItemStack[0]; - if (hasStacks) - { - msg.itemStacks = new ItemStack[8]; - for (int i = 0; i < msg.itemStacks.length; i++) - { - msg.itemStacks[i] = ByteBufUtils.readItemStack(dat); - } - } - } - - } - - /** - * This is a utility method called to transform a packet from a custom - * packet into a "system packet". We're called from - * {@link TileEntity#getDescriptionPacket()} in this case, but there are - * others. All network packet methods in minecraft have been adapted to - * handle {@link FMLProxyPacket} but general purpose objects can't be - * handled sadly. - * - * This method uses the {@link IronChestCodec} to transform a custom packet - * {@link IronChestMessage} into an {@link FMLProxyPacket} by using the - * utility method {@link FMLEmbeddedChannel#generatePacketFrom(Object)} on - * the channel to do exactly that. - * - * @param tileEntityIronChest - * @return - */ - public static Packet getPacket(TileEntityIronChest tileEntityIronChest) - { - IronChestMessage msg = new IronChestMessage(); - msg.x = tileEntityIronChest.getPos().getX(); - msg.y = tileEntityIronChest.getPos().getY(); - msg.z = tileEntityIronChest.getPos().getZ(); - msg.type = tileEntityIronChest.getType().ordinal(); - msg.facing = tileEntityIronChest.getFacing(); - msg.itemStacks = tileEntityIronChest.buildItemStackDataList(); - return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); - } -} diff --git a/src/main/java/cpw/mods/ironchest/RegistryHelper.java b/src/main/java/cpw/mods/ironchest/RegistryHelper.java deleted file mode 100644 index 770f6081..00000000 --- a/src/main/java/cpw/mods/ironchest/RegistryHelper.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * 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 - * - * Contributors: - * cpw - initial API and implementation - ******************************************************************************/ -package cpw.mods.ironchest; - -import java.util.Iterator; - -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.item.ItemBlock; -import net.minecraftforge.fml.common.registry.GameRegistry; - - -public class RegistryHelper -{ - public static Block registerBlock(Block block, Class itemclass, String name, Object... itemCtorArgs) - { - block = GameRegistry.registerBlock(block, itemclass, name, itemCtorArgs); - - Iterator iterator = block.getBlockState().getValidStates().iterator(); - - while (iterator.hasNext()) - { - IBlockState iblockstate = (IBlockState)iterator.next(); - int id = Block.blockRegistry.getIDForObject(block) << 4 | block.getMetaFromState(iblockstate); - Block.BLOCK_STATE_IDS.put(iblockstate, id); - } - - return block; - } -} diff --git a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java index 217eceb2..7f2a0051 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java @@ -22,13 +22,16 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.server.gui.IUpdatePlayerListBox; import net.minecraft.tileentity.TileEntityLockable; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.util.Constants; -public class TileEntityIronChest extends TileEntityLockable implements IUpdatePlayerListBox, IInventory +public class TileEntityIronChest extends TileEntityLockable implements IUpdatePlayerListBox, IInventory { private int ticksSinceSync = -1; public float prevLidAngle; @@ -37,7 +40,7 @@ public class TileEntityIronChest extends TileEntityLockable implements IUpdatePl private IronChestType type; public ItemStack[] chestContents; private ItemStack[] topStacks; - private int facing; + private byte facing; private boolean inventoryTouched; private boolean hadStuff; private String customName; @@ -59,8 +62,8 @@ public ItemStack[] getContents() { return chestContents; } - - public void setContents (ItemStack[] contents) + + public void setContents(ItemStack[] contents) { chestContents = new ItemStack[getSizeInventory()]; for (int i = 0; i < contents.length; i++) @@ -142,19 +145,18 @@ protected void sortTopStacks() return; } hadStuff = true; - Arrays.sort(tempCopy, new Comparator() { + Arrays.sort(tempCopy, new Comparator() + { @Override public int compare(ItemStack o1, ItemStack o2) { if (o1 == null) { return 1; - } - else if (o2 == null) + } else if (o2 == null) { return -1; - } - else + } else { return o2.stackSize - o1.stackSize; } @@ -201,8 +203,7 @@ public ItemStack decrStackSize(int i, int j) } markDirty(); return itemstack1; - } - else + } else { return null; } @@ -218,19 +219,19 @@ public void setInventorySlotContents(int i, ItemStack itemstack) } markDirty(); } - + @Override public String getName() { return this.hasCustomName() ? this.customName : type.name(); } - + @Override public boolean hasCustomName() { return this.customName != null && this.customName.length() > 0; } - + public void setCustomName(String name) { this.customName = name; @@ -240,17 +241,15 @@ public void setCustomName(String name) public void readFromNBT(NBTTagCompound nbttagcompound) { super.readFromNBT(nbttagcompound); - - //10 - TAG_COMPOUND - NBTTagList nbttaglist = nbttagcompound.getTagList("Items", 10); + + NBTTagList nbttaglist = nbttagcompound.getTagList("Items", Constants.NBT.TAG_COMPOUND); this.chestContents = new ItemStack[getSizeInventory()]; - - //8 - TAG_STRING - if (nbttagcompound.hasKey("CustomName", 8)) + + if (nbttagcompound.hasKey("CustomName", Constants.NBT.TAG_STRING)) { this.customName = nbttagcompound.getString("CustomName"); } - + for (int i = 0; i < nbttaglist.tagCount(); i++) { NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); @@ -281,8 +280,8 @@ public void writeToNBT(NBTTagCompound nbttagcompound) } nbttagcompound.setTag("Items", nbttaglist); - nbttagcompound.setByte("facing", (byte)facing); - + nbttagcompound.setByte("facing", facing); + if (this.hasCustomName()) { nbttagcompound.setString("CustomName", this.customName); @@ -306,7 +305,7 @@ public boolean isUseableByPlayer(EntityPlayer entityplayer) { return false; } - return entityplayer.getDistanceSq((double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D) <= 64D; + return entityplayer.getDistanceSq(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D) <= 64D; } @Override @@ -318,10 +317,12 @@ public void update() this.numUsingPlayers = 0; float var1 = 5.0F; @SuppressWarnings("unchecked") - List var2 = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB((double)((float)pos.getX() - var1), (double)((float)pos.getY() - var1), (double)((float)pos.getZ() - var1), (double)((float)(pos.getX() + 1) + var1), (double)((float)(pos.getY() + 1) + var1), (double)((float)(pos.getZ() + 1) + var1))); + List var2 = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(pos.getX() - var1, pos.getY() - var1, pos.getZ() - var1, pos.getX() + 1 + var1, pos.getY() + 1 + var1, pos.getZ() + 1 + var1)); - for (EntityPlayer var4 : var2) { - if (var4.openContainer instanceof ContainerIronChest) { + for (EntityPlayer var4 : var2) + { + if (var4.openContainer instanceof ContainerIronChest) + { ++this.numUsingPlayers; } } @@ -342,9 +343,9 @@ public void update() float f = 0.1F; if (numUsingPlayers > 0 && lidAngle == 0.0F) { - double d = (double) pos.getX() + 0.5D; - double d1 = (double) pos.getZ() + 0.5D; - worldObj.playSoundEffect(d, (double) pos.getY() + 0.5D, d1, "random.chestopen", 0.5F, worldObj.rand.nextFloat() * 0.1F + 0.9F); + double d = pos.getX() + 0.5D; + double d1 = pos.getZ() + 0.5D; + worldObj.playSoundEffect(d, pos.getY() + 0.5D, d1, "random.chestopen", 0.5F, worldObj.rand.nextFloat() * 0.1F + 0.9F); } if (numUsingPlayers == 0 && lidAngle > 0.0F || numUsingPlayers > 0 && lidAngle < 1.0F) { @@ -352,8 +353,7 @@ public void update() if (numUsingPlayers > 0) { lidAngle += f; - } - else + } else { lidAngle -= f; } @@ -364,9 +364,9 @@ public void update() float f2 = 0.5F; if (lidAngle < f2 && f1 >= f2) { - double d2 = (double) pos.getX() + 0.5D; - double d3 = (double) pos.getZ() + 0.5D; - worldObj.playSoundEffect(d2, (double) pos.getY() + 0.5D, d3, "random.chestclosed", 0.5F, worldObj.rand.nextFloat() * 0.1F + 0.9F); + double d2 = pos.getX() + 0.5D; + double d3 = pos.getZ() + 0.5D; + worldObj.playSoundEffect(d2, pos.getY() + 0.5D, d3, "random.chestclosed", 0.5F, worldObj.rand.nextFloat() * 0.1F + 0.9F); } if (lidAngle < 0.0F) { @@ -381,12 +381,10 @@ public boolean receiveClientEvent(int i, int j) if (i == 1) { numUsingPlayers = j; - } - else if (i == 2) + } else if (i == 2) { facing = (byte) j; - } - else if (i == 3) + } else if (i == 3) { facing = (byte) (j & 0x7); numUsingPlayers = (j & 0xF8) >> 3; @@ -397,7 +395,10 @@ else if (i == 3) @Override public void openInventory(EntityPlayer player) { - if (worldObj == null) return; + if (worldObj == null) + { + return; + } numUsingPlayers++; worldObj.addBlockEvent(pos, IronChest.ironChestBlock, 1, numUsingPlayers); } @@ -405,12 +406,15 @@ public void openInventory(EntityPlayer player) @Override public void closeInventory(EntityPlayer player) { - if (worldObj == null) return; + if (worldObj == null) + { + return; + } numUsingPlayers--; worldObj.addBlockEvent(pos, IronChest.ironChestBlock, 1, numUsingPlayers); } - public void setFacing(int facing2) + public void setFacing(byte facing2) { this.facing = facing2; } @@ -436,30 +440,65 @@ public TileEntityIronChest updateFromMetadata(int l) @Override public Packet getDescriptionPacket() { - return PacketHandler.getPacket(this); + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setInteger("type", getType().ordinal()); + nbt.setByte("facing", facing); + ItemStack[] stacks = buildItemStackDataList(); + if (stacks != null) + { + NBTTagList nbttaglist = new NBTTagList(); + for (int i = 0; i < stacks.length; i++) + { + if (stacks[i] != null) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte) i); + stacks[i].writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + } + nbt.setTag("stacks", nbttaglist); + } + + return new S35PacketUpdateTileEntity(pos, 0, nbt); } - public void handlePacketData(int typeData, ItemStack[] intData) + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - TileEntityIronChest chest = this; - if (this.type.ordinal() != typeData) + if (pkt.getTileEntityType() == 0) { - chest = updateFromMetadata(typeData); - } - if (IronChestType.values()[typeData].isTransparent() && intData != null) - { - int pos = 0; - for (int i = 0; i < chest.topStacks.length; i++) + NBTTagCompound nbt = pkt.getNbtCompound(); + type = IronChestType.values()[nbt.getInteger("type")]; + facing = nbt.getByte("facing"); + + NBTTagList tagList = nbt.getTagList("stacks", Constants.NBT.TAG_COMPOUND); + ItemStack[] stacks = new ItemStack[topStacks.length]; + + for (int i = 0; i < stacks.length; i++) { - if (intData[pos] != null) + NBTTagCompound nbt1 = tagList.getCompoundTagAt(i); + int j = nbt1.getByte("Slot") & 0xff; + if (j >= 0 && j < stacks.length) { - chest.topStacks[i] = intData[pos]; + stacks[j] = ItemStack.loadItemStackFromNBT(nbt1); } - else + } + + if (type.isTransparent() && stacks != null) + { + int pos = 0; + for (int i = 0; i < topStacks.length; i++) { - chest.topStacks[i] = null; + if (stacks[pos] != null) + { + topStacks[i] = stacks[pos]; + } else + { + topStacks[i] = null; + } + pos++; } - pos ++; } } } @@ -475,8 +514,7 @@ public ItemStack[] buildItemStackDataList() if (is != null) { sortList[pos++] = is; - } - else + } else { sortList[pos++] = null; } @@ -494,31 +532,25 @@ public ItemStack getStackInSlotOnClosing(int par1) ItemStack var2 = this.chestContents[par1]; this.chestContents[par1] = null; return var2; - } - else + } else { return null; } } - public void setMaxStackSize(int size) - { - - } - @Override public boolean isItemValidForSlot(int i, ItemStack itemstack) { return type.acceptsStack(itemstack); } - void rotateAround() + public void rotateAround() { - facing++; - if(facing > EnumFacing.EAST.ordinal()) - { - facing = EnumFacing.NORTH.ordinal(); - } + facing++; + if (facing > EnumFacing.EAST.ordinal()) + { + facing = (byte) EnumFacing.NORTH.ordinal(); + } setFacing(facing); worldObj.addBlockEvent(pos, IronChest.ironChestBlock, 2, facing); } @@ -527,7 +559,9 @@ public void wasPlaced(EntityLivingBase entityliving, ItemStack itemStack) { } - public void removeAdornments() {} + public void removeAdornments() + { + } @Override public int getField(int id) @@ -536,7 +570,9 @@ public int getField(int id) } @Override - public void setField(int id, int value) {} + public void setField(int id, int value) + { + } @Override public int getFieldCount() @@ -564,10 +600,10 @@ public String getGuiID() { return "IronChest:" + type.name(); } - + @Override public boolean canRenderBreaking() { - return true; + return true; } } diff --git a/src/main/java/cpw/mods/ironchest/client/ClientProxy.java b/src/main/java/cpw/mods/ironchest/client/ClientProxy.java index 09ad48a3..1967404b 100755 --- a/src/main/java/cpw/mods/ironchest/client/ClientProxy.java +++ b/src/main/java/cpw/mods/ironchest/client/ClientProxy.java @@ -10,8 +10,12 @@ ******************************************************************************/ package cpw.mods.ironchest.client; -import net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.ItemModelMesher; +import net.minecraft.client.resources.model.ModelBakery; +import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.world.World; @@ -22,20 +26,23 @@ import cpw.mods.ironchest.IronChestType; import cpw.mods.ironchest.TileEntityIronChest; -public class ClientProxy extends CommonProxy +public class ClientProxy extends CommonProxy { @Override public void registerRenderInformation() - { + { + Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getModelManager().getBlockModelShapes().registerBuiltInBlocks(IronChest.ironChestBlock); + + ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher(); for (IronChestType chestType : IronChestType.values()) { if (chestType != IronChestType.WOOD) { - ModelHelper.registerBlock(IronChest.ironChestBlock, chestType.ordinal(), "ironchest:BlockIronChest"); + Item chestItem = Item.getItemFromBlock(IronChest.ironChestBlock); + mesher.register(chestItem, chestType.ordinal(), new ModelResourceLocation("ironchest:chest_" + chestType.getName().toLowerCase(), "inventory")); + ModelBakery.addVariantName(chestItem, "ironchest:chest_" + chestType.getName().toLowerCase()); } } - - TileEntityItemStackRenderer.instance = new IronChestRenderHelper(); } @Override @@ -57,8 +64,7 @@ public Object getClientGuiElement(int ID, EntityPlayer player, World world, int if (te != null && te instanceof TileEntityIronChest) { return GUIChest.GUI.buildGUI(IronChestType.values()[ID], player.inventory, (TileEntityIronChest) te); - } - else + } else { return null; } diff --git a/src/main/java/cpw/mods/ironchest/client/IronChestRenderHelper.java b/src/main/java/cpw/mods/ironchest/client/IronChestRenderHelper.java deleted file mode 100755 index 4c0ca28c..00000000 --- a/src/main/java/cpw/mods/ironchest/client/IronChestRenderHelper.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * 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 - * - * Contributors: - * cpw - initial API and implementation - ******************************************************************************/ -package cpw.mods.ironchest.client; - -import java.util.Map; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.item.ItemStack; - -import com.google.common.collect.Maps; - -import cpw.mods.ironchest.IronChest; -import cpw.mods.ironchest.IronChestType; -import cpw.mods.ironchest.TileEntityIronChest; - -public class IronChestRenderHelper extends TileEntityItemStackRenderer -{ - private Map itemRenders = Maps.newHashMap(); - - public IronChestRenderHelper() - { - for (IronChestType typ : IronChestType.values()) - { - itemRenders.put(typ.ordinal(), (TileEntityIronChest) IronChest.ironChestBlock.createNewTileEntity(null, typ.ordinal())); - } - } - - @Override - public void renderByItem(ItemStack itemStack) - { - Block block = Block.getBlockFromItem(itemStack.getItem()); - - if (block == IronChest.ironChestBlock) - { - TileEntityRendererDispatcher.instance.renderTileEntityAt(itemRenders.get(itemStack.getMetadata()), 0.0D, 0.0D, 0.0D, 0.0F); - } - else - { - super.renderByItem(itemStack); - } - } -} diff --git a/src/main/resources/assets/ironchest/models/item/BlockIronChest.json b/src/main/resources/assets/ironchest/models/item/BlockIronChest.json deleted file mode 100755 index 9935accd..00000000 --- a/src/main/resources/assets/ironchest/models/item/BlockIronChest.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "builtin/entity" -} diff --git a/src/main/resources/assets/ironchest/models/item/chest_copper.json b/src/main/resources/assets/ironchest/models/item/chest_copper.json new file mode 100755 index 00000000..488cab4f --- /dev/null +++ b/src/main/resources/assets/ironchest/models/item/chest_copper.json @@ -0,0 +1,40 @@ +{ + "textures": { + "texture": "ironchest:model/copperchest" + }, + "elements": [ + { "from": [ 1, 0, 1 ], + "to": [ 15, 10, 15 ], + "faces": { + "down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" }, + "up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" }, + "north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" }, + "south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" }, + "west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" }, + "east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" } + } + }, + { "from": [ 1, 9, 1 ], + "to": [ 15, 14, 15 ], + "faces": { + "down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" }, + "up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" }, + "north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" }, + "south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" }, + "west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" }, + "east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" } + } + }, + { "from": [ 7, 7, 0 ], + "to": [ 9, 11, 1 ], + "faces": { + "down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" }, + "north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" }, + "south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" }, + "west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" }, + "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } + } + } + ] +} diff --git a/src/main/resources/assets/ironchest/models/item/chest_crystal.json b/src/main/resources/assets/ironchest/models/item/chest_crystal.json new file mode 100755 index 00000000..ff0c8239 --- /dev/null +++ b/src/main/resources/assets/ironchest/models/item/chest_crystal.json @@ -0,0 +1,40 @@ +{ + "textures": { + "texture": "ironchest:model/crystalchest" + }, + "elements": [ + { "from": [ 1, 0, 1 ], + "to": [ 15, 10, 15 ], + "faces": { + "down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" }, + "up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" }, + "north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" }, + "south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" }, + "west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" }, + "east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" } + } + }, + { "from": [ 1, 9, 1 ], + "to": [ 15, 14, 15 ], + "faces": { + "down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" }, + "up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" }, + "north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" }, + "south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" }, + "west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" }, + "east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" } + } + }, + { "from": [ 7, 7, 0 ], + "to": [ 9, 11, 1 ], + "faces": { + "down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" }, + "north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" }, + "south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" }, + "west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" }, + "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } + } + } + ] +} diff --git a/src/main/resources/assets/ironchest/models/item/chest_diamond.json b/src/main/resources/assets/ironchest/models/item/chest_diamond.json new file mode 100755 index 00000000..89505152 --- /dev/null +++ b/src/main/resources/assets/ironchest/models/item/chest_diamond.json @@ -0,0 +1,40 @@ +{ + "textures": { + "texture": "ironchest:model/diamondchest" + }, + "elements": [ + { "from": [ 1, 0, 1 ], + "to": [ 15, 10, 15 ], + "faces": { + "down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" }, + "up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" }, + "north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" }, + "south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" }, + "west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" }, + "east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" } + } + }, + { "from": [ 1, 9, 1 ], + "to": [ 15, 14, 15 ], + "faces": { + "down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" }, + "up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" }, + "north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" }, + "south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" }, + "west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" }, + "east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" } + } + }, + { "from": [ 7, 7, 0 ], + "to": [ 9, 11, 1 ], + "faces": { + "down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" }, + "north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" }, + "south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" }, + "west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" }, + "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } + } + } + ] +} diff --git a/src/main/resources/assets/ironchest/models/item/chest_dirtchest9000.json b/src/main/resources/assets/ironchest/models/item/chest_dirtchest9000.json new file mode 100755 index 00000000..d2947cdb --- /dev/null +++ b/src/main/resources/assets/ironchest/models/item/chest_dirtchest9000.json @@ -0,0 +1,40 @@ +{ + "textures": { + "texture": "ironchest:model/dirtchest" + }, + "elements": [ + { "from": [ 1, 0, 1 ], + "to": [ 15, 10, 15 ], + "faces": { + "down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" }, + "up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" }, + "north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" }, + "south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" }, + "west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" }, + "east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" } + } + }, + { "from": [ 1, 9, 1 ], + "to": [ 15, 14, 15 ], + "faces": { + "down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" }, + "up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" }, + "north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" }, + "south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" }, + "west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" }, + "east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" } + } + }, + { "from": [ 7, 7, 0 ], + "to": [ 9, 11, 1 ], + "faces": { + "down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" }, + "north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" }, + "south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" }, + "west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" }, + "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } + } + } + ] +} diff --git a/src/main/resources/assets/ironchest/models/item/chest_gold.json b/src/main/resources/assets/ironchest/models/item/chest_gold.json new file mode 100755 index 00000000..5260625c --- /dev/null +++ b/src/main/resources/assets/ironchest/models/item/chest_gold.json @@ -0,0 +1,40 @@ +{ + "textures": { + "texture": "ironchest:model/goldchest" + }, + "elements": [ + { "from": [ 1, 0, 1 ], + "to": [ 15, 10, 15 ], + "faces": { + "down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" }, + "up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" }, + "north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" }, + "south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" }, + "west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" }, + "east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" } + } + }, + { "from": [ 1, 9, 1 ], + "to": [ 15, 14, 15 ], + "faces": { + "down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" }, + "up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" }, + "north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" }, + "south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" }, + "west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" }, + "east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" } + } + }, + { "from": [ 7, 7, 0 ], + "to": [ 9, 11, 1 ], + "faces": { + "down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" }, + "north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" }, + "south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" }, + "west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" }, + "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } + } + } + ] +} diff --git a/src/main/resources/assets/ironchest/models/item/chest_iron.json b/src/main/resources/assets/ironchest/models/item/chest_iron.json new file mode 100755 index 00000000..2c63365f --- /dev/null +++ b/src/main/resources/assets/ironchest/models/item/chest_iron.json @@ -0,0 +1,40 @@ +{ + "textures": { + "texture": "ironchest:model/ironchest" + }, + "elements": [ + { "from": [ 1, 0, 1 ], + "to": [ 15, 10, 15 ], + "faces": { + "down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" }, + "up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" }, + "north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" }, + "south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" }, + "west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" }, + "east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" } + } + }, + { "from": [ 1, 9, 1 ], + "to": [ 15, 14, 15 ], + "faces": { + "down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" }, + "up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" }, + "north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" }, + "south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" }, + "west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" }, + "east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" } + } + }, + { "from": [ 7, 7, 0 ], + "to": [ 9, 11, 1 ], + "faces": { + "down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" }, + "north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" }, + "south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" }, + "west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" }, + "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } + } + } + ] +} diff --git a/src/main/resources/assets/ironchest/models/item/chest_obsidian.json b/src/main/resources/assets/ironchest/models/item/chest_obsidian.json new file mode 100755 index 00000000..b13d0189 --- /dev/null +++ b/src/main/resources/assets/ironchest/models/item/chest_obsidian.json @@ -0,0 +1,40 @@ +{ + "textures": { + "texture": "ironchest:model/obsidianchest" + }, + "elements": [ + { "from": [ 1, 0, 1 ], + "to": [ 15, 10, 15 ], + "faces": { + "down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" }, + "up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" }, + "north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" }, + "south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" }, + "west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" }, + "east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" } + } + }, + { "from": [ 1, 9, 1 ], + "to": [ 15, 14, 15 ], + "faces": { + "down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" }, + "up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" }, + "north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" }, + "south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" }, + "west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" }, + "east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" } + } + }, + { "from": [ 7, 7, 0 ], + "to": [ 9, 11, 1 ], + "faces": { + "down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" }, + "north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" }, + "south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" }, + "west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" }, + "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } + } + } + ] +} diff --git a/src/main/resources/assets/ironchest/models/item/chest_silver.json b/src/main/resources/assets/ironchest/models/item/chest_silver.json new file mode 100755 index 00000000..43fdd95b --- /dev/null +++ b/src/main/resources/assets/ironchest/models/item/chest_silver.json @@ -0,0 +1,40 @@ +{ + "textures": { + "texture": "ironchest:model/silverchest" + }, + "elements": [ + { "from": [ 1, 0, 1 ], + "to": [ 15, 10, 15 ], + "faces": { + "down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" }, + "up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" }, + "north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" }, + "south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" }, + "west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" }, + "east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" } + } + }, + { "from": [ 1, 9, 1 ], + "to": [ 15, 14, 15 ], + "faces": { + "down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" }, + "up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" }, + "north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" }, + "south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" }, + "west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" }, + "east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" } + } + }, + { "from": [ 7, 7, 0 ], + "to": [ 9, 11, 1 ], + "faces": { + "down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" }, + "north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" }, + "south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" }, + "west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" }, + "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } + } + } + ] +} diff --git a/src/main/resources/assets/ironchest/textures/blocks/copper_front.png b/src/main/resources/assets/ironchest/textures/blocks/copper_front.png deleted file mode 100755 index 8ca415c5..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/copper_front.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/copper_side.png b/src/main/resources/assets/ironchest/textures/blocks/copper_side.png deleted file mode 100755 index 864e9509..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/copper_side.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/copper_top.png b/src/main/resources/assets/ironchest/textures/blocks/copper_top.png deleted file mode 100755 index 09a84886..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/copper_top.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/crystal_front.png b/src/main/resources/assets/ironchest/textures/blocks/crystal_front.png deleted file mode 100755 index c517953d..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/crystal_front.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/crystal_side.png b/src/main/resources/assets/ironchest/textures/blocks/crystal_side.png deleted file mode 100755 index 842cc18f..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/crystal_side.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/crystal_top.png b/src/main/resources/assets/ironchest/textures/blocks/crystal_top.png deleted file mode 100755 index ce8ef630..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/crystal_top.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/diamond_front.png b/src/main/resources/assets/ironchest/textures/blocks/diamond_front.png deleted file mode 100755 index d5e6373d..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/diamond_front.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/diamond_side.png b/src/main/resources/assets/ironchest/textures/blocks/diamond_side.png deleted file mode 100755 index 3c69947f..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/diamond_side.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/diamond_top.png b/src/main/resources/assets/ironchest/textures/blocks/diamond_top.png deleted file mode 100755 index 08c3bb53..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/diamond_top.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/dirtchest9000_front.png b/src/main/resources/assets/ironchest/textures/blocks/dirtchest9000_front.png deleted file mode 100755 index 4e1e1fdd..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/dirtchest9000_front.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/dirtchest9000_side.png b/src/main/resources/assets/ironchest/textures/blocks/dirtchest9000_side.png deleted file mode 100755 index ebda19fd..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/dirtchest9000_side.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/dirtchest9000_top.png b/src/main/resources/assets/ironchest/textures/blocks/dirtchest9000_top.png deleted file mode 100755 index a92c5f17..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/dirtchest9000_top.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/gold_front.png b/src/main/resources/assets/ironchest/textures/blocks/gold_front.png deleted file mode 100755 index 56f1d4d4..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/gold_front.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/gold_side.png b/src/main/resources/assets/ironchest/textures/blocks/gold_side.png deleted file mode 100755 index f06fb4f7..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/gold_side.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/gold_top.png b/src/main/resources/assets/ironchest/textures/blocks/gold_top.png deleted file mode 100755 index a29e9f37..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/gold_top.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/iron_front.png b/src/main/resources/assets/ironchest/textures/blocks/iron_front.png deleted file mode 100755 index a3db4152..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/iron_front.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/iron_side.png b/src/main/resources/assets/ironchest/textures/blocks/iron_side.png deleted file mode 100755 index 14869495..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/iron_side.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/iron_top.png b/src/main/resources/assets/ironchest/textures/blocks/iron_top.png deleted file mode 100755 index 30efea4d..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/iron_top.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/obsidian_front.png b/src/main/resources/assets/ironchest/textures/blocks/obsidian_front.png deleted file mode 100755 index ed1ef0d9..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/obsidian_front.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/obsidian_side.png b/src/main/resources/assets/ironchest/textures/blocks/obsidian_side.png deleted file mode 100755 index dc8d227e..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/obsidian_side.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/obsidian_top.png b/src/main/resources/assets/ironchest/textures/blocks/obsidian_top.png deleted file mode 100755 index 4f531cc5..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/obsidian_top.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/silver_front.png b/src/main/resources/assets/ironchest/textures/blocks/silver_front.png deleted file mode 100755 index 3a8a37e3..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/silver_front.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/silver_side.png b/src/main/resources/assets/ironchest/textures/blocks/silver_side.png deleted file mode 100755 index d4df0773..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/silver_side.png and /dev/null differ diff --git a/src/main/resources/assets/ironchest/textures/blocks/silver_top.png b/src/main/resources/assets/ironchest/textures/blocks/silver_top.png deleted file mode 100755 index 94390366..00000000 Binary files a/src/main/resources/assets/ironchest/textures/blocks/silver_top.png and /dev/null differ