/** * Gets this block change's absolute x coordinate. * * @return Absolute X coordinate */ public int getAbsoluteX() { return (chunk.getChunkX() << 4) + getX(); }
/** * Gets this block change's absolute z coordinate. * * @return Absolute Z coordinate */ public int getAbsoluteZ() { return (chunk.getChunkZ() << 4) + getZ(); }
public MultiBlockChangeInfo(Location location, WrappedBlockData data) { this.data = data; this.chunk = new ChunkCoordIntPair(location.getBlockX() >> 4, location.getBlockZ() >> 4); this.setLocation(location); }
/** * Retrieves a read/write structure for wrapped ChunkCoordIntPairs. * @return A modifier for ChunkCoordIntPair. */ public StructureModifier<ChunkCoordIntPair> getChunkCoordIntPairs() { // Allow access to the NBT class in packet 130 return structureModifier.withType( MinecraftReflection.getChunkCoordIntPair(), ChunkCoordIntPair.getConverter()); }
@Override public ChunkCoordIntPair getSpecific(Object generic) { if (MinecraftReflection.isChunkCoordIntPair(generic)) { if (COORD_X == null || COORD_Z == null) { FieldAccessor[] ints = Accessors.getFieldAccessorArray(COORD_PAIR_CLASS, int.class, true); COORD_X = ints[0]; COORD_Z = ints[1]; } return new ChunkCoordIntPair((Integer) COORD_X.get(generic), (Integer) COORD_Z.get(generic)); } // Otherwise, return NULL return null; }