blob: cb554a827d812f748efffde0fe6ca2c0ed7e0231 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
--- a/net/minecraft/util/datafix/fixes/ItemStackTheFlatteningFix.java
+++ b/net/minecraft/util/datafix/fixes/ItemStackTheFlatteningFix.java
@@ -421,11 +372,12 @@
typed1 = typed.set(opticFinder, Pair.of(References.ITEM_NAME.typeName(), string));
}
- if (DAMAGE_IDS.contains(optional.get().getSecond())) {
- Typed<?> typed2 = typed.getOrCreateTyped(opticFinder1);
- Dynamic<?> dynamic1 = typed2.get(DSL.remainderFinder());
- dynamic1 = dynamic1.set("Damage", dynamic1.createInt(_int));
- typed1 = typed1.set(opticFinder1, typed2.set(DSL.remainderFinder(), dynamic1));
+ if (ItemStackTheFlatteningFix.DAMAGE_IDS.contains(((Pair) optional.get()).getSecond())) {
+ Typed<?> typed2 = typed.getOrCreateTyped(opticfinder1);
+ Dynamic<?> dynamic1 = (Dynamic) typed2.get(DSL.remainderFinder());
+
+ if (i != 0) dynamic1 = dynamic1.set("Damage", dynamic1.createInt(i)); // CraftBukkit
+ typed1 = typed1.set(opticfinder1, typed2.set(DSL.remainderFinder(), dynamic1));
}
return typed1.set(DSL.remainderFinder(), dynamic.remove("Damage"));
|