Fix compile issues

This commit is contained in:
Jesse Boyd 2016-08-27 13:47:09 +10:00
parent ee272053b2
commit 5baa99ec80
10 changed files with 26 additions and 17 deletions

View File

@ -698,7 +698,7 @@ public class BukkitQueue_1_10 extends BukkitQueue_0<Chunk, ChunkSection[], Chunk
for (Map.Entry<BytePair, CompoundTag> entry : tilesToSpawn.entrySet()) { for (Map.Entry<BytePair, CompoundTag> entry : tilesToSpawn.entrySet()) {
CompoundTag nativeTag = entry.getValue(); CompoundTag nativeTag = entry.getValue();
BytePair pair = entry.getKey(); BytePair pair = entry.getKey();
BlockPosition pos = new BlockPosition(MathMan.unpair16x(pair.pair[0]) + bx, pair.pair[1] & 0xFF, MathMan.unpair16y(pair.pair[0]) + bz); // Set pos BlockPosition pos = new BlockPosition(MathMan.unpair16x((byte) pair.get0()) + bx, pair.get1() & 0xFF, MathMan.unpair16y((byte) pair.get0()) + bz); // Set pos
TileEntity tileEntity = nmsWorld.getTileEntity(pos); TileEntity tileEntity = nmsWorld.getTileEntity(pos);
if (tileEntity != null) { if (tileEntity != null) {
NBTTagCompound tag = (NBTTagCompound) methodFromNative.invoke(adapter, nativeTag); NBTTagCompound tag = (NBTTagCompound) methodFromNative.invoke(adapter, nativeTag);

View File

@ -429,7 +429,7 @@ public class BukkitQueue17 extends BukkitQueue_0<Chunk, ChunkSection[], ChunkSec
for (Map.Entry<BytePair, CompoundTag> entry : tilesToSpawn.entrySet()) { for (Map.Entry<BytePair, CompoundTag> entry : tilesToSpawn.entrySet()) {
CompoundTag nativeTag = entry.getValue(); CompoundTag nativeTag = entry.getValue();
BytePair pair = entry.getKey(); BytePair pair = entry.getKey();
TileEntity tileEntity = nmsWorld.getTileEntity(MathMan.unpair16x(pair.pair[0]) + bx, pair.pair[1] & 0xFF, MathMan.unpair16y(pair.pair[0]) + bz); TileEntity tileEntity = nmsWorld.getTileEntity(MathMan.unpair16x((byte) pair.get0()) + bx, pair.get1() & 0xFF, MathMan.unpair16y((byte) pair.get0()) + bz);
if (tileEntity != null) { if (tileEntity != null) {
NBTTagCompound tag = (NBTTagCompound) methodFromNative.invoke(adapter, nativeTag); NBTTagCompound tag = (NBTTagCompound) methodFromNative.invoke(adapter, nativeTag);
tileEntity.a(tag); // ReadTagIntoTile tileEntity.a(tag); // ReadTagIntoTile
@ -602,12 +602,7 @@ public class BukkitQueue17 extends BukkitQueue_0<Chunk, ChunkSection[], ChunkSec
@Override @Override
public FaweChunk getFaweChunk(int x, int z) { public FaweChunk getFaweChunk(int x, int z) {
return new CharFaweChunk<Chunk>(this, x, z) { return new BukkitChunk_1_7(this, x, z);
@Override
public Chunk getNewChunk() {
return BukkitQueue17.this.getWorld().getChunkAt(getX(), getZ());
}
};
} }
@Override @Override

View File

@ -403,7 +403,7 @@ public class BukkitQueue18R3 extends BukkitQueue_0<Chunk, ChunkSection[], ChunkS
for (Map.Entry<BytePair, CompoundTag> entry : tilesToSpawn.entrySet()) { for (Map.Entry<BytePair, CompoundTag> entry : tilesToSpawn.entrySet()) {
CompoundTag nativeTag = entry.getValue(); CompoundTag nativeTag = entry.getValue();
BytePair pair = entry.getKey(); BytePair pair = entry.getKey();
BlockPosition pos = new BlockPosition(MathMan.unpair16x(pair.pair[0]) + bx, pair.pair[1] & 0xFF, MathMan.unpair16y(pair.pair[0]) + bz); // Set pos BlockPosition pos = new BlockPosition(pair.get0x() + bx, pair.get1() & 0xFF, pair.get0y() + bz); // Set pos
TileEntity tileEntity = nmsWorld.getTileEntity(pos); TileEntity tileEntity = nmsWorld.getTileEntity(pos);
if (tileEntity != null) { if (tileEntity != null) {
NBTTagCompound tag = (NBTTagCompound) methodFromNative.invoke(adapter, nativeTag); NBTTagCompound tag = (NBTTagCompound) methodFromNative.invoke(adapter, nativeTag);

View File

@ -665,7 +665,7 @@ public class BukkitQueue_1_9_R1 extends BukkitQueue_0<Chunk, ChunkSection[], Chu
for (Map.Entry<BytePair, CompoundTag> entry : tilesToSpawn.entrySet()) { for (Map.Entry<BytePair, CompoundTag> entry : tilesToSpawn.entrySet()) {
CompoundTag nativeTag = entry.getValue(); CompoundTag nativeTag = entry.getValue();
BytePair pair = entry.getKey(); BytePair pair = entry.getKey();
BlockPosition pos = new BlockPosition(MathMan.unpair16x(pair.pair[0]) + bx, pair.pair[1] & 0xFF, MathMan.unpair16y(pair.pair[0]) + bz); // Set pos BlockPosition pos = new BlockPosition(MathMan.unpair16x((byte) pair.get0()) + bx, pair.get1() & 0xFF, MathMan.unpair16y((byte) pair.get0()) + bz); // Set pos
TileEntity tileEntity = nmsWorld.getTileEntity(pos); TileEntity tileEntity = nmsWorld.getTileEntity(pos);
if (tileEntity != null) { if (tileEntity != null) {
NBTTagCompound tag = (NBTTagCompound) methodFromNative.invoke(adapter, nativeTag); NBTTagCompound tag = (NBTTagCompound) methodFromNative.invoke(adapter, nativeTag);

View File

@ -43,6 +43,20 @@ public class MathMan {
253, 254, 254, 255 253, 254, 254, 255
}; };
public static void main(String[] args) {
double val;
val = 10.2;
System.out.println(inverseRound(10.2) + " " + 11);
System.out.println(inverseRound(10.8) + " " + 10);
System.out.println(inverseRound(-10.2) + " " + -11);
System.out.println(inverseRound(-10.8) + " " + -10);
}
public static long inverseRound(double val) {
long round = Math.round(val);
return (long) (round + Math.signum(val - round));
}
public static short pairByte(int x, int y) { public static short pairByte(int x, int y) {
return (short) ((x << 8) | (y & 0xFF)); return (short) ((x << 8) | (y & 0xFF));
} }

View File

@ -473,7 +473,7 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
for (Map.Entry<BytePair, CompoundTag> entry : tilesToSpawn.entrySet()) { for (Map.Entry<BytePair, CompoundTag> entry : tilesToSpawn.entrySet()) {
CompoundTag nativeTag = entry.getValue(); CompoundTag nativeTag = entry.getValue();
BytePair pair = entry.getKey(); BytePair pair = entry.getKey();
BlockPos pos = new BlockPos(MathMan.unpair16x(pair.pair[0]) + bx, pair.pair[1] & 0xFF, MathMan.unpair16y(pair.pair[0]) + bz); // Set pos BlockPos pos = new BlockPos(MathMan.unpair16x((byte) pair.get0()) + bx, pair.get1() & 0xFF, MathMan.unpair16y((byte) pair.get0()) + bz); // Set pos
TileEntity tileEntity = nmsWorld.getTileEntity(pos); TileEntity tileEntity = nmsWorld.getTileEntity(pos);
if (tileEntity != null) { if (tileEntity != null) {
NBTTagCompound tag = (NBTTagCompound) methodFromNative.invoke(null, nativeTag); NBTTagCompound tag = (NBTTagCompound) methodFromNative.invoke(null, nativeTag);

View File

@ -450,9 +450,9 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
for (Map.Entry<BytePair, CompoundTag> entry : tilesToSpawn.entrySet()) { for (Map.Entry<BytePair, CompoundTag> entry : tilesToSpawn.entrySet()) {
CompoundTag nativeTag = entry.getValue(); CompoundTag nativeTag = entry.getValue();
BytePair pair = entry.getKey(); BytePair pair = entry.getKey();
int x = MathMan.unpair16x(pair.pair[0]) + bx; int x = MathMan.unpair16x((byte) pair.get0()) + bx;
int y = pair.pair[1] & 0xFF; int y = pair.get1() & 0xFF;
int z = MathMan.unpair16y(pair.pair[0]) + bz; int z = MathMan.unpair16y((byte) pair.get0()) + bz;
TileEntity tileEntity = nmsWorld.getTileEntity(x, y, z); TileEntity tileEntity = nmsWorld.getTileEntity(x, y, z);
if (tileEntity != null) { if (tileEntity != null) {
NBTTagCompound tag = (NBTTagCompound) methodFromNative.invoke(null, nativeTag); NBTTagCompound tag = (NBTTagCompound) methodFromNative.invoke(null, nativeTag);

View File

@ -418,7 +418,7 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
for (Map.Entry<BytePair, CompoundTag> entry : tilesToSpawn.entrySet()) { for (Map.Entry<BytePair, CompoundTag> entry : tilesToSpawn.entrySet()) {
CompoundTag nativeTag = entry.getValue(); CompoundTag nativeTag = entry.getValue();
BytePair pair = entry.getKey(); BytePair pair = entry.getKey();
BlockPos pos = new BlockPos(MathMan.unpair16x(pair.pair[0]) + bx, pair.pair[1] & 0xFF, MathMan.unpair16y(pair.pair[0]) + bz); // Set pos BlockPos pos = new BlockPos(MathMan.unpair16x((byte) pair.get0()) + bx, pair.get1() & 0xFF, MathMan.unpair16y((byte) pair.get0()) + bz); // Set pos
TileEntity tileEntity = nmsWorld.getTileEntity(pos); TileEntity tileEntity = nmsWorld.getTileEntity(pos);
if (tileEntity != null) { if (tileEntity != null) {
NBTTagCompound tag = (NBTTagCompound) methodFromNative.invoke(null, nativeTag); NBTTagCompound tag = (NBTTagCompound) methodFromNative.invoke(null, nativeTag);

View File

@ -473,7 +473,7 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
for (Map.Entry<BytePair, CompoundTag> entry : tilesToSpawn.entrySet()) { for (Map.Entry<BytePair, CompoundTag> entry : tilesToSpawn.entrySet()) {
CompoundTag nativeTag = entry.getValue(); CompoundTag nativeTag = entry.getValue();
BytePair pair = entry.getKey(); BytePair pair = entry.getKey();
BlockPos pos = new BlockPos(MathMan.unpair16x(pair.pair[0]) + bx, pair.pair[1] & 0xFF, MathMan.unpair16y(pair.pair[0]) + bz); // Set pos BlockPos pos = new BlockPos(MathMan.unpair16x((byte) pair.get0()) + bx, pair.get1() & 0xFF, MathMan.unpair16y((byte) pair.get0()) + bz); // Set pos
TileEntity tileEntity = nmsWorld.getTileEntity(pos); TileEntity tileEntity = nmsWorld.getTileEntity(pos);
if (tileEntity != null) { if (tileEntity != null) {
NBTTagCompound tag = (NBTTagCompound) methodFromNative.invoke(null, nativeTag); NBTTagCompound tag = (NBTTagCompound) methodFromNative.invoke(null, nativeTag);

View File

@ -476,7 +476,7 @@ public class SpongeQueue_1_8 extends NMSMappedFaweQueue<World, net.minecraft.wor
for (Map.Entry<BytePair, CompoundTag> entry : tilesToSpawn.entrySet()) { for (Map.Entry<BytePair, CompoundTag> entry : tilesToSpawn.entrySet()) {
CompoundTag nativeTag = entry.getValue(); CompoundTag nativeTag = entry.getValue();
BytePair pair = entry.getKey(); BytePair pair = entry.getKey();
BlockPos pos = new BlockPos(MathMan.unpair16x(pair.pair[0]) + bx, pair.pair[1] & 0xFF, MathMan.unpair16y(pair.pair[0]) + bz); // Set pos BlockPos pos = new BlockPos(MathMan.unpair16x((byte) pair.get0()) + bx, pair.get1() & 0xFF, MathMan.unpair16y((byte) pair.get0()) + bz); // Set pos
TileEntity tileEntity = nmsWorld.getTileEntity(pos); TileEntity tileEntity = nmsWorld.getTileEntity(pos);
if (tileEntity != null) { if (tileEntity != null) {
NBTTagCompound tag = (NBTTagCompound) methodFromNative.invoke(null, nativeTag); NBTTagCompound tag = (NBTTagCompound) methodFromNative.invoke(null, nativeTag);