mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 20:16:41 +00:00
minor tweak for mutable vectors
This commit is contained in:
@ -16,6 +16,7 @@ import com.boydti.fawe.util.image.Drawable;
|
||||
import com.boydti.fawe.util.image.ImageViewer;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.worldedit.*;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.blocks.BaseItemStack;
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
@ -24,8 +25,6 @@ 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.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.Vector2;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.math.transform.AffineTransform;
|
||||
import com.sk89q.worldedit.math.transform.Transform;
|
||||
@ -51,7 +50,7 @@ import javax.annotation.Nullable;
|
||||
|
||||
// TODO FIXME
|
||||
public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Drawable, VirtualWorld {
|
||||
private final MutableBlockVector mutable = new MutableBlockVector();
|
||||
private final MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
|
||||
private final ThreadLocal<int[]> indexStore = new ThreadLocal<int[]>() {
|
||||
@Override
|
||||
@ -528,7 +527,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
int y = heights[index] & 0xFF;
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(y);
|
||||
if (mask.test(mutable.toBlockVector3())) {
|
||||
if (mask.test(mutable)) {
|
||||
int newHeight = table.average(x, z, index);
|
||||
setLayerHeightRaw(index, newHeight);
|
||||
}
|
||||
@ -583,7 +582,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
}
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(y);
|
||||
if (!mask.test(mutable.toBlockVector3())) {
|
||||
if (!mask.test(mutable)) {
|
||||
continue;
|
||||
}
|
||||
if (placed.containsRadius(x, z, distance)) {
|
||||
@ -603,9 +602,9 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
Schematic schematic = new Schematic(clipboard);
|
||||
Transform transform = holder.getTransform();
|
||||
if (transform.isIdentity()) {
|
||||
schematic.paste(this, mutable.toBlockVector3(), false);
|
||||
schematic.paste(this, mutable, false);
|
||||
} else {
|
||||
schematic.paste(this, mutable.toBlockVector3(), false, transform);
|
||||
schematic.paste(this, mutable, false, transform);
|
||||
}
|
||||
if (x + distance < getWidth()) {
|
||||
x += distance;
|
||||
@ -631,7 +630,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
}
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(y);
|
||||
if (!mask.test(mutable.toBlockVector3())) {
|
||||
if (!mask.test(mutable)) {
|
||||
continue;
|
||||
}
|
||||
if (placed.containsRadius(x, z, distance)) {
|
||||
@ -652,9 +651,9 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
Schematic schematic = new Schematic(clipboard);
|
||||
Transform transform = holder.getTransform();
|
||||
if (transform.isIdentity()) {
|
||||
schematic.paste(this, mutable.toBlockVector3(), false);
|
||||
schematic.paste(this, mutable, false);
|
||||
} else {
|
||||
schematic.paste(this, mutable.toBlockVector3(), false, transform);
|
||||
schematic.paste(this, mutable, false, transform);
|
||||
}
|
||||
if (x + distance < getWidth()) {
|
||||
x += distance;
|
||||
@ -1135,7 +1134,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
if (mask != null) {
|
||||
mutable.mutX(z);
|
||||
mutable.mutY(heights.getByte(index) & 0xFF);
|
||||
if (!mask.test(mutable.toBlockVector3())) continue;
|
||||
if (!mask.test(mutable)) continue;
|
||||
}
|
||||
if (imgMask != null) {
|
||||
int height = imgMask.getRGB(x, z) & 0xFF;
|
||||
@ -1256,7 +1255,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
for (int x = 0; x < getWidth(); x++, index++) {
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(heights.getByte(index) & 0xFF);
|
||||
if (mask.test(mutable.toBlockVector3())) {
|
||||
if (mask.test(mutable)) {
|
||||
int color = img.getRGB(x, z);
|
||||
BlockType block = textureUtil.getNearestBlock(color);
|
||||
if (block != null) {
|
||||
@ -1332,7 +1331,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
int y = heights.getByte(index) & 0xFF;
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(y);
|
||||
if (mask.test(mutable.toBlockVector3())) {
|
||||
if (mask.test(mutable)) {
|
||||
biomes.setByte(index, biome);
|
||||
}
|
||||
}
|
||||
@ -1362,7 +1361,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
.nextInt(256) <= height) {
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(height);
|
||||
overlayArr[index] = pattern.apply(mutable.toBlockVector3()).getInternalId();
|
||||
overlayArr[index] = pattern.apply(mutable).getInternalId();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1390,7 +1389,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
.nextInt(256) <= height) {
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(height);
|
||||
mainArr[index] = pattern.apply(mutable.toBlockVector3()).getInternalId();
|
||||
mainArr[index] = pattern.apply(mutable).getInternalId();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1416,7 +1415,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
.nextInt(256) <= height) {
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(height);
|
||||
floorArr[index] = pattern.apply(mutable.toBlockVector3()).getInternalId();
|
||||
floorArr[index] = pattern.apply(mutable).getInternalId();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1444,7 +1443,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
.nextInt(256) <= height) {
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(height);
|
||||
int combined = pattern.apply(mutable.toBlockVector3()).getInternalId();
|
||||
int combined = pattern.apply(mutable).getInternalId();
|
||||
mainArr[index] = combined;
|
||||
floorArr[index] = combined;
|
||||
}
|
||||
@ -1466,8 +1465,8 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
int y = heights.getByte(index) & 0xFF;
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(y);
|
||||
if (mask.test(mutable.toBlockVector3())) {
|
||||
overlay.setInt(index, pattern.apply(mutable.toBlockVector3()).getInternalId());
|
||||
if (mask.test(mutable)) {
|
||||
overlay.setInt(index, pattern.apply(mutable).getInternalId());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1485,8 +1484,8 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
int y = heights.getByte(index) & 0xFF;
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(y);
|
||||
if (mask.test(mutable.toBlockVector3())) {
|
||||
floor.setInt(index, pattern.apply(mutable.toBlockVector3()).getInternalId());
|
||||
if (mask.test(mutable)) {
|
||||
floor.setInt(index, pattern.apply(mutable).getInternalId());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1505,8 +1504,8 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
int y = heights.getByte(index) & 0xFF;
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(y);
|
||||
if (mask.test(mutable.toBlockVector3())) {
|
||||
main.setInt(index, pattern.apply(mutable.toBlockVector3()).getInternalId());
|
||||
if (mask.test(mutable)) {
|
||||
main.setInt(index, pattern.apply(mutable).getInternalId());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1525,8 +1524,8 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
int y = heights.getByte(index) & 0xFF;
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(y);
|
||||
if (mask.test(mutable.toBlockVector3())) {
|
||||
int combined = pattern.apply(mutable.toBlockVector3()).getInternalId();
|
||||
if (mask.test(mutable)) {
|
||||
int combined = pattern.apply(mutable).getInternalId();
|
||||
floor.setInt(index, combined);
|
||||
main.setInt(index, combined);
|
||||
}
|
||||
@ -1552,7 +1551,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
int y = heights.getByte(index) & 0xFF;
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(y);
|
||||
floorArr[index] = value.apply(mutable.toBlockVector3()).getInternalId();
|
||||
floorArr[index] = value.apply(mutable).getInternalId();
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1573,7 +1572,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
int y = heights.getByte(index) & 0xFF;
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(y);
|
||||
int combined = value.apply(mutable.toBlockVector3()).getInternalId();
|
||||
int combined = value.apply(mutable).getInternalId();
|
||||
mainArr[index] = combined;
|
||||
floorArr[index] = combined;
|
||||
}
|
||||
@ -1595,7 +1594,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
int y = heights.getByte(index) & 0xFF;
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(y);
|
||||
mainArr[index] = value.apply(mutable.toBlockVector3()).getInternalId();
|
||||
mainArr[index] = value.apply(mutable).getInternalId();
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1616,7 +1615,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
int y = heights.getByte(index) & 0xFF;
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(y);
|
||||
overlayArr[index] = value.apply(mutable.toBlockVector3()).getInternalId();
|
||||
overlayArr[index] = value.apply(mutable).getInternalId();
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -2003,7 +2002,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
int y = heights.getByte(index) & 0xFF;
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(y);
|
||||
if (mask.test(mutable.toBlockVector3())) {
|
||||
if (mask.test(mutable)) {
|
||||
overlay.setInt(index, combined);
|
||||
}
|
||||
}
|
||||
@ -2018,7 +2017,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
int y = heights.getByte(index) & 0xFF;
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(y);
|
||||
if (mask.test(mutable.toBlockVector3())) {
|
||||
if (mask.test(mutable)) {
|
||||
floor.setInt(index, combined);
|
||||
}
|
||||
}
|
||||
@ -2034,7 +2033,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
int y = heights.getByte(index) & 0xFF;
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(y);
|
||||
if (mask.test(mutable.toBlockVector3())) {
|
||||
if (mask.test(mutable)) {
|
||||
main.setInt(index, combined);
|
||||
}
|
||||
}
|
||||
@ -2050,7 +2049,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
||||
int y = heights.getByte(index) & 0xFF;
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(y);
|
||||
if (mask.test(mutable.toBlockVector3())) {
|
||||
if (mask.test(mutable)) {
|
||||
floor.setInt(index, combined);
|
||||
main.setInt(index, combined);
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ public class MappedReplacePatternFilter extends MCAFilterCounter {
|
||||
// map[block.getCombined()] = pattern;
|
||||
}
|
||||
|
||||
// private final MutableBlockVector mutable = new MutableBlockVector(0, 0, 0);
|
||||
// private final MutableBlockVector3 mutable = new MutableBlockVector3(0, 0, 0);
|
||||
|
||||
@Override
|
||||
public void applyBlock(int x, int y, int z, BaseBlock block, MutableLong ignore) {
|
||||
|
@ -1,12 +1,11 @@
|
||||
package com.boydti.fawe.jnbt.anvil.generator;
|
||||
|
||||
import com.boydti.fawe.object.PseudoRandom;
|
||||
import com.boydti.fawe.util.MathMan;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -20,7 +19,7 @@ public class OreGen extends Resource {
|
||||
private final Pattern pattern;
|
||||
private final Extent extent;
|
||||
private final Mask mask;
|
||||
private MutableBlockVector mutable = new MutableBlockVector();
|
||||
private MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
|
||||
private double ONE_2 = 1 / 2F;
|
||||
private double ONE_8 = 1 / 8F;
|
||||
@ -43,7 +42,7 @@ public class OreGen extends Resource {
|
||||
@Override
|
||||
public boolean spawn(Random rand, int x, int z) throws WorldEditException {
|
||||
int y = rand.nextInt(maxY - minY) + minY;
|
||||
if (!mask.test(mutable.setComponents(x, y, z).toBlockVector3())) {
|
||||
if (!mask.test(mutable.setComponents(x, y, z))) {
|
||||
return false;
|
||||
}
|
||||
double f = rand.nextDouble() * Math.PI;
|
||||
@ -106,8 +105,8 @@ public class OreGen extends Resource {
|
||||
double dz = (zz + 0.5D - d9) * id11o2;
|
||||
double dxyz2 = dxy2 + dz * dz;
|
||||
if ((dxyz2 < 1)) {
|
||||
if (mask.test(mutable.toBlockVector3()))
|
||||
pattern.apply(extent, mutable.toBlockVector3(), mutable.toBlockVector3());
|
||||
if (mask.test(mutable))
|
||||
pattern.apply(extent, mutable, mutable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package com.boydti.fawe.jnbt.anvil.generator;
|
||||
|
||||
import com.boydti.fawe.object.PseudoRandom;
|
||||
import com.boydti.fawe.object.schematic.Schematic;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
@ -20,7 +20,7 @@ public class SchemGen extends Resource {
|
||||
private final boolean randomRotate;
|
||||
private final Mask mask;
|
||||
|
||||
private MutableBlockVector mutable = new MutableBlockVector();
|
||||
private MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
|
||||
public SchemGen(Mask mask, Extent extent, List<ClipboardHolder> clipboards, boolean randomRotate) {
|
||||
this.mask = mask;
|
||||
@ -36,7 +36,7 @@ public class SchemGen extends Resource {
|
||||
int y = extent.getNearestSurfaceTerrainBlock(x, z, mutable.getBlockY(), 0, 255);
|
||||
if (y == -1) return false;
|
||||
mutable.mutY(y);
|
||||
if (!mask.test(mutable.toBlockVector3())) {
|
||||
if (!mask.test(mutable)) {
|
||||
return false;
|
||||
}
|
||||
mutable.mutY(y + 1);
|
||||
@ -48,9 +48,9 @@ public class SchemGen extends Resource {
|
||||
Schematic schematic = new Schematic(clipboard);
|
||||
Transform transform = holder.getTransform();
|
||||
if (transform.isIdentity()) {
|
||||
schematic.paste(extent, mutable.toBlockVector3(), false);
|
||||
schematic.paste(extent, mutable, false);
|
||||
} else {
|
||||
schematic.paste(extent, mutable.toBlockVector3(), false, transform);
|
||||
schematic.paste(extent, mutable, false, transform);
|
||||
}
|
||||
mutable.mutY(y);
|
||||
return true;
|
||||
|
@ -27,7 +27,7 @@ public class LoggingChangeSet extends AbstractDelegateChangeSet {
|
||||
|
||||
// public static IBlocksHubApi api;
|
||||
//
|
||||
// private final MutableVector loc;
|
||||
// private final MutableVector3 loc;
|
||||
// private final IPlayer player;
|
||||
// private IWorld world;
|
||||
// private final MutableBlockData oldBlock;
|
||||
@ -46,7 +46,7 @@ public class LoggingChangeSet extends AbstractDelegateChangeSet {
|
||||
// } catch (Throwable ignore) {
|
||||
// this.world = api.getWorld(world);
|
||||
// }
|
||||
// this.loc = new MutableVector();
|
||||
// this.loc = new MutableVector3();
|
||||
// this.oldBlock = new MutableBlockData();
|
||||
// this.newBlock = new MutableBlockData();
|
||||
// this.player = api.getPlayer(player.getUUID());
|
||||
|
@ -2,11 +2,11 @@
|
||||
//
|
||||
//import org.primesoft.blockshub.api.Vector;
|
||||
//
|
||||
//public class MutableVector extends Vector {
|
||||
//public class MutableVector3 extends Vector {
|
||||
//
|
||||
// public double x, y, z;
|
||||
//
|
||||
// public MutableVector() {
|
||||
// public MutableVector3() {
|
||||
// super(0, 0, 0);
|
||||
// this.x = 0;
|
||||
// this.y = 0;
|
||||
|
@ -18,7 +18,7 @@ import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
||||
@ -273,7 +273,7 @@ public interface FaweQueue extends HasFaweQueue, Extent {
|
||||
default void forEachBlockInChunk(int cx, int cz, RunnableVal2<BlockVector3, BaseBlock> onEach) {
|
||||
int bx = cx << 4;
|
||||
int bz = cz << 4;
|
||||
MutableBlockVector mutable = new MutableBlockVector(0, 0, 0);
|
||||
MutableBlockVector3 mutable = new MutableBlockVector3(0, 0, 0);
|
||||
for (int x = 0; x < 16; x++) {
|
||||
int xx = x + bx;
|
||||
mutable.mutX(xx);
|
||||
@ -290,9 +290,9 @@ public interface FaweQueue extends HasFaweQueue, Extent {
|
||||
mutable.mutY(y);
|
||||
CompoundTag tile = getTileEntity(x, y, z);
|
||||
if (tile != null) {
|
||||
onEach.run(mutable.toBlockVector3(), block.toBaseBlock(tile));
|
||||
onEach.run(mutable, block.toBaseBlock(tile));
|
||||
} else {
|
||||
onEach.run(mutable.toBlockVector3(), block);
|
||||
onEach.run(mutable, block);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -302,7 +302,7 @@ public interface FaweQueue extends HasFaweQueue, Extent {
|
||||
default void forEachTileInChunk(int cx, int cz, RunnableVal2<BlockVector3, BaseBlock> onEach) {
|
||||
int bx = cx << 4;
|
||||
int bz = cz << 4;
|
||||
MutableBlockVector mutable = new MutableBlockVector(0, 0, 0);
|
||||
MutableBlockVector3 mutable = new MutableBlockVector3(0, 0, 0);
|
||||
for (int x = 0; x < 16; x++) {
|
||||
int xx = x + bx;
|
||||
for (int z = 0; z < 16; z++) {
|
||||
@ -320,7 +320,7 @@ public interface FaweQueue extends HasFaweQueue, Extent {
|
||||
mutable.mutZ(zz);
|
||||
mutable.mutY(y);
|
||||
BaseBlock block = BaseBlock.getFromInternalId(combined, tile);
|
||||
onEach.run(mutable.toBlockVector3(), block);
|
||||
onEach.run(mutable, block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,8 +7,7 @@ import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.command.tool.brush.Brush;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableVector;
|
||||
import com.sk89q.worldedit.math.MutableVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.math.transform.AffineTransform;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
@ -72,7 +71,7 @@ public class BlobBrush implements Brush {
|
||||
double manScaleY = (1.25 + seedY * 0.5);
|
||||
double manScaleZ = (1.25 + seedZ * 0.5);
|
||||
|
||||
MutableVector mutable = new MutableVector();
|
||||
MutableVector3 mutable = new MutableVector3();
|
||||
double roughness = 1 - sphericity;
|
||||
for (int xr = -sizeInt; xr <= sizeInt; xr++) {
|
||||
mutable.mutX(xr);
|
||||
@ -80,7 +79,7 @@ public class BlobBrush implements Brush {
|
||||
mutable.mutY(yr);
|
||||
for (int zr = -sizeInt; zr <= sizeInt; zr++) {
|
||||
mutable.mutZ(zr);
|
||||
Vector3 pt = transform.apply(mutable.toVector3());
|
||||
Vector3 pt = transform.apply(mutable);
|
||||
int x = MathMan.roundInt(pt.getX());
|
||||
int y = MathMan.roundInt(pt.getY());
|
||||
int z = MathMan.roundInt(pt.getZ());
|
||||
|
@ -19,7 +19,7 @@ public class CircleBrush implements Brush {
|
||||
|
||||
@Override
|
||||
public void build(EditSession editSession, BlockVector3 position, Pattern pattern, double size) throws MaxChangedBlocksException {
|
||||
Vector3 normal = position.toVector3().subtract(player.getLocation().toVector());
|
||||
Vector3 normal = position.toVector3().subtract(player.getLocation());
|
||||
editSession.makeCircle(position, pattern, size, size, size, false, normal);
|
||||
}
|
||||
|
||||
|
@ -6,16 +6,14 @@ import com.boydti.fawe.util.TextureUtil;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.command.tool.brush.Brush;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.function.mask.SolidBlockMask;
|
||||
import com.sk89q.worldedit.function.operation.Operations;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.function.visitor.RecursiveVisitor;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableVector;
|
||||
import com.sk89q.worldedit.math.MutableVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.math.transform.AffineTransform;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
@ -89,7 +87,7 @@ public class ImageBrush implements Brush {
|
||||
AffineTransform transform = new AffineTransform().rotateY((-yaw) % 360).rotateX((pitch - 90) % 360).inverse();
|
||||
|
||||
RecursiveVisitor visitor = new RecursiveVisitor(new Mask() {
|
||||
private final MutableVector mutable = new MutableVector();
|
||||
private final MutableVector3 mutable = new MutableVector3();
|
||||
@Override
|
||||
public boolean test(BlockVector3 vector) {
|
||||
if (solid.test(vector)) {
|
||||
@ -97,11 +95,11 @@ public class ImageBrush implements Brush {
|
||||
int dy = vector.getBlockY() - cy;
|
||||
int dz = vector.getBlockZ() - cz;
|
||||
|
||||
Vector3 pos1 = transform.apply(mutable.setComponents(dx - 0.5, dy - 0.5, dz - 0.5).toVector3());
|
||||
Vector3 pos1 = transform.apply(mutable.setComponents(dx - 0.5, dy - 0.5, dz - 0.5));
|
||||
int x1 = (int) (pos1.getX() * scale + centerX);
|
||||
int z1 = (int) (pos1.getZ() * scale + centerZ);
|
||||
|
||||
Vector3 pos2 = transform.apply(mutable.setComponents(dx + 0.5, dy + 0.5, dz + 0.5).toVector3());
|
||||
Vector3 pos2 = transform.apply(mutable.setComponents(dx + 0.5, dy + 0.5, dz + 0.5));
|
||||
int x2 = (int) (pos2.getX() * scale + centerX);
|
||||
int z2 = (int) (pos2.getZ() * scale + centerZ);
|
||||
if (x2 < x1) {
|
||||
|
@ -53,9 +53,9 @@ public class InspectBrush extends BrushTool implements DoubleActionTraceTool {
|
||||
int range = this.range > -1 ? getRange() : MAX_RANGE;
|
||||
if (adjacent) {
|
||||
Location face = player.getBlockTraceFace(range, true);
|
||||
return face.toVector().add(face.getDirection());
|
||||
return face.add(face.getDirection());
|
||||
} else {
|
||||
return player.getBlockTrace(getRange(), true).toVector();
|
||||
return player.getBlockTrace(getRange(), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,6 @@ import com.boydti.fawe.object.mask.RadiusMask;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.command.tool.brush.Brush;
|
||||
import com.sk89q.worldedit.function.mask.BlockMask;
|
||||
import com.sk89q.worldedit.function.mask.BlockTypeMask;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.function.mask.SolidBlockMask;
|
||||
@ -16,8 +15,7 @@ import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.function.visitor.BreadthFirstSearch;
|
||||
import com.sk89q.worldedit.function.visitor.RecursiveVisitor;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
@ -27,7 +25,7 @@ public class LayerBrush implements Brush {
|
||||
|
||||
private final BlockStateHolder[] layers;
|
||||
private RecursiveVisitor visitor;
|
||||
private MutableBlockVector mutable = new MutableBlockVector();
|
||||
private MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
|
||||
public LayerBrush(BlockStateHolder[] layers) {
|
||||
this.layers = layers;
|
||||
@ -53,9 +51,9 @@ public class LayerBrush implements Brush {
|
||||
int previous2 = layers[depth - 2].getInternalId();
|
||||
for (BlockVector3 dir : BreadthFirstSearch.DEFAULT_DIRECTIONS) {
|
||||
mutable.setComponents(pos.getBlockX() + dir.getBlockX(), pos.getBlockY() + dir.getBlockY(), pos.getBlockZ() + dir.getBlockZ());
|
||||
if (visitor.isVisited(mutable.toBlockVector3()) && queue.getCachedCombinedId4Data(mutable.getBlockX(), mutable.getBlockY(), mutable.getBlockZ()) == previous) {
|
||||
if (visitor.isVisited(mutable) && queue.getCachedCombinedId4Data(mutable.getBlockX(), mutable.getBlockY(), mutable.getBlockZ()) == previous) {
|
||||
mutable.setComponents(pos.getBlockX() + dir.getBlockX() * 2, pos.getBlockY() + dir.getBlockY() * 2, pos.getBlockZ() + dir.getBlockZ() * 2);
|
||||
if (visitor.isVisited(mutable.toBlockVector3()) && queue.getCachedCombinedId4Data(mutable.getBlockX(), mutable.getBlockY(), mutable.getBlockZ()) == previous2) {
|
||||
if (visitor.isVisited(mutable) && queue.getCachedCombinedId4Data(mutable.getBlockX(), mutable.getBlockY(), mutable.getBlockZ()) == previous2) {
|
||||
found = true;
|
||||
break;
|
||||
} else {
|
||||
|
@ -10,10 +10,10 @@ import com.sk89q.worldedit.function.mask.Masks;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.function.visitor.BreadthFirstSearch;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
|
||||
public class ShatterBrush extends ScatterBrush {
|
||||
private final MutableBlockVector mutable = new MutableBlockVector();
|
||||
private final MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
|
||||
public ShatterBrush(int count) {
|
||||
super(count, 1);
|
||||
@ -76,8 +76,8 @@ public class ShatterBrush extends ScatterBrush {
|
||||
int dz = position.getBlockZ() - z2;
|
||||
int dSqr = (dx * dx) + (dy * dy) + (dz * dz);
|
||||
if (dSqr <= radius2) {
|
||||
MutableBlockVector v = mutable.setComponents(x2, y2, z2);
|
||||
BlockVector3 bv = v.toBlockVector3();
|
||||
MutableBlockVector3 v = mutable.setComponents(x2, y2, z2);
|
||||
BlockVector3 bv = v;
|
||||
if (surfaceTest.test(bv) && finalMask.test(bv)) {
|
||||
// (collision) If it's visited and part of another frontier, set the block
|
||||
if (!placed.add(x2, y2, z2)) {
|
||||
|
@ -17,7 +17,7 @@ import com.sk89q.worldedit.function.mask.MaskIntersection;
|
||||
import com.sk89q.worldedit.function.operation.Operations;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableVector;
|
||||
import com.sk89q.worldedit.math.MutableVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.math.interpolation.Node;
|
||||
import java.util.ArrayList;
|
||||
@ -151,13 +151,13 @@ public class SplineBrush implements Brush, ResettableTool {
|
||||
}
|
||||
|
||||
private Vector3 getCentroid(Collection<BlockVector3> points) {
|
||||
MutableVector sum = new MutableVector();
|
||||
MutableVector3 sum = new MutableVector3();
|
||||
for (BlockVector3 p : points) {
|
||||
sum.mutX(sum.getX() + p.getX());
|
||||
sum.mutY(sum.getY() + p.getY());
|
||||
sum.mutZ(sum.getZ() + p.getZ());
|
||||
}
|
||||
return sum.multiply(1.0 / points.size()).toVector3();
|
||||
return sum.multiply(1.0 / points.size());
|
||||
}
|
||||
|
||||
private BlockVector3 normal(Collection<BlockVector3> points, BlockVector3 centroid) {
|
||||
@ -179,7 +179,7 @@ public class SplineBrush implements Brush, ResettableTool {
|
||||
double yz = 0.0;
|
||||
double zz = 0.0;
|
||||
|
||||
MutableVector r = new MutableVector();
|
||||
MutableVector3 r = new MutableVector3();
|
||||
for (BlockVector3 p : points) {
|
||||
r.mutX((p.getX() - centroid.getX()));
|
||||
r.mutY((p.getY() - centroid.getY()));
|
||||
|
@ -15,8 +15,7 @@ import com.sk89q.worldedit.function.operation.Operations;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.function.visitor.RecursiveVisitor;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableVector;
|
||||
import com.sk89q.worldedit.math.MutableVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.math.transform.AffineTransform;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
@ -54,7 +53,7 @@ public class StencilBrush extends HeightBrush {
|
||||
|
||||
|
||||
Player player = editSession.getPlayer().getPlayer();
|
||||
// BlockVector3 pos = player.getLocation().toVector();
|
||||
// BlockVector3 pos = player.getLocation();
|
||||
|
||||
|
||||
|
||||
@ -65,7 +64,7 @@ public class StencilBrush extends HeightBrush {
|
||||
|
||||
|
||||
RecursiveVisitor visitor = new RecursiveVisitor(new Mask() {
|
||||
private final MutableVector mutable = new MutableVector();
|
||||
private final MutableVector3 mutable = new MutableVector3();
|
||||
@Override
|
||||
public boolean test(BlockVector3 vector) {
|
||||
if (solid.test(vector)) {
|
||||
@ -73,7 +72,7 @@ public class StencilBrush extends HeightBrush {
|
||||
int dy = vector.getBlockY() - cy;
|
||||
int dz = vector.getBlockZ() - cz;
|
||||
|
||||
Vector3 srcPos = transform.apply(mutable.setComponents(dx, dy, dz).toVector3());
|
||||
Vector3 srcPos = transform.apply(mutable.setComponents(dx, dy, dz));
|
||||
dx = MathMan.roundInt(srcPos.getX());
|
||||
dz = MathMan.roundInt(srcPos.getZ());
|
||||
|
||||
|
@ -8,7 +8,7 @@ import com.sk89q.worldedit.*;
|
||||
import com.sk89q.worldedit.command.tool.brush.Brush;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.math.interpolation.KochanekBartelsInterpolation;
|
||||
import com.sk89q.worldedit.math.interpolation.Node;
|
||||
@ -60,7 +60,7 @@ public class SurfaceSpline implements Brush {
|
||||
tipy = editSession.getNearestSurfaceTerrainBlock(tipx, tipz, tipy, 0, maxY);
|
||||
if (tipy == -1) continue;
|
||||
if (radius == 0) {
|
||||
BlockVector3 set = MutableBlockVector.get(tipx, tipy, tipz).toBlockVector3();
|
||||
BlockVector3 set = MutableBlockVector3.get(tipx, tipy, tipz);
|
||||
try {
|
||||
pattern.apply(editSession, set, set);
|
||||
} catch (WorldEditException e) {
|
||||
|
@ -4,7 +4,6 @@ import com.boydti.fawe.object.PseudoRandom;
|
||||
import com.boydti.fawe.util.MainUtil;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.convolution.GaussianKernel;
|
||||
@ -31,7 +30,7 @@ public interface HeightMap {
|
||||
int iterations = 1;
|
||||
Location min = new Location(session.getWorld(), pos.subtract(size, maxY, size).toVector3());
|
||||
BlockVector3 max = pos.add(size, maxY, size);
|
||||
Region region = new CuboidRegion(session.getWorld(), min.toVector().toBlockPoint(), max);
|
||||
Region region = new CuboidRegion(session.getWorld(), min.toBlockPoint(), max);
|
||||
com.sk89q.worldedit.math.convolution.HeightMap heightMap = new com.sk89q.worldedit.math.convolution.HeightMap(session, region, data[0], layers);
|
||||
if (smooth) {
|
||||
try {
|
||||
|
@ -1,16 +1,16 @@
|
||||
package com.boydti.fawe.object.brush.heightmap;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableVector;
|
||||
import com.sk89q.worldedit.math.MutableVector3;
|
||||
import com.sk89q.worldedit.math.transform.AffineTransform;
|
||||
|
||||
public class RotatableHeightMap extends AbstractDelegateHeightMap {
|
||||
private AffineTransform transform;
|
||||
private MutableVector mutable;
|
||||
private MutableVector3 mutable;
|
||||
|
||||
public RotatableHeightMap(HeightMap parent) {
|
||||
super(parent);
|
||||
mutable = new MutableVector();
|
||||
mutable = new MutableVector3();
|
||||
this.transform = new AffineTransform();
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ public class RotatableHeightMap extends AbstractDelegateHeightMap {
|
||||
public double getHeight(int x, int z) {
|
||||
mutable.mutX(x);
|
||||
mutable.mutZ(z);
|
||||
BlockVector3 pos = transform.apply(mutable.setComponents(x, 0, z).toVector3()).toBlockPoint();
|
||||
BlockVector3 pos = transform.apply(mutable.setComponents(x, 0, z)).toBlockPoint();
|
||||
return super.getHeight(pos.getBlockX(), pos.getBlockZ());
|
||||
}
|
||||
}
|
@ -3,10 +3,9 @@ package com.boydti.fawe.object.brush.heightmap;
|
||||
import com.boydti.fawe.object.IntegerPair;
|
||||
import com.boydti.fawe.util.MainUtil;
|
||||
import com.boydti.fawe.util.MathMan;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
@ -77,10 +76,10 @@ public class ScalableHeightMap implements com.boydti.fawe.object.brush.heightmap
|
||||
int xx = pos.getBlockX();
|
||||
int zz = pos.getBlockZ();
|
||||
int highestY = minY;
|
||||
MutableBlockVector bv = new MutableBlockVector(pos);
|
||||
MutableBlockVector3 bv = new MutableBlockVector3(pos);
|
||||
for (int y = minY; y <= maxY; y++) {
|
||||
bv.mutY(y);
|
||||
BlockStateHolder block = clipboard.getBlock(bv.toBlockVector3());
|
||||
BlockStateHolder block = clipboard.getBlock(bv);
|
||||
if (!block.getBlockType().getMaterial().isAir()) {
|
||||
highestY = y + 1;
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ import com.sk89q.worldedit.command.tool.brush.Brush;
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableVector;
|
||||
import com.sk89q.worldedit.math.MutableVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.math.interpolation.Interpolation;
|
||||
import com.sk89q.worldedit.math.interpolation.KochanekBartelsInterpolation;
|
||||
@ -95,10 +95,10 @@ public class SweepBrush implements Brush, ResettableTool {
|
||||
double blockDistance = 1d / splineLength;
|
||||
double step = blockDistance / quality;
|
||||
double accumulation = 0;
|
||||
MutableVector last = new MutableVector(0, 0, 0);
|
||||
MutableVector3 last = new MutableVector3(0, 0, 0);
|
||||
for (double pos = 0D; pos <= 1D; pos += step) {
|
||||
Vector3 gradient = interpol.get1stDerivative(pos);
|
||||
if (last == null) last = new MutableVector(interpol.get1stDerivative(pos));
|
||||
if (last == null) last = new MutableVector3(interpol.get1stDerivative(pos));
|
||||
double dist = MathMan.sqrtApprox(last.distanceSq(gradient));
|
||||
last.mutX(gradient.getX());
|
||||
last.mutY(gradient.getY());
|
||||
|
@ -3,12 +3,12 @@ package com.boydti.fawe.object.change;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.history.UndoContext;
|
||||
import com.sk89q.worldedit.history.change.Change;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2D;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
||||
|
||||
public class MutableBiomeChange implements Change {
|
||||
|
||||
private MutableBlockVector2D mutable = new MutableBlockVector2D();
|
||||
private MutableBlockVector2 mutable = new MutableBlockVector2();
|
||||
private BaseBiome from;
|
||||
private BaseBiome to;
|
||||
|
||||
@ -25,11 +25,11 @@ public class MutableBiomeChange implements Change {
|
||||
|
||||
@Override
|
||||
public void undo(UndoContext context) throws WorldEditException {
|
||||
context.getExtent().setBiome(mutable.toBlockVector2(), from);
|
||||
context.getExtent().setBiome(mutable, from);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void redo(UndoContext context) throws WorldEditException {
|
||||
context.getExtent().setBiome(mutable.toBlockVector2(), to);
|
||||
context.getExtent().setBiome(mutable, to);
|
||||
}
|
||||
}
|
||||
|
@ -1,21 +1,19 @@
|
||||
package com.boydti.fawe.object.clipboard;
|
||||
|
||||
import com.boydti.fawe.util.ReflectionUtils;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.jnbt.IntTag;
|
||||
import com.sk89q.jnbt.Tag;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.entity.Entity;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
import com.sk89q.worldedit.function.operation.Operations;
|
||||
import com.sk89q.worldedit.function.visitor.RegionVisitor;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2D;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
||||
@ -29,7 +27,7 @@ public class WorldCopyClipboard extends ReadOnlyClipboard {
|
||||
public final int mx, my, mz;
|
||||
private final boolean hasBiomes;
|
||||
private final boolean hasEntities;
|
||||
private MutableBlockVector2D mutableBlockVector2D = new MutableBlockVector2D();
|
||||
private MutableBlockVector2 MutableBlockVector2 = new MutableBlockVector2();
|
||||
public final Extent extent;
|
||||
|
||||
public WorldCopyClipboard(Extent editSession, Region region) {
|
||||
@ -58,7 +56,7 @@ public class WorldCopyClipboard extends ReadOnlyClipboard {
|
||||
|
||||
@Override
|
||||
public BaseBiome getBiome(int x, int z) {
|
||||
return extent.getBiome(mutableBlockVector2D.setComponents(mx + x, mz + z).toBlockVector2());
|
||||
return extent.getBiome(MutableBlockVector2.setComponents(mx + x, mz + z));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -76,7 +74,7 @@ public class WorldCopyClipboard extends ReadOnlyClipboard {
|
||||
public void forEach(BlockReader task, boolean air) {
|
||||
BlockVector3 min = region.getMinimumPoint();
|
||||
BlockVector3 max = region.getMaximumPoint();
|
||||
MutableBlockVector pos = new MutableBlockVector();
|
||||
MutableBlockVector3 pos = new MutableBlockVector3();
|
||||
if (region instanceof CuboidRegion) {
|
||||
if (air) {
|
||||
((CuboidRegion) region).setUseOldIterator(true);
|
||||
@ -137,9 +135,9 @@ public class WorldCopyClipboard extends ReadOnlyClipboard {
|
||||
for (int x = min.getBlockX(); x <= max.getBlockX(); x++) {
|
||||
pos.mutX(x);
|
||||
int xx = pos.getBlockX() - mx;
|
||||
if (region.contains(pos.toBlockVector3())) {
|
||||
if (region.contains(pos)) {
|
||||
// BlockState block = getBlockAbs(x, y, z);
|
||||
BaseBlock block = extent.getFullBlock(pos.toBlockVector3());
|
||||
BaseBlock block = extent.getFullBlock(pos);
|
||||
if (!air && block.getBlockType().getMaterial().isAir()) {
|
||||
continue;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package com.boydti.fawe.object.collection;
|
||||
|
||||
import com.boydti.fawe.util.MathMan;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
@ -43,14 +43,14 @@ public class BlockVectorSet extends AbstractCollection<BlockVector3> implements
|
||||
int newSize = count + size;
|
||||
if (newSize > index) {
|
||||
int localIndex = index - count;
|
||||
MutableBlockVector pos = new MutableBlockVector(set.getIndex(localIndex));
|
||||
MutableBlockVector3 pos = new MutableBlockVector3(set.getIndex(localIndex));
|
||||
if (pos != null) {
|
||||
int pair = entry.getIntKey();
|
||||
int cx = MathMan.unpairX(pair);
|
||||
int cz = MathMan.unpairY(pair);
|
||||
pos.mutX((cx << 11) + pos.getBlockX());
|
||||
pos.mutZ((cz << 11) + pos.getBlockZ());
|
||||
return pos.toBlockVector3();
|
||||
return pos;
|
||||
}
|
||||
}
|
||||
count += newSize;
|
||||
@ -92,7 +92,7 @@ public class BlockVectorSet extends AbstractCollection<BlockVector3> implements
|
||||
return new Iterator<BlockVector3>() {
|
||||
Int2ObjectMap.Entry<LocalBlockVectorSet> entry = entries.next();
|
||||
Iterator<BlockVector3> entryIter = entry.getValue().iterator();
|
||||
MutableBlockVector mutable = new MutableBlockVector();
|
||||
MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
@ -117,7 +117,7 @@ public class BlockVectorSet extends AbstractCollection<BlockVector3> implements
|
||||
int pair = entry.getIntKey();
|
||||
int cx = MathMan.unpairX(pair);
|
||||
int cz = MathMan.unpairY(pair);
|
||||
return mutable.setComponents((cx << 11) + localPos.getBlockX(), localPos.getBlockY(), (cz << 11) + localPos.getBlockZ()).toBlockVector3();
|
||||
return mutable.setComponents((cx << 11) + localPos.getBlockX(), localPos.getBlockY(), (cz << 11) + localPos.getBlockZ());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package com.boydti.fawe.object.collection;
|
||||
|
||||
import com.boydti.fawe.util.MathMan;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2D;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
@ -15,7 +15,7 @@ import java.util.Set;
|
||||
*/
|
||||
public class LocalBlockVector2DSet implements Set<BlockVector2> {
|
||||
private final SparseBitSet set;
|
||||
private final MutableBlockVector2D mutable = new MutableBlockVector2D();
|
||||
private final MutableBlockVector2 mutable = new MutableBlockVector2();
|
||||
|
||||
public LocalBlockVector2DSet() {
|
||||
this.set = new SparseBitSet();
|
||||
@ -102,7 +102,7 @@ public class LocalBlockVector2DSet implements Set<BlockVector2> {
|
||||
if (index != -1) {
|
||||
int x = MathMan.unpairSearchCoordsX(index);
|
||||
int y = MathMan.unpairSearchCoordsY(index);
|
||||
return mutable.setComponents(x, y).toBlockVector2();
|
||||
return mutable.setComponents(x, y);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -131,7 +131,7 @@ public class LocalBlockVector2DSet implements Set<BlockVector2> {
|
||||
mutable.setComponents(x, y);
|
||||
previous = index;
|
||||
index = set.nextSetBit(index + 1);
|
||||
return mutable.toBlockVector2();
|
||||
return mutable;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package com.boydti.fawe.object.collection;
|
||||
|
||||
import com.boydti.fawe.util.MathMan;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
@ -117,7 +117,7 @@ public class LocalBlockVectorSet implements Set<BlockVector3> {
|
||||
int x = offsetX + (((b3 + ((MathMan.unpair8x(b2)) << 8)) << 21) >> 21);
|
||||
int y = b1;
|
||||
int z = offsetZ + (((b4 + ((MathMan.unpair8y(b2)) << 8)) << 21) >> 21);
|
||||
return MutableBlockVector.get(x, y, z).toBlockVector3();
|
||||
return MutableBlockVector3.get(x, y, z);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -127,7 +127,7 @@ public class LocalBlockVectorSet implements Set<BlockVector3> {
|
||||
return new Iterator<BlockVector3>() {
|
||||
int index = set.nextSetBit(0);
|
||||
int previous = -1;
|
||||
MutableBlockVector mutable = new MutableBlockVector(0, 0, 0);
|
||||
MutableBlockVector3 mutable = new MutableBlockVector3(0, 0, 0);
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
@ -151,7 +151,7 @@ public class LocalBlockVectorSet implements Set<BlockVector3> {
|
||||
mutable.mutZ(offsetZ + (((b4 + ((MathMan.unpair8y(b2)) << 8)) << 21) >> 21));
|
||||
previous = index;
|
||||
index = set.nextSetBit(index + 1);
|
||||
return mutable.toBlockVector3();
|
||||
return mutable;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -280,7 +280,7 @@ public class LocalBlockVectorSet implements Set<BlockVector3> {
|
||||
boolean result = false;
|
||||
int size = size();
|
||||
int index = -1;
|
||||
MutableBlockVector mVec = MutableBlockVector.get(0, 0, 0);
|
||||
MutableBlockVector3 mVec = MutableBlockVector3.get(0, 0, 0);
|
||||
for (int i = 0; i < size; i++) {
|
||||
index = set.nextSetBit(index + 1);
|
||||
int b1 = (index & 0xFF);
|
||||
@ -310,7 +310,7 @@ public class LocalBlockVectorSet implements Set<BlockVector3> {
|
||||
public void forEach(BlockVectorSetVisitor visitor) {
|
||||
int size = size();
|
||||
int index = -1;
|
||||
BlockVector3 mVec = MutableBlockVector.get(0, 0, 0).toBlockVector3();
|
||||
BlockVector3 mVec = MutableBlockVector3.get(0, 0, 0);
|
||||
for (int i = 0; i < size; i++) {
|
||||
index = set.nextSetBit(index + 1);
|
||||
int b1 = (index & 0xFF);
|
||||
|
@ -7,14 +7,13 @@ import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
public class BlockTranslateExtent extends AbstractDelegateExtent {
|
||||
private final int dx, dy, dz;
|
||||
private MutableBlockVector mutable = new MutableBlockVector();
|
||||
private MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
|
||||
public BlockTranslateExtent(Extent extent, int dx, int dy, int dz) {
|
||||
super(extent);
|
||||
@ -28,7 +27,7 @@ public class BlockTranslateExtent extends AbstractDelegateExtent {
|
||||
mutable.mutX((location.getX() + dx));
|
||||
mutable.mutY((location.getY() + dy));
|
||||
mutable.mutZ((location.getZ() + dz));
|
||||
return getExtent().setBlock(mutable.toBlockVector3(), block);
|
||||
return getExtent().setBlock(mutable, block);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,17 +1,16 @@
|
||||
package com.boydti.fawe.object.extent;
|
||||
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2D;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
public class OffsetExtent extends ResettableExtent {
|
||||
private final int dx, dy, dz;
|
||||
private transient MutableBlockVector2D mutable = new MutableBlockVector2D();
|
||||
private transient MutableBlockVector2 mutable = new MutableBlockVector2();
|
||||
|
||||
public OffsetExtent(Extent parent, int dx, int dy, int dz) {
|
||||
super(parent);
|
||||
@ -22,7 +21,7 @@ public class OffsetExtent extends ResettableExtent {
|
||||
|
||||
@Override
|
||||
public boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
||||
return getExtent().setBiome(mutable.setComponents(position.getBlockX() + dx, position.getBlockZ() + dz).toBlockVector2(), biome);
|
||||
return getExtent().setBiome(mutable.setComponents(position.getBlockX() + dx, position.getBlockZ() + dz), biome);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -42,7 +41,7 @@ public class OffsetExtent extends ResettableExtent {
|
||||
|
||||
@Override
|
||||
public ResettableExtent setExtent(Extent extent) {
|
||||
mutable = new MutableBlockVector2D();
|
||||
mutable = new MutableBlockVector2();
|
||||
return super.setExtent(extent);
|
||||
}
|
||||
}
|
||||
|
@ -6,16 +6,15 @@ import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableVector;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableVector3;
|
||||
import com.sk89q.worldedit.math.transform.Transform;
|
||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
public class PositionTransformExtent extends ResettableExtent {
|
||||
|
||||
private transient MutableBlockVector mutable = new MutableBlockVector();
|
||||
private transient MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
private transient BlockVector3 min;
|
||||
private Transform transform;
|
||||
|
||||
@ -26,7 +25,7 @@ public class PositionTransformExtent extends ResettableExtent {
|
||||
|
||||
@Override
|
||||
public ResettableExtent setExtent(Extent extent) {
|
||||
mutable = new MutableBlockVector();
|
||||
mutable = new MutableBlockVector3();
|
||||
min = null;
|
||||
return super.setExtent(extent);
|
||||
}
|
||||
@ -42,7 +41,7 @@ public class PositionTransformExtent extends ResettableExtent {
|
||||
mutable.mutX(((pos.getX() - min.getX())));
|
||||
mutable.mutY(((pos.getY() - min.getY())));
|
||||
mutable.mutZ(((pos.getZ() - min.getZ())));
|
||||
MutableVector tmp = new MutableVector(transform.apply(mutable.toVector3()));
|
||||
MutableVector3 tmp = new MutableVector3(transform.apply(mutable.toVector3()));
|
||||
BlockVector3 result = min.add(tmp.toBlockPoint());
|
||||
return result;
|
||||
}
|
||||
@ -72,7 +71,7 @@ public class PositionTransformExtent extends ResettableExtent {
|
||||
mutable.mutX(position.getBlockX());
|
||||
mutable.mutZ(position.getBlockZ());
|
||||
mutable.mutY(0);
|
||||
return super.getBiome(getPos(mutable.toBlockVector3()).toBlockVector2());
|
||||
return super.getBiome(getPos(mutable).toBlockVector2());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -91,7 +90,7 @@ public class PositionTransformExtent extends ResettableExtent {
|
||||
mutable.mutX(position.getBlockX());
|
||||
mutable.mutZ(position.getBlockZ());
|
||||
mutable.mutY(0);
|
||||
return super.setBiome(getPos(mutable.toBlockVector3()).toBlockVector2(), biome);
|
||||
return super.setBiome(getPos(mutable).toBlockVector2(), biome);
|
||||
}
|
||||
|
||||
public void setTransform(Transform transform) {
|
||||
|
@ -2,11 +2,10 @@ package com.boydti.fawe.object.extent;
|
||||
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2D;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
@ -14,7 +13,7 @@ import java.util.SplittableRandom;
|
||||
|
||||
public class RandomOffsetTransform extends ResettableExtent {
|
||||
private transient SplittableRandom random;
|
||||
private transient MutableBlockVector2D mutable = new MutableBlockVector2D();
|
||||
private transient MutableBlockVector2 mutable = new MutableBlockVector2();
|
||||
|
||||
private final int dx, dy, dz;
|
||||
|
||||
@ -30,7 +29,7 @@ public class RandomOffsetTransform extends ResettableExtent {
|
||||
public boolean setBiome(BlockVector2 pos, BaseBiome biome) {
|
||||
int x = pos.getBlockX() + random.nextInt(1 + (dx << 1)) - dx;
|
||||
int z = pos.getBlockZ() + random.nextInt(1 + (dz << 1)) - dz;
|
||||
return getExtent().setBiome(mutable.setComponents(x, z).toBlockVector2(), biome);
|
||||
return getExtent().setBiome(mutable.setComponents(x, z), biome);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -52,7 +51,7 @@ public class RandomOffsetTransform extends ResettableExtent {
|
||||
@Override
|
||||
public ResettableExtent setExtent(Extent extent) {
|
||||
random = new SplittableRandom();
|
||||
mutable = new MutableBlockVector2D();
|
||||
mutable = new MutableBlockVector2();
|
||||
return super.setExtent(extent);
|
||||
}
|
||||
}
|
||||
|
@ -2,13 +2,12 @@ package com.boydti.fawe.object.extent;
|
||||
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
|
||||
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;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
@ -16,7 +15,7 @@ import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ScaleTransform extends ResettableExtent {
|
||||
private transient MutableBlockVector mutable = new MutableBlockVector();
|
||||
private transient MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
private transient int maxy;
|
||||
private transient BlockVector3 min;
|
||||
|
||||
@ -35,7 +34,7 @@ public class ScaleTransform extends ResettableExtent {
|
||||
public ResettableExtent setExtent(Extent extent) {
|
||||
min = null;
|
||||
maxy = extent.getMaximumPoint().getBlockY();
|
||||
mutable = new MutableBlockVector();
|
||||
mutable = new MutableBlockVector3();
|
||||
return super.setExtent(extent);
|
||||
}
|
||||
|
||||
@ -46,7 +45,7 @@ public class ScaleTransform extends ResettableExtent {
|
||||
mutable.mutX((min.getX() + (pos.getX() - min.getX()) * dx));
|
||||
mutable.mutY((min.getY() + (pos.getY() - min.getY()) * dy));
|
||||
mutable.mutZ((min.getZ() + (pos.getZ() - min.getZ()) * dz));
|
||||
return mutable.toBlockVector3();
|
||||
return mutable;
|
||||
}
|
||||
|
||||
private BlockVector3 getPos(int x, int y, int z) {
|
||||
@ -56,14 +55,14 @@ public class ScaleTransform extends ResettableExtent {
|
||||
mutable.mutX((min.getX() + (x - min.getX()) * dx));
|
||||
mutable.mutY((min.getY() + (y - min.getY()) * dy));
|
||||
mutable.mutZ((min.getZ() + (z - min.getZ()) * dz));
|
||||
return mutable.toBlockVector3();
|
||||
return mutable;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean setBlock(BlockVector3 location, BlockStateHolder block) throws WorldEditException {
|
||||
boolean result = false;
|
||||
MutableBlockVector pos = new MutableBlockVector(getPos(location));
|
||||
MutableBlockVector3 pos = new MutableBlockVector3(getPos(location));
|
||||
double sx = pos.getX();
|
||||
double sy = pos.getY();
|
||||
double sz = pos.getZ();
|
||||
@ -73,7 +72,7 @@ public class ScaleTransform extends ResettableExtent {
|
||||
for (pos.mutY(sy); pos.getY() < ey; pos.mutY(pos.getY() + 1)) {
|
||||
for (pos.mutZ(sz); pos.getZ() < ez; pos.mutZ(pos.getZ() + 1)) {
|
||||
for (pos.mutX(sx); pos.getX() < ex; pos.mutX(pos.getX() + 1)) {
|
||||
result |= super.setBlock(pos.toBlockVector3(), block);
|
||||
result |= super.setBlock(pos, block);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -83,7 +82,7 @@ public class ScaleTransform extends ResettableExtent {
|
||||
@Override
|
||||
public boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
||||
boolean result = false;
|
||||
MutableBlockVector pos = new MutableBlockVector(getPos(position.getBlockX(), 0, position.getBlockZ()));
|
||||
MutableBlockVector3 pos = new MutableBlockVector3(getPos(position.getBlockX(), 0, position.getBlockZ()));
|
||||
double sx = pos.getX();
|
||||
double sz = pos.getZ();
|
||||
double ex = pos.getX() + dx;
|
||||
@ -99,7 +98,7 @@ public class ScaleTransform extends ResettableExtent {
|
||||
@Override
|
||||
public boolean setBlock(int x1, int y1, int z1, BlockStateHolder block) throws WorldEditException {
|
||||
boolean result = false;
|
||||
MutableBlockVector pos = new MutableBlockVector(getPos(x1, y1, z1));
|
||||
MutableBlockVector3 pos = new MutableBlockVector3(getPos(x1, y1, z1));
|
||||
double sx = pos.getX();
|
||||
double sy = pos.getY();
|
||||
double sz = pos.getZ();
|
||||
@ -109,7 +108,7 @@ public class ScaleTransform extends ResettableExtent {
|
||||
for (pos.mutY(sy); pos.getY() < ey; pos.mutY(pos.getY() + 1)) {
|
||||
for (pos.mutZ(sz); pos.getZ() < ez; pos.mutZ(pos.getZ() + 1)) {
|
||||
for (pos.mutX(sx); pos.getX() < ex; pos.mutX(pos.getX() + 1)) {
|
||||
result |= super.setBlock(pos.toBlockVector3(), block);
|
||||
result |= super.setBlock(pos, block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,11 +2,10 @@ package com.boydti.fawe.object.extent;
|
||||
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
|
||||
@ -14,7 +13,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public class SourceMaskExtent extends TemporalExtent {
|
||||
private Mask mask;
|
||||
private MutableBlockVector mutable = new MutableBlockVector();
|
||||
private MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
|
||||
|
||||
/**
|
||||
@ -54,6 +53,6 @@ public class SourceMaskExtent extends TemporalExtent {
|
||||
mutable.mutX(x);
|
||||
mutable.mutY(y);
|
||||
mutable.mutZ(z);
|
||||
return mask.test(mutable.toBlockVector3()) && super.setBlock(x, y, z, block);
|
||||
return mask.test(mutable) && super.setBlock(x, y, z, block);
|
||||
}
|
||||
}
|
||||
|
@ -7,16 +7,14 @@ import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.extent.transform.BlockTransformExtent;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableVector3;
|
||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.registry.BlockRegistry;
|
||||
|
||||
public class TransformExtent extends BlockTransformExtent {
|
||||
|
||||
private final MutableBlockVector mutable = new MutableBlockVector();
|
||||
private final MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
private BlockVector3 min;
|
||||
private int maxy;
|
||||
|
||||
@ -58,7 +56,7 @@ public class TransformExtent extends BlockTransformExtent {
|
||||
mutable.mutX(((pos.getX() - min.getX())));
|
||||
mutable.mutY(((pos.getY() - min.getY())));
|
||||
mutable.mutZ(((pos.getZ() - min.getZ())));
|
||||
MutableVector tmp = new MutableVector(getTransform().apply(mutable.toVector3()));
|
||||
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()));
|
||||
@ -72,7 +70,7 @@ public class TransformExtent extends BlockTransformExtent {
|
||||
mutable.mutX(((x - min.getX())));
|
||||
mutable.mutY(((y - min.getY())));
|
||||
mutable.mutZ(((z - min.getZ())));
|
||||
MutableVector tmp = new MutableVector(getTransform().apply(mutable.toVector3()));
|
||||
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()));
|
||||
@ -104,7 +102,7 @@ public class TransformExtent extends BlockTransformExtent {
|
||||
mutable.mutX(position.getBlockX());
|
||||
mutable.mutZ(position.getBlockZ());
|
||||
mutable.mutY(0);
|
||||
return super.getBiome(getPos(mutable.toBlockVector3()).toBlockVector2());
|
||||
return super.getBiome(getPos(mutable).toBlockVector2());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -123,6 +121,6 @@ public class TransformExtent extends BlockTransformExtent {
|
||||
mutable.mutX(position.getBlockX());
|
||||
mutable.mutZ(position.getBlockZ());
|
||||
mutable.mutY(0);
|
||||
return super.setBiome(getPos(mutable.toBlockVector3()).toBlockVector2(), biome);
|
||||
return super.setBiome(getPos(mutable).toBlockVector2(), biome);
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.FlatRegionFunction;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
|
||||
public class SurfaceRegionFunction implements FlatRegionFunction {
|
||||
private final Extent extent;
|
||||
@ -13,7 +13,7 @@ public class SurfaceRegionFunction implements FlatRegionFunction {
|
||||
private final int minY;
|
||||
private final int maxY;
|
||||
private int lastY;
|
||||
private MutableBlockVector mutable = new MutableBlockVector();
|
||||
private MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
|
||||
public SurfaceRegionFunction(Extent extent, RegionFunction function, int minY, int maxY) {
|
||||
this.extent = extent;
|
||||
@ -30,7 +30,7 @@ public class SurfaceRegionFunction implements FlatRegionFunction {
|
||||
int layer = extent.getNearestSurfaceTerrainBlock(x, z, lastY, minY, maxY, false);
|
||||
if (layer != -1) {
|
||||
lastY = layer;
|
||||
return function.apply(mutable.setComponents(x, layer, z).toBlockVector3());
|
||||
return function.apply(mutable.setComponents(x, layer, z));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -5,17 +5,17 @@ import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2D;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||
|
||||
public class BiomeCopy implements RegionFunction {
|
||||
protected final Extent source;
|
||||
protected final Extent destination;
|
||||
private final MutableBlockVector2D mPos2d;
|
||||
private final MutableBlockVector2 mPos2d;
|
||||
|
||||
public BiomeCopy(Extent source, Extent destination) {
|
||||
this.source = source;
|
||||
this.destination = destination;
|
||||
this.mPos2d = new MutableBlockVector2D();
|
||||
this.mPos2d = new MutableBlockVector2();
|
||||
this.mPos2d.setComponents(Integer.MIN_VALUE, Integer.MIN_VALUE);
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ public class BiomeCopy implements RegionFunction {
|
||||
int z = position.getBlockZ();
|
||||
if (x != mPos2d.getBlockX() || z != mPos2d.getBlockZ()) {
|
||||
mPos2d.setComponents(x, z);
|
||||
BlockVector2 bv = mPos2d.toBlockVector2();
|
||||
BlockVector2 bv = mPos2d;
|
||||
return destination.setBiome( bv, source.getBiome(bv));
|
||||
}
|
||||
return false;
|
||||
|
@ -3,7 +3,7 @@ package com.boydti.fawe.object.mask;
|
||||
import com.sk89q.worldedit.function.mask.AbstractMask;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
|
||||
/**
|
||||
* Just an optimized version of the Adjacent Mask for single adjacency
|
||||
@ -11,16 +11,16 @@ import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
public class AdjacentAnyMask extends AbstractMask implements ResettableMask {
|
||||
|
||||
private final CachedMask mask;
|
||||
private transient MutableBlockVector mutable = new MutableBlockVector();
|
||||
private transient MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
|
||||
public AdjacentAnyMask(Mask mask) {
|
||||
this.mask = CachedMask.cache(mask);
|
||||
mutable = new MutableBlockVector();
|
||||
mutable = new MutableBlockVector3();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
mutable = new MutableBlockVector();
|
||||
mutable = new MutableBlockVector3();
|
||||
}
|
||||
|
||||
public CachedMask getParentMask() {
|
||||
@ -75,6 +75,6 @@ public class AdjacentAnyMask extends AbstractMask implements ResettableMask {
|
||||
if (y > 0 && mask.test(x, y - 1, z)) {
|
||||
mutable.setComponents(0, -1, 0);
|
||||
}
|
||||
return (mutable.getX() == 0 && mutable.getY() == 0 && mutable.getZ() == 0) ? null : mutable.toBlockVector3();
|
||||
return (mutable.getX() == 0 && mutable.getY() == 0 && mutable.getZ() == 0) ? null : mutable;
|
||||
}
|
||||
}
|
@ -3,18 +3,18 @@ package com.boydti.fawe.object.mask;
|
||||
import com.sk89q.worldedit.function.mask.AbstractMask;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
|
||||
public class AdjacentMask extends AbstractMask {
|
||||
private final int min, max;
|
||||
private final Mask mask;
|
||||
private MutableBlockVector v;
|
||||
private MutableBlockVector3 v;
|
||||
|
||||
public AdjacentMask(Mask mask, int requiredMin, int requiredMax) {
|
||||
this.mask = mask;
|
||||
this.min = requiredMin;
|
||||
this.max = requiredMax;
|
||||
this.v = new MutableBlockVector();
|
||||
this.v = new MutableBlockVector3();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -25,34 +25,34 @@ public class AdjacentMask extends AbstractMask {
|
||||
double y = bv.getY();
|
||||
double z = bv.getZ();
|
||||
v.mutX(x + 1);
|
||||
if (mask.test(v.toBlockVector3()) && ++count == min && max >= 8) {
|
||||
if (mask.test(v) && ++count == min && max >= 8) {
|
||||
v.mutX(x);
|
||||
return true;
|
||||
}
|
||||
v.mutX(x - 1);
|
||||
if (mask.test(v.toBlockVector3()) && ++count == min && max >= 8) {
|
||||
if (mask.test(v) && ++count == min && max >= 8) {
|
||||
v.mutX(x);
|
||||
return true;
|
||||
}
|
||||
v.mutX(x);
|
||||
v.mutY(y + 1);
|
||||
if (mask.test(v.toBlockVector3()) && ++count == min && max >= 8) {
|
||||
if (mask.test(v) && ++count == min && max >= 8) {
|
||||
v.mutY(y);
|
||||
return true;
|
||||
}
|
||||
v.mutY(y - 1);
|
||||
if (mask.test(v.toBlockVector3()) && ++count == min && max >= 8) {
|
||||
if (mask.test(v) && ++count == min && max >= 8) {
|
||||
v.mutY(y);
|
||||
return true;
|
||||
}
|
||||
v.mutY(y);
|
||||
v.mutZ(z + 1);
|
||||
if (mask.test(v.toBlockVector3()) && ++count == min && max >= 8) {
|
||||
if (mask.test(v) && ++count == min && max >= 8) {
|
||||
v.mutZ(z);
|
||||
return true;
|
||||
}
|
||||
v.mutZ(z - 1);
|
||||
if (mask.test(v.toBlockVector3()) && ++count == min && max >= 8) {
|
||||
if (mask.test(v) && ++count == min && max >= 8) {
|
||||
v.mutZ(z);
|
||||
return true;
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.mask.Mask2D;
|
||||
import com.sk89q.worldedit.function.mask.SolidBlockMask;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
|
||||
import java.util.Arrays;
|
||||
import javax.annotation.Nullable;
|
||||
@ -21,7 +21,7 @@ public class AngleMask extends SolidBlockMask implements ResettableMask {
|
||||
protected final int maxY;
|
||||
protected final int distance;
|
||||
|
||||
protected transient MutableBlockVector mutable = new MutableBlockVector();
|
||||
protected transient MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
|
||||
public AngleMask(Extent extent, double min, double max, boolean overlay, int distance) {
|
||||
super(extent);
|
||||
@ -36,7 +36,7 @@ public class AngleMask extends SolidBlockMask implements ResettableMask {
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
mutable = new MutableBlockVector();
|
||||
mutable = new MutableBlockVector3();
|
||||
cacheBotX = Integer.MIN_VALUE;
|
||||
cacheBotZ = Integer.MIN_VALUE;
|
||||
lastX = Integer.MIN_VALUE;
|
||||
|
@ -4,12 +4,12 @@ import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.mask.AbstractExtentMask;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2D;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
||||
|
||||
public class BiomeMask extends AbstractExtentMask implements ResettableMask {
|
||||
private final BaseBiome biome;
|
||||
private transient MutableBlockVector2D mutable = new MutableBlockVector2D();
|
||||
private transient MutableBlockVector2 mutable = new MutableBlockVector2();
|
||||
|
||||
public BiomeMask(Extent extent, BaseBiome biome) {
|
||||
super(extent);
|
||||
@ -18,12 +18,12 @@ public class BiomeMask extends AbstractExtentMask implements ResettableMask {
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
mutable = new MutableBlockVector2D();
|
||||
mutable = new MutableBlockVector2();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(BlockVector3 vector) {
|
||||
BlockVector2 pos = mutable.setComponents(vector.getBlockX(), vector.getBlockZ()).toBlockVector2();
|
||||
BlockVector2 pos = mutable.setComponents(vector.getBlockX(), vector.getBlockZ());
|
||||
return getExtent().getBiome(pos).getId() == biome.getId();
|
||||
}
|
||||
}
|
||||
|
@ -4,11 +4,11 @@ import com.boydti.fawe.object.collection.LocalBlockVectorSet;
|
||||
import com.boydti.fawe.object.function.mask.AbstractDelegateMask;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
|
||||
public class CachedMask extends AbstractDelegateMask implements ResettableMask {
|
||||
|
||||
private transient MutableBlockVector mutable = new MutableBlockVector();
|
||||
private transient MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
private transient LocalBlockVectorSet cache_checked = new LocalBlockVectorSet();
|
||||
private transient LocalBlockVectorSet cache_results = new LocalBlockVectorSet();
|
||||
|
||||
@ -27,7 +27,7 @@ public class CachedMask extends AbstractDelegateMask implements ResettableMask {
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
mutable = new MutableBlockVector();
|
||||
mutable = new MutableBlockVector3();
|
||||
cache_checked = new LocalBlockVectorSet();
|
||||
cache_results = new LocalBlockVectorSet();
|
||||
resetCache();
|
||||
@ -51,11 +51,11 @@ public class CachedMask extends AbstractDelegateMask implements ResettableMask {
|
||||
if (!check) {
|
||||
return cache_results.contains(x, y, z);
|
||||
}
|
||||
boolean result = getMask().test(mutable.setComponents(x, y, z).toBlockVector3());
|
||||
boolean result = getMask().test(mutable.setComponents(x, y, z));
|
||||
if (result) cache_results.add(x, y, z);
|
||||
return result;
|
||||
} catch (UnsupportedOperationException ignore) {
|
||||
boolean result = getMask().test(mutable.setComponents(x, y, z).toBlockVector3());
|
||||
boolean result = getMask().test(mutable.setComponents(x, y, z));
|
||||
if (y < 0 || y > 255) return result;
|
||||
resetCache();
|
||||
cache_checked.setOffset(x, z);
|
||||
|
@ -21,7 +21,7 @@ public class MaskedTargetBlock extends TargetBlock {
|
||||
Location lastBlock = null;
|
||||
while (getNextBlock() != null) {
|
||||
Location current = getCurrentBlock();
|
||||
if (!mask.test(current.toVector().toBlockPoint())) {
|
||||
if (!mask.test(current.toBlockPoint())) {
|
||||
if (searchForLastBlock) {
|
||||
lastBlock = current;
|
||||
if (lastBlock.getBlockY() <= 0 || lastBlock.getBlockY() >= world.getMaxY()) {
|
||||
|
@ -4,7 +4,7 @@ import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.mask.Mask2D;
|
||||
import com.sk89q.worldedit.function.mask.SolidBlockMask;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@ -14,7 +14,7 @@ import javax.annotation.Nullable;
|
||||
public class SolidPlaneMask extends SolidBlockMask implements ResettableMask {
|
||||
|
||||
private transient int mode = -1;
|
||||
private transient MutableBlockVector mutable = new MutableBlockVector();
|
||||
private transient MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
|
||||
private int originX = Integer.MAX_VALUE, originY = Integer.MAX_VALUE, originZ = Integer.MAX_VALUE;
|
||||
|
||||
@ -34,13 +34,13 @@ public class SolidPlaneMask extends SolidBlockMask implements ResettableMask {
|
||||
originZ = vector.getBlockZ();
|
||||
mode = 0;
|
||||
Extent extent = getExtent();
|
||||
if (!extent.getBlockType(mutable.setComponents(originX - 1, originY, originZ).toBlockVector3()).getMaterial().isAir() && !extent.getBlockType(mutable.setComponents(originX + 1, originY, originZ).toBlockVector3()).getMaterial().isAir()) {
|
||||
if (!extent.getBlockType(mutable.setComponents(originX - 1, originY, originZ)).getMaterial().isAir() && !extent.getBlockType(mutable.setComponents(originX + 1, originY, originZ)).getMaterial().isAir()) {
|
||||
mode &= 1;
|
||||
}
|
||||
if (!extent.getBlockType(mutable.setComponents(originX, originY, originZ - 1).toBlockVector3()).getMaterial().isAir() && !extent.getBlockType(mutable.setComponents(originX, originY, originZ + 1).toBlockVector3()).getMaterial().isAir()) {
|
||||
if (!extent.getBlockType(mutable.setComponents(originX, originY, originZ - 1)).getMaterial().isAir() && !extent.getBlockType(mutable.setComponents(originX, originY, originZ + 1)).getMaterial().isAir()) {
|
||||
mode &= 4;
|
||||
}
|
||||
if (!extent.getBlockType(mutable.setComponents(originX, originY - 1, originZ + 1).toBlockVector3()).getMaterial().isAir() && !extent.getBlockType(mutable.setComponents(originX, originY + 1, originZ + 1).toBlockVector3()).getMaterial().isAir()) {
|
||||
if (!extent.getBlockType(mutable.setComponents(originX, originY - 1, originZ + 1)).getMaterial().isAir() && !extent.getBlockType(mutable.setComponents(originX, originY + 1, originZ + 1)).getMaterial().isAir()) {
|
||||
mode &= 2;
|
||||
}
|
||||
if (Integer.bitCount(mode) >= 3) {
|
||||
@ -85,7 +85,7 @@ public class SolidPlaneMask extends SolidBlockMask implements ResettableMask {
|
||||
@Override
|
||||
public void reset() {
|
||||
mode = -1;
|
||||
mutable = new MutableBlockVector();
|
||||
mutable = new MutableBlockVector3();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
@ -3,18 +3,18 @@ package com.boydti.fawe.object.mask;
|
||||
import com.sk89q.worldedit.function.mask.AbstractMask;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
|
||||
public class WallMask extends AbstractMask {
|
||||
private final int min, max;
|
||||
private final Mask mask;
|
||||
private MutableBlockVector v;
|
||||
private MutableBlockVector3 v;
|
||||
|
||||
public WallMask(Mask mask, int requiredMin, int requiredMax) {
|
||||
this.mask = mask;
|
||||
this.min = requiredMin;
|
||||
this.max = requiredMax;
|
||||
this.v = new MutableBlockVector();
|
||||
this.v = new MutableBlockVector3();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -25,23 +25,23 @@ public class WallMask extends AbstractMask {
|
||||
double y = v.getY();
|
||||
double z = v.getZ();
|
||||
v.mutX(x + 1);
|
||||
if (mask.test(v.toBlockVector3()) && ++count == min && max >= 8) {
|
||||
if (mask.test(v) && ++count == min && max >= 8) {
|
||||
v.mutX(x);
|
||||
return true;
|
||||
}
|
||||
v.mutX(x - 1);
|
||||
if (mask.test(v.toBlockVector3()) && ++count == min && max >= 8) {
|
||||
if (mask.test(v) && ++count == min && max >= 8) {
|
||||
v.mutX(x);
|
||||
return true;
|
||||
}
|
||||
v.mutX(x);
|
||||
v.mutZ(z + 1);
|
||||
if (mask.test(v.toBlockVector3()) && ++count == min && max >= 8) {
|
||||
if (mask.test(v) && ++count == min && max >= 8) {
|
||||
v.mutZ(z);
|
||||
return true;
|
||||
}
|
||||
v.mutZ(z - 1);
|
||||
if (mask.test(v.toBlockVector3()) && ++count == min && max >= 8) {
|
||||
if (mask.test(v) && ++count == min && max >= 8) {
|
||||
v.mutZ(z);
|
||||
return true;
|
||||
}
|
||||
|
@ -5,12 +5,12 @@ import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2D;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
||||
import java.io.IOException;
|
||||
|
||||
public class BiomePattern extends ExistingPattern {
|
||||
private transient MutableBlockVector2D mutable = new MutableBlockVector2D();
|
||||
private transient MutableBlockVector2 mutable = new MutableBlockVector2();
|
||||
private final BaseBiome biome;
|
||||
|
||||
public BiomePattern(Extent extent, BaseBiome biome) {
|
||||
@ -48,6 +48,6 @@ public class BiomePattern extends ExistingPattern {
|
||||
|
||||
private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException {
|
||||
stream.defaultReadObject();
|
||||
mutable = new MutableBlockVector2D();
|
||||
mutable = new MutableBlockVector2();
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import com.sk89q.worldedit.function.mask.ExistingBlockMask;
|
||||
import com.sk89q.worldedit.function.operation.ForwardExtentCopy;
|
||||
import com.sk89q.worldedit.function.operation.Operations;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import java.io.IOException;
|
||||
import java.io.NotSerializableException;
|
||||
@ -22,7 +22,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
*/
|
||||
public class FullClipboardPattern extends AbstractExtentPattern {
|
||||
private final Clipboard clipboard;
|
||||
private final MutableBlockVector mutable = new MutableBlockVector();
|
||||
private final MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
|
||||
/**
|
||||
* Create a new clipboard pattern.
|
||||
|
@ -7,7 +7,7 @@ import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.pattern.AbstractPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -15,7 +15,7 @@ import java.io.IOException;
|
||||
public class NoXPattern extends AbstractPattern {
|
||||
|
||||
private final Pattern pattern;
|
||||
// private transient MutableBlockVector mutable = new MutableBlockVector();
|
||||
// private transient MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
|
||||
public NoXPattern(Pattern pattern) {
|
||||
this.pattern = pattern;
|
||||
@ -25,7 +25,7 @@ public class NoXPattern extends AbstractPattern {
|
||||
public BaseBlock apply(BlockVector3 pos) {
|
||||
// mutable.mutY((pos.getY()));
|
||||
// mutable.mutZ((pos.getZ()));
|
||||
// return pattern.apply(mutable.toBlockVector3());
|
||||
// return pattern.apply(mutable);
|
||||
return pattern.apply(pos);
|
||||
}
|
||||
|
||||
@ -38,6 +38,6 @@ public class NoXPattern extends AbstractPattern {
|
||||
|
||||
private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException {
|
||||
stream.defaultReadObject();
|
||||
// mutable = new MutableBlockVector();
|
||||
// mutable = new MutableBlockVector3();
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.pattern.AbstractPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -20,7 +20,7 @@ public class NoYPattern extends AbstractPattern {
|
||||
this.pattern = pattern;
|
||||
}
|
||||
|
||||
// private transient MutableBlockVector mutable = new MutableBlockVector();
|
||||
// private transient MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
|
||||
@Override
|
||||
public BaseBlock apply(BlockVector3 pos) {
|
||||
@ -38,6 +38,6 @@ public class NoYPattern extends AbstractPattern {
|
||||
|
||||
private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException {
|
||||
stream.defaultReadObject();
|
||||
// mutable = new MutableBlockVector();
|
||||
// mutable = new MutableBlockVector3();
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.pattern.AbstractPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -20,7 +20,7 @@ public class NoZPattern extends AbstractPattern {
|
||||
this.pattern = pattern;
|
||||
}
|
||||
|
||||
// private transient MutableBlockVector mutable = new MutableBlockVector();
|
||||
// private transient MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
|
||||
@Override
|
||||
public BaseBlock apply(BlockVector3 pos) {
|
||||
@ -38,6 +38,6 @@ public class NoZPattern extends AbstractPattern {
|
||||
|
||||
private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException {
|
||||
stream.defaultReadObject();
|
||||
// mutable = new MutableBlockVector();
|
||||
// mutable = new MutableBlockVector3();
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.pattern.AbstractPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -15,7 +15,7 @@ import java.io.IOException;
|
||||
public class OffsetPattern extends AbstractPattern {
|
||||
|
||||
private final int dx, dy, dz;
|
||||
// private transient MutableBlockVector mutable = new MutableBlockVector();
|
||||
// private transient MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
private final Pattern pattern;
|
||||
|
||||
public OffsetPattern(Pattern pattern, int dx, int dy, int dz) {
|
||||
@ -45,6 +45,6 @@ public class OffsetPattern extends AbstractPattern {
|
||||
|
||||
private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException {
|
||||
stream.defaultReadObject();
|
||||
// mutable = new MutableBlockVector();
|
||||
// mutable = new MutableBlockVector3();
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.function.pattern.AbstractPattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.math.transform.AffineTransform;
|
||||
import com.sk89q.worldedit.math.transform.Transform;
|
||||
@ -23,7 +23,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public class RandomFullClipboardPattern extends AbstractPattern {
|
||||
private final Extent extent;
|
||||
private final MutableBlockVector mutable = new MutableBlockVector();
|
||||
private final MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
private final List<ClipboardHolder> clipboards;
|
||||
private boolean randomRotate;
|
||||
private boolean randomFlip;
|
||||
|
@ -2,13 +2,11 @@ package com.boydti.fawe.object.pattern;
|
||||
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.pattern.AbstractPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.SplittableRandom;
|
||||
@ -18,7 +16,7 @@ public class RandomOffsetPattern extends AbstractPattern {
|
||||
private final Pattern pattern;
|
||||
|
||||
private transient int dx2, dy2, dz2;
|
||||
private transient MutableBlockVector mutable = new MutableBlockVector();
|
||||
private transient MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
private transient SplittableRandom r;
|
||||
|
||||
public RandomOffsetPattern(Pattern pattern, int dx, int dy, int dz) {
|
||||
@ -38,7 +36,7 @@ public class RandomOffsetPattern extends AbstractPattern {
|
||||
mutable.mutX((position.getX() + r.nextInt(dx2) - dx));
|
||||
mutable.mutY((position.getY() + r.nextInt(dy2) - dy));
|
||||
mutable.mutZ((position.getZ() + r.nextInt(dz2) - dz));
|
||||
return pattern.apply(mutable.toBlockVector3());
|
||||
return pattern.apply(mutable);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -46,7 +44,7 @@ public class RandomOffsetPattern extends AbstractPattern {
|
||||
mutable.mutX((get.getX() + r.nextInt(dx2) - dx));
|
||||
mutable.mutY((get.getY() + r.nextInt(dy2) - dy));
|
||||
mutable.mutZ((get.getZ() + r.nextInt(dz2) - dz));
|
||||
return pattern.apply(extent, set, mutable.toBlockVector3());
|
||||
return pattern.apply(extent, set, mutable);
|
||||
}
|
||||
|
||||
private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException {
|
||||
@ -55,6 +53,6 @@ public class RandomOffsetPattern extends AbstractPattern {
|
||||
this.dy2 = dy * 2 + 1;
|
||||
this.dz2 = dz * 2 + 1;
|
||||
this.r = new SplittableRandom();
|
||||
this.mutable = new MutableBlockVector();
|
||||
this.mutable = new MutableBlockVector3();
|
||||
}
|
||||
}
|
@ -2,13 +2,11 @@ package com.boydti.fawe.object.pattern;
|
||||
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.pattern.AbstractPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@ -16,7 +14,7 @@ public class RelativePattern extends AbstractPattern implements ResettablePatter
|
||||
|
||||
private final Pattern pattern;
|
||||
private transient BlockVector3 origin;
|
||||
private transient MutableBlockVector mutable = new MutableBlockVector();
|
||||
private transient MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
|
||||
public RelativePattern(Pattern pattern) {
|
||||
this.pattern = pattern;
|
||||
@ -30,7 +28,7 @@ public class RelativePattern extends AbstractPattern implements ResettablePatter
|
||||
mutable.mutX((pos.getX() - origin.getX()));
|
||||
mutable.mutY((pos.getY() - origin.getY()));
|
||||
mutable.mutZ((pos.getZ() - origin.getZ()));
|
||||
return pattern.apply(mutable.toBlockVector3());
|
||||
return pattern.apply(mutable);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -41,12 +39,12 @@ public class RelativePattern extends AbstractPattern implements ResettablePatter
|
||||
mutable.mutX((get.getX() - origin.getX()));
|
||||
mutable.mutY((get.getY() - origin.getY()));
|
||||
mutable.mutZ((get.getZ() - origin.getZ()));
|
||||
return pattern.apply(extent, set, mutable.toBlockVector3());
|
||||
return pattern.apply(extent, set, mutable);
|
||||
}
|
||||
|
||||
private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException {
|
||||
stream.defaultReadObject();
|
||||
mutable = new MutableBlockVector();
|
||||
mutable = new MutableBlockVector3();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,15 +1,13 @@
|
||||
package com.boydti.fawe.object.pattern;
|
||||
|
||||
import com.boydti.fawe.FaweCache;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.mask.SolidBlockMask;
|
||||
import com.sk89q.worldedit.function.pattern.AbstractPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -20,7 +18,7 @@ public class SolidRandomOffsetPattern extends AbstractPattern {
|
||||
private final Pattern pattern;
|
||||
|
||||
private transient int dx2, dy2, dz2;
|
||||
private transient MutableBlockVector mutable;
|
||||
private transient MutableBlockVector3 mutable;
|
||||
private transient boolean[] solid;
|
||||
private SplittableRandom r;
|
||||
|
||||
@ -39,7 +37,7 @@ public class SolidRandomOffsetPattern extends AbstractPattern {
|
||||
this.dz2 = dz * 2 + 1;
|
||||
solid = SolidBlockMask.getTypes();
|
||||
this.r = new SplittableRandom();
|
||||
this.mutable = new MutableBlockVector();
|
||||
this.mutable = new MutableBlockVector3();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -47,7 +45,7 @@ public class SolidRandomOffsetPattern extends AbstractPattern {
|
||||
mutable.mutX((position.getX() + r.nextInt(dx2) - dx));
|
||||
mutable.mutY((position.getY() + r.nextInt(dy2) - dy));
|
||||
mutable.mutZ((position.getZ() + r.nextInt(dz2) - dz));
|
||||
BaseBlock block = pattern.apply(mutable.toBlockVector3());
|
||||
BaseBlock block = pattern.apply(mutable);
|
||||
if (solid[block.getInternalBlockTypeId()]) {
|
||||
return block;
|
||||
} else {
|
||||
@ -60,9 +58,9 @@ public class SolidRandomOffsetPattern extends AbstractPattern {
|
||||
mutable.mutX((get.getX() + r.nextInt(dx2) - dx));
|
||||
mutable.mutY((get.getY() + r.nextInt(dy2) - dy));
|
||||
mutable.mutZ((get.getZ() + r.nextInt(dz2) - dz));
|
||||
BlockStateHolder block = pattern.apply(mutable.toBlockVector3());
|
||||
BlockStateHolder block = pattern.apply(mutable);
|
||||
if (solid[block.getInternalBlockTypeId()]) {
|
||||
return pattern.apply(extent, set, mutable.toBlockVector3());
|
||||
return pattern.apply(extent, set, mutable);
|
||||
} else {
|
||||
return pattern.apply(extent, set, get);
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import com.sk89q.worldedit.function.pattern.AbstractPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.function.visitor.BreadthFirstSearch;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -15,10 +15,10 @@ public class SurfaceRandomOffsetPattern extends AbstractPattern {
|
||||
private final Pattern pattern;
|
||||
private int moves;
|
||||
|
||||
private transient MutableBlockVector cur;
|
||||
private transient MutableBlockVector[] buffer;
|
||||
private transient MutableBlockVector[] allowed;
|
||||
private transient MutableBlockVector next;
|
||||
private transient MutableBlockVector3 cur;
|
||||
private transient MutableBlockVector3[] buffer;
|
||||
private transient MutableBlockVector3[] allowed;
|
||||
private transient MutableBlockVector3 next;
|
||||
|
||||
public SurfaceRandomOffsetPattern(Pattern pattern, int distance) {
|
||||
this.pattern = pattern;
|
||||
@ -27,12 +27,12 @@ public class SurfaceRandomOffsetPattern extends AbstractPattern {
|
||||
}
|
||||
|
||||
private void init() {
|
||||
cur = new MutableBlockVector();
|
||||
this.buffer = new MutableBlockVector[BreadthFirstSearch.DIAGONAL_DIRECTIONS.length];
|
||||
cur = new MutableBlockVector3();
|
||||
this.buffer = new MutableBlockVector3[BreadthFirstSearch.DIAGONAL_DIRECTIONS.length];
|
||||
for (int i = 0; i < buffer.length; i++) {
|
||||
buffer[i] = new MutableBlockVector();
|
||||
buffer[i] = new MutableBlockVector3();
|
||||
}
|
||||
allowed = new MutableBlockVector[buffer.length];
|
||||
allowed = new MutableBlockVector3[buffer.length];
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -48,21 +48,21 @@ public class SurfaceRandomOffsetPattern extends AbstractPattern {
|
||||
next = buffer[i];
|
||||
BlockVector3 dir = BreadthFirstSearch.DIAGONAL_DIRECTIONS[i];
|
||||
next.setComponents(cur.getBlockX() + dir.getBlockX(), cur.getBlockY() + dir.getBlockY(), cur.getBlockZ() + dir.getBlockZ());
|
||||
if (allowed(next.toBlockVector3())) {
|
||||
if (allowed(next)) {
|
||||
allowed[index++] = next;
|
||||
}
|
||||
}
|
||||
if (index == 0) {
|
||||
return cur.toBlockVector3();
|
||||
return cur;
|
||||
}
|
||||
next = allowed[ThreadLocalRandom.current().nextInt(index)];
|
||||
cur.setComponents(next.getBlockX(), next.getBlockY(), next.getBlockZ());
|
||||
}
|
||||
return cur.toBlockVector3();
|
||||
return cur;
|
||||
}
|
||||
|
||||
private boolean allowed(BlockVector3 bv) {
|
||||
MutableBlockVector v = new MutableBlockVector(bv);
|
||||
MutableBlockVector3 v = new MutableBlockVector3(bv);
|
||||
BlockStateHolder block = pattern.apply(bv);
|
||||
if (!block.getBlockType().getMaterial().isMovementBlocker()) {
|
||||
return false;
|
||||
@ -71,34 +71,34 @@ public class SurfaceRandomOffsetPattern extends AbstractPattern {
|
||||
int y = v.getBlockY();
|
||||
int z = v.getBlockZ();
|
||||
v.mutY(y + 1);
|
||||
if (canPassthrough(v.toBlockVector3())) {
|
||||
if (canPassthrough(v)) {
|
||||
v.mutY(y);
|
||||
return true;
|
||||
}
|
||||
v.mutY(y - 1);
|
||||
if (canPassthrough(v.toBlockVector3())) {
|
||||
if (canPassthrough(v)) {
|
||||
v.mutY(y);
|
||||
return true;
|
||||
}
|
||||
v.mutY(y);
|
||||
v.mutX(x + 1);
|
||||
if (canPassthrough(v.toBlockVector3())) {
|
||||
if (canPassthrough(v)) {
|
||||
v.mutX(x);
|
||||
return true;
|
||||
}
|
||||
v.mutX(x - 1);
|
||||
if (canPassthrough(v.toBlockVector3())) {
|
||||
if (canPassthrough(v)) {
|
||||
v.mutX(x);
|
||||
return true;
|
||||
}
|
||||
v.mutX(x);
|
||||
v.mutZ(z + 1);
|
||||
if (canPassthrough(v.toBlockVector3())) {
|
||||
if (canPassthrough(v)) {
|
||||
v.mutZ(z);
|
||||
return true;
|
||||
}
|
||||
v.mutZ(z - 1);
|
||||
if (canPassthrough(v.toBlockVector3())) {
|
||||
if (canPassthrough(v)) {
|
||||
v.mutZ(z);
|
||||
return true;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2D;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
@ -19,7 +19,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
public class FaweQueueDelegateExtent extends DelegateFaweQueue {
|
||||
private final FaweQueue parentQueue;
|
||||
private final Extent parentExtent;
|
||||
// private final MutableBlockVector2D mutable2d = new MutableBlockVector2D();
|
||||
// private final MutableBlockVector2 mutable2d = new MutableBlockVector2();
|
||||
|
||||
public FaweQueueDelegateExtent(FaweQueue parentQueue, Extent parentExtent) {
|
||||
super(parentQueue);
|
||||
|
@ -20,8 +20,8 @@
|
||||
package com.boydti.fawe.object.regions;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.regions.AbstractRegion;
|
||||
import com.sk89q.worldedit.regions.RegionOperationException;
|
||||
@ -143,8 +143,8 @@ public class PolyhedralRegion extends AbstractRegion {
|
||||
if (minimumPoint == null) {
|
||||
minimumPoint = maximumPoint = vertex;
|
||||
} else {
|
||||
// minimumPoint = new MutableBlockVector(minimumPoint.getMinimum(vertex));
|
||||
// maximumPoint = new MutableBlockVector(maximumPoint.getMaximum(vertex));
|
||||
// minimumPoint = new MutableBlockVector3(minimumPoint.getMinimum(vertex));
|
||||
// maximumPoint = new MutableBlockVector3(maximumPoint.getMaximum(vertex));
|
||||
minimumPoint = minimumPoint.getMinimum(vertex);
|
||||
maximumPoint = maximumPoint.getMaximum(vertex);
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import com.boydti.fawe.util.TextureUtil;
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardWriter;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
@ -68,8 +68,8 @@ public class PNGWriter implements ClipboardWriter {
|
||||
|
||||
boolean fill = length * 4 < imageSize && width * 4 < imageSize;
|
||||
|
||||
MutableBlockVector mutable, mutableTop, mutableRight, mutableLeft;
|
||||
mutable = mutableTop = mutableRight = mutableLeft = new MutableBlockVector(0, 0, 0);
|
||||
MutableBlockVector3 mutable, mutableTop, mutableRight, mutableLeft;
|
||||
mutable = mutableTop = mutableRight = mutableLeft = new MutableBlockVector3(0, 0, 0);
|
||||
// Vector mutableTop = new Vector(0, 0, 0);
|
||||
// Vector mutableRight = new Vector(0, 0, 0);
|
||||
// Vector mutableLeft = new Vector(0, 0, 0);
|
||||
@ -96,16 +96,16 @@ public class PNGWriter implements ClipboardWriter {
|
||||
double cpy2 = cpy1 + dpyj[zz];
|
||||
for (int y = y0; y < y0 + height; y++) {
|
||||
mutable.mutY(y);
|
||||
BlockStateHolder block = clipboard.getBlock(mutable.toBlockVector3());
|
||||
BlockStateHolder block = clipboard.getBlock(mutable);
|
||||
if (block.getBlockType().getMaterial().isAir()) {
|
||||
continue;
|
||||
}
|
||||
mutableTop.mutY(y + 1);
|
||||
mutableRight.mutY(y);
|
||||
mutableLeft.mutY(y);
|
||||
if (!clipboard.getBlock(mutableTop.toBlockVector3()).getBlockType().getMaterial().isAir() &&
|
||||
!clipboard.getBlock(mutableRight.toBlockVector3()).getBlockType().getMaterial().isAir() &&
|
||||
!clipboard.getBlock(mutableLeft.toBlockVector3()).getBlockType().getMaterial().isAir() ) {
|
||||
if (!clipboard.getBlock(mutableTop).getBlockType().getMaterial().isAir() &&
|
||||
!clipboard.getBlock(mutableRight).getBlockType().getMaterial().isAir() &&
|
||||
!clipboard.getBlock(mutableLeft).getBlockType().getMaterial().isAir() ) {
|
||||
continue;
|
||||
}
|
||||
double cpy = cpy2 - dpxi[y - y0];
|
||||
|
@ -8,8 +8,6 @@ import com.boydti.fawe.util.MaskTraverser;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.entity.Entity;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
|
||||
@ -25,7 +23,7 @@ import com.sk89q.worldedit.function.operation.Operations;
|
||||
import com.sk89q.worldedit.function.visitor.RegionVisitor;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2D;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||
import com.sk89q.worldedit.math.transform.Transform;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
@ -211,7 +209,7 @@ public class Schematic {
|
||||
BlockArrayClipboard bac = (BlockArrayClipboard) clipboard;
|
||||
if (copyBiomes) {
|
||||
bac.IMP.forEach(new FaweClipboard.BlockReader() {
|
||||
MutableBlockVector2D mpos2d = new MutableBlockVector2D();
|
||||
MutableBlockVector2 mpos2d = new MutableBlockVector2();
|
||||
{
|
||||
mpos2d.setComponents(Integer.MIN_VALUE, Integer.MIN_VALUE);
|
||||
}
|
||||
@ -222,7 +220,7 @@ public class Schematic {
|
||||
int zz = z + relz;
|
||||
if (xx != mpos2d.getBlockX() || zz != mpos2d.getBlockZ()) {
|
||||
mpos2d.setComponents(xx, zz);
|
||||
extent.setBiome(mpos2d.toBlockVector2(), bac.IMP.getBiome(x, z));
|
||||
extent.setBiome(mpos2d, bac.IMP.getBiome(x, z));
|
||||
}
|
||||
if (!pasteAir && block.getBlockType().getMaterial().isAir()) {
|
||||
return;
|
||||
@ -247,8 +245,8 @@ public class Schematic {
|
||||
final int rely = to.getBlockY() - origin.getBlockY();
|
||||
final int relz = to.getBlockZ() - origin.getBlockZ();
|
||||
RegionVisitor visitor = new RegionVisitor(region, new RegionFunction() {
|
||||
// MutableBlockVector2D mpos2d_2 = new MutableBlockVector2D();
|
||||
MutableBlockVector2D mpos2d = new MutableBlockVector2D();
|
||||
// MutableBlockVector2 mpos2d_2 = new MutableBlockVector2();
|
||||
MutableBlockVector2 mpos2d = new MutableBlockVector2();
|
||||
{
|
||||
mpos2d.setComponents(Integer.MIN_VALUE, Integer.MIN_VALUE);
|
||||
}
|
||||
@ -260,7 +258,7 @@ public class Schematic {
|
||||
if (copyBiomes && xx != mpos2d.getBlockX() && zz != mpos2d.getBlockZ()) {
|
||||
mpos2d.setComponents(xx, zz);
|
||||
// extent.setBiome(mpos2d, clipboard.getBiome(mpos2d_2.setComponents(mutable.getBlockX(), mutable.getBlockZ())));
|
||||
extent.setBiome(mpos2d.toBlockVector2(), clipboard.getBiome(BlockVector2.at(mutable.getBlockX(), mutable.getBlockZ())));
|
||||
extent.setBiome(mpos2d, clipboard.getBiome(BlockVector2.at(mutable.getBlockX(), mutable.getBlockZ())));
|
||||
}
|
||||
if (!pasteAir && block.getBlockType().getMaterial().isAir()) {
|
||||
return false;
|
||||
|
@ -22,7 +22,7 @@ import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardWriter;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.registry.state.AbstractProperty;
|
||||
@ -168,7 +168,7 @@ public class StructureFormat implements ClipboardReader, ClipboardWriter {
|
||||
}
|
||||
Map<String, Object> structure = FaweCache.asMap("version", 1, "author", owner);
|
||||
// ignored: version / owner
|
||||
MutableBlockVector mutable = new MutableBlockVector(0, 0, 0);
|
||||
MutableBlockVector3 mutable = new MutableBlockVector3(0, 0, 0);
|
||||
Int2ObjectArrayMap<Integer> indexes = new Int2ObjectArrayMap<>();
|
||||
// Size
|
||||
structure.put("size", Arrays.asList(width, height, length));
|
||||
|
@ -27,7 +27,7 @@ import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2D;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.session.ClipboardHolder;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
@ -56,7 +56,7 @@ public class SchemVis extends ImmutableVirtualWorld {
|
||||
private final Long2ObjectOpenHashMap<Map.Entry<File, Long>> files;
|
||||
private final Long2ObjectOpenHashMap<MCAChunk> chunks; // TODO use soft references OR clear chunks outside view distance
|
||||
|
||||
private final MutableBlockVector2D lastPos = new MutableBlockVector2D();
|
||||
private final MutableBlockVector2 lastPos = new MutableBlockVector2();
|
||||
private final FawePlayer player;
|
||||
private final Location origin;
|
||||
private final BlockVector2 chunkOffset;
|
||||
@ -322,10 +322,10 @@ public class SchemVis extends ImmutableVirtualWorld {
|
||||
private BlockVector2 registerAndGetChunkOffset(BlockVector2 schemDimensions, File file) {
|
||||
int chunkX = schemDimensions.getBlockX() >> 4;
|
||||
int chunkZ = schemDimensions.getBlockZ() >> 4;
|
||||
MutableBlockVector2D pos2 = new MutableBlockVector2D();
|
||||
MutableBlockVector2D curPos = lastPos;
|
||||
MutableBlockVector2 pos2 = new MutableBlockVector2();
|
||||
MutableBlockVector2 curPos = lastPos;
|
||||
// Find next free position
|
||||
while (!isAreaFree(curPos.toBlockVector2(), pos2.setComponents(curPos.getBlockX() + chunkX, curPos.getBlockZ() + chunkZ).toBlockVector2())) {
|
||||
while (!isAreaFree(curPos, pos2.setComponents(curPos.getBlockX() + chunkX, curPos.getBlockZ() + chunkZ))) {
|
||||
// if (curPos == lastPos && !files.containsKey(MathMan.pairInt(curPos.getBlockX(), curPos.getBlockZ()))) {
|
||||
// curPos = new MutableBlockVector2();
|
||||
// curPos.setComponents(lastPos.getBlockX(), lastPos.getBlockZ());
|
||||
@ -345,7 +345,7 @@ public class SchemVis extends ImmutableVirtualWorld {
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < Math.min(chunkX, chunkZ); i++) curPos.nextPosition();
|
||||
return curPos.toBlockVector2();
|
||||
return curPos;
|
||||
}
|
||||
|
||||
private boolean isAreaFree(BlockVector2 chunkPos1, BlockVector2 chunkPos2 /* inclusive */) {
|
||||
@ -599,7 +599,7 @@ public class SchemVis extends ImmutableVirtualWorld {
|
||||
clear();
|
||||
chunks.clear();
|
||||
files.clear();
|
||||
player.getPlayer().setPosition(origin.toVector(), origin.getPitch(), origin.getYaw());
|
||||
player.getPlayer().setPosition(origin, origin.getPitch(), origin.getYaw());
|
||||
if (update) {
|
||||
FaweQueue packetQueue = SetQueue.IMP.getNewQueue(player.getWorld(), true, false);
|
||||
|
||||
|
@ -7,7 +7,7 @@ import com.sk89q.worldedit.function.RegionFunction;
|
||||
import com.sk89q.worldedit.function.operation.Operation;
|
||||
import com.sk89q.worldedit.function.operation.RunContext;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.ArrayList;
|
||||
@ -77,8 +77,8 @@ public abstract class DFSVisitor implements Operation {
|
||||
NodePair current;
|
||||
Node from;
|
||||
Node adjacent;
|
||||
// MutableBlockVector mutable = new MutableBlockVector();
|
||||
// MutableBlockVector mutable2 = new MutableBlockVector();
|
||||
// MutableBlockVector3 mutable = new MutableBlockVector3();
|
||||
// MutableBlockVector3 mutable2 = new MutableBlockVector3();
|
||||
int countAdd, countAttempt;
|
||||
IntegerTrio[] dirs = getIntDirections();
|
||||
|
||||
|
@ -67,20 +67,6 @@ public abstract class TaskManager {
|
||||
* @param runnables
|
||||
*/
|
||||
public void parallel(Collection<Runnable> runnables) {
|
||||
// if (!Fawe.get().isJava8()) {
|
||||
// ExecutorCompletionService c = new ExecutorCompletionService(pool);
|
||||
// for (Runnable run : runnables) {
|
||||
// c.submit(run, null);
|
||||
// }
|
||||
// try {
|
||||
// for (int i = 0; i < runnables.size(); i++) {
|
||||
// c.take();
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// return;
|
||||
// }
|
||||
for (Runnable run : runnables) {
|
||||
pool.submit(run);
|
||||
}
|
||||
|
Reference in New Issue
Block a user