diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/CopyPastaBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/CopyPastaBrush.java index 4ddafd9d0..c9187ad11 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/CopyPastaBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/CopyPastaBrush.java @@ -67,7 +67,7 @@ public class CopyPastaBrush implements Brush, ResettableTool { @Override public boolean test(BlockVector3 vector) { if (super.test(vector) && vector.getBlockY() >= minY) { - BaseBlock block = editSession.getFullBlock(position); + BaseBlock block = editSession.getFullBlock(vector); if (!block.getBlockType().getMaterial().isAir()) { builder.add(vector, EditSession.nullBlock.toBaseBlock(), block); return true; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SurfaceSpline.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SurfaceSpline.java index d3b9eb4d8..3e6ea0c6b 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SurfaceSpline.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SurfaceSpline.java @@ -25,7 +25,7 @@ public class SurfaceSpline implements Brush { this.quality = quality; } - private ArrayList path = new ArrayList<>(); + private ArrayList path = new ArrayList<>(); @Override public void build(EditSession editSession, BlockVector3 pos, Pattern pattern, double radius) throws MaxChangedBlocksException { @@ -35,7 +35,7 @@ public class SurfaceSpline implements Brush { int max = editSession.getNearestSurfaceTerrainBlock(pos.getBlockX(), pos.getBlockZ(), pos.getBlockY(), 0, editSession.getMaxY()); if (max == -1) return; // pos.mutY(max); - path.add(Vector3.at(pos.getBlockX(), max, pos.getBlockZ())); + path.add(BlockVector3.at(pos.getBlockX(), max, pos.getBlockZ())); editSession.getPlayer().sendMessage(BBC.getPrefix() + BBC.BRUSH_SPLINE_PRIMARY_2.s()); if (!vis) return; } @@ -43,8 +43,8 @@ public class SurfaceSpline implements Brush { final List nodes = new ArrayList<>(path.size()); final KochanekBartelsInterpolation interpol = new KochanekBartelsInterpolation(); - for (final Vector3 nodevector : path) { - final Node n = new Node(nodevector); + for (final BlockVector3 nodevector : path) { + final Node n = new Node(nodevector.toVector3()); n.setTension(tension); n.setBias(bias); n.setContinuity(continuity); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java index 92d5f8150..a7a6ae3b6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java @@ -411,7 +411,8 @@ public class BlockTransformExtent extends ResettableExtent { return BlockState.getFromInternalId(newMaskedId | (internalId & (~mask))); } - int newMaskId = transformState(state, transform); + newMaskedId = transformState(state, transform); + arr[maskedId >> BlockTypes.BIT_OFFSET] = newMaskedId & mask; return BlockState.getFromInternalId(newMaskedId); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/fluent/DispatcherNode.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/fluent/DispatcherNode.java index 96bc98865..6725a0283 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/fluent/DispatcherNode.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/fluent/DispatcherNode.java @@ -86,7 +86,7 @@ public class DispatcherNode { * @see ParametricBuilder#registerMethodsAsCommands(com.sk89q.worldedit.util.command.Dispatcher, Object) */ public DispatcherNode registerMethods(Object object) { - return registerMethods(object, null); + return registerMethods(object, object instanceof CallableProcessor ? (CallableProcessor) object : null); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricBuilder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricBuilder.java index 4d3fbd6be..43f809dd5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricBuilder.java @@ -194,6 +194,9 @@ public class ParametricBuilder { else if (object instanceof CallableProcessor) { callable = new ProcessedCallable(callable, (CallableProcessor) object); } + if (object instanceof MethodCommands) { + ((MethodCommands) object).register(method, callable, dispatcher); + } dispatcher.registerCommand(callable, definition.aliases()); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java index c048ba73e..6ab42e12c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockStateHolder.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.world.block; import com.sk89q.worldedit.blocks.TileEntityBlock; import com.sk89q.worldedit.function.pattern.FawePattern; import com.sk89q.jnbt.CompoundTag; +import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.registry.state.PropertyKey; import com.sk89q.worldedit.world.registry.BlockMaterial; @@ -32,6 +33,11 @@ import java.util.stream.Collectors; public interface BlockStateHolder> extends FawePattern, TileEntityBlock { + @Override + default BaseBlock apply(BlockVector3 position) { + return this.toBaseBlock(); + } + /** * Get the block type *