mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 20:16:41 +00:00
Don't construct new BaseBlock
This commit is contained in:
@ -379,8 +379,7 @@ public class DiskOptimizedClipboard extends FaweClipboard implements Closeable {
|
||||
trio.set(x, y, z);
|
||||
CompoundTag nbt = nbtMap.get(trio);
|
||||
if (nbt != null) {
|
||||
BaseBlock block = new BaseBlock(state, nbt);
|
||||
task.run(x, y, z, block);
|
||||
task.run(x, y, z, state.toBaseBlock(nbt));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -411,8 +410,7 @@ public class DiskOptimizedClipboard extends FaweClipboard implements Closeable {
|
||||
trio.set(x, y, z);
|
||||
CompoundTag nbt = nbtMap.get(trio);
|
||||
if (nbt != null) {
|
||||
BaseBlock block = new BaseBlock(state, nbt);
|
||||
task.run(x, y, z, block);
|
||||
task.run(x, y, z, state.toBaseBlock(nbt));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
public class IdDataMaskPattern extends AbstractExtentPattern {
|
||||
private final Pattern pattern;
|
||||
private final int bitMask;
|
||||
private final BaseBlock mutable = new BaseBlock(BlockTypes.AIR);
|
||||
|
||||
public IdDataMaskPattern(Extent extent, Pattern parent, int bitMask) {
|
||||
super(extent);
|
||||
|
@ -205,7 +205,7 @@ public class PropertyPattern extends AbstractExtentPattern {
|
||||
if (newOrdinal != ordinal) {
|
||||
CompoundTag nbt = block.getNbtData();
|
||||
BlockState newState = BlockState.getFromOrdinal(newOrdinal);
|
||||
return nbt != null ? new BaseBlock(newState, nbt) : newState.toBaseBlock();
|
||||
return newState.toBaseBlock(nbt);
|
||||
}
|
||||
return orDefault;
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ public class StructureFormat implements ClipboardReader, ClipboardWriter {
|
||||
if (state.getBlockType().getMaterial().hasContainer()) {
|
||||
CompoundTag nbt = (CompoundTag) blockMap.get("nbt");
|
||||
if (nbt != null) {
|
||||
BaseBlock block = new BaseBlock(state, nbt);
|
||||
BaseBlock block = state.toBaseBlock(nbt);
|
||||
clipboard.setBlock(x, y, z, block);
|
||||
continue;
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ public class FakePlayer extends AbstractPlayerActor {
|
||||
|
||||
@Override
|
||||
public BaseBlock getBlockInHand(HandSide ignore) {
|
||||
return new BaseBlock(BlockTypes.AIR.getDefaultState());
|
||||
return BlockTypes.AIR.getDefaultState().toBaseBlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user