From b33caa57eb15a802a777abe3fb8fe311da30f518 Mon Sep 17 00:00:00 2001 From: CrazyPants Date: Sat, 18 Oct 2014 19:37:53 +0800 Subject: [PATCH] #1116 Soul Binder recipes not working with Special Mobs --- ReleaseNotes.txt | 15 ++++++++----- .../config/PoweredSpawnerConfig_Core.json | 1 + .../soul/AbstractSoulBinderRecipe.java | 22 ++++++++++++++----- .../soul/SoulBinderEnderCystalRecipe.java | 2 +- .../soul/SoulBinderReanimationRecipe.java | 2 +- 5 files changed, 28 insertions(+), 14 deletions(-) diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 3b76b775..e1ffced5 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -19,14 +19,17 @@ Bugs - Fixed attractor not working with wither skellies. - Dark Steel pressure plate no longer needs to be placed in the painter first when painting with quite clear glass. - #1106 Using 2nd mode of conduit probe causes server disconnect -- #1113 Dark Pick Travel does not work correctly. - #1107 Crash placing machine next to door -- #1129 Server crash on placement of Painting Machine -- #1128 Server crashes with cauldron when teleporting - #1112 (new) Dimentional transceiver doesn't save the selected channels on pickup -- #1115 Glass Painted Dark Pressure Plate doesn't render in inventory or as item -- #1125 Improved client side performance when pressurized fluid conduits are transferring small volumes of fluid -- #1121 Killer Joe XP bar doesn't update if not active +- #1113 Dark Pick Travel does not work correctly. +- #1115 Glass Painted Dark Pressure Plate doesn't render in inventory or as item +- #1116 Soul Binder recipes not working with Special Mobs +- #1121 Killer Joe XP bar doesn't update if not active +- #1125 Improved client side performance when pressurized fluid conduits are transferring small volumes of fluid +- #1128 Server crashes with cauldron when teleporting +- #1129 Server crash on placement of Painting Machine + + diff --git a/resources/assets/enderio/config/PoweredSpawnerConfig_Core.json b/resources/assets/enderio/config/PoweredSpawnerConfig_Core.json index 6a543102..571164ca 100644 --- a/resources/assets/enderio/config/PoweredSpawnerConfig_Core.json +++ b/resources/assets/enderio/config/PoweredSpawnerConfig_Core.json @@ -12,6 +12,7 @@ "Witch" : "5", "Slime" : "5", "Enderman" : "10", + "SpecialMobs.SpecialEnderman" : "10", "LavaSlime" : "2", "PigZombie" : "5", diff --git a/src/main/java/crazypants/enderio/machine/soul/AbstractSoulBinderRecipe.java b/src/main/java/crazypants/enderio/machine/soul/AbstractSoulBinderRecipe.java index 5b364523..04597ae0 100644 --- a/src/main/java/crazypants/enderio/machine/soul/AbstractSoulBinderRecipe.java +++ b/src/main/java/crazypants/enderio/machine/soul/AbstractSoulBinderRecipe.java @@ -19,15 +19,24 @@ public abstract class AbstractSoulBinderRecipe implements IMachineRecipe, ISoulB private int energyRequired; private String uid; - private Class entityClass; private int xpRequired; + private List supportedEntities = new ArrayList(); protected AbstractSoulBinderRecipe(int energyRequired, int xpRequired, String uid, Class entityClass) { this.energyRequired = energyRequired; this.xpRequired = xpRequired; - this.uid = uid; - this.entityClass = entityClass; + this.uid = uid; + supportedEntities.add((String)EntityList.classToStringMapping.get(entityClass)); + } + + protected AbstractSoulBinderRecipe(int energyRequired, int xpRequired, String uid, String... entityNames) { + this.energyRequired = energyRequired; + this.xpRequired = xpRequired; + this.uid = uid; + for(String name : entityNames) { + supportedEntities.add(name); + } } @Override @@ -87,8 +96,9 @@ public abstract class AbstractSoulBinderRecipe implements IMachineRecipe, ISoulB } int slot = input.slotNumber; ItemStack item = input.item; - if(slot == 0) { - return getSupportedSouls().contains(EnderIO.itemSoulVessel.getMobTypeFromStack(item)); + if(slot == 0) { + String type = EnderIO.itemSoulVessel.getMobTypeFromStack(item); + return getSupportedSouls().contains(type); } if(slot == 1) { return item.isItemEqual(getInputStack()); @@ -121,7 +131,7 @@ public abstract class AbstractSoulBinderRecipe implements IMachineRecipe, ISoulB @Override public List getSupportedSouls() { - return Collections.singletonList((String)EntityList.classToStringMapping.get(entityClass)); + return supportedEntities; } @Override diff --git a/src/main/java/crazypants/enderio/machine/soul/SoulBinderEnderCystalRecipe.java b/src/main/java/crazypants/enderio/machine/soul/SoulBinderEnderCystalRecipe.java index 2cf15582..b46ccecc 100644 --- a/src/main/java/crazypants/enderio/machine/soul/SoulBinderEnderCystalRecipe.java +++ b/src/main/java/crazypants/enderio/machine/soul/SoulBinderEnderCystalRecipe.java @@ -13,7 +13,7 @@ public class SoulBinderEnderCystalRecipe extends AbstractSoulBinderRecipe { public static SoulBinderEnderCystalRecipe instance = new SoulBinderEnderCystalRecipe(); private SoulBinderEnderCystalRecipe() { - super(Config.soulBinderEnderCystalRF,Config.soulBinderEnderCystalLevels, "SoulBinderEnderCystalRecipe", EntityEnderman.class); + super(Config.soulBinderEnderCystalRF,Config.soulBinderEnderCystalLevels, "SoulBinderEnderCystalRecipe", "Enderman", "SpecialMobs.SpecialEnderman"); } @Override diff --git a/src/main/java/crazypants/enderio/machine/soul/SoulBinderReanimationRecipe.java b/src/main/java/crazypants/enderio/machine/soul/SoulBinderReanimationRecipe.java index 07c29602..c6cd49a0 100644 --- a/src/main/java/crazypants/enderio/machine/soul/SoulBinderReanimationRecipe.java +++ b/src/main/java/crazypants/enderio/machine/soul/SoulBinderReanimationRecipe.java @@ -19,7 +19,7 @@ public class SoulBinderReanimationRecipe extends AbstractSoulBinderRecipe { public static SoulBinderReanimationRecipe instance = new SoulBinderReanimationRecipe(); private SoulBinderReanimationRecipe() { - super(Config.soulBinderReanimationRF, Config.soulBinderReanimationLevels, "SoulBinderReanimationRecipe", EntityZombie.class); + super(Config.soulBinderReanimationRF, Config.soulBinderReanimationLevels, "SoulBinderReanimationRecipe", "Zombie", "SpecialMobs.SpecialZombie"); } @Override