diff --git a/pom.xml b/pom.xml
index 65942ac70..dcebb06cd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
me.lokka30
LevelledMobs
- 3.3.0 b582
+ 3.3.1 b587
jar
LevelledMobs
diff --git a/src/main/java/me/lokka30/levelledmobs/Companion.java b/src/main/java/me/lokka30/levelledmobs/Companion.java
index a02e9a073..cbe76c8be 100644
--- a/src/main/java/me/lokka30/levelledmobs/Companion.java
+++ b/src/main/java/me/lokka30/levelledmobs/Companion.java
@@ -289,18 +289,6 @@ void registerCommands() {
levelledMobsCommand.setExecutor(main.levelledMobsCommand);
}
- void loadSpigotConfig(){
- try {
- main.levelManager.attributeMaxHealthMax = Bukkit.getServer().spigot().getConfig().getDouble("settings.attribute.maxHealth.max", 2048.0);
- main.levelManager.attributeMovementSpeedMax = Bukkit.getServer().spigot().getConfig().getDouble("settings.attribute.movementSpeed.max", 2048.0);
- main.levelManager.attributeAttackDamageMax = Bukkit.getServer().spigot().getConfig().getDouble("settings.attribute.attackDamage.max", 2048.0);
- } catch (final NoSuchMethodError ignored) {
- main.levelManager.attributeMaxHealthMax = Integer.MAX_VALUE;
- main.levelManager.attributeMovementSpeedMax = Integer.MAX_VALUE;
- main.levelManager.attributeAttackDamageMax = Integer.MAX_VALUE;
- }
- }
-
void setupMetrics() {
final Metrics metrics = new Metrics(main, 6269);
diff --git a/src/main/java/me/lokka30/levelledmobs/LevelledMobs.java b/src/main/java/me/lokka30/levelledmobs/LevelledMobs.java
index e890683a2..b5dfbce56 100644
--- a/src/main/java/me/lokka30/levelledmobs/LevelledMobs.java
+++ b/src/main/java/me/lokka30/levelledmobs/LevelledMobs.java
@@ -110,7 +110,6 @@ public void onEnable() {
}
companion.registerListeners();
companion.registerCommands();
- companion.loadSpigotConfig();
Utils.logger.info("&fStart-up: &7Running misc procedures...");
if (ExternalCompatibilityManager.hasProtocolLibInstalled()) {
diff --git a/src/main/java/me/lokka30/levelledmobs/commands/subcommands/RulesSubcommand.java b/src/main/java/me/lokka30/levelledmobs/commands/subcommands/RulesSubcommand.java
index fd2ada382..a6c3c42a5 100644
--- a/src/main/java/me/lokka30/levelledmobs/commands/subcommands/RulesSubcommand.java
+++ b/src/main/java/me/lokka30/levelledmobs/commands/subcommands/RulesSubcommand.java
@@ -343,9 +343,10 @@ else if (findNearbyEntities && entities.isEmpty())
lmEntity.getLivingEntity().getLocation().getBlockX(),
lmEntity.getLivingEntity().getLocation().getBlockY(),
lmEntity.getLivingEntity().getLocation().getBlockZ());
+ final String mobLevel = lmEntity.isLevelled() ? lmEntity.getMobLevel() + "" : "0";
final List messages = getMessage("command.levelledmobs.rules.effective-rules",
- new String[]{"%mobname%", "%entitytype%", "%location%", "%world%"},
- new String[]{ entityName, lmEntity.getNameIfBaby(), locationStr, lmEntity.getWorldName() }
+ new String[]{"%mobname%", "%entitytype%", "%location%", "%world%", "%level%"},
+ new String[]{ entityName, lmEntity.getNameIfBaby(), locationStr, lmEntity.getWorldName(), mobLevel }
);
@@ -407,7 +408,8 @@ private void showEffectiveValues(final CommandSender sender, final @NotNull Livi
final RuleInfo pi = effectiveRules.get(i);
for (final Field f : pi.getClass().getDeclaredFields()) {
- if (!Modifier.isPublic(f.getModifiers())) continue;
+ if (Modifier.isPrivate(f.getModifiers())) continue;
+ f.setAccessible(true);
if (f.get(pi) == null) continue;
if (printedKeys.contains(f.getName())) continue;
if (f.getName().equals("ruleSourceNames")) continue;
diff --git a/src/main/java/me/lokka30/levelledmobs/commands/subcommands/SpawnerBaseClass.java b/src/main/java/me/lokka30/levelledmobs/commands/subcommands/SpawnerBaseClass.java
index 3fae3499d..1ef19eb07 100644
--- a/src/main/java/me/lokka30/levelledmobs/commands/subcommands/SpawnerBaseClass.java
+++ b/src/main/java/me/lokka30/levelledmobs/commands/subcommands/SpawnerBaseClass.java
@@ -91,13 +91,13 @@ private String parseFlagValue(final String keyName, final int argNumber, final S
return args[argNumber + 1];
}
- static void setMetaItems(final @Nullable ItemMeta meta, final @NotNull CustomSpawnerInfo info){
+ static void setMetaItems(final @Nullable ItemMeta meta, final @NotNull CustomSpawnerInfo info, final @NotNull String defaultName){
if (meta == null) return;
if (VersionUtils.isRunningPaper())
- PaperUtils.updateItemDisplayName(meta, info.customName == null ? "LM Spawn Egg" : info.customName);
+ PaperUtils.updateItemDisplayName(meta, info.customName == null ? defaultName : info.customName);
else
- SpigotUtils.updateItemDisplayName(meta, info.customName == null ? "LM Spawn Egg" : info.customName);
+ SpigotUtils.updateItemDisplayName(meta, info.customName == null ? defaultName : info.customName);
List lore = new LinkedList<>();
diff --git a/src/main/java/me/lokka30/levelledmobs/commands/subcommands/SpawnerEggCommand.java b/src/main/java/me/lokka30/levelledmobs/commands/subcommands/SpawnerEggCommand.java
index 621fe88d6..7c69bab7b 100644
--- a/src/main/java/me/lokka30/levelledmobs/commands/subcommands/SpawnerEggCommand.java
+++ b/src/main/java/me/lokka30/levelledmobs/commands/subcommands/SpawnerEggCommand.java
@@ -148,7 +148,7 @@ private void generateEgg(final @NotNull CustomSpawnerInfo info){
final ItemStack item = new ItemStack(material);
final ItemMeta meta = item.getItemMeta();
if (meta != null){
- setMetaItems(meta, info);
+ setMetaItems(meta, info, "LM Spawn Egg");
meta.getPersistentDataContainer().set(info.main.namespaced_keys.spawnerEgg, PersistentDataType.INTEGER, 1);
meta.getPersistentDataContainer().set(info.main.namespaced_keys.keySpawner_MinLevel, PersistentDataType.INTEGER, info.minLevel);
diff --git a/src/main/java/me/lokka30/levelledmobs/commands/subcommands/SpawnerSubCommand.java b/src/main/java/me/lokka30/levelledmobs/commands/subcommands/SpawnerSubCommand.java
index bc21a177d..c4574becb 100644
--- a/src/main/java/me/lokka30/levelledmobs/commands/subcommands/SpawnerSubCommand.java
+++ b/src/main/java/me/lokka30/levelledmobs/commands/subcommands/SpawnerSubCommand.java
@@ -242,7 +242,7 @@ public void generateSpawner(final @NotNull CustomSpawnerInfo info){
final ItemStack item = new ItemStack(Material.SPAWNER);
final ItemMeta meta = item.getItemMeta();
if (meta != null){
- setMetaItems(meta, info);
+ setMetaItems(meta, info, "LM Spawner");
meta.getPersistentDataContainer().set(info.main.namespaced_keys.keySpawner, PersistentDataType.INTEGER, 1);
meta.getPersistentDataContainer().set(info.main.namespaced_keys.keySpawner_MinLevel, PersistentDataType.INTEGER, info.minLevel);
diff --git a/src/main/java/me/lokka30/levelledmobs/commands/subcommands/SummonSubcommand.java b/src/main/java/me/lokka30/levelledmobs/commands/subcommands/SummonSubcommand.java
index 35667b0d3..27e8b5520 100644
--- a/src/main/java/me/lokka30/levelledmobs/commands/subcommands/SummonSubcommand.java
+++ b/src/main/java/me/lokka30/levelledmobs/commands/subcommands/SummonSubcommand.java
@@ -373,7 +373,7 @@ private void summonMobs(@NotNull final SummonMobOptions options) {
final Player target = options.player;
Location location = options.lmPlaceHolder.getLocation();
- if (main.levelManager.FORCED_BLOCKED_ENTITY_TYPES.contains(options.lmPlaceHolder.getTypeName())) {
+ if (main.levelManager.FORCED_BLOCKED_ENTITY_TYPES.contains(options.lmPlaceHolder.getEntityType())) {
List messages = main.messagesCfg.getStringList("command.levelledmobs.summon.not-levellable");
messages = Utils.replaceAllInList(messages, "%prefix%", main.configUtils.getPrefix());
messages = Utils.replaceAllInList(messages, "%entity%", options.lmPlaceHolder.getTypeName());
diff --git a/src/main/java/me/lokka30/levelledmobs/compatibility/Compat1_17.java b/src/main/java/me/lokka30/levelledmobs/compatibility/Compat1_17.java
index 5ea7f42be..496607a8a 100644
--- a/src/main/java/me/lokka30/levelledmobs/compatibility/Compat1_17.java
+++ b/src/main/java/me/lokka30/levelledmobs/compatibility/Compat1_17.java
@@ -6,7 +6,9 @@
import org.bukkit.entity.EntityType;
+import java.util.Collection;
import java.util.HashSet;
+import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -26,4 +28,8 @@ public static HashSet getPassiveMobs() {
EntityType.GOAT
).collect(Collectors.toCollection(HashSet::new));
}
+
+ public static Collection getForceBlockedEntityType(){
+ return List.of(EntityType.GLOW_ITEM_FRAME, EntityType.MARKER);
+ }
}
diff --git a/src/main/java/me/lokka30/levelledmobs/customdrops/CustomDropItem.java b/src/main/java/me/lokka30/levelledmobs/customdrops/CustomDropItem.java
index 082c667d7..4c7f550eb 100644
--- a/src/main/java/me/lokka30/levelledmobs/customdrops/CustomDropItem.java
+++ b/src/main/java/me/lokka30/levelledmobs/customdrops/CustomDropItem.java
@@ -27,7 +27,6 @@ public class CustomDropItem extends CustomDropBase {
boolean onlyDropIfEquipped;
public String customName;
public String mobHeadTexture;
- String nbtData;
public List lore;
List itemFlags;
private boolean hasDamageRange;
@@ -40,7 +39,7 @@ public class CustomDropItem extends CustomDropBase {
CustomDropItem(@NotNull final CustomDropsDefaults defaults) {
super(defaults);
- if (!Utils.isNullOrEmpty(defaults.damage)) this.setDamageRangeFromString(defaults.damage);
+
this.customModelDataId = defaults.customModelData;
this.chance = defaults.chance;
this.maxLevel = defaults.maxLevel;
diff --git a/src/main/java/me/lokka30/levelledmobs/customdrops/CustomDropResult.java b/src/main/java/me/lokka30/levelledmobs/customdrops/CustomDropResult.java
index cbfeaeca7..7eb423306 100644
--- a/src/main/java/me/lokka30/levelledmobs/customdrops/CustomDropResult.java
+++ b/src/main/java/me/lokka30/levelledmobs/customdrops/CustomDropResult.java
@@ -13,6 +13,5 @@
*/
public enum CustomDropResult {
HAS_OVERRIDE,
- NO_OVERRIDE,
- HAS_OVERALL_CHANCE
+ NO_OVERRIDE
}
diff --git a/src/main/java/me/lokka30/levelledmobs/customdrops/CustomDropsDefaults.java b/src/main/java/me/lokka30/levelledmobs/customdrops/CustomDropsDefaults.java
index 42f29b322..9cd5f244e 100644
--- a/src/main/java/me/lokka30/levelledmobs/customdrops/CustomDropsDefaults.java
+++ b/src/main/java/me/lokka30/levelledmobs/customdrops/CustomDropsDefaults.java
@@ -36,7 +36,6 @@ class CustomDropsDefaults {
float equippedSpawnChance;
Float overallChance;
String groupId;
- public String damage;
String playerLevelVariable;
public final List permissions;
final List overallPermissions;
diff --git a/src/main/java/me/lokka30/levelledmobs/customdrops/CustomDropsParser.java b/src/main/java/me/lokka30/levelledmobs/customdrops/CustomDropsParser.java
index bb43a0858..c18a498cb 100644
--- a/src/main/java/me/lokka30/levelledmobs/customdrops/CustomDropsParser.java
+++ b/src/main/java/me/lokka30/levelledmobs/customdrops/CustomDropsParser.java
@@ -434,7 +434,6 @@ else if (singleCommand != null)
Utils.logger.warning("custom drop " + item.getMaterial().toString() + " for " + dropInstance.getMobOrGroupName() + " has invalid NBT data: " + result.exceptionMessage);
else {
item.setItemStack(result.itemStack);
- item.nbtData = nbtStuff;
this.dropsUtilizeNBTAPI = true;
}
} else if (!hasMentionedNBTAPI_Missing) {
diff --git a/src/main/java/me/lokka30/levelledmobs/listeners/EntitySpawnListener.java b/src/main/java/me/lokka30/levelledmobs/listeners/EntitySpawnListener.java
index 08b683e20..cfb41e864 100644
--- a/src/main/java/me/lokka30/levelledmobs/listeners/EntitySpawnListener.java
+++ b/src/main/java/me/lokka30/levelledmobs/listeners/EntitySpawnListener.java
@@ -166,14 +166,16 @@ private LevelledMobSpawnReason adaptVanillaSpawnReason(final CreatureSpawnEvent.
return LevelledMobSpawnReason.valueOf(spawnReason.toString());
}
- private void delayedAddToQueue(final LivingEntityWrapper lmEntity, final Event event, final int delay){
+ private void delayedAddToQueue(final @NotNull LivingEntityWrapper lmEntity, final Event event, final int delay){
final BukkitRunnable runnable = new BukkitRunnable() {
@Override
public void run() {
main._mobsQueueManager.addToQueue(new QueueItem(lmEntity, event));
+ lmEntity.free();
}
};
+ lmEntity.inUseCount.getAndIncrement();
runnable.runTaskLater(main, delay);
}
@@ -324,7 +326,7 @@ else if (lmEntity.isBabyMob()) {
}
private static boolean shouldDenyLevel(final @NotNull LivingEntityWrapper lmEntity, final int levelAssignment){
- final boolean result =
+ boolean result =
lmEntity.reEvaluateLevel &&
!lmEntity.isRulesForceAll &&
lmEntity.playerLevellingAllowDecrease != null &&
@@ -332,6 +334,12 @@ private static boolean shouldDenyLevel(final @NotNull LivingEntityWrapper lmEnti
lmEntity.isLevelled() &&
levelAssignment < lmEntity.getMobLevel();
+ if (result){
+ synchronized (lmEntity.getLivingEntity().getPersistentDataContainer()) {
+ result = lmEntity.getPDC().has(lmEntity.getMainInstance().namespaced_keys.playerLevelling_Id, PersistentDataType.STRING);
+ }
+ }
+
if (!result && lmEntity.pendingPlayerIdToSet != null) {
synchronized (lmEntity.getLivingEntity().getPersistentDataContainer()) {
lmEntity.getPDC().set(lmEntity.getMainInstance().namespaced_keys.playerLevelling_Id, PersistentDataType.STRING, lmEntity.pendingPlayerIdToSet);
diff --git a/src/main/java/me/lokka30/levelledmobs/managers/LevelManager.java b/src/main/java/me/lokka30/levelledmobs/managers/LevelManager.java
index 61988a110..9f642cfee 100644
--- a/src/main/java/me/lokka30/levelledmobs/managers/LevelManager.java
+++ b/src/main/java/me/lokka30/levelledmobs/managers/LevelManager.java
@@ -7,6 +7,7 @@
import me.lokka30.levelledmobs.LevelInterface;
import me.lokka30.levelledmobs.LevelledMobs;
import me.lokka30.levelledmobs.LivingEntityInterface;
+import me.lokka30.levelledmobs.compatibility.Compat1_17;
import me.lokka30.levelledmobs.customdrops.CustomDropResult;
import me.lokka30.levelledmobs.events.MobPostLevelEvent;
import me.lokka30.levelledmobs.events.MobPreLevelEvent;
@@ -19,6 +20,7 @@
import me.lokka30.levelledmobs.rules.strategies.SpawnDistanceStrategy;
import me.lokka30.levelledmobs.rules.strategies.YDistanceStrategy;
import me.lokka30.microlib.messaging.MessageUtils;
+import me.lokka30.microlib.other.VersionUtils;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Location;
@@ -26,7 +28,15 @@
import org.bukkit.attribute.Attribute;
import org.bukkit.attribute.AttributeInstance;
import org.bukkit.enchantments.EnchantmentTarget;
-import org.bukkit.entity.*;
+import org.bukkit.entity.ChestedHorse;
+import org.bukkit.entity.Creeper;
+import org.bukkit.entity.Entity;
+import org.bukkit.entity.EntityType;
+import org.bukkit.entity.Horse;
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.entity.Player;
+import org.bukkit.entity.Vehicle;
+import org.bukkit.entity.Zombie;
import org.bukkit.inventory.AbstractHorseInventory;
import org.bukkit.inventory.EntityEquipment;
import org.bukkit.inventory.ItemStack;
@@ -63,13 +73,26 @@ public LevelManager(final LevelledMobs main) {
Material.GOLDEN_HORSE_ARMOR,
Material.DIAMOND_HORSE_ARMOR
);
+
+ this.FORCED_BLOCKED_ENTITY_TYPES = new HashSet<>(Arrays.asList(
+ EntityType.AREA_EFFECT_CLOUD, EntityType.ARMOR_STAND, EntityType.ARROW, EntityType.BOAT,
+ EntityType.DRAGON_FIREBALL, EntityType.DROPPED_ITEM, EntityType.EGG, EntityType.ENDER_CRYSTAL,
+ EntityType.ENDER_PEARL, EntityType.ENDER_SIGNAL, EntityType.EXPERIENCE_ORB, EntityType.FALLING_BLOCK,
+ EntityType.FIREBALL, EntityType.FIREWORK, EntityType.FISHING_HOOK,
+ EntityType.ITEM_FRAME, EntityType.LEASH_HITCH, EntityType.LIGHTNING, EntityType.LLAMA_SPIT,
+ EntityType.MINECART, EntityType.MINECART_CHEST, EntityType.MINECART_COMMAND, EntityType.MINECART_FURNACE,
+ EntityType.MINECART_HOPPER, EntityType.MINECART_MOB_SPAWNER, EntityType.MINECART_TNT, EntityType.PAINTING,
+ EntityType.PRIMED_TNT, EntityType.SMALL_FIREBALL, EntityType.SNOWBALL, EntityType.SPECTRAL_ARROW,
+ EntityType.SPLASH_POTION, EntityType.THROWN_EXP_BOTTLE,EntityType.TRIDENT, EntityType.UNKNOWN,
+ EntityType.WITHER_SKULL, EntityType.SHULKER_BULLET, EntityType.PLAYER
+ ));
+ if (VersionUtils.isOneSeventeen())
+ this.FORCED_BLOCKED_ENTITY_TYPES.addAll(Compat1_17.getForceBlockedEntityType());
+
}
private final LevelledMobs main;
private final List vehicleNoMultiplierItems;
- public double attributeMaxHealthMax = 2048.0;
- public double attributeMovementSpeedMax = 2048.0;
- public double attributeAttackDamageMax = 2048.0;
public final Map summonedOrSpawnEggs;
public static final Object summonedOrSpawnEggs_Lock = new Object();
private boolean hasMentionedNBTAPI_Missing;
@@ -78,18 +101,8 @@ public LevelManager(final LevelledMobs main) {
/**
* The following entity types *MUST NOT* be levellable.
- * Stored as Strings since older versions may not contain certain entity type constants
*/
- public final HashSet FORCED_BLOCKED_ENTITY_TYPES = new HashSet<>(Arrays.asList(
- "AREA_EFFECT_CLOUD", "ARMOR_STAND", "ARROW", "BOAT", "DRAGON_FIREBALL", "DROPPED_ITEM",
- "EGG", "ENDER_CRYSTAL", "ENDER_PEARL", "ENDER_SIGNAL", "EXPERIENCE_ORB",
- "FALLING_BLOCK", "FIREBALL", "FIREWORK", "FISHING_HOOK", "GLOW_ITEM_FRAME",
- "ITEM_FRAME", "LEASH_HITCH", "LIGHTNING", "LLAMA_SPIT", "MARKER", "MINECART",
- "MINECART_CHEST", "MINECART_COMMAND", "MINECART_FURNACE", "MINECART_HOPPER",
- "MINECART_MOB_SPAWNER", "MINECART_TNT", "NPC", "PAINTING", "PLAYER", "PRIMED_TNT",
- "SMALL_FIREBALL", "SNOWBALL", "SPECTRAL_ARROW", "SPLASH_POTION", "THROWN_EXP_BOTTLE",
- "TRIDENT", "UNKNOWN", "WITHER_SKULL"
- ));
+ public final HashSet FORCED_BLOCKED_ENTITY_TYPES;
public void clearRandomLevellingCache(){
this.randomLevellingCache.clear();
@@ -179,7 +192,7 @@ private int generateRandomLevel(RandomLevellingStrategy randomLevelling, final i
int levelSource;
final String variableToUse = Utils.isNullOrEmpty(options.variable) ? "%level%" : options.variable;
final double scale = options.playerLevelScale != null ? options.playerLevelScale : 1.0;
- final boolean usePlayerMax = options.usePlayerMaxLevel != null && options.matchPlayerLevel;
+ final boolean usePlayerMax = options.usePlayerMaxLevel != null && options.usePlayerMaxLevel;
final boolean matchPlayerLvl = options.matchPlayerLevel != null && options.matchPlayerLevel;
final PlayerLevelSourceResult playerLevelSourceResult = getPlayerLevelSourceNumber(lmEntity.getPlayerForLevelling(), variableToUse);
final double origLevelSource = playerLevelSourceResult.isNumericResult ? playerLevelSourceResult.numericResult : 1;
@@ -756,6 +769,8 @@ private void runNametagCheck_aSync(final @NotNull Map> entit
// Mob must be a livingentity that is ...living.
if (!(entity instanceof LivingEntity) || entity instanceof Player || !entity.isValid()) continue;
+ // this is mostly so for spawner mobs and spawner egg mobs as they have a 20 tick delay in before proessing
+ if (entity.getTicksLived() < 30) continue;
boolean wrapperHasReference = false;
final LivingEntityWrapper lmEntity = LivingEntityWrapper.getInstance((LivingEntity) entity, main);
@@ -1060,7 +1075,7 @@ public LevellableState getLevellableState(@NotNull final LivingEntityInterface l
This is also ran in getLevellableState(EntityType), however it is important that this is ensured
before all other checks are made.
*/
- if (FORCED_BLOCKED_ENTITY_TYPES.contains(lmInterface.getTypeName()))
+ if (FORCED_BLOCKED_ENTITY_TYPES.contains(lmInterface.getEntityType()))
return LevellableState.DENIED_FORCE_BLOCKED_ENTITY_TYPE;
if (lmInterface.getApplicableRules().isEmpty())
diff --git a/src/main/java/me/lokka30/levelledmobs/misc/CustomUniversalGroups.java b/src/main/java/me/lokka30/levelledmobs/misc/CustomUniversalGroups.java
index ae9b19115..19e84bd8e 100644
--- a/src/main/java/me/lokka30/levelledmobs/misc/CustomUniversalGroups.java
+++ b/src/main/java/me/lokka30/levelledmobs/misc/CustomUniversalGroups.java
@@ -12,7 +12,6 @@
* @since 2.6.0
*/
public enum CustomUniversalGroups {
- NOT_APPLICABLE,
ALL_MOBS,
ALL_LEVELLABLE_MOBS,
ALL_HOSTILE_MOBS,
diff --git a/src/main/java/me/lokka30/levelledmobs/misc/LevellableState.java b/src/main/java/me/lokka30/levelledmobs/misc/LevellableState.java
index f92034981..8f2cc3f32 100644
--- a/src/main/java/me/lokka30/levelledmobs/misc/LevellableState.java
+++ b/src/main/java/me/lokka30/levelledmobs/misc/LevellableState.java
@@ -27,25 +27,12 @@ public enum LevellableState {
*/
DENIED_FORCE_BLOCKED_ENTITY_TYPE,
- /**
- * settings.yml has been configured to block mobs
- * spawning in entity's world from being levelled
- */
- DENIED_CONFIGURATION_BLOCKED_WORLD,
-
/**
* settings.yml has been configured to block mobs
* of such entity type from being levelled
*/
DENIED_CONFIGURATION_BLOCKED_ENTITY_TYPE,
- /**
- * settings.yml has been configured to block mobs
- * that spawn with a specific SpawnReason through
- * CreatureSpawnEvent.
- */
- DENIED_CONFIGURATION_BLOCKED_SPAWN_REASON,
-
/**
* settings.yml has been configured to block
* DangerousCaves mobs from being levelled.
@@ -94,12 +81,6 @@ public enum LevellableState {
*/
DENIED_CONFIGURATION_COMPATIBILITY_SIMPLEPETS,
- /**
- * WorldGuard region flag states that
- * mobs are not levellable in its region
- */
- DENIED_CONFIGURATION_COMPATIBILITY_WORLD_GUARD,
-
/**
* A rule has been configured to block
* nametagged mobs from being levelled.
diff --git a/src/main/java/me/lokka30/levelledmobs/misc/LivingEntityPlaceHolder.java b/src/main/java/me/lokka30/levelledmobs/misc/LivingEntityPlaceHolder.java
index 961fe6796..1170fb76a 100644
--- a/src/main/java/me/lokka30/levelledmobs/misc/LivingEntityPlaceHolder.java
+++ b/src/main/java/me/lokka30/levelledmobs/misc/LivingEntityPlaceHolder.java
@@ -95,10 +95,6 @@ public EntityType getEntityType() {
return main.rulesManager.getApplicableRules(this).allApplicableRules;
}
- public ApplicableRulesResult getRules(){
- return main.rulesManager.getApplicableRules(this);
- }
-
@NotNull
public String getTypeName(){
return this.entityType.name();
diff --git a/src/main/java/me/lokka30/levelledmobs/rules/FineTuningAttributes.java b/src/main/java/me/lokka30/levelledmobs/rules/FineTuningAttributes.java
index 18062daea..c59e6c055 100644
--- a/src/main/java/me/lokka30/levelledmobs/rules/FineTuningAttributes.java
+++ b/src/main/java/me/lokka30/levelledmobs/rules/FineTuningAttributes.java
@@ -17,8 +17,6 @@
* @since 3.0.0
*/
public class FineTuningAttributes implements Cloneable {
- EntityType applicableEntity;
-
public Double attackDamage;
public Double creeperExplosionRadius;
public Double maxHealth;
diff --git a/src/main/java/me/lokka30/levelledmobs/rules/RulesParsingManager.java b/src/main/java/me/lokka30/levelledmobs/rules/RulesParsingManager.java
index 57a56f367..6c68d9e8d 100644
--- a/src/main/java/me/lokka30/levelledmobs/rules/RulesParsingManager.java
+++ b/src/main/java/me/lokka30/levelledmobs/rules/RulesParsingManager.java
@@ -26,6 +26,7 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.EnumMap;
+import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
@@ -1003,7 +1004,6 @@ private void parseFineTuning(final ConfigurationSection cs){
final FineTuningAttributes attribs = parseFineTuningValues(objTo_CS(cs_Custom, mobName));
if (attribs == null) continue;
- attribs.applicableEntity = entityType;
fineTuning.put(mobName, attribs);
}
@@ -1052,7 +1052,14 @@ private ConfigurationSection objTo_CS(final ConfigurationSection cs, final Strin
return (ConfigurationSection) object;
} else if (object instanceof Map) {
final MemoryConfiguration result = new MemoryConfiguration();
- result.addDefaults((Map) object);
+
+ // this is to convert any non-string objects
+ final Map