Remove debug + Sync sponge tile changes

This commit is contained in:
Jesse Boyd 2017-11-12 11:42:19 +11:00
parent 97515d0f31
commit 0bac7251c1
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
4 changed files with 37 additions and 31 deletions

View File

@ -49,7 +49,7 @@ permissions:
worldedit.clipboard.rotate: true worldedit.clipboard.rotate: true
worldedit.help: true worldedit.help: true
worldedit.global-mask: true worldedit.global-mask: true
worldedit.global-trasnform: true worldedit.global-transform: true
worldedit.generation.cylinder: true worldedit.generation.cylinder: true
worldedit.generation.sphere: true worldedit.generation.sphere: true
worldedit.generation.forest: true worldedit.generation.forest: true

View File

@ -284,7 +284,6 @@ public class DiskOptimizedClipboard extends FaweClipboard implements Closeable {
@Override @Override
public void close() { public void close() {
MainUtil.stacktrace();
try { try {
if (mbb != null) { if (mbb != null) {
mbb.force(); mbb.force();

View File

@ -381,20 +381,24 @@ public class SpongeChunk_1_12 extends CharFaweChunk<Chunk, SpongeQueue_1_12> {
// Set tiles // Set tiles
Map<Short, CompoundTag> tilesToSpawn = this.getTiles(); Map<Short, CompoundTag> tilesToSpawn = this.getTiles();
for (Map.Entry<Short, CompoundTag> entry : tilesToSpawn.entrySet()) { if (!tilesToSpawn.isEmpty()) {
CompoundTag nativeTag = entry.getValue(); synchronized (SpongeChunk_1_12.class) {
short blockHash = entry.getKey(); for (Map.Entry<Short, CompoundTag> entry : tilesToSpawn.entrySet()) {
int x = (blockHash >> 12 & 0xF) + bx; CompoundTag nativeTag = entry.getValue();
int y = (blockHash & 0xFF); short blockHash = entry.getKey();
int z = (blockHash >> 8 & 0xF) + bz; int x = (blockHash >> 12 & 0xF) + bx;
BlockPos pos = new BlockPos(x, y, z); // Set pos int y = (blockHash & 0xFF);
TileEntity tileEntity = nmsWorld.getTileEntity(pos); int z = (blockHash >> 8 & 0xF) + bz;
if (tileEntity != null) { BlockPos pos = new BlockPos(x, y, z); // Set pos
NBTTagCompound tag = (NBTTagCompound) SpongeQueue_1_12.methodFromNative.invoke(SpongeQueue_1_12.adapter, nativeTag); TileEntity tileEntity = nmsWorld.getTileEntity(pos);
tag.setInteger("x", pos.getX()); if (tileEntity != null) {
tag.setInteger("y", pos.getY()); NBTTagCompound tag = (NBTTagCompound) SpongeQueue_1_12.methodFromNative.invoke(SpongeQueue_1_12.adapter, nativeTag);
tag.setInteger("z", pos.getZ()); tag.setInteger("x", pos.getX());
tileEntity.readFromNBT(tag); // ReadTagIntoTile tag.setInteger("y", pos.getY());
tag.setInteger("z", pos.getZ());
tileEntity.readFromNBT(tag); // ReadTagIntoTile
}
}
} }
} }
} catch (Throwable e) { } catch (Throwable e) {

View File

@ -380,21 +380,24 @@ public class SpongeChunk_1_11 extends CharFaweChunk<Chunk, SpongeQueue_1_11> {
} }
// Set tiles // Set tiles
Map<Short, CompoundTag> tilesToSpawn = this.getTiles(); Map<Short, CompoundTag> tilesToSpawn = this.getTiles();
if (!tilesToSpawn.isEmpty()) {
for (Map.Entry<Short, CompoundTag> entry : tilesToSpawn.entrySet()) { synchronized (SpongeChunk_1_11.class) {
CompoundTag nativeTag = entry.getValue(); for (Map.Entry<Short, CompoundTag> entry : tilesToSpawn.entrySet()) {
short blockHash = entry.getKey(); CompoundTag nativeTag = entry.getValue();
int x = (blockHash >> 12 & 0xF) + bx; short blockHash = entry.getKey();
int y = (blockHash & 0xFF); int x = (blockHash >> 12 & 0xF) + bx;
int z = (blockHash >> 8 & 0xF) + bz; int y = (blockHash & 0xFF);
BlockPos pos = new BlockPos(x, y, z); // Set pos int z = (blockHash >> 8 & 0xF) + bz;
TileEntity tileEntity = nmsWorld.getTileEntity(pos); BlockPos pos = new BlockPos(x, y, z); // Set pos
if (tileEntity != null) { TileEntity tileEntity = nmsWorld.getTileEntity(pos);
NBTTagCompound tag = (NBTTagCompound) SpongeQueue_1_11.methodFromNative.invoke(SpongeQueue_1_11.adapter, nativeTag); if (tileEntity != null) {
tag.setInteger("x", pos.getX()); NBTTagCompound tag = (NBTTagCompound) SpongeQueue_1_11.methodFromNative.invoke(SpongeQueue_1_11.adapter, nativeTag);
tag.setInteger("y", pos.getY()); tag.setInteger("x", pos.getX());
tag.setInteger("z", pos.getZ()); tag.setInteger("y", pos.getY());
tileEntity.readFromNBT(tag); // ReadTagIntoTile tag.setInteger("z", pos.getZ());
tileEntity.readFromNBT(tag); // ReadTagIntoTile
}
}
} }
} }
} catch (Throwable e) { } catch (Throwable e) {