/** * Retrieves a read/write structure for chunk positions. * @return A modifier for a ChunkPosition. */ public StructureModifier<ChunkPosition> getPositionModifier() { // Convert to and from the Bukkit wrapper return structureModifier.withType( MinecraftReflection.getChunkPositionClass(), ChunkPosition.getConverter()); }
/** * Retrieves a read/write structure for collections of chunk positions. * <p> * This modifier will automatically marshal between the visible ProtocolLib ChunkPosition and the * internal Minecraft ChunkPosition. * * @return A modifier for ChunkPosition list fields. */ public StructureModifier<List<ChunkPosition>> getPositionCollectionModifier() { // Convert to and from the ProtocolLib wrapper return structureModifier.withType( Collection.class, BukkitConverters.getListConverter(ChunkPosition.getConverter())); }
return ChunkPosition.getConverter().getGeneric((ChunkPosition) wrapped); } else if (wrapped instanceof WrappedChunkCoordinate) { return ((WrappedChunkCoordinate) wrapped).getHandle();
return new WrappedChunkCoordinate((Comparable) value); } else if (is(MinecraftReflection.getChunkPositionClass(), value)) { return ChunkPosition.getConverter().getSpecific(value);