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

Dieser Commit ist enthalten in:
Wyatt Childers 2016-05-16 15:49:49 -04:00
Ursprung a31546eda2
Commit d1e9446d47

Datei anzeigen

@ -116,6 +116,8 @@ public abstract class SpongeWorld extends AbstractWorld {
protected abstract void applyTileEntityData(TileEntity entity, BaseBlock block); protected abstract void applyTileEntityData(TileEntity entity, BaseBlock block);
private static final BlockSnapshot.Builder builder = BlockSnapshot.builder();
@Override @Override
public boolean setBlock(Vector position, BaseBlock block, boolean notifyAndLight) throws WorldEditException { public boolean setBlock(Vector position, BaseBlock block, boolean notifyAndLight) throws WorldEditException {
checkNotNull(position); checkNotNull(position);
@ -127,7 +129,7 @@ public abstract class SpongeWorld extends AbstractWorld {
Vector3i pos = new Vector3i(position.getX(), position.getY(), position.getZ()); Vector3i pos = new Vector3i(position.getX(), position.getY(), position.getZ());
BlockState newState = getBlockState(block); BlockState newState = getBlockState(block);
BlockSnapshot snapshot = BlockSnapshot.builder() BlockSnapshot snapshot = builder.reset()
.blockState(newState) .blockState(newState)
.position(pos) .position(pos)
.world(world.getProperties()) .world(world.getProperties())