Possible fix for tiles
This commit is contained in:
parent
ff59a61046
commit
272a359c28
@ -72,7 +72,6 @@ public abstract class BukkitQueue_0<CHUNK, CHUNKSECTIONS, SECTION> extends NMSMa
|
||||
}
|
||||
|
||||
public void setupAdapter(BukkitImplAdapter adapter) {
|
||||
if (adapter == null) {
|
||||
try {
|
||||
WorldEditPlugin instance = (WorldEditPlugin) Bukkit.getPluginManager().getPlugin("WorldEdit");
|
||||
Field fieldAdapter = WorldEditPlugin.class.getDeclaredField("bukkitAdapter");
|
||||
@ -102,7 +101,6 @@ public abstract class BukkitQueue_0<CHUNK, CHUNKSECTIONS, SECTION> extends NMSMa
|
||||
Fawe.debug("=========================================");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorld(String world) {
|
||||
|
@ -22,6 +22,7 @@ import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@ -595,8 +596,8 @@ public class BukkitQueue_1_10 extends BukkitQueue_0<Chunk, ChunkSection[], DataP
|
||||
changeTask.run(previous);
|
||||
}
|
||||
// Trim tiles
|
||||
Set<Entry<BlockPosition, TileEntity>> entryset = tiles.entrySet();
|
||||
Iterator<Map.Entry<BlockPosition, TileEntity>> iterator = entryset.iterator();
|
||||
Iterator<Map.Entry<BlockPosition, TileEntity>> iterator = tiles.entrySet().iterator();
|
||||
HashMap<BlockPosition, TileEntity> toRemove = null;
|
||||
while (iterator.hasNext()) {
|
||||
Map.Entry<BlockPosition, TileEntity> tile = iterator.next();
|
||||
BlockPosition pos = tile.getKey();
|
||||
@ -610,9 +611,22 @@ public class BukkitQueue_1_10 extends BukkitQueue_0<Chunk, ChunkSection[], DataP
|
||||
}
|
||||
int k = FaweCache.CACHE_J[ly][lx][lz];
|
||||
if (array[k] != 0) {
|
||||
tile.getValue().invalidateBlockCache();
|
||||
iterator.remove();
|
||||
if (toRemove == null) {
|
||||
toRemove = new HashMap<>();
|
||||
}
|
||||
toRemove.put(tile.getKey(), tile.getValue());
|
||||
}
|
||||
}
|
||||
if (toRemove != null) {
|
||||
for (Entry<BlockPosition, TileEntity> entry : toRemove.entrySet()) {
|
||||
BlockPosition bp = entry.getKey();
|
||||
TileEntity tile = entry.getValue();
|
||||
tiles.remove(bp);
|
||||
tile.y();
|
||||
nmsWorld.s(bp);
|
||||
tile.invalidateBlockCache();
|
||||
}
|
||||
|
||||
}
|
||||
// Set blocks
|
||||
for (int j = 0; j < sections.length; j++) {
|
||||
|
@ -20,6 +20,7 @@ import com.sk89q.worldedit.internal.Constants;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@ -271,8 +272,8 @@ public class BukkitQueue18R3 extends BukkitQueue_0<Chunk, ChunkSection[], char[]
|
||||
changeTask.run(previous);
|
||||
}
|
||||
// Trim tiles
|
||||
Set<Map.Entry<BlockPosition, TileEntity>> entryset = tiles.entrySet();
|
||||
Iterator<Map.Entry<BlockPosition, TileEntity>> iterator = entryset.iterator();
|
||||
Iterator<Map.Entry<BlockPosition, TileEntity>> iterator = tiles.entrySet().iterator();
|
||||
HashMap<BlockPosition, TileEntity> toRemove = null;
|
||||
while (iterator.hasNext()) {
|
||||
Map.Entry<BlockPosition, TileEntity> tile = iterator.next();
|
||||
BlockPosition pos = tile.getKey();
|
||||
@ -286,9 +287,22 @@ public class BukkitQueue18R3 extends BukkitQueue_0<Chunk, ChunkSection[], char[]
|
||||
}
|
||||
int k = FaweCache.CACHE_J[ly][lx][lz];
|
||||
if (array[k] != 0) {
|
||||
tile.getValue().E();
|
||||
iterator.remove();
|
||||
if (toRemove == null) {
|
||||
toRemove = new HashMap<>();
|
||||
}
|
||||
toRemove.put(tile.getKey(), tile.getValue());
|
||||
}
|
||||
}
|
||||
if (toRemove != null) {
|
||||
for (Map.Entry<BlockPosition, TileEntity> entry : toRemove.entrySet()) {
|
||||
BlockPosition bp = entry.getKey();
|
||||
TileEntity tile = entry.getValue();
|
||||
tiles.remove(bp);
|
||||
tile.y();
|
||||
nmsWorld.t(bp);
|
||||
tile.E();
|
||||
}
|
||||
|
||||
}
|
||||
HashSet<UUID> entsToRemove = fs.getEntityRemoves();
|
||||
if (entsToRemove.size() > 0) {
|
||||
|
@ -22,6 +22,7 @@ import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@ -593,8 +594,8 @@ public class BukkitQueue_1_9_R1 extends BukkitQueue_0<Chunk, ChunkSection[], Dat
|
||||
changeTask.run(previous);
|
||||
}
|
||||
// Trim tiles
|
||||
Set<Entry<BlockPosition, TileEntity>> entryset = tiles.entrySet();
|
||||
Iterator<Map.Entry<BlockPosition, TileEntity>> iterator = entryset.iterator();
|
||||
Iterator<Map.Entry<BlockPosition, TileEntity>> iterator = tiles.entrySet().iterator();
|
||||
HashMap<BlockPosition, TileEntity> toRemove = null;
|
||||
while (iterator.hasNext()) {
|
||||
Map.Entry<BlockPosition, TileEntity> tile = iterator.next();
|
||||
BlockPosition pos = tile.getKey();
|
||||
@ -608,9 +609,22 @@ public class BukkitQueue_1_9_R1 extends BukkitQueue_0<Chunk, ChunkSection[], Dat
|
||||
}
|
||||
int k = FaweCache.CACHE_J[ly][lx][lz];
|
||||
if (array[k] != 0) {
|
||||
tile.getValue().invalidateBlockCache();
|
||||
iterator.remove();
|
||||
if (toRemove == null) {
|
||||
toRemove = new HashMap<>();
|
||||
}
|
||||
toRemove.put(tile.getKey(), tile.getValue());
|
||||
}
|
||||
}
|
||||
if (toRemove != null) {
|
||||
for (Entry<BlockPosition, TileEntity> entry : toRemove.entrySet()) {
|
||||
BlockPosition bp = entry.getKey();
|
||||
TileEntity tile = entry.getValue();
|
||||
tiles.remove(bp);
|
||||
tile.y();
|
||||
nmsWorld.s(bp);
|
||||
tile.invalidateBlockCache();
|
||||
}
|
||||
|
||||
}
|
||||
// Set blocks
|
||||
for (int j = 0; j < sections.length; j++) {
|
||||
|
Loading…
Reference in New Issue
Block a user