mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 03:56:41 +00:00
continue with merge
This commit is contained in:
@ -37,6 +37,8 @@ import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.registry.BundledBlockData;
|
||||
@ -44,9 +46,8 @@ import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class AbstractDelegateExtent implements LightingExtent {
|
||||
|
||||
private transient final Extent extent;
|
||||
// private MutableBlockVector3 mutable = new MutableBlockVector3(0, 0, 0);
|
||||
private MutableBlockVector3 mutable = new MutableBlockVector3(0, 0, 0);
|
||||
|
||||
/**
|
||||
* Create a new instance.
|
||||
@ -75,11 +76,6 @@ public class AbstractDelegateExtent implements LightingExtent {
|
||||
return extent.getBlockType(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBlock getFullBlock(BlockVector3 position) {
|
||||
return extent.getFullBlock(position);
|
||||
}
|
||||
|
||||
|
||||
public int getBlockLight(int x, int y, int z) {
|
||||
if (extent instanceof LightingExtent) {
|
||||
|
@ -27,6 +27,8 @@ import com.sk89q.worldedit.entity.BaseEntity;
|
||||
import com.sk89q.worldedit.entity.Entity;
|
||||
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.function.operation.Operation;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
@ -330,11 +332,11 @@ public interface Extent extends InputExtent, OutputExtent {
|
||||
* @param region a region
|
||||
* @return the results
|
||||
*/
|
||||
default List<Countable<BlockStateHolder>> getBlockDistributionWithData(final Region region) {
|
||||
default List<Countable<BlockState>> getBlockDistributionWithData(final Region region) {
|
||||
int[][] counter = new int[BlockTypes.size()][];
|
||||
|
||||
for (final BlockVector3 pt : region) {
|
||||
BlockStateHolder blk = this.getBlock(pt);
|
||||
BlockState blk = this.getBlock(pt);
|
||||
BlockType type = blk.getBlockType();
|
||||
int[] stateCounter = counter[type.getInternalId()];
|
||||
if (stateCounter == null) {
|
||||
@ -342,7 +344,7 @@ public interface Extent extends InputExtent, OutputExtent {
|
||||
}
|
||||
stateCounter[blk.getInternalPropertiesId()]++;
|
||||
}
|
||||
List<Countable<BlockStateHolder>> distribution = new ArrayList<>();
|
||||
List<Countable<BlockState>> distribution = new ArrayList<>();
|
||||
for (int typeId = 0; typeId < counter.length; typeId++) {
|
||||
BlockType type = BlockTypes.get(typeId);
|
||||
int[] stateCount = counter[typeId];
|
||||
@ -350,7 +352,7 @@ public interface Extent extends InputExtent, OutputExtent {
|
||||
for (int propId = 0; propId < stateCount.length; propId++) {
|
||||
int count = stateCount[propId];
|
||||
if (count != 0) {
|
||||
BlockStateHolder state = type.withPropertyId(propId);
|
||||
BlockState state = type.withPropertyId(propId);
|
||||
distribution.add(new Countable<>(state, count));
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@ import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
|
||||
/**
|
||||
* Provides the current state of blocks, entities, and so on.
|
||||
|
@ -168,6 +168,7 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder
|
||||
public MultiStageReorder(Extent extent, boolean enabled) {
|
||||
super(extent);
|
||||
this.enabled = enabled;
|
||||
|
||||
for (PlacementPriority priority : PlacementPriority.values()) {
|
||||
stages.put(priority, new LocatedBlockList());
|
||||
}
|
||||
@ -229,7 +230,6 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder
|
||||
stages.get(PlacementPriority.CLEAR_LAST).add(location, replacement);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (block.getBlockType().getMaterial().isAir()) {
|
||||
return !existing.equalsFuzzy(block);
|
||||
@ -252,4 +252,4 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder
|
||||
|
||||
return new OperationQueue(operations);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user