mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-10 06:58:34 +00:00
Current Progress #3
This commit is contained in:
@ -19,12 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit.function.block;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import com.sk89q.worldedit.Vector;
|
||||
=======
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
@ -56,13 +52,15 @@ public class BlockReplace implements RegionFunction {
|
||||
}
|
||||
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public boolean apply(Vector position) throws WorldEditException {
|
||||
return pattern.apply(extent, position, position);
|
||||
=======
|
||||
//<<<<<<< HEAD
|
||||
// public boolean apply(Vector position) throws WorldEditException {
|
||||
// return pattern.apply(extent, position, position);
|
||||
//=======
|
||||
// public boolean apply(BlockVector3 position) throws WorldEditException {
|
||||
// return extent.setBlock(position, pattern.apply(position));
|
||||
//>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
public boolean apply(BlockVector3 position) throws WorldEditException {
|
||||
return extent.setBlock(position, pattern.apply(position));
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
return pattern.apply(extent, position, position);
|
||||
}
|
||||
|
||||
|
||||
|
@ -22,16 +22,12 @@ package com.sk89q.worldedit.function.block;
|
||||
import com.boydti.fawe.util.ReflectionUtils;
|
||||
import com.sk89q.jnbt.ByteTag;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
<<<<<<< HEAD
|
||||
import com.sk89q.jnbt.Tag;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
=======
|
||||
import com.sk89q.jnbt.CompoundTagBuilder;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
import com.sk89q.worldedit.internal.helper.MCDirections;
|
||||
@ -40,16 +36,13 @@ import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.math.transform.Transform;
|
||||
import com.sk89q.worldedit.util.Direction;
|
||||
import com.sk89q.worldedit.util.Direction.Flag;
|
||||
<<<<<<< HEAD
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
=======
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
//import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
|
||||
/**
|
||||
* Copies blocks from one extent to another.
|
||||
@ -85,16 +78,16 @@ public class ExtentBlockCopy implements RegionFunction {
|
||||
}
|
||||
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public boolean apply(Vector position) throws WorldEditException {
|
||||
Vector orig = position.subtract(from);
|
||||
Vector transformed = transform.apply(orig);
|
||||
=======
|
||||
//<<<<<<< HEAD
|
||||
public boolean apply(BlockVector3 position) throws WorldEditException {
|
||||
BaseBlock block = source.getFullBlock(position);
|
||||
BlockVector3 orig = position.subtract(from);
|
||||
BlockVector3 transformed = transform.apply(orig.toVector3()).toBlockPoint();
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
//=======
|
||||
// public boolean apply(BlockVector3 position) throws WorldEditException {
|
||||
// BaseBlock block = source.getFullBlock(position);
|
||||
// BlockVector3 orig = position.subtract(from);
|
||||
// BlockVector3 transformed = transform.apply(orig.toVector3()).toBlockPoint();
|
||||
//>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
|
||||
// Apply transformations to NBT data if necessary
|
||||
BlockStateHolder block = transformNbtData(source.getBlock(position));
|
||||
@ -119,18 +112,18 @@ public class ExtentBlockCopy implements RegionFunction {
|
||||
Direction direction = MCDirections.fromRotation(rot);
|
||||
|
||||
if (direction != null) {
|
||||
<<<<<<< HEAD
|
||||
Vector applyAbsolute = transform.apply(direction.toVector());
|
||||
Vector applyOrigin = transform.apply(Vector.ZERO);
|
||||
applyAbsolute.mutX(applyAbsolute.getX() - applyOrigin.getX());
|
||||
applyAbsolute.mutY(applyAbsolute.getY() - applyOrigin.getY());
|
||||
applyAbsolute.mutZ(applyAbsolute.getZ() - applyOrigin.getZ());
|
||||
=======
|
||||
//<<<<<<< HEAD
|
||||
// Vector applyAbsolute = transform.apply(direction.toVector());
|
||||
// Vector applyOrigin = transform.apply(Vector.ZERO);
|
||||
// applyAbsolute.mutX(applyAbsolute.getX() - applyOrigin.getX());
|
||||
// applyAbsolute.mutY(applyAbsolute.getY() - applyOrigin.getY());
|
||||
// applyAbsolute.mutZ(applyAbsolute.getZ() - applyOrigin.getZ());
|
||||
//=======
|
||||
Vector3 vector = transform.apply(direction.toVector()).subtract(transform.apply(Vector3.ZERO)).normalize();
|
||||
Direction newDirection = Direction.findClosest(vector, Flag.CARDINAL | Flag.ORDINAL | Flag.SECONDARY_ORDINAL);
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
//>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
|
||||
Direction newDirection = Direction.findClosest(applyAbsolute, Flag.CARDINAL | Flag.ORDINAL | Flag.SECONDARY_ORDINAL);
|
||||
// Direction newDirection = Direction.findClosest(applyAbsolute, Flag.CARDINAL | Flag.ORDINAL | Flag.SECONDARY_ORDINAL);
|
||||
|
||||
if (newDirection != null) {
|
||||
Map<String, Tag> values = ReflectionUtils.getMap(tag.getValue());
|
||||
|
@ -29,13 +29,10 @@ import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.function.LayerFunction;
|
||||
import com.sk89q.worldedit.function.mask.BlockTypeMask;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
<<<<<<< HEAD
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
=======
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
||||
|
||||
/**
|
||||
* Makes a layer of grass on top, three layers of dirt below, and smooth stone
|
||||
|
Reference in New Issue
Block a user