/** * Retrieves a read/write structure for block positions. * @return A modifier for a BlockPosition. */ public StructureModifier<BlockPosition> getBlockPositionModifier() { // Convert to and from the Bukkit wrapper return structureModifier.withType( MinecraftReflection.getBlockPositionClass(), BlockPosition.getConverter()); }
/** * Retrieves a read/write structure for collections of chunk positions. * <p> * This modifier will automatically marshal between the visible ProtocolLib BlockPosition and the * internal Minecraft BlockPosition. * * @return A modifier for ChunkPosition list fields. */ public StructureModifier<List<BlockPosition>> getBlockPositionCollectionModifier() { // Convert to and from the ProtocolLib wrapper return structureModifier.withType( Collection.class, BukkitConverters.getListConverter(BlockPosition.getConverter())); }
return Vector3F.getConverter().getGeneric((Vector3F) wrapped); } else if (wrapped instanceof BlockPosition) { return BlockPosition.getConverter().getGeneric((BlockPosition) wrapped); } else if (wrapped instanceof Direction) { return EnumWrappers.getDirectionConverter().getGeneric((Direction) wrapped);
return Vector3F.getConverter().getSpecific(value); } else if (is(MinecraftReflection.getBlockPositionClass(), value)) { return BlockPosition.getConverter().getSpecific(value); } else if (is(EnumWrappers.getDirectionClass(), value)) { return EnumWrappers.getDirectionConverter().getSpecific(value);