Skip to content

Commit

Permalink
Use a static builder and reset it, rather than asking the Sponge regi…
Browse files Browse the repository at this point in the history
…stry for a new builder
  • Loading branch information
DarkArc committed May 17, 2016
1 parent a31546e commit d1e9446
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -116,6 +116,8 @@ public String getName() {

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);
Expand All @@ -127,7 +129,7 @@ public boolean setBlock(Vector position, BaseBlock block, boolean notifyAndLight
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())
Expand Down

0 comments on commit d1e9446

Please sign in to comment.