diff --git a/MechanicsCore/src/main/java/me/deecaad/core/file/SerializeData.java b/MechanicsCore/src/main/java/me/deecaad/core/file/SerializeData.java index bb4032b2..c06527ea 100644 --- a/MechanicsCore/src/main/java/me/deecaad/core/file/SerializeData.java +++ b/MechanicsCore/src/main/java/me/deecaad/core/file/SerializeData.java @@ -1005,19 +1005,19 @@ public boolean getBool(boolean def) throws SerializerException { // Wildcards are not allowed for singleton enums, they are only // allowed for lists. input = input.trim(); - XEntityType entityType = XEntityType.of(input); - if (entityType == null) { + Optional entityType = XEntityType.of(input); + if (entityType.isEmpty()) { throw new SerializerEnumException(serializer, EntityType.class, input, false, getLocation()) .addMessage(wikiLink != null, getWikiMessage()); } - EntityType parsed = entityType.get(); + EntityType parsed = entityType.get().get(); if (parsed == null) { - throw exception(relative, "Your version, " + MinecraftVersions.getCURRENT() + ", doesn't support '" + entityType.name() + "'", + throw exception(relative, "Your version, " + MinecraftVersions.getCURRENT() + ", doesn't support '" + entityType.get().name() + "'", "Try using a different material or update your server to a newer version!"); } - return entityType.get(); + return parsed; } public @Nullable Particle getParticle(@Nullable Particle defaultValue) throws SerializerException { @@ -1030,15 +1030,15 @@ public boolean getBool(boolean def) throws SerializerException { // Wildcards are not allowed for singleton enums, they are only // allowed for lists. input = input.trim(); - XParticle particle = XParticle.of(input); - if (particle == null) { + Optional particle = XParticle.of(input); + if (particle.isEmpty()) { throw new SerializerEnumException(serializer, Particle.class, input, false, getLocation()) .addMessage(wikiLink != null, getWikiMessage()); } - Particle parsed = particle.get(); + Particle parsed = particle.get().get(); if (parsed == null) { - throw exception(relative, "Your version, " + MinecraftVersions.getCURRENT() + ", doesn't support '" + particle.name() + "'", + throw exception(relative, "Your version, " + MinecraftVersions.getCURRENT() + ", doesn't support '" + particle.get().name() + "'", "Try using a different material or update your server to a newer version!"); } diff --git a/MechanicsCore/src/main/java/me/deecaad/core/file/serializers/ItemSerializer.java b/MechanicsCore/src/main/java/me/deecaad/core/file/serializers/ItemSerializer.java index e8755380..3f07de3a 100644 --- a/MechanicsCore/src/main/java/me/deecaad/core/file/serializers/ItemSerializer.java +++ b/MechanicsCore/src/main/java/me/deecaad/core/file/serializers/ItemSerializer.java @@ -1,7 +1,9 @@ package me.deecaad.core.file.serializers; import com.cryptomorin.xseries.XMaterial; -import com.cryptomorin.xseries.XSkull; +import com.cryptomorin.xseries.profiles.builder.XSkull; +import com.cryptomorin.xseries.profiles.objects.ProfileInputType; +import com.cryptomorin.xseries.profiles.objects.Profileable; import me.deecaad.core.MechanicsCore; import me.deecaad.core.compatibility.CompatibilityAPI; import me.deecaad.core.compatibility.nbt.NBTCompatibility; @@ -321,7 +323,7 @@ public ItemStack serializeWithoutRecipe(@NotNull SerializeData data) throws Seri // https://www.spigotmc.org/threads/create-a-skull-item-stack-with-a-custom-texture-base64.82416/ if (uuid != null && url != null) { // XSkull.of(itemMeta).profile(XSkull.SkullInputType.UUID, id).apply(); - XSkull.of(skullMeta).profile(XSkull.SkullInputType.TEXTURE_URL, url).apply(); + XSkull.of(skullMeta).profile(Profileable.of(ProfileInputType.TEXTURE_URL, url)).apply(); } // Standard player name SkullMeta... "CJCrafter", "DeeCaaD", "Darkman_Bree" diff --git a/gradle.properties b/gradle.properties index 3261791b..40d5508d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ # Versions of the 2 plugins stored in this repo. -mechanicsCoreVersion=3.5.0 -weaponMechanicsVersion=3.5.1 +mechanicsCoreVersion=3.5.1 +weaponMechanicsVersion=3.5.2 # Version of the resource pack resourcePackVersion=2.1.2