diff --git a/mods/tinker/resources/lang/en_US.xml b/mods/tinker/resources/lang/en_US.xml index 16fd104..676822c 100644 --- a/mods/tinker/resources/lang/en_US.xml +++ b/mods/tinker/resources/lang/en_US.xml @@ -176,6 +176,6 @@ Blue Slime Nitro Creeper - Armor Gui + Armor Gui \ No newline at end of file diff --git a/mods/tinker/tconstruct/TConstruct.java b/mods/tinker/tconstruct/TConstruct.java index dd35539..e1d5d25 100644 --- a/mods/tinker/tconstruct/TConstruct.java +++ b/mods/tinker/tconstruct/TConstruct.java @@ -10,10 +10,12 @@ import mods.tinker.tconstruct.util.PHConstruct; import mods.tinker.tconstruct.util.TCraftingHandler; import mods.tinker.tconstruct.util.TEventHandler; import mods.tinker.tconstruct.util.player.TPlayerHandler; +import mods.tinker.tconstruct.worldgen.OverworldProvider; import mods.tinker.tconstruct.worldgen.TBaseWorldGenerator; import mods.tinker.tconstruct.worldgen.village.TVillageTrades; import mods.tinker.tconstruct.worldgen.village.VillageSmelteryHandler; import mods.tinker.tconstruct.worldgen.village.VillageToolStationHandler; +import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; @@ -35,7 +37,7 @@ import cpw.mods.fml.common.registry.VillagerRegistry; * @dependencies: IC2 API */ -@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.2", dependencies = "required-after:Forge@[7.7.1.675,)") +@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.2.15", dependencies = "required-after:Forge@[7.7.1.675,)") @NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.util.network.TPacketHandler.class) public class TConstruct { @@ -88,8 +90,8 @@ public class TConstruct VillagerRegistry.instance().registerVillageCreationHandler(new VillageSmelteryHandler()); } - //DimensionManager.unregisterProviderType(0); - //DimensionManager.registerProviderType(0, OverworldProvider.class, true); + DimensionManager.unregisterProviderType(0); + DimensionManager.registerProviderType(0, OverworldProvider.class, true); } @Init diff --git a/mods/tinker/tconstruct/blocks/OreberryBush.java b/mods/tinker/tconstruct/blocks/OreberryBush.java index 41660c0..e41acad 100644 --- a/mods/tinker/tconstruct/blocks/OreberryBush.java +++ b/mods/tinker/tconstruct/blocks/OreberryBush.java @@ -198,8 +198,8 @@ public class OreberryBush extends BlockLeavesBase implements IPlantable int meta = world.getBlockMetadata(x, y, z); if (meta >= 12) { - if (world.isRemote) - return true; + /*if (world.isRemote) + return true;*/ world.setBlock(x, y, z, blockID, meta - 4, 3); AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.oreBerries, 1, meta % 4 + itemMeat)); diff --git a/mods/tinker/tconstruct/client/TControls.java b/mods/tinker/tconstruct/client/TControls.java index 3e39a80..a99d485 100644 --- a/mods/tinker/tconstruct/client/TControls.java +++ b/mods/tinker/tconstruct/client/TControls.java @@ -19,7 +19,7 @@ public class TControls extends TKeyHandler { //static KeyBinding grabKey = new KeyBinding("key.grab", 29); //static KeyBinding stiltsKey = new KeyBinding("key.stilts", 46); - public static KeyBinding armorKey = new KeyBinding("key.armor", 23); + public static KeyBinding armorKey = new KeyBinding("key.tarmor", 24); static KeyBinding jumpKey; static KeyBinding invKey; static Minecraft mc; diff --git a/mods/tinker/tconstruct/client/TProxyClient.java b/mods/tinker/tconstruct/client/TProxyClient.java index dd4b6fe..82dfd2a 100644 --- a/mods/tinker/tconstruct/client/TProxyClient.java +++ b/mods/tinker/tconstruct/client/TProxyClient.java @@ -23,6 +23,7 @@ import mods.tinker.tconstruct.library.*; import mods.tinker.tconstruct.library.client.*; import mods.tinker.tconstruct.library.crafting.*; import mods.tinker.tconstruct.library.tools.*; +import mods.tinker.tconstruct.util.PHConstruct; import mods.tinker.tconstruct.util.player.*; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -140,7 +141,7 @@ public class TProxyClient extends TProxyCommon public void registerTickHandler () { - TickRegistry.registerTickHandler(new TClientTickHandler(), Side.CLIENT); + //TickRegistry.registerTickHandler(new TClientTickHandler(), Side.CLIENT); //TickRegistry.registerTickHandler(new TCommonTickHandler(), Side.CLIENT); } diff --git a/mods/tinker/tconstruct/client/gui/GuiButtonTool.java b/mods/tinker/tconstruct/client/gui/GuiButtonTool.java index e472435..70a0ced 100644 --- a/mods/tinker/tconstruct/client/gui/GuiButtonTool.java +++ b/mods/tinker/tconstruct/client/gui/GuiButtonTool.java @@ -40,7 +40,7 @@ public class GuiButtonTool extends GuiButton this.field_82253_i = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; int var5 = this.getHoverState(this.field_82253_i); int index = 18 * getHoverState(field_82253_i); - this.drawTexturedModalRect(this.xPosition, this.yPosition, index, 0, 18, 18); + this.drawTexturedModalRect(this.xPosition, this.yPosition, 144 + index*2, 216, 18, 18); this.drawTexturedModalRect(this.xPosition, this.yPosition, textureX*18, textureY*18, 18, 18); } } diff --git a/mods/tinker/tconstruct/client/gui/ToolStationGui.java b/mods/tinker/tconstruct/client/gui/ToolStationGui.java index c8d9946..181412c 100644 --- a/mods/tinker/tconstruct/client/gui/ToolStationGui.java +++ b/mods/tinker/tconstruct/client/gui/ToolStationGui.java @@ -328,7 +328,7 @@ public class ToolStationGui extends NewContainerGui if (active) { - this.drawTexturedModalRect(cornerX+68, cornerY+6, 0, this.ySize, 102, 12); + this.drawTexturedModalRect(cornerX+62, cornerY, 0, this.ySize, 112, 22); } //texID = this.mc.renderEngine.getTexture("/mods/tinker/textures/gui/icons.png"); @@ -339,7 +339,7 @@ public class ToolStationGui extends NewContainerGui for (int i = 0; i < slotX.length; i++) { - this.drawTexturedModalRect(cornerX + slotX[i], cornerY + slotY[i], 0, 0, 18, 18); + this.drawTexturedModalRect(cornerX + slotX[i]-4, cornerY + slotY[i]-4, 140, 212, 28, 28); if (!logic.isStackInSlot(i + 1)) { this.drawTexturedModalRect(cornerX + slotX[i], cornerY + slotY[i], 18 * iconX[i], 18 * iconY[i], 18, 18); diff --git a/mods/tinker/tconstruct/common/TContent.java b/mods/tinker/tconstruct/common/TContent.java index fc52fb4..7fcd15c 100644 --- a/mods/tinker/tconstruct/common/TContent.java +++ b/mods/tinker/tconstruct/common/TContent.java @@ -8,6 +8,7 @@ import mods.tinker.tconstruct.entity.projectile.*; import mods.tinker.tconstruct.items.*; import mods.tinker.tconstruct.items.blocks.*; import mods.tinker.tconstruct.items.tools.*; +import mods.tinker.tconstruct.items.armor.*; import mods.tinker.tconstruct.library.*; import mods.tinker.tconstruct.library.client.TConstructClientRegistry; import mods.tinker.tconstruct.library.crafting.*; @@ -149,6 +150,11 @@ public class TContent implements IFuelHandler public static Item note; //Wearaables + public static Item heavyHelmet; + public static Item heavyChestplate; + public static Item heavyPants; + public static Item heavyBoots; + public static Item heartContainer; public TContent() @@ -352,6 +358,7 @@ public class TContent implements IFuelHandler //lumberHead = new ToolPart(PHConstruct.lumberHead, 0, broadheads).setUnlocalizedName("tconstruct.LumberHead"); //Wearables + //heavyHelmet = new TArmorBase(PHConstruct.heavyHelmet, 0).setUnlocalizedName("tconstruct.HeavyHelmet"); //heartContainer = new HeartContainer(PHConstruct.heartContainer).setUnlocalizedName("tconstruct.canister"); //Vanilla stack sizes @@ -363,6 +370,11 @@ public class TContent implements IFuelHandler Item.minecartCrate.setMaxStackSize(3); Item.minecartPowered.setMaxStackSize(3); Block.torchWood.setTickRandomly(false); + if (PHConstruct.clearWater) + { + Block.waterMoving.setLightOpacity(1); + Block.waterStill.setLightOpacity(1); + } } void registerMaterials () diff --git a/mods/tinker/tconstruct/items/armor/TArmorBase.java b/mods/tinker/tconstruct/items/armor/TArmorBase.java new file mode 100644 index 0000000..cfe2d41 --- /dev/null +++ b/mods/tinker/tconstruct/items/armor/TArmorBase.java @@ -0,0 +1,118 @@ +package mods.tinker.tconstruct.items.armor; + +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumArmorMaterial; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class TArmorBase extends ItemArmor + //implements ISpecialArmor +{ + Icon[] icons; + String[] iconNames = { "wood_helmet" }; + + public TArmorBase(int id, int armorSlot) + { + super(id, EnumArmorMaterial.CLOTH, 0, armorSlot); + this.maxStackSize = 1; + this.setMaxDamage(100); + setNoRepair(); + canRepair = false; + this.setCreativeTab(CreativeTabs.tabMisc); + //this.setCreativeTab(TConstructRegistry.toolTab); + } + + public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) + { + + } + + /** + * Called by RenderBiped and RenderPlayer to determine the armor texture that + * should be use for the currently equiped item. + * This will only be called on instances of ItemArmor. + * + * Returning null from this function will use the default value. + * + * @param stack ItemStack for the equpt armor + * @param entity The entity wearing the armor + * @param slot The slot the armor is in + * @param layer The render layer, either 1 or 2, 2 is only used for CLOTH armor by default + * @return Path of texture to bind, or null to use default + */ + public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) + { + return "/mods/tinker/textures/armor/wood_1.png"; + } + + /** + * Override this method to have an item handle its own armor rendering. + * + * @param entityLiving The entity wearing the armor + * @param itemStack The itemStack to render the model of + * @param armorSlot 0=head, 1=torso, 2=legs, 3=feet + * + * @return A ModelBiped to render instead of the default + */ + @SideOnly(Side.CLIENT) + public ModelBiped getArmorModel(EntityLiving entityLiving, ItemStack itemStack, int armorSlot) + { + return null; + } + + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() + { + return false; + } + + @SideOnly(Side.CLIENT) + @Override + public Icon getIconFromDamage(int meta) + { + return icons[0]; + } + + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IconRegister iconRegister) + { + this.icons = new Icon[iconNames.length]; + + for (int i = 0; i < this.icons.length; ++i) + { + this.icons[i] = iconRegister.registerIcon("tinker:armor/"+iconNames[i]); + } + } + + /*@Override + public ArmorProperties getProperties (EntityLiving player, ItemStack armor, DamageSource source, double damage, int slot) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public int getArmorDisplay (EntityPlayer player, ItemStack armor, int slot) + { + // TODO Auto-generated method stub + return 0; + } + + @Override + public void damageArmor (EntityLiving entity, ItemStack stack, DamageSource source, int damage, int slot) + { + // TODO Auto-generated method stub + + }*/ +} diff --git a/mods/tinker/tconstruct/items/tools/Chisel.java b/mods/tinker/tconstruct/items/tools/Chisel.java index 3d3da7f..b347ef3 100644 --- a/mods/tinker/tconstruct/items/tools/Chisel.java +++ b/mods/tinker/tconstruct/items/tools/Chisel.java @@ -43,6 +43,11 @@ public class Chisel extends ToolCore boolean detailed = false; return detailed; } + + public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ) + { + return false; + } @Override public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer entityplayer) diff --git a/mods/tinker/tconstruct/library/tools/DualHarvestTool.java b/mods/tinker/tconstruct/library/tools/DualHarvestTool.java index 9ce513c..88fbbb7 100644 --- a/mods/tinker/tconstruct/library/tools/DualHarvestTool.java +++ b/mods/tinker/tconstruct/library/tools/DualHarvestTool.java @@ -2,8 +2,11 @@ package mods.tinker.tconstruct.library.tools; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.nbt.NBTTagCompound; @@ -14,116 +17,144 @@ import net.minecraftforge.common.MinecraftForge; public abstract class DualHarvestTool extends HarvestTool { - public DualHarvestTool(int itemID, int baseDamage) - { - super(itemID, baseDamage); - } - - @Override - public int getHeadType () - { - return 3; - } - - @Override - public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) - { - NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); - World world = player.worldObj; - int bID = player.worldObj.getBlockId(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - Block block = Block.blocksList[bID]; - if (block == null || bID < 1) - return false; - int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); - int shlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getSecondHarvestType()); - - if (hlvl <= tags.getInteger("HarvestLevel") && shlvl <= tags.getInteger("HarvestLevel2")) - { - if (tags.getBoolean("Lava") && block.quantityDropped(meta, 0, random) != 0) - { - ItemStack smeltStack = new ItemStack(block.idDropped(block.blockID, random, 0), 1, block.damageDropped(meta)); + public DualHarvestTool(int itemID, int baseDamage) + { + super(itemID, baseDamage); + } + + @Override + public int getHeadType () + { + return 3; + } + + @Override + public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPlayer player) + { + NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + World world = player.worldObj; + int bID = player.worldObj.getBlockId(x, y, z); + int meta = world.getBlockMetadata(x, y, z); + Block block = Block.blocksList[bID]; + if (block == null || bID < 1) + return false; + int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); + int shlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getSecondHarvestType()); + + if (hlvl <= tags.getInteger("HarvestLevel") && shlvl <= tags.getInteger("HarvestLevel2")) + { + if (tags.getBoolean("Lava") && block.quantityDropped(meta, 0, random) != 0) + { + ItemStack smeltStack = new ItemStack(block.idDropped(block.blockID, random, 0), 1, block.damageDropped(meta)); if (smeltStack.itemID < 0 || smeltStack.itemID >= 32000 || smeltStack.getItem() == null) return false; ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(smeltStack); - if (result != null) - { - //System.out.println("Woo~"); - world.setBlockToAir(x, y, z); - if (!player.capabilities.isCreativeMode) - onBlockDestroyed(stack, world, bID, x, y, z, player); - if (!world.isRemote) - { - EntityItem entityitem = new EntityItem(world, x+0.5, y+0.5, z+0.5, result.copy()); - - entityitem.delayBeforeCanPickup = 10; - world.spawnEntityInWorld(entityitem); - world.playAuxSFX(2001, x, y, z, bID + (meta << 12)); - } - return true; - } - } - return false; - } - else - { - if (!player.capabilities.isCreativeMode) - onBlockDestroyed(stack, world, bID, x, y, z, player); - world.setBlockToAir(x, y, z); - if (!world.isRemote) - world.playAuxSFX(2001, x, y, z, bID + (meta << 12)); - return true; - } - } + if (result != null) + { + world.setBlockToAir(x, y, z); + if (!player.capabilities.isCreativeMode) + onBlockDestroyed(stack, world, bID, x, y, z, player); + if (!world.isRemote) + { + ItemStack spawnme = result.copy(); + if (!(result.getItem() instanceof ItemBlock)) + { + int loot = EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack); + if (loot > 0) + { + spawnme.stackSize *= (random.nextInt(loot + 1) + 1); + } + } + EntityItem entityitem = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, spawnme); - @Override - public float getStrVsBlock(ItemStack stack, Block block, int meta) - { + entityitem.delayBeforeCanPickup = 10; + world.spawnEntityInWorld(entityitem); + world.playAuxSFX(2001, x, y, z, bID + (meta << 12)); - NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); - if (tags.getBoolean("Broken")) - return 0.1f; - - Material[] materials = getEffectiveMaterials(); - for (int i = 0; i < materials.length; i++) - { - if (materials[i] == block.blockMaterial ) - { - float speed = tags.getInteger("MiningSpeed"); - speed /= 100f; - int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); - int durability = tags.getInteger("Damage"); - - float shoddy = tags.getFloat("Shoddy"); - speed += shoddy*durability/100f; - - if (hlvl <= tags.getInteger("HarvestLevel")) - return speed; - return 0.1f; - } - } - materials = getEffectiveSecondaryMaterials(); - for (int i = 0; i < materials.length; i++) - { - if (materials[i] == block.blockMaterial ) - { - float speed = tags.getInteger("MiningSpeed2"); - speed /= 100f; - int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); - int durability = tags.getInteger("Damage"); - - float shoddy = tags.getFloat("Shoddy"); - speed += shoddy*durability/100f; - - if (hlvl <= tags.getInteger("HarvestLevel2")) - return speed; - return 0.1f; - } - } - return super.getStrVsBlock(stack, block, meta); - } - - public boolean canHarvestBlock (Block block) + } + for (int i = 0; i < 6; i++) + { + float f = (float) x + random.nextFloat(); + float f1 = (float) y + random.nextFloat(); + float f2 = (float) z + random.nextFloat(); + float f3 = 0.52F; + float f4 = random.nextFloat() * 0.6F - 0.3F; + world.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + world.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + + world.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + world.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + + world.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D); + world.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D); + + world.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D); + world.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D); + } + return true; + } + } + return false; + } + else + { + if (!player.capabilities.isCreativeMode) + onBlockDestroyed(stack, world, bID, x, y, z, player); + world.setBlockToAir(x, y, z); + if (!world.isRemote) + world.playAuxSFX(2001, x, y, z, bID + (meta << 12)); + return true; + } + } + + @Override + public float getStrVsBlock (ItemStack stack, Block block, int meta) + { + + NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + if (tags.getBoolean("Broken")) + return 0.1f; + + Material[] materials = getEffectiveMaterials(); + for (int i = 0; i < materials.length; i++) + { + if (materials[i] == block.blockMaterial) + { + float speed = tags.getInteger("MiningSpeed"); + speed /= 100f; + int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); + int durability = tags.getInteger("Damage"); + + float shoddy = tags.getFloat("Shoddy"); + speed += shoddy * durability / 100f; + + if (hlvl <= tags.getInteger("HarvestLevel")) + return speed; + return 0.1f; + } + } + materials = getEffectiveSecondaryMaterials(); + for (int i = 0; i < materials.length; i++) + { + if (materials[i] == block.blockMaterial) + { + float speed = tags.getInteger("MiningSpeed2"); + speed /= 100f; + int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); + int durability = tags.getInteger("Damage"); + + float shoddy = tags.getFloat("Shoddy"); + speed += shoddy * durability / 100f; + + if (hlvl <= tags.getInteger("HarvestLevel2")) + return speed; + return 0.1f; + } + } + return super.getStrVsBlock(stack, block, meta); + } + + public boolean canHarvestBlock (Block block) { if (block.blockMaterial.isToolNotRequired()) { @@ -141,13 +172,14 @@ public abstract class DualHarvestTool extends HarvestTool } return false; } - - @Override - public String[] toolCategories() + + @Override + public String[] toolCategories () { return new String[] { "harvest", "dualharvest" }; } - - protected abstract Material[] getEffectiveSecondaryMaterials(); - protected abstract String getSecondHarvestType(); + + protected abstract Material[] getEffectiveSecondaryMaterials (); + + protected abstract String getSecondHarvestType (); } diff --git a/mods/tinker/tconstruct/library/tools/HarvestTool.java b/mods/tinker/tconstruct/library/tools/HarvestTool.java index 762dd12..6433d48 100644 --- a/mods/tinker/tconstruct/library/tools/HarvestTool.java +++ b/mods/tinker/tconstruct/library/tools/HarvestTool.java @@ -28,7 +28,8 @@ public abstract class HarvestTool extends ToolCore public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPlayer player) { TContent.modL.midStreamModify(stack); - NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + return super.onBlockStartBreak(stack, x, y, z, player); + /*NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); World world = player.worldObj; int bID = player.worldObj.getBlockId(x, y, z); int meta = world.getBlockMetadata(x, y, z); @@ -80,7 +81,7 @@ public abstract class HarvestTool extends ToolCore if (!world.isRemote) world.playAuxSFX(2001, x, y, z, bID + (meta << 12)); return true; - } + }*/ } @Override diff --git a/mods/tinker/tconstruct/library/tools/ToolCore.java b/mods/tinker/tconstruct/library/tools/ToolCore.java index 96c6b34..7e7d64e 100644 --- a/mods/tinker/tconstruct/library/tools/ToolCore.java +++ b/mods/tinker/tconstruct/library/tools/ToolCore.java @@ -14,11 +14,14 @@ import mods.tinker.tconstruct.library.crafting.ToolBuilder; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.nbt.NBTTagCompound; @@ -187,8 +190,8 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox Map.Entry pairs = (Map.Entry) iter.next(); effectIcons.put((Integer) pairs.getKey(), iconRegister.registerIcon((String) pairs.getValue())); } - - emptyIcon = iconRegister.registerIcon("tinker:blankface"); + + emptyIcon = iconRegister.registerIcon("tinker:blankface"); } @Override @@ -450,7 +453,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox { return TConstructRegistry.toolRod; } - + /* Updating */ public void onUpdate (ItemStack stack, World world, Entity entity, int par4, boolean par5) @@ -464,17 +467,17 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox int check = world.canBlockSeeTheSky((int) entity.posX, (int) entity.posY, (int) entity.posZ) ? 350 : 1150; if (random.nextInt(check) < chance) { - AbilityHelper.healTool(stack, 1, (EntityLiving) entity, true, !((EntityLiving)entity).isSwingInProgress); + AbilityHelper.healTool(stack, 1, (EntityLiving) entity, true, !((EntityLiving) entity).isSwingInProgress); } } } } /* Tool uses */ - + //Types - public abstract String[] toolCategories(); - + public abstract String[] toolCategories (); + //Mining @Override public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPlayer player) @@ -484,10 +487,12 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox int bID = player.worldObj.getBlockId(x, y, z); int meta = world.getBlockMetadata(x, y, z); Block block = Block.blocksList[bID]; + if (block == null || bID < 1 || bID > 4095) + return false; if (tags.getBoolean("Lava") && block.quantityDropped(meta, 0, random) != 0) { - ItemStack smeltStack = new ItemStack(block.idDropped(block.blockID, random, 0), 1, block.damageDropped(meta)); + ItemStack smeltStack = new ItemStack(block.idDropped(meta, random, 0), 1, block.damageDropped(meta)); if (smeltStack.itemID < 0 || smeltStack.itemID >= 32000 || smeltStack.getItem() == null) return false; ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(smeltStack); @@ -498,12 +503,40 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox onBlockDestroyed(stack, world, bID, x, y, z, player); if (!world.isRemote) { - EntityItem entityitem = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, result.copy()); + ItemStack spawnme = result.copy(); + if (!(result.getItem() instanceof ItemBlock)) + { + int loot = EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack); + if (loot > 0) + { + spawnme.stackSize *= (random.nextInt(loot + 1) + 1); + } + } + EntityItem entityitem = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, spawnme); entityitem.delayBeforeCanPickup = 10; world.spawnEntityInWorld(entityitem); world.playAuxSFX(2001, x, y, z, bID + (meta << 12)); } + for (int i = 0; i < 6; i++) + { + float f = (float) x + random.nextFloat(); + float f1 = (float) y + random.nextFloat(); + float f2 = (float) z + random.nextFloat(); + float f3 = 0.52F; + float f4 = random.nextFloat() * 0.6F - 0.3F; + world.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + world.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + + world.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + world.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + + world.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D); + world.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D); + + world.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D); + world.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D); + } return true; } } @@ -560,8 +593,35 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox { return 1f; } - /* - * IC2 Support + + //Right-click + public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ) + { + int hotbarSlot = player.inventory.currentItem; + if (hotbarSlot == 0) + { + ItemStack next = player.inventory.getStackInSlot(8); + if (next != null && next.getItem() instanceof ItemBlock) + { + next.getItem().onItemUse(next, player, world, x, y, z, side, clickX, clickY, clickZ); + if (next.stackSize < 1) + player.inventory.setInventorySlotContents(8, null); + } + } + else if (hotbarSlot < 8) + { + ItemStack next = player.inventory.getStackInSlot(hotbarSlot + 1); + if (next != null && next.getItem() instanceof ItemBlock) + { + next.getItem().onItemUse(next, player, world, x, y, z, side, clickX, clickY, clickZ); + if (next.stackSize < 1) + player.inventory.setInventorySlotContents(hotbarSlot + 1, null); + } + } + return false; + } + + /* IC2 Support * Every tool can be an electric tool if you modify it right */ @Override @@ -713,17 +773,17 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox { return false; } - - public boolean isRepairable() + + public boolean isRepairable () { return false; } - + public int getItemEnchantability () { return 0; } - + public boolean isFull3D () { return true; diff --git a/mods/tinker/tconstruct/library/tools/Weapon.java b/mods/tinker/tconstruct/library/tools/Weapon.java index 7a18405..30f0e50 100644 --- a/mods/tinker/tconstruct/library/tools/Weapon.java +++ b/mods/tinker/tconstruct/library/tools/Weapon.java @@ -6,6 +6,7 @@ import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; +import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.world.World; @@ -68,6 +69,11 @@ public abstract class Weapon extends ToolCore return stack; } + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ) + { + return false; + } + /** * Returns if the item (tool) can harvest results from the block type. */ diff --git a/mods/tinker/tconstruct/util/PHConstruct.java b/mods/tinker/tconstruct/util/PHConstruct.java index f578707..c4d8fa1 100644 --- a/mods/tinker/tconstruct/util/PHConstruct.java +++ b/mods/tinker/tconstruct/util/PHConstruct.java @@ -44,6 +44,8 @@ public class PHConstruct //removeToolRecipes = config.get("Diffuclty Changes", "Remove vanilla tool recipes", false).getBoolean(false); keepHunger = config.get("Difficulty Changes", "Keep hunger on death", true).getBoolean(true); keepLevels = config.get("Difficulty Changes", "Keep levels on death", true).getBoolean(true); + clearWater = config.get("Difficulty Changes", "Turn water clear", true).getBoolean(true); + voidFog = config.get("Difficulty Changes", "Remove Overworld void fog", true).getBoolean(true); /*disableWoodTools = config.get("Difficulty Changes", "Disable vanilla wooden tools", false).getBoolean(false); disableStoneTools = config.get("Difficulty Changes", "Disable vanilla stone tools", true).getBoolean(true); @@ -141,6 +143,7 @@ public class PHConstruct oreChunks = config.getItem("Patterns and Misc", "Ore Chunks", 14104).getInt(14104); heartContainer = config.getItem("Equipables", "Heart Canister", 14105).getInt(14105); + heavyHelmet = config.getItem("Equipables", "Heavy Helmet", 14106).getInt(14106); boolean ic2 = true; boolean xycraft = true; @@ -321,7 +324,12 @@ public class PHConstruct public static int binding; - //Equipables + //Wearables + public static int heavyHelmet; + public static int heavyChestplate; + public static int heavyPants; + public static int heavyBoots; + public static int heartContainer; //Ore values @@ -397,6 +405,8 @@ public class PHConstruct //Difficulty modifiers public static boolean keepHunger; public static boolean keepLevels; + public static boolean clearWater; + public static boolean voidFog; public static boolean disableWoodTools; public static boolean disableStoneTools; diff --git a/mods/tinker/tconstruct/util/TEventHandler.java b/mods/tinker/tconstruct/util/TEventHandler.java index ce3a7dc..a59d2d3 100644 --- a/mods/tinker/tconstruct/util/TEventHandler.java +++ b/mods/tinker/tconstruct/util/TEventHandler.java @@ -10,14 +10,20 @@ import mods.tinker.tconstruct.entity.NitroCreeper; import mods.tinker.tconstruct.library.crafting.PatternBuilder; import mods.tinker.tconstruct.library.crafting.Smeltery; import mods.tinker.tconstruct.library.crafting.ToolBuilder; +import mods.tinker.tconstruct.library.tools.ToolCore; +import mods.tinker.tconstruct.library.util.IFacingLogic; import mods.tinker.tconstruct.modifiers.ModAttack; +import net.minecraft.block.Block; +import net.minecraft.entity.monster.EntityGhast; import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.entity.passive.EntityChicken; import net.minecraft.entity.passive.EntityCow; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EntityDamageSource; import net.minecraft.util.EnumMovingObjectType; +import net.minecraft.world.World; import net.minecraftforge.client.event.TextureStitchEvent; import net.minecraftforge.client.event.sound.SoundLoadEvent; import net.minecraftforge.event.Event.Result; @@ -25,6 +31,8 @@ import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.entity.living.LivingHurtEvent; import net.minecraftforge.event.entity.player.FillBucketEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; import net.minecraftforge.liquids.LiquidStack; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary.OreRegisterEvent; @@ -112,6 +120,11 @@ public class TEventHandler skeleton.entityDropItem(new ItemStack(TContent.materials, 1, 8), 0f); } } + + else if (event.entityLiving.getClass() == EntityGhast.class) + { + event.entityLiving.entityDropItem(new ItemStack(Item.ghastTear), 0); + } } /* Ore Dictionary */ @@ -642,10 +655,9 @@ public class TEventHandler int hitY = evt.target.blockY; int hitZ = evt.target.blockZ; - if (!evt.entityPlayer.canPlayerEdit(hitX, hitY, hitZ, evt.target.sideHit, evt.current)) + if (evt.entityPlayer != null && !evt.entityPlayer.canPlayerEdit(hitX, hitY, hitZ, evt.target.sideHit, evt.current)) { return; - //return evt.current; } int bID = evt.world.getBlockId(hitX, hitY, hitZ); diff --git a/mods/tinker/tconstruct/util/player/TPlayerHandler.java b/mods/tinker/tconstruct/util/player/TPlayerHandler.java index 882f09d..e097903 100644 --- a/mods/tinker/tconstruct/util/player/TPlayerHandler.java +++ b/mods/tinker/tconstruct/util/player/TPlayerHandler.java @@ -28,287 +28,290 @@ import cpw.mods.fml.relauncher.Side; public class TPlayerHandler implements IPlayerTracker { - /* Player */ - //public int hunger; - public ConcurrentHashMap playerStats = new ConcurrentHashMap(); + /* Player */ + //public int hunger; + public ConcurrentHashMap playerStats = new ConcurrentHashMap(); - @Override - public void onPlayerLogin (EntityPlayer entityplayer) - { - //Lookup player - TFoodStats food = new TFoodStats(); - food.readStats(entityplayer.foodStats); - entityplayer.foodStats = food; - NBTTagCompound tags = entityplayer.getEntityData(); - if (!tags.hasKey("TConstruct")) - { - tags.setCompoundTag("TConstruct", new NBTTagCompound()); - } - TPlayerStats stats = new TPlayerStats(); - stats.player = new WeakReference(entityplayer); + @Override + public void onPlayerLogin (EntityPlayer entityplayer) + { + //Lookup player + TFoodStats food = new TFoodStats(); + food.readStats(entityplayer.foodStats); + entityplayer.foodStats = food; + NBTTagCompound tags = entityplayer.getEntityData(); + if (!tags.hasKey("TConstruct")) + { + tags.setCompoundTag("TConstruct", new NBTTagCompound()); + } + TPlayerStats stats = new TPlayerStats(); + stats.player = new WeakReference(entityplayer); stats.armor = new ArmorExtended(); stats.armor.init(entityplayer); stats.armor.loadFromNBT(entityplayer); - - stats.level = entityplayer.experienceLevel; - stats.health = entityplayer.maxHealth; - stats.hunger = entityplayer.getFoodStats().getFoodLevel(); - stats.beginnerManual = tags.getCompoundTag("TConstruct").getBoolean("beginnerManual"); - stats.materialManual = tags.getCompoundTag("TConstruct").getBoolean("materialManual"); - stats.smelteryManual = tags.getCompoundTag("TConstruct").getBoolean("smelteryManual"); - if (!stats.beginnerManual) - { - tags.getCompoundTag("TConstruct").setBoolean("beginnerManual", true); - ItemStack diary = new ItemStack(TContent.manualBook); - if (!entityplayer.inventory.addItemStackToInventory(diary)) - { - AbilityHelper.spawnItemAtPlayer(entityplayer, diary); - } - } - playerStats.put(entityplayer.username, stats); - } + stats.level = entityplayer.experienceLevel; + stats.health = entityplayer.maxHealth; + stats.hunger = entityplayer.getFoodStats().getFoodLevel(); + stats.beginnerManual = tags.getCompoundTag("TConstruct").getBoolean("beginnerManual"); + stats.materialManual = tags.getCompoundTag("TConstruct").getBoolean("materialManual"); + stats.smelteryManual = tags.getCompoundTag("TConstruct").getBoolean("smelteryManual"); + if (!stats.beginnerManual) + { + tags.getCompoundTag("TConstruct").setBoolean("beginnerManual", true); + ItemStack diary = new ItemStack(TContent.manualBook); + if (!entityplayer.inventory.addItemStackToInventory(diary)) + { + AbilityHelper.spawnItemAtPlayer(entityplayer, diary); + } + } - @Override - public void onPlayerLogout (EntityPlayer entityplayer) - { - getPlayerStats(entityplayer.username).armor.saveToNBT(entityplayer); - playerStats.remove(entityplayer.username); - } + playerStats.put(entityplayer.username, stats); + } - @Override - public void onPlayerChangedDimension (EntityPlayer entityplayer) - { - //Nothing? + @Override + public void onPlayerLogout (EntityPlayer entityplayer) + { + if (entityplayer != null) + { + getPlayerStats(entityplayer.username).armor.saveToNBT(entityplayer); + playerStats.remove(entityplayer.username); + } + } - } + @Override + public void onPlayerChangedDimension (EntityPlayer entityplayer) + { + //Nothing? - @Override - public void onPlayerRespawn (EntityPlayer entityplayer) - { - //Boom! - TPlayerStats stats = getPlayerStats(entityplayer.username); - stats.player = new WeakReference(entityplayer); + } + + @Override + public void onPlayerRespawn (EntityPlayer entityplayer) + { + //Boom! + TPlayerStats stats = getPlayerStats(entityplayer.username); + stats.player = new WeakReference(entityplayer); TFoodStats food = new TFoodStats(); entityplayer.foodStats = food; - - if (PHConstruct.keepLevels) - entityplayer.experienceLevel = stats.level; - if (PHConstruct.keepHunger) - entityplayer.getFoodStats().addStats(-1*(20 - stats.hunger), 0); - NBTTagCompound tags = entityplayer.getEntityData(); - NBTTagCompound tTag = new NBTTagCompound(); - tTag.setBoolean("beginnerManual", stats.beginnerManual); - tTag.setBoolean("materialManual", stats.materialManual); - tTag.setBoolean("smelteryManual", stats.smelteryManual); - tags.setCompoundTag("TConstruct", tTag); - Side side = FMLCommonHandler.instance().getEffectiveSide(); - if (side == Side.CLIENT) - { - //TProxyClient.controlInstance.resetControls(); - if (PHConstruct.keepHunger) - entityplayer.getFoodStats().setFoodLevel(stats.hunger); - } - } + if (PHConstruct.keepLevels) + entityplayer.experienceLevel = stats.level; + if (PHConstruct.keepHunger) + entityplayer.getFoodStats().addStats(-1 * (20 - stats.hunger), 0); + NBTTagCompound tags = entityplayer.getEntityData(); + NBTTagCompound tTag = new NBTTagCompound(); + tTag.setBoolean("beginnerManual", stats.beginnerManual); + tTag.setBoolean("materialManual", stats.materialManual); + tTag.setBoolean("smelteryManual", stats.smelteryManual); + tags.setCompoundTag("TConstruct", tTag); - @ForgeSubscribe - public void livingFall (LivingFallEvent evt) //Only for negating fall damage - { - if (evt.entityLiving instanceof EntityPlayer) - { - /*Side side = FMLCommonHandler.instance().getEffectiveSide(); - if (side == Side.CLIENT) - { - TProxyClient.controlInstance.landOnGround(); - }*/ - //else - //System.out.println("Server side"); + Side side = FMLCommonHandler.instance().getEffectiveSide(); + if (side == Side.CLIENT) + { + //TProxyClient.controlInstance.resetControls(); + if (PHConstruct.keepHunger) + entityplayer.getFoodStats().setFoodLevel(stats.hunger); + } + } - evt.distance -= 1; - //evt.distance = 0; - //TPlayerStats stats = playerStats.get(((EntityPlayer)evt.entityLiving).username); - //stats.prevMotionY = evt.entityLiving.motionY; - //evt.entityLiving.motionY = 10.2; - } - } + @ForgeSubscribe + public void livingFall (LivingFallEvent evt) //Only for negating fall damage + { + if (evt.entityLiving instanceof EntityPlayer) + { + /*Side side = FMLCommonHandler.instance().getEffectiveSide(); + if (side == Side.CLIENT) + { + TProxyClient.controlInstance.landOnGround(); + }*/ + //else + //System.out.println("Server side"); - /*@ForgeSubscribe - public void livingUpdate (LivingUpdateEvent evt) - { - Side side = FMLCommonHandler.instance().getEffectiveSide(); - if (side == Side.CLIENT && evt.entityLiving instanceof EntityPlayer) - { - EntityPlayer player = (EntityPlayer) evt.entityLiving; - TPlayerStats stats = playerStats.get(player.username); - if (player.onGround != stats.prevOnGround) - { - if (player.onGround)// && -stats.prevMotionY > 0.1) - //player.motionY = 0.5; - player.motionY = -stats.prevMotionY * 0.8; - //player.motionY *= -1.2; - stats.prevOnGround = player.onGround; - //if () - - //System.out.println("Fall: "+player.fallDistance); - } - } - }*/ + evt.distance -= 1; + //evt.distance = 0; + //TPlayerStats stats = playerStats.get(((EntityPlayer)evt.entityLiving).username); + //stats.prevMotionY = evt.entityLiving.motionY; + //evt.entityLiving.motionY = 10.2; + } + } - @ForgeSubscribe - public void playerDrops (PlayerDropsEvent evt) - { - TPlayerStats stats = getPlayerStats(evt.entityPlayer.username); - stats.level = evt.entityPlayer.experienceLevel / 2; - //stats.health = 20; - int hunger = evt.entityPlayer.getFoodStats().getFoodLevel(); - if (hunger < 6) - stats.hunger = 6; - else - stats.hunger = evt.entityPlayer.getFoodStats().getFoodLevel(); - } + /*@ForgeSubscribe + public void livingUpdate (LivingUpdateEvent evt) + { + Side side = FMLCommonHandler.instance().getEffectiveSide(); + if (side == Side.CLIENT && evt.entityLiving instanceof EntityPlayer) + { + EntityPlayer player = (EntityPlayer) evt.entityLiving; + TPlayerStats stats = playerStats.get(player.username); + if (player.onGround != stats.prevOnGround) + { + if (player.onGround)// && -stats.prevMotionY > 0.1) + //player.motionY = 0.5; + player.motionY = -stats.prevMotionY * 0.8; + //player.motionY *= -1.2; + stats.prevOnGround = player.onGround; + //if () + + //System.out.println("Fall: "+player.fallDistance); + } + } + }*/ - /* Find the right player */ - public TPlayerStats getPlayerStats (String username) - { - TPlayerStats stats = playerStats.get(username); + @ForgeSubscribe + public void playerDrops (PlayerDropsEvent evt) + { + TPlayerStats stats = getPlayerStats(evt.entityPlayer.username); + stats.level = evt.entityPlayer.experienceLevel / 2; + //stats.health = 20; + int hunger = evt.entityPlayer.getFoodStats().getFoodLevel(); + if (hunger < 6) + stats.hunger = 6; + else + stats.hunger = evt.entityPlayer.getFoodStats().getFoodLevel(); + } + + /* Find the right player */ + public TPlayerStats getPlayerStats (String username) + { + TPlayerStats stats = playerStats.get(username); //System.out.println("Stats: "+stats); - if (stats == null) - { - stats = new TPlayerStats(); - playerStats.put(username, stats); - } - return stats; - } + if (stats == null) + { + stats = new TPlayerStats(); + playerStats.put(username, stats); + } + return stats; + } - public EntityPlayer getEntityPlayer (String username) - { - TPlayerStats stats = playerStats.get(username); - if (stats == null) - { - return null; - } - else - { - return stats.player.get(); - } - } + public EntityPlayer getEntityPlayer (String username) + { + TPlayerStats stats = playerStats.get(username); + if (stats == null) + { + return null; + } + else + { + return stats.player.get(); + } + } - /* Modify Player */ - public void updateSize (String user, float offset) - { - /*EntityPlayer player = getEntityPlayer(user); - setEntitySize(0.6F, offset, player); - player.yOffset = offset - 0.18f;*/ - } + /* Modify Player */ + public void updateSize (String user, float offset) + { + /*EntityPlayer player = getEntityPlayer(user); + setEntitySize(0.6F, offset, player); + player.yOffset = offset - 0.18f;*/ + } - public static void setEntitySize (float width, float height, Entity entity) - { - //System.out.println("Size: " + height); - if (width != entity.width || height != entity.height) - { - entity.width = width; - entity.height = height; - entity.boundingBox.maxX = entity.boundingBox.minX + (double) entity.width; - entity.boundingBox.maxZ = entity.boundingBox.minZ + (double) entity.width; - entity.boundingBox.maxY = entity.boundingBox.minY + (double) entity.height; - } + public static void setEntitySize (float width, float height, Entity entity) + { + //System.out.println("Size: " + height); + if (width != entity.width || height != entity.height) + { + entity.width = width; + entity.height = height; + entity.boundingBox.maxX = entity.boundingBox.minX + (double) entity.width; + entity.boundingBox.maxZ = entity.boundingBox.minZ + (double) entity.width; + entity.boundingBox.maxY = entity.boundingBox.minY + (double) entity.height; + } - float que = width % 2.0F; + float que = width % 2.0F; - if ((double) que < 0.375D) - { - entity.myEntitySize = EnumEntitySize.SIZE_1; - } - else if ((double) que < 0.75D) - { - entity.myEntitySize = EnumEntitySize.SIZE_2; - } - else if ((double) que < 1.0D) - { - entity.myEntitySize = EnumEntitySize.SIZE_3; - } - else if ((double) que < 1.375D) - { - entity.myEntitySize = EnumEntitySize.SIZE_4; - } - else if ((double) que < 1.75D) - { - entity.myEntitySize = EnumEntitySize.SIZE_5; - } - else - { - entity.myEntitySize = EnumEntitySize.SIZE_6; - } - //entity.yOffset = height; - } + if ((double) que < 0.375D) + { + entity.myEntitySize = EnumEntitySize.SIZE_1; + } + else if ((double) que < 0.75D) + { + entity.myEntitySize = EnumEntitySize.SIZE_2; + } + else if ((double) que < 1.0D) + { + entity.myEntitySize = EnumEntitySize.SIZE_3; + } + else if ((double) que < 1.375D) + { + entity.myEntitySize = EnumEntitySize.SIZE_4; + } + else if ((double) que < 1.75D) + { + entity.myEntitySize = EnumEntitySize.SIZE_5; + } + else + { + entity.myEntitySize = EnumEntitySize.SIZE_6; + } + //entity.yOffset = height; + } - Random rand = new Random(); + Random rand = new Random(); - /* Bows */ - /*@ForgeSubscribe - public void arrowShoot (ArrowLooseEvent event) - { - event.setCanceled(true); - int j = event.charge; + /* Bows */ + /*@ForgeSubscribe + public void arrowShoot (ArrowLooseEvent event) + { + event.setCanceled(true); + int j = event.charge; - boolean flag = event.entityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, event.bow) > 0; + boolean flag = event.entityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, event.bow) > 0; - if (flag || event.entityPlayer.inventory.hasItem(Item.arrow.itemID)) - { - float f = (float) j / 20.0F; - f = (f * f + f * 2.0F) / 3.0F; + if (flag || event.entityPlayer.inventory.hasItem(Item.arrow.itemID)) + { + float f = (float) j / 20.0F; + f = (f * f + f * 2.0F) / 3.0F; - if ((double) f < 0.1D) - { - return; - } + if ((double) f < 0.1D) + { + return; + } - if (f > 1.0F) - { - f = 1.0F; - } + if (f > 1.0F) + { + f = 1.0F; + } - EntityArrow entityarrow = new EntityArrow(event.entityPlayer.worldObj, event.entityPlayer, f * 2.0F); + EntityArrow entityarrow = new EntityArrow(event.entityPlayer.worldObj, event.entityPlayer, f * 2.0F); - if (f == 1.0F) - { - entityarrow.setIsCritical(true); - } + if (f == 1.0F) + { + entityarrow.setIsCritical(true); + } - int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, event.bow); + int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, event.bow); - entityarrow.setDamage(1.5D + k * 0.45D); + entityarrow.setDamage(1.5D + k * 0.45D); - int l = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, event.bow); + int l = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, event.bow); - if (l > 0) - { - entityarrow.setKnockbackStrength(l); - } + if (l > 0) + { + entityarrow.setKnockbackStrength(l); + } - if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, event.bow) > 0) - { - entityarrow.setFire(100); - } + if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, event.bow) > 0) + { + entityarrow.setFire(100); + } - event.bow.damageItem(1, event.entityPlayer); - event.entityPlayer.worldObj.playSoundAtEntity(event.entityPlayer, "random.bow", 1.0F, 1.0F / (rand.nextFloat() * 0.4F + 1.2F) + f * 0.5F); + event.bow.damageItem(1, event.entityPlayer); + event.entityPlayer.worldObj.playSoundAtEntity(event.entityPlayer, "random.bow", 1.0F, 1.0F / (rand.nextFloat() * 0.4F + 1.2F) + f * 0.5F); - if (flag) - { - entityarrow.canBePickedUp = 2; - } - else - { - event.entityPlayer.inventory.consumeInventoryItem(Item.arrow.itemID); - } + if (flag) + { + entityarrow.canBePickedUp = 2; + } + else + { + event.entityPlayer.inventory.consumeInventoryItem(Item.arrow.itemID); + } - if (!event.entityPlayer.worldObj.isRemote) - { - event.entityPlayer.worldObj.spawnEntityInWorld(entityarrow); - } - } - }*/ + if (!event.entityPlayer.worldObj.isRemote) + { + event.entityPlayer.worldObj.spawnEntityInWorld(entityarrow); + } + } + }*/ } diff --git a/mods/tinker/tconstruct/worldgen/OverworldProvider.java b/mods/tinker/tconstruct/worldgen/OverworldProvider.java index e8b8f9a..0edcd6d 100644 --- a/mods/tinker/tconstruct/worldgen/OverworldProvider.java +++ b/mods/tinker/tconstruct/worldgen/OverworldProvider.java @@ -1,5 +1,6 @@ package mods.tinker.tconstruct.worldgen; +import mods.tinker.tconstruct.util.PHConstruct; import net.minecraft.world.WorldProvider; public class OverworldProvider extends WorldProvider @@ -11,7 +12,14 @@ public class OverworldProvider extends WorldProvider return "Overworld"; } - public float calculateCelestialAngle(long worldtime, float par3) + public boolean getWorldHasVoidParticles() + { + if (PHConstruct.voidFog) + return false; + return this.terrainType.hasVoidParticles(this.hasNoSky); + } + + /*public float calculateCelestialAngle(long worldtime, float par3) { int timeOfDay = (int)(worldtime % 43200L); float f1 = ((float)timeOfDay + par3) / 43200.0F - 0.25F; @@ -35,5 +43,5 @@ public class OverworldProvider extends WorldProvider public int getMoonPhase(long par1) { return (int)(par1 / 43200L) % 8; - } + }*/ } diff --git a/mods/tinker/textures/armor/wood_1.png b/mods/tinker/textures/armor/wood_1.png index 0b6d4d6..d599ecb 100644 Binary files a/mods/tinker/textures/armor/wood_1.png and b/mods/tinker/textures/armor/wood_1.png differ diff --git a/mods/tinker/textures/entity/wagon.png b/mods/tinker/textures/entity/wagon.png deleted file mode 100644 index e67e29e..0000000 Binary files a/mods/tinker/textures/entity/wagon.png and /dev/null differ diff --git a/mods/tinker/textures/entity/wagontexture.png b/mods/tinker/textures/entity/wagontexture.png deleted file mode 100644 index 817de29..0000000 Binary files a/mods/tinker/textures/entity/wagontexture.png and /dev/null differ diff --git a/mods/tinker/textures/gui/icons.png b/mods/tinker/textures/gui/icons.png index 187e887..4048ff9 100644 Binary files a/mods/tinker/textures/gui/icons.png and b/mods/tinker/textures/gui/icons.png differ diff --git a/mods/tinker/textures/gui/toolparts.png b/mods/tinker/textures/gui/toolparts.png index 4072b97..5aa1954 100644 Binary files a/mods/tinker/textures/gui/toolparts.png and b/mods/tinker/textures/gui/toolparts.png differ diff --git a/mods/tinker/textures/gui/toolstation.png b/mods/tinker/textures/gui/toolstation.png index eacecdd..30fa118 100644 Binary files a/mods/tinker/textures/gui/toolstation.png and b/mods/tinker/textures/gui/toolstation.png differ diff --git a/mods/tinker/textures/items/armor/wood_boots.png b/mods/tinker/textures/items/armor/wood_boots.png new file mode 100644 index 0000000..ecea7e6 Binary files /dev/null and b/mods/tinker/textures/items/armor/wood_boots.png differ diff --git a/mods/tinker/textures/items/armor/wood_chestplate.png b/mods/tinker/textures/items/armor/wood_chestplate.png new file mode 100644 index 0000000..1468741 Binary files /dev/null and b/mods/tinker/textures/items/armor/wood_chestplate.png differ diff --git a/mods/tinker/textures/items/armor/wood_helmet.png b/mods/tinker/textures/items/armor/wood_helmet.png new file mode 100644 index 0000000..40279be Binary files /dev/null and b/mods/tinker/textures/items/armor/wood_helmet.png differ diff --git a/mods/tinker/textures/items/armor/wood_pants.png b/mods/tinker/textures/items/armor/wood_pants.png new file mode 100644 index 0000000..20b98c9 Binary files /dev/null and b/mods/tinker/textures/items/armor/wood_pants.png differ