Extract the boss-heart-drop blacklist into the config.

Closes #1787
This commit is contained in:
Bernhard Bonigl committed 2015-10-27 18:45:54 +01:00
1 parent f5f60ec588
commit 75b97cf4f9
2 files changed
+8 -3

No files matched your search

@@ -17,9 +17,12 @@ import tconstruct.armor.items.TravelWings;
import tconstruct.armor.player.ArmorExtended;
import tconstruct.armor.player.TPlayerStats;
import tconstruct.library.modifier.IModifyable;
import tconstruct.util.config.PHConstruct;
import tconstruct.util.network.ArmourGuiSyncPacket;
import tconstruct.world.entity.BlueSlime;
import java.util.Locale;
public class TinkerArmorEvents
{
@@ -43,8 +46,9 @@ public class TinkerArmorEvents
if (event.entityLiving instanceof IBossDisplayData)
{
String entityName = event.entityLiving.getClass().getSimpleName().toLowerCase();
if (entityName.contains("entitynpc") || entityName.contains("entitycustomnpc"))
return;
for(String name : PHConstruct.heartDropBlacklist)
if (name.toLowerCase(Locale.US).equals(entityName))
return;
int count = event.entityLiving instanceof EntityDragon ? 5 : 1;
for (int i = 0; i < count; i++)
@@ -210,6 +210,7 @@ public class PHConstruct
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);
heartDropBlacklist = config.get("Experimental", "YellowHeartDropBlacklist", new String[] {"entitynpc", "entitycustomnpc"}, "Entity classes listed here will not drop yellow hearts. The values are the actual class names in lowercase.").getStringList();
/* Save the configuration file only if it has changed */
if (config.hasChanged())
@@ -390,5 +391,5 @@ public class PHConstruct
public static boolean meltableVillagers;
public static boolean minimalTextures;
public static boolean extraBlockUpdates;
public static String[] heartDropBlacklist;
}