From 2734e0fd2b584ccd10c9d16c84f35bce8a607e22 Mon Sep 17 00:00:00 2001 From: TheVikingWarrior Date: Mon, 20 Oct 2014 19:52:19 +0200 Subject: [PATCH 1/6] Update it_IT.lang --- resources/assets/tinker/lang/it_IT.lang | 46 +++++++++++++------------ 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/resources/assets/tinker/lang/it_IT.lang b/resources/assets/tinker/lang/it_IT.lang index 7684b7a4..ce7d9d72 100644 --- a/resources/assets/tinker/lang/it_IT.lang +++ b/resources/assets/tinker/lang/it_IT.lang @@ -544,27 +544,6 @@ death.four.smeltery=%1$s pensò che nuotare in fluidi bollenti fosse una buona i death.attack.Landmine=Le gambe di %1$s sono state spazzate via da una mina death.attack.FireworkExplode=%1$s è stato fatto a pezzi da un fuoco d'artificio -parttype.wood=di legno -parttype.stone=di pietra -parttype.iron=di ferro -parttype.flint=di selce -parttype.cactus=di cactus -parttype.bone=d'osso -parttype.obsidian=di ossidiana -parttype.slime=di gelatina -parttype.paper=di carta -parttype.netherrack=di inferrena -parttype.cobalt=di cobalto -parttype.ardite=di ardite -parttype.manyullyn=di manyullyn -parttype.copper=di rame -parttype.bronze=di bronzo -parttype.alumite=di alumite -parttype.steel=d'acciaio -parttype.blueslime=di gelatina -parttype.thaumium=di taumio -parttype.pigiron=di ferro suino - toolpart.ToolRod=Manico %%material toolpart.PickaxeHead=Testa di piccone %%material toolpart.ShovelHead=Testa di pala %%material @@ -592,8 +571,29 @@ toolpart.Bowstring=Corda d'arco %%material toolpart.ArrowHead=Testa di freccia %%material toolpart.Fletching=Impennaggio %%material -# Now with translations of specific material and part combinations: +#Now with translations of specific material and part combinations: #toolpart.ToolRod.wood=Wooden Tool Rod +# If only the material part has to be specific, you can use this +toolpart.material.wood=di legno +toolpart.material.stone=di pietra +toolpart.material.iron=di ferro +toolpart.material.flint=di selce +toolpart.material.cactus=di cactus +toolpart.material.bone=d'osso +toolpart.material.obsidian=di ossidiana +toolpart.material.slime=di gelatina +toolpart.material.paper=di carta +toolpart.material.netherrack=di inferrena +toolpart.material.cobalt=di cobalto +toolpart.material.ardite=di ardite +toolpart.material.manyullyn=di manyullyn +toolpart.material.copper=di rame +toolpart.material.bronze=di bronzo +toolpart.material.alumite=di alumite +toolpart.material.steel=d'acciaio +toolpart.material.blueslime=di gelatina +toolpart.material.thaumium=di taumio +toolpart.material.pigiron=di ferro suino fluid.iron.molten=Ferro fuso fluid.gold.molten=Oro fuso @@ -717,6 +717,8 @@ smeltery.drain.tooltip1=Funziona sia come entrata che come smeltery.drain.tooltip2=uscita per fluidi nella fonderia smeltery.brick.tooltip1=Blocco per la fonderia smeltery.brick.tooltip2=(Usabile anche come decorazione) +#Dear translators, only translate this line if the joke is applicable in your language. +grout.tooltip=I am Grout! gui.smeltery.fuel=Carburante gui.smeltery.emerald=Smeraldi: From 4ed86956e280cd8993137bed40d0b141f9a93e5c Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Tue, 21 Oct 2014 16:09:52 +0200 Subject: [PATCH 2/6] Don't oredict emerald, since they use different values. #1102 --- src/main/java/tconstruct/smeltery/TinkerSmeltery.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/tconstruct/smeltery/TinkerSmeltery.java b/src/main/java/tconstruct/smeltery/TinkerSmeltery.java index be6f11a0..8055f24b 100644 --- a/src/main/java/tconstruct/smeltery/TinkerSmeltery.java +++ b/src/main/java/tconstruct/smeltery/TinkerSmeltery.java @@ -848,7 +848,7 @@ public class TinkerSmeltery public void addOreDictionarySmelteryRecipes () { - List exceptions = Arrays.asList(new FluidType[] { FluidType.getFluidType("Water"), FluidType.getFluidType("Stone"), FluidType.getFluidType("Ender"), FluidType.getFluidType("Glass"), FluidType.getFluidType("Slime"), FluidType.getFluidType("Obsidian") }); + List exceptions = Arrays.asList(new FluidType[] { FluidType.getFluidType("Water"), FluidType.getFluidType("Stone"), FluidType.getFluidType("Emerald"), FluidType.getFluidType("Ender"), FluidType.getFluidType("Glass"), FluidType.getFluidType("Slime"), FluidType.getFluidType("Obsidian") }); Iterator iter = FluidType.fluidTypes.entrySet().iterator(); while (iter.hasNext()) { @@ -1197,6 +1197,7 @@ public class TinkerSmeltery Smeltery.addMelting(Blocks.stone, 0, 800, new FluidStack(TinkerSmeltery.moltenStoneFluid, TConstruct.ingotLiquidValue / 18)); Smeltery.addMelting(Blocks.cobblestone, 0, 800, new FluidStack(TinkerSmeltery.moltenStoneFluid, TConstruct.ingotLiquidValue / 8)); Smeltery.addMelting(Blocks.emerald_block, 0, 800, new FluidStack(TinkerSmeltery.moltenEmeraldFluid, 640 * 9)); + Smeltery.addMelting(Blocks.emerald_ore, 0, 800, new FluidStack(TinkerSmeltery.moltenEmeraldFluid, 640 * 2)); // the ore also is done here Smeltery.addMelting(TinkerSmeltery.glueBlock, 0, 250, new FluidStack(TinkerSmeltery.glueFluid, TConstruct.blockLiquidValue)); Smeltery.addMelting(TinkerTools.craftedSoil, 1, 600, new FluidStack(TinkerSmeltery.moltenStoneFluid, TConstruct.ingotLiquidValue / 4)); From b7bd5755e22bc6470b8847ee4b85ad43eded7de1 Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Tue, 21 Oct 2014 17:09:55 +0200 Subject: [PATCH 3/6] Add afterBlockBreak callback to the ActiveToolMod --- src/main/java/tconstruct/library/ActiveToolMod.java | 7 +++++++ src/main/java/tconstruct/library/tools/ToolCore.java | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/main/java/tconstruct/library/ActiveToolMod.java b/src/main/java/tconstruct/library/ActiveToolMod.java index ab7b738c..28d60f4d 100644 --- a/src/main/java/tconstruct/library/ActiveToolMod.java +++ b/src/main/java/tconstruct/library/ActiveToolMod.java @@ -1,5 +1,6 @@ package tconstruct.library; +import net.minecraft.block.Block; import net.minecraft.entity.*; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -20,11 +21,17 @@ public class ActiveToolMod return false; } + @Deprecated public boolean afterBlockBreak () // Unfinished, not called { return false; } + public void afterBlockBreak(ToolCore tool, ItemStack stack, Block block, int x, int y, int z, EntityLivingBase entity) + { + + } + /* Attacking */ public int baseAttackDamage (int earlyModDamage, int damage, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLivingBase player, Entity entity) diff --git a/src/main/java/tconstruct/library/tools/ToolCore.java b/src/main/java/tconstruct/library/tools/ToolCore.java index 371893d0..97fb419d 100644 --- a/src/main/java/tconstruct/library/tools/ToolCore.java +++ b/src/main/java/tconstruct/library/tools/ToolCore.java @@ -581,6 +581,9 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IMo @Override public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPlayer player) { + if(!stack.hasTagCompound()) + return false; + boolean cancelHarvest = false; for (ActiveToolMod mod : TConstructRegistry.activeModifiers) { @@ -594,6 +597,13 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IMo @Override public boolean onBlockDestroyed (ItemStack itemstack, World world, Block block, int x, int y, int z, EntityLivingBase player) { + if(!itemstack.hasTagCompound()) + return false; + + // callbacks! + for (ActiveToolMod mod : TConstructRegistry.activeModifiers) + mod.afterBlockBreak(this, itemstack, block, x, y, z, player); + if (block != null && (double) block.getBlockHardness(world, x, y, z) != 0.0D) { return AbilityHelper.onBlockChanged(itemstack, world, block, x, y, z, player, random); From bd02e5419f0021e223bc8bd703bfb5ddbeb601a7 Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Tue, 21 Oct 2014 17:10:28 +0200 Subject: [PATCH 4/6] Slimy trait now has a small chance to summon a small slime when breaking blocks :3 --- resources/META-INF/TConstruct_at.cfg | 2 + .../java/tconstruct/tools/TActiveOmniMod.java | 65 +++++++++++++++++-- 2 files changed, 63 insertions(+), 4 deletions(-) diff --git a/resources/META-INF/TConstruct_at.cfg b/resources/META-INF/TConstruct_at.cfg index 5446467f..e00d0b13 100644 --- a/resources/META-INF/TConstruct_at.cfg +++ b/resources/META-INF/TConstruct_at.cfg @@ -38,4 +38,6 @@ public net.minecraft.client.multiplayer.PlayerControllerMP func_85182_a(III)Z #s public net.minecraft.server.management.ItemInWorldManager field_73086_f public net.minecraft.server.management.ItemInWorldManager field_73087_g public net.minecraft.server.management.ItemInWorldManager field_73099_h +# EntitySlime +public net.minecraft.entity.monster.EntitySlime func_70799_a(I)V #setSlimeSize # needs to have a space at the end of every line or SS will derp diff --git a/src/main/java/tconstruct/tools/TActiveOmniMod.java b/src/main/java/tconstruct/tools/TActiveOmniMod.java index f14cf51b..7cbcb30d 100644 --- a/src/main/java/tconstruct/tools/TActiveOmniMod.java +++ b/src/main/java/tconstruct/tools/TActiveOmniMod.java @@ -5,6 +5,7 @@ import net.minecraft.block.Block; import net.minecraft.enchantment.*; import net.minecraft.entity.*; import net.minecraft.entity.item.*; +import net.minecraft.entity.monster.EntitySlime; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.*; import net.minecraft.item.crafting.FurnaceRecipes; @@ -16,6 +17,7 @@ import tconstruct.library.ActiveToolMod; import tconstruct.library.tools.*; import tconstruct.util.config.PHConstruct; import tconstruct.world.TinkerWorld; +import tconstruct.world.entity.BlueSlime; public class TActiveOmniMod extends ActiveToolMod { @@ -56,6 +58,12 @@ public class TActiveOmniMod extends ActiveToolMod return false; } + @Override + public void afterBlockBreak(ToolCore tool, ItemStack stack, Block block, int x, int y, int z, EntityLivingBase entity) { + NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + slimify(tool, tags, block, x,y,z, entity.worldObj); + } + private boolean autoSmelt (ToolCore tool, NBTTagCompound tags, ItemStack stack, int x, int y, int z, EntityLivingBase entity) { World world = entity.worldObj; @@ -168,11 +176,12 @@ public class TActiveOmniMod extends ActiveToolMod private void baconator (ToolCore tool, ItemStack stack, EntityLivingBase entity, NBTTagCompound tags) { + final int pigiron = TinkerTools.MaterialID.PigIron; int bacon = 0; - bacon += tags.getInteger("Head") == 18 ? 1 : 0; - bacon += tags.getInteger("Handle") == 18 ? 1 : 0; - bacon += tags.getInteger("Accessory") == 18 ? 1 : 0; - bacon += tags.getInteger("Extra") == 18 ? 1 : 0; + bacon += tags.getInteger("Head") == pigiron ? 1 : 0; + bacon += tags.getInteger("Handle") == pigiron ? 1 : 0; + bacon += tags.getInteger("Accessory") == pigiron ? 1 : 0; + bacon += tags.getInteger("Extra") == pigiron ? 1 : 0; int chance = tool.getPartAmount() * 100; if (random.nextInt(chance) < bacon) { @@ -183,6 +192,54 @@ public class TActiveOmniMod extends ActiveToolMod } } + private void slimify(ToolCore tool, NBTTagCompound tags, Block block, int x, int y, int z, World world) + { + if (world.isRemote) + return; + + int chance = tool.getPartAmount() * 100; + int count = 0; + int slimeMat = TinkerTools.MaterialID.Slime; + + // regular slime + if(tags.getInteger("Head") == slimeMat) + count++; + if(tags.getInteger("Handle") == slimeMat) + count++; + if(tags.getInteger("Accessory") == slimeMat) + count++; + if(tags.getInteger("Extra") == slimeMat) + count++; + + if(random.nextInt(chance) < count) { + EntitySlime entity = new EntitySlime(world); + entity.setPosition(x+0.5,y,z+0.5); + entity.setSlimeSize(1); // minislime! + world.spawnEntityInWorld(entity); + entity.playLivingSound(); + } + + // blueslime + slimeMat = TinkerTools.MaterialID.BlueSlime; + count = 0; + if(tags.getInteger("Head") == slimeMat) + count++; + if(tags.getInteger("Handle") == slimeMat) + count++; + if(tags.getInteger("Accessory") == slimeMat) + count++; + if(tags.getInteger("Extra") == slimeMat) + count++; + + if(random.nextInt(chance) < count) { + BlueSlime entity = new BlueSlime(world); + entity.setPosition(x+0.5,y,z+0.5); + entity.setSlimeSize(1); // minislime! + world.spawnEntityInWorld(entity); + entity.playLivingSound(); + } + } + @Override public int attackDamage (int modDamage, int currentDamage, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLivingBase player, Entity entity) { From 81b0922b95ad5e5caad75e158118ac22b9cf6735 Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Tue, 21 Oct 2014 18:13:59 +0200 Subject: [PATCH 5/6] Fix compressed stone still giving the old stone values. Also limit smeltable compressed coble to 4x at most, since the others are too big. --- src/main/java/tconstruct/TConstruct.java | 1 + src/main/java/tconstruct/smeltery/TinkerSmeltery.java | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/tconstruct/TConstruct.java b/src/main/java/tconstruct/TConstruct.java index d3a04807..ddbf6fdd 100644 --- a/src/main/java/tconstruct/TConstruct.java +++ b/src/main/java/tconstruct/TConstruct.java @@ -78,6 +78,7 @@ public class TConstruct public static final int blockLiquidValue = ingotLiquidValue * 9; public static final int chunkLiquidValue = ingotLiquidValue / 2; public static final int nuggetLiquidValue = ingotLiquidValue / 9; + public static final int stoneLiquidValue = ingotLiquidValue/8; public static final int liquidUpdateAmount = 6; public static final String modID = "TConstruct"; diff --git a/src/main/java/tconstruct/smeltery/TinkerSmeltery.java b/src/main/java/tconstruct/smeltery/TinkerSmeltery.java index 8055f24b..d3c1c179 100644 --- a/src/main/java/tconstruct/smeltery/TinkerSmeltery.java +++ b/src/main/java/tconstruct/smeltery/TinkerSmeltery.java @@ -924,10 +924,10 @@ public class TinkerSmeltery } } - // Compressed materials - for (int i = 1; i <= 8; i++) + // Compressed materials. max 4x because it's too much otherwise. + for (int i = 1; i <= 4; i++) { - Smeltery.addDictionaryMelting("compressedCobblestone" + i + "x", FluidType.getFluidType("Stone"), 0, TConstruct.ingotLiquidValue / 18 * (int) Math.pow(9, i)); + Smeltery.addDictionaryMelting("compressedCobblestone" + i + "x", FluidType.getFluidType("Stone"), 0, TConstruct.stoneLiquidValue * (int) Math.pow(9, i)); } Smeltery.addDictionaryMelting("compressedSand1x", FluidType.getFluidType("Glass"), 175, FluidContainerRegistry.BUCKET_VOLUME * 9); Smeltery.addDictionaryMelting("compressedSand2x", FluidType.getFluidType("Glass"), 175, FluidContainerRegistry.BUCKET_VOLUME * 9 * 9); @@ -1194,8 +1194,8 @@ public class TinkerSmeltery Smeltery.addMelting(Blocks.sand, 0, 625, new FluidStack(TinkerSmeltery.moltenGlassFluid, FluidContainerRegistry.BUCKET_VOLUME)); Smeltery.addMelting(Blocks.glass, 0, 625, new FluidStack(TinkerSmeltery.moltenGlassFluid, FluidContainerRegistry.BUCKET_VOLUME)); Smeltery.addMelting(Blocks.glass_pane, 0, 625, new FluidStack(TinkerSmeltery.moltenGlassFluid, 250)); - Smeltery.addMelting(Blocks.stone, 0, 800, new FluidStack(TinkerSmeltery.moltenStoneFluid, TConstruct.ingotLiquidValue / 18)); - Smeltery.addMelting(Blocks.cobblestone, 0, 800, new FluidStack(TinkerSmeltery.moltenStoneFluid, TConstruct.ingotLiquidValue / 8)); + Smeltery.addMelting(Blocks.stone, 0, 800, new FluidStack(TinkerSmeltery.moltenStoneFluid, TConstruct.stoneLiquidValue)); + Smeltery.addMelting(Blocks.cobblestone, 0, 800, new FluidStack(TinkerSmeltery.moltenStoneFluid, TConstruct.stoneLiquidValue)); Smeltery.addMelting(Blocks.emerald_block, 0, 800, new FluidStack(TinkerSmeltery.moltenEmeraldFluid, 640 * 9)); Smeltery.addMelting(Blocks.emerald_ore, 0, 800, new FluidStack(TinkerSmeltery.moltenEmeraldFluid, 640 * 2)); // the ore also is done here Smeltery.addMelting(TinkerSmeltery.glueBlock, 0, 250, new FluidStack(TinkerSmeltery.glueFluid, TConstruct.blockLiquidValue)); From 35f098e4b0ddc2861ed9557bff9e34b0d35ea4e3 Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Tue, 21 Oct 2014 18:18:36 +0200 Subject: [PATCH 6/6] Fix smeltery overfilling if it was empty and one block could overfill it. (I'm looking at you there, compressed cobble) --- src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java b/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java index f3610bb1..b34295b8 100644 --- a/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java +++ b/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java @@ -507,8 +507,12 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci needsUpdate = true; if (moltenMetal.size() == 0) { + // does it fit in? + if(liquid.amount > this.getCapacity()) + return false; + moltenMetal.add(liquid.copy()); - currentLiquid += liquid.amount; + updateCurrentLiquid(); return true; } else