64 lines
2.0 KiB
Diff
64 lines
2.0 KiB
Diff
--- a/net/minecraft/core/component/DataComponentPatch.java
|
|
+++ b/net/minecraft/core/component/DataComponentPatch.java
|
|
@@ -60,7 +60,7 @@
|
|
}
|
|
}
|
|
|
|
- return reference2objectmap;
|
|
+ return (Reference2ObjectMap) reference2objectmap; // CraftBukkit - decompile error
|
|
});
|
|
public static final StreamCodec<RegistryFriendlyByteBuf, DataComponentPatch> STREAM_CODEC = createStreamCodec(new DataComponentPatch.b() {
|
|
@Override
|
|
@@ -159,7 +159,7 @@
|
|
}
|
|
|
|
private <T> void encodeComponent(RegistryFriendlyByteBuf registryfriendlybytebuf, DataComponentType<T> datacomponenttype, Object object) {
|
|
- datacomponentpatch_b.apply(datacomponenttype).encode(registryfriendlybytebuf, object);
|
|
+ datacomponentpatch_b.apply(datacomponenttype).encode(registryfriendlybytebuf, (T) object); // CraftBukkit - decompile error
|
|
}
|
|
};
|
|
}
|
|
@@ -321,6 +321,42 @@
|
|
|
|
a() {}
|
|
|
|
+ // CraftBukkit start
|
|
+ public void copy(DataComponentPatch orig) {
|
|
+ this.map.putAll(orig.map);
|
|
+ }
|
|
+
|
|
+ public void clear(DataComponentType<?> type) {
|
|
+ this.map.remove(type);
|
|
+ }
|
|
+
|
|
+ public boolean isSet(DataComponentType<?> type) {
|
|
+ return map.containsKey(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;
|