Correctly wrap and unwrap ItemStacks in WrappedWatchableObject.
This should make it possible to set and retrieve watchable objects of the type ItemStack.
Dieser Commit ist enthalten in:
Ursprung
b6809f6ce6
Commit
8c8ca3746b
@ -280,6 +280,8 @@ public class WrappedWatchableObject {
|
||||
return ChunkPosition.class;
|
||||
else if (unwrapped.equals(MinecraftReflection.getChunkCoordinatesClass()))
|
||||
return WrappedChunkCoordinate.class;
|
||||
else if (unwrapped.equals(MinecraftReflection.getItemStackClass()))
|
||||
return ItemStack.class;
|
||||
else
|
||||
return unwrapped;
|
||||
}
|
||||
@ -291,7 +293,10 @@ public class WrappedWatchableObject {
|
||||
*/
|
||||
static Object getUnwrapped(Object wrapped) {
|
||||
// Convert special cases
|
||||
if (wrapped instanceof WrappedChunkCoordinate)
|
||||
if (wrapped instanceof ChunkPosition)
|
||||
return ChunkPosition.getConverter().getGeneric(
|
||||
MinecraftReflection.getChunkPositionClass(), (ChunkPosition) wrapped);
|
||||
else if (wrapped instanceof WrappedChunkCoordinate)
|
||||
return ((WrappedChunkCoordinate) wrapped).getHandle();
|
||||
else if (wrapped instanceof ItemStack)
|
||||
return BukkitConverters.getItemStackConverter().getGeneric(
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren