From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Tue, 21 May 2024 19:07:47 +0800 Subject: [PATCH] Decompile fix Removed since Paper 1.21.4, hardfork diff --git a/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java b/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java index b2a4ae4388758f89fcd0dc3b0c4c03bf46fa5470..a4f9de18d40d5d85a809af3777b00eb75b1af027 100644 --- a/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java +++ b/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java @@ -34,7 +34,7 @@ public interface CustomPacketPayload { private void writeCap(B value, CustomPacketPayload.Type id, CustomPacketPayload payload) { value.writeResourceLocation(id.id()); - StreamCodec streamCodec = this.findCodec(id.id); + StreamCodec streamCodec = (StreamCodec) this.findCodec(id.id); // Leaf - Decompile fix streamCodec.encode(value, (T)payload); } diff --git a/net/minecraft/world/entity/ai/Brain.java b/net/minecraft/world/entity/ai/Brain.java index afbb027021acfbe25d534a84f1750e420bbde6e0..2ae8c9d56d88987b750e57025d313cfa9300c7e4 100644 --- a/net/minecraft/world/entity/ai/Brain.java +++ b/net/minecraft/world/entity/ai/Brain.java @@ -79,7 +79,7 @@ public class Brain { } public DataResult> decode(DynamicOps dynamicOps, MapLike mapLike) { - MutableObject>>> mutableObject = new MutableObject<>( + MutableObject>>> mutableObject2 = new MutableObject<>( // Leaf - Decompile fix DataResult.success(ImmutableList.builder()) ); mapLike.entries() @@ -91,10 +91,10 @@ public class Brain { DataResult> dataResult2 = dataResult.flatMap( memoryType -> this.captureRead((MemoryModuleType)memoryType, dynamicOps, (T)pair.getSecond()) ); - mutableObject.setValue(mutableObject.getValue().apply2(Builder::add, dataResult2)); + mutableObject2.setValue(mutableObject2.getValue().apply2(Builder::add, dataResult2)); // Leaf - Decompile fix } ); - ImmutableList> immutableList = mutableObject.getValue() + ImmutableList> immutableList = mutableObject2.getValue() // Leaf - Decompile fix .resultOrPartial(Brain.LOGGER::error) .map(Builder::build) .orElseGet(ImmutableList::of); @@ -194,14 +194,14 @@ public class Brain { if (optional == null) { throw new IllegalStateException("Unregistered memory fetched: " + type); } else { - return optional.map(ExpirableValue::getValue); + return (Optional) optional.map(ExpirableValue::getValue); // Leaf - Decompile fix } } @Nullable public Optional getMemoryInternal(MemoryModuleType type) { Optional> optional = this.memories.get(type); - return optional == null ? null : optional.map(ExpirableValue::getValue); + return optional == null ? null : (Optional) optional.map(ExpirableValue::getValue); // Leaf - Decompile fix } public long getTimeUntilExpiry(MemoryModuleType type) {