From 2380a1c35912e2eff00a7f519773b1fbd68a975b Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Sun, 21 Jan 2024 09:11:40 -0500 Subject: [PATCH] fix: fix spawn in ArmorStandUtils --- .../thebusybiscuit/slimefun4/utils/ArmorStandUtils.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ArmorStandUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ArmorStandUtils.java index 5635a040c2..e2cf5ae10f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ArmorStandUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ArmorStandUtils.java @@ -21,6 +21,8 @@ */ public class ArmorStandUtils { + private ArmorStandUtils() {} + /** * Spawns an {@link ArmorStand} at the given {@link Location} with the given custom name *
@@ -51,15 +53,14 @@ public class ArmorStandUtils { // The consumer method was moved from World to RegionAccessor in 1.20.2 // Due to this, we need to use a rubbish workaround to support 1.20.1 and below // This causes flicker on these versions which sucks but not sure a better way around this right now. - if (PaperLib.getMinecraftVersion() <= 20 - && PaperLib.getMinecraftPatchVersion() < 2 - ) { + if (PaperLib.getMinecraftVersion() < 20 || + (PaperLib.getMinecraftVersion() == 20 && PaperLib.getMinecraftPatchVersion() < 2)) { ArmorStand armorStand = location.getWorld().spawn(location, ArmorStand.class); setupArmorStand(armorStand); return armorStand; } - return location.getWorld().spawn(location, ArmorStand.class, armorStand -> setupArmorStand(armorStand)); + return location.getWorld().spawn(location, ArmorStand.class, ArmorStandUtils::setupArmorStand); } private static void setupArmorStand(ArmorStand armorStand) {