From d1e9446d476890e5cec4f468ba03eb54e4ccb052 Mon Sep 17 00:00:00 2001 From: Wyatt Childers Date: Mon, 16 May 2016 15:49:49 -0400 Subject: [PATCH] Use a static builder and reset it, rather than asking the Sponge registry for a new builder --- .../src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java index d7b6f7803..c6309cb22 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java @@ -116,6 +116,8 @@ public abstract class SpongeWorld extends AbstractWorld { protected abstract void applyTileEntityData(TileEntity entity, BaseBlock block); + private static final BlockSnapshot.Builder builder = BlockSnapshot.builder(); + @Override public boolean setBlock(Vector position, BaseBlock block, boolean notifyAndLight) throws WorldEditException { checkNotNull(position); @@ -127,7 +129,7 @@ public abstract class SpongeWorld extends AbstractWorld { Vector3i pos = new Vector3i(position.getX(), position.getY(), position.getZ()); BlockState newState = getBlockState(block); - BlockSnapshot snapshot = BlockSnapshot.builder() + BlockSnapshot snapshot = builder.reset() .blockState(newState) .position(pos) .world(world.getProperties())