mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
gracefully handle error in EntityInBlockRemovingProcessor
- ensures edit continues on chunk correctly
This commit is contained in:
parent
1745c50878
commit
8da530ee80
@ -6,8 +6,10 @@ import com.fastasyncworldedit.core.queue.IChunkGet;
|
|||||||
import com.fastasyncworldedit.core.queue.IChunkSet;
|
import com.fastasyncworldedit.core.queue.IChunkSet;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.worldedit.extent.Extent;
|
import com.sk89q.worldedit.extent.Extent;
|
||||||
|
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -17,8 +19,11 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
*/
|
*/
|
||||||
public class EntityInBlockRemovingProcessor implements IBatchProcessor {
|
public class EntityInBlockRemovingProcessor implements IBatchProcessor {
|
||||||
|
|
||||||
|
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IChunkSet processSet(final IChunk chunk, final IChunkGet get, final IChunkSet set) {
|
public IChunkSet processSet(final IChunk chunk, final IChunkGet get, final IChunkSet set) {
|
||||||
|
try {
|
||||||
for (CompoundTag tag : get.getEntities()) {
|
for (CompoundTag tag : get.getEntities()) {
|
||||||
// Empty tags for seemingly non-existent entities can exist?
|
// Empty tags for seemingly non-existent entities can exist?
|
||||||
if (tag.getList("Pos").size() == 0) {
|
if (tag.getList("Pos").size() == 0) {
|
||||||
@ -39,6 +44,9 @@ public class EntityInBlockRemovingProcessor implements IBatchProcessor {
|
|||||||
set.removeEntity(tag.getUUID());
|
set.removeEntity(tag.getUUID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
LOGGER.warn("Could not remove entities in blocks in chunk {},{}", chunk.getX(), chunk.getZ(), e);
|
||||||
|
}
|
||||||
return set;
|
return set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user