mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
WIP clipboard offsets
TODO schem load -> BlockArrayClipboard
This commit is contained in:
parent
599a4dfebc
commit
cfa147cf76
@ -322,7 +322,6 @@ public class ChunkHolder<T extends Future<T>> implements IQueueChunk {
|
|||||||
if ((!full && !get.hasSection(layer)) || !filter.appliesLayer(this, layer)) {
|
if ((!full && !get.hasSection(layer)) || !filter.appliesLayer(this, layer)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
System.out.println("Apply layer " + full);
|
|
||||||
block.init(get, set, layer);
|
block.init(get, set, layer);
|
||||||
block.filter(filter);
|
block.filter(filter);
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,6 @@ import java.util.function.Supplier;
|
|||||||
|
|
||||||
public class WorldCopyClipboard extends ReadOnlyClipboard {
|
public class WorldCopyClipboard extends ReadOnlyClipboard {
|
||||||
|
|
||||||
public final int mx, my, mz;
|
|
||||||
private final boolean hasBiomes;
|
private final boolean hasBiomes;
|
||||||
private final boolean hasEntities;
|
private final boolean hasEntities;
|
||||||
private Extent extent;
|
private Extent extent;
|
||||||
@ -28,10 +27,6 @@ public class WorldCopyClipboard extends ReadOnlyClipboard {
|
|||||||
super(region);
|
super(region);
|
||||||
this.hasBiomes = hasBiomes;
|
this.hasBiomes = hasBiomes;
|
||||||
this.hasEntities = hasEntities;
|
this.hasEntities = hasEntities;
|
||||||
final BlockVector3 origin = region.getMinimumPoint();
|
|
||||||
this.mx = origin.getBlockX();
|
|
||||||
this.my = origin.getBlockY();
|
|
||||||
this.mz = origin.getBlockZ();
|
|
||||||
this.supplier = supplier;
|
this.supplier = supplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,17 +41,17 @@ public class WorldCopyClipboard extends ReadOnlyClipboard {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBlock getFullBlock(int x, int y, int z) {
|
public BaseBlock getFullBlock(int x, int y, int z) {
|
||||||
return getExtent().getFullBlock(mx + x, my + y, mz + z);
|
return getExtent().getFullBlock(x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState getBlock(int x, int y, int z) {
|
public BlockState getBlock(int x, int y, int z) {
|
||||||
return getExtent().getBlock(mx + x, my + y, mz + z);
|
return getExtent().getBlock(x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BiomeType getBiomeType(int x, int z) {
|
public BiomeType getBiomeType(int x, int z) {
|
||||||
return getExtent().getBiomeType(mx + x, mz + z);
|
return getExtent().getBiomeType(x, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -23,22 +23,16 @@ public class WorldCutClipboard extends WorldCopyClipboard {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBlock getFullBlock(int x, int y, int z) {
|
public BaseBlock getFullBlock(int x, int y, int z) {
|
||||||
int xx = mx + x;
|
|
||||||
int yy = my + y;
|
|
||||||
int zz = mz + z;
|
|
||||||
Extent extent = getExtent();
|
Extent extent = getExtent();
|
||||||
BaseBlock block = extent.getFullBlock(xx, yy, zz);
|
BaseBlock block = extent.getFullBlock(x, y, z);
|
||||||
extent.setBlock(xx, yy, zz, BlockTypes.AIR.getDefaultState());
|
extent.setBlock(x, y, z, BlockTypes.AIR.getDefaultState());
|
||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState getBlock(int x, int y, int z) {
|
public BlockState getBlock(int x, int y, int z) {
|
||||||
int xx = mx + x;
|
|
||||||
int yy = my + y;
|
|
||||||
int zz = mz + z;
|
|
||||||
Extent extent = getExtent();
|
Extent extent = getExtent();
|
||||||
BlockState block = extent.getBlock(xx, yy, zz);
|
BlockState block = extent.getBlock(x, y, z);
|
||||||
extent.setBlock(x, y, z, BlockTypes.AIR.getDefaultState());
|
extent.setBlock(x, y, z, BlockTypes.AIR.getDefaultState());
|
||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
|
@ -191,9 +191,8 @@ public class ClipboardCommands {
|
|||||||
session.setClipboard(null);
|
session.setClipboard(null);
|
||||||
ReadOnlyClipboard lazyClipboard = ReadOnlyClipboard.of(region, !skipEntities, copyBiomes);
|
ReadOnlyClipboard lazyClipboard = ReadOnlyClipboard.of(region, !skipEntities, copyBiomes);
|
||||||
|
|
||||||
BlockArrayClipboard clipboard = new BlockArrayClipboard(region, lazyClipboard);
|
lazyClipboard.setOrigin(session.getPlacementPosition(actor));
|
||||||
clipboard.setOrigin(session.getPlacementPosition(actor));
|
session.setClipboard(new ClipboardHolder(lazyClipboard));
|
||||||
session.setClipboard(new ClipboardHolder(clipboard));
|
|
||||||
BBC.COMMAND_COPY.send(actor, region.getArea());
|
BBC.COMMAND_COPY.send(actor, region.getArea());
|
||||||
if (!actor.hasPermission("fawe.tips")) {
|
if (!actor.hasPermission("fawe.tips")) {
|
||||||
BBC.TIP_PASTE.or(BBC.TIP_LAZYCOPY, BBC.TIP_DOWNLOAD, BBC.TIP_ROTATE, BBC.TIP_COPYPASTE, BBC.TIP_REPLACE_MARKER, BBC.TIP_COPY_PATTERN).send(actor);
|
BBC.TIP_PASTE.or(BBC.TIP_LAZYCOPY, BBC.TIP_DOWNLOAD, BBC.TIP_ROTATE, BBC.TIP_COPYPASTE, BBC.TIP_REPLACE_MARKER, BBC.TIP_COPY_PATTERN).send(actor);
|
||||||
@ -226,9 +225,8 @@ public class ClipboardCommands {
|
|||||||
// session.setClipboard(null);
|
// session.setClipboard(null);
|
||||||
//
|
//
|
||||||
// ReadOnlyClipboard lazyClipboard = new WorldCutClipboard(editSession, region, !skipEntities, copyBiomes);
|
// ReadOnlyClipboard lazyClipboard = new WorldCutClipboard(editSession, region, !skipEntities, copyBiomes);
|
||||||
// BlockArrayClipboard clipboard = new BlockArrayClipboard(region, lazyClipboard);
|
|
||||||
// clipboard.setOrigin(session.getPlacementPosition(actor));
|
// clipboard.setOrigin(session.getPlacementPosition(actor));
|
||||||
// session.setClipboard(new ClipboardHolder(clipboard));
|
// session.setClipboard(new ClipboardHolder(lazyClipboard));
|
||||||
// BBC.COMMAND_CUT_LAZY.send(actor, region.getArea());
|
// BBC.COMMAND_CUT_LAZY.send(actor, region.getArea());
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@ -462,6 +460,7 @@ public class ClipboardCommands {
|
|||||||
|
|
||||||
BlockVector3 to = atOrigin ? clipboard.getOrigin() : session.getPlacementPosition(actor);
|
BlockVector3 to = atOrigin ? clipboard.getOrigin() : session.getPlacementPosition(actor);
|
||||||
checkPaste(actor, editSession, to, holder, clipboard);
|
checkPaste(actor, editSession, to, holder, clipboard);
|
||||||
|
|
||||||
Operation operation = holder
|
Operation operation = holder
|
||||||
.createPaste(editSession)
|
.createPaste(editSession)
|
||||||
.to(to)
|
.to(to)
|
||||||
|
@ -293,6 +293,7 @@ public final class PlatformCommandManager {
|
|||||||
.map(actor -> {
|
.map(actor -> {
|
||||||
EditSession editSession = localSession.createEditSession(actor);
|
EditSession editSession = localSession.createEditSession(actor);
|
||||||
editSession.enableStandardMode();
|
editSession.enableStandardMode();
|
||||||
|
Request.request().setEditSession(editSession);
|
||||||
return editSession;
|
return editSession;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -60,6 +60,7 @@ public class ProvideBindings extends Bindings {
|
|||||||
public EditSession editSession(LocalSession localSession, Player player) {
|
public EditSession editSession(LocalSession localSession, Player player) {
|
||||||
EditSession editSession = localSession.createEditSession(player);
|
EditSession editSession = localSession.createEditSession(player);
|
||||||
editSession.enableStandardMode();
|
editSession.enableStandardMode();
|
||||||
|
Request.request().setEditSession(editSession);
|
||||||
return editSession;
|
return editSession;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
package com.sk89q.worldedit.extent.clipboard;
|
package com.sk89q.worldedit.extent.clipboard;
|
||||||
|
|
||||||
import com.boydti.fawe.beta.Filter;
|
|
||||||
import com.boydti.fawe.object.clipboard.DelegateClipboard;
|
import com.boydti.fawe.object.clipboard.DelegateClipboard;
|
||||||
|
import com.google.common.collect.Iterators;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.worldedit.WorldEditException;
|
import com.sk89q.worldedit.WorldEditException;
|
||||||
import com.sk89q.worldedit.entity.BaseEntity;
|
import com.sk89q.worldedit.entity.BaseEntity;
|
||||||
@ -29,6 +29,8 @@ import com.sk89q.worldedit.extent.Extent;
|
|||||||
import com.sk89q.worldedit.function.visitor.Order;
|
import com.sk89q.worldedit.function.visitor.Order;
|
||||||
import com.sk89q.worldedit.math.BlockVector2;
|
import com.sk89q.worldedit.math.BlockVector2;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
|
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||||
|
import com.sk89q.worldedit.math.OffsetBlockVector3;
|
||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import com.sk89q.worldedit.util.Location;
|
import com.sk89q.worldedit.util.Location;
|
||||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
@ -39,7 +41,6 @@ import com.sk89q.worldedit.world.block.BlockTypes;
|
|||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.io.Closeable;
|
import java.io.Closeable;
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@ -68,16 +69,12 @@ public class BlockArrayClipboard extends DelegateClipboard implements Clipboard,
|
|||||||
*/
|
*/
|
||||||
public BlockArrayClipboard(Region region, UUID clipboardId) {
|
public BlockArrayClipboard(Region region, UUID clipboardId) {
|
||||||
this(region, Clipboard.create(region.getDimensions(), clipboardId));
|
this(region, Clipboard.create(region.getDimensions(), clipboardId));
|
||||||
checkNotNull(region);
|
|
||||||
this.region = region.clone();
|
|
||||||
this.offset = region.getMinimumPoint();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlockArrayClipboard(Region region, Clipboard clipboard) {
|
public BlockArrayClipboard(Region region, Clipboard clipboard) {
|
||||||
super(clipboard);
|
super(clipboard);
|
||||||
checkNotNull(region);
|
checkNotNull(region);
|
||||||
this.region = region.clone();
|
setRegion(region);
|
||||||
this.offset = region.getMinimumPoint();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -87,6 +84,7 @@ public class BlockArrayClipboard extends DelegateClipboard implements Clipboard,
|
|||||||
|
|
||||||
public void setRegion(Region region) {
|
public void setRegion(Region region) {
|
||||||
this.region = region;
|
this.region = region;
|
||||||
|
this.offset = region.getMinimumPoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -237,17 +235,21 @@ public class BlockArrayClipboard extends DelegateClipboard implements Clipboard,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Iterator<BlockVector3> iterator() {
|
public Iterator<BlockVector3> iterator() {
|
||||||
return getParent().iterator();
|
OffsetBlockVector3 mutable = new OffsetBlockVector3(offset);
|
||||||
|
return Iterators.transform(getParent().iterator(), mutable::init);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Iterator<BlockVector2> iterator2d() {
|
public Iterator<BlockVector2> iterator2d() {
|
||||||
return getParent().iterator2d();
|
MutableBlockVector2 mutable = new MutableBlockVector2();
|
||||||
|
return Iterators.transform(getParent().iterator2d(), input ->
|
||||||
|
mutable.setComponents(input.getX() + offset.getX(), input.getZ() + offset.getZ()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Iterator<BlockVector3> iterator(Order order) {
|
public Iterator<BlockVector3> iterator(Order order) {
|
||||||
return getParent().iterator(order);
|
OffsetBlockVector3 mutable = new OffsetBlockVector3(offset);
|
||||||
|
return Iterators.transform(getParent().iterator(order), mutable::init);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -51,6 +51,7 @@ import com.sk89q.worldedit.regions.Region;
|
|||||||
import com.sk89q.worldedit.regions.Regions;
|
import com.sk89q.worldedit.regions.Regions;
|
||||||
import com.sk89q.worldedit.util.Location;
|
import com.sk89q.worldedit.util.Location;
|
||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
|
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
@ -69,7 +70,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
|||||||
* Specifies an object that implements something suitable as a "clipboard."
|
* Specifies an object that implements something suitable as a "clipboard."
|
||||||
*/
|
*/
|
||||||
public interface Clipboard extends Extent, Iterable<BlockVector3>, Closeable {
|
public interface Clipboard extends Extent, Iterable<BlockVector3>, Closeable {
|
||||||
public static Clipboard create(Region region) {
|
static Clipboard create(Region region) {
|
||||||
checkNotNull(region);
|
checkNotNull(region);
|
||||||
checkNotNull(region.getWorld(),
|
checkNotNull(region.getWorld(),
|
||||||
"World cannot be null (use the other constructor for the region)");
|
"World cannot be null (use the other constructor for the region)");
|
||||||
@ -78,7 +79,7 @@ public interface Clipboard extends Extent, Iterable<BlockVector3>, Closeable {
|
|||||||
return ReadOnlyClipboard.of(session, region);
|
return ReadOnlyClipboard.of(session, region);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Clipboard create(BlockVector3 size, UUID uuid) {
|
static Clipboard create(BlockVector3 size, UUID uuid) {
|
||||||
if (Settings.IMP.CLIPBOARD.USE_DISK) {
|
if (Settings.IMP.CLIPBOARD.USE_DISK) {
|
||||||
return new DiskOptimizedClipboard(size, uuid);
|
return new DiskOptimizedClipboard(size, uuid);
|
||||||
} else if (Settings.IMP.CLIPBOARD.COMPRESSION_LEVEL == 0) {
|
} else if (Settings.IMP.CLIPBOARD.COMPRESSION_LEVEL == 0) {
|
||||||
@ -323,7 +324,6 @@ public interface Clipboard extends Extent, Iterable<BlockVector3>, Closeable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
default void paste(Extent extent, BlockVector3 to, boolean pasteAir) {
|
default void paste(Extent extent, BlockVector3 to, boolean pasteAir) {
|
||||||
Region region = this.getRegion().clone();
|
|
||||||
final BlockVector3 origin = this.getOrigin();
|
final BlockVector3 origin = this.getOrigin();
|
||||||
|
|
||||||
final boolean copyBiomes = this.hasBiomes();
|
final boolean copyBiomes = this.hasBiomes();
|
||||||
@ -332,33 +332,21 @@ public interface Clipboard extends Extent, Iterable<BlockVector3>, Closeable {
|
|||||||
final int rely = to.getBlockY() - origin.getBlockY();
|
final int rely = to.getBlockY() - origin.getBlockY();
|
||||||
final int relz = to.getBlockZ() - origin.getBlockZ();
|
final int relz = to.getBlockZ() - origin.getBlockZ();
|
||||||
|
|
||||||
Operation visitor = new RegionVisitor(region, new RegionFunction() {
|
MutableBlockVector2 mpos2d = new MutableBlockVector2();
|
||||||
// MutableBlockVector2 mpos2d_2 = new MutableBlockVector2();
|
mpos2d.setComponents(Integer.MIN_VALUE, Integer.MIN_VALUE);
|
||||||
MutableBlockVector2 mpos2d = new MutableBlockVector2();
|
for (BlockVector3 pos : this) {
|
||||||
|
BaseBlock block = pos.getFullBlock(this);
|
||||||
{
|
int xx = pos.getX() + relx;
|
||||||
mpos2d.setComponents(Integer.MIN_VALUE, Integer.MIN_VALUE);
|
int zz = pos.getZ() + relz;
|
||||||
|
if (copyBiomes && xx != mpos2d.getBlockX() && zz != mpos2d.getBlockZ()) {
|
||||||
|
mpos2d.setComponents(xx, zz);
|
||||||
|
extent.setBiome(mpos2d, Clipboard.this.getBiome(pos.toBlockVector2()));
|
||||||
}
|
}
|
||||||
|
if (!pasteAir && block.getBlockType().getMaterial().isAir()) {
|
||||||
@Override
|
continue;
|
||||||
public boolean apply(BlockVector3 mutable) throws WorldEditException {
|
|
||||||
BlockState block = getBlock(mutable);
|
|
||||||
int xx = mutable.getBlockX() + relx;
|
|
||||||
int zz = mutable.getBlockZ() + relz;
|
|
||||||
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, Clipboard.this
|
|
||||||
.getBiome(BlockVector2.at(mutable.getBlockX(), mutable.getBlockZ())));
|
|
||||||
}
|
|
||||||
if (!pasteAir && block.getBlockType().getMaterial().isAir()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
extent.setBlock(xx, mutable.getBlockY() + rely, zz, block);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
});
|
extent.setBlock(xx, pos.getY() + rely, zz, block);
|
||||||
Operations.completeBlindly(visitor);
|
}
|
||||||
// Entity offset is the paste location subtract the clipboard origin (entity's location is already relative to the world origin)
|
// Entity offset is the paste location subtract the clipboard origin (entity's location is already relative to the world origin)
|
||||||
final int entityOffsetX = to.getBlockX() - origin.getBlockX();
|
final int entityOffsetX = to.getBlockX() - origin.getBlockX();
|
||||||
final int entityOffsetY = to.getBlockY() - origin.getBlockY();
|
final int entityOffsetY = to.getBlockY() - origin.getBlockY();
|
||||||
|
@ -0,0 +1,402 @@
|
|||||||
|
package com.sk89q.worldedit.math;
|
||||||
|
|
||||||
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
|
import com.sk89q.worldedit.extent.Extent;
|
||||||
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
|
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||||
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
|
|
||||||
|
import java.util.Comparator;
|
||||||
|
|
||||||
|
public class DelegateBlockVector3 extends BlockVector3 {
|
||||||
|
private BlockVector3 parent;
|
||||||
|
|
||||||
|
public DelegateBlockVector3 init(BlockVector3 parent) {
|
||||||
|
this.parent = parent;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BlockVector3 at(double x, double y, double z) {
|
||||||
|
return BlockVector3.at(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BlockVector3 at(int x, int y, int z) {
|
||||||
|
return BlockVector3.at(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isLongPackable(BlockVector3 location) {
|
||||||
|
return BlockVector3.isLongPackable(location);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void checkLongPackable(BlockVector3 location) {
|
||||||
|
BlockVector3.checkLongPackable(location);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BlockVector3 fromLongPackedForm(long packed) {
|
||||||
|
return BlockVector3.fromLongPackedForm(packed);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Comparator<BlockVector3> sortByCoordsYzx() {
|
||||||
|
return BlockVector3.sortByCoordsYzx();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MutableBlockVector3 setComponents(double x, double y, double z) {
|
||||||
|
return parent.setComponents(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MutableBlockVector3 setComponents(int x, int y, int z) {
|
||||||
|
return parent.setComponents(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MutableBlockVector3 mutX(double x) {
|
||||||
|
return parent.mutX(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MutableBlockVector3 mutY(double y) {
|
||||||
|
return parent.mutY(y);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MutableBlockVector3 mutZ(double z) {
|
||||||
|
return parent.mutZ(z);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MutableBlockVector3 mutX(int x) {
|
||||||
|
return parent.mutX(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MutableBlockVector3 mutY(int y) {
|
||||||
|
return parent.mutY(y);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MutableBlockVector3 mutZ(int z) {
|
||||||
|
return parent.mutZ(z);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 toImmutable() {
|
||||||
|
return parent.toImmutable();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long toLongPackedForm() {
|
||||||
|
return parent.toLongPackedForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getX() {
|
||||||
|
return parent.getX();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getBlockX() {
|
||||||
|
return parent.getBlockX();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 withX(int x) {
|
||||||
|
return parent.withX(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getY() {
|
||||||
|
return parent.getY();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getBlockY() {
|
||||||
|
return parent.getBlockY();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 withY(int y) {
|
||||||
|
return parent.withY(y);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getZ() {
|
||||||
|
return parent.getZ();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getBlockZ() {
|
||||||
|
return parent.getBlockZ();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 withZ(int z) {
|
||||||
|
return parent.withZ(z);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 add(BlockVector3 other) {
|
||||||
|
return parent.add(other);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 add(int x, int y, int z) {
|
||||||
|
return parent.add(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 add(BlockVector3... others) {
|
||||||
|
return parent.add(others);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 subtract(BlockVector3 other) {
|
||||||
|
return parent.subtract(other);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 subtract(int x, int y, int z) {
|
||||||
|
return parent.subtract(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 subtract(BlockVector3... others) {
|
||||||
|
return parent.subtract(others);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 multiply(BlockVector3 other) {
|
||||||
|
return parent.multiply(other);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 multiply(int x, int y, int z) {
|
||||||
|
return parent.multiply(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 multiply(BlockVector3... others) {
|
||||||
|
return parent.multiply(others);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 multiply(int n) {
|
||||||
|
return parent.multiply(n);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 divide(BlockVector3 other) {
|
||||||
|
return parent.divide(other);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 divide(int x, int y, int z) {
|
||||||
|
return parent.divide(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 divide(int n) {
|
||||||
|
return parent.divide(n);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 shr(int x, int y, int z) {
|
||||||
|
return parent.shr(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 shr(int n) {
|
||||||
|
return parent.shr(n);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 shl(int x, int y, int z) {
|
||||||
|
return parent.shl(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 shl(int n) {
|
||||||
|
return parent.shl(n);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double length() {
|
||||||
|
return parent.length();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int lengthSq() {
|
||||||
|
return parent.lengthSq();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double distance(BlockVector3 other) {
|
||||||
|
return parent.distance(other);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int distanceSq(BlockVector3 other) {
|
||||||
|
return parent.distanceSq(other);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 normalize() {
|
||||||
|
return parent.normalize();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double dot(BlockVector3 other) {
|
||||||
|
return parent.dot(other);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 cross(BlockVector3 other) {
|
||||||
|
return parent.cross(other);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean containedWithin(BlockVector3 min, BlockVector3 max) {
|
||||||
|
return parent.containedWithin(min, max);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 clampY(int min, int max) {
|
||||||
|
return parent.clampY(min, max);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 floor() {
|
||||||
|
return parent.floor();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 ceil() {
|
||||||
|
return parent.ceil();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 round() {
|
||||||
|
return parent.round();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 abs() {
|
||||||
|
return parent.abs();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 transform2D(double angle, double aboutX, double aboutZ, double translateX, double translateZ) {
|
||||||
|
return parent.transform2D(angle, aboutX, aboutZ, translateX, translateZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double toPitch() {
|
||||||
|
return parent.toPitch();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double toYaw() {
|
||||||
|
return parent.toYaw();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 getMinimum(BlockVector3 v2) {
|
||||||
|
return parent.getMinimum(v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 getMaximum(BlockVector3 v2) {
|
||||||
|
return parent.getMaximum(v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean setOrdinal(Extent orDefault, int ordinal) {
|
||||||
|
return parent.setOrdinal(orDefault, ordinal);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean setBlock(Extent orDefault, BlockState state) {
|
||||||
|
return parent.setBlock(orDefault, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean setFullBlock(Extent orDefault, BaseBlock block) {
|
||||||
|
return parent.setFullBlock(orDefault, block);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean setBiome(Extent orDefault, BiomeType biome) {
|
||||||
|
return parent.setBiome(orDefault, biome);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getOrdinal(Extent orDefault) {
|
||||||
|
return parent.getOrdinal(orDefault);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public char getOrdinalChar(Extent orDefault) {
|
||||||
|
return parent.getOrdinalChar(orDefault);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockState getBlock(Extent orDefault) {
|
||||||
|
return parent.getBlock(orDefault);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BaseBlock getFullBlock(Extent orDefault) {
|
||||||
|
return parent.getFullBlock(orDefault);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CompoundTag getNbtData(Extent orDefault) {
|
||||||
|
return parent.getNbtData(orDefault);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockState getOrdinalBelow(Extent orDefault) {
|
||||||
|
return parent.getOrdinalBelow(orDefault);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockState getStateAbove(Extent orDefault) {
|
||||||
|
return parent.getStateAbove(orDefault);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockState getStateRelativeY(Extent orDefault, int y) {
|
||||||
|
return parent.getStateRelativeY(orDefault, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector2 toBlockVector2() {
|
||||||
|
return parent.toBlockVector2();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Vector3 toVector3() {
|
||||||
|
return parent.toVector3();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
return parent.equals(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return parent.hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return parent.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockVector3 plus(BlockVector3 other) {
|
||||||
|
return parent.plus(other);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package com.sk89q.worldedit.math;
|
||||||
|
|
||||||
|
public class OffsetBlockVector3 extends DelegateBlockVector3 {
|
||||||
|
private final BlockVector3 offset;
|
||||||
|
|
||||||
|
public OffsetBlockVector3(BlockVector3 offset) {
|
||||||
|
this.offset = offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getX() {
|
||||||
|
return super.getX() + offset.getX();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getY() {
|
||||||
|
return super.getY() + offset.getY();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getZ() {
|
||||||
|
return super.getZ() + offset.getZ();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user