diff options
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/util/datafix/fixes/ItemStackMapIdFix.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower/net/minecraft/util/datafix/fixes/ItemStackMapIdFix.java.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/util/datafix/fixes/ItemStackMapIdFix.java.patch b/patch-remap/mache-spigotflower/net/minecraft/util/datafix/fixes/ItemStackMapIdFix.java.patch new file mode 100644 index 0000000000..aafb3e922d --- /dev/null +++ b/patch-remap/mache-spigotflower/net/minecraft/util/datafix/fixes/ItemStackMapIdFix.java.patch @@ -0,0 +1,30 @@ +--- a/net/minecraft/util/datafix/fixes/ItemStackMapIdFix.java ++++ b/net/minecraft/util/datafix/fixes/ItemStackMapIdFix.java +@@ -15,14 +15,13 @@ + + public class ItemStackMapIdFix extends DataFix { + +- public ItemStackMapIdFix(Schema schema, boolean flag) { +- super(schema, flag); ++ public ItemStackMapIdFix(Schema outputSchema, boolean changesType) { ++ super(outputSchema, changesType); + } + +- @Override + public TypeRewriteRule makeRule() { +- Type<?> type = this.getInputSchema().getType(References.ITEM_STACK); +- OpticFinder<Pair<String, String>> opticfinder = DSL.fieldFinder("id", DSL.named(References.ITEM_NAME.typeName(), NamespacedSchema.namespacedString())); ++ Type<?> type = this.getInputSchema().getType(DataConverterTypes.ITEM_STACK); ++ OpticFinder<Pair<String, String>> opticfinder = DSL.fieldFinder("id", DSL.named(DataConverterTypes.ITEM_NAME.typeName(), NamespacedSchema.namespacedString())); + OpticFinder<?> opticfinder1 = type.findField("tag"); + + return this.fixTypeEverywhereTyped("ItemInstanceMapIdFix", type, (typed) -> { +@@ -33,7 +32,7 @@ + Typed<?> typed1 = typed.getOrCreateTyped(opticfinder1); + Dynamic<?> dynamic1 = (Dynamic) typed1.get(DSL.remainderFinder()); + +- dynamic1 = dynamic1.set("map", dynamic1.createInt(dynamic.get("Damage").asInt(0))); ++ if (!dynamic1.getElement("map").result().isPresent()) dynamic1 = dynamic1.set("map", dynamic1.createInt(dynamic.get("Damage").asInt(0))); // CraftBukkit + return typed.set(opticfinder1, typed1.set(DSL.remainderFinder(), dynamic1)); + } else { + return typed; |