PaperMC/paper-server/patches/sources/net/minecraft/util/datafix/fixes/ItemStackMapIdFix.java.patch
CraftBukkit/Spigot 30e4583dbe Remap CraftBukkit to Mojang+Yarn Mappings
By: Initial Source <noreply+automated@papermc.io>
2024-12-11 22:26:55 +01:00

11 lines
719 B
Diff

--- a/net/minecraft/util/datafix/fixes/ItemStackMapIdFix.java
+++ b/net/minecraft/util/datafix/fixes/ItemStackMapIdFix.java
@@ -32,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;