Merge pull request #110 from TeamHRLive/development

Replacing server version checks for 1.8
This commit is contained in:
Christian Koop 2024-07-10 14:22:03 +02:00 committed by GitHub
commit 127a50ca83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 7 deletions

View File

@ -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()));

View File

@ -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);
}