Skip to content

Commit

Permalink
Merge pull request #110 from TeamHRLive/development
Browse files Browse the repository at this point in the history
Replacing server version checks for 1.8
  • Loading branch information
SpraxDev authored Jul 10, 2024
2 parents 363ff47 + 926b5cb commit 127a50c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public enum ParticleType {
}

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());
Expand All @@ -154,7 +154,7 @@ public enum ParticleType {

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;
Expand Down Expand Up @@ -201,15 +201,15 @@ public static void spawnParticles(String type, Location location, int count, dou
}

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

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()));
Expand All @@ -224,7 +224,7 @@ public static void spawnParticles(ParticleType type, Location location, int coun
}

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()));
Expand All @@ -242,7 +242,7 @@ public static void spawnParticles(ParticleType type, Location location, int coun
}

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()));
Expand Down
2 changes: 1 addition & 1 deletion Core/src/main/java/com/craftaro/core/gui/Gui.java
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ protected static String trimTitle(String title) {
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);
}

Expand Down

0 comments on commit 127a50c

Please sign in to comment.