From 46f5b12b368bd09e09930153c56357f10e2008ed Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Mon, 22 Jul 2019 16:42:40 -0400 Subject: [PATCH] Convert tabs to whitespace. --- .../adapter/v1_13_1/Spigot_v1_13_R2.java | 34 ++-- .../fawe/bukkit/filter/WorldGuardFilter.java | 9 +- .../bukkit/listener/CFIPacketListener.java | 14 +- .../fawe/bukkit/regions/WorldguardFlag.java | 12 +- .../bukkit/v1_14/adapter/Spigot_v1_14_R1.java | 28 ++-- .../fawe/bukkit/wrapper/AsyncBlock.java | 24 +-- .../fawe/bukkit/wrapper/AsyncChunk.java | 16 +- .../fawe/bukkit/wrapper/AsyncWorld.java | 148 +++++++++--------- .../fawe/bukkit/wrapper/state/AsyncSign.java | 18 +-- .../sk89q/worldedit/bukkit/BukkitAdapter.java | 8 +- .../bukkit/adapter/CachedBukkitAdapter.java | 13 +- .../bukkit/adapter/IBukkitAdapter.java | 15 +- .../boydti/fawe/command/AnvilCommands.java | 30 ++-- .../main/java/com/boydti/fawe/config/BBC.java | 3 +- .../boydti/fawe/jnbt/SchematicStreamer.java | 2 +- .../com/boydti/fawe/object/FawePlayer.java | 8 +- .../com/boydti/fawe/object/HistoryExtent.java | 18 +-- .../com/boydti/fawe/object/NullChangeSet.java | 20 +-- .../fawe/object/brush/CopyPastaBrush.java | 2 +- .../boydti/fawe/object/brush/HeightBrush.java | 4 +- .../boydti/fawe/object/brush/SplineBrush.java | 6 +- .../fawe/object/brush/SurfaceSpline.java | 2 +- .../object/brush/heightmap/HeightMap.java | 4 +- .../brush/visualization/VirtualWorld.java | 2 +- .../changeset/AbstractDelegateChangeSet.java | 20 +-- .../fawe/object/changeset/AnvilHistory.java | 20 +-- .../fawe/object/changeset/CFIChangeSet.java | 20 +-- .../changeset/CPUOptimizedChangeSet.java | 20 +-- .../object/changeset/DiskStorageHistory.java | 19 ++- .../changeset/MemoryOptimizedHistory.java | 18 +-- .../fawe/object/clipboard/FaweClipboard.java | 21 ++- .../clipboard/MemoryOptimizedClipboard.java | 2 +- .../object/clipboard/ReadOnlyClipboard.java | 2 +- .../clipboard/ResizableClipboardBuilder.java | 4 +- .../object/clipboard/WorldCopyClipboard.java | 16 +- .../object/collection/BlockVectorSet.java | 4 +- .../collection/LocalBlockVector2DSet.java | 4 +- .../collection/LocalBlockVectorSet.java | 4 +- .../object/collection/SummedAreaTable.java | 6 +- .../object/extent/BlockTranslateExtent.java | 4 +- .../boydti/fawe/object/extent/NullExtent.java | 24 +-- .../extent/PositionTransformExtent.java | 2 +- .../fawe/object/extent/StripNBTExtent.java | 12 +- .../fawe/object/extent/TemporalExtent.java | 4 +- .../fawe/object/extent/TransformExtent.java | 17 +- .../function/block/CombinedBlockCopy.java | 6 +- .../fawe/object/mask/AdjacentAnyMask.java | 22 +-- .../boydti/fawe/object/mask/AdjacentMask.java | 2 +- .../boydti/fawe/object/mask/BiomeMask.java | 2 +- .../com/boydti/fawe/object/mask/WallMask.java | 2 +- .../boydti/fawe/object/pattern/IdPattern.java | 11 +- .../pattern/SurfaceRandomOffsetPattern.java | 7 +- .../fawe/object/regions/PolyhedralRegion.java | 19 ++- .../fawe/object/visitor/DFSVisitor.java | 6 +- .../general/plot/FaweLocalBlockQueue.java | 8 +- .../java/com/boydti/fawe/util/WEManager.java | 8 +- .../boydti/fawe/wrappers/PlayerWrapper.java | 8 +- .../boydti/fawe/wrappers/WorldWrapper.java | 16 +- .../java/com/sk89q/worldedit/EditSession.java | 36 ++--- .../worldedit/command/RegionCommands.java | 6 +- .../parser/mask/DefaultMaskParser.java | 8 +- .../platform/binding/AnnotatedBindings.java | 3 +- .../extent/AbstractDelegateExtent.java | 7 +- .../extent/clipboard/BlockArrayClipboard.java | 12 +- .../extent/clipboard/io/ClipboardFormats.java | 23 ++- .../function/block/BlockReplace.java | 2 +- .../operation/BackwardsExtentBlockCopy.java | 14 +- .../function/visitor/BreadthFirstSearch.java | 5 +- .../worldedit/math/convolution/HeightMap.java | 2 +- .../worldedit/util/paste/IncendoPaste.java | 22 +-- .../worldedit/world/block/BaseBlock.java | 45 +++--- .../worldedit/world/block/BlockState.java | 14 +- .../worldedit/world/block/BlockType.java | 16 +- .../sk89q/worldedit/world/item/ItemType.java | 4 +- .../world/registry/LegacyMapper.java | 40 ++--- 75 files changed, 513 insertions(+), 546 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/Spigot_v1_13_R2.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/Spigot_v1_13_R2.java index e134b532d..3da21ac6e 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/Spigot_v1_13_R2.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/Spigot_v1_13_R2.java @@ -277,7 +277,7 @@ public final class Spigot_v1_13_R2 extends CachedBukkitAdapter implements Bukkit sections[y4] = section = new ChunkSection(y4 << 4, nmsWorld.worldProvider.g()); } if (existing.e() != blockData.e() || existing.getMaterial().f() != blockData.getMaterial().f()) { - nmsChunk.setType(pos = new BlockPosition(x, y, z), blockData, false); + nmsChunk.setType(pos = new BlockPosition(x, y, z), blockData, false); } else { section.setType(x & 15, y & 15, z & 15, blockData); } @@ -555,25 +555,25 @@ public final class Spigot_v1_13_R2 extends CachedBukkitAdapter implements Bukkit return material.getCraftBlockData(); } - @Override - public void sendFakeNBT(Player player, BlockVector3 pos, CompoundTag nbtData) { - // TODO Auto-generated method stub + @Override + public void sendFakeNBT(Player player, BlockVector3 pos, CompoundTag nbtData) { + // TODO Auto-generated method stub - } + } - @Override - public void notifyAndLightBlock(Location position, BlockState previousType) { - this.setBlock(position.getChunk(), position.getBlockX(), position.getBlockY(), position.getBlockZ(), previousType, true); - } + @Override + public void notifyAndLightBlock(Location position, BlockState previousType) { + this.setBlock(position.getChunk(), position.getBlockX(), position.getBlockY(), position.getBlockZ(), previousType, true); + } - @Override - public boolean setBlock(Location location, BlockStateHolder state, boolean notifyAndLight) { - return this.setBlock(location.getChunk(), location.getBlockX(), location.getBlockY(), location.getBlockZ(), state, notifyAndLight); - } + @Override + public boolean setBlock(Location location, BlockStateHolder state, boolean notifyAndLight) { + return this.setBlock(location.getChunk(), location.getBlockX(), location.getBlockY(), location.getBlockZ(), state, notifyAndLight); + } - @Override - public void sendFakeOP(Player player) { - // TODO Auto-generated method stub + @Override + public void sendFakeOP(Player player) { + // TODO Auto-generated method stub - } + } } diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/filter/WorldGuardFilter.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/filter/WorldGuardFilter.java index 2f4443d81..2a421b1c4 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/filter/WorldGuardFilter.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/filter/WorldGuardFilter.java @@ -1,5 +1,7 @@ package com.boydti.fawe.bukkit.filter; +import static com.google.common.base.Preconditions.checkNotNull; + import com.boydti.fawe.Fawe; import com.boydti.fawe.FaweAPI; import com.boydti.fawe.object.RunnableVal; @@ -13,9 +15,6 @@ import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion; import com.sk89q.worldguard.protection.regions.ProtectedRegion; import org.bukkit.World; - -import static com.google.common.base.Preconditions.checkNotNull; - public class WorldGuardFilter extends CuboidRegionFilter { private final World world; private boolean large; @@ -32,8 +31,8 @@ public class WorldGuardFilter extends CuboidRegionFilter { public void run(Object value) { WorldGuardFilter.this.manager = WorldGuard.getInstance().getPlatform().getRegionContainer().get(FaweAPI.getWorld(world.getName())); for (ProtectedRegion region : manager.getRegions().values()) { - BlockVector3 min = region.getMinimumPoint(); - BlockVector3 max = region.getMaximumPoint(); + BlockVector3 min = region.getMinimumPoint(); + BlockVector3 max = region.getMaximumPoint(); if (max.getBlockX() - min.getBlockX() > 1024 || max.getBlockZ() - min.getBlockZ() > 1024) { Fawe.debug("Large or complex region shapes cannot be optimized. Filtering will be slower"); large = true; diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/listener/CFIPacketListener.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/listener/CFIPacketListener.java index cec672dd0..30005a683 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/listener/CFIPacketListener.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/listener/CFIPacketListener.java @@ -125,7 +125,7 @@ public class CFIPacketListener implements Listener { VirtualWorld gen = getGenerator(event); if (gen != null) { - BlockVector3 origin = gen.getOrigin().toBlockPoint(); + BlockVector3 origin = gen.getOrigin().toBlockPoint(); PacketContainer packet = event.getPacket(); StructureModifier ints = packet.getIntegers(); int cx = ints.read(0); @@ -160,8 +160,8 @@ public class CFIPacketListener implements Listener { Location pos = player.getLocation(); VirtualWorld gen = getGenerator(event); if (gen != null) { - BlockVector3 origin = gen.getOrigin().toBlockPoint(); - BlockVector3 pt = BlockVector3.at(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ()); + BlockVector3 origin = gen.getOrigin().toBlockPoint(); + BlockVector3 pt = BlockVector3.at(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ()); StructureModifier ints = event.getPacket().getIntegers(); int id = ints.read(0); @@ -185,8 +185,8 @@ public class CFIPacketListener implements Listener { Location pos = player.getLocation(); VirtualWorld gen = getGenerator(event); if (gen != null) { - BlockVector3 origin = gen.getOrigin().toBlockPoint(); - BlockVector3 from = BlockVector3.at(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ()); + BlockVector3 origin = gen.getOrigin().toBlockPoint(); + BlockVector3 from = BlockVector3.at(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ()); PacketContainer packet = event.getPacket(); StructureModifier doubles = packet.getDoubles(); @@ -248,7 +248,7 @@ public class CFIPacketListener implements Listener { BlockInteractEvent toCall = new BlockInteractEvent(actor, location, action); platform.handleBlockInteract(toCall); if (toCall.isCancelled() || action == Interaction.OPEN) { - BlockVector3 realPos = pt.add(gen.getOrigin().toBlockPoint()); + BlockVector3 realPos = pt.add(gen.getOrigin().toBlockPoint()); BlockStateHolder block = gen.getBlock(pt); sendBlockChange(plr, realPos, block); return true; @@ -287,7 +287,7 @@ public class CFIPacketListener implements Listener { private void handleBlockEvent(PacketEvent event, boolean relative, RunnableVal3 task) { VirtualWorld gen = getGenerator(event); if (gen != null) { - BlockVector3 pt = getRelPos(event, gen); + BlockVector3 pt = getRelPos(event, gen); if (pt != null) { if (relative) pt = getRelative(event, pt); if (gen.contains(pt)) { diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/WorldguardFlag.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/WorldguardFlag.java index 333728814..4e5d5e7ed 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/WorldguardFlag.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/WorldguardFlag.java @@ -22,9 +22,9 @@ import java.util.Map; public class WorldguardFlag extends BukkitMaskManager implements Listener { private WorldGuardPlugin worldguard; - FaweBukkit plugin; + private FaweBukkit plugin; - public WorldguardFlag(final Plugin p2, final FaweBukkit p3) { + public WorldguardFlag(Plugin p2, FaweBukkit p3) { super("worldguardflag"); this.worldguard = (WorldGuardPlugin) p2; // this.getWorldGuard(); this.plugin = p3; @@ -66,9 +66,9 @@ public class WorldguardFlag extends BukkitMaskManager implements Listener { @Override public BlockVector3 getMinimumPoint() { - BlockVector3 point = null; + BlockVector3 point = null; for (Map.Entry entry : manager.getRegions().entrySet()) { - BlockVector3 p = entry.getValue().getMinimumPoint(); + BlockVector3 p = entry.getValue().getMinimumPoint(); if (point == null) { point = p; continue; @@ -80,9 +80,9 @@ public class WorldguardFlag extends BukkitMaskManager implements Listener { @Override public BlockVector3 getMaximumPoint() { - BlockVector3 point = null; + BlockVector3 point = null; for (Map.Entry entry : manager.getRegions().entrySet()) { - BlockVector3 p = entry.getValue().getMaximumPoint(); + BlockVector3 p = entry.getValue().getMaximumPoint(); if (point == null) { point = p; continue; diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v1_14/adapter/Spigot_v1_14_R1.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v1_14/adapter/Spigot_v1_14_R1.java index 6aa146a24..a636b78b1 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v1_14/adapter/Spigot_v1_14_R1.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v1_14/adapter/Spigot_v1_14_R1.java @@ -601,29 +601,29 @@ public final class Spigot_v1_14_R1 extends CachedBukkitAdapter implements Bukkit return material.getCraftBlockData(); } - @Override - public void sendFakeNBT(Player player, BlockVector3 pos, CompoundTag nbtData) { + @Override + public void sendFakeNBT(Player player, BlockVector3 pos, CompoundTag nbtData) { ((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutTileEntityData( new BlockPosition(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ()), 7, (NBTTagCompound) fromNative(nbtData) )); - } + } - @Override - public void notifyAndLightBlock(Location position, BlockState previousType) { - this.setBlock(position.getChunk(), position.getBlockX(), position.getBlockY(), position.getBlockZ(), previousType, true); - } + @Override + public void notifyAndLightBlock(Location position, BlockState previousType) { + this.setBlock(position.getChunk(), position.getBlockX(), position.getBlockY(), position.getBlockZ(), previousType, true); + } - @Override - public boolean setBlock(Location location, BlockStateHolder state, boolean notifyAndLight) { - return this.setBlock(location.getChunk(), location.getBlockX(), location.getBlockY(), location.getBlockZ(), state, notifyAndLight); - } + @Override + public boolean setBlock(Location location, BlockStateHolder state, boolean notifyAndLight) { + return this.setBlock(location.getChunk(), location.getBlockX(), location.getBlockY(), location.getBlockZ(), state, notifyAndLight); + } - @Override - public void sendFakeOP(Player player) { + @Override + public void sendFakeOP(Player player) { ((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityStatus( ((CraftPlayer) player).getHandle(), (byte) 28 )); - } + } } diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncBlock.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncBlock.java index 23a266da5..61ec93e2d 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncBlock.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncBlock.java @@ -366,20 +366,20 @@ public class AsyncBlock implements Block { this.getUnsafeBlock().removeMetadata(metadataKey, owningPlugin); } - @Override - public boolean isPassable() { - return this.getUnsafeBlock().isPassable(); - } + @Override + public boolean isPassable() { + return this.getUnsafeBlock().isPassable(); + } - @Override - public RayTraceResult rayTrace(@NotNull Location arg0, @NotNull Vector arg1, double arg2, @NotNull FluidCollisionMode arg3) { - return this.getUnsafeBlock().rayTrace(arg0, arg1, arg2, arg3); - } + @Override + public RayTraceResult rayTrace(@NotNull Location arg0, @NotNull Vector arg1, double arg2, @NotNull FluidCollisionMode arg3) { + return this.getUnsafeBlock().rayTrace(arg0, arg1, arg2, arg3); + } - @NotNull @Override - public BoundingBox getBoundingBox() { - return this.getUnsafeBlock().getBoundingBox(); - } + @NotNull @Override + public BoundingBox getBoundingBox() { + return this.getUnsafeBlock().getBoundingBox(); + } @Override public @NotNull BlockSoundGroup getSoundGroup() { diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncChunk.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncChunk.java index f92a0db3c..1e1baed2c 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncChunk.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncChunk.java @@ -172,15 +172,15 @@ public class AsyncChunk implements Chunk { return false; } - @Override - public boolean isForceLoaded() { - return world.isChunkForceLoaded(x, z); - } + @Override + public boolean isForceLoaded() { + return world.isChunkForceLoaded(x, z); + } - @Override - public void setForceLoaded(boolean arg0) { - world.getChunkAt(x, z).setForceLoaded(arg0); - } + @Override + public void setForceLoaded(boolean arg0) { + world.getChunkAt(x, z).setForceLoaded(arg0); + } @Override public boolean addPluginChunkTicket(final Plugin plugin) { diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncWorld.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncWorld.java index 93d4447de..51562304a 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncWorld.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncWorld.java @@ -1088,97 +1088,97 @@ public class AsyncWorld extends DelegateFaweQueue implements World, HasFaweQueue return adapter; } - @Override - public Collection getNearbyEntities(BoundingBox arg0) { - return parent.getNearbyEntities(arg0); - } + @Override + public Collection getNearbyEntities(BoundingBox arg0) { + return parent.getNearbyEntities(arg0); + } - @Override - public Collection getNearbyEntities(BoundingBox arg0, Predicate arg1) { - return parent.getNearbyEntities(arg0, arg1); - } + @Override + public Collection getNearbyEntities(BoundingBox arg0, Predicate arg1) { + return parent.getNearbyEntities(arg0, arg1); + } - @Override - public Collection getNearbyEntities(Location arg0, double arg1, double arg2, double arg3, - Predicate arg4) { - return parent.getNearbyEntities(arg0, arg1, arg2, arg3, arg4); - } + @Override + public Collection getNearbyEntities(Location arg0, double arg1, double arg2, double arg3, + Predicate arg4) { + return parent.getNearbyEntities(arg0, arg1, arg2, arg3, arg4); + } - @Override - public boolean isChunkForceLoaded(int arg0, int arg1) { - return parent.isChunkForceLoaded(arg0, arg1); - } + @Override + public boolean isChunkForceLoaded(int arg0, int arg1) { + return parent.isChunkForceLoaded(arg0, arg1); + } - @Override - public Location locateNearestStructure(Location arg0, StructureType arg1, int arg2, boolean arg3) { - return parent.locateNearestStructure(arg0, arg1, arg2, arg3); - } + @Override + public Location locateNearestStructure(Location arg0, StructureType arg1, int arg2, boolean arg3) { + return parent.locateNearestStructure(arg0, arg1, arg2, arg3); + } - @Override - public RayTraceResult rayTrace(Location arg0, Vector arg1, double arg2, FluidCollisionMode arg3, boolean arg4, - double arg5, Predicate arg6) { - return parent.rayTrace(arg0, arg1, arg2, arg3, arg4, arg5, arg6); - } + @Override + public RayTraceResult rayTrace(Location arg0, Vector arg1, double arg2, FluidCollisionMode arg3, boolean arg4, + double arg5, Predicate arg6) { + return parent.rayTrace(arg0, arg1, arg2, arg3, arg4, arg5, arg6); + } - @Override - public RayTraceResult rayTraceBlocks(Location arg0, Vector arg1, double arg2) { - return parent.rayTraceBlocks(arg0, arg1, arg2); - } + @Override + public RayTraceResult rayTraceBlocks(Location arg0, Vector arg1, double arg2) { + return parent.rayTraceBlocks(arg0, arg1, arg2); + } - @Override - public RayTraceResult rayTraceBlocks(Location arg0, Vector arg1, double arg2, FluidCollisionMode arg3) { - return parent.rayTraceBlocks(arg0, arg1, arg2, arg3); - } + @Override + public RayTraceResult rayTraceBlocks(Location arg0, Vector arg1, double arg2, FluidCollisionMode arg3) { + return parent.rayTraceBlocks(arg0, arg1, arg2, arg3); + } - @Override - public RayTraceResult rayTraceBlocks(Location arg0, Vector arg1, double arg2, FluidCollisionMode arg3, - boolean arg4) { - return parent.rayTraceBlocks(arg0, arg1, arg2, arg3, arg4); - } + @Override + public RayTraceResult rayTraceBlocks(Location arg0, Vector arg1, double arg2, FluidCollisionMode arg3, + boolean arg4) { + return parent.rayTraceBlocks(arg0, arg1, arg2, arg3, arg4); + } - @Override - public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2) { - return parent.rayTraceEntities(arg0, arg1, arg2); - } + @Override + public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2) { + return parent.rayTraceEntities(arg0, arg1, arg2); + } - @Override - public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2, double arg3) { - return parent.rayTraceEntities(arg0, arg1, arg2, arg3); - } + @Override + public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2, double arg3) { + return parent.rayTraceEntities(arg0, arg1, arg2, arg3); + } - @Override - public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2, Predicate arg3) { - return parent.rayTraceEntities(arg0, arg1, arg2, arg3); - } + @Override + public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2, Predicate arg3) { + return parent.rayTraceEntities(arg0, arg1, arg2, arg3); + } - @Override - public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2, double arg3, - Predicate arg4) { - return parent.rayTraceEntities(arg0, arg1, arg2, arg3, arg4); - } + @Override + public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2, double arg3, + Predicate arg4) { + return parent.rayTraceEntities(arg0, arg1, arg2, arg3, arg4); + } - @Override - public void spawnParticle(Particle arg0, Location arg1, int arg2, double arg3, double arg4, double arg5, - double arg6, T arg7, boolean arg8) { - parent.spawnParticle(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); - } + @Override + public void spawnParticle(Particle arg0, Location arg1, int arg2, double arg3, double arg4, double arg5, + double arg6, T arg7, boolean arg8) { + parent.spawnParticle(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); + } - @Override - public void spawnParticle(Particle arg0, double arg1, double arg2, double arg3, int arg4, double arg5, - double arg6, double arg7, double arg8, T arg9, boolean arg10) { - parent.spawnParticle(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); + @Override + public void spawnParticle(Particle arg0, double arg1, double arg2, double arg3, int arg4, double arg5, + double arg6, double arg7, double arg8, T arg9, boolean arg10) { + parent.spawnParticle(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); - } + } - @Override - public void setChunkForceLoaded(int x, int z, boolean forced) { - parent.setChunkForceLoaded(x, z, forced); - } + @Override + public void setChunkForceLoaded(int x, int z, boolean forced) { + parent.setChunkForceLoaded(x, z, forced); + } - @Override - public Collection getForceLoadedChunks() { - return parent.getForceLoadedChunks(); - } + @Override + public Collection getForceLoadedChunks() { + return parent.getForceLoadedChunks(); + } @Override public boolean addPluginChunkTicket(int x, int z, @NotNull Plugin plugin) { diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/state/AsyncSign.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/state/AsyncSign.java index 9525f601f..09ac437a4 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/state/AsyncSign.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/wrapper/state/AsyncSign.java @@ -20,7 +20,7 @@ public class AsyncSign extends AsyncBlockState implements Sign { public AsyncSign(AsyncBlock block, int combined) { super(block, combined); } - + private boolean isEditable = false; @Override @@ -60,15 +60,15 @@ public class AsyncSign extends AsyncBlockState implements Sign { } } - @Override - public boolean isEditable() { - return this.isEditable; - } + @Override + public boolean isEditable() { + return this.isEditable; + } - @Override - public void setEditable(boolean arg0) { - this.isEditable = arg0; - } + @Override + public void setEditable(boolean arg0) { + this.isEditable = arg0; + } @Override public @NotNull PersistentDataContainer getPersistentDataContainer() { diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java index 88c7685d2..034f01bcd 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java @@ -327,7 +327,7 @@ public enum BukkitAdapter { * @return The Bukkit BlockData */ public static BlockData adapt(@NotNull BlockStateHolder block) { - return getAdapter().adapt(block); + return getAdapter().adapt(block); } public static BlockData getBlockData(int combinedId) { @@ -341,11 +341,11 @@ public enum BukkitAdapter { * @return The WorldEdit BlockState */ public static BlockState asBlockState(ItemStack itemStack) throws WorldEditException { - checkNotNull(itemStack); - if (itemStack.getType().isBlock()) { + checkNotNull(itemStack); + if (itemStack.getType().isBlock()) { return getAdapter().asBlockState(itemStack); } else { - throw new NotABlockException(); + throw new NotABlockException(); } } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/CachedBukkitAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/CachedBukkitAdapter.java index c62dbc75b..76e0392d7 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/CachedBukkitAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/CachedBukkitAdapter.java @@ -1,23 +1,18 @@ package com.sk89q.worldedit.bukkit.adapter; -import com.bekvon.bukkit.residence.commands.material; -import com.sk89q.worldedit.bukkit.adapter.IBukkitAdapter; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemTypes; -import org.bukkit.Bukkit; +import java.util.List; import org.bukkit.Material; import org.bukkit.NamespacedKey; import org.bukkit.block.data.BlockData; -import java.util.List; - -import static com.google.common.base.Preconditions.checkNotNull; - public abstract class CachedBukkitAdapter implements IBukkitAdapter { private int[] itemTypes; private int[] blockTypes; @@ -63,7 +58,7 @@ public abstract class CachedBukkitAdapter implements IBukkitAdapter { @Override public BlockType adapt(Material material) { try { - return BlockTypes.values[blockTypes[material.ordinal()]]; + return BlockTypes.values[blockTypes[material.ordinal()]]; } catch (NullPointerException e) { if (init()) return adapt(material); throw e; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/IBukkitAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/IBukkitAdapter.java index 194ccc2c6..7c9d823d9 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/IBukkitAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/IBukkitAdapter.java @@ -1,8 +1,14 @@ package com.sk89q.worldedit.bukkit.adapter; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.NotABlockException; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.bukkit.*; +import com.sk89q.worldedit.bukkit.BukkitEntity; +import com.sk89q.worldedit.bukkit.BukkitItemStack; +import com.sk89q.worldedit.bukkit.BukkitPlayer; +import com.sk89q.worldedit.bukkit.BukkitWorld; +import com.sk89q.worldedit.bukkit.WorldEditPlugin; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.Vector3; @@ -19,6 +25,7 @@ import com.sk89q.worldedit.world.entity.EntityTypes; import com.sk89q.worldedit.world.gamemode.GameMode; import com.sk89q.worldedit.world.gamemode.GameModes; import com.sk89q.worldedit.world.item.ItemType; +import java.util.Locale; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.block.Biome; @@ -26,10 +33,6 @@ import org.bukkit.block.data.BlockData; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import java.util.Locale; - -import static com.google.common.base.Preconditions.checkNotNull; - public interface IBukkitAdapter { /** @@ -143,7 +146,7 @@ public interface IBukkitAdapter { } default org.bukkit.Location adapt(org.bukkit.World world, BlockVector3 position){ - return adapt(world, position.toVector3()); + return adapt(world, position.toVector3()); } /** diff --git a/worldedit-core/src/main/java/com/boydti/fawe/command/AnvilCommands.java b/worldedit-core/src/main/java/com/boydti/fawe/command/AnvilCommands.java index 3288c5e02..0b256ff7b 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/command/AnvilCommands.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/command/AnvilCommands.java @@ -114,7 +114,7 @@ public class AnvilCommands { descFooter = "The -d flag disabled wildcard data matching\n" ) @CommandPermissions("worldedit.anvil.replaceall") - public void replaceAll(Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, String to, @Switch(name='d', desc = "TODO") boolean useData) throws WorldEditException { + public void replaceAll(Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, String to, @Switch(name = 'd', desc = "TODO") boolean useData) throws WorldEditException { // final FaweBlockMatcher matchFrom; TODO NOT IMPLEMENTED // if (from == null) { // matchFrom = FaweBlockMatcher.NOT_AIR; @@ -178,7 +178,7 @@ public class AnvilCommands { "The auto-save interval is the recommended value for `file-duration` and `chunk-inactivity`" ) @CommandPermissions("worldedit.anvil.deleteallunclaimed") - public void deleteAllUnclaimed(Player player, int inhabitedTicks, @Arg(name = "filedurationmillis", desc = "int", def = "60000") int fileDurationMillis, @Switch(name='d', desc = "TODO") boolean debug) throws WorldEditException { + public void deleteAllUnclaimed(Player player, int inhabitedTicks, @Arg(name = "filedurationmillis", desc = "int", def = "60000") int fileDurationMillis, @Switch(name = 'd', desc = "TODO") boolean debug) throws WorldEditException { // String folder = player.getWorld().getName(); TODO NOT IMPLEMENTED // DeleteUnclaimedFilter filter = new DeleteUnclaimedFilter(player.getWorld(), fileDurationMillis, inhabitedTicks, fileDurationMillis); // if (debug) { @@ -201,7 +201,7 @@ public class AnvilCommands { "The auto-save interval is the recommended value for `file-duration` and `chunk-inactivity`" ) @CommandPermissions("worldedit.anvil.deleteunclaimed") - public void deleteUnclaimed(Player player, EditSession editSession, @Selection Region selection, int inhabitedTicks, @Arg(name = "filedurationmillis", desc = "int", def = "60000") int fileDurationMillis, @Switch(name='d', desc = "TODO") boolean debug) throws WorldEditException { + public void deleteUnclaimed(Player player, EditSession editSession, @Selection Region selection, int inhabitedTicks, @Arg(name = "filedurationmillis", desc = "int", def = "60000") int fileDurationMillis, @Switch(name = 'd', desc = "TODO") boolean debug) throws WorldEditException { // DeleteUnclaimedFilter filter = new DeleteUnclaimedFilter(player.getWorld(), fileDurationMillis, inhabitedTicks, fileDurationMillis); TODO NOT IMPLEMENTED // if (debug) { // filter.enableDebug(); @@ -238,7 +238,7 @@ public class AnvilCommands { "Unmodified chunks will be deleted\n" ) @CommandPermissions("worldedit.anvil.trimallplots") - public void trimAllPlots(Player player, @Switch(name='v', desc = "Delete unvisited chunks") boolean deleteUnvisited) throws WorldEditException { + public void trimAllPlots(Player player, @Switch(name = 'v', desc = "Delete unvisited chunks") boolean deleteUnvisited) throws WorldEditException { // String folder = player.getWorld().getName(); TODO NOT IMPLEMENTED // int visitTime = deleteUnvisited ? 1 : -1; // PlotTrimFilter filter = new PlotTrimFilter(player.getWorld(), 0, visitTime, 600000); @@ -256,7 +256,7 @@ public class AnvilCommands { desc = "Delete chunks matching a specific biome" ) @CommandPermissions("worldedit.anvil.trimallair") - public void deleteBiome(Player player, String folder, BiomeType biome, @Switch(name='u', desc = "TODO") boolean unsafe) { + public void deleteBiome(Player player, String folder, BiomeType biome, @Switch(name = 'u', desc = "TODO") boolean unsafe) { // DeleteBiomeFilterSimple filter = new DeleteBiomeFilterSimple(biome); TODO NOT IMPLEMENTED // DeleteBiomeFilterSimple result = runWithWorld(player, folder, filter, true, unsafe); // if (result != null) { @@ -269,7 +269,7 @@ public class AnvilCommands { desc = "Trim all air in the world" ) @CommandPermissions("worldedit.anvil.trimallair") - public void trimAllAir(Player player, String folder, @Switch(name='u', desc = "TODO") boolean unsafe) throws WorldEditException { + public void trimAllAir(Player player, String folder, @Switch(name = 'u', desc = "TODO") boolean unsafe) throws WorldEditException { // TrimAirFilter filter = new TrimAirFilter(); TODO NOT IMPLEMENTED // TrimAirFilter result = runWithWorld(player, folder, filter, true, unsafe); // if (result != null) { @@ -297,7 +297,7 @@ public class AnvilCommands { desc = "Replace all blocks in the selection with another" ) @CommandPermissions("worldedit.anvil.replaceall") - public void replaceAllPattern(Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch(name='d', desc = "TODO") boolean useData, @Switch(name='m', desc = "TODO") boolean useMap) throws WorldEditException { + public void replaceAllPattern(Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch(name = 'd', desc = "TODO") boolean useData, @Switch(name = 'm', desc = "TODO") boolean useMap) throws WorldEditException { // MCAFilterCounter filter; TODO NOT IMPLEMENTED // if (useMap) { // if (to instanceof RandomPattern) { @@ -326,7 +326,7 @@ public class AnvilCommands { desc = "Count all blocks in a world" ) @CommandPermissions("worldedit.anvil.countall") - public void countAll(Player player, EditSession editSession, String folder, String arg, @Switch(name='d', desc = "TODO") boolean useData) throws WorldEditException { + public void countAll(Player player, EditSession editSession, String folder, String arg, @Switch(name = 'd', desc = "TODO") boolean useData) throws WorldEditException { // Set searchBlocks = worldEdit.getBlocks(player, arg, true); // MCAFilterCounter filter; // if (useData || arg.contains(":")) { // Optimize for both cases @@ -400,7 +400,7 @@ public class AnvilCommands { desc = "Count blocks in a selection" ) @CommandPermissions("worldedit.anvil.count") - public void count(Player player, EditSession editSession, @Selection Region selection, String arg, @Switch(name='d', desc = "TODO") boolean useData) throws WorldEditException { + public void count(Player player, EditSession editSession, @Selection Region selection, String arg, @Switch(name = 'd', desc = "TODO") boolean useData) throws WorldEditException { // Set searchBlocks = worldEdit.getBlocks(player, arg, true); TODO NOT IMPLEMENTED // MCAFilterCounter filter; // if (useData || arg.contains(":")) { // Optimize for both cases @@ -422,7 +422,7 @@ public class AnvilCommands { desc = "Replace all blocks in the selection with another" ) @CommandPermissions("worldedit.anvil.distr") - public void distr(Player player, EditSession editSession, @Selection Region selection, @Switch(name='d', desc = "TODO") boolean useData) throws WorldEditException { + public void distr(Player player, EditSession editSession, @Selection Region selection, @Switch(name = 'd', desc = "TODO") boolean useData) throws WorldEditException { // long total = 0; TODO NOT IMPLEMENTED // long[] count; // MCAFilter counts; @@ -501,7 +501,7 @@ public class AnvilCommands { desc = "Replace all blocks in the selection with another" ) @CommandPermissions("worldedit.anvil.replace") - public void replace(Player player, EditSession editSession, @Selection Region selection, @Arg(name = "from", desc = "String", def = "") String from, String to, @Switch(name='d', desc = "TODO") boolean useData) throws WorldEditException { + public void replace(Player player, EditSession editSession, @Selection Region selection, @Arg(name = "from", desc = "String", def = "") String from, String to, @Switch(name = 'd', desc = "TODO") boolean useData) throws WorldEditException { // final FaweBlockMatcher matchFrom; TODO NOT IMPLEMENTED // if (from == null) { // matchFrom = FaweBlockMatcher.NOT_AIR; @@ -523,8 +523,8 @@ public class AnvilCommands { desc = "Replace all blocks in the selection with a pattern" ) @CommandPermissions("worldedit.anvil.replace") - // Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch(name='d', desc = "TODO") boolean useData, @Switch(name='m', desc = "TODO") boolean useMap - public void replacePattern(Player player, EditSession editSession, @Selection Region selection, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch(name='d', desc = "TODO") boolean useData, @Switch(name='m', desc = "TODO") boolean useMap) throws WorldEditException { + // Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch(name = 'd', desc = "TODO") boolean useData, @Switch(name = 'm', desc = "TODO") boolean useMap + public void replacePattern(Player player, EditSession editSession, @Selection Region selection, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch(name = 'd', desc = "TODO") boolean useData, @Switch(name = 'm', desc = "TODO") boolean useMap) throws WorldEditException { // MCAFilterCounter filter; TODO NOT IMPLEMENTED // if (useMap) { // if (to instanceof RandomPattern) { @@ -554,7 +554,7 @@ public class AnvilCommands { desc = "Set all blocks in the selection with a pattern" ) @CommandPermissions("worldedit.anvil.set") - // Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch(name='d', desc = "TODO") boolean useData, @Switch(name='m', desc = "TODO") boolean useMap + // Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch(name = 'd', desc = "TODO") boolean useData, @Switch(name = 'm', desc = "TODO") boolean useMap public void set(Player player, EditSession editSession, @Selection Region selection, final Pattern to) throws WorldEditException { // MCAFilterCounter filter = new SetPatternFilter(to); TODO NOT IMPLEMENTED // MCAFilterCounter result = runWithSelection(player, editSession, selection, filter); @@ -610,7 +610,7 @@ public class AnvilCommands { "The -c flag will align the paste to the chunks." ) @CommandPermissions("worldedit.anvil.pastechunks") - public void paste(Player player, LocalSession session, EditSession editSession, @Switch(name='c', desc = "TODO") boolean alignChunk) throws WorldEditException, IOException { + public void paste(Player player, LocalSession session, EditSession editSession, @Switch(name = 'c', desc = "TODO") boolean alignChunk) throws WorldEditException, IOException { // FawePlayer fp = FawePlayer.wrap(player); TODO NOT IMPLEMENTED // MCAClipboard clipboard = fp.getMeta(FawePlayer.METADATA_KEYS.ANVIL_CLIPBOARD); // if (clipboard == null) { diff --git a/worldedit-core/src/main/java/com/boydti/fawe/config/BBC.java b/worldedit-core/src/main/java/com/boydti/fawe/config/BBC.java index 41ab2f601..a155318d7 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/config/BBC.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/config/BBC.java @@ -626,7 +626,6 @@ public enum BBC { return "DARK_PURPLE"; case '6': return "GOLD"; - default: case '7': return "GRAY"; case '8': @@ -657,6 +656,8 @@ public enum BBC { return "ITALIC"; case 'r': return "RESET"; + default: + return "GRAY"; } } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/jnbt/SchematicStreamer.java b/worldedit-core/src/main/java/com/boydti/fawe/jnbt/SchematicStreamer.java index 180d9a1b7..dbd176031 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/jnbt/SchematicStreamer.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/jnbt/SchematicStreamer.java @@ -414,7 +414,7 @@ public class SchematicStreamer extends NBTStreamer { public Clipboard getClipboard() throws IOException { try { - setupClipboard(0); + setupClipboard(0); addDimensionReaders(); addBlockReaders(); readFully(); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/FawePlayer.java b/worldedit-core/src/main/java/com/boydti/fawe/object/FawePlayer.java index c622fd327..54d7607cf 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/FawePlayer.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/FawePlayer.java @@ -181,8 +181,8 @@ public abstract class FawePlayer extends Metadatable { public void checkConfirmationStack(@NotNull Runnable task, String command, Region region, int times, InjectedValueAccess context) throws RegionOperationException { if (command != null && !getMeta("cmdConfirmRunning", false)) { if (region != null) { - BlockVector3 min = region.getMinimumPoint(); - BlockVector3 max = region.getMaximumPoint(); + BlockVector3 min = region.getMinimumPoint(); + BlockVector3 max = region.getMaximumPoint(); long area = (long) ((max.getX() - min.getX()) * (max.getZ() - min.getZ() + 1)) * times; if (area > 2 << 18) { setConfirmTask(task, context, command); @@ -198,8 +198,8 @@ public abstract class FawePlayer extends Metadatable { public void checkConfirmationRegion(@NotNull Runnable task, String command, Region region, InjectedValueAccess context) throws RegionOperationException { if (command != null && !getMeta("cmdConfirmRunning", false)) { if (region != null) { - BlockVector3 min = region.getMinimumPoint(); - BlockVector3 max = region.getMaximumPoint(); + BlockVector3 min = region.getMinimumPoint(); + BlockVector3 max = region.getMaximumPoint(); long area = (max.getX() - min.getX()) * (max.getZ() - min.getZ() + 1); if (area > 2 << 18) { setConfirmTask(task, context, command); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/HistoryExtent.java b/worldedit-core/src/main/java/com/boydti/fawe/object/HistoryExtent.java index 468193800..d9f47b0ee 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/HistoryExtent.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/HistoryExtent.java @@ -1,8 +1,9 @@ package com.boydti.fawe.object; +import static com.google.common.base.Preconditions.checkNotNull; + import com.boydti.fawe.object.changeset.FaweChangeSet; -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.world.block.BaseBlock; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.extent.AbstractDelegateExtent; @@ -13,15 +14,12 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.biome.BiomeType; +import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockStateHolder; - import java.util.ArrayList; import java.util.List; import javax.annotation.Nullable; - -import static com.google.common.base.Preconditions.checkNotNull; - /** * Stores changes to a {@link ChangeSet}. */ @@ -156,9 +154,9 @@ public class HistoryExtent extends AbstractDelegateExtent { return this.entity.getFacet(cls); } - @Override - public boolean setLocation(Location location) { - return this.entity.setLocation(location); - } + @Override + public boolean setLocation(Location location) { + return this.entity.setLocation(location); + } } } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/NullChangeSet.java b/worldedit-core/src/main/java/com/boydti/fawe/object/NullChangeSet.java index baecc2148..2305da096 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/NullChangeSet.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/NullChangeSet.java @@ -68,15 +68,15 @@ public class NullChangeSet extends FaweChangeSet { return 0; } - @Override - public boolean isRecordingChanges() { - // TODO Auto-generated method stub - return false; - } + @Override + public boolean isRecordingChanges() { + // TODO Auto-generated method stub + return false; + } - @Override - public void setRecordChanges(boolean recordChanges) { - // TODO Auto-generated method stub - - } + @Override + public void setRecordChanges(boolean recordChanges) { + // TODO Auto-generated method stub + + } } 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 79b6c0b4b..ba84ae19e 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 @@ -68,7 +68,7 @@ public class CopyPastaBrush implements Brush, ResettableTool { @Override public boolean test(BlockVector3 vector) { if (super.test(vector) && vector.getBlockY() >= minY) { - BaseBlock block = editSession.getFullBlock(vector); + BaseBlock block = editSession.getFullBlock(vector); if (!block.getBlockType().getMaterial().isAir()) { builder.add(vector, BlockTypes.AIR.getDefaultState().toBaseBlock(), block); return true; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/HeightBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/HeightBrush.java index f28ecee41..75b773ca2 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/HeightBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/HeightBrush.java @@ -133,8 +133,8 @@ public class HeightBrush implements Brush { } if (smooth) { - BlockVector2 min = BlockVector2.at(Math.max(0, bx - size), Math.max(0, bz - size)); - BlockVector2 max = BlockVector2.at(Math.min(hmmg.getWidth() - 1, bx + size), Math.min(hmmg.getLength() - 1, bz + size)); + BlockVector2 min = BlockVector2.at(Math.max(0, bx - size), Math.max(0, bz - size)); + BlockVector2 max = BlockVector2.at(Math.min(hmmg.getWidth() - 1, bx + size), Math.min(hmmg.getLength() - 1, bz + size)); hmmg.smooth(min, max, 8, 1); if (size > 20) { diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SplineBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SplineBrush.java index a021c1782..de3edc14b 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SplineBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SplineBrush.java @@ -7,7 +7,6 @@ import com.boydti.fawe.object.mask.IdMask; import com.boydti.fawe.object.visitor.DFSRecursiveVisitor; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalSession; -import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.command.tool.brush.Brush; import com.sk89q.worldedit.entity.Player; @@ -23,7 +22,6 @@ import com.sk89q.worldedit.math.interpolation.Node; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.Comparator; import java.util.List; public class SplineBrush implements Brush, ResettableTool { @@ -84,7 +82,7 @@ public class SplineBrush implements Brush, ResettableTool { for (int y = -1; y <= 1; y++) { for (int z = -1; z <= 1; z++) { if (x != 0 || y != 0 || z != 0) { - BlockVector3 pos = BlockVector3.at(x, y, z); + BlockVector3 pos = BlockVector3.at(x, y, z); if (!directions.contains(pos)) { directions.add(pos); } @@ -151,7 +149,7 @@ public class SplineBrush implements Brush, ResettableTool { } private Vector3 getCentroid(Collection points) { - MutableVector3 sum = new MutableVector3(); + MutableVector3 sum = new MutableVector3(); for (BlockVector3 p : points) { sum.mutX(sum.getX() + p.getX()); sum.mutY(sum.getY() + p.getY()); 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 d6c1c37f5..8d30426bf 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 @@ -61,7 +61,7 @@ public class SurfaceSpline implements Brush { tipy = editSession.getNearestSurfaceTerrainBlock(tipx, tipz, tipy, 0, maxY); if (tipy == -1) continue; if (radius == 0) { - BlockVector3 set = mutable.setComponents(tipx, tipy, tipz); + BlockVector3 set = mutable.setComponents(tipx, tipy, tipz); try { pattern.apply(editSession, set, set); } catch (WorldEditException e) { diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/heightmap/HeightMap.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/heightmap/HeightMap.java index 3e52e8f30..1eea82eec 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/heightmap/HeightMap.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/heightmap/HeightMap.java @@ -24,7 +24,7 @@ public interface HeightMap { } default void applyHeightMapData(int[][] data, EditSession session, BlockVector3 pos, int size, double yscale, boolean smooth, boolean towards, boolean layers) throws MaxChangedBlocksException { - BlockVector3 top = session.getMaximumPoint(); + BlockVector3 top = session.getMaximumPoint(); int maxY = top.getBlockY(); Location min = new Location(session.getWorld(), pos.subtract(size, maxY, size).toVector3()); BlockVector3 max = pos.add(size, maxY, size); @@ -47,7 +47,7 @@ public interface HeightMap { } default int[][] generateHeightData(EditSession session, Mask mask, BlockVector3 pos, int size, final int rotationMode, double yscale, boolean smooth, boolean towards, final boolean layers) { - BlockVector3 top = session.getMaximumPoint(); + BlockVector3 top = session.getMaximumPoint(); int maxY = top.getBlockY(); int diameter = 2 * size + 1; int centerX = pos.getBlockX(); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/VirtualWorld.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/VirtualWorld.java index 31794a8b8..be92b1ec6 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/VirtualWorld.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/VirtualWorld.java @@ -15,7 +15,7 @@ import java.io.Closeable; import java.io.IOException; public interface VirtualWorld extends SimpleWorld, Closeable { - Vector3 getOrigin(); + Vector3 getOrigin(); @Override default BaseBlock getFullBlock(BlockVector3 position) { 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 c13f0a434..3e01457f9 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 @@ -173,15 +173,15 @@ public class AbstractDelegateChangeSet extends FaweChangeSet { parent.add(x, y, z, combinedFrom, to); } - @Override - public boolean isRecordingChanges() { - // TODO Auto-generated method stub - return false; - } + @Override + public boolean isRecordingChanges() { + // TODO Auto-generated method stub + return false; + } - @Override - public void setRecordChanges(boolean recordChanges) { - // TODO Auto-generated method stub - - } + @Override + public void setRecordChanges(boolean recordChanges) { + // TODO Auto-generated method stub + + } } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/AnvilHistory.java b/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/AnvilHistory.java index a804d8707..4474aafc7 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/AnvilHistory.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/AnvilHistory.java @@ -103,15 +103,15 @@ public class AnvilHistory extends FaweChangeSet implements IAnvilHistory { return size == -1 ? folder.listFiles().length : size; } - @Override - public boolean isRecordingChanges() { - // TODO Auto-generated method stub - return false; - } + @Override + public boolean isRecordingChanges() { + // TODO Auto-generated method stub + return false; + } - @Override - public void setRecordChanges(boolean recordChanges) { - // TODO Auto-generated method stub - - } + @Override + public void setRecordChanges(boolean recordChanges) { + // TODO Auto-generated method stub + + } } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/CFIChangeSet.java b/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/CFIChangeSet.java index 2eeb3128d..3e17f461c 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/CFIChangeSet.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/CFIChangeSet.java @@ -79,15 +79,15 @@ public class CFIChangeSet extends FaweChangeSet { return 1; } - @Override - public boolean isRecordingChanges() { - // TODO Auto-generated method stub - return false; - } + @Override + public boolean isRecordingChanges() { + // TODO Auto-generated method stub + return false; + } - @Override - public void setRecordChanges(boolean recordChanges) { - // TODO Auto-generated method stub - - } + @Override + public void setRecordChanges(boolean recordChanges) { + // TODO Auto-generated method stub + + } } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/CPUOptimizedChangeSet.java b/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/CPUOptimizedChangeSet.java index b3c3051f1..eb0201d8e 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/CPUOptimizedChangeSet.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/CPUOptimizedChangeSet.java @@ -108,15 +108,15 @@ public class CPUOptimizedChangeSet extends FaweChangeSet { return changes.size() * 65536; // num chunks * 65536 (guess of 65536 changes per chunk) } - @Override - public boolean isRecordingChanges() { - // TODO Auto-generated method stub - return false; - } + @Override + public boolean isRecordingChanges() { + // TODO Auto-generated method stub + return false; + } - @Override - public void setRecordChanges(boolean recordChanges) { - // TODO Auto-generated method stub - - } + @Override + public void setRecordChanges(boolean recordChanges) { + // TODO Auto-generated method stub + + } } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/DiskStorageHistory.java b/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/DiskStorageHistory.java index 46cd651da..29bb363f4 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/DiskStorageHistory.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/DiskStorageHistory.java @@ -21,7 +21,6 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; -import java.util.Arrays; import java.util.HashMap; import java.util.Map; import java.util.UUID; @@ -511,15 +510,15 @@ public class DiskStorageHistory extends FaweStreamChangeSet { } } - @Override - public boolean isRecordingChanges() { - // TODO Auto-generated method stub - return false; - } + @Override + public boolean isRecordingChanges() { + // TODO Auto-generated method stub + return false; + } - @Override - public void setRecordChanges(boolean recordChanges) { - // TODO Auto-generated method stub + @Override + public void setRecordChanges(boolean recordChanges) { + // TODO Auto-generated method stub - } + } } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/MemoryOptimizedHistory.java b/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/MemoryOptimizedHistory.java index d169d67c7..d4d671a1f 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/MemoryOptimizedHistory.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/MemoryOptimizedHistory.java @@ -237,15 +237,15 @@ public class MemoryOptimizedHistory extends FaweStreamChangeSet { return tileR == null ? null : new NBTInputStream(MainUtil.getCompressedIS(new FastByteArraysInputStream(tileR))); } - @Override - public boolean isRecordingChanges() { - // TODO Auto-generated method stub - return false; - } + @Override + public boolean isRecordingChanges() { + // TODO Auto-generated method stub + return false; + } - @Override - public void setRecordChanges(boolean recordChanges) { - // TODO Auto-generated method stub + @Override + public void setRecordChanges(boolean recordChanges) { + // TODO Auto-generated method stub - } + } } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/FaweClipboard.java b/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/FaweClipboard.java index 5b7199ae4..1345c8d78 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/FaweClipboard.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/FaweClipboard.java @@ -1,9 +1,9 @@ package com.boydti.fawe.object.clipboard; +import static com.google.common.base.Preconditions.checkNotNull; + import com.boydti.fawe.jnbt.NBTStreamer; import com.boydti.fawe.util.ReflectionUtils; - -import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.IntTag; import com.sk89q.jnbt.Tag; @@ -15,11 +15,10 @@ import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockStateHolder; - -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; import java.util.Map; +import javax.annotation.Nullable; public abstract class FaweClipboard { public abstract BaseBlock getBlock(int x, int y, int z); @@ -86,8 +85,8 @@ public abstract class FaweClipboard { @Override public > void run(int x, int y, int z, B block) { - if(!(block instanceof BaseBlock)) return; - BaseBlock base = (BaseBlock)block; + if(!(block instanceof BaseBlock)) return; + BaseBlock base = (BaseBlock)block; CompoundTag tag = base.getNbtData(); if (tag != null) { Map values = ReflectionUtils.getMap(tag.getValue()); @@ -161,10 +160,10 @@ public abstract class FaweClipboard { return world; } - @Override - public boolean setLocation(Location location) { - //Should not be teleporting this entity - return false; - } + @Override + public boolean setLocation(Location location) { + //Should not be teleporting this entity + return false; + } } } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/MemoryOptimizedClipboard.java b/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/MemoryOptimizedClipboard.java index c3f532262..d09521a10 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/MemoryOptimizedClipboard.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/MemoryOptimizedClipboard.java @@ -203,7 +203,7 @@ public class MemoryOptimizedClipboard extends FaweClipboard { } } if (lastCombinedIds == null) { - BlockType bt = BlockTypes.getFromStateId(v); + BlockType bt = BlockTypes.getFromStateId(v); if (bt.getMaterial().isAir()) { return; } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/ReadOnlyClipboard.java b/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/ReadOnlyClipboard.java index f767c4ed9..88c373a0a 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/ReadOnlyClipboard.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/ReadOnlyClipboard.java @@ -65,7 +65,7 @@ public abstract class ReadOnlyClipboard extends FaweClipboard { @Override public void streamBiomes(NBTStreamer.ByteReader task) { - BlockVector3 dim = getDimensions(); + BlockVector3 dim = getDimensions(); int index = 0; for (int z = 0; z <= dim.getBlockZ(); z++) { for (int x = 0; x <= dim.getBlockX(); x++, index++) { diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/ResizableClipboardBuilder.java b/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/ResizableClipboardBuilder.java index 41390a822..8406b71a5 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/ResizableClipboardBuilder.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/ResizableClipboardBuilder.java @@ -60,8 +60,8 @@ public class ResizableClipboardBuilder extends MemoryOptimizedHistory { } public Clipboard build() { - BlockVector3 pos1 = BlockVector3.at(minX, minY, minZ); - BlockVector3 pos2 = BlockVector3.at(maxX, maxY, maxZ); + BlockVector3 pos1 = BlockVector3.at(minX, minY, minZ); + BlockVector3 pos2 = BlockVector3.at(maxX, maxY, maxZ); CuboidRegion region = new CuboidRegion(pos1, pos2); BlockArrayClipboard clipboard = new BlockArrayClipboard(region); Iterator iter = getIterator(true); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/WorldCopyClipboard.java b/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/WorldCopyClipboard.java index 49c089d20..bdf159e48 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/WorldCopyClipboard.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/WorldCopyClipboard.java @@ -3,22 +3,20 @@ package com.boydti.fawe.object.clipboard; import com.boydti.fawe.util.ReflectionUtils; 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.entity.Entity; +import com.sk89q.worldedit.extent.Extent; 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.MutableBlockVector3; import com.sk89q.worldedit.math.MutableBlockVector2; +import com.sk89q.worldedit.math.MutableBlockVector3; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.world.biome.BiomeType; +import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockTypes; - import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -73,8 +71,8 @@ public class WorldCopyClipboard extends ReadOnlyClipboard { @Override public void forEach(BlockReader task, boolean air) { - BlockVector3 min = region.getMinimumPoint(); - BlockVector3 max = region.getMaximumPoint(); + BlockVector3 min = region.getMinimumPoint(); + BlockVector3 max = region.getMaximumPoint(); MutableBlockVector3 pos = new MutableBlockVector3(); if (region instanceof CuboidRegion) { if (air) { @@ -104,7 +102,7 @@ public class WorldCopyClipboard extends ReadOnlyClipboard { int y = pos.getBlockY() - my; int z = pos.getBlockZ() - mz; if (region.contains(pos)) { - BaseBlock block = extent.getFullBlock(pos); + BaseBlock block = extent.getFullBlock(pos); if (block.hasNbtData()) { Map values = ReflectionUtils.getMap(block.getNbtData().getValue()); values.put("x", new IntTag(x)); @@ -133,7 +131,7 @@ public class WorldCopyClipboard extends ReadOnlyClipboard { int xx = pos.getBlockX() - mx; if (region.contains(pos)) { // BlockState block = getBlockAbs(x, y, z); - BaseBlock block = extent.getFullBlock(pos); + BaseBlock block = extent.getFullBlock(pos); if (!air && block.getBlockType().getMaterial().isAir()) { continue; } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/collection/BlockVectorSet.java b/worldedit-core/src/main/java/com/boydti/fawe/object/collection/BlockVectorSet.java index 681c13636..068b25c10 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/collection/BlockVectorSet.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/collection/BlockVectorSet.java @@ -72,7 +72,7 @@ public class BlockVectorSet extends AbstractCollection implements @Override public boolean contains(Object o) { if (o instanceof BlockVector3) { - BlockVector3 v = (BlockVector3) o; + BlockVector3 v = (BlockVector3) o; return contains(v.getBlockX(), v.getBlockY(), v.getBlockZ()); } return false; @@ -152,7 +152,7 @@ public class BlockVectorSet extends AbstractCollection implements @Override public boolean remove(Object o) { if (o instanceof BlockVector3) { - BlockVector3 v = (BlockVector3) o; + BlockVector3 v = (BlockVector3) o; return remove(v.getBlockX(), v.getBlockY(), v.getBlockZ()); } return false; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/collection/LocalBlockVector2DSet.java b/worldedit-core/src/main/java/com/boydti/fawe/object/collection/LocalBlockVector2DSet.java index f51d935c7..599ed7f44 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/collection/LocalBlockVector2DSet.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/collection/LocalBlockVector2DSet.java @@ -43,7 +43,7 @@ public class LocalBlockVector2DSet implements Set { @Override public boolean contains(Object o) { if (o instanceof BlockVector2) { - BlockVector2 v = (BlockVector2) o; + BlockVector2 v = (BlockVector2) o; return contains(v.getBlockX(), v.getBlockZ()); } return false; @@ -202,7 +202,7 @@ public class LocalBlockVector2DSet implements Set { @Override public boolean remove(Object o) { if (o instanceof BlockVector2) { - BlockVector2 v = (BlockVector2) o; + BlockVector2 v = (BlockVector2) o; return remove(v.getBlockX(), v.getBlockZ()); } return false; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/collection/LocalBlockVectorSet.java b/worldedit-core/src/main/java/com/boydti/fawe/object/collection/LocalBlockVectorSet.java index 8faea1f83..d89d8c5c3 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/collection/LocalBlockVectorSet.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/collection/LocalBlockVectorSet.java @@ -50,7 +50,7 @@ public class LocalBlockVectorSet implements Set { @Override public boolean contains(Object o) { if (o instanceof BlockVector3) { - BlockVector3 v = (BlockVector3) o; + BlockVector3 v = (BlockVector3) o; return contains(v.getBlockX(), v.getBlockY(), v.getBlockZ()); } return false; @@ -249,7 +249,7 @@ public class LocalBlockVectorSet implements Set { @Override public boolean remove(Object o) { if (o instanceof BlockVector3) { - BlockVector3 v = (BlockVector3) o; + BlockVector3 v = (BlockVector3) o; return remove(v.getBlockX(), v.getBlockY(), v.getBlockZ()); } return false; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/collection/SummedAreaTable.java b/worldedit-core/src/main/java/com/boydti/fawe/object/collection/SummedAreaTable.java index b3c4d0d5c..0e71b42b5 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/collection/SummedAreaTable.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/collection/SummedAreaTable.java @@ -78,12 +78,12 @@ public class SummedAreaTable { if (index == 0) { return curr; } - /* top row */ + /* top row */ else if (row == 0 && col != 0) { leftSum = summed[index - 1]; return curr + leftSum; } - /* left-most column */ + /* left-most column */ else if (row != 0 && col == 0) { topSum = summed[index - width]; return curr + topSum; @@ -94,4 +94,4 @@ public class SummedAreaTable { return curr + leftSum + topSum - topLeftSum; } } -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/extent/BlockTranslateExtent.java b/worldedit-core/src/main/java/com/boydti/fawe/object/extent/BlockTranslateExtent.java index 1b35bf82f..4000aa826 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/extent/BlockTranslateExtent.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/extent/BlockTranslateExtent.java @@ -59,9 +59,9 @@ public class BlockTranslateExtent extends AbstractDelegateExtent { public BlockState getBlock(int x, int y, int z) { return super.getBlock(x + dx, y + dy, z + dz); } - + @Override public BaseBlock getFullBlock(BlockVector3 pos) { - return super.getFullBlock(pos.add(dx, dy, dz)); + return super.getFullBlock(pos.add(dx, dy, dz)); } } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/extent/NullExtent.java b/worldedit-core/src/main/java/com/boydti/fawe/object/extent/NullExtent.java index 157064697..45f55aff1 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/extent/NullExtent.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/extent/NullExtent.java @@ -54,7 +54,7 @@ public class NullExtent extends FaweRegionExtent { @Override public BiomeType getBiome(final BlockVector2 arg0) { if(reason != null) { - throw reason; + throw reason; } return null; } @@ -62,7 +62,7 @@ public class NullExtent extends FaweRegionExtent { @Override public BlockState getBlock(final BlockVector3 arg0) { if(reason != null) { - throw reason; + throw reason; } return null; } @@ -70,7 +70,7 @@ public class NullExtent extends FaweRegionExtent { @Override public BlockState getBlock(int x, int y, int z) { if(reason != null) { - throw reason; + throw reason; } return null; } @@ -86,7 +86,7 @@ public class NullExtent extends FaweRegionExtent { @Override public boolean setBiome(final BlockVector2 arg0, final BiomeType arg1) { if(reason != null) { - throw reason; + throw reason; } return false; } @@ -94,7 +94,7 @@ public class NullExtent extends FaweRegionExtent { @Override public boolean setBlock(final BlockVector3 arg0, final BlockStateHolder arg1) throws WorldEditException { if(reason != null) { - throw reason; + throw reason; } return false; } @@ -102,7 +102,7 @@ public class NullExtent extends FaweRegionExtent { @Override public boolean setBlock(int x, int y, int z, BlockStateHolder block) throws WorldEditException { if(reason != null) { - throw reason; + throw reason; } return false; } @@ -110,7 +110,7 @@ public class NullExtent extends FaweRegionExtent { @Override public Entity createEntity(final Location arg0, final BaseEntity arg1) { if(reason != null) { - throw reason; + throw reason; } return null; } @@ -138,7 +138,7 @@ public class NullExtent extends FaweRegionExtent { @Override public boolean contains(int x, int z) { if(reason != null) { - throw reason; + throw reason; } return false; } @@ -146,7 +146,7 @@ public class NullExtent extends FaweRegionExtent { @Override public boolean contains(int x, int y, int z) { if(reason != null) { - throw reason; + throw reason; } return false; } @@ -165,7 +165,7 @@ public class NullExtent extends FaweRegionExtent { @Override public int getNearestSurfaceLayer(int x, int z, int y, int minY, int maxY) { if(reason != null) { - throw reason; + throw reason; } return -1; } @@ -173,7 +173,7 @@ public class NullExtent extends FaweRegionExtent { @Override public int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY) { if(reason != null) { - throw reason; + throw reason; } return -1; } @@ -181,7 +181,7 @@ public class NullExtent extends FaweRegionExtent { @Override public int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY, int failedMin, int failedMax) { if(reason != null) { - throw reason; + throw reason; } return -1; } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/extent/PositionTransformExtent.java b/worldedit-core/src/main/java/com/boydti/fawe/object/extent/PositionTransformExtent.java index c984a7ca9..627a74198 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/extent/PositionTransformExtent.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/extent/PositionTransformExtent.java @@ -57,7 +57,7 @@ public class PositionTransformExtent extends ResettableExtent { @Override public BaseBlock getFullBlock(BlockVector3 position) { - return super.getFullBlock(getPos(position)); + return super.getFullBlock(getPos(position)); } @Override diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/extent/StripNBTExtent.java b/worldedit-core/src/main/java/com/boydti/fawe/object/extent/StripNBTExtent.java index 9ad71eefb..7d112d666 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/extent/StripNBTExtent.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/extent/StripNBTExtent.java @@ -1,11 +1,8 @@ package com.boydti.fawe.object.extent; -import com.boydti.fawe.util.ReflectionUtils; import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BaseBlock; -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.extent.AbstractDelegateExtent; @@ -13,12 +10,11 @@ import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.NbtValued; +import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockStateHolder; - -import javax.annotation.Nullable; -import java.util.Iterator; import java.util.Map; import java.util.Set; +import javax.annotation.Nullable; public class StripNBTExtent extends AbstractDelegateExtent { private final String[] strip; @@ -50,8 +46,8 @@ public class StripNBTExtent extends AbstractDelegateExtent { } public > B stripBlockNBT(B block) { - if(!(block instanceof BaseBlock)) return block; - BaseBlock localBlock = (BaseBlock)block; + if(!(block instanceof BaseBlock)) return block; + BaseBlock localBlock = (BaseBlock)block; if (!localBlock.hasNbtData()) return block; CompoundTag nbt = localBlock.getNbtData(); Map value = nbt.getValue(); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/extent/TemporalExtent.java b/worldedit-core/src/main/java/com/boydti/fawe/object/extent/TemporalExtent.java index 96e61de59..01192bd6b 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/extent/TemporalExtent.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/extent/TemporalExtent.java @@ -68,9 +68,9 @@ public class TemporalExtent extends AbstractDelegateExtent { public BaseBlock getFullBlock(BlockVector3 position) { if (position.getX() == x && position.getY() == y && position.getZ() == z) { if(block instanceof BaseBlock) { - return (BaseBlock)block; + return (BaseBlock)block; }else { - return block.toBaseBlock(); + return block.toBaseBlock(); } } return super.getFullBlock(position); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/extent/TransformExtent.java b/worldedit-core/src/main/java/com/boydti/fawe/object/extent/TransformExtent.java index f2be69cf1..b5a6cd329 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/extent/TransformExtent.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/extent/TransformExtent.java @@ -1,16 +1,15 @@ package com.boydti.fawe.object.extent; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.math.Vector3; -import com.sk89q.worldedit.world.block.BaseBlock; -import com.sk89q.worldedit.world.block.BlockState; 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.MutableBlockVector3; import com.sk89q.worldedit.math.MutableVector3; +import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.world.biome.BiomeType; +import com.sk89q.worldedit.world.block.BaseBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; public class TransformExtent extends BlockTransformExtent { @@ -31,15 +30,15 @@ public class TransformExtent extends BlockTransformExtent { @Override public BlockVector3 getMinimumPoint() { - BlockVector3 pos1 = getPos(super.getMinimumPoint()); - BlockVector3 pos2 = getPos(super.getMaximumPoint()); + BlockVector3 pos1 = getPos(super.getMinimumPoint()); + BlockVector3 pos2 = getPos(super.getMaximumPoint()); return pos1.getMinimum(pos2); } @Override public BlockVector3 getMaximumPoint() { - BlockVector3 pos1 = getPos(super.getMinimumPoint()); - BlockVector3 pos2 = getPos(super.getMaximumPoint()); + BlockVector3 pos1 = getPos(super.getMinimumPoint()); + BlockVector3 pos2 = getPos(super.getMaximumPoint()); return pos1.getMaximum(pos2); } @@ -84,7 +83,7 @@ public class TransformExtent extends BlockTransformExtent { @Override public BaseBlock getFullBlock(BlockVector3 position) { - return transform(super.getFullBlock(getPos(position))); + return transform(super.getFullBlock(getPos(position))); } @Override 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 767538a6e..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 @@ -1,12 +1,10 @@ package com.boydti.fawe.object.function.block; 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.RegionFunction; import com.sk89q.worldedit.math.BlockVector3; -import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BaseBlock; public class CombinedBlockCopy implements RegionFunction { @@ -23,7 +21,7 @@ public class CombinedBlockCopy implements RegionFunction { @Override public boolean apply(BlockVector3 position) throws WorldEditException { // BlockStateHolder block = source.getBlock(position); - BaseBlock block = source.getFullBlock(position); + BaseBlock block = source.getFullBlock(position); function.apply(position); return destination.setBlock(position, block); } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/AdjacentAnyMask.java b/worldedit-core/src/main/java/com/boydti/fawe/object/mask/AdjacentAnyMask.java index b5f384f88..e12205db3 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/AdjacentAnyMask.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/mask/AdjacentAnyMask.java @@ -58,23 +58,23 @@ public class AdjacentAnyMask extends AbstractMask implements ResettableMask { int y = v.getBlockY(); int z = v.getBlockZ(); if (mask.test(x + 1, y, z)) { - mutable.setComponents(1, 0, 0); + mutable.setComponents(1, 0, 0); }else if (mask.test(x - 1, y, z)) { - mutable.setComponents(-1, 0, 0); + mutable.setComponents(-1, 0, 0); }else if (mask.test(x, y, z + 1)) { - mutable.setComponents(0, 0, 1); + mutable.setComponents(0, 0, 1); }else if (mask.test(x, y, z - 1)) { - mutable.setComponents(0, 0, -1); + mutable.setComponents(0, 0, -1); }else - if (y < 256 && mask.test(x, y + 1, z)) { - mutable.setComponents(0, 1, 0); - }else - if (y > 0 && mask.test(x, y - 1, z)) { - mutable.setComponents(0, -1, 0); - } + if (y < 256 && mask.test(x, y + 1, z)) { + mutable.setComponents(0, 1, 0); + }else + 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; } -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/AdjacentMask.java b/worldedit-core/src/main/java/com/boydti/fawe/object/mask/AdjacentMask.java index 9fa0259b3..8c363d1a2 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/AdjacentMask.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/mask/AdjacentMask.java @@ -19,7 +19,7 @@ public class AdjacentMask extends AbstractMask { @Override public boolean test(BlockVector3 bv) { - v.setComponents(bv); + v.setComponents(bv); int count = 0; double x = bv.getX(); double y = bv.getY(); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/BiomeMask.java b/worldedit-core/src/main/java/com/boydti/fawe/object/mask/BiomeMask.java index 5c7d345f5..0a1bd2d2b 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/BiomeMask.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/mask/BiomeMask.java @@ -23,7 +23,7 @@ public class BiomeMask extends AbstractExtentMask implements ResettableMask { @Override public boolean test(BlockVector3 vector) { - BlockVector2 pos = mutable.setComponents(vector.getBlockX(), vector.getBlockZ()); + BlockVector2 pos = mutable.setComponents(vector.getBlockX(), vector.getBlockZ()); return getExtent().getBiome(pos).getId() == biome.getId(); } } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/WallMask.java b/worldedit-core/src/main/java/com/boydti/fawe/object/mask/WallMask.java index 7e5d84f03..83b2d110d 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/WallMask.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/mask/WallMask.java @@ -19,7 +19,7 @@ public class WallMask extends AbstractMask { @Override public boolean test(BlockVector3 bv) { - v.setComponents(bv); + v.setComponents(bv); int count = 0; double x = v.getX(); double y = v.getY(); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/IdPattern.java b/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/IdPattern.java index 9b05385d9..1ccac933b 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/IdPattern.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/IdPattern.java @@ -1,12 +1,11 @@ package com.boydti.fawe.object.pattern; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BaseBlock; -import com.sk89q.worldedit.world.block.BlockStateHolder; - -import static com.google.common.base.Preconditions.checkNotNull; public class IdPattern extends AbstractExtentPattern { private final Pattern pattern; @@ -19,8 +18,8 @@ public class IdPattern extends AbstractExtentPattern { @Override public BaseBlock apply(BlockVector3 position) { - BaseBlock oldBlock = getExtent().getFullBlock(position); - BaseBlock newBlock = pattern.apply(position); + BaseBlock oldBlock = getExtent().getFullBlock(position); + BaseBlock newBlock = pattern.apply(position); return newBlock.withPropertyId(oldBlock.getInternalPropertiesId()).toBaseBlock(); } -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/SurfaceRandomOffsetPattern.java b/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/SurfaceRandomOffsetPattern.java index 03ee435a0..43dfb4acc 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/SurfaceRandomOffsetPattern.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/SurfaceRandomOffsetPattern.java @@ -1,15 +1,12 @@ package com.boydti.fawe.object.pattern; -import com.boydti.fawe.beta.FilterBlock; -import com.sk89q.worldedit.world.block.BaseBlock; 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.MutableBlockVector3; +import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockStateHolder; - -import java.io.IOException; import java.util.concurrent.ThreadLocalRandom; public class SurfaceRandomOffsetPattern extends AbstractPattern { @@ -60,7 +57,7 @@ public class SurfaceRandomOffsetPattern extends AbstractPattern { } private boolean allowed(BlockVector3 bv) { - MutableBlockVector3 v = new MutableBlockVector3(bv); + MutableBlockVector3 v = new MutableBlockVector3(bv); BlockStateHolder block = pattern.apply(bv); if (!block.getBlockType().getMaterial().isMovementBlocker()) { return false; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/regions/PolyhedralRegion.java b/worldedit-core/src/main/java/com/boydti/fawe/object/regions/PolyhedralRegion.java index 0df9a9594..8f2500fbe 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/regions/PolyhedralRegion.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/regions/PolyhedralRegion.java @@ -19,19 +19,22 @@ package com.boydti.fawe.object.regions; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.math.BlockVector3; -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; import com.sk89q.worldedit.regions.polyhedron.Edge; import com.sk89q.worldedit.world.World; - +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import java.util.Vector; import javax.annotation.Nullable; -import java.util.*; - -import static com.google.common.base.Preconditions.checkNotNull; public class PolyhedralRegion extends AbstractRegion { @@ -145,8 +148,8 @@ public class PolyhedralRegion extends AbstractRegion { } else { // minimumPoint = new MutableBlockVector3(minimumPoint.getMinimum(vertex)); // maximumPoint = new MutableBlockVector3(maximumPoint.getMaximum(vertex)); - minimumPoint = minimumPoint.getMinimum(vertex); - maximumPoint = maximumPoint.getMaximum(vertex); + minimumPoint = minimumPoint.getMinimum(vertex); + maximumPoint = maximumPoint.getMaximum(vertex); } int size = vertices.size(); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/visitor/DFSVisitor.java b/worldedit-core/src/main/java/com/boydti/fawe/object/visitor/DFSVisitor.java index bece42121..fd54ee23f 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/visitor/DFSVisitor.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/visitor/DFSVisitor.java @@ -7,8 +7,6 @@ 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.MutableBlockVector3; - import java.util.ArrayDeque; import java.util.ArrayList; import java.util.HashSet; @@ -57,7 +55,7 @@ public abstract class DFSVisitor implements Operation { private IntegerTrio[] getIntDirections() { IntegerTrio[] array = new IntegerTrio[directions.size()]; for (int i = 0; i < array.length; i++) { - BlockVector3 dir = directions.get(i); + BlockVector3 dir = directions.get(i); array[i] = new IntegerTrio(dir.getBlockX(), dir.getBlockY(), dir.getBlockZ()); } return array; @@ -100,7 +98,7 @@ public abstract class DFSVisitor implements Operation { // mutable2.mutX(from.getX() + direction.x); // mutable2.mutY(from.getY() + direction.y); // mutable2.mutZ(from.getZ() + direction.z); - BlockVector3 bv2 = BlockVector3.at(from.getX() + direction.x, from.getY() + direction.y, from.getZ() + direction.z); + BlockVector3 bv2 = BlockVector3.at(from.getX() + direction.x, from.getY() + direction.y, from.getZ() + direction.z); if (isVisitable(bv, bv2)) { adjacent = new Node(bv2.getBlockX(), bv2.getBlockY(), bv2.getBlockZ()); if ((!adjacent.equals(current.from))) { diff --git a/worldedit-core/src/main/java/com/boydti/fawe/regions/general/plot/FaweLocalBlockQueue.java b/worldedit-core/src/main/java/com/boydti/fawe/regions/general/plot/FaweLocalBlockQueue.java index 3eed78a4e..89b9ad11f 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/regions/general/plot/FaweLocalBlockQueue.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/regions/general/plot/FaweLocalBlockQueue.java @@ -69,15 +69,15 @@ public class FaweLocalBlockQueue extends LocalBlockQueue { public long getModified() { return IMP.size(); } - + @Override public boolean setBlock(final int x, final int y, final int z, final PlotBlock id) { - return setBlock(x, y, z, legacyMapper.getBaseBlockFromPlotBlock(id)); + return setBlock(x, y, z, legacyMapper.getBaseBlockFromPlotBlock(id)); } - + @Override public boolean setBlock(final int x, final int y, final int z, final BaseBlock id) { - return IMP.setBlock(x, y, z, id); + return IMP.setBlock(x, y, z, id); } @Override diff --git a/worldedit-core/src/main/java/com/boydti/fawe/util/WEManager.java b/worldedit-core/src/main/java/com/boydti/fawe/util/WEManager.java index 878a18b7b..2c931a902 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/util/WEManager.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/util/WEManager.java @@ -155,10 +155,10 @@ public class WEManager { public boolean intersects(final Region region1, final Region region2) { - BlockVector3 rg1P1 = region1.getMinimumPoint(); - BlockVector3 rg1P2 = region1.getMaximumPoint(); - BlockVector3 rg2P1 = region2.getMinimumPoint(); - BlockVector3 rg2P2 = region2.getMaximumPoint(); + BlockVector3 rg1P1 = region1.getMinimumPoint(); + BlockVector3 rg1P2 = region1.getMaximumPoint(); + BlockVector3 rg2P1 = region2.getMinimumPoint(); + BlockVector3 rg2P2 = region2.getMaximumPoint(); return (rg1P1.getBlockX() <= rg2P2.getBlockX()) && (rg1P2.getBlockX() >= rg2P1.getBlockX()) && (rg1P1.getBlockZ() <= rg2P2.getBlockZ()) && (rg1P2.getBlockZ() >= rg2P1.getBlockZ()); } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/wrappers/PlayerWrapper.java b/worldedit-core/src/main/java/com/boydti/fawe/wrappers/PlayerWrapper.java index 02faf6642..286b9e71f 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/wrappers/PlayerWrapper.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/wrappers/PlayerWrapper.java @@ -417,8 +417,8 @@ public class PlayerWrapper extends AbstractPlayerActor { return parent.openFileSaveDialog(extensions); } - @Override - public boolean setLocation(Location location) { - return parent.setLocation(location); - } + @Override + public boolean setLocation(Location location) { + return parent.setLocation(location); + } } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/wrappers/WorldWrapper.java b/worldedit-core/src/main/java/com/boydti/fawe/wrappers/WorldWrapper.java index d90d93b1d..3007c5c74 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/wrappers/WorldWrapper.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/wrappers/WorldWrapper.java @@ -252,13 +252,13 @@ public class WorldWrapper extends AbstractWorld { return parent.setBiome(position, biome); } - @Override - public boolean notifyAndLightBlock(BlockVector3 position, BlockState previousType) throws WorldEditException { - return parent.notifyAndLightBlock(position, previousType); - } + @Override + public boolean notifyAndLightBlock(BlockVector3 position, BlockState previousType) throws WorldEditException { + return parent.notifyAndLightBlock(position, previousType); + } - @Override - public BlockVector3 getSpawnPosition() { - return parent.getSpawnPosition(); - } + @Override + public BlockVector3 getSpawnPosition() { + return parent.getSpawnPosition(); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index b463d3d7e..485023787 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -3052,8 +3052,8 @@ public class EditSession extends AbstractDelegateExtent implements SimpleWorld, final FaweRegionExtent fe = this.getRegionExtent(); final boolean cuboid = region instanceof CuboidRegion; if (fe != null && cuboid) { - BlockVector3 max = region.getMaximumPoint(); - BlockVector3 min = region.getMinimumPoint(); + BlockVector3 max = region.getMaximumPoint(); + BlockVector3 min = region.getMinimumPoint(); if (!fe.contains(max.getBlockX(), max.getBlockY(), max.getBlockZ()) && !fe.contains(min.getBlockX(), min.getBlockY(), min.getBlockZ())) { throw FaweException.OUTSIDE_REGION; } @@ -3190,24 +3190,24 @@ public class EditSession extends AbstractDelegateExtent implements SimpleWorld, world.setWeather(weatherType, duration); } - @Override - public void dropItem(Vector3 position, BaseItemStack item) { - world.dropItem(position, item); - } + @Override + public void dropItem(Vector3 position, BaseItemStack item) { + world.dropItem(position, item); + } - @Override - public boolean playEffect(Vector3 position, int type, int data) { - return world.playEffect(position, type, data); - } + @Override + public boolean playEffect(Vector3 position, int type, int data) { + return world.playEffect(position, type, data); + } - @Override - public boolean notifyAndLightBlock(BlockVector3 position, BlockState previousType) throws WorldEditException { - return world.notifyAndLightBlock(position, previousType); - } + @Override + public boolean notifyAndLightBlock(BlockVector3 position, BlockState previousType) throws WorldEditException { + return world.notifyAndLightBlock(position, previousType); + } - @Override - public BlockVector3 getSpawnPosition() { - return world.getSpawnPosition(); - } + @Override + public BlockVector3 getSpawnPosition() { + return world.getSpawnPosition(); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java index a70b8eb6a..f0b81525e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java @@ -323,7 +323,7 @@ public class RegionCommands extends MethodCommands { int y = 0; int affected = 0; while (iter.hasNext()) { - BlockVector2 pos = iter.next(); + BlockVector2 pos = iter.next(); int x = pos.getBlockX(); int z = pos.getBlockZ(); y = editSession.getNearestSurfaceTerrainBlock(x, z, y, 0, maxY); @@ -405,8 +405,8 @@ public class RegionCommands extends MethodCommands { @Arg(desc = "The mask of blocks to use as the height map", def = "") Mask mask, @Switch(name='s', desc = "TODO") boolean snow, InjectedValueAccess context) throws WorldEditException { - BlockVector3 min = region.getMinimumPoint(); - BlockVector3 max = region.getMaximumPoint(); + BlockVector3 min = region.getMinimumPoint(); + BlockVector3 max = region.getMaximumPoint(); long volume = (((long) max.getX() - (long) min.getX() + 1) * ((long) max.getY() - (long) min.getY() + 1) * ((long) max.getZ() - (long) min.getZ() + 1)); FaweLimit limit = FawePlayer.wrap(player).getLimit(); if (volume >= limit.MAX_CHECKS) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/DefaultMaskParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/DefaultMaskParser.java index e24602ee9..b9d7990be 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/DefaultMaskParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/DefaultMaskParser.java @@ -183,9 +183,9 @@ public class DefaultMaskParser extends FaweParser { } } } else { - List args = entry.getValue(); - String cmdArgs = ((args.isEmpty()) ? "" : " " + StringMan.join(args, " ")); - try { + List args = entry.getValue(); + String cmdArgs = ((args.isEmpty()) ? "" : " " + StringMan.join(args, " ")); + try { mask = (Mask) dispatcher.call(command + cmdArgs, locals, new String[0]); } catch (SuggestInputParseException rethrow) { throw rethrow; @@ -239,6 +239,6 @@ public class DefaultMaskParser extends FaweParser { } else { return null; } - + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/AnnotatedBindings.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/AnnotatedBindings.java index 54cdbef74..8768cbdda 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/AnnotatedBindings.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/AnnotatedBindings.java @@ -26,8 +26,7 @@ public class AnnotatedBindings extends Bindings { * @param modifiers the list of modifiers to scan * @throws InputParseException on a validation error */ - private static String validate(String string, Annotation... modifiers) - { + private static String validate(String string, Annotation... modifiers) { if (string != null) { for (Annotation modifier : modifiers) { if (modifier instanceof Validate) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java index 0ad161e55..1589fcfaa 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.extent; +import static com.google.common.base.Preconditions.checkNotNull; + import com.boydti.fawe.Fawe; import com.boydti.fawe.object.HistoryExtent; import com.boydti.fawe.object.changeset.FaweChangeSet; @@ -35,11 +37,8 @@ import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; - import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - /** * A base class for {@link Extent}s that merely passes extents onto another. */ @@ -79,7 +78,7 @@ public class AbstractDelegateExtent implements Extent, LightingExtent { if (!(extent instanceof ForgetfulExtentBuffer)) { // placeholder extent.disableQueue(); } - } catch (FaweException disableQueue) {} + } catch (FaweException ignored) {} if (extent instanceof AbstractDelegateExtent) { Extent next = ((AbstractDelegateExtent) extent).getExtent(); new ExtentTraverser(this).setNext(next); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java index 1d4148aa7..22369ec10 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java @@ -19,14 +19,13 @@ package com.sk89q.worldedit.extent.clipboard; +import static com.google.common.base.Preconditions.checkNotNull; + import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.clipboard.DiskOptimizedClipboard; import com.boydti.fawe.object.clipboard.FaweClipboard; import com.boydti.fawe.object.clipboard.FaweClipboard.ClipboardEntity; import com.boydti.fawe.object.clipboard.MemoryOptimizedClipboard; -import com.boydti.fawe.object.extent.LightingExtent; - -import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.BaseEntity; @@ -41,13 +40,12 @@ import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes; - -import javax.annotation.Nullable; import java.io.Closeable; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.UUID; +import javax.annotation.Nullable; /** * Stores block data as a multi-dimensional array of {@link BlockState}s and @@ -55,7 +53,7 @@ import java.util.UUID; */ public class BlockArrayClipboard implements Clipboard, Closeable { - private Region region; + private Region region; private BlockVector3 origin; public FaweClipboard IMP; private BlockVector3 size; @@ -204,7 +202,7 @@ public class BlockArrayClipboard implements Clipboard, Closeable { int z = position.getBlockZ() - mz; return IMP.getBlock(x, y, z); } - return BlockTypes.AIR.getDefaultState().toBaseBlock(); + return BlockTypes.AIR.getDefaultState().toBaseBlock(); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormats.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormats.java index 2d0c56d43..f34396e2a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormats.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormats.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.extent.clipboard.io; +import static com.google.common.base.Preconditions.checkNotNull; + import com.boydti.fawe.config.BBC; import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.clipboard.LazyClipboardHolder; @@ -26,8 +28,6 @@ import com.boydti.fawe.object.clipboard.MultiClipboardHolder; import com.boydti.fawe.object.clipboard.URIClipboardHolder; import com.boydti.fawe.object.io.FastByteArrayOutputStream; import com.boydti.fawe.util.MainUtil; - -import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; import com.google.common.collect.Multimaps; @@ -36,8 +36,6 @@ import com.google.common.io.Files; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extension.platform.Actor; - -import javax.annotation.Nullable; import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -59,6 +57,7 @@ import java.util.Map.Entry; import java.util.regex.Pattern; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; +import javax.annotation.Nullable; public class ClipboardFormats { @@ -130,15 +129,15 @@ public class ClipboardFormats { */ @Nullable public static ClipboardFormat findByExtension(String extension) { - checkNotNull(extension); + checkNotNull(extension); - Collection> entries = getFileExtensionMap().entries(); - for(Map.Entry entry : entries) { - if(entry.getKey().equalsIgnoreCase(extension)) { - return entry.getValue(); - } - } - return null; + Collection> entries = getFileExtensionMap().entries(); + for(Map.Entry entry : entries) { + if(entry.getKey().equalsIgnoreCase(extension)) { + return entry.getValue(); + } + } + return null; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/BlockReplace.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/BlockReplace.java index acf4bca3a..57f9d5aff 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/BlockReplace.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/BlockReplace.java @@ -50,7 +50,7 @@ public class BlockReplace implements RegionFunction { @Override public boolean apply(BlockVector3 position) throws WorldEditException { - return pattern.apply(extent, position, position); + return pattern.apply(extent, position, position); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/BackwardsExtentBlockCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/BackwardsExtentBlockCopy.java index 8daa51819..f5dab3b03 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/BackwardsExtentBlockCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/BackwardsExtentBlockCopy.java @@ -9,9 +9,7 @@ import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.math.transform.Transform; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.Region; - import java.util.List; -import java.util.Vector; public class BackwardsExtentBlockCopy implements Operation { private final Region region; @@ -34,7 +32,7 @@ public class BackwardsExtentBlockCopy implements Operation { CuboidRegion destRegion = transform(this.transform, this.region); Transform inverse = this.transform.inverse(); for (BlockVector3 pt : destRegion) { - BlockVector3 copyFrom = transform(inverse, pt); + BlockVector3 copyFrom = transform(inverse, pt); if (region.contains(copyFrom)) { function.apply(pt); } @@ -43,14 +41,14 @@ public class BackwardsExtentBlockCopy implements Operation { } private CuboidRegion transform(Transform transform, Region region) { - BlockVector3 min = BlockVector3.at(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE); - BlockVector3 max = BlockVector3.at(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE); - BlockVector3 pos1 = region.getMinimumPoint(); - BlockVector3 pos2 = region.getMaximumPoint(); + BlockVector3 min = BlockVector3.at(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE); + BlockVector3 max = BlockVector3.at(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE); + BlockVector3 pos1 = region.getMinimumPoint(); + BlockVector3 pos2 = region.getMaximumPoint(); for (int x : new int[] { pos1.getBlockX(), pos2.getBlockX() }) { for (int y : new int[] { pos1.getBlockY(), pos2.getBlockY() }) { for (int z : new int[] { pos1.getBlockZ(), pos2.getBlockZ() }) { - BlockVector3 pt = transform(transform, BlockVector3.at(x, y, z)); + BlockVector3 pt = transform(transform, BlockVector3.at(x, y, z)); min = min.getMinimum(pt); max = max.getMaximum(pt); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java index a276dbc24..875417f0c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java @@ -22,7 +22,6 @@ package com.sk89q.worldedit.function.visitor; import static com.google.common.base.Preconditions.checkNotNull; import com.boydti.fawe.config.BBC; -import com.boydti.fawe.example.MappedIQueueExtent; import com.boydti.fawe.object.collection.BlockVectorSet; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.RegionFunction; @@ -37,8 +36,6 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Performs a breadth-first search starting from points added with * {@link #visit(BlockVector3)}. The search continues @@ -67,7 +64,7 @@ public abstract class BreadthFirstSearch implements Operation { for (int y = -1; y <= 1; y++) { for (int z = -1; z <= 1; z++) { if (x != 0 || y != 0 || z != 0) { - BlockVector3 pos = BlockVector3.at(x, y, z); + BlockVector3 pos = BlockVector3.at(x, y, z); if (!list.contains(pos)) { list.add(pos); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java index f090e5232..bf5c3151e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java @@ -89,7 +89,7 @@ public class HeightMap { invalid = new boolean[data.length]; if (layers) { - BlockVector3 min = region.getMinimumPoint(); + BlockVector3 min = region.getMinimumPoint(); int bx = min.getBlockX(); int bz = min.getBlockZ(); Iterable flat = Regions.asFlatRegion(region).asFlatRegion(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/paste/IncendoPaste.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/paste/IncendoPaste.java index 2b10ad132..450740556 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/paste/IncendoPaste.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/paste/IncendoPaste.java @@ -52,21 +52,21 @@ public final class IncendoPaste implements Paster{ this.pasteApplication = pasteApplication; } - @Override - public Callable paste(String content) { - return new PasteTask(content); - } + @Override + public Callable paste(String content) { + return new PasteTask(content); + } - private final class PasteTask implements Callable{ + private final class PasteTask implements Callable{ - private PasteTask(String content) {} + private PasteTask(String content) {} - @Override - public URL call() throws Exception { - return new URL(debugPaste()); - } + @Override + public URL call() throws Exception { + return new URL(debugPaste()); + } - } + } /** * Get an immutable collection containing all the files that have been added to this paster diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BaseBlock.java index 5835abe54..80ed33065 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BaseBlock.java @@ -20,22 +20,21 @@ package com.sk89q.worldedit.world.block; import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.TileEntityBlock; import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.function.mask.ABlockMask; 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; import com.sk89q.worldedit.world.registry.LegacyMapper; - -import javax.annotation.Nullable; import java.util.Map; import java.util.Objects; +import javax.annotation.Nullable; /** * Represents a "snapshot" of a block with NBT Data. @@ -71,7 +70,7 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { * @param blockState The blockstate */ public BaseBlock(BlockState blockState) { - this.blockState = blockState; + this.blockState = blockState; nbtData = null; } @@ -244,31 +243,31 @@ public class BaseBlock implements BlockStateHolder, TileEntityBlock { return this; } - @Override - public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException { + @Override + public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException { set.setFullBlock(extent, this); return true; - } + } - @Override - public BaseBlock withPropertyId(int propertyId) { - return getBlockType().withPropertyId(propertyId).toBaseBlock(getNbtData()); - } + @Override + public BaseBlock withPropertyId(int propertyId) { + return getBlockType().withPropertyId(propertyId).toBaseBlock(getNbtData()); + } - @Override - public int getInternalBlockTypeId() { - return toImmutableState().getInternalBlockTypeId(); - } + @Override + public int getInternalBlockTypeId() { + return toImmutableState().getInternalBlockTypeId(); + } - @Override - public int getInternalPropertiesId() { - return toImmutableState().getInternalPropertiesId(); - } + @Override + public int getInternalPropertiesId() { + return toImmutableState().getInternalPropertiesId(); + } - @Override - public BaseBlock with(PropertyKey property, V value) { - return toImmutableState().with(property, value).toBaseBlock(getNbtData()); - } + @Override + public BaseBlock with(PropertyKey property, V value) { + return toImmutableState().with(property, value).toBaseBlock(getNbtData()); + } @Override public BaseBlock toBaseBlock(CompoundTag compoundTag) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockState.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockState.java index 05a66f136..07599940a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockState.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockState.java @@ -338,13 +338,13 @@ public class BlockState implements BlockStateHolder, FawePattern { return new BaseBlock(this, compoundTag); } - @Override - public int getInternalId() { - return internalId; - } + @Override + public int getInternalId() { + return internalId; + } - @Override - public BlockMaterial getMaterial() { + @Override + public BlockMaterial getMaterial() { if (this.material == null) { if (blockType == BlockTypes.__RESERVED__) { return this.material = blockType.getMaterial(); @@ -352,7 +352,7 @@ public class BlockState implements BlockStateHolder, FawePattern { this.material = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getMaterial(this); } return material; - } + } @Override public final int getOrdinal() { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java index 3c6073e11..0465bc21d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java @@ -19,7 +19,8 @@ package com.sk89q.worldedit.world.block; -import com.google.common.collect.ImmutableList; +import static com.google.common.base.Preconditions.checkArgument; + import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.extension.platform.Capability; @@ -35,19 +36,16 @@ import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.registry.BlockMaterial; import com.sk89q.worldedit.world.registry.LegacyMapper; - -import javax.annotation.Nullable; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.IntStream; - -import static com.google.common.base.Preconditions.checkArgument; +import javax.annotation.Nullable; public class BlockType implements FawePattern, Keyed { - private final String id; + private final String id; private final BlockTypes.Settings settings; private boolean initItemType; @@ -61,7 +59,7 @@ public class BlockType implements FawePattern, Keyed { @Deprecated public int getMaxStateId() { - return settings.permutations; + return settings.permutations; } /** @@ -248,7 +246,7 @@ public class BlockType implements FawePattern, Keyed { * @return The material */ public BlockMaterial getMaterial() { - return this.settings.blockMaterial; + return this.settings.blockMaterial; } /** @@ -272,7 +270,7 @@ public class BlockType implements FawePattern, Keyed { * @return internal id */ public int getInternalId() { - return this.settings.internalId; + return this.settings.internalId; } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java index ff37090cb..61a8000f8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java @@ -107,14 +107,14 @@ public class ItemType implements RegistryItem, Keyed { } public void setBlockType(BlockType blockType) { - this.blockType = blockType; + this.blockType = blockType; } public BaseItem getDefaultState() { if (defaultState == null) { this.defaultState = new BaseItemStack(this); } - return this.defaultState; + return this.defaultState; } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java index 538927977..cd9d1db06 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java @@ -245,26 +245,26 @@ public final class LegacyMapper { } public BaseBlock getBaseBlockFromPlotBlock(PlotBlock plotBlock) { - if(plotBlock instanceof StringPlotBlock) { - try { - return BlockTypes.get(plotBlock.toString()).getDefaultState().toBaseBlock(); - } catch (Throwable failed) { - log.error("Unable to convert StringPlotBlock " + plotBlock + " to BaseBlock!"); - failed.printStackTrace(); - return null; - } - }else if(plotBlock instanceof LegacyPlotBlock) { - try { - return BaseBlock.getState(((LegacyPlotBlock)plotBlock).getId(), ((LegacyPlotBlock)plotBlock).getData()).toBaseBlock(); - } catch (Throwable failed) { - log.error("Unable to convert LegacyPlotBlock " + plotBlock + " to BaseBlock!"); - failed.printStackTrace(); - return null; - } - }else { - log.error("Unable to convert LegacyPlotBlock " + plotBlock + " to BaseBlock!"); - return null; - } + if(plotBlock instanceof StringPlotBlock) { + try { + return BlockTypes.get(plotBlock.toString()).getDefaultState().toBaseBlock(); + } catch (Throwable failed) { + log.error("Unable to convert StringPlotBlock " + plotBlock + " to BaseBlock!"); + failed.printStackTrace(); + return null; + } + }else if(plotBlock instanceof LegacyPlotBlock) { + try { + return BaseBlock.getState(((LegacyPlotBlock)plotBlock).getId(), ((LegacyPlotBlock)plotBlock).getData()).toBaseBlock(); + } catch (Throwable failed) { + log.error("Unable to convert LegacyPlotBlock " + plotBlock + " to BaseBlock!"); + failed.printStackTrace(); + return null; + } + }else { + log.error("Unable to convert LegacyPlotBlock " + plotBlock + " to BaseBlock!"); + return null; + } } public static LegacyMapper getInstance() {