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

View File

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

View File

@ -36,6 +36,14 @@ public class SignListener implements Listener {
return; 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(); String[] lines = event.getLines();
Map<String, PaidSign> allPaidSigns = PaidSigns.getInstance().getSignManager().getAllPaidSigns(); Map<String, PaidSign> allPaidSigns = PaidSigns.getInstance().getSignManager().getAllPaidSigns();

View File

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