diff --git a/mods/tinker/armory/PHArmory.java b/mods/tinker/armory/PHArmory.java index 53a7c6dd..1050da77 100644 --- a/mods/tinker/armory/PHArmory.java +++ b/mods/tinker/armory/PHArmory.java @@ -24,11 +24,11 @@ public class PHArmory try { newFile.createNewFile(); - System.out.println("Successfully read configuration file for mod_FloraBerries"); + System.out.println("Successfully read configuration file for mod_NBerries"); } catch (IOException e) { - System.out.println("Could not read configuration file for mod_FloraBerries. Reason:"); + System.out.println("Could not read configuration file for mod_NBerries. Reason:"); System.out.println(e); } diff --git a/mods/tinker/tconstruct/PHConstruct.java b/mods/tinker/tconstruct/PHConstruct.java index 561fc793..eae80e57 100644 --- a/mods/tinker/tconstruct/PHConstruct.java +++ b/mods/tinker/tconstruct/PHConstruct.java @@ -54,6 +54,9 @@ public class PHConstruct { enableTCactus = config.get("Difficulty Changes", "Enable mod cactus tools", true).getBoolean(true); enableTBone = config.get("Difficulty Changes", "Enable mod bone tools", true).getBoolean(true); + unstableCreeper = config.get("Mob Spawning", "Activate Nitro Creeper Spawns", true).getBoolean(true); + blueSlime = config.get("Mob Spawning", "Activate Blue Slime Spawns", true).getBoolean(true); + woodCrafter = config.getBlock("Wood Tool Station", 1471).getInt(1471); heldItemBlock = config.getBlock("Held Item Block", 1472).getInt(1472); lavaTank = config.getBlock("Lava Tank", 1473).getInt(1473); @@ -232,6 +235,10 @@ public class PHConstruct { public static int aluminumRange; public static int netherDensity; + //Mobs + public static boolean unstableCreeper; + public static boolean blueSlime; + //Difficulty modifiers public static boolean keepHunger; public static boolean keepLevels; diff --git a/mods/tinker/tconstruct/TConstruct.java b/mods/tinker/tconstruct/TConstruct.java index 35ae0760..8d4b9e79 100644 --- a/mods/tinker/tconstruct/TConstruct.java +++ b/mods/tinker/tconstruct/TConstruct.java @@ -25,7 +25,7 @@ import cpw.mods.fml.common.registry.GameRegistry; * @author: mDiyo */ -@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.2.7") +@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.2.12") @NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.TPacketHandler.class) public class TConstruct { @@ -60,7 +60,7 @@ public class TConstruct proxy.registerRenderer(); proxy.addNames(); proxy.readManuals(); - proxy.registerKeys(); + //proxy.registerKeys(); } @Init diff --git a/mods/tinker/tconstruct/TContent.java b/mods/tinker/tconstruct/TContent.java index f2039e6d..4a424b57 100644 --- a/mods/tinker/tconstruct/TContent.java +++ b/mods/tinker/tconstruct/TContent.java @@ -7,73 +7,14 @@ import java.util.List; import mods.tinker.common.IPattern; import mods.tinker.common.RecipeRemover; import mods.tinker.common.fancyitem.FancyEntityItem; -import mods.tinker.tconstruct.blocks.EquipBlock; -import mods.tinker.tconstruct.blocks.LavaTankBlock; -import mods.tinker.tconstruct.blocks.LiquidMetalFlowing; -import mods.tinker.tconstruct.blocks.LiquidMetalStill; -import mods.tinker.tconstruct.blocks.MetalOre; -import mods.tinker.tconstruct.blocks.SearedBlock; -import mods.tinker.tconstruct.blocks.SmelteryBlock; -import mods.tinker.tconstruct.blocks.TConstructBlock; -import mods.tinker.tconstruct.blocks.ToolStationBlock; -import mods.tinker.tconstruct.crafting.LiquidCasting; -import mods.tinker.tconstruct.crafting.PatternBuilder; -import mods.tinker.tconstruct.crafting.Smeltery; -import mods.tinker.tconstruct.crafting.ToolBuilder; -import mods.tinker.tconstruct.entity.BlueSlime; -import mods.tinker.tconstruct.entity.CartEntity; -import mods.tinker.tconstruct.entity.Crystal; -import mods.tinker.tconstruct.entity.MetalSlime; -import mods.tinker.tconstruct.entity.Skyla; -import mods.tinker.tconstruct.entity.UnstableCreeper; -import mods.tinker.tconstruct.items.CraftedSoilItemBlock; -import mods.tinker.tconstruct.items.CraftingItem; -import mods.tinker.tconstruct.items.FilledBucket; -import mods.tinker.tconstruct.items.LavaTankItemBlock; -import mods.tinker.tconstruct.items.LiquidItemBlock; -import mods.tinker.tconstruct.items.MetalItemBlock; -import mods.tinker.tconstruct.items.MetalOreItemBlock; -import mods.tinker.tconstruct.items.MetalPattern; -import mods.tinker.tconstruct.items.Pattern; -import mods.tinker.tconstruct.items.PatternManual; -import mods.tinker.tconstruct.items.SearedTableItemBlock; -import mods.tinker.tconstruct.items.SmelteryItemBlock; -import mods.tinker.tconstruct.items.StrangeFood; -import mods.tinker.tconstruct.items.TitleIcon; -import mods.tinker.tconstruct.items.ToolPart; -import mods.tinker.tconstruct.items.ToolShard; -import mods.tinker.tconstruct.items.ToolStationItemBlock; -import mods.tinker.tconstruct.library.TConstructRegistry; -import mods.tinker.tconstruct.library.ToolCore; -import mods.tinker.tconstruct.logic.CastingTableLogic; -import mods.tinker.tconstruct.logic.FaucetLogic; -import mods.tinker.tconstruct.logic.FrypanLogic; -import mods.tinker.tconstruct.logic.LavaTankLogic; -import mods.tinker.tconstruct.logic.LiquidTextureLogic; -import mods.tinker.tconstruct.logic.MultiServantLogic; -import mods.tinker.tconstruct.logic.PartCrafterLogic; -import mods.tinker.tconstruct.logic.PatternChestLogic; -import mods.tinker.tconstruct.logic.PatternShaperLogic; -import mods.tinker.tconstruct.logic.SmelteryDrainLogic; -import mods.tinker.tconstruct.logic.SmelteryLogic; -import mods.tinker.tconstruct.logic.ToolStationLogic; -import mods.tinker.tconstruct.modifiers.ModBlaze; -import mods.tinker.tconstruct.modifiers.ModBoolean; -import mods.tinker.tconstruct.modifiers.ModDurability; -import mods.tinker.tconstruct.modifiers.ModElectric; -import mods.tinker.tconstruct.modifiers.ModInteger; -import mods.tinker.tconstruct.modifiers.ModLapisBase; -import mods.tinker.tconstruct.modifiers.ModLapisIncrease; -import mods.tinker.tconstruct.modifiers.ModRedstone; -import mods.tinker.tconstruct.modifiers.ModRepair; -import mods.tinker.tconstruct.tools.Axe; -import mods.tinker.tconstruct.tools.BattleSign; -import mods.tinker.tconstruct.tools.Broadsword; -import mods.tinker.tconstruct.tools.FryingPan; -import mods.tinker.tconstruct.tools.Longsword; -import mods.tinker.tconstruct.tools.Mattock; -import mods.tinker.tconstruct.tools.Pickaxe; -import mods.tinker.tconstruct.tools.Rapier; +import mods.tinker.tconstruct.blocks.*; +import mods.tinker.tconstruct.crafting.*; +import mods.tinker.tconstruct.entity.*; +import mods.tinker.tconstruct.items.*; +import mods.tinker.tconstruct.library.*; +import mods.tinker.tconstruct.logic.*; +import mods.tinker.tconstruct.modifiers.*; +import mods.tinker.tconstruct.tools.*; import mods.tinker.tconstruct.tools.Shovel; import net.minecraft.block.Block; import net.minecraft.block.material.MapColor; @@ -194,8 +135,10 @@ public class TContent implements IFuelHandler BiomeGenBase[] overworldBiomes = new BiomeGenBase[] { BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.desert, BiomeGenBase.extremeHills, BiomeGenBase.forest, BiomeGenBase.taiga, BiomeGenBase.swampland, BiomeGenBase.river, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.beach, BiomeGenBase.desertHills, BiomeGenBase.forestHills, BiomeGenBase.taigaHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.jungle, BiomeGenBase.jungleHills }; - EntityRegistry.addSpawn(UnstableCreeper.class, 8, 4, 6, EnumCreatureType.monster, overworldBiomes); - EntityRegistry.addSpawn(BlueSlime.class, 10, 4, 4, EnumCreatureType.monster, overworldBiomes); + if (PHConstruct.unstableCreeper) + EntityRegistry.addSpawn(UnstableCreeper.class, 7, 4, 6, EnumCreatureType.monster, overworldBiomes); + if (PHConstruct.blueSlime) + EntityRegistry.addSpawn(BlueSlime.class, 10, 4, 4, EnumCreatureType.monster, overworldBiomes); //EntityRegistry.addSpawn(MetalSlime.class, 1, 4, 4, EnumCreatureType.monster, overworldBiomes); } @@ -551,12 +494,12 @@ public class TContent implements IFuelHandler //Items Smeltery.addMelting(new ItemStack(Item.ingotIron, 4), Block.blockSteel.blockID, 0, 500, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 0)); Smeltery.addMelting(new ItemStack(Item.ingotGold, 4), Block.blockGold.blockID, 0, 450, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 1)); - Smeltery.addMelting(new ItemStack(Item.goldNugget, 4), Block.blockGold.blockID, 0, 450, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue / 9, 1)); + Smeltery.addMelting(new ItemStack(Item.goldNugget, 4), Block.blockGold.blockID, 0, 150, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue / 9, 1)); //Blocks Smeltery.addMelting(Block.blockSteel, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 0)); Smeltery.addMelting(Block.blockGold, 0, 550, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 1)); - Smeltery.addMelting(Block.obsidian, 0, 800, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 11)); + Smeltery.addMelting(Block.obsidian, 0, 800, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 11)); //Alloys Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 2, 7), new LiquidStack(liquidMetalStill.blockID, 3, 2), new LiquidStack(liquidMetalStill.blockID, 1, 3)); //Bronze @@ -647,7 +590,7 @@ public class TContent implements IFuelHandler OreDictionary.registerOre("ingotManyullyn", new ItemStack(materials, 1, 5)); OreDictionary.registerOre("ingotCopper", new ItemStack(materials, 1, 9)); OreDictionary.registerOre("ingotTin", new ItemStack(materials, 1, 10)); - OreDictionary.registerOre("ingotAluminum", new ItemStack(materials, 1, 11)); + OreDictionary.registerOre("ingotNaturalAluminum", new ItemStack(materials, 1, 11)); OreDictionary.registerOre("naturalAluminum", new ItemStack(materials, 1, 12)); OreDictionary.registerOre("ingotBronze", new ItemStack(materials, 1, 13)); OreDictionary.registerOre("ingotAluminumBrass", new ItemStack(materials, 1, 14)); diff --git a/mods/tinker/tconstruct/TEventHandler.java b/mods/tinker/tconstruct/TEventHandler.java index 09591b3b..98ad9c3d 100644 --- a/mods/tinker/tconstruct/TEventHandler.java +++ b/mods/tinker/tconstruct/TEventHandler.java @@ -69,10 +69,10 @@ public class TEventHandler Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 4, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 2, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 9)); } - /*else if (evt.Name == "ingotAluminum") + else if (evt.Name == "ingotNaturalAluminum") { Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 4, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 4)); - }*/ + } else if (evt.Name == "naturalAluminum") { @@ -279,6 +279,12 @@ public class TEventHandler Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 4)); } + ores = OreDictionary.getOres("ingotNaturalAluminum"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 4)); + } + ores = OreDictionary.getOres("ingotAluminumBrass"); for (ItemStack ore : ores) { diff --git a/mods/tinker/tconstruct/client/gui/PartCrafterGui.java b/mods/tinker/tconstruct/client/gui/PartCrafterGui.java index c521efe2..7abc63ed 100644 --- a/mods/tinker/tconstruct/client/gui/PartCrafterGui.java +++ b/mods/tinker/tconstruct/client/gui/PartCrafterGui.java @@ -57,7 +57,7 @@ public class PartCrafterGui extends GuiContainer topMaterial = top; int topID = PatternBuilder.instance.getPartID(top); - if (topID != -1) + if (topID != Short.MAX_VALUE) { topEnum = TConstructRegistry.getMaterial(topID); hasTop = true; @@ -72,7 +72,7 @@ public class PartCrafterGui extends GuiContainer bottomMaterial = bottom; int bottomID = PatternBuilder.instance.getPartID(bottom); - if (bottomID != -1) + if (bottomID != Short.MAX_VALUE) { bottomEnum = TConstructRegistry.getMaterial(bottomID); hasBottom = true; diff --git a/mods/tinker/tconstruct/container/SmelteryContainer.java b/mods/tinker/tconstruct/container/SmelteryContainer.java index ab69367f..e3b20e15 100644 --- a/mods/tinker/tconstruct/container/SmelteryContainer.java +++ b/mods/tinker/tconstruct/container/SmelteryContainer.java @@ -65,20 +65,20 @@ public class SmelteryContainer extends Container for (int y = 0; y < 8; y++) for (int x = 0; x < 3; x++) - this.addSlotToContainer(new Slot(logic, x + y*3 + invRow*3, -34 + x * 22, 8 + y * 18)); + this.addSlotToContainer(new Slot(logic, x + y*3 + invRow*3, 2 + x * 22, 8 + y * 18)); /* Player inventory */ for (int column = 0; column < 3; column++) { for (int row = 0; row < 9; row++) { - this.addSlotToContainer(new Slot(playerInv, row + column * 9 + 9, 54 + row * 18, 84 + column * 18)); + this.addSlotToContainer(new Slot(playerInv, row + column * 9 + 9, 90 + row * 18, 84 + column * 18)); } } for (int column = 0; column < 9; column++) { - this.addSlotToContainer(new Slot(playerInv, column, 54 + column * 18, 142)); + this.addSlotToContainer(new Slot(playerInv, column, 90 + column * 18, 142)); } return slotRow; } diff --git a/mods/tinker/tconstruct/crafting/PatternBuilder.java b/mods/tinker/tconstruct/crafting/PatternBuilder.java index e062f740..3b0b38de 100644 --- a/mods/tinker/tconstruct/crafting/PatternBuilder.java +++ b/mods/tinker/tconstruct/crafting/PatternBuilder.java @@ -79,14 +79,13 @@ public class PatternBuilder { if (otherPattern != null) { - int otherValue = ((Pattern)otherPattern.getItem()).getPatternCost(otherPattern.getItemDamage()); + int otherValue = ((IPattern)otherPattern.getItem()).getPatternCost(otherPattern.getItemDamage()); if (patternValue + otherValue <= key.value) { - Item otherPart = getMatchingPattern(otherPattern); - return new ItemStack[] { new ItemStack(toolPart, 1, mat.materialID), new ItemStack(otherPart, 1, mat.materialID) }; //Material + Material + ItemStack otherPart = getMatchingPattern(otherPattern, mat); + return new ItemStack[] { toolPart, otherPart }; //Material + Material } } - return new ItemStack[] { new ItemStack(toolPart, 1, mat.materialID), mat.shard.copy() }; //Material + Shard, copy to avoid weirdness with the itemstack reference } else if ( patternValue == key.value ) @@ -111,7 +110,7 @@ public class PatternBuilder return set.materialID; } } - return -1; + return Short.MAX_VALUE; } public int getPartValue (ItemStack material) @@ -131,7 +130,7 @@ public class PatternBuilder int damage = material.getItemDamage(); for (ItemKey ik : materials) { - if (mat == ik.item && (ik.damage == -1 || damage == ik.damage)) + if (mat == ik.item && (ik.damage == Short.MAX_VALUE || damage == ik.damage)) return ik; } return null; @@ -165,20 +164,6 @@ public class PatternBuilder } } - /*public class PatternKey - { - public final IToolPart item; - public PatternKey(IToolPart i) - { - item = i; - } - - public ItemStack getOutput(ItemStack stack) - { - return item.getPatternOutput(); - } - }*/ - public class MaterialSet { public final ItemStack shard; @@ -196,31 +181,31 @@ public class PatternBuilder //Helper Methods public void registerMaterial (Block material, int value, String key) { - registerMaterial(new ItemStack(material, 1, -1), value, key); + registerMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key); } public void registerMaterial (Item material, int value, String key) { - registerMaterial(new ItemStack(material, 1, -1), value, key); + registerMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key); } public void registerFullMaterial (Block material, int value, String key, ItemStack shard, ItemStack rod, int materialID) { - registerFullMaterial(new ItemStack(material, 1, -1), value, key, shard, rod, materialID); + registerFullMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key, shard, rod, materialID); } public void registerFullMaterial (Item material, int value, String key, ItemStack shard, ItemStack rod, int materialID) { - registerFullMaterial(new ItemStack(material, 1, -1), value, key, shard, rod, materialID); + registerFullMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key, shard, rod, materialID); } /*public void registerFullMaterial (Block material, int value, String key, int materialID) { - registerFullMaterial(new ItemStack(material, 1, -1), value, key, new ItemStack(TContent.toolShard, 1, materialID), new ItemStack(TContent.toolRod, 1, materialID), materialID); + registerFullMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key, new ItemStack(TContent.toolShard, 1, materialID), new ItemStack(TContent.toolRod, 1, materialID), materialID); } public void registerFullMaterial (Item material, int value, String key, int materialID) { - registerFullMaterial(new ItemStack(material, 1, -1), value, key, new ItemStack(TContent.toolShard, 1, materialID), new ItemStack(TContent.toolRod, 1, materialID), materialID); + registerFullMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key, new ItemStack(TContent.toolShard, 1, materialID), new ItemStack(TContent.toolRod, 1, materialID), materialID); }*/ } \ No newline at end of file diff --git a/mods/tinker/tconstruct/entity/BlueSlime.java b/mods/tinker/tconstruct/entity/BlueSlime.java index aa141d13..2b0a3d1e 100644 --- a/mods/tinker/tconstruct/entity/BlueSlime.java +++ b/mods/tinker/tconstruct/entity/BlueSlime.java @@ -30,25 +30,25 @@ public class BlueSlime extends EntityLiving implements IMob this.texture = "/mods/tinker/textures/mob/slimeedible.png"; int i = 1 << Math.max(1, this.rand.nextInt(4)); this.yOffset = 0.0F; - this.slimeJumpDelay = this.rand.nextInt(20) + 10; + this.slimeJumpDelay = this.rand.nextInt(120) + 40; this.setSlimeSize(i); this.jumpMovementFactor = 0.004F * i + 0.01F; } - - protected void damageEntity(DamageSource damageSource, int damage) - { - //Minecraft.getMinecraft().getLogAgent().logInfo("Damage: "+damage); + + protected void damageEntity (DamageSource damageSource, int damage) + { + //Minecraft.getMinecraft().getLogAgent().logInfo("Damage: "+damage); if (damageSource.damageType.equals("arrow")) - damage = damage/2; + damage = damage / 2; super.damageEntity(damageSource, damage); - } - + } + /*public boolean attackEntityFrom(DamageSource damageSource, int damage) - { + { if (damageSource.damageType.equals("arrow") && rand.nextInt(5) == 0) return false; return super.attackEntityFrom(damageSource, damage); - }*/ + }*/ @Override public void initCreature () @@ -63,12 +63,12 @@ public class BlueSlime extends EntityLiving implements IMob } } - + @Override - public double getMountedYOffset() - { + public double getMountedYOffset () + { return this.height * 0.3; - } + } protected void jump () { @@ -218,10 +218,10 @@ public class BlueSlime extends EntityLiving implements IMob TConstruct.proxy.spawnParticle(this.getSlimeParticle(), this.posX + (double) xPos, this.boundingBox.minY, this.posZ + (double) zPos, 0.0D, 0.0D, 0.0D); } - //if (this.makesSoundOnLand()) - //{ - this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) / 0.8F); - //} + if (this.makesSoundOnLand()) + { + this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) / 0.8F); + } this.field_70813_a = -0.5F; } @@ -264,7 +264,7 @@ public class BlueSlime extends EntityLiving implements IMob if (entityplayer != null) { - this.slimeJumpDelay /= 3; + this.slimeJumpDelay /= 12; } this.isJumping = true; @@ -298,7 +298,7 @@ public class BlueSlime extends EntityLiving implements IMob */ protected int getJumpDelay () { - return this.rand.nextInt(20) + 10; + return this.rand.nextInt(120) + 40; } protected BlueSlime createInstance () @@ -330,7 +330,7 @@ public class BlueSlime extends EntityLiving implements IMob { int j = this.getDropItemId(); - if (j > 0) + if (j > 0 && rand.nextInt(2) == 0) { int k = rand.nextInt(3) + rand.nextInt(this.getSlimeSize()); @@ -408,7 +408,7 @@ public class BlueSlime extends EntityLiving implements IMob */ protected float getSoundVolume () { - return 0.4F * (float) this.getSlimeSize(); + return Math.min(0.05F * (float) this.getSlimeSize(), 0.3f); } /** @@ -431,8 +431,8 @@ public class BlueSlime extends EntityLiving implements IMob /** * Returns true if the slime makes a sound when it lands after a jump (based upon the slime's size) */ - /*protected boolean makesSoundOnLand () + protected boolean makesSoundOnLand () { return this.getSlimeSize() > 2; - }*/ + } } diff --git a/mods/tinker/tconstruct/library/AbilityHelper.java b/mods/tinker/tconstruct/library/AbilityHelper.java index 7801d012..03431531 100644 --- a/mods/tinker/tconstruct/library/AbilityHelper.java +++ b/mods/tinker/tconstruct/library/AbilityHelper.java @@ -128,7 +128,7 @@ public class AbilityHelper if (broken) damage = 1; boolean causedDamage = false; - if (tool.pierceArmor()) + if (tool.pierceArmor() && !broken) causedDamage = entity.attackEntityFrom(causePlayerPiercingDamage(player), damage); else causedDamage = entity.attackEntityFrom(DamageSource.causePlayerDamage(player), damage); @@ -264,8 +264,11 @@ public class AbilityHelper { tags.getCompoundTag("InfiTool").setInteger("Damage", damage + dam); int toolDamage = damage * 100 / maxDamage; - int stackDamage = stack.getItemDamage(); - stack.setItemDamage(damage * 100 / maxDamage); + //int stackDamage = stack.getItemDamage(); + if (damage + dam <= 0) + stack.setItemDamage(0); + else + stack.setItemDamage(damage * 100 / maxDamage + 1); } //stack.setItemDamage(1 + (maxDamage - damage) * (stack.getMaxDamage() - 1) / maxDamage); diff --git a/mods/tinker/tconstruct/logic/PartCrafterLogic.java b/mods/tinker/tconstruct/logic/PartCrafterLogic.java index 762bc6ca..9f9eca3a 100644 --- a/mods/tinker/tconstruct/logic/PartCrafterLogic.java +++ b/mods/tinker/tconstruct/logic/PartCrafterLogic.java @@ -60,8 +60,9 @@ public class PartCrafterLogic extends InventoryLogic if (!craftedTop) { int value = PatternBuilder.instance.getPartValue(inventory[2]); - int cost = ((Pattern)inventory[0].getItem()).getPatternCost(inventory[0].getItemDamage()); - if (value > 0) + Pattern item = (Pattern)inventory[0].getItem(); + int cost = item != null ? item.getPatternCost(inventory[0].getItemDamage()) : 0; + if (value > 0 && cost > 0) { int decrease = cost / value; if (cost % value != 0) @@ -84,8 +85,10 @@ public class PartCrafterLogic extends InventoryLogic if (!craftedBottom) { int value = PatternBuilder.instance.getPartValue(inventory[3]); - int cost = ((Pattern)inventory[1].getItem()).getPatternCost(inventory[1].getItemDamage()); - if (value > 0) + //int cost = ((Pattern)inventory[1].getItem()).getPatternCost(inventory[1].getItemDamage()); + Pattern item = (Pattern)inventory[1].getItem(); + int cost = item != null ? item.getPatternCost(inventory[1].getItemDamage()) : 0; + if (value > 0 && cost > 0) { int decrease = cost / value; if (cost % value != 0) diff --git a/mods/tinker/tconstruct/logic/SmelteryLogic.java b/mods/tinker/tconstruct/logic/SmelteryLogic.java index ca05de18..1cbb5376 100644 --- a/mods/tinker/tconstruct/logic/SmelteryLogic.java +++ b/mods/tinker/tconstruct/logic/SmelteryLogic.java @@ -163,7 +163,10 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci public int getScaledFuelGague (int scale) { - return (fuelGague * scale) / 52; + int ret = (fuelGague * scale) / 52; + if (ret < 1) + ret = 1; + return ret; } public int getInternalTemperature () @@ -218,7 +221,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci activeTemps[i] += 1; inUse = true; } - else if (meltingTemps[i] >= activeTemps[i]) + else if (activeTemps[i] >= meltingTemps[i]) { if (!worldObj.isRemote) { diff --git a/mods/tinker/tconstruct/player/TPlayerHandler.java b/mods/tinker/tconstruct/player/TPlayerHandler.java index b005fb6d..a54d306c 100644 --- a/mods/tinker/tconstruct/player/TPlayerHandler.java +++ b/mods/tinker/tconstruct/player/TPlayerHandler.java @@ -84,7 +84,7 @@ public class TPlayerHandler implements IPlayerTracker if (PHConstruct.keepLevels) entityplayer.experienceLevel = stats.level; if (PHConstruct.keepHunger) - entityplayer.getFoodStats().setFoodLevel(stats.hunger); + entityplayer.getFoodStats().addStats(-1*(20 - stats.hunger), 0); NBTTagCompound tags = entityplayer.getEntityData(); NBTTagCompound tTag = new NBTTagCompound(); tTag.setBoolean("diary", stats.diary); @@ -95,7 +95,9 @@ public class TPlayerHandler implements IPlayerTracker Side side = FMLCommonHandler.instance().getEffectiveSide(); if (side == Side.CLIENT) { - TProxyClient.controlInstance.resetControls(); + //TProxyClient.controlInstance.resetControls(); + if (PHConstruct.keepHunger) + entityplayer.getFoodStats().setFoodLevel(stats.hunger); } } @@ -104,13 +106,11 @@ public class TPlayerHandler implements IPlayerTracker { if (evt.entityLiving instanceof EntityPlayer) { - Side side = FMLCommonHandler.instance().getEffectiveSide(); + /*Side side = FMLCommonHandler.instance().getEffectiveSide(); if (side == Side.CLIENT) { TProxyClient.controlInstance.landOnGround(); - - //System.out.println("Client side: "+evt.entityLiving.motionY); - } + }*/ //else //System.out.println("Server side"); diff --git a/mods/tinker/tconstruct/tools/Mattock.java b/mods/tinker/tconstruct/tools/Mattock.java index 67d0db43..abbb2c3f 100644 --- a/mods/tinker/tconstruct/tools/Mattock.java +++ b/mods/tinker/tconstruct/tools/Mattock.java @@ -7,6 +7,7 @@ import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; public class Mattock extends DualHarvestTool @@ -54,6 +55,10 @@ public class Mattock extends DualHarvestTool @Override public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ) { + NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + if (tags.getBoolean("Broken")) + return false; + return AbilityHelper.hoeGround(stack, player, world, x, y, z, side, random); } diff --git a/test/XinStick.java b/test/XinStick.java index 863ff55f..462b2f8e 100644 --- a/test/XinStick.java +++ b/test/XinStick.java @@ -1,5 +1,6 @@ package test; +import mods.tinker.tconstruct.entity.BlueSlime; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; @@ -27,7 +28,7 @@ public class XinStick extends Item //spawnItem(player.posX, player.posY, player.posZ, tool, world); //CartEntity cart = new CartEntity(world, 1); //cart.cartType = 1; - //spawnEntity(player.posX, player.posY+1, player.posZ, new BlueSlime(world), world, player); + spawnEntity(player.posX, player.posY+1, player.posZ, new BlueSlime(world), world, player); return stack; }