Update to Minecraft 1.20.5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-04-24 01:15:00 +10:00
parent 4deda9501f
commit 65bc2541a3
524 changed files with 7788 additions and 6181 deletions

View File

@@ -0,0 +1,59 @@
--- a/net/minecraft/core/component/DataComponentPatch.java
+++ b/net/minecraft/core/component/DataComponentPatch.java
@@ -61,7 +61,7 @@
}
}
- return reference2objectmap;
+ return (Reference2ObjectMap) reference2objectmap; // CraftBukkit - decompile error
});
public static final StreamCodec<RegistryFriendlyByteBuf, DataComponentPatch> STREAM_CODEC = new StreamCodec<RegistryFriendlyByteBuf, DataComponentPatch>() {
public DataComponentPatch decode(RegistryFriendlyByteBuf registryfriendlybytebuf) {
@@ -143,7 +143,7 @@
}
private static <T> void encodeComponent(RegistryFriendlyByteBuf registryfriendlybytebuf, DataComponentType<T> datacomponenttype, Object object) {
- datacomponenttype.streamCodec().encode(registryfriendlybytebuf, object);
+ datacomponenttype.streamCodec().encode(registryfriendlybytebuf, (T) object); // CraftBukkit - decompile error
}
};
private static final String REMOVED_PREFIX = "!";
@@ -270,6 +270,38 @@
a() {}
+ // CraftBukkit start
+ public void copy(DataComponentPatch orig) {
+ this.map.putAll(orig.map);
+ }
+
+ public void clear(DataComponentType<?> type) {
+ this.map.remove(type);
+ }
+
+ public boolean isEmpty() {
+ return this.map.isEmpty();
+ }
+
+ @Override
+ public boolean equals(Object object) {
+ if (this == object) {
+ return true;
+ }
+
+ if (object instanceof DataComponentPatch.a patch) {
+ return this.map.equals(patch.map);
+ }
+
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return this.map.hashCode();
+ }
+ // CraftBukkit end
+
public <T> DataComponentPatch.a set(DataComponentType<T> datacomponenttype, T t0) {
this.map.put(datacomponenttype, Optional.of(t0));
return this;