3
0
Fork 0

Bumped deps, moved IOByte deps to SBD repo, removed ParkPlus support
All checks were successful
Plugins/ThemeParkPlus/pipeline/head This commit looks good

This commit is contained in:
Stijn Bannink 2023-10-12 20:36:09 +02:00
parent 4a4c620d53
commit d71f9a0fca
5 changed files with 12 additions and 48 deletions

23
pom.xml
View file

@ -6,7 +6,7 @@
<groupId>nl.SBDeveloper</groupId> <groupId>nl.SBDeveloper</groupId>
<artifactId>ThemeParkPlus</artifactId> <artifactId>ThemeParkPlus</artifactId>
<version>3.2</version> <version>3.2.1</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>ThemeParkPlus</name> <name>ThemeParkPlus</name>
@ -115,28 +115,25 @@
<url>https://repo.codemc.org/repository/maven-public/</url> <url>https://repo.codemc.org/repository/maven-public/</url>
<layout>default</layout> <layout>default</layout>
</repository> </repository>
<repository>
<id>sbdevelopment-repo-releases</id>
<name>SBDevelopment Repository</name>
<url>https://repo.sbdevelopment.tech/releases</url>
</repository>
</repositories> </repositories>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId> <artifactId>spigot-api</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version> <version>1.20.2-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>me.paradoxpixel</groupId> <groupId>nl.iobyte</groupId>
<artifactId>themepark</artifactId> <artifactId>themepark</artifactId>
<version>3.1.1</version> <version>3.1.3</version>
<scope>system</scope> <scope>provided</scope>
<systemPath>${pom.basedir}/src/lib/ThemePark_v3.1.1.jar</systemPath>
</dependency>
<dependency>
<groupId>me.paradoxpixel</groupId>
<artifactId>parkplusmc</artifactId>
<version>1.4</version>
<scope>system</scope>
<systemPath>${pom.basedir}/src/lib/parkplus-1.4.jar</systemPath>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>

Binary file not shown.

Binary file not shown.

View file

@ -84,14 +84,11 @@ public final class ThemeParkPlus extends JavaPlugin {
Bukkit.getPluginManager().registerEvents(new AntiFreerunListener(), this); Bukkit.getPluginManager().registerEvents(new AntiFreerunListener(), this);
} }
if (Bukkit.getPluginManager().getPlugin("ThemePark") == null && Bukkit.getPluginManager().getPlugin("ParkPlusMC") == null) { if (Bukkit.getPluginManager().getPlugin("ThemePark") == null) {
getLogger().severe("ThemePark or ParkPlusMC not found! Some functions will not work without it!"); getLogger().warning("ThemePark not found! Some functions will not work without it!");
} else if (Bukkit.getPluginManager().getPlugin("ThemePark") != null) { } else if (Bukkit.getPluginManager().getPlugin("ThemePark") != null) {
getLogger().info("Enabling ThemePark hook..."); getLogger().info("Enabling ThemePark hook...");
hasParkHook = true; hasParkHook = true;
} else if (Bukkit.getPluginManager().getPlugin("ParkPlusMC") != null) {
getLogger().info("Enabling ParkPlusMC hook...");
hasParkHook = true;
} }
if (hasParkHook) { if (hasParkHook) {

View file

@ -73,34 +73,4 @@ public class StatusChangeListener implements Listener {
ThemeParkPlus.getWebhookClient().send(message); ThemeParkPlus.getWebhookClient().send(message);
} }
@EventHandler
public void onStatusChangePPMC(nl.iobyte.parkplus.generic.event.attraction.AttractionStatusChangeEvent e) {
String title = ThemeParkPlus.getSConfig().getFile().getString("DiscordWebhook.Embed.Title");
if (title == null) return;
String rideName = ChatColor.stripColor(ConfigUtil.__(e.getAttraction().getName()));
String regionName = ChatColor.stripColor(ConfigUtil.__(e.getAttraction().getRegionID()));
String statusAfter = ChatColor.stripColor(ConfigUtil.__(e.getCurrent().getColor() + e.getCurrent().getName()));
title = title.replaceAll("%RideName%", rideName);
title = title.replaceAll("%Region%", regionName);
String copy = ThemeParkPlus.getSConfig().getFile().getString("DiscordWebhook.Embed.Copyright");
String copyimg = ThemeParkPlus.getSConfig().getFile().getString("DiscordWebhook.Embed.CopyrightImage");
Integer color = ThemeParkPlus.getSConfig().getFile().getInt("DiscordWebhook.Embed.Colors." + e.getCurrent().name());
if (copy == null || copyimg == null) return;
WebhookEmbed embed = new WebhookEmbedBuilder()
.setTitle(new WebhookEmbed.EmbedTitle(title, null))
.setFooter(new WebhookEmbed.EmbedFooter(copy, copyimg))
.setColor(color)
.addField(new WebhookEmbed.EmbedField(false, rideName, statusAfter))
.build();
WebhookMessage message = new WebhookMessageBuilder()
.addEmbeds(embed)
.build();
ThemeParkPlus.getWebhookClient().send(message);
}
} }