diff --git a/src/main/java/crazypants/enderio/config/Config.java b/src/main/java/crazypants/enderio/config/Config.java index a712706e..ed0b8181 100644 --- a/src/main/java/crazypants/enderio/config/Config.java +++ b/src/main/java/crazypants/enderio/config/Config.java @@ -255,6 +255,7 @@ public final class Config { public static String isGasConduitEnabled = "auto"; public static String[] soulVesselBlackList = new String[0]; + public static boolean soulVesselCapturesBosses = false; public static void load(FMLPreInitializationEvent event) { @@ -680,7 +681,11 @@ public final class Config { isGasConduitEnabled = config.getString("isGasConduitEnabled", sectionItems.name, isGasConduitEnabled, "Can be set to 'auto', 'true' or 'false'. When set to auto the gas conduit will only be enabled when Mekanism is installed."); - soulVesselBlackList = config.getStringList("soulVesselBlackList", sectionItems.name, soulVesselBlackList, "Entities listed here will can not be captured in a 'Vessel of Souls'"); + soulVesselBlackList = config.getStringList("soulVesselBlackList", sectionItems.name, soulVesselBlackList, + "Entities listed here will can not be captured in a 'Vessel of Souls'"); + + soulVesselCapturesBosses = config.getBoolean("soulVesselCapturesBosses", sectionItems.name, soulVesselCapturesBosses, + "When set to false, any mob with a 'boss bar' won't be able to be captured in the 'Vessel of Souls'"); } private Config() { diff --git a/src/main/java/crazypants/enderio/item/ItemSoulVessel.java b/src/main/java/crazypants/enderio/item/ItemSoulVessel.java index 10e5ab59..04bd918b 100644 --- a/src/main/java/crazypants/enderio/item/ItemSoulVessel.java +++ b/src/main/java/crazypants/enderio/item/ItemSoulVessel.java @@ -21,6 +21,7 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.IBossDisplayData; import net.minecraft.entity.passive.EntityHorse; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -164,6 +165,10 @@ public class ItemSoulVessel extends Item implements IResourceTooltipProvider { return false; } + if(!Config.soulVesselCapturesBosses && entity instanceof IBossDisplayData) { + return false; + } + NBTTagCompound root = new NBTTagCompound(); root.setString("id", entityId); entity.writeToNBT(root);