summaryrefslogtreecommitdiffstats
path: root/nms-patches/DataConverterMap.patch
blob: 190d6490c21cac353cef7df3984d7a093146c562 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--- a/net/minecraft/server/DataConverterMap.java
+++ b/net/minecraft/server/DataConverterMap.java
@@ -22,7 +22,7 @@
     public TypeRewriteRule makeRule() {
         Type type = this.getInputSchema().getType(DataConverterTypes.ITEM_STACK);
         OpticFinder opticfinder = DSL.fieldFinder("id", DSL.named(DataConverterTypes.q.typeName(), DSL.namespacedString()));
-        OpticFinder opticfinder1 = type.findField("tag");
+        OpticFinder<?> opticfinder1 = type.findField("tag"); // CraftBukkit - decompile error
 
         return this.fixTypeEverywhereTyped("ItemInstanceMapIdFix", type, (typed) -> {
             Optional optional = typed.getOptional(opticfinder);
@@ -32,7 +32,7 @@
                 Typed typed1 = typed.getOrCreateTyped(opticfinder1);
                 Dynamic dynamic1 = (Dynamic) typed1.get(DSL.remainderFinder());
 
-                dynamic1 = dynamic1.set("map", dynamic1.createInt(dynamic.getInt("Damage")));
+                if (!dynamic1.get("map").isPresent()) dynamic1 = dynamic1.set("map", dynamic1.createInt(dynamic.getInt("Damage"))); // CraftBukkit
                 return typed.set(opticfinder1, typed1.set(DSL.remainderFinder(), dynamic1));
             } else {
                 return typed;