From 4611e2b2bac8d39ae6be61ce8af9f88999afaabb Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Sat, 14 Feb 2015 23:57:52 +0100 Subject: [PATCH] Add a config option if villagers are meltable into emeralds. #1400 If disabled they'll give blood. And horses will do that too now if the option for glue is disabled. --- src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java | 6 +++--- src/main/java/tconstruct/util/config/PHConstruct.java | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java b/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java index 4924952d..a77c7132 100644 --- a/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java +++ b/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java @@ -333,7 +333,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci { if (moltenMetal.size() >= 1) { - if (o instanceof EntityVillager) + if (o instanceof EntityVillager && PHConstruct.meltableVillagers) { EntityVillager villager = (EntityVillager) o; if (villager.attackEntityFrom(new SmelteryDamageSource(), 5)) @@ -367,10 +367,10 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci } } } - else if (o instanceof EntityHorse) + else if (o instanceof EntityHorse && PHConstruct.meltableHorses) { EntityHorse horse = (EntityHorse) o; - if (PHConstruct.meltableHorses && horse.attackEntityFrom(new SmelteryDamageSource(), 5)) + if (horse.attackEntityFrom(new SmelteryDamageSource(), 5)) { if (currentLiquid + 108 < maxLiquid) { diff --git a/src/main/java/tconstruct/util/config/PHConstruct.java b/src/main/java/tconstruct/util/config/PHConstruct.java index 72ebcbb9..6c39f729 100644 --- a/src/main/java/tconstruct/util/config/PHConstruct.java +++ b/src/main/java/tconstruct/util/config/PHConstruct.java @@ -189,6 +189,7 @@ public class PHConstruct throwableSmeltery = config.get("Experimental", "Items can be thrown into smelteries", true).getBoolean(true); newSmeltery = config.get("Experimental", "Use new adaptive Smeltery code", false, "Warning: Very buggy").getBoolean(false); meltableHorses = config.get("Experimental", "Allow horses to be melted down for glue", true).getBoolean(true); + meltableVillagers = config.get("Experimental", "Allow villagers to be melted down for emeralds", true).getBoolean(true); minimalTextures = config.get("Experimental", "Minimal Textures", false).getBoolean(false); extraBlockUpdates = config.get("Experimental", "Send additional block updates when using AOE tools", true,"This fixes very fast tools sometimes resulting in ghost blocks, but causes a bit more network traffic. Should be fine in theory.").getBoolean(true); @@ -362,6 +363,7 @@ public class PHConstruct public static boolean throwableSmeltery; public static boolean newSmeltery; public static boolean meltableHorses; + public static boolean meltableVillagers; public static boolean minimalTextures; public static boolean extraBlockUpdates;