From 95b65371f1c26a0621e2bfada00f9fdf90994cf8 Mon Sep 17 00:00:00 2001 From: Andreas Troelsen Date: Sun, 11 Jul 2021 01:09:41 +0200 Subject: [PATCH] Switch to Spigot API and bump version to 1.17. Spigot has decided to discontinue distribution of the Bukkit artifacts, which means Bukkit "doesn't exist" after Minecraft 1.15. This commit takes the plunge on that change and moves to the Spigot API rather than the Bukkit API. Goodbye, Bukkit. Hello, Spigot. The version is also bumped to 1.17 to give way to new features and bug fixes otherwise blocked by staying on 1.13. Unfortunately, this brings with it a swath of potential issues with version compatibility going forward, because backwards compatibility in the API sometimes takes a back seat, such as with the Material and EntityType enums. This commit specifically changes some references that break compatibility with older server versions, but compatibility with those is reinstated later. Finally, the Spigot repository is changed to match the consensus about which path on the Spigot Nexus instance to use. This seems to be what everyone else is doing, so `bandwagon.jumpOn()`. --- pom.xml | 10 +++++----- src/main/java/com/garbagemule/MobArena/MAUtils.java | 2 +- .../com/garbagemule/MobArena/util/ClassChests.java | 2 +- .../com/garbagemule/MobArena/waves/MACreature.java | 6 ++++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 311a671..1f5bf1f 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ spigot-repo - https://hub.spigotmc.org/nexus/content/groups/public/ + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ @@ -85,11 +85,11 @@ - + - org.bukkit - bukkit - 1.13-R0.1-SNAPSHOT + org.spigotmc + spigot-api + 1.17-R0.1-SNAPSHOT provided diff --git a/src/main/java/com/garbagemule/MobArena/MAUtils.java b/src/main/java/com/garbagemule/MobArena/MAUtils.java index b29729b..771a393 100644 --- a/src/main/java/com/garbagemule/MobArena/MAUtils.java +++ b/src/main/java/com/garbagemule/MobArena/MAUtils.java @@ -274,7 +274,7 @@ public class MAUtils // Place the hippie signs //Iterator iterator = am.getClasses().iterator(); Iterator iterator = am.getClasses().values().iterator(); - Rotatable signData = (Rotatable) Material.SIGN.createBlockData(); + Rotatable signData = (Rotatable) Material.OAK_SIGN.createBlockData(); signData.setRotation(BlockFace.NORTH); for (int i = lx1+2; i <= lx2-2; i++) // Signs { diff --git a/src/main/java/com/garbagemule/MobArena/util/ClassChests.java b/src/main/java/com/garbagemule/MobArena/util/ClassChests.java index 29936cb..6561f0b 100644 --- a/src/main/java/com/garbagemule/MobArena/util/ClassChests.java +++ b/src/main/java/com/garbagemule/MobArena/util/ClassChests.java @@ -59,7 +59,7 @@ public class ClassChests { Block blockBehind = blockBelow.getRelative(backwards); // If the block below this sign is a class sign, swap the order - if (blockBelow.getType() == Material.WALL_SIGN || blockBelow.getType() == Material.SIGN) { + if (blockBelow.getType() == Material.OAK_WALL_SIGN || blockBelow.getType() == Material.OAK_SIGN) { String className = ChatColor.stripColor(((Sign) blockBelow.getState()).getLine(0)).toLowerCase(); if (arena.getClasses().containsKey(className)) { blockSign = blockBehind; // Use blockSign as a temp while swapping diff --git a/src/main/java/com/garbagemule/MobArena/waves/MACreature.java b/src/main/java/com/garbagemule/MobArena/waves/MACreature.java index e9afdc6..a373c28 100644 --- a/src/main/java/com/garbagemule/MobArena/waves/MACreature.java +++ b/src/main/java/com/garbagemule/MobArena/waves/MACreature.java @@ -45,7 +45,7 @@ public class MACreature public static final MACreature WOLF = new MACreature("wolf", "wolves", EntityType.WOLF); // Special creatures - public static final MACreature ZOMBIEPIGMAN = new MACreature("zombiepigman", "zombiepigmen", EntityType.PIG_ZOMBIE); + public static final MACreature ZOMBIEPIGMAN = new MACreature("zombiepigman", "zombiepigmen", EntityType.ZOMBIFIED_PIGLIN); public static final MACreature POWEREDCREEPER = new MACreature("poweredcreeper", EntityType.CREEPER); public static final MACreature ANGRYWOLF = new MACreature("angrywolf", "angrywolves", EntityType.WOLF); public static final MACreature ENDERMAN = new MACreature("enderman", "endermen", EntityType.ENDERMAN); @@ -76,7 +76,7 @@ public class MACreature // 1.4 creatures public static final MACreature WITCH = new MACreature("witch", "witches", EntityType.WITCH); public static final MACreature BABYZOMBIE = new MACreature("babyzombie", EntityType.ZOMBIE); - public static final MACreature BABYPIGMAN = new MACreature("babypigman", "babypigmen", EntityType.PIG_ZOMBIE); + public static final MACreature BABYPIGMAN = new MACreature("babypigman", "babypigmen", EntityType.ZOMBIFIED_PIGLIN); public static final MACreature BABYZOMBIEVILLAGER = new MACreature("babyzombievillager", EntityType.ZOMBIE_VILLAGER); // 1.6 creatures @@ -175,11 +175,13 @@ public class MACreature ((Zombie) e).setBaby(true); break; case "babypigman": + case "babyzombifiedpiglin": ((Zombie) e).setBaby(true); ((PigZombie) e).setAngry(true); break; case "pigzombie": case "zombiepigman": + case "zombifiedpiglin": ((PigZombie) e).setAngry(true); break; case "killerbunny":