From fb91456bddbdc1a7319dd950900613d41d215608 Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Fri, 11 Oct 2019 10:34:56 -0400 Subject: [PATCH] Some changes to make the diff between 1.14-snapshot and commanding branch smaller. --- .../src/main/java/com/boydti/fawe/beta/IChunk.java | 2 +- .../java/com/boydti/fawe/beta/IQueueExtent.java | 11 +++++++---- .../beta/implementation/blocks/CharBlocks.java | 3 +-- .../beta/implementation/blocks/CharGetBlocks.java | 2 -- .../beta/implementation/holder/DelegateChunk.java | 14 +++++--------- .../visualization/cfi/HeightMapMCAGenerator.java | 7 +++++++ .../changeset/AbstractDelegateChangeSet.java | 10 +++++----- .../object/function/block/CombinedBlockCopy.java | 2 +- .../object/function/block/SimpleBlockCopy.java | 2 +- 9 files changed, 28 insertions(+), 25 deletions(-) diff --git a/worldedit-core/src/main/java/com/boydti/fawe/beta/IChunk.java b/worldedit-core/src/main/java/com/boydti/fawe/beta/IChunk.java index fe360a387..3894a0c9f 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/beta/IChunk.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/beta/IChunk.java @@ -89,7 +89,7 @@ public interface IChunk> extends Trimable, Callable, IChu * Filter through all the blocks in the chunk * * @param filter the filter - * @param block The filter block + * @param block The filter block * @param region The region allowed to filter (may be null) */ void filterBlocks(Filter filter, ChunkFilterBlock block, @Nullable Region region); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/beta/IQueueExtent.java b/worldedit-core/src/main/java/com/boydti/fawe/beta/IQueueExtent.java index becbb7b65..716967374 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/beta/IQueueExtent.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/beta/IQueueExtent.java @@ -145,7 +145,7 @@ public interface IQueueExtent extends Flushable, Trimable, Extent { * #wrap(IChunk)} * * @param isFull true if a more optimized chunk should be returned - * @return + * @return a more optimized chunk object */ IChunk create(boolean isFull); @@ -173,13 +173,16 @@ public interface IQueueExtent extends Flushable, Trimable, Extent { ChunkFilterBlock initFilterBlock(); /** - * Number of chunks in queue - * @return + * Returns the number of chunks in this queue. + * + * @return the number of chunks in this queue */ int size(); /** - * @return If queue is empty + * Returns true if this queue contains no elements. + * + * @return true if this queue contains no elements */ boolean isEmpty(); } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharBlocks.java b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharBlocks.java index 60cb7e6f7..2ec176f24 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharBlocks.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharBlocks.java @@ -113,8 +113,7 @@ public class CharBlocks implements IBlocks { return get(blocks, layer)[index]; } - public final void set(CharBlocks blocks, int layer, int index, - char value) { + public final void set(CharBlocks blocks, int layer, int index, char value) { get(blocks, layer)[index] = value; } } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharGetBlocks.java b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharGetBlocks.java index 2f3dfd368..84b857470 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharGetBlocks.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharGetBlocks.java @@ -6,8 +6,6 @@ import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; -import java.util.concurrent.Future; - public abstract class CharGetBlocks extends CharBlocks implements IChunkGet { @Override diff --git a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/holder/DelegateChunk.java b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/holder/DelegateChunk.java index 7a284df67..c5f17ba16 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/holder/DelegateChunk.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/holder/DelegateChunk.java @@ -1,29 +1,25 @@ package com.boydti.fawe.beta.implementation.holder; import com.boydti.fawe.beta.IChunk; -import com.boydti.fawe.beta.IChunkSet; import com.boydti.fawe.beta.IDelegateChunk; -import com.sk89q.jnbt.CompoundTag; - -import java.util.concurrent.Future; /** * Implementation of IDelegateChunk */ -public class DelegateChunk implements IDelegateChunk { +public class DelegateChunk implements IDelegateChunk { - private U parent; + private T parent; - public DelegateChunk(U parent) { + public DelegateChunk(final T parent) { this.parent = parent; } @Override - public final U getParent() { + public final T getParent() { return parent; } - public final void setParent(U parent) { + public final void setParent(final T parent) { this.parent = parent; } } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/cfi/HeightMapMCAGenerator.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/cfi/HeightMapMCAGenerator.java index 12f1eac59..617c071c2 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/cfi/HeightMapMCAGenerator.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/cfi/HeightMapMCAGenerator.java @@ -25,6 +25,7 @@ import com.boydti.fawe.util.image.ImageViewer; import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.entity.Player; @@ -43,6 +44,7 @@ import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.registry.state.PropertyKey; import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.util.Location; +import com.sk89q.worldedit.util.TreeGenerator; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeTypes; @@ -1946,6 +1948,11 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr return false; } + @Override + public boolean generateTree(TreeGenerator.TreeType type, EditSession editSession, BlockVector3 position) throws MaxChangedBlocksException { + return false; + } + @Override public void dropItem(Vector3 position, BaseItemStack item) { // TODO Auto-generated method stub diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/AbstractDelegateChangeSet.java b/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/AbstractDelegateChangeSet.java index ce03f61ea..b65bb501d 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/AbstractDelegateChangeSet.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/AbstractDelegateChangeSet.java @@ -31,6 +31,11 @@ public class AbstractDelegateChangeSet extends FaweChangeSet { this.waitingAsync = parent.waitingAsync; } + @Override + public boolean closeAsync() { + return parent.closeAsync(); + } + @Override public boolean flush() { return parent.flush(); @@ -61,11 +66,6 @@ public class AbstractDelegateChangeSet extends FaweChangeSet { return parent.flushAsync(); } - @Override - public boolean closeAsync() { - return parent.closeAsync(); - } - @Override public void add(int x, int y, int z, int combinedFrom, int combinedTo) { parent.add(x, y, z, combinedFrom, combinedTo); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/function/block/CombinedBlockCopy.java b/worldedit-core/src/main/java/com/boydti/fawe/object/function/block/CombinedBlockCopy.java index 4dc14588f..c42f69fb8 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/function/block/CombinedBlockCopy.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/function/block/CombinedBlockCopy.java @@ -23,6 +23,6 @@ public class CombinedBlockCopy implements RegionFunction { // BlockStateHolder block = source.getBlock(position); BaseBlock block = source.getFullBlock(position); function.apply(position); - return destination.setBlock(position.getX(),position.getY(),position.getZ(), block); + return destination.setBlock(position, block); } } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/function/block/SimpleBlockCopy.java b/worldedit-core/src/main/java/com/boydti/fawe/object/function/block/SimpleBlockCopy.java index 1784ff852..9f3e40af5 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/function/block/SimpleBlockCopy.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/function/block/SimpleBlockCopy.java @@ -17,6 +17,6 @@ public class SimpleBlockCopy implements RegionFunction { @Override public boolean apply(BlockVector3 position) throws WorldEditException { - return destination.setBlock(position.getX(),position.getY(),position.getZ(), source.getFullBlock(position)); + return destination.setBlock(position, source.getFullBlock(position)); } }