Skip to content

Commit

Permalink
* Updated dependencies to 1.20.6
Browse files Browse the repository at this point in the history
* Fixed versioning issues due to package changes in 1.20.5-1.20.6
* Fixed particle enumeration name changes
  • Loading branch information
XZot1K committed May 4, 2024
1 parent 66914ad commit 21165b9
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
11 changes: 11 additions & 0 deletions .idea/aws.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/dictionaries/alexo.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<groupId>xzot1k.plugins.sp</groupId>
<artifactId>SimplePortals</artifactId>
<version>1.7.5</version>
<version>1.7.6</version>
<packaging>jar</packaging>

<name>SimplePortals</name>
Expand Down Expand Up @@ -108,7 +108,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
<version>1.20.6-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/xzot1k/plugins/sp/SimplePortals.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ private void saveLangConfig() {
@Override
public void onEnable() {
pluginInstance = this;
setServerVersion(getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3]);

// 1.20.5-1.20.6 changed packaging, so the server version is formatted as v1_20_6R1
String[] args = getServer().getClass().getPackage().getName().split("\\.");
setServerVersion(args.length > 3 ? args[3] : "v" + getServer().getBukkitVersion().replace("-R0.", "R")
.replace("-SNAPSHOT", "").replace(".", "_"));

File file = new File(getDataFolder(), "/config.yml");
if (file.exists()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void displayParticle(Player player, Location location, float offsetX, flo
Particle particle = Particle.valueOf(enumParticle);
if (!SimplePortals.getPluginInstance().getServerVersion().startsWith("v1_8") && !SimplePortals.getPluginInstance().getServerVersion().startsWith("v1_9")
&& !SimplePortals.getPluginInstance().getServerVersion().startsWith("v1_10") && !SimplePortals.getPluginInstance().getServerVersion().startsWith("v1_11")
&& !SimplePortals.getPluginInstance().getServerVersion().startsWith("v1_12") && particle == Particle.REDSTONE)
&& !SimplePortals.getPluginInstance().getServerVersion().startsWith("v1_12") && (particle.name().equals("REDSTONE") || particle.name().equals("DUST")))
player.spawnParticle(particle, location, amount, offsetX, offsetY, offsetZ, new Particle.DustOptions(Color.fromBGR(255, 0, 0), 1));
else player.spawnParticle(particle, location, amount, offsetX, offsetY, offsetZ, 0);
}
Expand All @@ -27,9 +27,9 @@ public void broadcastParticle(Location location, float offsetX, float offsetY, f
Particle particle = Particle.valueOf(enumParticle);
if (!SimplePortals.getPluginInstance().getServerVersion().startsWith("v1_8") && !SimplePortals.getPluginInstance().getServerVersion().startsWith("v1_9")
&& !SimplePortals.getPluginInstance().getServerVersion().startsWith("v1_10") && !SimplePortals.getPluginInstance().getServerVersion().startsWith("v1_11")
&& !SimplePortals.getPluginInstance().getServerVersion().startsWith("v1_12") && particle == Particle.REDSTONE)
&& !SimplePortals.getPluginInstance().getServerVersion().startsWith("v1_12") && (particle.name().equals("REDSTONE") || particle.name().equals("DUST")))
location.getWorld().spawnParticle(particle, location, amount, offsetX, offsetY, offsetZ, new Particle.DustOptions(Color.fromBGR(255, 0, 0), 1));
else location.getWorld().spawnParticle(particle, location, amount, offsetX, offsetY, offsetZ, 0);
}

}
}

0 comments on commit 21165b9

Please sign in to comment.