Skip to content

Commit

Permalink
Fix crafting recipe producing incorrect armor
Browse files Browse the repository at this point in the history
  • Loading branch information
CJCrafter committed Sep 20, 2022
1 parent 9116a2c commit 66f4d15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

group = "me.cjcrafter"
version = "1.3.8"
version = "1.3.9"

plugins {
`java-library`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public ArmorSerializer() {
@Nonnull
@Override
public ItemStack serialize(SerializeData data) throws SerializerException {
ItemStack item = super.serialize(data);
ItemStack item = super.serializeWithoutRecipe(data);

if (!isArmor(item))
throw data.exception("Type", "Material was not a valid armor type", SerializerException.forValue(item.getType()));
Expand All @@ -30,10 +30,10 @@ public ItemStack serialize(SerializeData data) throws SerializerException {
CompatibilityAPI.getNBTCompatibility().setString(item, "ArmorMechanics", "armor-title", title);

// Register the effects
ArmorMechanics.INSTANCE.armors.put(title, item);
ArmorMechanics.INSTANCE.armors.put(title, item.clone()); // clone... just in case
ArmorMechanics.INSTANCE.effects.put(title, effect);

return item;
return super.serializeRecipe(data, item);
}

public static boolean isArmor(ItemStack item) {
Expand Down

0 comments on commit 66f4d15

Please # to comment.