package com.comphenix.protocol.wrappers; import com.comphenix.protocol.reflect.EquivalentConverter; import com.comphenix.protocol.reflect.FuzzyReflection; import com.comphenix.protocol.reflect.accessors.Accessors; import com.comphenix.protocol.reflect.accessors.ConstructorAccessor; import com.comphenix.protocol.reflect.accessors.FieldAccessor; import com.comphenix.protocol.reflect.fuzzy.FuzzyFieldContract; import com.comphenix.protocol.utility.MinecraftReflection; import com.google.common.base.Objects; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.List; /** * Represents a ChunkCoordIntPair. * @author Kristian */ public class ChunkCoordIntPair { private static Class> COORD_PAIR_CLASS = MinecraftReflection.getChunkCoordIntPair(); private static ConstructorAccessor COORD_CONSTRUCTOR; private static FieldAccessor COORD_X; private static FieldAccessor COORD_Z; // Use protected members, like Bukkit protected final int chunkX; protected final int chunkZ; /** * Construct a new chunk coord int pair. * @param x - the x index of the chunk. * @param z - the z index of the chunk. */ public ChunkCoordIntPair(int x, int z) { this.chunkX = x; this.chunkZ = z; } /** * Retrieve the chunk index in the x-dimension. *
* This is the number of adjacent chunks to (0, 0), not a block coordinate. * @return The x chunk index. */ public int getChunkX() { return chunkX; } /** * Retrieve the chunk index in the z-dimension. *
* This is the number of adjacent chunks to (0, 0), not a block coordinate.
* @return The z chunk index.
*/
public int getChunkZ() {
return chunkZ;
}
/**
* Used to convert between NMS ChunkPosition and the wrapper instance.
* @return A new converter.
*/
public static EquivalentConverter