Compare commits

...

4 Commits

Author SHA1 Message Date
ceze88 afbb81428f Release v3.0.3 2024-04-15 16:54:12 +02:00
ceze88 b3c0f41948 Update EssentialsX kit conversion (EssentialsX 2.20.1+ required) 2024-04-15 16:53:51 +02:00
ceze88 6e568b1077 Update core version 2024-04-15 15:32:10 +02:00
ceze88 9eefc45c12 Fix relocation 2024-04-15 15:32:00 +02:00
3 changed files with 41 additions and 10 deletions

41
pom.xml
View File

@ -6,7 +6,7 @@
<groupId>com.craftaro</groupId>
<artifactId>UltimateKits</artifactId>
<version>3.0.2</version>
<version>3.0.3</version>
<name>UltimateKits</name>
<description>Creating and displaying your server's kits has never been easier</description>
@ -62,7 +62,7 @@
<relocations>
<relocation>
<pattern>com.craftaro.core</pattern>
<shadedPattern>com.craftaro.ultimatestacker.core</shadedPattern>
<shadedPattern>com.craftaro.ultimatekits.core</shadedPattern>
</relocation>
</relocations>
@ -111,11 +111,31 @@
</build>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>essentials-snapshots</id>
<url>https://repo.essentialsx.net/snapshots/</url>
</repository>
<repository>
<id>essentials-releases</id>
<url>https://repo.essentialsx.net/releases/</url>
</repository>
<repository>
<id>paper-repo</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
</repository>
<repository>
<id>public</id>
<url>https://repo.craftaro.com/repository/public/</url>
@ -133,7 +153,7 @@
<dependency>
<groupId>com.craftaro</groupId>
<artifactId>CraftaroCore</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.6-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
@ -144,10 +164,19 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.earth2me</groupId>
<artifactId>essentials</artifactId>
<version>2.17.1</version>
<groupId>net.essentialsx</groupId>
<artifactId>EssentialsX</artifactId>
<version>2.19.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- Required by Essentials -->
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>3.0.2</version>
<scope>provided</scope>
</dependency>

View File

@ -53,7 +53,8 @@ public class Convert {
}
plugin.saveKits(true);
} catch (NoSuchMethodError | NoClassDefFoundError e) {
System.out.println("UltimateKits conversion failed.");
plugin.getLogger().severe("Failed to convert kits from " + hook.getClass().getSimpleName() + "most likely due to an outdated plugin version.");
e.printStackTrace();
}
}

View File

@ -5,6 +5,7 @@ import com.craftaro.ultimatekits.conversion.Hook;
import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.Kit;
import com.earth2me.essentials.MetaItemStack;
import com.earth2me.essentials.config.EssentialsConfiguration;
import org.bukkit.Bukkit;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.inventory.ItemStack;
@ -23,10 +24,10 @@ public class EssentialsHook implements Hook {
@Override
public Map<String, ConversionKit> getKits() {
ConfigurationSection cs = this.essentials.getSettings().getKits();
EssentialsConfiguration cs = this.essentials.getKits().getRootConfig();
Map<String, ConversionKit> kits = new LinkedHashMap<>();
try {
for (String name : cs.getKeys(false)) {
for (String name : cs.getKeys()) {
Set<ItemStack> stacks = new HashSet<>();
Kit kitObj = new Kit(name, this.essentials);
for (String nonParse : kitObj.getItems()) {
@ -42,7 +43,7 @@ public class EssentialsHook implements Hook {
}
stacks.add(metaStack.getItemStack());
}
kits.put(name, new ConversionKit(stacks, Integer.toUnsignedLong((int) this.essentials.getSettings().getKit(name).getOrDefault("delay", 0))));
kits.put(name, new ConversionKit(stacks, Integer.toUnsignedLong((int) cs.getInt("delay", 0))));
}
} catch (Exception e) {
return kits;