ChunkPosition was replaced by BlockPosition
Dieser Commit ist enthalten in:
Ursprung
d5a63e8e38
Commit
1f6b873f84
@ -40,8 +40,7 @@ public class BukkitCloner implements Cloner {
|
||||
List<Class<?>> classes = Lists.newArrayList();
|
||||
|
||||
classes.add(MinecraftReflection.getItemStackClass());
|
||||
// TODO: Chunk position does not exist
|
||||
// classes.add(MinecraftReflection.getChunkPositionClass());
|
||||
classes.add(MinecraftReflection.getBlockPositionClass());
|
||||
classes.add(MinecraftReflection.getDataWatcherClass());
|
||||
|
||||
if (MinecraftReflection.isUsingNetty()) {
|
||||
|
@ -418,12 +418,23 @@ public class MinecraftReflection {
|
||||
/**
|
||||
* Determine if a given object is a ChunkPosition.
|
||||
* @param obj - the object to test.
|
||||
* @deprecated ChunkPosition no longer exists
|
||||
* @return TRUE if it can, FALSE otherwise.
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean isChunkPosition(Object obj) {
|
||||
return obj != null && getChunkPositionClass().isAssignableFrom(obj.getClass());
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a given object is a BlockPosition.
|
||||
* @param obj - the object to test.
|
||||
* @return TRUE if it can, FALSE otherwise.
|
||||
*/
|
||||
public static boolean isBlockPosition(Object obj) {
|
||||
return obj != null && getBlockPositionClass().isAssignableFrom(obj.getClass());
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the given object is an NMS ChunkCoordIntPar.
|
||||
* @param obj - the object.
|
||||
@ -1167,26 +1178,53 @@ public class MinecraftReflection {
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the ChunkPosition class.
|
||||
* Retrieves the ChunkPosition class.
|
||||
*
|
||||
* @deprecated ChunkPosition no longer exists. Replaced by BlockPosition.
|
||||
* @return The ChunkPosition class.
|
||||
*/
|
||||
@Deprecated
|
||||
public static Class<?> getChunkPositionClass() {
|
||||
try {
|
||||
return getMinecraftClass("ChunkPosition");
|
||||
} catch (RuntimeException e) {
|
||||
return getBlockPositionClass();
|
||||
// Class<?> normalChunkGenerator = getCraftBukkitClass("generator.NormalChunkGenerator");
|
||||
//
|
||||
// // ChunkPosition a(net.minecraft.server.World world, String string, int i, int i1, int i2) {
|
||||
// FuzzyMethodContract selected = FuzzyMethodContract.newBuilder()
|
||||
// .banModifier(Modifier.STATIC)
|
||||
// .parameterMatches(getMinecraftObjectMatcher(), 0)
|
||||
// .parameterExactType(String.class, 1)
|
||||
// .parameterExactType(int.class, 2)
|
||||
// .parameterExactType(int.class, 3)
|
||||
// .parameterExactType(int.class, 4)
|
||||
// .build();
|
||||
//
|
||||
// return setMinecraftClass("ChunkPosition",
|
||||
// FuzzyReflection.fromClass(normalChunkGenerator).getMethod(selected).getReturnType());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the BlockPosition class.
|
||||
* @return The BlockPosition class.
|
||||
*/
|
||||
public static Class<?> getBlockPositionClass() {
|
||||
try {
|
||||
return getMinecraftClass("BlockPosition");
|
||||
} catch (RuntimeException e) {
|
||||
Class<?> normalChunkGenerator = getCraftBukkitClass("generator.NormalChunkGenerator");
|
||||
|
||||
// ChunkPosition a(net.minecraft.server.World world, String string, int i, int i1, int i2) {
|
||||
// BlockPosition findNearestMapFeature(World, String, BlockPosition)
|
||||
FuzzyMethodContract selected = FuzzyMethodContract.newBuilder()
|
||||
.banModifier(Modifier.STATIC)
|
||||
.parameterMatches(getMinecraftObjectMatcher(), 0)
|
||||
.parameterExactType(String.class, 1)
|
||||
.parameterExactType(int.class, 2)
|
||||
.parameterExactType(int.class, 3)
|
||||
.parameterExactType(int.class, 4)
|
||||
.parameterMatches(getMinecraftObjectMatcher(), 1)
|
||||
.build();
|
||||
|
||||
return setMinecraftClass("ChunkPosition",
|
||||
return setMinecraftClass("BlockPosition",
|
||||
FuzzyReflection.fromClass(normalChunkGenerator).getMethod(selected).getReturnType());
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren