From ff0b4485b39d51e4637a9c46b8531f3d39e1618b Mon Sep 17 00:00:00 2001 From: MagmaGuy Date: Sat, 21 Dec 2024 18:52:52 +0000 Subject: [PATCH] EliteMobs 9.2.1: - [New] Reenabled the vampire manor wormhole - [Fix] Fixed startup error related to versioning - [Fix] Fixed problem related to pre-1.21.4 versions failing to assign some models correctly - [Fix] Tweaked code for valid spawn location detection for events Signed-off-by: MagmaGuy --- build.gradle | 4 ++-- ...orWormholeConfig.off => AGVampireManorWormholeConfig.java} | 0 .../java/com/magmaguy/elitemobs/items/ItemLootShower.java | 4 +++- src/main/java/com/magmaguy/elitemobs/menus/UnbindMenu.java | 4 +++- .../mobconstructor/custombosses/CustomBossMegaConsumer.java | 3 +-- src/main/resources/plugin.yml | 2 +- 6 files changed, 10 insertions(+), 7 deletions(-) rename src/main/java/com/magmaguy/elitemobs/config/wormholes/premade/{AGVampireManorWormholeConfig.off => AGVampireManorWormholeConfig.java} (100%) diff --git a/build.gradle b/build.gradle index 2c406592b..ddae7252c 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ processResources { } group 'com.magmaguy' -version '9.2.0' +version '9.2.1' repositories { maven { @@ -114,7 +114,7 @@ dependencies { implementation group: 'commons-io', name: 'commons-io', version: '2.7' implementation group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1' implementation group: 'com.magmaguy', name: 'EasyMinecraftGoals-dist', version: '1.15.0' - implementation group: 'com.magmaguy', name: 'MagmaCore', version: '1.5-SNAPSHOT' + implementation group: 'com.magmaguy', name: 'MagmaCore', version: '1.7' } diff --git a/src/main/java/com/magmaguy/elitemobs/config/wormholes/premade/AGVampireManorWormholeConfig.off b/src/main/java/com/magmaguy/elitemobs/config/wormholes/premade/AGVampireManorWormholeConfig.java similarity index 100% rename from src/main/java/com/magmaguy/elitemobs/config/wormholes/premade/AGVampireManorWormholeConfig.off rename to src/main/java/com/magmaguy/elitemobs/config/wormholes/premade/AGVampireManorWormholeConfig.java diff --git a/src/main/java/com/magmaguy/elitemobs/items/ItemLootShower.java b/src/main/java/com/magmaguy/elitemobs/items/ItemLootShower.java index f49510569..2ade6b977 100644 --- a/src/main/java/com/magmaguy/elitemobs/items/ItemLootShower.java +++ b/src/main/java/com/magmaguy/elitemobs/items/ItemLootShower.java @@ -8,6 +8,7 @@ import com.magmaguy.elitemobs.entitytracker.EntityTracker; import com.magmaguy.elitemobs.items.customenchantments.SoulbindEnchantment; import com.magmaguy.elitemobs.playerdata.ElitePlayerInventory; +import com.magmaguy.elitemobs.versionnotifier.VersionChecker; import com.magmaguy.magmacore.util.ChatColorConverter; import com.magmaguy.magmacore.util.ItemStackGenerator; import com.magmaguy.magmacore.util.Logger; @@ -343,7 +344,8 @@ private void dropOneThousand(Location location) { private ItemStack setCoinModel(ItemStack itemStack, String data) { ItemMeta itemMeta = itemStack.getItemMeta(); - itemMeta.setItemModel(NamespacedKey.fromString(data)); + if (!VersionChecker.serverVersionOlderThan(21, 4)) + itemMeta.setItemModel(NamespacedKey.fromString(data)); itemStack.setItemMeta(itemMeta); return itemStack; } diff --git a/src/main/java/com/magmaguy/elitemobs/menus/UnbindMenu.java b/src/main/java/com/magmaguy/elitemobs/menus/UnbindMenu.java index 425bc493f..c50c63145 100644 --- a/src/main/java/com/magmaguy/elitemobs/menus/UnbindMenu.java +++ b/src/main/java/com/magmaguy/elitemobs/menus/UnbindMenu.java @@ -6,6 +6,7 @@ import com.magmaguy.elitemobs.items.ItemTagger; import com.magmaguy.elitemobs.items.customenchantments.SoulbindEnchantment; import com.magmaguy.elitemobs.items.customenchantments.UnbindEnchantment; +import com.magmaguy.elitemobs.versionnotifier.VersionChecker; import com.magmaguy.magmacore.util.ItemStackGenerator; import org.bukkit.Bukkit; import org.bukkit.ChatColor; @@ -60,7 +61,8 @@ public void constructUnbinderMenu(Player player) { if (DefaultConfig.isForceMenuUnicode() || Bukkit.getPluginManager().isPluginEnabled("ResourcePackManager")) { infoButton.setType(Material.PAPER); ItemMeta itemMeta = infoButton.getItemMeta(); - itemMeta.setItemModel(NamespacedKey.fromString("elitemobs:ui/goldenquestionmark")); + if (!VersionChecker.serverVersionOlderThan(21, 4)) + itemMeta.setItemModel(NamespacedKey.fromString("elitemobs:ui/goldenquestionmark")); infoButton.setItemMeta(itemMeta); } UnbinderInventory.setItem(i, infoButton); diff --git a/src/main/java/com/magmaguy/elitemobs/mobconstructor/custombosses/CustomBossMegaConsumer.java b/src/main/java/com/magmaguy/elitemobs/mobconstructor/custombosses/CustomBossMegaConsumer.java index 0f29280a7..fe17a72cc 100644 --- a/src/main/java/com/magmaguy/elitemobs/mobconstructor/custombosses/CustomBossMegaConsumer.java +++ b/src/main/java/com/magmaguy/elitemobs/mobconstructor/custombosses/CustomBossMegaConsumer.java @@ -7,7 +7,6 @@ import com.magmaguy.elitemobs.powers.meta.ElitePower; import com.magmaguy.elitemobs.thirdparty.custommodels.CustomModel; import com.magmaguy.elitemobs.thirdparty.libsdisguises.DisguiseEntity; -import com.magmaguy.elitemobs.thirdparty.worldguard.WorldGuardCompatibility; import com.magmaguy.elitemobs.thirdparty.worldguard.WorldGuardFlagChecker; import com.magmaguy.elitemobs.thirdparty.worldguard.WorldGuardSpawnEventBypasser; import com.magmaguy.elitemobs.utils.AttributeManager; @@ -74,7 +73,7 @@ public LivingEntity spawn() { return null; } if (EliteMobs.worldGuardIsEnabled) { - if (!WorldGuardFlagChecker.checkFlag(spawnLocation, WorldGuardCompatibility.getELITEMOBS_SPAWN_FLAG())) { + if (!WorldGuardFlagChecker.doEliteMobsSpawnFlag(spawnLocation)) { Logger.warn("Attempted to spawn " + customBossesConfigFields.getFilename() + " in location " + spawnLocation + " which is protected by WorldGuard with elitemobs-spawning deny! This should not have happened."); return null; diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 4eb25f129..f760f88f0 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: EliteMobs -version: 9.2.0 +version: 9.2.1 author: MagmaGuy main: com.magmaguy.elitemobs.EliteMobs api-version: 1.14