Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-05 11:00:05 +01:00
Avoid block vector creation for combine stages = false
Dieser Commit ist enthalten in:
Ursprung
f6014089cc
Commit
69e2ce6165
@ -61,7 +61,7 @@ public class HistoryExtent extends AbstractDelegateExtent {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <B extends BlockStateHolder<B>> boolean setBlock(int x, int y, int z, B block) throws WorldEditException {
|
public <B extends BlockStateHolder<B>> boolean setBlock(int x, int y, int z, B block) throws WorldEditException {
|
||||||
BaseBlock previous = queue.getFullBlock(BlockVector3.at(x, y, z)).toBaseBlock();
|
BaseBlock previous = queue.getFullBlock(mutable.setComponents(x, y, z)).toBaseBlock();
|
||||||
if (previous.getInternalId() == block.getInternalId()) {
|
if (previous.getInternalId() == block.getInternalId()) {
|
||||||
if (!previous.hasNbtData() && (block instanceof BaseBlock && !((BaseBlock)block).hasNbtData())) {
|
if (!previous.hasNbtData() && (block instanceof BaseBlock && !((BaseBlock)block).hasNbtData())) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -25,6 +25,7 @@ import com.sk89q.worldedit.entity.Player;
|
|||||||
import com.sk89q.worldedit.extent.Extent;
|
import com.sk89q.worldedit.extent.Extent;
|
||||||
import com.sk89q.worldedit.internal.cui.CUIEvent;
|
import com.sk89q.worldedit.internal.cui.CUIEvent;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
|
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||||
import com.sk89q.worldedit.math.Vector3;
|
import com.sk89q.worldedit.math.Vector3;
|
||||||
import com.sk89q.worldedit.util.Direction;
|
import com.sk89q.worldedit.util.Direction;
|
||||||
import com.sk89q.worldedit.util.HandSide;
|
import com.sk89q.worldedit.util.HandSide;
|
||||||
@ -106,15 +107,16 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable {
|
|||||||
|
|
||||||
byte free = 0;
|
byte free = 0;
|
||||||
|
|
||||||
|
BlockVector3 mutablePos = MutableBlockVector3.at(0, 0, 0);
|
||||||
while (y <= world.getMaximumPoint().getBlockY() + 2) {
|
while (y <= world.getMaximumPoint().getBlockY() + 2) {
|
||||||
if (!world.getBlock(BlockVector3.at(x, y, z)).getBlockType().getMaterial().isMovementBlocker()) {
|
if (!world.getBlock(mutablePos.setComponents(x, y, z)).getBlockType().getMaterial().isMovementBlocker()) {
|
||||||
++free;
|
++free;
|
||||||
} else {
|
} else {
|
||||||
free = 0;
|
free = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (free == 2) {
|
if (free == 2) {
|
||||||
final BlockVector3 pos = BlockVector3.at(x, y - 2, z);
|
final BlockVector3 pos = mutablePos.setComponents(x, y - 2, z);
|
||||||
final BlockStateHolder state = world.getBlock(pos);
|
final BlockStateHolder state = world.getBlock(pos);
|
||||||
setPosition(new Location(world, Vector3.at(x + 0.5, y - 2 + BlockTypeUtil.centralTopLimit(state), z + 0.5)));
|
setPosition(new Location(world, Vector3.at(x + 0.5, y - 2 + BlockTypeUtil.centralTopLimit(state), z + 0.5)));
|
||||||
return;
|
return;
|
||||||
|
@ -47,7 +47,7 @@ import javax.annotation.Nullable;
|
|||||||
|
|
||||||
public class AbstractDelegateExtent implements LightingExtent {
|
public class AbstractDelegateExtent implements LightingExtent {
|
||||||
private transient final Extent extent;
|
private transient final Extent extent;
|
||||||
private MutableBlockVector3 mutable = new MutableBlockVector3(0, 0, 0);
|
protected MutableBlockVector3 mutable = new MutableBlockVector3(0, 0, 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new instance.
|
* Create a new instance.
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren