diff --git a/mods/tinker/textures/blocks/coal_block.png b/mods/tinker/textures/blocks/coal_block.png new file mode 100644 index 00000000..024404bc Binary files /dev/null and b/mods/tinker/textures/blocks/coal_block.png differ diff --git a/mods/tinker/textures/gui/drawbridge.png b/mods/tinker/textures/gui/drawbridge.png new file mode 100644 index 00000000..f247f1d0 Binary files /dev/null and b/mods/tinker/textures/gui/drawbridge.png differ diff --git a/mods/tinker/textures/items/blanksprite.png b/mods/tinker/textures/items/blanksprite.png new file mode 100644 index 00000000..827bd32d Binary files /dev/null and b/mods/tinker/textures/items/blanksprite.png differ diff --git a/mods/tinker/textures/items/materials/cast_bowstring.png b/mods/tinker/textures/items/materials/cast_bowstring.png new file mode 100644 index 00000000..3b0fc0a9 Binary files /dev/null and b/mods/tinker/textures/items/materials/cast_bowstring.png differ diff --git a/mods/tinker/textures/items/materials/cast_fletching.png b/mods/tinker/textures/items/materials/cast_fletching.png new file mode 100644 index 00000000..3b0fc0a9 Binary files /dev/null and b/mods/tinker/textures/items/materials/cast_fletching.png differ diff --git a/tconstruct/blocks/LavaTankBlock.java b/tconstruct/blocks/LavaTankBlock.java index a5bf3e5d..b7a3907a 100644 --- a/tconstruct/blocks/LavaTankBlock.java +++ b/tconstruct/blocks/LavaTankBlock.java @@ -7,6 +7,7 @@ import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; diff --git a/tconstruct/blocks/RedstoneMachine.java b/tconstruct/blocks/RedstoneMachine.java index 205bc235..22860981 100644 --- a/tconstruct/blocks/RedstoneMachine.java +++ b/tconstruct/blocks/RedstoneMachine.java @@ -1,7 +1,5 @@ package tconstruct.blocks; -import static net.minecraftforge.common.ForgeDirection.UP; - import java.util.List; import net.minecraft.block.Block; @@ -11,7 +9,6 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -27,6 +24,8 @@ import tconstruct.library.TConstructRegistry; import tconstruct.library.blocks.InventoryBlock; import tconstruct.library.util.IActiveLogic; import tconstruct.library.util.IFacingLogic; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class RedstoneMachine extends InventoryBlock { @@ -57,6 +56,25 @@ public class RedstoneMachine extends InventoryBlock } return super.getLightValue(world, x, y, z); } + + @Override + @SideOnly(Side.CLIENT) + public int colorMultiplier (IBlockAccess world, int x, int y, int z) + { + if (world.getBlockMetadata(x, y, z) == 0) + { + TileEntity logic = world.getBlockTileEntity(x, y, z); + + if (logic != null && logic instanceof DrawbridgeLogic) + { + ItemStack stack = ((DrawbridgeLogic) logic).getStackInSlot(1); + if (stack != null && stack.itemID < 4096 && Block.blocksList[stack.itemID] != null) + return Block.blocksList[stack.itemID].colorMultiplier(world, x, y, z); + } + } + + return 0xffffff; + } @Override public TileEntity createTileEntity (World world, int metadata) @@ -187,7 +205,7 @@ public class RedstoneMachine extends InventoryBlock public boolean isFireSource (World world, int x, int y, int z, int metadata, ForgeDirection side) { if (metadata == 1) - return side == UP; + return side == ForgeDirection.UP; return false; } diff --git a/tconstruct/blocks/logic/DrawbridgeLogic.java b/tconstruct/blocks/logic/DrawbridgeLogic.java index 500eac46..1544b2c8 100644 --- a/tconstruct/blocks/logic/DrawbridgeLogic.java +++ b/tconstruct/blocks/logic/DrawbridgeLogic.java @@ -34,7 +34,6 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc { super(2); } - @Override public void setWorldObj (World par1World) { @@ -111,14 +110,14 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc } } } - + /* 0 = Up * 1 = Right * 2 = Down * 3 = Left * 4 = Center, neutral */ - public void setPlacementDirection (byte keycode) + public void setPlacementDirection(byte keycode) { if (keycode == 4) { @@ -129,20 +128,13 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc { switch (keycode) { - case 0: - fakePlayer.rotationYaw = 0; - break; - case 1: - fakePlayer.rotationYaw = 90; - break; - case 2: - fakePlayer.rotationYaw = 180; - break; - case 3: - fakePlayer.rotationYaw = 270; - break; + case 0: fakePlayer.rotationYaw = 0; break; + case 1: fakePlayer.rotationYaw = 90; break; + case 2: fakePlayer.rotationYaw = 180; break; + case 3: fakePlayer.rotationYaw = 270; break; } - + + if (this.direction == 0) fakePlayer.rotationPitch = -90; else @@ -150,22 +142,10 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc } else { - if (keycode == 0) //Forward + if (keycode % 2 == 0) { fakePlayer.rotationYaw = mapDirection() * 90; - - if (keycode == 0) - fakePlayer.rotationPitch = 90; - else - fakePlayer.rotationPitch = -90; - } - else if (keycode == 2) //Backward - { - int face = mapDirection() + 2; - if (face > 3) - face -= 4; - fakePlayer.rotationYaw = face * 90; - + if (keycode == 0) fakePlayer.rotationPitch = 90; else @@ -174,25 +154,25 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc else { fakePlayer.rotationPitch = 0; - + int facing = mapDirection(); if (keycode == 1) facing += 1; else facing -= 1; - + if (facing >= 4) facing = 0; if (facing < 0) facing = 3; - + fakePlayer.rotationYaw = facing * 90; } - } + } placementDirection = keycode; } - - int mapDirection () + + int mapDirection() { if (this.direction == 2) //North return 0; @@ -200,9 +180,14 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc return 1; if (this.direction == 3) //South return 2; - + return 3; //West } + + public byte getFacingDirection() + { + return placementDirection; + } public byte getPlacementDirection () { @@ -468,7 +453,6 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc { tags.setByte("Direction", direction); tags.setByte("Placement", placementDirection); - } /* Packets */ diff --git a/tconstruct/common/TContent.java b/tconstruct/common/TContent.java index 8283e3e0..c2e4effe 100644 --- a/tconstruct/common/TContent.java +++ b/tconstruct/common/TContent.java @@ -531,7 +531,6 @@ public class TContent implements IFuelHandler craftingStationWood = new CraftingStationBlock(PHConstruct.woodCrafter, Material.wood).setUnlocalizedName("CraftingStation"); GameRegistry.registerBlock(craftingStationWood, "CraftingStation"); GameRegistry.registerTileEntity(CraftingStationLogic.class, "CraftingStation"); - //public static Block craftingStationWood; craftingStationWood = new CraftingStationBlock(PHConstruct.woodCrafter, Material.wood).setUnlocalizedName("CraftingStation"); GameRegistry.registerBlock(craftingStationWood, "CraftingStation"); diff --git a/tconstruct/items/ToolShard.java b/tconstruct/items/ToolShard.java index 2fc9ef15..3b5993ad 100644 --- a/tconstruct/items/ToolShard.java +++ b/tconstruct/items/ToolShard.java @@ -25,7 +25,10 @@ public class ToolShard extends ToolPart { String[] names = new String[toolMaterialNames.length]; for (int i = 0; i < toolMaterialNames.length; i++) - names[i] = toolTextureNames[i] + textureType; + { + if (!toolTextureNames[i].equals("")) + names[i] = toolTextureNames[i] + textureType; + } return names; } @@ -46,7 +49,8 @@ public class ToolShard extends ToolPart icons[9] = icons[8]; for (int i = 10; i < icons.length; ++i) { - this.icons[i] = iconRegister.registerIcon("tinker:" + folder + textureNames[i]); + if (!toolTextureNames[i].equals("")) + this.icons[i] = iconRegister.registerIcon("tinker:" + folder + textureNames[i]); } } diff --git a/tconstruct/items/blocks/GlassBlockItem.java b/tconstruct/items/blocks/GlassBlockItem.java index 279a40b0..1d5cbca7 100644 --- a/tconstruct/items/blocks/GlassBlockItem.java +++ b/tconstruct/items/blocks/GlassBlockItem.java @@ -1,7 +1,11 @@ package tconstruct.items.blocks; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.MathHelper; public class GlassBlockItem extends ItemBlock @@ -25,4 +29,28 @@ public class GlassBlockItem extends ItemBlock int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); return (new StringBuilder()).append("block.").append(blockType[pos]).toString(); } + + public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) + { + if (stack.hasTagCompound() && stack.getItemDamage() == 0) + { + NBTTagCompound contentTags = stack.getTagCompound().getCompoundTag("Contents"); + if (contentTags != null) + { + ItemStack contents = ItemStack.loadItemStackFromNBT(contentTags); + if (contents != null) + { + list.add("Inventory: " + contents.getDisplayName()); + list.add("Amount: " + contents.stackSize); + } + } + NBTTagCompound camoTag = stack.getTagCompound().getCompoundTag("Camoflauge"); + if (camoTag != null) + { + ItemStack camo = ItemStack.loadItemStackFromNBT(camoTag); + if (camo != null) + list.add("Camoflauge: " + camo.getDisplayName()); + } + } + } } diff --git a/tconstruct/items/blocks/MetalOreItemBlock.java b/tconstruct/items/blocks/MetalOreItemBlock.java index 71a53dfc..bb0f4742 100644 --- a/tconstruct/items/blocks/MetalOreItemBlock.java +++ b/tconstruct/items/blocks/MetalOreItemBlock.java @@ -1,7 +1,11 @@ package tconstruct.items.blocks; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.MathHelper; public class MetalOreItemBlock extends ItemBlock @@ -25,4 +29,17 @@ public class MetalOreItemBlock extends ItemBlock int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); return (new StringBuilder()).append("MetalOre.").append(blockType[pos]).toString(); } + + public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) + { + if (stack.hasTagCompound()) + { + NBTTagCompound liquidTag = stack.getTagCompound().getCompoundTag("Liquid"); + if (liquidTag != null) + { + list.add("Contains "+liquidTag.getString("LiquidName")); + list.add(liquidTag.getInteger("Amount")+" mB"); + } + } + } }