From 2f8c2666dffcd08d34f3a0755c9f0b1abdcde5e2 Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Wed, 18 Mar 2020 12:58:18 -0400 Subject: [PATCH] Removed LightingExtent and organized some classes. --- .../main/java/com/boydti/fawe/FaweAPI.java | 33 +----------- .../{object => function}/mask/XAxisMask.java | 3 +- .../{object => function}/mask/YAxisMask.java | 3 +- .../{object => function}/mask/ZAxisMask.java | 3 +- .../fawe/object/brush/BrushSettings.java | 10 ---- .../fawe/object/brush/CatenaryBrush.java | 2 +- .../fawe/object/brush/CommandBrush.java | 2 +- .../fawe/object/brush/CopyPastaBrush.java | 7 ++- .../fawe/object/brush/FlattenBrush.java | 1 - .../boydti/fawe/object/brush/HeightBrush.java | 5 +- .../boydti/fawe/object/brush/ImageBrush.java | 2 - .../fawe/object/brush/InspectBrush.java | 8 ++- .../boydti/fawe/object/brush/LayerBrush.java | 1 - .../boydti/fawe/object/brush/LineBrush.java | 2 +- .../boydti/fawe/object/brush/RaiseBrush.java | 5 -- .../fawe/object/brush/RecurseBrush.java | 2 - .../boydti/fawe/object/brush/RockBrush.java | 1 - .../fawe/object/brush/ScatterBrush.java | 3 -- .../fawe/object/brush/ShatterBrush.java | 1 - .../boydti/fawe/object/brush/SplineBrush.java | 3 +- .../fawe/object/brush/StencilBrush.java | 3 -- .../fawe/object/brush/SurfaceSphereBrush.java | 4 +- .../fawe/object/brush/SurfaceSpline.java | 6 ++- .../object/brush/heightmap/HeightMap.java | 1 - .../fawe/object/brush/sweep/Spline.java | 1 - .../fawe/object/brush/sweep/SweepBrush.java | 2 +- .../brush/visualization/VirtualWorld.java | 1 - .../brush/visualization/cfi/CFIDrawer.java | 1 - .../brush/visualization/cfi/MCAWriter.java | 2 - .../fawe/object/extent/LightingExtent.java | 17 ------ .../sk89q/worldedit/command/MaskCommands.java | 6 +-- .../extent/AbstractDelegateExtent.java | 53 +------------------ .../function/mask/DelegateExtentMask.java | 4 -- .../java/com/sk89q/worldedit/world/World.java | 5 -- 34 files changed, 30 insertions(+), 173 deletions(-) rename worldedit-core/src/main/java/com/boydti/fawe/{object => function}/mask/XAxisMask.java (85%) rename worldedit-core/src/main/java/com/boydti/fawe/{object => function}/mask/YAxisMask.java (85%) rename worldedit-core/src/main/java/com/boydti/fawe/{object => function}/mask/ZAxisMask.java (85%) delete mode 100644 worldedit-core/src/main/java/com/boydti/fawe/object/extent/LightingExtent.java diff --git a/worldedit-core/src/main/java/com/boydti/fawe/FaweAPI.java b/worldedit-core/src/main/java/com/boydti/fawe/FaweAPI.java index e11897570..e73f7166a 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/FaweAPI.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/FaweAPI.java @@ -7,7 +7,6 @@ import com.boydti.fawe.object.RegionWrapper; import com.boydti.fawe.object.changeset.DiskStorageHistory; import com.boydti.fawe.object.changeset.SimpleChangeSetSummary; import com.boydti.fawe.object.exception.FaweException; -import com.boydti.fawe.object.extent.LightingExtent; import com.boydti.fawe.regions.FaweMaskManager; import com.boydti.fawe.util.EditSessionBuilder; import com.boydti.fawe.util.MainUtil; @@ -29,7 +28,6 @@ import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats; import com.sk89q.worldedit.internal.registry.AbstractFactory; import com.sk89q.worldedit.internal.registry.InputParser; -import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.formatting.text.Component; @@ -383,11 +381,6 @@ public class FaweAPI { } - @Deprecated - public static int fixLighting(World world, Region selection) { - return fixLighting(world, selection, null); - } - /** * Fix the lighting in a selection
* - First removes all lighting, then relights @@ -399,31 +392,7 @@ public class FaweAPI { * @return */ public static int fixLighting(World world, Region selection, @Nullable IQueueExtent queue) { - //TODO NONE OF THIS CODE WORKS AS OF 2020-03-05 - final BlockVector3 bot = selection.getMinimumPoint(); - final BlockVector3 top = selection.getMaximumPoint(); - - final int minX = bot.getBlockX() >> 4; - final int minZ = bot.getBlockZ() >> 4; - - final int maxX = top.getBlockX() >> 4; - final int maxZ = top.getBlockZ() >> 4; - - int count = 0; - if (queue == null) queue = createQueue(world, false); - // Remove existing lighting first - if (queue instanceof LightingExtent) { - LightingExtent relighter = (LightingExtent) queue; - for (int x = minX; x <= maxX; x++) { - for (int z = minZ; z <= maxZ; z++) { - relighter.relightChunk(x, z); - count++; - } - } - } else { - throw new UnsupportedOperationException("Queue is not " + LightingExtent.class); - } - return count; + throw new UnsupportedOperationException(); } /** diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/XAxisMask.java b/worldedit-core/src/main/java/com/boydti/fawe/function/mask/XAxisMask.java similarity index 85% rename from worldedit-core/src/main/java/com/boydti/fawe/object/mask/XAxisMask.java rename to worldedit-core/src/main/java/com/boydti/fawe/function/mask/XAxisMask.java index 3e0fe8312..2a82b89ef 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/XAxisMask.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/function/mask/XAxisMask.java @@ -1,5 +1,6 @@ -package com.boydti.fawe.object.mask; +package com.boydti.fawe.function.mask; +import com.boydti.fawe.object.mask.ResettableMask; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.mask.AbstractMask; import com.sk89q.worldedit.math.BlockVector3; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/YAxisMask.java b/worldedit-core/src/main/java/com/boydti/fawe/function/mask/YAxisMask.java similarity index 85% rename from worldedit-core/src/main/java/com/boydti/fawe/object/mask/YAxisMask.java rename to worldedit-core/src/main/java/com/boydti/fawe/function/mask/YAxisMask.java index 0b53631f2..219da3012 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/YAxisMask.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/function/mask/YAxisMask.java @@ -1,5 +1,6 @@ -package com.boydti.fawe.object.mask; +package com.boydti.fawe.function.mask; +import com.boydti.fawe.object.mask.ResettableMask; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.mask.AbstractMask; import com.sk89q.worldedit.math.BlockVector3; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/ZAxisMask.java b/worldedit-core/src/main/java/com/boydti/fawe/function/mask/ZAxisMask.java similarity index 85% rename from worldedit-core/src/main/java/com/boydti/fawe/object/mask/ZAxisMask.java rename to worldedit-core/src/main/java/com/boydti/fawe/function/mask/ZAxisMask.java index 99d90786e..d76c88e08 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/ZAxisMask.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/function/mask/ZAxisMask.java @@ -1,5 +1,6 @@ -package com.boydti.fawe.object.mask; +package com.boydti.fawe.function.mask; +import com.boydti.fawe.object.mask.ResettableMask; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.mask.AbstractMask; import com.sk89q.worldedit.math.BlockVector3; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/BrushSettings.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/BrushSettings.java index 2b299739c..7121d395f 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/BrushSettings.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/BrushSettings.java @@ -3,24 +3,14 @@ package com.boydti.fawe.object.brush; import static com.boydti.fawe.object.brush.BrushSettings.SettingType.BRUSH; import static com.google.common.base.Preconditions.checkNotNull; -import com.boydti.fawe.Fawe; import com.boydti.fawe.object.brush.scroll.Scroll; import com.boydti.fawe.object.extent.ResettableExtent; -import com.sk89q.worldedit.LocalSession; -import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.command.tool.BrushTool; import com.sk89q.worldedit.command.tool.brush.Brush; -import com.sk89q.worldedit.entity.Player; -import com.sk89q.worldedit.extension.input.InputParseException; -import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Actor; -import com.sk89q.worldedit.extension.platform.PlatformCommandManager; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.internal.expression.EvaluationException; import com.sk89q.worldedit.internal.expression.Expression; -import com.sk89q.worldedit.internal.expression.ExpressionException; -import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/CatenaryBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/CatenaryBrush.java index b93b7ce8a..94247f503 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/CatenaryBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/CatenaryBrush.java @@ -1,7 +1,6 @@ package com.boydti.fawe.object.brush; import com.boydti.fawe.config.Caption; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.brush.visualization.VisualExtent; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; @@ -11,6 +10,7 @@ import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.util.Location; +import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import java.util.Arrays; import java.util.List; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/CommandBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/CommandBrush.java index ff341ec9f..6ce0bf1b2 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/CommandBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/CommandBrush.java @@ -1,8 +1,8 @@ package com.boydti.fawe.object.brush; import com.boydti.fawe.util.StringMan; -import com.boydti.fawe.wrappers.LocationMaskedPlayerWrapper; import com.boydti.fawe.wrappers.AsyncPlayer; +import com.boydti.fawe.wrappers.LocationMaskedPlayerWrapper; import com.boydti.fawe.wrappers.SilentPlayerWrapper; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; 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 b894a9355..582136f57 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 @@ -1,19 +1,17 @@ package com.boydti.fawe.object.brush; import com.boydti.fawe.config.Caption; -import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.function.mask.DelegateExtentMask; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.brush.visualization.VisualExtent; import com.boydti.fawe.object.clipboard.ResizableClipboardBuilder; import com.boydti.fawe.object.function.NullRegionFunction; -import com.boydti.fawe.object.function.mask.AbstractDelegateMask; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.command.tool.brush.Brush; import com.sk89q.worldedit.entity.Player; +import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.clipboard.Clipboard; +import com.sk89q.worldedit.function.mask.DelegateExtentMask; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.mask.Masks; import com.sk89q.worldedit.function.operation.Operation; @@ -24,6 +22,7 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.transform.AffineTransform; import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.util.Location; +import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockTypes; import java.util.concurrent.ThreadLocalRandom; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/FlattenBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/FlattenBrush.java index de2cbc45a..368f9ac30 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/FlattenBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/FlattenBrush.java @@ -9,7 +9,6 @@ import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.mask.Masks; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.math.BlockVector3; - import java.io.InputStream; public class FlattenBrush extends HeightBrush { 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 4413c7c02..6aa41c3e6 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 @@ -1,10 +1,9 @@ package com.boydti.fawe.object.brush; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; -import com.boydti.fawe.object.brush.visualization.cfi.HeightMapMCAGenerator; import com.boydti.fawe.object.brush.heightmap.HeightMap; import com.boydti.fawe.object.brush.heightmap.RotatableHeightMap; import com.boydti.fawe.object.brush.heightmap.ScalableHeightMap; +import com.boydti.fawe.object.brush.visualization.cfi.HeightMapMCAGenerator; import com.boydti.fawe.object.exception.FaweException; import com.boydti.fawe.util.MathMan; import com.sk89q.worldedit.EditSession; @@ -17,7 +16,7 @@ import com.sk89q.worldedit.function.mask.Masks; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; - +import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import java.io.IOException; import java.io.InputStream; import java.util.concurrent.ThreadLocalRandom; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/ImageBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/ImageBrush.java index 536828a9c..74b020a54 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/ImageBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/ImageBrush.java @@ -19,9 +19,7 @@ import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.math.transform.AffineTransform; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockType; - import java.awt.image.BufferedImage; import java.io.IOException; import java.util.Arrays; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/InspectBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/InspectBrush.java index b4594b97e..8adfa0a14 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/InspectBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/InspectBrush.java @@ -2,30 +2,28 @@ package com.boydti.fawe.object.brush; import com.boydti.fawe.Fawe; import com.boydti.fawe.config.Caption; -import com.boydti.fawe.logging.rollback.RollbackOptimizedHistory; -import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.config.Settings; import com.boydti.fawe.database.DBHandler; import com.boydti.fawe.database.RollbackDatabase; +import com.boydti.fawe.logging.rollback.RollbackOptimizedHistory; import com.boydti.fawe.object.change.MutableFullBlockChange; import com.boydti.fawe.util.MainUtil; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.command.tool.BrushTool; -import com.sk89q.worldedit.command.tool.DoubleActionTraceTool; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.util.Location; +import com.sk89q.worldedit.util.formatting.text.TextComponent; +import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.formatting.text.event.ClickEvent; import com.sk89q.worldedit.util.formatting.text.event.HoverEvent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BlockState; - import java.io.IOException; import java.util.Iterator; import java.util.UUID; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/LayerBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/LayerBrush.java index 9ee24a339..0701b305c 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/LayerBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/LayerBrush.java @@ -18,7 +18,6 @@ import com.sk89q.worldedit.function.visitor.RecursiveVisitor; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.MutableBlockVector3; import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes; import java.util.Arrays; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/LineBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/LineBrush.java index ae30f4e08..16b03844d 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/LineBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/LineBrush.java @@ -1,13 +1,13 @@ package com.boydti.fawe.object.brush; import com.boydti.fawe.config.Caption; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.brush.visualization.VisualExtent; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.command.tool.brush.Brush; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.math.BlockVector3; +import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; public class LineBrush implements Brush, ResettableTool { diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/RaiseBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/RaiseBrush.java index 4ae931884..dffcb29e3 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/RaiseBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/RaiseBrush.java @@ -1,10 +1,5 @@ package com.boydti.fawe.object.brush; -import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.function.pattern.Pattern; -import com.sk89q.worldedit.math.BlockVector3; - public class RaiseBrush extends ErodeBrush { public RaiseBrush() { this(6, 0, 1, 1); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/RecurseBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/RecurseBrush.java index e15ee9d7e..914eb602e 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/RecurseBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/RecurseBrush.java @@ -6,7 +6,6 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.command.tool.brush.Brush; import com.sk89q.worldedit.function.block.BlockReplace; -import com.sk89q.worldedit.function.mask.DelegateExtentMask; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.mask.Masks; import com.sk89q.worldedit.function.operation.Operations; @@ -14,7 +13,6 @@ import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.visitor.RecursiveVisitor; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockStateHolder; public class RecurseBrush implements Brush { diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/RockBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/RockBrush.java index 32cf5ba18..267fb66e4 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/RockBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/RockBrush.java @@ -7,7 +7,6 @@ import com.sk89q.worldedit.command.tool.brush.Brush; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.Vector3; - import java.util.concurrent.ThreadLocalRandom; public class RockBrush implements Brush { diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/ScatterBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/ScatterBrush.java index 159027380..89832d0c1 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/ScatterBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/ScatterBrush.java @@ -9,8 +9,6 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.command.tool.brush.Brush; import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.function.mask.AbstractExtentMask; -import com.sk89q.worldedit.function.mask.DelegateExtentMask; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.mask.MaskUnion; import com.sk89q.worldedit.function.mask.Masks; @@ -19,7 +17,6 @@ import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.visitor.BreadthFirstSearch; import com.sk89q.worldedit.function.visitor.RecursiveVisitor; import com.sk89q.worldedit.math.BlockVector3; - import java.util.Arrays; import java.util.concurrent.ThreadLocalRandom; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/ShatterBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/ShatterBrush.java index 903d4f80e..fbd400de0 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/ShatterBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/ShatterBrush.java @@ -10,7 +10,6 @@ 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 java.util.concurrent.ThreadLocalRandom; public class ShatterBrush extends ScatterBrush { 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 a49d65248..77a77a2af 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 @@ -1,8 +1,6 @@ package com.boydti.fawe.object.brush; import com.boydti.fawe.FaweCache; -import com.sk89q.worldedit.function.mask.DelegateExtentMask; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.brush.visualization.VisualExtent; import com.boydti.fawe.object.mask.IdMask; import com.boydti.fawe.object.visitor.DFSRecursiveVisitor; @@ -18,6 +16,7 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.MutableVector3; import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.math.interpolation.Node; +import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import java.util.ArrayList; import java.util.Collection; import java.util.List; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/StencilBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/StencilBrush.java index 9187edc64..5f215c4f1 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/StencilBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/StencilBrush.java @@ -1,15 +1,12 @@ package com.boydti.fawe.object.brush; import com.boydti.fawe.object.brush.heightmap.HeightMap; -import com.boydti.fawe.object.mask.AdjacentAnyMask; import com.boydti.fawe.util.MathMan; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.function.mask.AbstractExtentMask; -import com.sk89q.worldedit.function.mask.Mask; -import com.sk89q.worldedit.function.mask.Masks; import com.sk89q.worldedit.function.mask.SolidBlockMask; import com.sk89q.worldedit.function.operation.Operations; import com.sk89q.worldedit.function.pattern.Pattern; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SurfaceSphereBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SurfaceSphereBrush.java index c04e4725e..ac4064d06 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SurfaceSphereBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SurfaceSphereBrush.java @@ -5,7 +5,6 @@ import com.boydti.fawe.object.mask.SurfaceMask; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.command.tool.brush.Brush; -import com.sk89q.worldedit.function.mask.DelegateExtentMask; import com.sk89q.worldedit.function.mask.MaskUnion; import com.sk89q.worldedit.function.mask.SolidBlockMask; import com.sk89q.worldedit.function.operation.Operations; @@ -13,7 +12,6 @@ import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.visitor.BreadthFirstSearch; import com.sk89q.worldedit.function.visitor.RecursiveVisitor; import com.sk89q.worldedit.math.BlockVector3; - import java.util.Arrays; public class SurfaceSphereBrush implements Brush { @@ -27,4 +25,4 @@ public class SurfaceSphereBrush implements Brush { visitor.setDirections(Arrays.asList(BreadthFirstSearch.DIAGONAL_DIRECTIONS)); Operations.completeBlindly(visitor); } -} \ No newline at end of file +} 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 a9a977365..621e2b80f 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 @@ -1,10 +1,11 @@ package com.boydti.fawe.object.brush; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.brush.visualization.VisualExtent; import com.boydti.fawe.object.collection.LocalBlockVectorSet; import com.boydti.fawe.util.MathMan; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.MaxChangedBlocksException; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.command.tool.brush.Brush; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.math.BlockVector3; @@ -12,6 +13,7 @@ import com.sk89q.worldedit.math.MutableBlockVector3; import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.math.interpolation.KochanekBartelsInterpolation; import com.sk89q.worldedit.math.interpolation.Node; +import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import java.util.ArrayList; import java.util.List; 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 8e64eb64e..77bad8505 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 @@ -9,7 +9,6 @@ import com.sk89q.worldedit.math.convolution.HeightMapFilter; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; - import java.util.concurrent.ThreadLocalRandom; public interface HeightMap { diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/Spline.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/Spline.java index b7f2eafe4..a43e4dfca 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/Spline.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/Spline.java @@ -8,7 +8,6 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.Vector2; import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.math.interpolation.Interpolation; - import java.util.ArrayList; import java.util.List; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/SweepBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/SweepBrush.java index 3ee21a6f5..9e5c264e6 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/SweepBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/SweepBrush.java @@ -1,6 +1,5 @@ package com.boydti.fawe.object.brush.sweep; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.brush.ResettableTool; import com.boydti.fawe.object.brush.visualization.VisualExtent; import com.boydti.fawe.util.MathMan; @@ -20,6 +19,7 @@ import com.sk89q.worldedit.math.interpolation.KochanekBartelsInterpolation; import com.sk89q.worldedit.math.interpolation.Node; import com.sk89q.worldedit.math.transform.AffineTransform; import com.sk89q.worldedit.session.ClipboardHolder; +import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; 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 884afea68..5e7fd3238 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 @@ -9,7 +9,6 @@ import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.world.SimpleWorld; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockStateHolder; - import java.io.Closeable; import java.io.IOException; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/cfi/CFIDrawer.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/cfi/CFIDrawer.java index 57715ea79..1078d838a 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/cfi/CFIDrawer.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/cfi/CFIDrawer.java @@ -5,7 +5,6 @@ import com.boydti.fawe.util.MathMan; import com.boydti.fawe.util.TextureUtil; import com.sk89q.worldedit.world.block.BlockID; import com.sk89q.worldedit.world.block.BlockTypes; - import java.awt.image.BufferedImage; import java.awt.image.DataBufferInt; import java.util.concurrent.ForkJoinPool; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/cfi/MCAWriter.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/cfi/MCAWriter.java index 3d952538a..7cfb83bf6 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/cfi/MCAWriter.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/cfi/MCAWriter.java @@ -7,13 +7,11 @@ import com.boydti.fawe.util.MainUtil; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.block.BlockID; import it.unimi.dsi.fastutil.io.FastByteArrayOutputStream; - import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.concurrent.ForkJoinPool; import java.util.concurrent.TimeUnit; -import java.util.function.Supplier; import java.util.zip.Deflater; public abstract class MCAWriter implements Extent { diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/extent/LightingExtent.java b/worldedit-core/src/main/java/com/boydti/fawe/object/extent/LightingExtent.java deleted file mode 100644 index 933e277d2..000000000 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/extent/LightingExtent.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.boydti.fawe.object.extent; - -import com.sk89q.worldedit.extent.Extent; - -public interface LightingExtent extends Extent { - int getLight(int x, int y, int z); - - int getSkyLight(int x, int y, int z); - - int getBlockLight(int x, int y, int z); - - int getOpacity(int x, int y, int z); - - int getBrightness(int x, int y, int z); - - public void relightChunk(int chunkX, int chunkZ); -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/MaskCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/MaskCommands.java index 01a11b0d8..1668a1231 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/MaskCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/MaskCommands.java @@ -20,9 +20,9 @@ //import com.boydti.fawe.object.mask.SkyLightMask; //import com.boydti.fawe.object.mask.SurfaceMask; //import com.boydti.fawe.object.mask.WallMask; -//import com.boydti.fawe.object.mask.XAxisMask; -//import com.boydti.fawe.object.mask.YAxisMask; -//import com.boydti.fawe.object.mask.ZAxisMask; +//import com.boydti.fawe.function.mask.XAxisMask; +//import com.boydti.fawe.function.mask.YAxisMask; +//import com.boydti.fawe.function.mask.ZAxisMask; //import com.sk89q.worldedit.IncompleteRegionException; //import com.sk89q.worldedit.LocalSession; //import com.sk89q.worldedit.WorldEdit; 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 d74001ed7..8581b2148 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 @@ -26,7 +26,6 @@ import com.boydti.fawe.beta.IBatchProcessor; import com.boydti.fawe.object.HistoryExtent; import com.boydti.fawe.object.changeset.AbstractChangeSet; import com.boydti.fawe.object.exception.FaweException; -import com.boydti.fawe.object.extent.LightingExtent; import com.boydti.fawe.util.ExtentTraverser; import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.WorldEditException; @@ -52,7 +51,7 @@ import org.jetbrains.annotations.Range; /** * A base class for {@link Extent}s that merely passes extents onto another. */ -public class AbstractDelegateExtent implements Extent, LightingExtent { +public class AbstractDelegateExtent implements Extent { private final Extent extent; @@ -200,55 +199,7 @@ public class AbstractDelegateExtent implements Extent, LightingExtent { public boolean setBiome(BlockVector2 position, BiomeType biome) { return extent.setBiome(position.getX(), 0, position.getZ(), biome); } - - @Override - public int getSkyLight(int x, int y, int z) { - if (extent instanceof LightingExtent) { - return ((LightingExtent) extent).getSkyLight(x, y, z); - } - return 0; - } - - @Override - public int getBlockLight(int x, int y, int z) { - if (extent instanceof LightingExtent) { - return ((LightingExtent) extent).getBlockLight(x, y, z); - } - return getBrightness(x, y, z); - } - @Override - public int getOpacity(int x, int y, int z) { - if (extent instanceof LightingExtent) { - return ((LightingExtent) extent).getOpacity(x, y, z); - } - return getBlock(x, y, z).getBlockType().getMaterial().getLightOpacity(); - } - - @Override - public int getLight(int x, int y, int z) { - if (extent instanceof LightingExtent) { - return ((LightingExtent) extent).getLight(x, y, z); - } - return 0; - } - - @Override - public int getBrightness(int x, int y, int z) { - if (extent instanceof LightingExtent) { - return ((LightingExtent) extent).getBrightness(x, y, z); - } - return getBlock(x, y, z).getBlockType().getMaterial().getLightValue(); - } - - @Override - public void relightChunk(int chunkX, int chunkZ) { - if (extent instanceof LightingExtent) { - ((LightingExtent) extent).relightChunk(chunkX, chunkZ); - } else { - throw new UnsupportedOperationException("Cannot relight"); - } - } - + @Override public String toString() { return super.toString() + ":" + (extent == this ? "" : extent.toString()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/DelegateExtentMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/DelegateExtentMask.java index 7119ba96e..78c765a4c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/DelegateExtentMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/DelegateExtentMask.java @@ -17,10 +17,6 @@ public class DelegateExtentMask extends AbstractDelegateMask { return super.test(extent, vector); } - public Extent getExtent() { - return extent; - } - @Override public Mask withExtent(Extent extent) { return new DelegateExtentMask(extent, getMask()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java index 30f489589..5c6ba7df3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java @@ -22,7 +22,6 @@ package com.sk89q.worldedit.world; import com.boydti.fawe.beta.IChunkGet; import com.boydti.fawe.beta.implementation.packet.ChunkPacket; import com.boydti.fawe.beta.IChunkCache; -import com.boydti.fawe.object.extent.LightingExtent; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.WorldEditException; @@ -134,10 +133,6 @@ public interface World extends Extent, Keyed, IChunkCache { * @return the light level (0-15) */ default int getBlockLightLevel(BlockVector3 position) { - if (this instanceof LightingExtent) { - LightingExtent extent = (LightingExtent) this; - return extent.getBlockLight(position.getX(), position.getY(), position.getZ()); - } return getBlock(position).getMaterial().getLightValue(); }