This commit is contained in:
Jesse Boyd
2019-07-18 04:30:02 +10:00
280 changed files with 13872 additions and 8497 deletions

View File

@ -52,17 +52,12 @@ public class BlockTranslateExtent extends AbstractDelegateExtent {
@Override
public BlockState getBlock(BlockVector3 location) {
return getLazyBlock(location.getBlockX(), location.getBlockY(), location.getBlockZ());
return getBlock(location.getBlockX(), location.getBlockY(), location.getBlockZ());
}
@Override
public BlockState getLazyBlock(BlockVector3 location) {
return getLazyBlock(location.getBlockX(), location.getBlockY(), location.getBlockZ());
}
@Override
public BlockState getLazyBlock(int x, int y, int z) {
return super.getLazyBlock(x + dx, y + dy, z + dz);
public BlockState getBlock(int x, int y, int z) {
return super.getBlock(x + dx, y + dy, z + dz);
}
@Override

View File

@ -127,12 +127,12 @@ public class FastWorldEditExtent extends AbstractDelegateExtent implements HasFa
}
@Override
public BlockState getLazyBlock(BlockVector3 location) {
return getLazyBlock(location.getBlockX(), location.getBlockY(), location.getBlockZ());
public BlockState getBlock(BlockVector3 location) {
return getBlock(location.getBlockX(), location.getBlockY(), location.getBlockZ());
}
@Override
public BlockState getLazyBlock(int x, int y, int z) {
public BlockState getBlock(int x, int y, int z) {
int combinedId4Data = queue.getCombinedId4Data(x, y, z, 0);
BlockType type = BlockTypes.getFromStateId(combinedId4Data);
return type.withStateId(combinedId4Data);
@ -162,11 +162,6 @@ public class FastWorldEditExtent extends AbstractDelegateExtent implements HasFa
return world.getEntities(region);
}
@Override
public BlockState getBlock(final BlockVector3 position) {
return this.getLazyBlock(position);
}
@Override
public boolean setBiome(final BlockVector2 position, final BiomeType biome) {
queue.setBiome(position.getBlockX(), position.getBlockZ(), biome);

View File

@ -2,6 +2,7 @@ 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;
@ -57,44 +58,22 @@ public abstract class FaweRegionExtent extends ResettableExtent {
return contains(p.getBlockX(), p.getBlockZ());
}
@Override
public <B extends BlockStateHolder<B>> boolean setBlock(BlockVector3 location, B block) throws WorldEditException {
if (!contains(location)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION);
}
return false;
}
return super.setBlock(location, block);
}
@Override
public <B extends BlockStateHolder<B>> boolean setBlock(int x, int y, int z, B block) throws WorldEditException {
if (!contains(x, y, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION);
WEManager.IMP.cancelEditSafe(this, FaweException.OUTSIDE_REGION);
}
return false;
}
return super.setBlock(x, y, z, block);
}
@Override
public boolean setBiome(BlockVector2 position, BiomeType biome) {
if (!contains(position)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION);
}
return false;
}
return super.setBiome(position, biome);
}
@Override
public boolean setBiome(int x, int y, int z, BiomeType biome) {
if (!contains(x, y, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION);
WEManager.IMP.cancelEditSafe(this, FaweException.OUTSIDE_REGION);
}
return false;
}
@ -105,18 +84,29 @@ public abstract class FaweRegionExtent extends ResettableExtent {
public BiomeType getBiome(BlockVector2 position) {
if (!contains(position)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION);
WEManager.IMP.cancelEditSafe(this, FaweException.OUTSIDE_REGION);
}
return null;
}
return super.getBiome(position);
}
@Override
public BiomeType getBiomeType(int x, int z) {
if (!contains(x, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, FaweException.OUTSIDE_REGION);
}
return null;
}
return super.getBiomeType(x, z);
}
@Override
public BaseBlock getFullBlock(BlockVector3 position) {
if (!contains(position)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION);
WEManager.IMP.cancelEditSafe(this, FaweException.OUTSIDE_REGION);
}
return BlockTypes.AIR.getDefaultState().toBaseBlock();
}
@ -127,40 +117,18 @@ public abstract class FaweRegionExtent extends ResettableExtent {
public BlockState getBlock(BlockVector3 position) {
if (!contains(position)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION);
WEManager.IMP.cancelEditSafe(this, FaweException.OUTSIDE_REGION);
}
return BlockTypes.AIR.getDefaultState();
}
return super.getBlock(position);
}
@Override
public BlockState getLazyBlock(BlockVector3 position) {
if (!contains(position)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION);
}
return BlockTypes.AIR.getDefaultState();
}
return super.getLazyBlock(position);
}
@Override
public BlockState getLazyBlock(int x, int y, int z) {
if (!contains(x, y, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION);
}
return BlockTypes.AIR.getDefaultState();
}
return super.getLazyBlock(x, y, z);
}
@Override
public int getBlockLight(int x, int y, int z) {
if (!contains(x, y, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION);
WEManager.IMP.cancelEditSafe(this, FaweException.OUTSIDE_REGION);
}
return 0;
}
@ -171,7 +139,7 @@ public abstract class FaweRegionExtent extends ResettableExtent {
public int getBrightness(int x, int y, int z) {
if (!contains(x, y, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION);
WEManager.IMP.cancelEditSafe(this, FaweException.OUTSIDE_REGION);
}
return 0;
}
@ -182,7 +150,7 @@ public abstract class FaweRegionExtent extends ResettableExtent {
public int getLight(int x, int y, int z) {
if (!contains(x, y, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION);
WEManager.IMP.cancelEditSafe(this, FaweException.OUTSIDE_REGION);
}
return 0;
}
@ -193,7 +161,7 @@ public abstract class FaweRegionExtent extends ResettableExtent {
public int getOpacity(int x, int y, int z) {
if (!contains(x, y, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION);
WEManager.IMP.cancelEditSafe(this, FaweException.OUTSIDE_REGION);
}
return 0;
}
@ -204,7 +172,7 @@ public abstract class FaweRegionExtent extends ResettableExtent {
public int getSkyLight(int x, int y, int z) {
if (!contains(x, y, z)) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION);
WEManager.IMP.cancelEditSafe(this, FaweException.OUTSIDE_REGION);
}
return 0;
}
@ -216,7 +184,7 @@ public abstract class FaweRegionExtent extends ResettableExtent {
public Entity createEntity(Location location, BaseEntity entity) {
if (!contains(location.getBlockX(), location.getBlockY(), location.getBlockZ())) {
if (!limit.MAX_FAILS()) {
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION);
WEManager.IMP.cancelEditSafe(this, FaweException.OUTSIDE_REGION);
}
return null;
}

View File

@ -2,6 +2,7 @@ package com.boydti.fawe.object.extent;
import com.boydti.fawe.config.BBC;
import com.boydti.fawe.object.FawePlayer;
import com.boydti.fawe.object.exception.FaweException;
import com.boydti.fawe.util.MemUtil;
import com.boydti.fawe.util.Perm;
import com.boydti.fawe.util.WEManager;
@ -30,7 +31,7 @@ public class MemoryCheckingExtent extends AbstractDelegateExtent {
BBC.WORLDEDIT_OOM_ADMIN.send(this.player);
}
}
WEManager.IMP.cancelEdit(this, BBC.WORLDEDIT_CANCEL_REASON_LOW_MEMORY);
WEManager.IMP.cancelEdit(this, FaweException.LOW_MEMORY);
return false;
}
return true;

View File

@ -28,7 +28,7 @@ public class MultiTransform extends RandomTransform {
@Override
public void add(ResettableExtent extent, double chance) {
super.add(extent, chance);
this.extents = getExtents().toArray(new ResettableExtent[getExtents().size()]);
this.extents = getExtents().toArray(new ResettableExtent[0]);
}
@Override

View File

@ -3,9 +3,8 @@ 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.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,6 +14,8 @@ 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 javax.annotation.Nullable;
@ -25,7 +26,7 @@ import java.util.List;
public class NullExtent extends FaweRegionExtent {
private final BBC reason;
private final FaweException reason;
/**
* Create a new instance.
@ -33,15 +34,18 @@ public class NullExtent extends FaweRegionExtent {
* @param extent the extent
*/
public NullExtent(Extent extent, BBC failReason) {
this(extent, new FaweException(failReason));
}
public NullExtent(Extent extent, FaweException exception) {
super(extent, FaweLimit.MAX);
this.reason = failReason;
this.reason = exception;
}
public NullExtent() {
super(new com.sk89q.worldedit.extent.NullExtent(), FaweLimit.MAX);
this.reason = BBC.WORLDEDIT_CANCEL_REASON_MANUAL;
this(new com.sk89q.worldedit.extent.NullExtent(), FaweException.MANUAL);
}
@Override
public ResettableExtent setExtent(Extent extent) {
return this;
@ -50,73 +54,65 @@ public class NullExtent extends FaweRegionExtent {
@Override
public BiomeType getBiome(final BlockVector2 arg0) {
if(reason != null) {
throw new FaweException(reason);
}else {
return null;
throw reason;
}
return null;
}
@Override
public BlockState getBlock(final BlockVector3 arg0) {
if(reason != null) {
throw new FaweException(reason);
}else {
return null;
throw reason;
}
return null;
}
@Override
public BlockState getLazyBlock(final BlockVector3 arg0) {
public BlockState getBlock(int x, int y, int z) {
if(reason != null) {
throw new FaweException(reason);
}else {
return null;
throw reason;
}
return null;
}
@Override
public BaseBlock getFullBlock(int x, int y, int z) {
if(reason != null) {
throw reason;
}
return null;
}
@Override
public boolean setBiome(final BlockVector2 arg0, final BiomeType arg1) {
if(reason != null) {
throw new FaweException(reason);
}else {
return false;
throw reason;
}
return false;
}
@Override
public boolean setBlock(final BlockVector3 arg0, final BlockStateHolder arg1) throws WorldEditException {
if(reason != null) {
throw new FaweException(reason);
}else {
return false;
throw reason;
}
return false;
}
@Override
public boolean setBlock(int x, int y, int z, BlockStateHolder block) throws WorldEditException {
if(reason != null) {
throw new FaweException(reason);
}else {
return false;
}
}
@Override
public BlockState getLazyBlock(int x, int y, int z) {
if(reason != null) {
throw new FaweException(reason);
}else {
return null;
throw reason;
}
return false;
}
@Override
public Entity createEntity(final Location arg0, final BaseEntity arg1) {
if(reason != null) {
throw new FaweException(reason);
}else {
return null;
throw reason;
}
return null;
}
@Override
@ -131,30 +127,28 @@ public class NullExtent extends FaweRegionExtent {
@Override
public BlockVector3 getMaximumPoint() {
return BlockVector3.at(0, 0, 0);
return BlockVector3.ZERO;
}
@Override
public BlockVector3 getMinimumPoint() {
return BlockVector3.at(0, 0, 0);
return BlockVector3.ZERO;
}
@Override
public boolean contains(int x, int z) {
if(reason != null) {
throw new FaweException(reason);
}else {
return false;
throw reason;
}
return false;
}
@Override
public boolean contains(int x, int y, int z) {
if(reason != null) {
throw new FaweException(reason);
}else {
return false;
throw reason;
}
return false;
}
@Override
@ -162,11 +156,6 @@ public class NullExtent extends FaweRegionExtent {
return Collections.emptyList();
}
@Override
protected Operation commitBefore() {
return null;
}
@Nullable
@Override
public Operation commit() {
@ -176,28 +165,25 @@ public class NullExtent extends FaweRegionExtent {
@Override
public int getNearestSurfaceLayer(int x, int z, int y, int minY, int maxY) {
if(reason != null) {
throw new FaweException(reason);
}else {
return -1;
throw reason;
}
return -1;
}
@Override
public int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY) {
if(reason != null) {
throw new FaweException(reason);
}else {
return -1;
throw reason;
}
return -1;
}
@Override
public int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY, int failedMin, int failedMax) {
if(reason != null) {
throw new FaweException(reason);
}else {
return -1;
throw reason;
}
return -1;
}
@Override

View File

@ -46,13 +46,8 @@ public class PositionTransformExtent extends ResettableExtent {
}
@Override
public BlockState getLazyBlock(int x, int y, int z) {
return super.getLazyBlock(getPos(BlockVector3.at(x, y, z)));
}
@Override
public BlockState getLazyBlock(BlockVector3 position) {
return super.getLazyBlock(getPos(position));
public BlockState getBlock(int x, int y, int z) {
return super.getBlock(getPos(BlockVector3.at(x, y, z)));
}
@Override

View File

@ -2,10 +2,10 @@ 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.AbstractDelegateExtent;
@ -15,6 +15,8 @@ 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;
@ -40,7 +42,7 @@ public class ProcessedWEExtent extends AbstractDelegateExtent {
return null;
}
if (!limit.MAX_ENTITIES()) {
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_MAX_ENTITIES);
WEManager.IMP.cancelEditSafe(this, FaweException.MAX_ENTITIES);
return null;
}
return super.createEntity(location, entity);
@ -62,19 +64,19 @@ public class ProcessedWEExtent extends AbstractDelegateExtent {
}
@Override
public BlockState getLazyBlock(int x, int y, int z) {
public BlockState getBlock(int x, int y, int z) {
if (!limit.MAX_CHECKS()) {
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_MAX_CHECKS);
WEManager.IMP.cancelEditSafe(this, FaweException.MAX_CHECKS);
return BlockTypes.AIR.getDefaultState();
} else {
return extent.getLazyBlock(x, y, z);
return extent.getBlock(x, y, z);
}
}
@Override
public BaseBlock getFullBlock(BlockVector3 pos) {
if (!limit.MAX_CHECKS()) {
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_MAX_CHECKS);
WEManager.IMP.cancelEditSafe(this, FaweException.MAX_CHECKS);
return BlockTypes.AIR.getDefaultState().toBaseBlock();
} else {
return extent.getFullBlock(pos);
@ -87,8 +89,8 @@ public class ProcessedWEExtent extends AbstractDelegateExtent {
}
@Override
public BlockState getLazyBlock(BlockVector3 location) {
return getLazyBlock(location.getBlockX(), location.getBlockY(), location.getBlockZ());
public BlockState getBlock(BlockVector3 location) {
return getBlock(location.getBlockX(), location.getBlockY(), location.getBlockZ());
}
@Override
@ -96,18 +98,18 @@ public class ProcessedWEExtent extends AbstractDelegateExtent {
boolean hasNbt = block instanceof BaseBlock && ((BaseBlock)block).hasNbtData();
if (hasNbt) {
if (!limit.MAX_BLOCKSTATES()) {
WEManager.IMP.cancelEdit(this, BBC.WORLDEDIT_CANCEL_REASON_MAX_TILES);
WEManager.IMP.cancelEdit(this, FaweException.MAX_TILES);
return false;
} else {
if (!limit.MAX_CHANGES()) {
WEManager.IMP.cancelEdit(this, BBC.WORLDEDIT_CANCEL_REASON_MAX_CHANGES);
WEManager.IMP.cancelEdit(this, FaweException.MAX_CHANGES);
return false;
}
return extent.setBlock(x, y, z, block);
}
}
if (!limit.MAX_CHANGES()) {
WEManager.IMP.cancelEdit(this, BBC.WORLDEDIT_CANCEL_REASON_MAX_CHANGES);
WEManager.IMP.cancelEdit(this, FaweException.MAX_CHANGES);
return false;
} else {
return extent.setBlock(x, y, z, block);
@ -117,7 +119,7 @@ public class ProcessedWEExtent extends AbstractDelegateExtent {
@Override
public boolean setBiome(final BlockVector2 position, final BiomeType biome) {
if (!limit.MAX_CHANGES()) {
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_MAX_CHANGES);
WEManager.IMP.cancelEditSafe(this, FaweException.MAX_CHANGES);
return false;
}
return super.setBiome(position, biome);

View File

@ -26,9 +26,7 @@ public class ResettableExtent extends AbstractDelegateExtent implements Serializ
setOrigin(pos);
}
protected void setOrigin(BlockVector3 pos) {
}
protected void setOrigin(BlockVector3 pos) {}
public ResettableExtent setExtent(Extent extent) {
checkNotNull(extent);

View File

@ -30,7 +30,7 @@ public class StripNBTExtent extends AbstractDelegateExtent {
*/
public StripNBTExtent(Extent extent, Set<String> strip) {
super(extent);
this.strip = strip.toArray(new String[strip.size()]);
this.strip = strip.toArray(new String[0]);
}
@Override
@ -60,7 +60,7 @@ public class StripNBTExtent extends AbstractDelegateExtent {
}
return (B) localBlock;
}
public <T extends NbtValued> T stripEntityNBT(T entity) {
if (!entity.hasNbtData()) return entity;
CompoundTag nbt = entity.getNbtData();

View File

@ -57,19 +57,11 @@ public class TemporalExtent extends AbstractDelegateExtent {
}
@Override
public BlockState getLazyBlock(BlockVector3 position) {
if (position.getX() == x && position.getY() == y && position.getZ() == z) {
return block.toImmutableState();
}
return super.getLazyBlock(position);
}
@Override
public BlockState getLazyBlock(int x, int y, int z) {
public BlockState getBlock(int x, int y, int z) {
if (this.x == x && this.y == y && this.z == z) {
return block.toImmutableState();
}
return super.getLazyBlock(x, y, z);
return super.getBlock(x, y, z);
}
@Override

View File

@ -1,6 +1,7 @@
package com.boydti.fawe.object.extent;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.extent.Extent;
@ -14,7 +15,8 @@ import com.sk89q.worldedit.world.block.BlockStateHolder;
public class TransformExtent extends BlockTransformExtent {
private final MutableBlockVector3 mutable = new MutableBlockVector3();
private final MutableVector3 mutable1 = new MutableVector3();
private final MutableBlockVector3 mutable2 = new MutableBlockVector3();
private BlockVector3 min;
public TransformExtent(Extent parent) {
@ -50,43 +52,34 @@ public class TransformExtent extends BlockTransformExtent {
if (min == null) {
min = pos;
}
mutable.mutX(((pos.getX() - min.getX())));
mutable.mutY(((pos.getY() - min.getY())));
mutable.mutZ(((pos.getZ() - min.getZ())));
MutableVector3 tmp = new MutableVector3(getTransform().apply(mutable.toVector3()));
tmp.mutX((tmp.getX() + min.getX()));
tmp.mutY((tmp.getY() + min.getY()));
tmp.mutZ((tmp.getZ() + min.getZ()));
return tmp.toBlockPoint();
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()));
return mutable2;
}
public BlockVector3 getPos(int x, int y, int z) {
if (min == null) {
min = BlockVector3.at(x, y, z);
}
mutable.mutX(((x - min.getX())));
mutable.mutY(((y - min.getY())));
mutable.mutZ(((z - min.getZ())));
MutableVector3 tmp = new MutableVector3(getTransform().apply(mutable.toVector3()));
tmp.mutX((tmp.getX() + min.getX()));
tmp.mutY((tmp.getY() + min.getY()));
tmp.mutZ((tmp.getZ() + 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()));
return tmp.toBlockPoint();
}
@Override
public BlockState getLazyBlock(int x, int y, int z) {
return transform(super.getLazyBlock(getPos(x, y, z)));
}
@Override
public BlockState getLazyBlock(BlockVector3 position) {
return transform(super.getLazyBlock(getPos(position)));
}
@Override
public BlockState getBlock(BlockVector3 position) {
return transform(super.getBlock(getPos(position)));
public BlockState getBlock(int x, int y, int z) {
BlockVector3 p = getPos(x, y, z);
return transform(super.getBlock(p.getX(), p.getY(), p.getZ()));
}
@Override
@ -95,11 +88,9 @@ public class TransformExtent extends BlockTransformExtent {
}
@Override
public BiomeType getBiome(BlockVector2 position) {
mutable.mutX(position.getBlockX());
mutable.mutZ(position.getBlockZ());
mutable.mutY(0);
return super.getBiome(getPos(mutable).toBlockVector2());
public BiomeType getBiomeType(int x, int z) {
BlockVector3 p = getPos(x, 0, z);
return super.getBiomeType(p.getX(), p.getZ());
}
@Override
@ -114,10 +105,8 @@ public class TransformExtent extends BlockTransformExtent {
}
@Override
public boolean setBiome(BlockVector2 position, BiomeType biome) {
mutable.mutX(position.getBlockX());
mutable.mutZ(position.getBlockZ());
mutable.mutY(0);
return super.setBiome(getPos(mutable).toBlockVector2(), biome);
public boolean setBiome(int x, int y, int z, BiomeType biome) {
BlockVector3 p = getPos(x, y, z);
return super.setBiome(p.getX(), p.getY(), p.getZ(), biome);
}
}