From 926b5cbcf7fb9caaa70a3b5e27461a484d1fed5b Mon Sep 17 00:00:00 2001 From: TeamHRLive Date: Tue, 9 Jul 2024 18:42:46 +0530 Subject: [PATCH] [Fixed] Error due to Particles in 1.8.8 --- .../compatibility/CompatibleParticleHandler.java | 12 ++++++------ Core/src/main/java/com/craftaro/core/gui/Gui.java | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Compatibility/src/main/java/com/craftaro/core/compatibility/CompatibleParticleHandler.java b/Compatibility/src/main/java/com/craftaro/core/compatibility/CompatibleParticleHandler.java index 8985422b..32c3eac6 100644 --- a/Compatibility/src/main/java/com/craftaro/core/compatibility/CompatibleParticleHandler.java +++ b/Compatibility/src/main/java/com/craftaro/core/compatibility/CompatibleParticleHandler.java @@ -133,7 +133,7 @@ public class CompatibleParticleHandler { } ParticleType() { - if (ServerVersion.isServerVersionAtOrBelow(ServerVersion.V1_8)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_9)) { this.compatibilityMode = true; this.particle = null; this.compatibleEffect = LegacyParticleEffects.Type.valueOf(name()); @@ -154,7 +154,7 @@ public class CompatibleParticleHandler { ParticleType(ServerVersion minVersion, String compatible) { // Particle class doesn't exist in 1.8 - if (ServerVersion.isServerVersionAtOrBelow(ServerVersion.V1_8)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_9)) { this.compatibilityMode = true; this.compatibleEffect = LegacyParticleEffects.Type.valueOf(compatible); this.particle = null; @@ -201,7 +201,7 @@ public class CompatibleParticleHandler { } public static void spawnParticles(ParticleType type, Location location) { - if (ServerVersion.isServerVersionAtOrBelow(ServerVersion.V1_8)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_9)) { LegacyParticleEffects.createParticle(location, type.compatibleEffect); } else { location.getWorld().spawnParticle((Particle) type.particle, location, 0); @@ -209,7 +209,7 @@ public class CompatibleParticleHandler { } public static void spawnParticles(ParticleType type, Location location, int count) { - if (ServerVersion.isServerVersionAtOrBelow(ServerVersion.V1_8)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_9)) { for (int i = 0; i < count; ++i) { float xx = (float) (1 * (Math.random() - Math.random())); float yy = (float) (1 * (Math.random() - Math.random())); @@ -224,7 +224,7 @@ public class CompatibleParticleHandler { } public static void spawnParticles(ParticleType type, Location location, int count, double offsetX, double offsetY, double offsetZ) { - if (ServerVersion.isServerVersionAtOrBelow(ServerVersion.V1_8)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_9)) { for (int i = 0; i < count; ++i) { float xx = (float) (offsetX * (Math.random() - Math.random())); float yy = (float) (offsetY * (Math.random() - Math.random())); @@ -242,7 +242,7 @@ public class CompatibleParticleHandler { } public static void spawnParticles(ParticleType type, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, Player receiver) { - if (ServerVersion.isServerVersionAtOrBelow(ServerVersion.V1_8)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_9)) { for (int i = 0; i < count; i++) { float xx = (float) (offsetX * (Math.random() - Math.random())); float yy = (float) (offsetY * (Math.random() - Math.random())); diff --git a/Core/src/main/java/com/craftaro/core/gui/Gui.java b/Core/src/main/java/com/craftaro/core/gui/Gui.java index 1b28936e..38a855cb 100644 --- a/Core/src/main/java/com/craftaro/core/gui/Gui.java +++ b/Core/src/main/java/com/craftaro/core/gui/Gui.java @@ -895,7 +895,7 @@ public class Gui { return ""; } - if (ServerVersion.isServerVersionAtOrBelow(ServerVersion.V1_8) && title.length() > 32) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_9) && title.length() > 32) { return title.charAt(30) == 'ยง' ? title.substring(0, 30) : title.substring(0, 31); }