mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-05 20:36:42 +00:00
*
A tribute to Jesse
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
package com.boydti.fawe.object.extent;
|
||||
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.extent.PassthroughExtent;
|
||||
|
||||
@ -30,7 +29,7 @@ public class ExtentHeightCacher extends PassthroughExtent {
|
||||
int rx = x - cacheBotX + 16;
|
||||
int rz = z - cacheBotZ + 16;
|
||||
int index;
|
||||
if (((rx & 0xFF) != rx || (rz & 0xFF) != rz)) {
|
||||
if ((rx & 0xFF) != rx || (rz & 0xFF) != rz) {
|
||||
cacheBotX = x - 16;
|
||||
cacheBotZ = z - 16;
|
||||
lastY = y;
|
||||
|
@ -1,12 +1,9 @@
|
||||
package com.boydti.fawe.object.extent;
|
||||
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.object.FaweLimit;
|
||||
import com.boydti.fawe.object.exception.FaweException;
|
||||
import com.boydti.fawe.util.WEManager;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.entity.BaseEntity;
|
||||
import com.sk89q.worldedit.entity.Entity;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
@ -15,9 +12,10 @@ import com.sk89q.worldedit.math.BlockVector3;
|
||||
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.BlockTypes;
|
||||
|
||||
import java.util.Collection;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@ -41,12 +39,7 @@ public abstract class FaweRegionExtent extends ResettableExtent {
|
||||
public abstract Collection<Region> getRegions();
|
||||
|
||||
public boolean isGlobal() {
|
||||
for (Region region : getRegions()) {
|
||||
if (region.isGlobal()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return getRegions().stream().anyMatch(Region::isGlobal);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,12 +30,12 @@ public class OffsetExtent extends ResettableExtent {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBlock(BlockVector3 location, BlockStateHolder block) throws WorldEditException {
|
||||
public <T extends BlockStateHolder<T>> boolean setBlock(BlockVector3 location, T block) throws WorldEditException {
|
||||
return getExtent().setBlock(location.getBlockX() + dx, location.getBlockY() + dy, location.getBlockZ() + dz, block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBlock(int x, int y, int z, BlockStateHolder block) throws WorldEditException {
|
||||
public <T extends BlockStateHolder<T>> boolean setBlock(int x, int y, int z, T block) throws WorldEditException {
|
||||
return getExtent().setBlock(x + dx, y + dy, z + dz, block);
|
||||
}
|
||||
|
||||
|
@ -51,13 +51,13 @@ public class TransformExtent extends BlockTransformExtent {
|
||||
if (min == null) {
|
||||
min = pos;
|
||||
}
|
||||
mutable1.mutX(((pos.getX() - min.getX())));
|
||||
mutable1.mutY(((pos.getY() - min.getY())));
|
||||
mutable1.mutZ(((pos.getZ() - min.getZ())));
|
||||
mutable1.mutX(pos.getX() - min.getX());
|
||||
mutable1.mutY(pos.getY() - min.getY());
|
||||
mutable1.mutZ(pos.getZ() - min.getZ());
|
||||
Vector3 tmp = getTransform().apply(mutable1);
|
||||
mutable2.mutX((tmp.getX() + min.getX()));
|
||||
mutable2.mutY((tmp.getY() + min.getY()));
|
||||
mutable2.mutZ((tmp.getZ() + min.getZ()));
|
||||
mutable2.mutX(tmp.getX() + min.getX());
|
||||
mutable2.mutY(tmp.getY() + min.getY());
|
||||
mutable2.mutZ(tmp.getZ() + min.getZ());
|
||||
return mutable2;
|
||||
}
|
||||
|
||||
@ -65,13 +65,13 @@ public class TransformExtent extends BlockTransformExtent {
|
||||
if (min == null) {
|
||||
min = BlockVector3.at(x, y, z);
|
||||
}
|
||||
mutable1.mutX(((x - min.getX())));
|
||||
mutable1.mutY(((y - min.getY())));
|
||||
mutable1.mutZ(((z - min.getZ())));
|
||||
mutable1.mutX(x - min.getX());
|
||||
mutable1.mutY(y - min.getY());
|
||||
mutable1.mutZ(z - min.getZ());
|
||||
Vector3 tmp = getTransform().apply(mutable1);
|
||||
mutable2.mutX((tmp.getX() + min.getX()));
|
||||
mutable2.mutY((tmp.getY() + min.getY()));
|
||||
mutable2.mutZ((tmp.getZ() + min.getZ()));
|
||||
mutable2.mutX(tmp.getX() + min.getX());
|
||||
mutable2.mutY(tmp.getY() + min.getY());
|
||||
mutable2.mutZ(tmp.getZ() + min.getZ());
|
||||
return tmp.toBlockPoint();
|
||||
}
|
||||
|
||||
@ -93,13 +93,13 @@ public class TransformExtent extends BlockTransformExtent {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBlock(int x, int y, int z, BlockStateHolder block) throws WorldEditException {
|
||||
public <T extends BlockStateHolder<T>> boolean setBlock(int x, int y, int z, T block) throws WorldEditException {
|
||||
return super.setBlock(getPos(x, y, z), transformInverse(block));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean setBlock(BlockVector3 location, BlockStateHolder block) throws WorldEditException {
|
||||
public <B extends BlockStateHolder<B>> boolean setBlock(BlockVector3 location, B block) throws WorldEditException {
|
||||
return super.setBlock(getPos(location), transformInverse(block));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user