Use a static builder and reset it, rather than asking the Sponge registry for a new builder

This commit is contained in:
Wyatt Childers 2016-05-16 15:49:49 -04:00
parent a31546eda2
commit d1e9446d47

View File

@ -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())