FIXED: DataWatcher can now clone ItemStacks and ChunkPositions.
Due to a oversight, we retrieved the "wrapped" value in the get cloned helper method. This caused it to not clone the chunk position and item stack.
Dieser Commit ist enthalten in:
Ursprung
637d6cda18
Commit
651581d677
@ -218,6 +218,14 @@ public class WrappedWatchableObject {
|
|||||||
modifier.withType(Object.class).write(0, getUnwrapped(newValue));
|
modifier.withType(Object.class).write(0, getUnwrapped(newValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read the underlying value field.
|
||||||
|
* @return The underlying value.
|
||||||
|
*/
|
||||||
|
private Object getNMSValue() {
|
||||||
|
return modifier.withType(Object.class).read(0);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read the value field.
|
* Read the value field.
|
||||||
* @return The watched value.
|
* @return The watched value.
|
||||||
@ -324,7 +332,7 @@ public class WrappedWatchableObject {
|
|||||||
|
|
||||||
// Helper
|
// Helper
|
||||||
Object getClonedValue() throws FieldAccessException {
|
Object getClonedValue() throws FieldAccessException {
|
||||||
Object value = getValue();
|
Object value = getNMSValue();
|
||||||
|
|
||||||
// Only a limited set of references types are supported
|
// Only a limited set of references types are supported
|
||||||
if (MinecraftReflection.isChunkPosition(value)) {
|
if (MinecraftReflection.isChunkPosition(value)) {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren