Updates for 1.20
Some checks failed
EpicKnarvik97/PaidSigns/pipeline/head There was a failure building this commit

Makes sure to unregister and refund on the sign edit event, as the sign might be registered as a paid sign already.
Updates Spigot
Updates Vault repository
This commit is contained in:
Kristian Knarvik 2023-06-23 20:34:20 +02:00
parent 05898d7d65
commit d8aabeee88
4 changed files with 16 additions and 8 deletions

10
pom.xml
View File

@ -82,8 +82,8 @@
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<id>vault-repo</id>
<url>https://nexus.hc.to/content/repositories/pub_releases</url>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<distributionManagement>
@ -101,11 +101,11 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version>
<version>1.20.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>
<groupId>com.github.MilkBowl</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.7</version>
<scope>provided</scope>
@ -113,7 +113,7 @@
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>23.0.0</version>
<version>24.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@ -92,7 +92,7 @@ public final class PaidSigns extends JavaPlugin {
//Initialize translator
translator = new Translator();
translator.registerMessageCategory(PaidSignsTranslatableMessage.BOOLEAN_TRUE);
translator.loadLanguages(this.getDataFolder(), language);
translator.loadLanguages(this.getDataFolder(), "en", language);
stringFormatter = new StringFormatter(this.getDescription().getPrefix(), translator);
signManager = new PaidSignManager(PaidSignManager.loadSigns());
@ -118,7 +118,7 @@ public final class PaidSigns extends JavaPlugin {
public void reload() {
this.reloadConfig();
loadConfig();
translator.loadLanguages(this.getDataFolder(), language);
translator.loadLanguages(this.getDataFolder(), "en", language);
signManager = new PaidSignManager(PaidSignManager.loadSigns());
TrackedSignManager.loadTrackedSigns();
}

View File

@ -36,6 +36,14 @@ public class SignListener implements Listener {
return;
}
// As signs can be edited now, this event might be triggered on an already registered sign, so unregister
if (SignHelper.isSign(event.getBlock())) {
try {
TrackedSignManager.removeTrackedSign(event.getBlock().getLocation(), true, false);
} catch (IOException ignored) {
}
}
String[] lines = event.getLines();
Map<String, PaidSign> allPaidSigns = PaidSigns.getInstance().getSignManager().getAllPaidSigns();

View File

@ -1,7 +1,7 @@
name: PaidSigns
version: '${project.version}'
main: net.knarcraft.paidsigns.PaidSigns
api-version: 1.19
api-version: '1.19'
prefix: PaidSigns
depend: [ Vault ]
authors: [ EpicKnarvik97 ]