From 4858fab64304eed5ff191f45f2b16ad13a649fdf Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Wed, 15 Oct 2014 22:27:42 +0200 Subject: [PATCH 1/9] Update Mystcraft IMC --- .../plugins/imc/TinkerMystcraft.java | 49 +++++++++++-------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/src/main/java/tconstruct/plugins/imc/TinkerMystcraft.java b/src/main/java/tconstruct/plugins/imc/TinkerMystcraft.java index 514e4ac2..f4e96732 100644 --- a/src/main/java/tconstruct/plugins/imc/TinkerMystcraft.java +++ b/src/main/java/tconstruct/plugins/imc/TinkerMystcraft.java @@ -1,34 +1,43 @@ package tconstruct.plugins.imc; import cpw.mods.fml.common.event.*; -import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder; import mantle.pulsar.pulse.*; -import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.Fluid; import tconstruct.TConstruct; -@ObjectHolder(TConstruct.modID) -@Pulse(id = "Tinkers Mystcraft Compatibility", forced = true, modsRequired = "Mystcraft") +import static tconstruct.smeltery.TinkerSmeltery.*; + +@Pulse(id = "Tinkers Mystcraft Compatibility", forced = true, modsRequired = "Mystcraft", pulsesRequired = "Tinkers' Smeltery") public class TinkerMystcraft { - private static String[] fluids = new String[] { "invar.molten", "electrum.molten", "bronze.molten", "aluminumbrass.molten", "manyullyn.molten", "alumite.molten", "cobalt.molten", "moltenArdite", "ender", "steel.molten", "platinum.molten" }; - @Handler public void init (FMLInitializationEvent event) { + final Fluid[] fluids = new Fluid[] { + // precious tinker fluids + moltenGoldFluid, + moltenSteelFluid, + moltenEmeraldFluid, + moltenArditeFluid, + moltenCobaltFluid, + // all alloys + pigIronFluid, + moltenBronzeFluid, + moltenAlumiteFluid, + moltenAlubrassFluid, + moltenManyullynFluid, + // precious TE fluids + moltenEnderFluid, + moltenSilverFluid, + moltenInvarFluid, + moltenElectrumFluid, + moltenShinyFluid + }; + TConstruct.logger.info("Mystcraft detected. Blacklisting Mystcraft fluid symbols."); - for (String nm : fluids) - sendFluidBlacklist(nm); + for(Fluid fluid : fluids) + { + FMLInterModComms.sendMessage("Mystcraft", "blacklistfluid", fluid.getName()); + } } - - private void sendFluidBlacklist (String FluidName) - { - NBTTagCompound NBTMsg = new NBTTagCompound(); - NBTMsg.setTag("fluidsymbol", new NBTTagCompound()); - NBTMsg.getCompoundTag("fluidsymbol").setFloat("rarity", 0.0F); - NBTMsg.getCompoundTag("fluidsymbol").setFloat("grammarweight", 0.0F); - NBTMsg.getCompoundTag("fluidsymbol").setFloat("instabilityPerBlock", 10000F); // renders creative symbol useless - NBTMsg.getCompoundTag("fluidsymbol").setString("fluidname", FluidName); - FMLInterModComms.sendMessage("Mystcraft", "fluidsymbol", NBTMsg); - } - } From c824f68b7915891cadedd5d103e24532bd143956 Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Wed, 15 Oct 2014 22:37:22 +0200 Subject: [PATCH 2/9] Prevent NPEs with mystcraft if TE isn't present --- src/main/java/tconstruct/plugins/imc/TinkerMystcraft.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/tconstruct/plugins/imc/TinkerMystcraft.java b/src/main/java/tconstruct/plugins/imc/TinkerMystcraft.java index f4e96732..d582c300 100644 --- a/src/main/java/tconstruct/plugins/imc/TinkerMystcraft.java +++ b/src/main/java/tconstruct/plugins/imc/TinkerMystcraft.java @@ -37,6 +37,8 @@ public class TinkerMystcraft TConstruct.logger.info("Mystcraft detected. Blacklisting Mystcraft fluid symbols."); for(Fluid fluid : fluids) { + if(fluid == null) + continue; FMLInterModComms.sendMessage("Mystcraft", "blacklistfluid", fluid.getName()); } } From c0e46f151bdd461baeaef4bdbe70622573438d2d Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Wed, 15 Oct 2014 23:17:41 +0200 Subject: [PATCH 3/9] Materials that shall have toolparts created for them have to be registered specifically now. Registering a material via IMC does so automatically. Should also fix the double-toolparts with extratic and other mod relying on the 1.6 API. --- .../library/TConstructRegistry.java | 9 ++++++++ .../library/tools/DynamicToolPart.java | 7 +++++-- .../java/tconstruct/tools/TinkerTools.java | 21 +++++++++++++++++++ src/main/java/tconstruct/util/IMCHandler.java | 1 + 4 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/main/java/tconstruct/library/TConstructRegistry.java b/src/main/java/tconstruct/library/TConstructRegistry.java index 554b032b..4aaeb24f 100644 --- a/src/main/java/tconstruct/library/TConstructRegistry.java +++ b/src/main/java/tconstruct/library/TConstructRegistry.java @@ -219,6 +219,15 @@ public class TConstructRegistry // Materials public static HashMap toolMaterials = new HashMap(40); public static HashMap toolMaterialStrings = new HashMap(40); + public static List defaultToolPartMaterials = new LinkedList(); + + public static void addDefaultToolPartMaterial(int materialID) + { + if(!toolMaterials.containsKey(materialID)) + logger.error("[TCon API] Can't add default toolpart: Material ID " + materialID + " is unknown."); + else + defaultToolPartMaterials.add(materialID); + } /** * Adds a tool material to the registry diff --git a/src/main/java/tconstruct/library/tools/DynamicToolPart.java b/src/main/java/tconstruct/library/tools/DynamicToolPart.java index 04b6aba1..69df1a68 100644 --- a/src/main/java/tconstruct/library/tools/DynamicToolPart.java +++ b/src/main/java/tconstruct/library/tools/DynamicToolPart.java @@ -98,8 +98,11 @@ public class DynamicToolPart extends CraftingItem implements IToolPart return; // material id == metadata - for(Integer matID : TConstructRegistry.toolMaterials.keySet()) - list.add(new ItemStack(item, 1, matID)); + for(Integer matID : TConstructRegistry.defaultToolPartMaterials) { + ItemStack stack = new ItemStack(item, 1, matID); + if (this.getMaterialID(stack) != -1) + list.add(stack); + } } @Override diff --git a/src/main/java/tconstruct/tools/TinkerTools.java b/src/main/java/tconstruct/tools/TinkerTools.java index 66eaba21..69191943 100644 --- a/src/main/java/tconstruct/tools/TinkerTools.java +++ b/src/main/java/tconstruct/tools/TinkerTools.java @@ -788,6 +788,27 @@ public class TinkerTools TConstructRegistry.addFletchingMaterial(2, 2, new ItemStack(TinkerTools.materials, 1, 1), new ItemStack(TinkerTools.fletching, 1, 2), 100F, 0F, 0.12F, 0x82c873); // Slime TConstructRegistry.addFletchingMaterial(3, 2, new ItemStack(TinkerTools.materials, 1, 17), new ItemStack(TinkerTools.fletching, 1, 3), 100F, 0F, 0.12F, 0x74c8c7); // BlueSlime + // Register all the materials for default toolparts + TConstructRegistry.addDefaultToolPartMaterial(MaterialID.Wood); + TConstructRegistry.addDefaultToolPartMaterial(MaterialID.Stone); + TConstructRegistry.addDefaultToolPartMaterial(MaterialID.Iron); + TConstructRegistry.addDefaultToolPartMaterial(MaterialID.Flint); + TConstructRegistry.addDefaultToolPartMaterial(MaterialID.Cactus); + TConstructRegistry.addDefaultToolPartMaterial(MaterialID.Bone); + TConstructRegistry.addDefaultToolPartMaterial(MaterialID.Obsidian); + TConstructRegistry.addDefaultToolPartMaterial(MaterialID.Netherrack); + TConstructRegistry.addDefaultToolPartMaterial(MaterialID.Slime); + TConstructRegistry.addDefaultToolPartMaterial(MaterialID.Paper); + TConstructRegistry.addDefaultToolPartMaterial(MaterialID.Cobalt); + TConstructRegistry.addDefaultToolPartMaterial(MaterialID.Ardite); + TConstructRegistry.addDefaultToolPartMaterial(MaterialID.Manyullyn); + TConstructRegistry.addDefaultToolPartMaterial(MaterialID.Copper); + TConstructRegistry.addDefaultToolPartMaterial(MaterialID.Bronze); + TConstructRegistry.addDefaultToolPartMaterial(MaterialID.Alumite); + TConstructRegistry.addDefaultToolPartMaterial(MaterialID.Steel); + TConstructRegistry.addDefaultToolPartMaterial(MaterialID.BlueSlime ); + TConstructRegistry.addDefaultToolPartMaterial(MaterialID.PigIron); + PatternBuilder pb = PatternBuilder.instance; if (PHConstruct.enableTWood) pb.registerFullMaterial(Blocks.planks, 2, "Wood", new ItemStack(Items.stick), new ItemStack(Items.stick), 0); diff --git a/src/main/java/tconstruct/util/IMCHandler.java b/src/main/java/tconstruct/util/IMCHandler.java index e7b2cae4..61b3d39f 100644 --- a/src/main/java/tconstruct/util/IMCHandler.java +++ b/src/main/java/tconstruct/util/IMCHandler.java @@ -49,6 +49,7 @@ public final class IMCHandler { ToolMaterial mat = scanMaterial(tag); if(mat != null) { TConstructRegistry.addtoolMaterial(tag.getInteger("Id"), mat); + TConstructRegistry.addDefaultToolPartMaterial(tag.getInteger("Id")); TConstruct.logger.info("IMC: Added material " + mat.materialName); } } From cbe57a08e1de59afc3c6832a26413130fb1e4a24 Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Wed, 15 Oct 2014 23:36:27 +0200 Subject: [PATCH 4/9] Call the callbacks on tools when breaking blocks when breaking extra blocks with AOE tools. Fixes extra-blocks harvested not using up durability. #1089 --- src/main/java/tconstruct/library/tools/HarvestTool.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/tconstruct/library/tools/HarvestTool.java b/src/main/java/tconstruct/library/tools/HarvestTool.java index 0c1d4f59..b124a3a4 100644 --- a/src/main/java/tconstruct/library/tools/HarvestTool.java +++ b/src/main/java/tconstruct/library/tools/HarvestTool.java @@ -258,6 +258,10 @@ public abstract class HarvestTool extends ToolCore } return; } + + // callback to the tool the player uses. Called on both sides. This damages the tool n stuff. + player.getCurrentEquippedItem().func_150999_a(world, block, x, y, z, player); + // server sided handling if (!world.isRemote) { // serverside we reproduce ItemInWorldManager.tryHarvestBlock From 90e23e393a274d38d9720b959616082baa268721 Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Thu, 16 Oct 2014 10:58:23 +0200 Subject: [PATCH 5/9] Water/Lava buckets can now be cast with a casting table! There you go @fuj1n ;) --- src/main/java/tconstruct/smeltery/TinkerSmeltery.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/tconstruct/smeltery/TinkerSmeltery.java b/src/main/java/tconstruct/smeltery/TinkerSmeltery.java index a1004dea..be6f11a0 100644 --- a/src/main/java/tconstruct/smeltery/TinkerSmeltery.java +++ b/src/main/java/tconstruct/smeltery/TinkerSmeltery.java @@ -970,6 +970,10 @@ public class TinkerSmeltery } } + // water and lava bucket + tableCasting.addCastingRecipe(new ItemStack(Items.water_bucket), new FluidStack(FluidRegistry.WATER, FluidContainerRegistry.BUCKET_VOLUME), bucket, true, 10); + tableCasting.addCastingRecipe(new ItemStack(Items.lava_bucket), new FluidStack(FluidRegistry.LAVA, FluidContainerRegistry.BUCKET_VOLUME), bucket, true, 10); + // Clear glass pane casting tableCasting.addCastingRecipe(new ItemStack(TinkerSmeltery.glassPane), new FluidStack(TinkerSmeltery.moltenGlassFluid, 250), null, 80); From 2b2eaaa7eed053c00edf886437181199157f306d Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Thu, 16 Oct 2014 10:59:31 +0200 Subject: [PATCH 6/9] Also ensure that tinkers is loaded after Thermal Foundation, not only Thermal Expansion (only matters if TE is not present, but meh.) --- src/main/java/tconstruct/TConstruct.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/tconstruct/TConstruct.java b/src/main/java/tconstruct/TConstruct.java index 541bf256..d3a04807 100644 --- a/src/main/java/tconstruct/TConstruct.java +++ b/src/main/java/tconstruct/TConstruct.java @@ -68,7 +68,7 @@ import cpw.mods.fml.relauncher.Side; */ @Mod(modid = "TConstruct", name = "TConstruct", version = "${version}", - dependencies = "required-after:Forge@[10.13.0.1200,);required-after:Mantle@[0.3.1,);after:MineFactoryReloaded;after:NotEnoughItems;after:Waila;after:ThermalExpansion") + dependencies = "required-after:Forge@[10.13.0.1200,);required-after:Mantle@[0.3.1,);after:MineFactoryReloaded;after:NotEnoughItems;after:Waila;after:ThermalExpansion;after:ThermalFoundation") public class TConstruct { public static final String modVersion = "${version}"; From d80bd63e7aa98cf129df921e0edf8c5ec6fc791b Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Thu, 16 Oct 2014 11:10:40 +0200 Subject: [PATCH 7/9] Make @Adaptivity happy --- resources/assets/tinker/lang/en_US.lang | 23 ++----------------- .../library/tools/DynamicToolPart.java | 9 +++++++- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/resources/assets/tinker/lang/en_US.lang b/resources/assets/tinker/lang/en_US.lang index ca784165..5e6d70e0 100644 --- a/resources/assets/tinker/lang/en_US.lang +++ b/resources/assets/tinker/lang/en_US.lang @@ -544,27 +544,6 @@ death.four.smeltery=%1$s thought swimming in hot liquids was a good idea death.attack.Landmine=%1$s watched their legs get blown off by a landmine death.attack.FireworkExplode=%1$s was torn apart by a wild firework explosion -parttype.wood=Wooden -parttype.stone=Stone -parttype.iron=Iron -parttype.flint=Flint -parttype.cactus=Cactus -parttype.bone=Bone -parttype.obsidian=Obsidian -parttype.slime=Slime -parttype.paper=Paper -parttype.netherrack=Netherrack -parttype.cobalt=Cobalt -parttype.ardite=Ardite -parttype.manyullyn=Manyullyn -parttype.copper=Copper -parttype.bronze=Bronze -parttype.alumite=Alumite -parttype.steel=Steel -parttype.blueslime=Slime -parttype.thaumium=Thaumium -parttype.pigiron=Pig Iron - toolpart.ToolRod=%%material Tool Rod toolpart.PickaxeHead=%%material Pickaxe Head toolpart.ShovelHead=%%material Shovel Head @@ -594,6 +573,8 @@ toolpart.Fletching=%%material Fletching # 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=Wooden fluid.iron.molten=Molten Iron fluid.gold.molten=Molten Gold diff --git a/src/main/java/tconstruct/library/tools/DynamicToolPart.java b/src/main/java/tconstruct/library/tools/DynamicToolPart.java index 69df1a68..08b17a64 100644 --- a/src/main/java/tconstruct/library/tools/DynamicToolPart.java +++ b/src/main/java/tconstruct/library/tools/DynamicToolPart.java @@ -78,7 +78,14 @@ public class DynamicToolPart extends CraftingItem implements IToolPart // general name else { - return StatCollector.translateToLocal("toolpart." + partName).replaceAll("%%material", toolmat.prefixName()); + // specific material name for materials? + String matName; + if(StatCollector.canTranslate("toolpart.material." + material)) + matName = StatCollector.translateToLocal("toolpart.material." + material); + else + matName = toolmat.prefixName(); + + return StatCollector.translateToLocal("toolpart." + partName).replaceAll("%%material", matName); } } From f14b190d8c54f983518fadf3545cb5da2fe2f49a Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 16 Oct 2014 13:33:54 +0400 Subject: [PATCH 8/9] Update ru_RU.lang --- resources/assets/tinker/lang/ru_RU.lang | 46 ++++++++++++++----------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/resources/assets/tinker/lang/ru_RU.lang b/resources/assets/tinker/lang/ru_RU.lang index 95904c7f..1c82640d 100644 --- a/resources/assets/tinker/lang/ru_RU.lang +++ b/resources/assets/tinker/lang/ru_RU.lang @@ -544,27 +544,6 @@ death.four.smeltery=%1$s думал, что купание в горячих ж death.attack.Landmine=%1$s наблюдал, как его ноги взорвались на мине death.attack.FireworkExplode=%1$s был разорван диким взрывом фейерверка -parttype.wood=Деревянный -parttype.stone=Каменный -parttype.iron=Железный -parttype.flint=Кремниевый -parttype.cactus=Кактусовый -parttype.bone=Костный -parttype.obsidian=Обсидиановый -parttype.slime=Слизневый -parttype.paper=Бумажный -parttype.netherrack=Адскокаменный -parttype.cobalt=Кобальтовый -parttype.ardite=Ардитовый -parttype.manyullyn=Мануллиновый -parttype.copper=Медный -parttype.bronze=Бронзовый -parttype.alumite=Алюмитовый -parttype.steel=Стальной -parttype.blueslime=Синеслизневый -parttype.thaumium=Таумический -parttype.pigiron=Свиножелезный - toolpart.ToolRod=%%material стержень toolpart.PickaxeHead=%%material обух кирки toolpart.ShovelHead=%%material штык лопаты @@ -594,6 +573,8 @@ toolpart.Fletching=%%material оперение # 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=Wooden fluid.iron.molten=Расплавленное железо fluid.gold.molten=Расплавленное золото @@ -717,6 +698,8 @@ smeltery.drain.tooltip1=Работает в качестве ввода и вы smeltery.drain.tooltip2=жидкостей в плавильне smeltery.brick.tooltip1=Структурный блок плавильни smeltery.brick.tooltip2=(Безопасен для декораций) +#Dear translators, only translate this line if the joke is applicable in your language. +grout.tooltip=I am Grout! gui.smeltery.fuel=Топливо gui.smeltery.emerald=Изумрудов: @@ -1462,3 +1445,24 @@ toolpart.ExcavatorHead.bronze=Бронзовая пластина копалки toolpart.ExcavatorHead.alumite=Алюмитовая пластина копалки toolpart.ExcavatorHead.steel=Стальная пластина копалки toolpart.ExcavatorHead.thaumium=Таумическая пластина копалки + +toolpart.material.wood=Деревянный +toolpart.material.stone=Каменный +toolpart.material.iron=Железный +toolpart.material.flint=Кремниевый +toolpart.material.cactus=Кактусовый +toolpart.material.bone=Костный +toolpart.material.obsidian=Обсидиановый +toolpart.material.slime=Слизневый +toolpart.material.paper=Бумажный +toolpart.material.netherrack=Адскокаменный +toolpart.material.cobalt=Кобальтовый +toolpart.material.ardite=Ардитовый +toolpart.material.manyullyn=Мануллиновый +toolpart.material.copper=Медный +toolpart.material.bronze=Бронзовый +toolpart.material.alumite=Алюмитовый +toolpart.material.steel=Стальной +toolpart.material.blueslime=Синеслизневый +toolpart.material.thaumium=Таумический +toolpart.material.pigiron=Свиножелезный From 5a5b05d1c795249c1fab1bf4d905fab31e829531 Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Thu, 16 Oct 2014 11:46:05 +0200 Subject: [PATCH 9/9] Update mod version to 1.7.1 --- build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.properties b/build.properties index 4e8f47c0..1ccb840f 100644 --- a/build.properties +++ b/build.properties @@ -4,5 +4,5 @@ mantle_version=0.3.1.jenkins176 CCLIB_version=1.1.1.95 NEI_version=1.0.2.15 ccc_version=1.0.2.9 -mod_version=1.7.0 +mod_version=1.7.1 waila_version=1.5.3_1.7.10 \ No newline at end of file