From 930dee9326d19dbcbdacc3df8d2aa9a090062173 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 4 Nov 2019 17:44:23 +0000 Subject: [PATCH 01/22] Refactor BlockVector2 --- .../plotsquared/bukkit/BukkitMain.java | 42 +++++++- .../plotsquared/bukkit/chat/FancyMessage.java | 14 ++- .../bukkit/commands/DebugUUID.java | 12 ++- .../bukkit/generator/BukkitPlotGenerator.java | 6 +- .../generator/DelegatePlotGenerator.java | 1 - .../bukkit/listeners/ChunkListener.java | 1 - .../bukkit/listeners/PlayerEvents.java | 101 ++++++++++++++++-- .../bukkit/object/entity/EntityBaseStats.java | 1 - .../entity/ReplicatingEntityWrapper.java | 18 +++- .../bukkit/object/schematic/StateWrapper.java | 7 +- .../bukkit/util/BukkitChunkManager.java | 62 ++++++----- .../bukkit/util/BukkitCommand.java | 8 +- .../bukkit/util/BukkitEventUtil.java | 18 +++- .../bukkit/util/BukkitHybridUtils.java | 8 +- .../bukkit/util/BukkitLegacyMappings.java | 8 +- .../bukkit/util/BukkitSchematicHandler.java | 17 ++- .../plotsquared/bukkit/util/BukkitUtil.java | 8 +- .../plotsquared/bukkit/util/Metrics.java | 16 ++- .../plotsquared/bukkit/util/NbtFactory.java | 25 ++++- .../bukkit/util/OfflinePlayerUtil.java | 8 +- .../plotsquared/bukkit/util/SendChunk.java | 10 +- .../plotsquared/commands/Command.java | 10 +- .../configuration/MemorySection.java | 7 +- .../configuration/file/FileConfiguration.java | 11 +- .../plotsquared/json/JSONObject.java | 11 +- .../plotsquared/json/JSONTokener.java | 7 +- .../plotsquared/plot/IPlotMain.java | 12 ++- .../plotsquared/plot/PlotSquared.java | 57 +++++++++- .../plotsquared/plot/commands/Area.java | 32 ++++-- .../plotsquared/plot/commands/Auto.java | 10 +- .../plotsquared/plot/commands/Claim.java | 8 +- .../plotsquared/plot/commands/Cluster.java | 8 +- .../plot/commands/DebugClaimTest.java | 11 +- .../plotsquared/plot/commands/DebugExec.java | 25 ++++- .../plotsquared/plot/commands/FlagCmd.java | 11 +- .../plotsquared/plot/commands/Like.java | 6 +- .../plotsquared/plot/commands/ListCmd.java | 8 +- .../plot/commands/MainCommand.java | 9 +- .../plotsquared/plot/commands/Rate.java | 12 ++- .../plot/commands/RegenAllRoads.java | 2 +- .../plotsquared/plot/commands/Relight.java | 6 +- .../plotsquared/plot/commands/Save.java | 6 +- .../plotsquared/plot/commands/Setup.java | 16 ++- .../plotsquared/plot/commands/Template.java | 11 +- .../plotsquared/plot/commands/Trim.java | 40 ++++--- .../plotsquared/plot/commands/Visit.java | 12 ++- .../plotsquared/plot/config/Config.java | 6 +- .../plotsquared/plot/database/MySQL.java | 6 +- .../plotsquared/plot/database/SQLManager.java | 35 ++++-- .../plotsquared/plot/database/SQLite.java | 6 +- .../plotsquared/plot/flag/FlagManager.java | 7 +- .../plot/flag/PlotBlockListFlag.java | 1 - .../plotsquared/plot/flag/StringFlag.java | 1 - .../plot/generator/ClassicPlotManager.java | 8 +- .../plot/generator/ClassicPlotWorld.java | 1 - .../plotsquared/plot/generator/HybridGen.java | 6 +- .../plot/generator/HybridPlotManager.java | 8 +- .../plot/generator/HybridUtils.java | 75 +++++++------ .../generator/IndependentPlotGenerator.java | 5 +- .../plot/generator/SquarePlotManager.java | 7 +- .../plot/listener/PlotListener.java | 11 +- .../plotsquared/plot/object/BlockBucket.java | 8 +- .../plotsquared/plot/object/BlockLoc.java | 50 ++++++--- .../plotsquared/plot/object/ChunkLoc.java | 50 --------- .../plot/object/LegacyPlotBlock.java | 1 - .../plotsquared/plot/object/Location.java | 5 +- .../plotsquared/plot/object/Plot.java | 39 +++++-- .../plotsquared/plot/object/PlotArea.java | 10 +- .../plotsquared/plot/object/PlotCluster.java | 4 +- .../plotsquared/plot/object/PlotPlayer.java | 8 +- .../plotsquared/plot/object/PlotSettings.java | 2 +- .../object/worlds/DefaultPlotAreaManager.java | 8 +- .../plot/object/worlds/SinglePlot.java | 8 +- .../plot/object/worlds/SinglePlotArea.java | 9 +- .../plot/object/worlds/SinglePlotManager.java | 7 +- .../object/worlds/SingleWorldGenerator.java | 6 +- .../plotsquared/plot/util/ChunkManager.java | 76 ++++++------- .../plotsquared/plot/util/EventUtil.java | 11 +- .../plotsquared/plot/util/IncendoPaster.java | 7 +- .../plotsquared/plot/util/MainUtil.java | 28 ++++- .../plot/util/SchematicHandler.java | 29 +++-- .../plotsquared/plot/util/UUIDHandler.java | 2 +- .../plot/util/UUIDHandlerImplementation.java | 2 +- .../plotsquared/plot/util/WorldUtil.java | 16 ++- .../plot/util/block/LocalBlockQueue.java | 6 +- .../plot/util/expiry/ExpireManager.java | 19 +++- .../plot/util/expiry/PlotAnalysis.java | 7 +- .../plotsquared/plot/util/EventUtilTest.java | 7 +- .../plotsquared/nukkit/NukkitMain.java | 4 - .../nukkit/generator/NukkitPlotGenerator.java | 1 - .../nukkit/listeners/PlayerEvents.java | 3 - .../nukkit/object/NukkitPlayer.java | 1 - .../plotsquared/nukkit/util/Metrics.java | 2 - .../nukkit/util/NukkitChunkManager.java | 7 +- .../nukkit/util/NukkitEventUtil.java | 1 - .../nukkit/util/NukkitSchematicHandler.java | 9 +- .../plotsquared/nukkit/util/NukkitUtil.java | 1 - .../nukkit/util/block/NukkitHybridGen.java | 2 + .../nukkit/util/block/NukkitLocalQueue.java | 2 + .../nukkit/util/block/NukkitWrappedChunk.java | 2 + .../plotsquared/sponge/SpongeMain.java | 1 - .../sponge/listener/MainListener.java | 3 - .../sponge/util/SpongeChunkManager.java | 8 +- .../sponge/util/SpongeCommand.java | 2 - .../sponge/util/SpongeEventUtil.java | 1 - .../sponge/util/SpongeMetrics.java | 37 +++---- .../sponge/util/SpongeSchematicHandler.java | 9 +- .../sponge/util/SpongeSetupUtils.java | 1 - .../plotsquared/sponge/util/SpongeUtil.java | 2 - .../sponge/util/block/GenChunk.java | 2 + .../sponge/util/block/SpongeLocalQueue.java | 2 + 111 files changed, 1061 insertions(+), 389 deletions(-) delete mode 100644 Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ChunkLoc.java diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java index 272d09056..a851207cd 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java @@ -7,7 +7,21 @@ import com.github.intellectualsites.plotsquared.bukkit.listeners.PlayerEvents; import com.github.intellectualsites.plotsquared.bukkit.listeners.PlotPlusListener; import com.github.intellectualsites.plotsquared.bukkit.listeners.SingleWorldListener; import com.github.intellectualsites.plotsquared.bukkit.listeners.WorldEvents; -import com.github.intellectualsites.plotsquared.bukkit.util.*; +import com.github.intellectualsites.plotsquared.bukkit.util.BukkitBlockRegistry; +import com.github.intellectualsites.plotsquared.bukkit.util.BukkitChatManager; +import com.github.intellectualsites.plotsquared.bukkit.util.BukkitChunkManager; +import com.github.intellectualsites.plotsquared.bukkit.util.BukkitCommand; +import com.github.intellectualsites.plotsquared.bukkit.util.BukkitEconHandler; +import com.github.intellectualsites.plotsquared.bukkit.util.BukkitEventUtil; +import com.github.intellectualsites.plotsquared.bukkit.util.BukkitHybridUtils; +import com.github.intellectualsites.plotsquared.bukkit.util.BukkitInventoryUtil; +import com.github.intellectualsites.plotsquared.bukkit.util.BukkitLegacyMappings; +import com.github.intellectualsites.plotsquared.bukkit.util.BukkitSchematicHandler; +import com.github.intellectualsites.plotsquared.bukkit.util.BukkitSetupUtils; +import com.github.intellectualsites.plotsquared.bukkit.util.BukkitTaskManager; +import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; +import com.github.intellectualsites.plotsquared.bukkit.util.Metrics; +import com.github.intellectualsites.plotsquared.bukkit.util.SetGenCB; import com.github.intellectualsites.plotsquared.bukkit.util.block.BukkitLocalQueue; import com.github.intellectualsites.plotsquared.bukkit.uuid.DefaultUUIDWrapper; import com.github.intellectualsites.plotsquared.bukkit.uuid.FileUUIDHandler; @@ -35,14 +49,36 @@ import com.github.intellectualsites.plotsquared.plot.object.worlds.PlotAreaManag import com.github.intellectualsites.plotsquared.plot.object.worlds.SinglePlotArea; import com.github.intellectualsites.plotsquared.plot.object.worlds.SinglePlotAreaManager; import com.github.intellectualsites.plotsquared.plot.object.worlds.SingleWorldGenerator; -import com.github.intellectualsites.plotsquared.plot.util.*; +import com.github.intellectualsites.plotsquared.plot.util.ChatManager; +import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; +import com.github.intellectualsites.plotsquared.plot.util.ConsoleColors; +import com.github.intellectualsites.plotsquared.plot.util.EconHandler; +import com.github.intellectualsites.plotsquared.plot.util.EventUtil; +import com.github.intellectualsites.plotsquared.plot.util.InventoryUtil; +import com.github.intellectualsites.plotsquared.plot.util.LegacyMappings; +import com.github.intellectualsites.plotsquared.plot.util.MainUtil; +import com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils; +import com.github.intellectualsites.plotsquared.plot.util.SchematicHandler; +import com.github.intellectualsites.plotsquared.plot.util.SetupUtils; +import com.github.intellectualsites.plotsquared.plot.util.StringMan; +import com.github.intellectualsites.plotsquared.plot.util.TaskManager; +import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; +import com.github.intellectualsites.plotsquared.plot.util.UUIDHandlerImplementation; +import com.github.intellectualsites.plotsquared.plot.util.UpdateUtility; +import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; import com.github.intellectualsites.plotsquared.plot.util.block.QueueProvider; import com.github.intellectualsites.plotsquared.plot.uuid.UUIDWrapper; import com.sk89q.worldedit.WorldEdit; import io.papermc.lib.PaperLib; import lombok.Getter; import lombok.NonNull; -import org.bukkit.*; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.Chunk; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.OfflinePlayer; +import org.bukkit.World; import org.bukkit.command.PluginCommand; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/FancyMessage.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/FancyMessage.java index 56635abb0..348f50f9a 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/FancyMessage.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/FancyMessage.java @@ -19,8 +19,18 @@ import org.bukkit.inventory.ItemStack; import java.io.IOException; import java.io.StringWriter; -import java.lang.reflect.*; -import java.util.*; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; import java.util.logging.Level; /** diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/commands/DebugUUID.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/commands/DebugUUID.java index bb5930228..49d399da1 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/commands/DebugUUID.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/commands/DebugUUID.java @@ -16,7 +16,11 @@ import com.github.intellectualsites.plotsquared.plot.object.OfflinePlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.StringWrapper; -import com.github.intellectualsites.plotsquared.plot.util.*; +import com.github.intellectualsites.plotsquared.plot.util.MainUtil; +import com.github.intellectualsites.plotsquared.plot.util.StringMan; +import com.github.intellectualsites.plotsquared.plot.util.TaskManager; +import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; +import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; import com.github.intellectualsites.plotsquared.plot.uuid.UUIDWrapper; import com.google.common.collect.Sets; @@ -24,8 +28,12 @@ import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; import java.util.Map.Entry; +import java.util.UUID; @CommandDeclaration(command = "uuidconvert", permission = "plots.admin", description = "Debug UUID conversion", usage = "/plot uuidconvert ", diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/BukkitPlotGenerator.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/BukkitPlotGenerator.java index 465fcab20..53a7dd358 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/BukkitPlotGenerator.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/BukkitPlotGenerator.java @@ -5,13 +5,13 @@ import com.github.intellectualsites.plotsquared.bukkit.util.block.GenChunk; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.generator.GeneratorWrapper; import com.github.intellectualsites.plotsquared.plot.generator.IndependentPlotGenerator; -import com.github.intellectualsites.plotsquared.plot.object.ChunkLoc; import com.github.intellectualsites.plotsquared.plot.object.ChunkWrapper; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.worlds.SingleWorldGenerator; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; +import com.sk89q.worldedit.math.BlockVector2; import org.bukkit.World; import org.bukkit.block.Biome; import org.bukkit.generator.BlockPopulator; @@ -145,7 +145,7 @@ public class BukkitPlotGenerator extends ChunkGenerator if (this.platformGenerator != this) { return this.platformGenerator.generateChunkData(world, random, x, z, biome); } else { - generate(new ChunkLoc(x, z), world, result); + generate(BlockVector2.at(x, z), world, result); } } catch (Throwable e) { e.printStackTrace(); @@ -154,7 +154,7 @@ public class BukkitPlotGenerator extends ChunkGenerator return result.getChunkData(); } - private void generate(ChunkLoc loc, World world, ScopedLocalBlockQueue result) { + private void generate(BlockVector2 loc, World world, ScopedLocalBlockQueue result) { // Load if improperly loaded if (!this.loaded) { String name = world.getName(); diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/DelegatePlotGenerator.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/DelegatePlotGenerator.java index c8b57dc78..6a2655d24 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/DelegatePlotGenerator.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/DelegatePlotGenerator.java @@ -9,7 +9,6 @@ import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; import com.github.intellectualsites.plotsquared.plot.object.PlotId; -import com.github.intellectualsites.plotsquared.plot.object.PlotManager; import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; import lombok.RequiredArgsConstructor; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/ChunkListener.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/ChunkListener.java index 5634ff02f..046c0de8f 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/ChunkListener.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/ChunkListener.java @@ -1,7 +1,6 @@ package com.github.intellectualsites.plotsquared.bukkit.listeners; import com.github.intellectualsites.plotsquared.plot.PlotSquared; -import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java index 611303552..f70d7f46b 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java @@ -10,8 +10,25 @@ import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.listener.PlayerBlockEventType; import com.github.intellectualsites.plotsquared.plot.listener.PlotListener; -import com.github.intellectualsites.plotsquared.plot.object.*; -import com.github.intellectualsites.plotsquared.plot.util.*; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.github.intellectualsites.plotsquared.plot.object.PlotHandler; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.object.PlotInventory; +import com.github.intellectualsites.plotsquared.plot.object.PlotMessage; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.StringWrapper; +import com.github.intellectualsites.plotsquared.plot.util.EntityUtil; +import com.github.intellectualsites.plotsquared.plot.util.EventUtil; +import com.github.intellectualsites.plotsquared.plot.util.MainUtil; +import com.github.intellectualsites.plotsquared.plot.util.MathMan; +import com.github.intellectualsites.plotsquared.plot.util.Permissions; +import com.github.intellectualsites.plotsquared.plot.util.RegExUtil; +import com.github.intellectualsites.plotsquared.plot.util.TaskManager; +import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; +import com.github.intellectualsites.plotsquared.plot.util.UpdateUtility; import io.papermc.lib.PaperLib; import org.bukkit.Bukkit; import org.bukkit.ChatColor; @@ -23,18 +40,81 @@ import org.bukkit.block.BlockFace; import org.bukkit.block.BlockState; import org.bukkit.block.data.BlockData; import org.bukkit.command.PluginCommand; -import org.bukkit.entity.*; +import org.bukkit.entity.Ageable; +import org.bukkit.entity.Animals; +import org.bukkit.entity.ArmorStand; +import org.bukkit.entity.Arrow; +import org.bukkit.entity.Creature; +import org.bukkit.entity.EnderDragon; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.FallingBlock; +import org.bukkit.entity.Fireball; +import org.bukkit.entity.Hanging; +import org.bukkit.entity.HumanEntity; +import org.bukkit.entity.ItemFrame; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Monster; +import org.bukkit.entity.Player; +import org.bukkit.entity.Projectile; +import org.bukkit.entity.TNTPrimed; +import org.bukkit.entity.Tameable; +import org.bukkit.entity.ThrownPotion; +import org.bukkit.entity.Vehicle; +import org.bukkit.entity.Villager; +import org.bukkit.entity.WaterMob; import org.bukkit.event.Event; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; -import org.bukkit.event.block.*; -import org.bukkit.event.entity.*; +import org.bukkit.event.block.Action; +import org.bukkit.event.block.BlockBreakEvent; +import org.bukkit.event.block.BlockBurnEvent; +import org.bukkit.event.block.BlockDamageEvent; +import org.bukkit.event.block.BlockDispenseEvent; +import org.bukkit.event.block.BlockExplodeEvent; +import org.bukkit.event.block.BlockFadeEvent; +import org.bukkit.event.block.BlockFormEvent; +import org.bukkit.event.block.BlockFromToEvent; +import org.bukkit.event.block.BlockGrowEvent; +import org.bukkit.event.block.BlockIgniteEvent; +import org.bukkit.event.block.BlockPhysicsEvent; +import org.bukkit.event.block.BlockPistonExtendEvent; +import org.bukkit.event.block.BlockPistonRetractEvent; +import org.bukkit.event.block.BlockPlaceEvent; +import org.bukkit.event.block.BlockRedstoneEvent; +import org.bukkit.event.block.BlockSpreadEvent; +import org.bukkit.event.block.EntityBlockFormEvent; +import org.bukkit.event.entity.CreatureSpawnEvent; +import org.bukkit.event.entity.EntityChangeBlockEvent; +import org.bukkit.event.entity.EntityCombustByEntityEvent; +import org.bukkit.event.entity.EntityDamageByEntityEvent; +import org.bukkit.event.entity.EntityDamageEvent; +import org.bukkit.event.entity.EntityExplodeEvent; +import org.bukkit.event.entity.ExplosionPrimeEvent; +import org.bukkit.event.entity.LingeringPotionSplashEvent; +import org.bukkit.event.entity.PotionSplashEvent; +import org.bukkit.event.entity.ProjectileHitEvent; +import org.bukkit.event.entity.ProjectileLaunchEvent; import org.bukkit.event.hanging.HangingBreakByEntityEvent; import org.bukkit.event.hanging.HangingPlaceEvent; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryCloseEvent; -import org.bukkit.event.player.*; +import org.bukkit.event.player.AsyncPlayerChatEvent; +import org.bukkit.event.player.PlayerBucketEmptyEvent; +import org.bukkit.event.player.PlayerBucketFillEvent; +import org.bukkit.event.player.PlayerChangedWorldEvent; +import org.bukkit.event.player.PlayerCommandPreprocessEvent; +import org.bukkit.event.player.PlayerEggThrowEvent; +import org.bukkit.event.player.PlayerEvent; +import org.bukkit.event.player.PlayerInteractAtEntityEvent; +import org.bukkit.event.player.PlayerInteractEntityEvent; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.event.player.PlayerMoveEvent; +import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.event.player.PlayerRespawnEvent; +import org.bukkit.event.player.PlayerTeleportEvent; import org.bukkit.event.vehicle.VehicleCreateEvent; import org.bukkit.event.vehicle.VehicleDestroyEvent; import org.bukkit.event.vehicle.VehicleEntityCollisionEvent; @@ -53,8 +133,15 @@ import org.bukkit.projectiles.ProjectileSource; import org.bukkit.util.Vector; import java.lang.reflect.Field; -import java.util.*; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; import java.util.Map.Entry; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.UUID; import java.util.regex.Pattern; /** diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/EntityBaseStats.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/EntityBaseStats.java index d33b4d913..c36236a5d 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/EntityBaseStats.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/EntityBaseStats.java @@ -1,6 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.object.entity; - class EntityBaseStats { EntityWrapper passenger; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/ReplicatingEntityWrapper.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/ReplicatingEntityWrapper.java index 769fcc9b3..a237bf96a 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/ReplicatingEntityWrapper.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/ReplicatingEntityWrapper.java @@ -8,7 +8,23 @@ import org.bukkit.Rotation; import org.bukkit.TreeSpecies; import org.bukkit.World; import org.bukkit.block.BlockFace; -import org.bukkit.entity.*; +import org.bukkit.entity.AbstractHorse; +import org.bukkit.entity.Ageable; +import org.bukkit.entity.ArmorStand; +import org.bukkit.entity.Bat; +import org.bukkit.entity.Boat; +import org.bukkit.entity.ChestedHorse; +import org.bukkit.entity.EnderDragon; +import org.bukkit.entity.Entity; +import org.bukkit.entity.IronGolem; +import org.bukkit.entity.Item; +import org.bukkit.entity.ItemFrame; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Painting; +import org.bukkit.entity.Rabbit; +import org.bukkit.entity.Sheep; +import org.bukkit.entity.Slime; +import org.bukkit.entity.Tameable; import org.bukkit.inventory.EntityEquipment; import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemStack; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/schematic/StateWrapper.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/schematic/StateWrapper.java index aaf5f4aa5..3d5c75edf 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/schematic/StateWrapper.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/schematic/StateWrapper.java @@ -3,7 +3,12 @@ package com.github.intellectualsites.plotsquared.bukkit.object.schematic; import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; -import com.sk89q.jnbt.*; +import com.sk89q.jnbt.ByteTag; +import com.sk89q.jnbt.CompoundTag; +import com.sk89q.jnbt.ListTag; +import com.sk89q.jnbt.ShortTag; +import com.sk89q.jnbt.StringTag; +import com.sk89q.jnbt.Tag; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChunkManager.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChunkManager.java index 6771d1d3a..d768ac32b 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChunkManager.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChunkManager.java @@ -5,13 +5,20 @@ import com.github.intellectualsites.plotsquared.bukkit.object.entity.Replicating import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.generator.AugmentedUtils; import com.github.intellectualsites.plotsquared.plot.listener.WEExtent; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.github.intellectualsites.plotsquared.plot.object.PlotLoc; +import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; import com.sk89q.worldedit.bukkit.BukkitWorld; +import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BaseBlock; import io.papermc.lib.PaperLib; @@ -25,8 +32,14 @@ import org.bukkit.entity.Creature; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; -import java.util.*; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; +import java.util.Set; import java.util.concurrent.CompletableFuture; public class BukkitChunkManager extends ChunkManager { @@ -35,15 +48,6 @@ public class BukkitChunkManager extends ChunkManager { return x >= region.minX && x <= region.maxX && z >= region.minZ && z <= region.maxZ; } - private static byte getOrdinal(Object[] list, Object value) { - for (byte i = 0; i < list.length; i++) { - if (list[i].equals(value)) { - return i; - } - } - return 0; - } - public static ContentMap swapChunk(World world1, World world2, Chunk pos1, Chunk pos2, RegionWrapper r1, RegionWrapper r2) { ContentMap map = new ContentMap(); @@ -104,10 +108,10 @@ public class BukkitChunkManager extends ChunkManager { return map; } - @Override public Set getChunkChunks(String world) { - Set chunks = super.getChunkChunks(world); + @Override public Set getChunkChunks(String world) { + Set chunks = super.getChunkChunks(world); for (Chunk chunk : Bukkit.getWorld(world).getLoadedChunks()) { - ChunkLoc loc = new ChunkLoc(chunk.getX() >> 5, chunk.getZ() >> 5); + BlockVector2 loc = BlockVector2.at(chunk.getX() >> 5, chunk.getZ() >> 5); chunks.add(loc); } return chunks; @@ -210,10 +214,10 @@ public class BukkitChunkManager extends ChunkManager { int bz = value[3]; int tx = value[4]; int tz = value[5]; - ChunkLoc loc = new ChunkLoc(value[0], value[1]); - int cxx = loc.x << 4; - int czz = loc.z << 4; - PaperLib.getChunkAtAsync(oldWorld, loc.x, loc.z) + BlockVector2 loc = BlockVector2.at(value[0], value[1]); + int cxx = loc.getX() << 4; + int czz = loc.getZ() << 4; + PaperLib.getChunkAtAsync(oldWorld, loc.getX(), loc.getZ()) .thenAccept(chunk1 -> map.saveEntitiesIn(chunk1, region)).thenRun(() -> { for (int x = bx & 15; x <= (tx & 15); x++) { for (int z = bz & 15; z <= (tz & 15); z++) { @@ -256,11 +260,11 @@ public class BukkitChunkManager extends ChunkManager { final int tcx = p2x >> 4; final int tcz = p2z >> 4; - final List chunks = new ArrayList<>(); + final List chunks = new ArrayList<>(); for (int x = bcx; x <= tcx; x++) { for (int z = bcz; z <= tcz; z++) { - chunks.add(new ChunkLoc(x, z)); + chunks.add(BlockVector2.at(x, z)); } } final World worldObj = Bukkit.getWorld(world); @@ -269,9 +273,9 @@ public class BukkitChunkManager extends ChunkManager { @Override public void run() { long start = System.currentTimeMillis(); while (!chunks.isEmpty() && System.currentTimeMillis() - start < 5) { - final ChunkLoc chunk = chunks.remove(0); - int x = chunk.x; - int z = chunk.z; + final BlockVector2 chunk = chunks.remove(0); + int x = chunk.getX(); + int z = chunk.getZ(); int xxb = x << 4; int zzb = z << 4; int xxt = xxb + 15; @@ -284,7 +288,7 @@ public class BukkitChunkManager extends ChunkManager { if (xxb >= p1x && xxt <= p2x && zzb >= p1z && zzt <= p2z && PlotSquared.imp().getServerVersion()[1] == 13) { AugmentedUtils - .bypass(ignoreAugment, () -> queue.regenChunkSafe(chunk.x, chunk.z)); + .bypass(ignoreAugment, () -> queue.regenChunkSafe(chunk.getX(), chunk.getZ())); continue; } boolean checkX1 = false; @@ -393,17 +397,17 @@ public class BukkitChunkManager extends ChunkManager { return true; } - @Override public CompletableFuture loadChunk(String world, ChunkLoc chunkLoc, boolean force) { - return PaperLib.getChunkAtAsync(BukkitUtil.getWorld(world),chunkLoc.x, chunkLoc.z, force); + @Override public CompletableFuture loadChunk(String world, BlockVector2 chunkLoc, boolean force) { + return PaperLib.getChunkAtAsync(BukkitUtil.getWorld(world),chunkLoc.getX(), chunkLoc.getZ(), force); } @Override - public void unloadChunk(final String world, final ChunkLoc chunkLoc, final boolean save) { + public void unloadChunk(final String world, final BlockVector2 chunkLoc, final boolean save) { if (!PlotSquared.get().isMainThread(Thread.currentThread())) { TaskManager.runTask( - () -> BukkitUtil.getWorld(world).unloadChunk(chunkLoc.x, chunkLoc.z, save)); + () -> BukkitUtil.getWorld(world).unloadChunk(chunkLoc.getX(), chunkLoc.getZ(), save)); } else { - BukkitUtil.getWorld(world).unloadChunk(chunkLoc.x, chunkLoc.z, save); + BukkitUtil.getWorld(world).unloadChunk(chunkLoc.getX(), chunkLoc.getZ(), save); } } diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitCommand.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitCommand.java index 27edabf78..190aa077a 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitCommand.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitCommand.java @@ -4,7 +4,13 @@ import com.github.intellectualsites.plotsquared.bukkit.commands.DebugUUID; import com.github.intellectualsites.plotsquared.plot.commands.MainCommand; import com.github.intellectualsites.plotsquared.plot.object.ConsolePlayer; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; -import org.bukkit.command.*; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.command.ConsoleCommandSender; +import org.bukkit.command.ProxiedCommandSender; +import org.bukkit.command.RemoteConsoleCommandSender; +import org.bukkit.command.TabCompleter; import org.bukkit.entity.Player; import java.util.ArrayList; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEventUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEventUtil.java index c2e39715e..25ca0e16e 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEventUtil.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEventUtil.java @@ -1,6 +1,22 @@ package com.github.intellectualsites.plotsquared.bukkit.util; -import com.github.intellectualsites.plotsquared.bukkit.events.*; +import com.github.intellectualsites.plotsquared.bukkit.events.PlayerClaimPlotEvent; +import com.github.intellectualsites.plotsquared.bukkit.events.PlayerEnterPlotEvent; +import com.github.intellectualsites.plotsquared.bukkit.events.PlayerLeavePlotEvent; +import com.github.intellectualsites.plotsquared.bukkit.events.PlayerPlotDeniedEvent; +import com.github.intellectualsites.plotsquared.bukkit.events.PlayerPlotHelperEvent; +import com.github.intellectualsites.plotsquared.bukkit.events.PlayerPlotTrustedEvent; +import com.github.intellectualsites.plotsquared.bukkit.events.PlayerTeleportToPlotEvent; +import com.github.intellectualsites.plotsquared.bukkit.events.PlotAutoMergeEvent; +import com.github.intellectualsites.plotsquared.bukkit.events.PlotChangeOwnerEvent; +import com.github.intellectualsites.plotsquared.bukkit.events.PlotClearEvent; +import com.github.intellectualsites.plotsquared.bukkit.events.PlotComponentSetEvent; +import com.github.intellectualsites.plotsquared.bukkit.events.PlotDeleteEvent; +import com.github.intellectualsites.plotsquared.bukkit.events.PlotFlagAddEvent; +import com.github.intellectualsites.plotsquared.bukkit.events.PlotFlagRemoveEvent; +import com.github.intellectualsites.plotsquared.bukkit.events.PlotMergeEvent; +import com.github.intellectualsites.plotsquared.bukkit.events.PlotRateEvent; +import com.github.intellectualsites.plotsquared.bukkit.events.PlotUnlinkEvent; import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.object.Location; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java index fb0d20fbc..2d0e2cfa2 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java @@ -5,7 +5,13 @@ import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.generator.HybridPlotWorld; import com.github.intellectualsites.plotsquared.plot.generator.HybridUtils; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; +import com.github.intellectualsites.plotsquared.plot.object.StringPlotBlock; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.MathMan; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitLegacyMappings.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitLegacyMappings.java index 0331e948a..c7d953ea7 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitLegacyMappings.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitLegacyMappings.java @@ -15,7 +15,13 @@ import lombok.ToString; import org.bukkit.Bukkit; import org.bukkit.Material; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; import java.util.stream.Collectors; /** diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSchematicHandler.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSchematicHandler.java index 76462a11e..3f980d37c 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSchematicHandler.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSchematicHandler.java @@ -8,13 +8,26 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.SchematicHandler; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; -import com.sk89q.jnbt.*; +import com.sk89q.jnbt.ByteArrayTag; +import com.sk89q.jnbt.CompoundTag; +import com.sk89q.jnbt.IntArrayTag; +import com.sk89q.jnbt.IntTag; +import com.sk89q.jnbt.ListTag; +import com.sk89q.jnbt.ShortTag; +import com.sk89q.jnbt.StringTag; +import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.world.block.BaseBlock; import java.io.ByteArrayOutputStream; -import java.util.*; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; import java.util.stream.IntStream; /** diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java index a6f49ca66..00bc7809f 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java @@ -3,7 +3,13 @@ package com.github.intellectualsites.plotsquared.bukkit.util; import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.LegacyPlotBlock; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.github.intellectualsites.plotsquared.plot.object.StringPlotBlock; import com.github.intellectualsites.plotsquared.plot.object.schematic.PlotItem; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.MathMan; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/Metrics.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/Metrics.java index ff6e1b310..e3870d940 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/Metrics.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/Metrics.java @@ -10,12 +10,24 @@ import org.json.simple.JSONArray; import org.json.simple.JSONObject; import javax.net.ssl.HttpsURLConnection; -import java.io.*; +import java.io.BufferedReader; +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URL; import java.nio.charset.StandardCharsets; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Timer; +import java.util.TimerTask; +import java.util.UUID; import java.util.concurrent.Callable; import java.util.logging.Level; import java.util.zip.GZIPOutputStream; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/NbtFactory.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/NbtFactory.java index acf0f82fa..10407f5ec 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/NbtFactory.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/NbtFactory.java @@ -13,9 +13,28 @@ import org.bukkit.Material; import org.bukkit.Server; import org.bukkit.inventory.ItemStack; -import java.io.*; -import java.lang.reflect.*; -import java.util.*; +import java.io.BufferedInputStream; +import java.io.DataInput; +import java.io.DataInputStream; +import java.io.DataOutput; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.AbstractList; +import java.util.AbstractMap; +import java.util.AbstractSet; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; import java.util.concurrent.ConcurrentMap; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/OfflinePlayerUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/OfflinePlayerUtil.java index a3e40fae1..a4ee94f80 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/OfflinePlayerUtil.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/OfflinePlayerUtil.java @@ -9,7 +9,13 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.util.UUID; -import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils.*; +import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils.callConstructor; +import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils.callMethod; +import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils.getCbClass; +import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils.getNmsClass; +import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils.getUtilClass; +import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils.makeConstructor; +import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils.makeMethod; public class OfflinePlayerUtil { diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SendChunk.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SendChunk.java index 09f8462bb..8b5e89b27 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SendChunk.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SendChunk.java @@ -2,7 +2,6 @@ package com.github.intellectualsites.plotsquared.bukkit.util; import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.plot.PlotSquared; -import com.github.intellectualsites.plotsquared.plot.object.ChunkLoc; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; @@ -12,6 +11,7 @@ import com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils.RefFie import com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils.RefMethod; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; +import com.sk89q.worldedit.math.BlockVector2; import io.papermc.lib.PaperLib; import org.bukkit.Bukkit; import org.bukkit.Chunk; @@ -129,12 +129,12 @@ public class SendChunk { } } - public void sendChunk(String worldName, Collection chunkLocations) { + public void sendChunk(String worldName, Collection chunkLocations) { World myWorld = Bukkit.getWorld(worldName); ArrayList chunks = new ArrayList<>(); - for (ChunkLoc loc : chunkLocations) { - if (myWorld.isChunkLoaded(loc.x, loc.z)) { - PaperLib.getChunkAtAsync(myWorld, loc.x, loc.z).thenAccept(chunks::add); + for (BlockVector2 loc : chunkLocations) { + if (myWorld.isChunkLoaded(loc.getX(), loc.getZ())) { + PaperLib.getChunkAtAsync(myWorld, loc.getX(), loc.getZ()).thenAccept(chunks::add); } } sendChunk(chunks); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Command.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Command.java index faaf3c7af..691daa93e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Command.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Command.java @@ -19,7 +19,15 @@ import com.github.intellectualsites.plotsquared.plot.util.StringMan; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; import java.util.concurrent.CompletableFuture; public abstract class Command { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemorySection.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemorySection.java index 0f87931f4..14233b758 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemorySection.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemorySection.java @@ -1,6 +1,11 @@ package com.github.intellectualsites.plotsquared.configuration; -import java.util.*; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * A type of {@link ConfigurationSection} that is stored in memory. diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/FileConfiguration.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/FileConfiguration.java index a56c65901..e8123cfc9 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/FileConfiguration.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/FileConfiguration.java @@ -4,7 +4,16 @@ import com.github.intellectualsites.plotsquared.configuration.Configuration; import com.github.intellectualsites.plotsquared.configuration.InvalidConfigurationException; import com.github.intellectualsites.plotsquared.configuration.MemoryConfiguration; -import java.io.*; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.io.Reader; +import java.io.Writer; import java.nio.charset.StandardCharsets; import java.util.stream.Collectors; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONObject.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONObject.java index cd67bb158..965e95644 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONObject.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONObject.java @@ -7,8 +7,15 @@ import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import java.util.*; +import java.util.Collection; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Locale; +import java.util.Map; import java.util.Map.Entry; +import java.util.ResourceBundle; +import java.util.Set; import java.util.stream.IntStream; /** @@ -554,7 +561,9 @@ public class JSONObject { return new JSONObject((Map) object); } Package objectPackage = object.getClass().getPackage(); + String objectPackageName = objectPackage != null ? objectPackage.getName() : ""; + if (objectPackageName.startsWith("java.") || objectPackageName.startsWith("javax.") || ( object.getClass().getClassLoader() == null)) { return object.toString(); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONTokener.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONTokener.java index 290b9ea0b..195ceeb5d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONTokener.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONTokener.java @@ -1,6 +1,11 @@ package com.github.intellectualsites.plotsquared.json; -import java.io.*; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.StringReader; /** * A JSONTokener takes a source string and extracts characters and tokens from it. It is used by the JSONObject and diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java index 8fff0921d..fb62a61ce 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java @@ -6,7 +6,17 @@ import com.github.intellectualsites.plotsquared.plot.generator.IndependentPlotGe import com.github.intellectualsites.plotsquared.plot.logger.ILogger; import com.github.intellectualsites.plotsquared.plot.object.BlockRegistry; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; -import com.github.intellectualsites.plotsquared.plot.util.*; +import com.github.intellectualsites.plotsquared.plot.util.ChatManager; +import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; +import com.github.intellectualsites.plotsquared.plot.util.EconHandler; +import com.github.intellectualsites.plotsquared.plot.util.EventUtil; +import com.github.intellectualsites.plotsquared.plot.util.InventoryUtil; +import com.github.intellectualsites.plotsquared.plot.util.LegacyMappings; +import com.github.intellectualsites.plotsquared.plot.util.SchematicHandler; +import com.github.intellectualsites.plotsquared.plot.util.SetupUtils; +import com.github.intellectualsites.plotsquared.plot.util.TaskManager; +import com.github.intellectualsites.plotsquared.plot.util.UUIDHandlerImplementation; +import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; import com.github.intellectualsites.plotsquared.plot.util.block.QueueProvider; import org.jetbrains.annotations.NotNull; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java index 45c284a3f..d6c7b437c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java @@ -20,12 +20,39 @@ import com.github.intellectualsites.plotsquared.plot.generator.HybridUtils; import com.github.intellectualsites.plotsquared.plot.generator.IndependentPlotGenerator; import com.github.intellectualsites.plotsquared.plot.listener.WESubscriber; import com.github.intellectualsites.plotsquared.plot.logger.ILogger; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.github.intellectualsites.plotsquared.plot.object.PlotCluster; +import com.github.intellectualsites.plotsquared.plot.object.PlotFilter; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.object.PlotManager; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.github.intellectualsites.plotsquared.plot.object.StringWrapper; import com.github.intellectualsites.plotsquared.plot.object.worlds.DefaultPlotAreaManager; import com.github.intellectualsites.plotsquared.plot.object.worlds.PlotAreaManager; import com.github.intellectualsites.plotsquared.plot.object.worlds.SinglePlotArea; import com.github.intellectualsites.plotsquared.plot.object.worlds.SinglePlotAreaManager; -import com.github.intellectualsites.plotsquared.plot.util.*; +import com.github.intellectualsites.plotsquared.plot.util.ChatManager; +import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; +import com.github.intellectualsites.plotsquared.plot.util.CommentManager; +import com.github.intellectualsites.plotsquared.plot.util.EconHandler; +import com.github.intellectualsites.plotsquared.plot.util.EventUtil; +import com.github.intellectualsites.plotsquared.plot.util.InventoryUtil; +import com.github.intellectualsites.plotsquared.plot.util.LegacyConverter; +import com.github.intellectualsites.plotsquared.plot.util.MainUtil; +import com.github.intellectualsites.plotsquared.plot.util.MathMan; +import com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils; +import com.github.intellectualsites.plotsquared.plot.util.SchematicHandler; +import com.github.intellectualsites.plotsquared.plot.util.SetupUtils; +import com.github.intellectualsites.plotsquared.plot.util.StringMan; +import com.github.intellectualsites.plotsquared.plot.util.TaskManager; +import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; +import com.github.intellectualsites.plotsquared.plot.util.UpdateUtility; +import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpiryTask; @@ -35,15 +62,37 @@ import lombok.NonNull; import lombok.Setter; import org.jetbrains.annotations.Nullable; -import java.io.*; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; import java.net.URLConnection; import java.nio.file.Files; import java.sql.SQLException; -import java.util.*; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; +import java.util.Properties; +import java.util.Set; +import java.util.UUID; import java.util.function.Consumer; import java.util.regex.Pattern; import java.util.stream.Collectors; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java index f4c73a972..0f39ebe94 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java @@ -7,8 +7,24 @@ import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Configuration; import com.github.intellectualsites.plotsquared.plot.generator.AugmentedUtils; import com.github.intellectualsites.plotsquared.plot.generator.HybridPlotWorld; -import com.github.intellectualsites.plotsquared.plot.object.*; -import com.github.intellectualsites.plotsquared.plot.util.*; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.object.PlotMessage; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal3; +import com.github.intellectualsites.plotsquared.plot.object.SetupObject; +import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; +import com.github.intellectualsites.plotsquared.plot.util.CmdConfirm; +import com.github.intellectualsites.plotsquared.plot.util.MainUtil; +import com.github.intellectualsites.plotsquared.plot.util.MathMan; +import com.github.intellectualsites.plotsquared.plot.util.Permissions; +import com.github.intellectualsites.plotsquared.plot.util.SetupUtils; +import com.github.intellectualsites.plotsquared.plot.util.StringMan; +import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; +import com.sk89q.worldedit.math.BlockVector2; import java.io.IOException; import java.util.ArrayList; @@ -120,10 +136,10 @@ import java.util.Set; player.teleport(WorldUtil.IMP.getSpawn(world)); if (area.TERRAIN != 3) { ChunkManager.largeRegionTask(world, region, - new RunnableVal() { - @Override public void run(ChunkLoc value) { + new RunnableVal() { + @Override public void run(BlockVector2 value) { AugmentedUtils - .generate(world, value.x, value.z, + .generate(world, value.getX(), value.getZ(), null); } }, null); @@ -415,9 +431,9 @@ import java.util.Set; return false; } ChunkManager - .largeRegionTask(area.worldname, area.getRegion(), new RunnableVal() { - @Override public void run(ChunkLoc value) { - AugmentedUtils.generate(area.worldname, value.x, value.z, null); + .largeRegionTask(area.worldname, area.getRegion(), new RunnableVal() { + @Override public void run(BlockVector2 value) { + AugmentedUtils.generate(area.worldname, value.getX(), value.getZ(), null); } }, () -> player.sendMessage("Regen complete")); return true; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java index 93eef7813..bf0a221b8 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java @@ -5,14 +5,20 @@ import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.Direction; +import com.github.intellectualsites.plotsquared.plot.object.Expression; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.util.ByteArrayUtilities; import com.github.intellectualsites.plotsquared.plot.util.EconHandler; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.Permissions; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; - import org.jetbrains.annotations.Nullable; + import java.util.Set; @CommandDeclaration(command = "auto", permission = "plots.auto", diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Claim.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Claim.java index 94a82fdd8..aba59ad05 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Claim.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Claim.java @@ -4,7 +4,13 @@ import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.Direction; +import com.github.intellectualsites.plotsquared.plot.object.Expression; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.util.ByteArrayUtilities; import com.github.intellectualsites.plotsquared.plot.util.EconHandler; import com.github.intellectualsites.plotsquared.plot.util.Permissions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Cluster.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Cluster.java index 1bc8f779e..088273c9c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Cluster.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Cluster.java @@ -5,7 +5,13 @@ import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.BlockLoc; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotCluster; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.Permissions; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugClaimTest.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugClaimTest.java index de7d754a3..411a3290b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugClaimTest.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugClaimTest.java @@ -4,12 +4,19 @@ import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.object.PlotManager; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.StringWrapper; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; import com.google.common.collect.BiMap; +import com.sk89q.worldedit.math.BlockVector2; import java.util.ArrayList; import java.util.Map; @@ -55,7 +62,7 @@ public class DebugClaimTest extends SubCommand { continue; } Location location = manager.getSignLoc(plot); - ChunkLoc chunk = new ChunkLoc(location.getX() >> 4, location.getZ() >> 4); + BlockVector2 chunk = BlockVector2.at(location.getX() >> 4, location.getZ() >> 4); ChunkManager.manager.loadChunk(area.worldname, chunk, false).thenRun(() -> { String[] lines = WorldUtil.IMP.getSign(location); if (lines != null) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugExec.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugExec.java index 841c6fc8c..6d5894616 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugExec.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugExec.java @@ -10,8 +10,29 @@ import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.flag.FlagManager; import com.github.intellectualsites.plotsquared.plot.generator.HybridUtils; import com.github.intellectualsites.plotsquared.plot.listener.WEManager; -import com.github.intellectualsites.plotsquared.plot.object.*; -import com.github.intellectualsites.plotsquared.plot.util.*; +import com.github.intellectualsites.plotsquared.plot.object.ConsolePlayer; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.OfflinePlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.object.PlotMessage; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal2; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal3; +import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; +import com.github.intellectualsites.plotsquared.plot.util.EconHandler; +import com.github.intellectualsites.plotsquared.plot.util.EventUtil; +import com.github.intellectualsites.plotsquared.plot.util.MainUtil; +import com.github.intellectualsites.plotsquared.plot.util.MathMan; +import com.github.intellectualsites.plotsquared.plot.util.SchematicHandler; +import com.github.intellectualsites.plotsquared.plot.util.SetupUtils; +import com.github.intellectualsites.plotsquared.plot.util.StringMan; +import com.github.intellectualsites.plotsquared.plot.util.TaskManager; +import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; +import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; import com.github.intellectualsites.plotsquared.plot.util.expiry.PlotAnalysis; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCmd.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCmd.java index af0389dec..746ddfe98 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCmd.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCmd.java @@ -22,7 +22,16 @@ import com.github.intellectualsites.plotsquared.plot.util.PlotWeather; import com.github.intellectualsites.plotsquared.plot.util.StringComparison; import com.github.intellectualsites.plotsquared.plot.util.StringMan; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Optional; @CommandDeclaration(command = "setflag", aliases = {"f", "flag", "setflag"}, usage = "/plot flag ", description = "Set plot flags", category = CommandCategory.SETTINGS, requiredType = RequiredType.NONE, permission = "plots.flag") diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Like.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Like.java index f839a9b1a..378da26c2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Like.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Like.java @@ -14,7 +14,11 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.Permissions; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; @CommandDeclaration(command = "like", permission = "plots.like", description = "Like the plot", usage = "/plot like [next|purge]", category = CommandCategory.INFO, diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/ListCmd.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/ListCmd.java index 4917e2499..2b70e48e5 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/ListCmd.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/ListCmd.java @@ -11,7 +11,13 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotMessage; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.Rating; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal3; -import com.github.intellectualsites.plotsquared.plot.util.*; +import com.github.intellectualsites.plotsquared.plot.util.EconHandler; +import com.github.intellectualsites.plotsquared.plot.util.MainUtil; +import com.github.intellectualsites.plotsquared.plot.util.MathMan; +import com.github.intellectualsites.plotsquared.plot.util.Permissions; +import com.github.intellectualsites.plotsquared.plot.util.StringComparison; +import com.github.intellectualsites.plotsquared.plot.util.StringMan; +import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; import java.util.ArrayList; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/MainCommand.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/MainCommand.java index 31095cd75..dd060c88e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/MainCommand.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/MainCommand.java @@ -5,7 +5,14 @@ import com.github.intellectualsites.plotsquared.commands.CommandCaller; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.ConsolePlayer; +import com.github.intellectualsites.plotsquared.plot.object.Expression; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal2; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal3; import com.github.intellectualsites.plotsquared.plot.util.CmdConfirm; import com.github.intellectualsites.plotsquared.plot.util.EconHandler; import com.github.intellectualsites.plotsquared.plot.util.Permissions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Rate.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Rate.java index 9c93925b6..f81f02719 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Rate.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Rate.java @@ -7,8 +7,16 @@ import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.flag.Flags; -import com.github.intellectualsites.plotsquared.plot.object.*; -import com.github.intellectualsites.plotsquared.plot.util.*; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotInventory; +import com.github.intellectualsites.plotsquared.plot.object.PlotItemStack; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.Rating; +import com.github.intellectualsites.plotsquared.plot.util.EventUtil; +import com.github.intellectualsites.plotsquared.plot.util.MainUtil; +import com.github.intellectualsites.plotsquared.plot.util.MathMan; +import com.github.intellectualsites.plotsquared.plot.util.Permissions; +import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import java.util.ArrayList; import java.util.HashMap; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RegenAllRoads.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RegenAllRoads.java index 9fcdc811d..e47cb610f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RegenAllRoads.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RegenAllRoads.java @@ -43,7 +43,7 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil; MainUtil.sendMessage(player, Captions.NOT_VALID_PLOT_WORLD); return false; } - //Set chunks = ChunkManager.manager.getChunkChunks(name); + //Set chunks = ChunkManager.manager.getChunkChunks(name); MainUtil .sendMessage(player, "&cIf no schematic is set, the following will not do anything"); MainUtil.sendMessage(player, diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Relight.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Relight.java index 5af706df3..cc5c8c21a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Relight.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Relight.java @@ -3,7 +3,11 @@ package com.github.intellectualsites.plotsquared.plot.commands; import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal2; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal3; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Save.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Save.java index 481acba53..d000f55e2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Save.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Save.java @@ -3,7 +3,11 @@ package com.github.intellectualsites.plotsquared.plot.commands; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.Permissions; import com.github.intellectualsites.plotsquared.plot.util.SchematicHandler; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java index 7b21352e2..82190f1b2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java @@ -15,11 +15,23 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.SetupUtils; import com.github.intellectualsites.plotsquared.plot.util.StringMan; import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; -import lombok.*; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NonNull; +import lombok.RequiredArgsConstructor; +import lombok.ToString; import org.jetbrains.annotations.Nullable; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; +import java.util.UUID; @CommandDeclaration(command = "setup", permission = "plots.admin.command.setup", description = "Setup wizard for plot worlds", usage = "/plot setup", aliases = {"create"}, diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Template.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Template.java index fe41e61ab..85a0fe633 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Template.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Template.java @@ -8,14 +8,21 @@ import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.ConfigurationNode; import com.github.intellectualsites.plotsquared.plot.config.Settings; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.FileBytes; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotManager; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.SetupObject; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.SetupUtils; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; -import java.io.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; import java.util.Set; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trim.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trim.java index 3b3504c24..000aa9b56 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trim.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trim.java @@ -3,7 +3,12 @@ package com.github.intellectualsites.plotsquared.plot.commands; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal2; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; @@ -11,6 +16,7 @@ import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; +import com.sk89q.worldedit.math.BlockVector2; import java.io.File; import java.io.IOException; @@ -31,7 +37,7 @@ import java.util.Set; public static ArrayList expired = null; private static volatile boolean TASK = false; - public static boolean getBulkRegions(final ArrayList empty, final String world, + public static boolean getBulkRegions(final ArrayList empty, final String world, final Runnable whenDone) { if (Trim.TASK) { return false; @@ -71,7 +77,7 @@ import java.util.Set; String[] split = name.split("\\."); int x = Integer.parseInt(split[1]); int z = Integer.parseInt(split[2]); - ChunkLoc loc = new ChunkLoc(x, z); + BlockVector2 loc = BlockVector2.at(x, z); empty.add(loc); } catch (NumberFormatException ignored) { PlotSquared.debug("INVALID MCA: " + name); @@ -90,7 +96,7 @@ import java.util.Set; * @return */ public static boolean getTrimRegions(String world, - final RunnableVal2, Set> result) { + final RunnableVal2, Set> result) { if (result == null) { return false; } @@ -114,7 +120,7 @@ import java.util.Set; int ccz2 = pos2.getZ() >> 9; for (int x = ccx1; x <= ccx2; x++) { for (int z = ccz1; z <= ccz2; z++) { - ChunkLoc loc = new ChunkLoc(x, z); + BlockVector2 loc = BlockVector2.at(x, z); if (result.value1.remove(loc)) { result.value2.add(loc); } @@ -141,8 +147,8 @@ import java.util.Set; } Trim.TASK = true; final boolean regen = args.length == 2 && Boolean.parseBoolean(args[1]); - getTrimRegions(world, new RunnableVal2, Set>() { - @Override public void run(Set viable, final Set nonViable) { + getTrimRegions(world, new RunnableVal2, Set>() { + @Override public void run(Set viable, final Set nonViable) { Runnable regenTask; if (regen) { PlotSquared.log("Starting regen task:"); @@ -155,16 +161,16 @@ import java.util.Set; player.sendMessage("Trim done!"); return; } - Iterator iterator = nonViable.iterator(); - ChunkLoc mcr = iterator.next(); + Iterator iterator = nonViable.iterator(); + BlockVector2 mcr = iterator.next(); iterator.remove(); - int cbx = mcr.x << 5; - int cbz = mcr.z << 5; + int cbx = mcr.getX() << 5; + int cbz = mcr.getZ() << 5; // get all 1024 chunks - HashSet chunks = new HashSet<>(); + HashSet chunks = new HashSet<>(); for (int x = cbx; x < cbx + 32; x++) { for (int z = cbz; z < cbz + 32; z++) { - ChunkLoc loc = new ChunkLoc(x, z); + BlockVector2 loc = BlockVector2.at(x, z); chunks.add(loc); } } @@ -182,16 +188,16 @@ import java.util.Set; } for (int x = plotReg.minX >> 4; x <= plotReg.maxX >> 4; x++) { for (int z = plotReg.minZ >> 4; z <= plotReg.maxZ >> 4; z++) { - ChunkLoc loc = new ChunkLoc(x, z); + BlockVector2 loc = BlockVector2.at(x, z); chunks.remove(loc); } } } final LocalBlockQueue queue = GlobalBlockQueue.IMP.getNewQueue(world, false); - TaskManager.objectTask(chunks, new RunnableVal() { - @Override public void run(ChunkLoc value) { - queue.regenChunk(value.x, value.z); + TaskManager.objectTask(chunks, new RunnableVal() { + @Override public void run(BlockVector2 value) { + queue.regenChunk(value.getX(), value.getZ()); } }, this); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java index 5c38ea63f..e2b7fa382 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java @@ -6,13 +6,21 @@ import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.flag.Flags; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal2; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal3; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.github.intellectualsites.plotsquared.plot.util.Permissions; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.UUID; import java.util.concurrent.CompletableFuture; @CommandDeclaration(command = "visit", permission = "plots.visit", diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Config.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Config.java index ace39f846..7234743cf 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Config.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Config.java @@ -14,7 +14,11 @@ import java.lang.annotation.Target; import java.lang.invoke.MethodHandles; import java.lang.reflect.Field; import java.lang.reflect.Modifier; -import java.util.*; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; public class Config { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/MySQL.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/MySQL.java index d5943d1ac..f8b2cedb0 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/MySQL.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/MySQL.java @@ -3,7 +3,11 @@ package com.github.intellectualsites.plotsquared.plot.database; import com.github.intellectualsites.plotsquared.plot.config.Storage; import com.github.intellectualsites.plotsquared.plot.util.StringMan; -import java.sql.*; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; /** * Connects to and uses a MySQL database diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java index 2f041cc57..a62924e9e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java @@ -6,7 +6,13 @@ import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.config.Storage; import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.flag.FlagManager; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.BlockLoc; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotCluster; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.object.PlotSettings; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.object.comment.PlotComment; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.StringMan; @@ -14,11 +20,26 @@ import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.google.common.base.Charsets; import org.jetbrains.annotations.NotNull; -import java.sql.*; +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.sql.Timestamp; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; +import java.util.Queue; +import java.util.Set; +import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicInteger; @@ -857,10 +878,10 @@ import java.util.concurrent.atomic.AtomicInteger; statement.setInt(i * 10 + 9, hash); BlockLoc loc = pair.settings.getPosition(); String position; - if (loc.y == 0) { + if (loc.getY() == 0) { position = "DEFAULT"; } else { - position = loc.x + "," + loc.y + ',' + loc.z; + position = loc.getX() + "," + loc.getY() + ',' + loc.getZ(); } statement.setString(i * 10 + 10, position); } @@ -898,10 +919,10 @@ import java.util.concurrent.atomic.AtomicInteger; stmt.setInt(i * 10 + 9, n); BlockLoc loc = pair.settings.getPosition(); String position; - if (loc.y == 0) { + if (loc.getY() == 0) { position = "DEFAULT"; } else { - position = loc.x + "," + loc.y + ',' + loc.z; + position = loc.getX() + "," + loc.getY() + ',' + loc.getZ(); } stmt.setString(i * 10 + 10, position); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLite.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLite.java index 3675ad0cd..10ceb8784 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLite.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLite.java @@ -4,7 +4,11 @@ import com.github.intellectualsites.plotsquared.plot.PlotSquared; import java.io.File; import java.io.IOException; -import java.sql.*; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; /** * Connects to and uses a SQLite database. diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/FlagManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/FlagManager.java index 6dc4aa2ff..51391f788 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/FlagManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/FlagManager.java @@ -10,7 +10,12 @@ import com.github.intellectualsites.plotsquared.plot.util.EventUtil; import com.github.intellectualsites.plotsquared.plot.util.Permissions; import com.google.common.collect.ImmutableSet; -import java.util.*; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; /** diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/PlotBlockListFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/PlotBlockListFlag.java index 93bd8c56f..d042ecb4d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/PlotBlockListFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/PlotBlockListFlag.java @@ -9,7 +9,6 @@ import com.github.intellectualsites.plotsquared.plot.util.StringMan; import java.util.Arrays; import java.util.HashSet; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; public class PlotBlockListFlag extends ListFlag> { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/StringFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/StringFlag.java index 6438ec938..31447847c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/StringFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/StringFlag.java @@ -1,6 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.flag; - import com.github.intellectualsites.plotsquared.plot.config.Captions; public class StringFlag extends Flag { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java index f7ce683ba..a15b9ab1b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java @@ -1,7 +1,13 @@ package com.github.intellectualsites.plotsquared.plot.generator; import com.github.intellectualsites.plotsquared.plot.config.Settings; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; +import com.github.intellectualsites.plotsquared.plot.object.Direction; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotWorld.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotWorld.java index 143879680..ec80b3b84 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotWorld.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotWorld.java @@ -10,7 +10,6 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import org.jetbrains.annotations.NotNull; -import javax.annotation.Nonnull; import java.lang.reflect.Field; import java.util.Locale; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridGen.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridGen.java index 81d76b929..6cb57ba8f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridGen.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridGen.java @@ -2,7 +2,11 @@ package com.github.intellectualsites.plotsquared.plot.generator; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Settings; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; import com.sk89q.worldedit.world.block.BaseBlock; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java index cd711dd6e..528ad57f9 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java @@ -3,7 +3,13 @@ package com.github.intellectualsites.plotsquared.plot.generator; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.commands.Template; import com.github.intellectualsites.plotsquared.plot.config.Settings; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; +import com.github.intellectualsites.plotsquared.plot.object.FileBytes; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.MathMan; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java index f7dc4d619..9e09ea977 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java @@ -5,7 +5,14 @@ import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.flag.FlagManager; import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.listener.WEExtent; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.object.PlotManager; +import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.github.intellectualsites.plotsquared.plot.util.SchematicHandler; @@ -15,18 +22,26 @@ import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.expiry.PlotAnalysis; import com.sk89q.jnbt.CompoundTag; +import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.world.block.BaseBlock; import java.io.File; -import java.util.*; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; public abstract class HybridUtils { public static HybridUtils manager; - public static Set regions; - public static Set chunks = new HashSet<>(); + public static Set regions; + public static Set chunks = new HashSet<>(); public static PlotArea area; public static boolean UPDATE = false; @@ -113,13 +128,13 @@ public abstract class HybridUtils { return count; } - public final ArrayList getChunks(ChunkLoc region) { - ArrayList chunks = new ArrayList<>(); - int sx = region.x << 5; - int sz = region.z << 5; + public final ArrayList getChunks(BlockVector2 region) { + ArrayList chunks = new ArrayList<>(); + int sx = region.getX() << 5; + int sz = region.getZ() << 5; for (int x = sx; x < sx + 32; x++) { for (int z = sz; z < sz + 32; z++) { - chunks.add(new ChunkLoc(x, z)); + chunks.add(BlockVector2.at(x, z)); } } return chunks; @@ -130,7 +145,7 @@ public abstract class HybridUtils { return false; } HybridUtils.UPDATE = true; - Set regions = ChunkManager.manager.getChunkChunks(area.worldname); + Set regions = ChunkManager.manager.getChunkChunks(area.worldname); return scheduleRoadUpdate(area, regions, extend); } @@ -139,12 +154,12 @@ public abstract class HybridUtils { return false; } HybridUtils.UPDATE = true; - Set regions = new HashSet<>(); - regions.add(ChunkManager.getChunkChunk(plot.getCenter())); + Set regions = new HashSet<>(); + regions.add(ChunkManager.getRegion(plot.getCenter())); return scheduleRoadUpdate(plot.getArea(), regions, extend); } - public boolean scheduleRoadUpdate(final PlotArea area, Set regions, + public boolean scheduleRoadUpdate(final PlotArea area, Set regions, final int extend) { HybridUtils.regions = regions; HybridUtils.area = area; @@ -153,9 +168,9 @@ public abstract class HybridUtils { TaskManager.runTask(new Runnable() { @Override public void run() { if (!UPDATE) { - Iterator iter = chunks.iterator(); + Iterator iter = chunks.iterator(); while (iter.hasNext()) { - ChunkLoc chunk = iter.next(); + BlockVector2 chunk = iter.next(); iter.remove(); boolean regenedRoad = regenerateRoad(area, chunk, extend); if (!regenedRoad) { @@ -183,10 +198,10 @@ public abstract class HybridUtils { try { if (chunks.size() < 1024) { if (!HybridUtils.regions.isEmpty()) { - Iterator iterator = HybridUtils.regions.iterator(); - ChunkLoc loc = iterator.next(); + Iterator iterator = HybridUtils.regions.iterator(); + BlockVector2 loc = iterator.next(); iterator.remove(); - PlotSquared.debug("Updating .mcr: " + loc.x + ", " + loc.z + PlotSquared.debug("Updating .mcr: " + loc.getX() + ", " + loc.getZ() + " (approx 1024 chunks)"); PlotSquared .debug(" - Remaining: " + HybridUtils.regions.size()); @@ -198,10 +213,10 @@ public abstract class HybridUtils { TaskManager.IMP.sync(new RunnableVal() { @Override public void run(Object value) { long start = System.currentTimeMillis(); - Iterator iterator = chunks.iterator(); + Iterator iterator = chunks.iterator(); while (System.currentTimeMillis() - start < 20 && !chunks .isEmpty()) { - final ChunkLoc chunk = iterator.next(); + final BlockVector2 chunk = iterator.next(); iterator.remove(); boolean regenedRoads = regenerateRoad(area, chunk, extend); @@ -214,18 +229,18 @@ public abstract class HybridUtils { } } catch (Exception e) { e.printStackTrace(); - Iterator iterator = HybridUtils.regions.iterator(); - ChunkLoc loc = iterator.next(); + Iterator iterator = HybridUtils.regions.iterator(); + BlockVector2 loc = iterator.next(); iterator.remove(); PlotSquared.debug( - "[ERROR] Could not update '" + area.worldname + "/region/r." + loc.x - + "." + loc.z + ".mca' (Corrupt chunk?)"); - int sx = loc.x << 5; - int sz = loc.z << 5; + "[ERROR] Could not update '" + area.worldname + "/region/r." + loc.getX() + + "." + loc.getZ() + ".mca' (Corrupt chunk?)"); + int sx = loc.getX() << 5; + int sz = loc.getZ() << 5; for (int x = sx; x < sx + 32; x++) { for (int z = sz; z < sz + 32; z++) { ChunkManager.manager - .unloadChunk(area.worldname, new ChunkLoc(x, z), true); + .unloadChunk(area.worldname, BlockVector2.at(x, z), true); } } PlotSquared.debug(" - Potentially skipping 1024 chunks"); @@ -303,9 +318,9 @@ public abstract class HybridUtils { return ey; } - public boolean regenerateRoad(final PlotArea area, final ChunkLoc chunk, int extend) { - int x = chunk.x << 4; - int z = chunk.z << 4; + public boolean regenerateRoad(final PlotArea area, final BlockVector2 chunk, int extend) { + int x = chunk.getX() << 4; + int z = chunk.getZ() << 4; int ex = x + 15; int ez = z + 15; HybridPlotWorld plotWorld = (HybridPlotWorld) area; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/IndependentPlotGenerator.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/IndependentPlotGenerator.java index 459aee272..def532368 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/IndependentPlotGenerator.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/IndependentPlotGenerator.java @@ -1,7 +1,10 @@ package com.github.intellectualsites.plotsquared.plot.generator; import com.github.intellectualsites.plotsquared.plot.PlotSquared; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.object.SetupObject; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; /** diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotManager.java index be19930fd..8ee343b3f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotManager.java @@ -1,7 +1,12 @@ package com.github.intellectualsites.plotsquared.plot.generator; import com.github.intellectualsites.plotsquared.plot.PlotSquared; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.Direction; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java index ce1007e15..7aee40de0 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java @@ -11,7 +11,16 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; -import com.github.intellectualsites.plotsquared.plot.util.*; +import com.github.intellectualsites.plotsquared.plot.util.ByteArrayUtilities; +import com.github.intellectualsites.plotsquared.plot.util.CommentManager; +import com.github.intellectualsites.plotsquared.plot.util.EventUtil; +import com.github.intellectualsites.plotsquared.plot.util.MainUtil; +import com.github.intellectualsites.plotsquared.plot.util.Permissions; +import com.github.intellectualsites.plotsquared.plot.util.PlotGameMode; +import com.github.intellectualsites.plotsquared.plot.util.PlotWeather; +import com.github.intellectualsites.plotsquared.plot.util.StringMan; +import com.github.intellectualsites.plotsquared.plot.util.TaskManager; +import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; import java.util.HashMap; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java index 8dde0ee20..bd15eddf9 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java @@ -10,8 +10,14 @@ import lombok.NonNull; import lombok.RequiredArgsConstructor; import org.jetbrains.annotations.NotNull; -import java.util.*; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; import java.util.Map.Entry; +import java.util.Random; /** * A block bucket is a container of block types, where each block diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockLoc.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockLoc.java index d170054a8..a4f02a9ef 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockLoc.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockLoc.java @@ -2,12 +2,12 @@ package com.github.intellectualsites.plotsquared.plot.object; public class BlockLoc { - public final int x; - public final int y; - public final int z; + private final int x; + private final int y; + private final int z; - public final float yaw; - public final float pitch; + private final float yaw; + private final float pitch; public BlockLoc(int x, int y, int z, float yaw, float pitch) { this.x = x; @@ -27,10 +27,6 @@ public class BlockLoc { float yaw; float pitch; - if (parts.length == 3) { - yaw = 0f; - pitch = 0f; - } if (parts.length == 5) { yaw = Float.parseFloat(parts[3]); pitch = Float.parseFloat(parts[4]); @@ -47,9 +43,9 @@ public class BlockLoc { @Override public int hashCode() { int prime = 31; int result = 1; - result = prime * result + this.x; - result = prime * result + this.y; - result = prime * result + this.z; + result = prime * result + this.getX(); + result = prime * result + this.getY(); + result = prime * result + this.getZ(); return result; } @@ -58,20 +54,42 @@ public class BlockLoc { return true; } if (obj == null) { - return this.x == 0 && this.y == 0 && this.z == 0; + return this.getX() == 0 && this.getY() == 0 && this.getZ() == 0; } if (getClass() != obj.getClass()) { return false; } BlockLoc other = (BlockLoc) obj; - return this.x == other.x && this.y == other.y && this.z == other.z; + return this.getX() == other.getX() && this.getY() == other.getY() && this.getZ() == other + .getZ(); } @Override public String toString() { - if (this.x == 0 && this.y == 0 && this.z == 0) { + if (this.getX() == 0 && this.getY() == 0 && this.getZ() == 0) { return ""; } - return this.x + "," + this.y + ',' + this.z + ',' + this.yaw + ',' + this.pitch; + return this.getX() + "," + this.getY() + ',' + this.getZ() + ',' + this.getYaw() + + ',' + this.getPitch(); } + + public int getX() { + return x; + } + + public int getY() { + return y; + } + + public int getZ() { + return z; + } + + public float getYaw() { + return yaw; + } + + public float getPitch() { + return pitch; + } } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ChunkLoc.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ChunkLoc.java deleted file mode 100644 index 29bd3857f..000000000 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ChunkLoc.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.github.intellectualsites.plotsquared.plot.object; - -public class ChunkLoc { - - public int x; - public int z; - - public ChunkLoc(int x, int z) { - this.x = x; - this.z = z; - } - - public static long getChunkLong(int x, int z) { - return (long) x & 0xffffffffL | ((long) z & 0xffffffffL) << 32; - } - - public long toLong() { - return getChunkLong(this.x,this.z); - } - - public static int getX(long chunkLong) { - return (int)(chunkLong & 0xffffffffL); - } - - public static int getZ(long chunkLong) { - return (int)(chunkLong >>> 32 & 0xffffffffL); - } - - @Override public int hashCode() { - return (x << 16) | (z & 0xFFFF); - } - - @Override public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - ChunkLoc other = (ChunkLoc) obj; - return (this.x == other.x) && (this.z == other.z); - } - - @Override public String toString() { - return this.x + "," + this.z; - } -} diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LegacyPlotBlock.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LegacyPlotBlock.java index 38407a52f..0596cd010 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LegacyPlotBlock.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LegacyPlotBlock.java @@ -1,7 +1,6 @@ package com.github.intellectualsites.plotsquared.plot.object; import com.sk89q.worldedit.world.block.BaseBlock; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.registry.LegacyMapper; import lombok.Getter; import lombok.Setter; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java index 2e28594df..5f2b6bafe 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java @@ -2,6 +2,7 @@ package com.github.intellectualsites.plotsquared.plot.object; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.util.MathMan; +import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; import lombok.Getter; import lombok.Setter; @@ -127,8 +128,8 @@ public class Location implements Cloneable, Comparable { } } - public ChunkLoc getChunkLoc() { - return new ChunkLoc(this.x >> 4, this.z >> 4); + public BlockVector2 getBlockVector2() { + return BlockVector2.at(this.x >> 4, this.z >> 4); } public Location add(int x, int y, int z) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java index cafcae466..6708289f3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java @@ -12,7 +12,16 @@ import com.github.intellectualsites.plotsquared.plot.generator.SquarePlotWorld; import com.github.intellectualsites.plotsquared.plot.listener.PlotListener; import com.github.intellectualsites.plotsquared.plot.object.comment.PlotComment; import com.github.intellectualsites.plotsquared.plot.object.schematic.Schematic; -import com.github.intellectualsites.plotsquared.plot.util.*; +import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; +import com.github.intellectualsites.plotsquared.plot.util.EventUtil; +import com.github.intellectualsites.plotsquared.plot.util.MainUtil; +import com.github.intellectualsites.plotsquared.plot.util.MathMan; +import com.github.intellectualsites.plotsquared.plot.util.Permissions; +import com.github.intellectualsites.plotsquared.plot.util.SchematicHandler; +import com.github.intellectualsites.plotsquared.plot.util.StringMan; +import com.github.intellectualsites.plotsquared.plot.util.TaskManager; +import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; +import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; @@ -21,6 +30,7 @@ import com.google.common.collect.BiMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; import com.sk89q.jnbt.CompoundTag; +import com.sk89q.worldedit.math.BlockVector2; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -30,8 +40,18 @@ import java.awt.geom.Rectangle2D; import java.io.File; import java.net.URL; import java.nio.charset.StandardCharsets; -import java.util.*; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; +import java.util.Optional; +import java.util.Set; +import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; @@ -920,7 +940,7 @@ public class Plot { region.maxZ + extendBiome); ChunkManager.chunkTask(pos1, pos2, new RunnableVal() { @Override public void run(int[] value) { - ChunkLoc loc = new ChunkLoc(value[0], value[1]); + BlockVector2 loc = BlockVector2.at(value[0], value[1]); ChunkManager.manager.loadChunk(getWorldName(), loc, false); MainUtil.setBiome(getWorldName(), value[2], value[3], value[4], value[5], biome); @@ -1251,13 +1271,14 @@ public class Plot { */ public Location getHome() { BlockLoc home = this.getPosition(); - if (home == null || home.x == 0 && home.z == 0) { + if (home == null || home.getX() == 0 && home.getZ() == 0) { return this.getDefaultHome(true); } else { Location bottom = this.getBottomAbs(); Location location = - new Location(bottom.getWorld(), bottom.getX() + home.x, bottom.getY() + home.y, - bottom.getZ() + home.z, home.yaw, home.pitch); + new Location(bottom.getWorld(), bottom.getX() + home.getX(), bottom.getY() + home + .getY(), + bottom.getZ() + home.getZ(), home.getYaw(), home.getPitch()); if (!isLoaded()) { return location; } @@ -1413,11 +1434,11 @@ public class Plot { */ public void refreshChunks() { LocalBlockQueue queue = GlobalBlockQueue.IMP.getNewQueue(getWorldName(), false); - HashSet chunks = new HashSet<>(); + HashSet chunks = new HashSet<>(); for (RegionWrapper region : Plot.this.getRegions()) { for (int x = region.minX >> 4; x <= region.maxX >> 4; x++) { for (int z = region.minZ >> 4; z <= region.maxZ >> 4; z++) { - if (chunks.add(new ChunkLoc(x, z))) { + if (chunks.add(BlockVector2.at(x, z))) { queue.refreshChunk(x, z); } } @@ -2142,7 +2163,7 @@ public class Plot { String[] lines = TaskManager.IMP.sync(new RunnableVal() { @Override public void run(String[] value) { ChunkManager.manager - .loadChunk(location.getWorld(), location.getChunkLoc(), false); + .loadChunk(location.getWorld(), location.getBlockVector2(), false); this.value = WorldUtil.IMP.getSign(location); } }); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java index ff6668ea4..b3217297d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java @@ -24,8 +24,16 @@ import com.google.common.collect.ImmutableSet; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; +import java.util.Set; +import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Consumer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java index feaf64ddb..d5d7c95d3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java @@ -126,7 +126,7 @@ public class PlotCluster { public Location getHome() { BlockLoc home = this.settings.getPosition(); Location toReturn; - if (home.y == 0) { + if (home.getY() == 0) { // default pos Plot center = getCenterPlot(); toReturn = center.getHome(); @@ -136,7 +136,7 @@ public class PlotCluster { toReturn.setY(location.getY()); } } else { - toReturn = getClusterBottom().add(home.x, home.y, home.z); + toReturn = getClusterBottom().add(home.getX(), home.getY(), home.getZ()); } int max = MainUtil.getHeighestBlock(this.area.worldname, toReturn.getX(), toReturn.getZ()); if (max > toReturn.getY()) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java index f8e21255b..e7ee3d40f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java @@ -10,7 +10,13 @@ import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.object.worlds.PlotAreaManager; import com.github.intellectualsites.plotsquared.plot.object.worlds.SinglePlotArea; import com.github.intellectualsites.plotsquared.plot.object.worlds.SinglePlotAreaManager; -import com.github.intellectualsites.plotsquared.plot.util.*; +import com.github.intellectualsites.plotsquared.plot.util.EconHandler; +import com.github.intellectualsites.plotsquared.plot.util.EventUtil; +import com.github.intellectualsites.plotsquared.plot.util.Permissions; +import com.github.intellectualsites.plotsquared.plot.util.PlotGameMode; +import com.github.intellectualsites.plotsquared.plot.util.PlotWeather; +import com.github.intellectualsites.plotsquared.plot.util.TaskManager; +import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; import com.google.common.base.Preconditions; import lombok.NonNull; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotSettings.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotSettings.java index ce51fea33..8d7904690 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotSettings.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotSettings.java @@ -104,7 +104,7 @@ public class PlotSettings { } public void setPosition(BlockLoc position) { - if (position != null && position.x == 0 && position.y == 0 && position.z == 0) { + if (position != null && position.getX() == 0 && position.getY() == 0 && position.getZ() == 0) { position = null; } this.position = position; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/DefaultPlotAreaManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/DefaultPlotAreaManager.java index 31a86b874..8d5152a1b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/DefaultPlotAreaManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/DefaultPlotAreaManager.java @@ -6,7 +6,13 @@ import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; import com.github.intellectualsites.plotsquared.plot.util.StringMan; import com.github.intellectualsites.plotsquared.plot.util.area.QuadMap; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.Set; public class DefaultPlotAreaManager implements PlotAreaManager { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java index 8c80e46a7..7f63e2ed0 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java @@ -2,7 +2,13 @@ package com.github.intellectualsites.plotsquared.plot.object.worlds; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.flag.Flag; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.BlockLoc; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; import com.google.common.collect.Sets; import org.jetbrains.annotations.NotNull; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java index 8f8ac96b1..1f5e70856 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java @@ -5,7 +5,14 @@ import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Configuration; import com.github.intellectualsites.plotsquared.plot.config.ConfigurationNode; import com.github.intellectualsites.plotsquared.plot.generator.GridPlotWorld; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.object.PlotLoc; +import com.github.intellectualsites.plotsquared.plot.object.PlotManager; +import com.github.intellectualsites.plotsquared.plot.object.PlotSettings; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; +import com.github.intellectualsites.plotsquared.plot.object.SetupObject; import com.github.intellectualsites.plotsquared.plot.util.SetupUtils; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotManager.java index 0c5a7e866..49d3788d5 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotManager.java @@ -1,7 +1,12 @@ package com.github.intellectualsites.plotsquared.plot.object.worlds; import com.github.intellectualsites.plotsquared.plot.PlotSquared; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.object.PlotManager; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.SetupUtils; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SingleWorldGenerator.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SingleWorldGenerator.java index 9ba3df278..d50e3d22f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SingleWorldGenerator.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SingleWorldGenerator.java @@ -2,7 +2,11 @@ package com.github.intellectualsites.plotsquared.plot.object.worlds; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.generator.IndependentPlotGenerator; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; public class SingleWorldGenerator extends IndependentPlotGenerator { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java index 55a99c9b9..206f2b710 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java @@ -1,7 +1,6 @@ package com.github.intellectualsites.plotsquared.plot.util; import com.github.intellectualsites.plotsquared.plot.PlotSquared; -import com.github.intellectualsites.plotsquared.plot.object.ChunkLoc; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; @@ -9,6 +8,7 @@ import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; +import com.sk89q.worldedit.math.BlockVector2; import java.io.File; import java.util.ArrayList; @@ -21,31 +21,31 @@ import java.util.concurrent.ConcurrentHashMap; public abstract class ChunkManager { - private static final Map> forceChunks = + private static final Map> forceChunks = new ConcurrentHashMap<>(); - private static final Map> addChunks = + private static final Map> addChunks = new ConcurrentHashMap<>(); public static ChunkManager manager = null; - public static ChunkLoc getChunkChunk(Location location) { + public static BlockVector2 getRegion(Location location) { int x = location.getX() >> 9; int z = location.getZ() >> 9; - return new ChunkLoc(x, z); + return BlockVector2.at(x, z); } public static void setChunkInPlotArea(RunnableVal force, - RunnableVal add, String world, ChunkLoc loc) { + RunnableVal add, String world, BlockVector2 loc) { LocalBlockQueue queue = GlobalBlockQueue.IMP.getNewQueue(world, false); if (PlotSquared.get().isAugmented(world)) { - int blockX = loc.x << 4; - int blockZ = loc.z << 4; + int blockX = loc.getX() << 4; + int blockZ = loc.getZ() << 4; ScopedLocalBlockQueue scoped = new ScopedLocalBlockQueue(queue, new Location(world, blockX, 0, blockZ), new Location(world, blockX + 15, 255, blockZ + 15)); if (force != null) { force.run(scoped); } else { - scoped.regenChunk(loc.x, loc.z); + scoped.regenChunk(loc.getX(), loc.getZ()); if (add != null) { add.run(scoped); } @@ -54,13 +54,13 @@ public abstract class ChunkManager { } else { forceChunks.put(loc, force); addChunks.put(loc, add); - queue.regenChunk(loc.x, loc.z); + queue.regenChunk(loc.getX(), loc.getZ()); forceChunks.remove(loc); addChunks.remove(loc); } } - public static boolean preProcessChunk(ChunkLoc loc, ScopedLocalBlockQueue queue) { + public static boolean preProcessChunk(BlockVector2 loc, ScopedLocalBlockQueue queue) { final RunnableVal forceChunk = forceChunks.get(loc); if (forceChunk != null) { forceChunk.run(queue); @@ -70,7 +70,7 @@ public abstract class ChunkManager { return false; } - public static boolean postProcessChunk(ChunkLoc loc, ScopedLocalBlockQueue queue) { + public static boolean postProcessChunk(BlockVector2 loc, ScopedLocalBlockQueue queue) { final RunnableVal addChunk = forceChunks.get(loc); if (addChunk != null) { addChunk.run(queue); @@ -81,13 +81,13 @@ public abstract class ChunkManager { } public static void largeRegionTask(final String world, final RegionWrapper region, - final RunnableVal task, final Runnable whenDone) { + final RunnableVal task, final Runnable whenDone) { TaskManager.runTaskAsync(() -> { - HashSet chunks = new HashSet<>(); - Set mcrs = manager.getChunkChunks(world); - for (ChunkLoc mcr : mcrs) { - int bx = mcr.x << 9; - int bz = mcr.z << 9; + HashSet chunks = new HashSet<>(); + Set mcrs = manager.getChunkChunks(world); + for (BlockVector2 mcr : mcrs) { + int bx = mcr.getX() << 9; + int bz = mcr.getZ() << 9; int tx = bx + 511; int tz = bz + 511; if (bx <= region.maxX && tx >= region.minX && bz <= region.maxZ @@ -100,16 +100,16 @@ public abstract class ChunkManager { int cbz = z << 4; int ctz = cbz + 15; if (cbz <= region.maxZ && ctz >= region.minZ) { - chunks.add(new ChunkLoc(x, z)); + chunks.add(BlockVector2.at(x, z)); } } } } } } - TaskManager.objectTask(chunks, new RunnableVal() { + TaskManager.objectTask(chunks, new RunnableVal() { - @Override public void run(ChunkLoc value) { + @Override public void run(BlockVector2 value) { manager.loadChunk(world, value, false).thenRun(()-> task.run(value)); } }, whenDone); @@ -152,21 +152,21 @@ public abstract class ChunkManager { final int bcz = p1z >> 4; final int tcx = p2x >> 4; final int tcz = p2z >> 4; - final ArrayList chunks = new ArrayList<>(); + final ArrayList chunks = new ArrayList<>(); for (int x = bcx; x <= tcx; x++) { for (int z = bcz; z <= tcz; z++) { - chunks.add(new ChunkLoc(x, z)); + chunks.add(BlockVector2.at(x, z)); } } TaskManager.runTask(new Runnable() { @Override public void run() { long start = System.currentTimeMillis(); while (!chunks.isEmpty() && ((System.currentTimeMillis() - start) < allocate)) { - ChunkLoc chunk = chunks.remove(0); + BlockVector2 chunk = chunks.remove(0); task.value = new int[7]; - task.value[0] = chunk.x; - task.value[1] = chunk.z; + task.value[0] = chunk.getX(); + task.value[1] = chunk.getZ(); task.value[2] = task.value[0] << 4; task.value[3] = task.value[1] << 4; task.value[4] = task.value[2] + 15; @@ -211,11 +211,11 @@ public abstract class ChunkManager { */ public abstract int[] countEntities(Plot plot); - public abstract CompletableFuture loadChunk(String world, ChunkLoc loc, boolean force); + public abstract CompletableFuture loadChunk(String world, BlockVector2 loc, boolean force); - public abstract void unloadChunk(String world, ChunkLoc loc, boolean save); + public abstract void unloadChunk(String world, BlockVector2 loc, boolean save); - public Set getChunkChunks(String world) { + public Set getChunkChunks(String world) { File folder = new File(PlotSquared.get().IMP.getWorldContainer(), world + File.separator + "region"); File[] regionFiles = folder.listFiles(); @@ -223,7 +223,7 @@ public abstract class ChunkManager { throw new RuntimeException( "Could not find worlds folder: " + folder + " ? (no read access?)"); } - HashSet chunks = new HashSet<>(); + HashSet chunks = new HashSet<>(); for (File file : regionFiles) { String name = file.getName(); if (name.endsWith("mca")) { @@ -231,7 +231,7 @@ public abstract class ChunkManager { try { int x = Integer.parseInt(split[1]); int z = Integer.parseInt(split[2]); - ChunkLoc loc = new ChunkLoc(x, z); + BlockVector2 loc = BlockVector2.at(x, z); chunks.add(loc); } catch (NumberFormatException ignored) { } @@ -240,16 +240,16 @@ public abstract class ChunkManager { return chunks; } - public void deleteRegionFiles(String world, Collection chunks) { + public void deleteRegionFiles(String world, Collection chunks) { deleteRegionFiles(world, chunks, null); } - public void deleteRegionFiles(final String world, final Collection chunks, + public void deleteRegionFiles(final String world, final Collection chunks, final Runnable whenDone) { TaskManager.runTaskAsync(() -> { - for (ChunkLoc loc : chunks) { + for (BlockVector2 loc : chunks) { String directory = - world + File.separator + "region" + File.separator + "r." + loc.x + "." + loc.z + world + File.separator + "region" + File.separator + "r." + loc.getX() + "." + loc.getZ() + ".mca"; File file = new File(PlotSquared.get().IMP.getWorldContainer(), directory); PlotSquared.log("&6 - Deleting file: " + file.getName() + " (max 1024 chunks)"); @@ -261,9 +261,9 @@ public abstract class ChunkManager { }); } - public Plot hasPlot(String world, ChunkLoc chunk) { - int x1 = chunk.x << 4; - int z1 = chunk.z << 4; + public Plot hasPlot(String world, BlockVector2 chunk) { + int x1 = chunk.getX() << 4; + int z1 = chunk.getZ() << 4; int x2 = x1 + 15; int z2 = z1 + 15; Location bot = new Location(world, x1, 0, z1); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EventUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EventUtil.java index fcb376355..5d443a43e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EventUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EventUtil.java @@ -6,11 +6,18 @@ import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.listener.PlayerBlockEventType; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.LazyBlock; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.Rating; import com.github.intellectualsites.plotsquared.plot.object.worlds.SinglePlotArea; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; - import org.jetbrains.annotations.Nullable; + import java.util.HashSet; import java.util.List; import java.util.Optional; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/IncendoPaster.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/IncendoPaster.java index 1fec0e567..b5ebe5d17 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/IncendoPaster.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/IncendoPaster.java @@ -9,7 +9,12 @@ import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Iterator; +import java.util.Locale; /** * Single class paster for the Incendo paste service diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java index 1f42d6772..af4b21e3c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java @@ -10,12 +10,25 @@ import com.github.intellectualsites.plotsquared.plot.flag.DoubleFlag; import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.flag.FlagManager; import com.github.intellectualsites.plotsquared.plot.flag.Flags; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.ConsolePlayer; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.object.stream.AbstractDelegateOutputStream; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; import org.jetbrains.annotations.NotNull; -import java.io.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.io.Reader; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; @@ -23,8 +36,17 @@ import java.net.URLConnection; import java.nio.charset.StandardCharsets; import java.nio.file.Paths; import java.text.DecimalFormat; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; +import java.util.Optional; +import java.util.Set; +import java.util.UUID; import java.util.stream.Collectors; import java.util.stream.IntStream; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java index 326d151e6..90a9b905f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java @@ -7,7 +7,6 @@ import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.generator.ClassicPlotWorld; -import com.github.intellectualsites.plotsquared.plot.object.ChunkLoc; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; @@ -26,16 +25,34 @@ import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats; import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader; import com.sk89q.worldedit.extent.clipboard.io.MCEditSchematicReader; import com.sk89q.worldedit.extent.clipboard.io.SpongeSchematicReader; +import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BaseBlock; import org.jetbrains.annotations.NotNull; -import java.io.*; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; import java.net.URL; import java.net.URLConnection; import java.nio.channels.Channels; import java.nio.channels.ReadableByteChannel; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; import java.util.stream.Collectors; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; @@ -197,9 +214,9 @@ public abstract class SchematicHandler { ChunkManager.chunkTask(pos1, pos2, new RunnableVal() { @Override public void run(int[] value) { - ChunkLoc chunk = new ChunkLoc(value[0], value[1]); - int x = chunk.x; - int z = chunk.z; + BlockVector2 chunk = BlockVector2.at(value[0], value[1]); + int x = chunk.getX(); + int z = chunk.getZ(); int xxb = x << 4; int zzb = z << 4; int xxt = xxb + 15; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandler.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandler.java index 60a0d778b..9967e88eb 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandler.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandler.java @@ -10,8 +10,8 @@ import com.github.intellectualsites.plotsquared.plot.object.StringWrapper; import com.github.intellectualsites.plotsquared.plot.uuid.UUIDWrapper; import com.google.common.collect.BiMap; import org.jetbrains.annotations.NotNull; - import org.jetbrains.annotations.Nullable; + import java.util.HashMap; import java.util.HashSet; import java.util.Map; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandlerImplementation.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandlerImplementation.java index 17ab6b5ce..b5e37ed93 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandlerImplementation.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandlerImplementation.java @@ -14,8 +14,8 @@ import com.google.common.base.Charsets; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; import org.jetbrains.annotations.NotNull; - import org.jetbrains.annotations.Nullable; + import java.util.HashMap; import java.util.HashSet; import java.util.Map; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java index 3aaed57fb..a503e1882 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java @@ -1,13 +1,19 @@ package com.github.intellectualsites.plotsquared.plot.util; import com.github.intellectualsites.plotsquared.plot.PlotSquared; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.object.schematic.PlotItem; import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.IntTag; import com.sk89q.jnbt.NBTInputStream; import com.sk89q.jnbt.NBTOutputStream; import com.sk89q.jnbt.Tag; +import com.sk89q.worldedit.math.BlockVector2; import java.io.ByteArrayOutputStream; import java.io.File; @@ -104,10 +110,10 @@ public abstract class WorldUtil { int brz = bot.getZ() >> 9; int trx = top.getX() >> 9; int trz = top.getZ() >> 9; - Set files = ChunkManager.manager.getChunkChunks(bot.getWorld()); - for (ChunkLoc mca : files) { - if (mca.x >= brx && mca.x <= trx && mca.z >= brz && mca.z <= trz) { - final File file = getMcr(plot.getWorldName(), mca.x, mca.z); + Set files = ChunkManager.manager.getChunkChunks(bot.getWorld()); + for (BlockVector2 mca : files) { + if (mca.getX() >= brx && mca.getX() <= trx && mca.getZ() >= brz && mca.getZ() <= trz) { + final File file = getMcr(plot.getWorldName(), mca.getX(), mca.getZ()); if (file != null) { //final String name = "r." + (x - cx) + "." + (z - cz) + ".mca"; String name = file.getName(); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/LocalBlockQueue.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/LocalBlockQueue.java index 04a9e2f0c..1ce8ccd11 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/LocalBlockQueue.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/LocalBlockQueue.java @@ -1,7 +1,6 @@ package com.github.intellectualsites.plotsquared.plot.util.block; import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; -import com.github.intellectualsites.plotsquared.plot.object.ChunkLoc; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; @@ -10,6 +9,7 @@ import com.github.intellectualsites.plotsquared.plot.util.StringMan; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; import com.sk89q.jnbt.CompoundTag; +import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.world.block.BaseBlock; import java.util.Map; @@ -83,11 +83,11 @@ public abstract class LocalBlockQueue { public final void regenChunkSafe(int x, int z) { regenChunk(x, z); fixChunkLighting(x, z); - ChunkLoc loc = new ChunkLoc(x, z); + BlockVector2 loc = BlockVector2.at(x, z); for (Map.Entry entry : UUIDHandler.getPlayers().entrySet()) { PlotPlayer pp = entry.getValue(); Location pLoc = pp.getLocation(); - if (!StringMan.isEqual(getWorld(), pLoc.getWorld()) || !pLoc.getChunkLoc() + if (!StringMan.isEqual(getWorld(), pLoc.getWorld()) || !pLoc.getBlockVector2() .equals(loc)) { continue; } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpireManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpireManager.java index 2fbcdee01..dbd9773f0 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpireManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpireManager.java @@ -7,13 +7,28 @@ import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.flag.FlagManager; import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.generator.HybridUtils; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.OfflinePlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotMessage; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal3; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.StringMan; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; -import java.util.*; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedDeque; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/PlotAnalysis.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/PlotAnalysis.java index 429a71035..484759d66 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/PlotAnalysis.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/PlotAnalysis.java @@ -10,7 +10,12 @@ import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import java.lang.reflect.Array; -import java.util.*; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; import java.util.concurrent.atomic.AtomicInteger; public class PlotAnalysis { diff --git a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/util/EventUtilTest.java b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/util/EventUtilTest.java index 6ae75a86d..fd2a8db15 100644 --- a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/util/EventUtilTest.java +++ b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/util/EventUtilTest.java @@ -1,7 +1,12 @@ package com.github.intellectualsites.plotsquared.plot.util; import com.github.intellectualsites.plotsquared.plot.flag.Flag; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.Rating; import java.util.List; import java.util.UUID; diff --git a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/NukkitMain.java b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/NukkitMain.java index 1cc8b8246..c84a73b67 100644 --- a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/NukkitMain.java +++ b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/NukkitMain.java @@ -25,19 +25,15 @@ import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.C; import com.github.intellectualsites.plotsquared.plot.config.ConfigurationNode; import com.github.intellectualsites.plotsquared.plot.config.Settings; -import com.github.intellectualsites.plotsquared.plot.generator.*; -import com.github.intellectualsites.plotsquared.plot.object.*; import com.github.intellectualsites.plotsquared.plot.object.chat.PlainChatManager; import com.github.intellectualsites.plotsquared.plot.object.worlds.PlotAreaManager; import com.github.intellectualsites.plotsquared.plot.object.worlds.SinglePlotArea; import com.github.intellectualsites.plotsquared.plot.object.worlds.SinglePlotAreaManager; -import com.github.intellectualsites.plotsquared.plot.util.*; import com.github.intellectualsites.plotsquared.plot.util.block.QueueProvider; import com.sk89q.worldedit.WorldEdit; import java.io.File; import java.lang.reflect.Field; -import java.util.*; public final class NukkitMain extends PluginBase implements Listener, IPlotMain { diff --git a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/generator/NukkitPlotGenerator.java b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/generator/NukkitPlotGenerator.java index ef274cf2b..d1712993b 100644 --- a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/generator/NukkitPlotGenerator.java +++ b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/generator/NukkitPlotGenerator.java @@ -9,7 +9,6 @@ import com.github.intellectualsites.plotsquared.nukkit.util.block.NukkitWrappedC import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.generator.GeneratorWrapper; import com.github.intellectualsites.plotsquared.plot.generator.IndependentPlotGenerator; -import com.github.intellectualsites.plotsquared.plot.object.*; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; diff --git a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/listeners/PlayerEvents.java b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/listeners/PlayerEvents.java index c429ba0fd..456cb97b2 100644 --- a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/listeners/PlayerEvents.java +++ b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/listeners/PlayerEvents.java @@ -28,11 +28,8 @@ import com.github.intellectualsites.plotsquared.plot.config.C; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.listener.PlotListener; -import com.github.intellectualsites.plotsquared.plot.object.*; -import com.github.intellectualsites.plotsquared.plot.util.*; import com.google.common.base.Optional; -import java.util.*; import java.util.Map.Entry; import java.util.regex.Pattern; diff --git a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/object/NukkitPlayer.java b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/object/NukkitPlayer.java index fa6bf2a59..f53213d69 100644 --- a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/object/NukkitPlayer.java +++ b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/object/NukkitPlayer.java @@ -10,7 +10,6 @@ import com.github.intellectualsites.plotsquared.nukkit.util.NukkitUtil; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; -import com.github.intellectualsites.plotsquared.plot.util.*; import java.util.Collections; import java.util.UUID; diff --git a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/Metrics.java b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/Metrics.java index 1a41b836d..9b2ffb10c 100644 --- a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/Metrics.java +++ b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/Metrics.java @@ -6,12 +6,10 @@ import cn.nukkit.utils.LogLevel; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; -import java.io.*; import java.net.Proxy; import java.net.URL; import java.net.URLConnection; import java.net.URLEncoder; -import java.util.*; import java.util.zip.GZIPOutputStream; public class Metrics { diff --git a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/NukkitChunkManager.java b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/NukkitChunkManager.java index 5caea648f..32da16dc3 100644 --- a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/NukkitChunkManager.java +++ b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/NukkitChunkManager.java @@ -1,8 +1,7 @@ package com.github.intellectualsites.plotsquared.nukkit.util; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; -import com.github.intellectualsites.plotsquared.plot.object.ChunkLoc; +import com.github.intellectualsites.plotsquared.plot.object.BlockVector2; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; @@ -16,11 +15,11 @@ public class NukkitChunkManager extends ChunkManager { return new int[0]; } - @Override public boolean loadChunk(String world, ChunkLoc loc, boolean force) { + @Override public boolean loadChunk(String world, BlockVector2 loc, boolean force) { return true; } - @Override public void unloadChunk(String world, ChunkLoc loc, boolean save, boolean safe) { + @Override public void unloadChunk(String world, BlockVector2 loc, boolean save, boolean safe) { } diff --git a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/NukkitEventUtil.java b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/NukkitEventUtil.java index 532870c43..d59e45ebf 100644 --- a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/NukkitEventUtil.java +++ b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/NukkitEventUtil.java @@ -7,7 +7,6 @@ import com.github.intellectualsites.plotsquared.nukkit.NukkitMain; import com.github.intellectualsites.plotsquared.nukkit.events.*; import com.github.intellectualsites.plotsquared.nukkit.object.NukkitPlayer; import com.github.intellectualsites.plotsquared.plot.flag.Flag; -import com.github.intellectualsites.plotsquared.plot.object.*; import com.github.intellectualsites.plotsquared.plot.util.EventUtil; import javax.annotation.Nullable; diff --git a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/NukkitSchematicHandler.java b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/NukkitSchematicHandler.java index 7e8fcf362..4a301101a 100644 --- a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/NukkitSchematicHandler.java +++ b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/NukkitSchematicHandler.java @@ -6,7 +6,7 @@ import cn.nukkit.level.format.generic.BaseFullChunk; import cn.nukkit.math.Vector3; import com.github.intellectualsites.plotsquared.jnbt.*; import com.github.intellectualsites.plotsquared.nukkit.NukkitMain; -import com.github.intellectualsites.plotsquared.plot.object.ChunkLoc; +import com.github.intellectualsites.plotsquared.plot.object.BlockVector2; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; @@ -16,7 +16,6 @@ import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; import java.io.IOException; -import java.util.*; /** * Schematic Handler. @@ -98,10 +97,10 @@ public class NukkitSchematicHandler extends SchematicHandler { final int sy = pos1.getY(); final int ey = pos2.getY(); // Generate list of chunks - final ArrayList chunks = new ArrayList<>(); + final ArrayList chunks = new ArrayList<>(); for (int x = bcx; x <= tcx; x++) { for (int z = bcz; z <= tcz; z++) { - chunks.add(new ChunkLoc(x, z)); + chunks.add(BlockVector2.at(x, z)); } } final Level worldObj = plugin.getServer().getLevelByName(world); @@ -113,7 +112,7 @@ public class NukkitSchematicHandler extends SchematicHandler { while (!chunks.isEmpty() && System.currentTimeMillis() - start < 20) { // save schematics - ChunkLoc chunk = chunks.remove(0); + BlockVector2 chunk = chunks.remove(0); BaseFullChunk bc = worldObj.getChunk(chunk.x, chunk.z); try { bc.load(false); diff --git a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/NukkitUtil.java b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/NukkitUtil.java index 4712d129d..ad085dca3 100644 --- a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/NukkitUtil.java +++ b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/NukkitUtil.java @@ -20,7 +20,6 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; import com.github.intellectualsites.plotsquared.plot.object.schematic.PlotItem; -import com.github.intellectualsites.plotsquared.plot.util.*; import java.lang.reflect.Field; import java.util.ArrayList; diff --git a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/block/NukkitHybridGen.java b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/block/NukkitHybridGen.java index ccca6dfe8..6af270e63 100644 --- a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/block/NukkitHybridGen.java +++ b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/block/NukkitHybridGen.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.nukkit.util.block; +import com.sk89q.worldedit.math.BlockVector2; + import cn.nukkit.level.Level; import com.github.intellectualsites.plotsquared.nukkit.NukkitMain; import com.github.intellectualsites.plotsquared.nukkit.generator.NukkitPlotGenerator; diff --git a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/block/NukkitLocalQueue.java b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/block/NukkitLocalQueue.java index 0a8012691..297df7c6b 100644 --- a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/block/NukkitLocalQueue.java +++ b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/block/NukkitLocalQueue.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.nukkit.util.block; +import com.sk89q.worldedit.math.BlockVector2; + import cn.nukkit.block.Block; import cn.nukkit.level.Level; import cn.nukkit.level.biome.EnumBiome; diff --git a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/block/NukkitWrappedChunk.java b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/block/NukkitWrappedChunk.java index 1dcb029f5..bc5182947 100644 --- a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/block/NukkitWrappedChunk.java +++ b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/util/block/NukkitWrappedChunk.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.nukkit.util.block; +import com.sk89q.worldedit.math.BlockVector2; + import cn.nukkit.level.biome.Biome; import cn.nukkit.level.biome.EnumBiome; import cn.nukkit.level.format.generic.BaseFullChunk; diff --git a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/SpongeMain.java b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/SpongeMain.java index 0877e42fb..07e535040 100644 --- a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/SpongeMain.java +++ b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/SpongeMain.java @@ -18,7 +18,6 @@ import com.github.intellectualsites.plotsquared.plot.object.worlds.PlotAreaManag import com.github.intellectualsites.plotsquared.plot.object.worlds.SinglePlotArea; import com.github.intellectualsites.plotsquared.plot.object.worlds.SinglePlotAreaManager; import com.github.intellectualsites.plotsquared.plot.object.worlds.SingleWorldGenerator; -import com.github.intellectualsites.plotsquared.plot.util.*; import com.github.intellectualsites.plotsquared.plot.util.block.QueueProvider; import com.github.intellectualsites.plotsquared.plot.uuid.UUIDWrapper; import com.github.intellectualsites.plotsquared.sponge.generator.SpongePlotGenerator; diff --git a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/listener/MainListener.java b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/listener/MainListener.java index 01dcfcd16..09f500103 100644 --- a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/listener/MainListener.java +++ b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/listener/MainListener.java @@ -4,8 +4,6 @@ import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.C; import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.listener.PlotListener; -import com.github.intellectualsites.plotsquared.plot.object.*; -import com.github.intellectualsites.plotsquared.plot.util.*; import com.github.intellectualsites.plotsquared.sponge.SpongeMain; import com.github.intellectualsites.plotsquared.sponge.object.SpongePlayer; import com.github.intellectualsites.plotsquared.sponge.util.SpongeUtil; @@ -35,7 +33,6 @@ import org.spongepowered.api.event.world.ExplosionEvent.Detonate; import org.spongepowered.api.text.Text; import org.spongepowered.api.world.World; -import java.util.*; import java.util.Map.Entry; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Predicate; diff --git a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeChunkManager.java b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeChunkManager.java index 5de2ae309..f5a26c306 100644 --- a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeChunkManager.java +++ b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeChunkManager.java @@ -1,6 +1,6 @@ package com.github.intellectualsites.plotsquared.sponge.util; -import com.github.intellectualsites.plotsquared.plot.object.ChunkLoc; +import com.github.intellectualsites.plotsquared.plot.object.BlockVector2; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; @@ -53,12 +53,12 @@ public class SpongeChunkManager extends ChunkManager { return count; } - @Override public boolean loadChunk(String world, ChunkLoc loc, boolean force) { + @Override public boolean loadChunk(String world, BlockVector2 loc, boolean force) { World worldObj = SpongeUtil.getWorld(world); return worldObj.loadChunk(loc.x << 4, 0, loc.z << 4, force).isPresent(); } - @Override public Set getChunkChunks(String world) { + @Override public Set getChunkChunks(String world) { // TODO save world; return super.getChunkChunks(world); } @@ -100,7 +100,7 @@ public class SpongeChunkManager extends ChunkManager { throw new UnsupportedOperationException("NOT IMPLEMENTED YET"); } - @Override public void unloadChunk(String world, ChunkLoc loc, boolean save, boolean safe) { + @Override public void unloadChunk(String world, BlockVector2 loc, boolean save, boolean safe) { World worldObj = SpongeUtil.getWorld(world); Optional chunk = worldObj.getChunk(loc.x << 4, 0, loc.z << 4); if (chunk.isPresent()) { diff --git a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeCommand.java b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeCommand.java index 2c6b9b936..21ab4b19e 100644 --- a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeCommand.java +++ b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeCommand.java @@ -16,8 +16,6 @@ import org.spongepowered.api.text.Text; import org.spongepowered.api.world.Location; import org.spongepowered.api.world.World; -import java.util.*; - public class SpongeCommand implements CommandCallable { @Override public CommandResult process(CommandSource source, String arguments) diff --git a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeEventUtil.java b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeEventUtil.java index d4c16e73d..a69f4c431 100644 --- a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeEventUtil.java +++ b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeEventUtil.java @@ -1,7 +1,6 @@ package com.github.intellectualsites.plotsquared.sponge.util; import com.github.intellectualsites.plotsquared.plot.flag.Flag; -import com.github.intellectualsites.plotsquared.plot.object.*; import com.github.intellectualsites.plotsquared.plot.util.EventUtil; import com.github.intellectualsites.plotsquared.sponge.SpongeMain; import com.github.intellectualsites.plotsquared.sponge.events.*; diff --git a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeMetrics.java b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeMetrics.java index 4ea1bc19d..4a221d4e9 100644 --- a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeMetrics.java +++ b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeMetrics.java @@ -1,5 +1,24 @@ package com.github.intellectualsites.plotsquared.sponge.util; +import com.github.intellectualsites.plotsquared.plot.PlotSquared; +import com.google.inject.Inject; +import ninja.leaping.configurate.commented.CommentedConfigurationNode; +import ninja.leaping.configurate.hocon.HoconConfigurationLoader; +import ninja.leaping.configurate.loader.ConfigurationLoader; +import org.spongepowered.api.Game; +import org.spongepowered.api.plugin.PluginContainer; +import org.spongepowered.api.scheduler.Task; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.Proxy; +import java.net.URL; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.util.UUID; +import java.util.concurrent.TimeUnit; +import java.util.zip.GZIPOutputStream; + /* * Copyright 2011-2013 Tyler Blair. All rights reserved. * @@ -28,24 +47,6 @@ package com.github.intellectualsites.plotsquared.sponge.util; * either expressed or implied, of anybody else. */ -import com.github.intellectualsites.plotsquared.plot.PlotSquared; -import com.google.inject.Inject; -import ninja.leaping.configurate.commented.CommentedConfigurationNode; -import ninja.leaping.configurate.hocon.HoconConfigurationLoader; -import ninja.leaping.configurate.loader.ConfigurationLoader; -import org.spongepowered.api.Game; -import org.spongepowered.api.plugin.PluginContainer; -import org.spongepowered.api.scheduler.Task; - -import java.io.*; -import java.net.Proxy; -import java.net.URL; -import java.net.URLConnection; -import java.net.URLEncoder; -import java.util.UUID; -import java.util.concurrent.TimeUnit; -import java.util.zip.GZIPOutputStream; - public class SpongeMetrics { /** diff --git a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeSchematicHandler.java b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeSchematicHandler.java index 648a3ebd2..ecfe61fe4 100644 --- a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeSchematicHandler.java +++ b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeSchematicHandler.java @@ -1,17 +1,16 @@ package com.github.intellectualsites.plotsquared.sponge.util; import com.github.intellectualsites.plotsquared.jnbt.*; -import com.github.intellectualsites.plotsquared.plot.object.*; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.SchematicHandler; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; +import com.sk89q.worldedit.math.BlockVector2; import org.spongepowered.api.block.BlockState; import org.spongepowered.api.item.inventory.Carrier; import org.spongepowered.api.item.inventory.type.CarriedInventory; import org.spongepowered.api.world.World; -import java.util.*; import java.util.Map.Entry; public class SpongeSchematicHandler extends SchematicHandler { @@ -92,10 +91,10 @@ public class SpongeSchematicHandler extends SchematicHandler { int sy = pos1.getY(); int ey = pos2.getY(); // Generate list of chunks - ArrayList chunks = new ArrayList<>(); + ArrayList chunks = new ArrayList<>(); for (int x = bcx; x <= tcx; x++) { for (int z = bcz; z <= tcz; z++) { - chunks.add(new ChunkLoc(x, z)); + chunks.add(BlockVector2.at(x, z)); } } World worldObj = SpongeUtil.getWorld(world); @@ -106,7 +105,7 @@ public class SpongeSchematicHandler extends SchematicHandler { while (!chunks.isEmpty() && System.currentTimeMillis() - start < 20) { // save schematics - ChunkLoc chunk = chunks.remove(0); + BlockVector2 chunk = chunks.remove(0); int X = chunk.x; int Z = chunk.z; if (!worldObj.getChunk(X, 0, Z).isPresent() && !worldObj diff --git a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeSetupUtils.java b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeSetupUtils.java index 3caf627bc..7a8cfc1a6 100644 --- a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeSetupUtils.java +++ b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeSetupUtils.java @@ -19,7 +19,6 @@ import org.spongepowered.api.world.gen.WorldGeneratorModifier; import org.spongepowered.api.world.storage.WorldProperties; import java.io.IOException; -import java.util.*; import java.util.Map.Entry; public class SpongeSetupUtils extends SetupUtils { diff --git a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeUtil.java b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeUtil.java index e1307f76d..404006678 100644 --- a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeUtil.java +++ b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeUtil.java @@ -9,7 +9,6 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; import com.github.intellectualsites.plotsquared.plot.object.schematic.PlotItem; -import com.github.intellectualsites.plotsquared.plot.util.*; import com.github.intellectualsites.plotsquared.sponge.SpongeMain; import com.github.intellectualsites.plotsquared.sponge.object.SpongePlayer; import net.minecraft.block.Block; @@ -39,7 +38,6 @@ import org.spongepowered.api.world.extent.Extent; import java.io.IOException; import java.lang.reflect.Field; -import java.util.*; public class SpongeUtil extends WorldUtil { diff --git a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/block/GenChunk.java b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/block/GenChunk.java index f88e8fa0d..698befdf8 100644 --- a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/block/GenChunk.java +++ b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/block/GenChunk.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.sponge.util.block; +import com.sk89q.worldedit.math.BlockVector2; + import com.github.intellectualsites.plotsquared.plot.object.ChunkWrapper; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; diff --git a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/block/SpongeLocalQueue.java b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/block/SpongeLocalQueue.java index 00e294138..51efceeb2 100644 --- a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/block/SpongeLocalQueue.java +++ b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/block/SpongeLocalQueue.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.sponge.util.block; +import com.sk89q.worldedit.math.BlockVector2; + import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; import com.github.intellectualsites.plotsquared.plot.object.PseudoRandom; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; From 37f608258fcbc016e5603414d41cf698a1bba9a1 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 4 Nov 2019 19:55:55 +0000 Subject: [PATCH 02/22] Remove PlotBlock --- .../plotsquared/bukkit/BukkitMain.java | 19 +- .../plotsquared/bukkit/chat/ArrayWrapper.java | 2 + .../plotsquared/bukkit/chat/FancyMessage.java | 2 + .../bukkit/chat/JsonRepresentedObject.java | 2 + .../plotsquared/bukkit/chat/JsonString.java | 2 + .../plotsquared/bukkit/chat/MessagePart.java | 2 + .../plotsquared/bukkit/chat/Reflection.java | 10 + .../bukkit/chat/TextualComponent.java | 2 + .../bukkit/commands/DebugUUID.java | 2 + .../bukkit/events/PlayerClaimPlotEvent.java | 2 + .../bukkit/events/PlayerEnterPlotEvent.java | 2 + .../bukkit/events/PlayerLeavePlotEvent.java | 2 + .../bukkit/events/PlayerPlotDeniedEvent.java | 2 + .../bukkit/events/PlayerPlotHelperEvent.java | 2 + .../bukkit/events/PlayerPlotTrustedEvent.java | 2 + .../events/PlayerTeleportToPlotEvent.java | 2 + .../bukkit/events/PlotAutoMergeEvent.java | 2 + .../bukkit/events/PlotChangeOwnerEvent.java | 2 + .../bukkit/events/PlotClearEvent.java | 2 + .../bukkit/events/PlotComponentSetEvent.java | 2 + .../bukkit/events/PlotDeleteEvent.java | 2 + .../plotsquared/bukkit/events/PlotEvent.java | 2 + .../bukkit/events/PlotFlagAddEvent.java | 2 + .../bukkit/events/PlotFlagRemoveEvent.java | 2 + .../bukkit/events/PlotMergeEvent.java | 2 + .../bukkit/events/PlotRateEvent.java | 2 + .../bukkit/events/PlotUnlinkEvent.java | 2 + .../generator/BukkitAugmentedGenerator.java | 2 + .../bukkit/generator/BukkitPlotGenerator.java | 4 +- .../generator/DelegatePlotGenerator.java | 7 +- .../bukkit/generator/PlotBlockPopulator.java | 4 +- .../bukkit/listeners/ChunkListener.java | 2 + .../bukkit/listeners/EntitySpawnListener.java | 2 + .../bukkit/listeners/ForceFieldListener.java | 2 + .../bukkit/listeners/PlayerEvents.java | 47 +- .../bukkit/listeners/PlotPlusListener.java | 2 + .../bukkit/listeners/SingleWorldListener.java | 2 + .../bukkit/listeners/WorldEvents.java | 2 + .../bukkit/object/BukkitBlockUtil.java | 30 + .../bukkit/object/BukkitLazyBlock.java | 25 - .../bukkit/object/BukkitOfflinePlayer.java | 2 + .../bukkit/object/BukkitPlayer.java | 12 +- .../bukkit/object/entity/AgeableStats.java | 2 + .../bukkit/object/entity/ArmorStandStats.java | 2 + .../bukkit/object/entity/EntityBaseStats.java | 2 + .../bukkit/object/entity/EntityWrapper.java | 2 + .../bukkit/object/entity/HorseStats.java | 2 + .../object/entity/LivingEntityStats.java | 2 + .../entity/ReplicatingEntityWrapper.java | 2 + .../bukkit/object/entity/TameableStats.java | 2 + .../object/entity/TeleportEntityWrapper.java | 2 + .../bukkit/object/schematic/StateWrapper.java | 9 +- .../bukkit/util/BukkitBlockRegistry.java | 18 - .../bukkit/util/BukkitChatManager.java | 2 + .../bukkit/util/BukkitChunkManager.java | 6 +- .../bukkit/util/BukkitCommand.java | 2 + .../bukkit/util/BukkitEconHandler.java | 2 + .../bukkit/util/BukkitEventUtil.java | 2 + .../bukkit/util/BukkitHybridUtils.java | 42 +- .../bukkit/util/BukkitInventoryUtil.java | 4 +- .../bukkit/util/BukkitLegacyMappings.java | 871 ------------------ .../bukkit/util/BukkitSchematicHandler.java | 2 + .../bukkit/util/BukkitSetupUtils.java | 2 + .../bukkit/util/BukkitTaskManager.java | 2 + .../plotsquared/bukkit/util/BukkitUtil.java | 73 +- .../bukkit/util/BukkitVersion.java | 2 + .../plotsquared/bukkit/util/Metrics.java | 3 + .../plotsquared/bukkit/util/NbtFactory.java | 2 + .../bukkit/util/OfflinePlayerUtil.java | 2 + .../plotsquared/bukkit/util/SendChunk.java | 2 + .../plotsquared/bukkit/util/SetGenCB.java | 2 + .../bukkit/util/block/BukkitLocalQueue.java | 49 +- .../bukkit/util/block/GenChunk.java | 42 +- .../bukkit/uuid/DatFileFilter.java | 2 + .../bukkit/uuid/DefaultUUIDWrapper.java | 2 + .../bukkit/uuid/FileUUIDHandler.java | 2 + .../bukkit/uuid/LowerOfflineUUIDWrapper.java | 2 + .../bukkit/uuid/OfflineUUIDWrapper.java | 2 + .../bukkit/uuid/SQLUUIDHandler.java | 2 + .../plotsquared/api/PlotAPI.java | 2 + .../plotsquared/commands/Argument.java | 2 + .../plotsquared/commands/Command.java | 2 + .../plotsquared/commands/CommandCaller.java | 2 + .../commands/CommandDeclaration.java | 2 + .../configuration/Configuration.java | 2 + .../configuration/ConfigurationOptions.java | 2 + .../configuration/ConfigurationSection.java | 2 + .../InvalidConfigurationException.java | 2 + .../configuration/MemoryConfiguration.java | 2 + .../MemoryConfigurationOptions.java | 2 + .../configuration/MemorySection.java | 2 + .../configuration/file/FileConfiguration.java | 2 + .../file/FileConfigurationOptions.java | 2 + .../configuration/file/YamlConfiguration.java | 2 + .../file/YamlConfigurationOptions.java | 2 + .../configuration/file/YamlConstructor.java | 2 + .../configuration/file/YamlRepresenter.java | 2 + .../ConfigurationSerializable.java | 2 + .../ConfigurationSerialization.java | 2 + .../DelegateDeserialization.java | 2 + .../serialization/SerializableAs.java | 2 + .../plotsquared/json/JSONArray.java | 2 + .../plotsquared/json/JSONException.java | 2 + .../plotsquared/json/JSONObject.java | 2 + .../plotsquared/json/JSONString.java | 2 + .../plotsquared/json/JSONTokener.java | 2 + .../plotsquared/json/Property.java | 2 + .../plotsquared/json/XML.java | 2 + .../plotsquared/json/XMLTokener.java | 2 + .../plotsquared/plot/IPlotMain.java | 11 +- .../plotsquared/plot/Platform.java | 2 + .../plotsquared/plot/PlotSquared.java | 6 +- .../plotsquared/plot/PlotVersion.java | 2 + .../plotsquared/plot/commands/Add.java | 2 + .../plotsquared/plot/commands/Alias.java | 2 + .../plotsquared/plot/commands/Area.java | 2 + .../plotsquared/plot/commands/Auto.java | 2 + .../plotsquared/plot/commands/Biome.java | 2 + .../plotsquared/plot/commands/Buy.java | 2 + .../plotsquared/plot/commands/Chat.java | 2 + .../plotsquared/plot/commands/Claim.java | 2 + .../plotsquared/plot/commands/Clear.java | 2 + .../plotsquared/plot/commands/Cluster.java | 2 + .../plot/commands/CommandCategory.java | 2 + .../plotsquared/plot/commands/Comment.java | 2 + .../plotsquared/plot/commands/Condense.java | 2 + .../plotsquared/plot/commands/Confirm.java | 2 + .../plotsquared/plot/commands/Continue.java | 2 + .../plotsquared/plot/commands/Copy.java | 2 + .../plot/commands/CreateRoadSchematic.java | 2 + .../plotsquared/plot/commands/Database.java | 2 + .../plotsquared/plot/commands/Debug.java | 2 + .../plot/commands/DebugAllowUnsafe.java | 2 + .../plot/commands/DebugClaimTest.java | 2 + .../plotsquared/plot/commands/DebugExec.java | 6 +- .../plot/commands/DebugFixFlags.java | 2 + .../plot/commands/DebugImportWorlds.java | 2 + .../plot/commands/DebugLoadTest.java | 2 + .../plotsquared/plot/commands/DebugPaste.java | 2 + .../plot/commands/DebugRoadRegen.java | 2 + .../plot/commands/DebugSaveTest.java | 2 + .../plotsquared/plot/commands/Delete.java | 2 + .../plotsquared/plot/commands/Deny.java | 2 + .../plotsquared/plot/commands/Desc.java | 2 + .../plotsquared/plot/commands/Dislike.java | 2 + .../plotsquared/plot/commands/Done.java | 2 + .../plotsquared/plot/commands/Download.java | 2 + .../plotsquared/plot/commands/FlagCmd.java | 18 +- .../plot/commands/GenerateDocs.java | 2 + .../plotsquared/plot/commands/Grant.java | 2 + .../plotsquared/plot/commands/Help.java | 2 + .../plotsquared/plot/commands/Inbox.java | 2 + .../plotsquared/plot/commands/Info.java | 2 + .../plotsquared/plot/commands/Kick.java | 2 + .../plotsquared/plot/commands/Leave.java | 2 + .../plotsquared/plot/commands/Like.java | 2 + .../plotsquared/plot/commands/ListCmd.java | 2 + .../plotsquared/plot/commands/Load.java | 2 + .../plot/commands/MainCommand.java | 2 + .../plotsquared/plot/commands/Merge.java | 2 + .../plotsquared/plot/commands/Middle.java | 2 + .../plotsquared/plot/commands/Move.java | 2 + .../plotsquared/plot/commands/Music.java | 7 +- .../plotsquared/plot/commands/Near.java | 2 + .../plotsquared/plot/commands/Owner.java | 2 + .../plotsquared/plot/commands/PluginCmd.java | 2 + .../plotsquared/plot/commands/Purge.java | 2 + .../plotsquared/plot/commands/Rate.java | 2 + .../plot/commands/RegenAllRoads.java | 2 + .../plotsquared/plot/commands/Relight.java | 2 + .../plotsquared/plot/commands/Reload.java | 2 + .../plotsquared/plot/commands/Remove.java | 2 + .../plot/commands/RequiredType.java | 2 + .../plotsquared/plot/commands/Save.java | 2 + .../plot/commands/SchematicCmd.java | 2 + .../plotsquared/plot/commands/Set.java | 12 +- .../plotsquared/plot/commands/SetCommand.java | 2 + .../plotsquared/plot/commands/SetHome.java | 2 + .../plotsquared/plot/commands/Setup.java | 2 + .../plotsquared/plot/commands/SubCommand.java | 2 + .../plotsquared/plot/commands/Swap.java | 2 + .../plotsquared/plot/commands/Target.java | 2 + .../plotsquared/plot/commands/Template.java | 2 + .../plotsquared/plot/commands/Toggle.java | 2 + .../plotsquared/plot/commands/Trim.java | 2 + .../plotsquared/plot/commands/Trust.java | 2 + .../plotsquared/plot/commands/Unlink.java | 2 + .../plotsquared/plot/commands/Visit.java | 2 + .../plot/commands/WE_Anywhere.java | 2 + .../plotsquared/plot/config/Captions.java | 2 + .../plotsquared/plot/config/Config.java | 2 + .../plot/config/Configuration.java | 16 +- .../plot/config/ConfigurationNode.java | 6 +- .../plotsquared/plot/config/Settings.java | 2 + .../plotsquared/plot/config/Storage.java | 2 + .../plotsquared/plot/database/AbstractDB.java | 2 + .../plotsquared/plot/database/DBFunc.java | 2 + .../plotsquared/plot/database/Database.java | 2 + .../plotsquared/plot/database/MySQL.java | 2 + .../plotsquared/plot/database/SQLManager.java | 2 + .../plotsquared/plot/database/SQLite.java | 2 + .../plotsquared/plot/database/StmtMod.java | 2 + .../plot/flag/BlockStateListFlag.java | 40 + .../plotsquared/plot/flag/BooleanFlag.java | 2 + .../plotsquared/plot/flag/DoubleFlag.java | 2 + .../plotsquared/plot/flag/EnumFlag.java | 2 + .../plotsquared/plot/flag/Flag.java | 2 + .../plotsquared/plot/flag/FlagManager.java | 2 + .../plotsquared/plot/flag/Flags.java | 8 +- .../plotsquared/plot/flag/GameModeFlag.java | 2 + .../plotsquared/plot/flag/IntegerFlag.java | 2 + .../plot/flag/IntegerListFlag.java | 2 + .../plotsquared/plot/flag/IntervalFlag.java | 2 + .../plotsquared/plot/flag/ListFlag.java | 2 + .../plotsquared/plot/flag/LongFlag.java | 2 + .../plot/flag/PlotBlockListFlag.java | 33 - .../plot/flag/PlotWeatherFlag.java | 2 + .../plotsquared/plot/flag/StringFlag.java | 2 + .../plotsquared/plot/flag/StringListFlag.java | 2 + .../plot/flag/TeleportDenyFlag.java | 2 + .../plot/generator/AugmentedUtils.java | 13 +- .../plot/generator/ClassicPlotManager.java | 22 +- .../plot/generator/ClassicPlotWorld.java | 28 +- .../plot/generator/GeneratorWrapper.java | 2 + .../plot/generator/GridPlotManager.java | 2 + .../plot/generator/GridPlotWorld.java | 2 + .../plotsquared/plot/generator/HybridGen.java | 8 +- .../plot/generator/HybridPlotManager.java | 12 +- .../plot/generator/HybridPlotWorld.java | 12 +- .../plot/generator/HybridUtils.java | 12 +- .../generator/IndependentPlotGenerator.java | 2 + .../plot/generator/PlotGenerator.java | 2 + .../plot/generator/SquarePlotManager.java | 2 + .../plot/generator/SquarePlotWorld.java | 2 + .../plot/listener/ExtentWrapper.java | 2 + .../plot/listener/PlayerBlockEventType.java | 2 + .../plot/listener/PlotListener.java | 25 +- .../plot/listener/ProcessedWEExtent.java | 2 + .../plotsquared/plot/listener/WEExtent.java | 2 + .../plotsquared/plot/listener/WEManager.java | 2 + .../plot/listener/WESubscriber.java | 2 + .../plot/logger/DelegateLogger.java | 2 + .../plotsquared/plot/logger/ILogger.java | 2 + .../plotsquared/plot/object/BlockBucket.java | 51 +- .../plotsquared/plot/object/BlockLoc.java | 2 + .../plot/object/BlockRegistry.java | 34 - .../plotsquared/plot/object/ChunkWrapper.java | 2 + .../plotsquared/plot/object/CmdInstance.java | 2 + .../plot/object/ConsolePlayer.java | 7 +- .../plotsquared/plot/object/Direction.java | 2 + .../plotsquared/plot/object/Expression.java | 2 + .../plotsquared/plot/object/FileBytes.java | 2 + .../plotsquared/plot/object/LazyBlock.java | 7 +- .../plotsquared/plot/object/LazyResult.java | 2 + .../plot/object/LegacyPlotBlock.java | 71 -- .../plotsquared/plot/object/Location.java | 2 + .../plot/object/OfflinePlotPlayer.java | 2 + .../plotsquared/plot/object/Plot.java | 6 +- .../plotsquared/plot/object/PlotArea.java | 2 + .../plotsquared/plot/object/PlotBlock.java | 138 --- .../plotsquared/plot/object/PlotCluster.java | 2 + .../plotsquared/plot/object/PlotFilter.java | 2 + .../plotsquared/plot/object/PlotHandler.java | 2 + .../plotsquared/plot/object/PlotId.java | 2 + .../plot/object/PlotInventory.java | 2 + .../plot/object/PlotItemStack.java | 18 +- .../plotsquared/plot/object/PlotLoc.java | 2 + .../plotsquared/plot/object/PlotManager.java | 2 + .../plotsquared/plot/object/PlotMessage.java | 2 + .../plotsquared/plot/object/PlotPlayer.java | 6 +- .../plotsquared/plot/object/PlotSettings.java | 2 + .../plotsquared/plot/object/PseudoRandom.java | 2 + .../plotsquared/plot/object/Rating.java | 2 + .../plot/object/RegionWrapper.java | 2 + .../plotsquared/plot/object/RunnableVal.java | 2 + .../plotsquared/plot/object/RunnableVal2.java | 2 + .../plotsquared/plot/object/RunnableVal3.java | 2 + .../plotsquared/plot/object/SetupObject.java | 2 + .../plot/object/StringPlotBlock.java | 100 -- .../plot/object/StringWrapper.java | 2 + .../plot/object/chat/PlainChatManager.java | 2 + .../collection/FlatRandomCollection.java | 2 + .../object/collection/RandomCollection.java | 2 + .../collection/SimpleRandomCollection.java | 2 + .../plot/object/comment/CommentInbox.java | 2 + .../plot/object/comment/InboxOwner.java | 2 + .../plot/object/comment/InboxPublic.java | 2 + .../plot/object/comment/InboxReport.java | 2 + .../plot/object/comment/PlotComment.java | 2 + .../plot/object/schematic/ItemType.java | 307 ------ .../plot/object/schematic/PlotItem.java | 9 +- .../plot/object/schematic/Schematic.java | 8 +- .../plot/object/schematic/StoredEntity.java | 2 + .../stream/AbstractDelegateOutputStream.java | 2 + .../object/worlds/DefaultPlotAreaManager.java | 2 + .../plot/object/worlds/PlotAreaManager.java | 2 + .../plot/object/worlds/SinglePlot.java | 2 + .../plot/object/worlds/SinglePlotArea.java | 2 + .../object/worlds/SinglePlotAreaManager.java | 2 + .../plot/object/worlds/SinglePlotManager.java | 2 + .../object/worlds/SingleWorldGenerator.java | 18 +- .../plotsquared/plot/util/ArrayUtil.java | 2 + .../plot/util/ByteArrayUtilities.java | 2 + .../plotsquared/plot/util/ChatManager.java | 2 + .../plotsquared/plot/util/ChunkManager.java | 2 + .../plotsquared/plot/util/CmdConfirm.java | 2 + .../plotsquared/plot/util/CommentManager.java | 2 + .../plotsquared/plot/util/ConsoleColors.java | 2 + .../plotsquared/plot/util/EconHandler.java | 2 + .../plotsquared/plot/util/EntityUtil.java | 2 + .../plotsquared/plot/util/EventUtil.java | 98 +- .../plotsquared/plot/util/HttpUtil.java | 2 + .../plotsquared/plot/util/IncendoPaster.java | 2 + .../plotsquared/plot/util/InventoryUtil.java | 2 + .../plot/util/LegacyConverter.java | 22 +- .../plotsquared/plot/util/LegacyMappings.java | 15 - .../plotsquared/plot/util/MainUtil.java | 2 + .../plotsquared/plot/util/MathMan.java | 2 + .../plotsquared/plot/util/Permissions.java | 2 + .../plotsquared/plot/util/PlotGameMode.java | 2 + .../plotsquared/plot/util/PlotWeather.java | 2 + .../plot/util/ReflectionUtils.java | 2 + .../plotsquared/plot/util/RegExUtil.java | 2 + .../plot/util/SchematicHandler.java | 12 +- .../plotsquared/plot/util/SetupUtils.java | 2 + .../plot/util/StringComparison.java | 2 + .../plotsquared/plot/util/StringMan.java | 2 + .../plotsquared/plot/util/TaskManager.java | 2 + .../plotsquared/plot/util/UUIDHandler.java | 2 + .../plot/util/UUIDHandlerImplementation.java | 2 + .../plotsquared/plot/util/UpdateUtility.java | 2 + .../plotsquared/plot/util/WorldUtil.java | 14 +- .../plotsquared/plot/util/area/QuadMap.java | 2 + .../plot/util/block/BasicLocalBlockQueue.java | 16 +- .../plot/util/block/BlockUtil.java | 89 ++ .../util/block/DelegateLocalBlockQueue.java | 8 +- .../plot/util/block/GlobalBlockQueue.java | 2 + .../plotsquared/plot/util/block/ItemUtil.java | 30 + .../plot/util/block/LocalBlockQueue.java | 10 +- .../util/block/OffsetLocalBlockQueue.java | 2 + .../plot/util/block/QueueProvider.java | 2 + .../util/block/ScopedLocalBlockQueue.java | 6 +- .../plot/util/expiry/ExpireManager.java | 2 + .../plot/util/expiry/ExpirySettings.java | 2 + .../plot/util/expiry/ExpiryTask.java | 2 + .../plot/util/expiry/PlotAnalysis.java | 2 + .../plot/util/helpmenu/HelpMenu.java | 2 + .../plot/util/helpmenu/HelpObject.java | 2 + .../plot/util/helpmenu/HelpPage.java | 2 + .../plotsquared/plot/uuid/UUIDWrapper.java | 2 + .../plotsquared/plot/FlagTest.java | 12 +- .../plotsquared/plot/PlotVersionTest.java | 2 + .../plot/database/AbstractDBTest.java | 2 + .../plotsquared/plot/object/LocationTest.java | 2 + .../plotsquared/plot/util/EventUtilTest.java | 2 + .../util/UUIDHandlerImplementationTest.java | 2 + build.gradle | 8 + 357 files changed, 1254 insertions(+), 2020 deletions(-) create mode 100644 Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitBlockUtil.java delete mode 100644 Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitLazyBlock.java delete mode 100644 Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitBlockRegistry.java delete mode 100644 Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitLegacyMappings.java create mode 100644 Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BlockStateListFlag.java delete mode 100644 Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/PlotBlockListFlag.java delete mode 100644 Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockRegistry.java delete mode 100644 Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LegacyPlotBlock.java delete mode 100644 Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotBlock.java delete mode 100644 Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/StringPlotBlock.java delete mode 100644 Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/ItemType.java delete mode 100644 Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/LegacyMappings.java create mode 100644 Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BlockUtil.java create mode 100644 Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/ItemUtil.java diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java index a851207cd..08a8dc4be 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.generator.BukkitPlotGenerator; import com.github.intellectualsites.plotsquared.bukkit.listeners.ChunkListener; import com.github.intellectualsites.plotsquared.bukkit.listeners.EntitySpawnListener; @@ -7,7 +9,6 @@ import com.github.intellectualsites.plotsquared.bukkit.listeners.PlayerEvents; import com.github.intellectualsites.plotsquared.bukkit.listeners.PlotPlusListener; import com.github.intellectualsites.plotsquared.bukkit.listeners.SingleWorldListener; import com.github.intellectualsites.plotsquared.bukkit.listeners.WorldEvents; -import com.github.intellectualsites.plotsquared.bukkit.util.BukkitBlockRegistry; import com.github.intellectualsites.plotsquared.bukkit.util.BukkitChatManager; import com.github.intellectualsites.plotsquared.bukkit.util.BukkitChunkManager; import com.github.intellectualsites.plotsquared.bukkit.util.BukkitCommand; @@ -15,7 +16,6 @@ import com.github.intellectualsites.plotsquared.bukkit.util.BukkitEconHandler; import com.github.intellectualsites.plotsquared.bukkit.util.BukkitEventUtil; import com.github.intellectualsites.plotsquared.bukkit.util.BukkitHybridUtils; import com.github.intellectualsites.plotsquared.bukkit.util.BukkitInventoryUtil; -import com.github.intellectualsites.plotsquared.bukkit.util.BukkitLegacyMappings; import com.github.intellectualsites.plotsquared.bukkit.util.BukkitSchematicHandler; import com.github.intellectualsites.plotsquared.bukkit.util.BukkitSetupUtils; import com.github.intellectualsites.plotsquared.bukkit.util.BukkitTaskManager; @@ -38,7 +38,6 @@ import com.github.intellectualsites.plotsquared.plot.generator.GeneratorWrapper; import com.github.intellectualsites.plotsquared.plot.generator.HybridGen; import com.github.intellectualsites.plotsquared.plot.generator.HybridUtils; import com.github.intellectualsites.plotsquared.plot.generator.IndependentPlotGenerator; -import com.github.intellectualsites.plotsquared.plot.object.BlockRegistry; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotId; @@ -55,7 +54,6 @@ import com.github.intellectualsites.plotsquared.plot.util.ConsoleColors; import com.github.intellectualsites.plotsquared.plot.util.EconHandler; import com.github.intellectualsites.plotsquared.plot.util.EventUtil; import com.github.intellectualsites.plotsquared.plot.util.InventoryUtil; -import com.github.intellectualsites.plotsquared.plot.util.LegacyMappings; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils; import com.github.intellectualsites.plotsquared.plot.util.SchematicHandler; @@ -69,6 +67,7 @@ import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; import com.github.intellectualsites.plotsquared.plot.util.block.QueueProvider; import com.github.intellectualsites.plotsquared.plot.uuid.UUIDWrapper; import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.bukkit.BukkitBlockRegistry; import io.papermc.lib.PaperLib; import lombok.Getter; import lombok.NonNull; @@ -113,9 +112,6 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain } } - private final LegacyMappings legacyMappings = new BukkitLegacyMappings(); - private final BlockRegistry blockRegistry = - new BukkitBlockRegistry(Material.values()); private int[] version; @Getter private String pluginName; @Getter private SingleWorldListener singleWorldListener; @@ -831,13 +827,4 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain } return names; } - - @Override public BlockRegistry getBlockRegistry() { - return this.blockRegistry; - } - - @Override public LegacyMappings getLegacyMappings() { - return this.legacyMappings; - } - } diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/ArrayWrapper.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/ArrayWrapper.java index 064d77d86..2b61b3d53 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/ArrayWrapper.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/ArrayWrapper.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.chat; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import org.apache.commons.lang.Validate; import java.lang.reflect.Array; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/FancyMessage.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/FancyMessage.java index 348f50f9a..911ca6b3c 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/FancyMessage.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/FancyMessage.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.chat; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/JsonRepresentedObject.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/JsonRepresentedObject.java index 04f036526..32c365171 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/JsonRepresentedObject.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/JsonRepresentedObject.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.chat; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.google.gson.stream.JsonWriter; import java.io.IOException; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/JsonString.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/JsonString.java index 7f8dd4d29..9d9d7ab9c 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/JsonString.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/JsonString.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.chat; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.google.gson.stream.JsonWriter; import org.bukkit.configuration.serialization.ConfigurationSerializable; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/MessagePart.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/MessagePart.java index 64bdda48d..deeeea0b3 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/MessagePart.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/MessagePart.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.chat; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.google.common.collect.BiMap; import com.google.common.collect.ImmutableBiMap; import com.google.gson.stream.JsonWriter; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/Reflection.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/Reflection.java index f3f004284..3d9e731c1 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/Reflection.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/Reflection.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.chat; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import org.bukkit.Bukkit; import java.lang.reflect.Field; @@ -21,6 +23,8 @@ public final class Reflection { private static final Map> _loadedNMSClasses = new HashMap<>(); /** * Stores loaded classes from the {@code org.bukkit.craftbukkit} package (and subpackages). + +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; */ private static final Map> _loadedOBCClasses = new HashMap<>(); private static final Map, Map> _loadedFields = new HashMap<>(); @@ -37,7 +41,11 @@ public final class Reflection { /** * Gets the version string from the package name of the CraftBukkit server implementation. + +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; * This is needed to bypass the JAR package name changing on each update. + +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; * * @return The version string of the OBC and NMS packages, including the trailing dot. */ @@ -79,6 +87,8 @@ public final class Reflection { * The class instances returned by this method are cached, such that no lookup will be done twice (unless multiple threads are accessing this method simultaneously). * * @param className The name of the class, excluding the package, within OBC. This name may contain a subpackage name, such as {@code inventory.CraftItemStack}. + +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; * @return The class instance representing the specified OBC class, or {@code null} if it could not be loaded. */ public synchronized static Class getOBCClass(String className) { diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/TextualComponent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/TextualComponent.java index 14e3d2305..c292f7d5f 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/TextualComponent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/TextualComponent.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.chat; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import com.google.gson.stream.JsonWriter; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/commands/DebugUUID.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/commands/DebugUUID.java index 49d399da1..9765d38b9 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/commands/DebugUUID.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/commands/DebugUUID.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.uuid.DatFileFilter; import com.github.intellectualsites.plotsquared.bukkit.uuid.DefaultUUIDWrapper; import com.github.intellectualsites.plotsquared.bukkit.uuid.LowerOfflineUUIDWrapper; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerClaimPlotEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerClaimPlotEvent.java index 269b64296..c8fbc78a4 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerClaimPlotEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerClaimPlotEvent.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.events; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.Plot; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerEnterPlotEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerEnterPlotEvent.java index a40365b40..c0b0702e0 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerEnterPlotEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerEnterPlotEvent.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.events; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.Plot; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerLeavePlotEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerLeavePlotEvent.java index 36482d44c..04ea1a344 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerLeavePlotEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerLeavePlotEvent.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.events; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.Plot; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotDeniedEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotDeniedEvent.java index c9c4d56b9..23c011e8f 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotDeniedEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotDeniedEvent.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.events; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.Plot; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotHelperEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotHelperEvent.java index 573d53ea8..174bd1673 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotHelperEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotHelperEvent.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.events; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.Plot; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotTrustedEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotTrustedEvent.java index f2f9efe71..4ee2d9ca0 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotTrustedEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotTrustedEvent.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.events; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.Plot; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerTeleportToPlotEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerTeleportToPlotEvent.java index 79d43391e..6a4c4bccd 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerTeleportToPlotEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerTeleportToPlotEvent.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.events; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import org.bukkit.entity.Player; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotAutoMergeEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotAutoMergeEvent.java index 059b296cf..8722d86b4 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotAutoMergeEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotAutoMergeEvent.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.events; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import lombok.Getter; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotChangeOwnerEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotChangeOwnerEvent.java index 3fba03284..4c71093b3 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotChangeOwnerEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotChangeOwnerEvent.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.events; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import org.bukkit.entity.Player; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotClearEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotClearEvent.java index b4ab469a2..e4354d4fe 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotClearEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotClearEvent.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.events; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import org.bukkit.event.Cancellable; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotComponentSetEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotComponentSetEvent.java index 6911ccdd4..4c347657e 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotComponentSetEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotComponentSetEvent.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.events; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import org.bukkit.event.HandlerList; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotDeleteEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotDeleteEvent.java index 5199496ff..4720a0353 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotDeleteEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotDeleteEvent.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.events; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import org.bukkit.event.Cancellable; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotEvent.java index ae4b0c1d7..d8ea39fc3 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotEvent.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.events; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.Plot; import org.bukkit.event.Event; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotFlagAddEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotFlagAddEvent.java index e8c4ac63c..e55b33920 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotFlagAddEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotFlagAddEvent.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.events; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.object.Plot; import org.bukkit.event.Cancellable; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotFlagRemoveEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotFlagRemoveEvent.java index 3e3e48b55..b8617e361 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotFlagRemoveEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotFlagRemoveEvent.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.events; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.object.Plot; import org.bukkit.event.Cancellable; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotMergeEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotMergeEvent.java index 55488011e..9e1822960 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotMergeEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotMergeEvent.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.events; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.Plot; import lombok.Getter; import lombok.Setter; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotRateEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotRateEvent.java index b6ca46593..9e494ba1c 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotRateEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotRateEvent.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.events; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.Rating; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotUnlinkEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotUnlinkEvent.java index 5db7d04d4..00a4d39dc 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotUnlinkEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotUnlinkEvent.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.events; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import lombok.Getter; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/BukkitAugmentedGenerator.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/BukkitAugmentedGenerator.java index 03b0c8123..85872ca9c 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/BukkitAugmentedGenerator.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/BukkitAugmentedGenerator.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.generator; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.generator.AugmentedUtils; import org.bukkit.Chunk; import org.bukkit.World; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/BukkitPlotGenerator.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/BukkitPlotGenerator.java index 53a7dd358..4fc0618cd 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/BukkitPlotGenerator.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/BukkitPlotGenerator.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.generator; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; import com.github.intellectualsites.plotsquared.bukkit.util.block.GenChunk; import com.github.intellectualsites.plotsquared.plot.PlotSquared; @@ -41,7 +43,7 @@ public class BukkitPlotGenerator extends ChunkGenerator this.plotGenerator = generator; this.platformGenerator = this; this.populators = new ArrayList<>(); - this.populators.add(new PlotBlockPopulator(this.plotGenerator)); + this.populators.add(new BlockStatePopulator(this.plotGenerator)); this.full = true; MainUtil.initCache(); } diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/DelegatePlotGenerator.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/DelegatePlotGenerator.java index 6a2655d24..0ffcad59c 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/DelegatePlotGenerator.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/DelegatePlotGenerator.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.generator; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.generator.HybridPlotWorld; @@ -7,7 +9,8 @@ import com.github.intellectualsites.plotsquared.plot.generator.IndependentPlotGe import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.bukkit.BukkitAdapter; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; @@ -45,7 +48,7 @@ import java.util.Random; for (short x = 0; x < 16; x++) { for (short z = 0; z < 16; z++) { blockBuckets[0][(z << 4) | x] = - BlockBucket.withSingle(PlotBlock.get("bedrock")); + BlockBucket.withSingle(BlockUtil.get("bedrock")); } } } diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/PlotBlockPopulator.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/PlotBlockPopulator.java index 9236e184a..3e24f900f 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/PlotBlockPopulator.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/PlotBlockPopulator.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.generator; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.generator.IndependentPlotGenerator; import com.github.intellectualsites.plotsquared.plot.object.ChunkWrapper; @@ -15,7 +17,7 @@ import org.jetbrains.annotations.NotNull; import java.util.Random; -@RequiredArgsConstructor final class PlotBlockPopulator extends BlockPopulator { +@RequiredArgsConstructor final class BlockStatePopulator extends BlockPopulator { private final IndependentPlotGenerator plotGenerator; private LocalBlockQueue queue; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/ChunkListener.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/ChunkListener.java index 046c0de8f..aa13e9dc5 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/ChunkListener.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/ChunkListener.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.listeners; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.object.Location; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/EntitySpawnListener.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/EntitySpawnListener.java index a982f39fd..2e5c8fcc8 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/EntitySpawnListener.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/EntitySpawnListener.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.listeners; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/ForceFieldListener.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/ForceFieldListener.java index d2d588970..86136afeb 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/ForceFieldListener.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/ForceFieldListener.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.listeners; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java index f70d7f46b..d622d6d71 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java @@ -1,7 +1,9 @@ package com.github.intellectualsites.plotsquared.bukkit.listeners; +import com.github.intellectualsites.plotsquared.bukkit.object.BukkitBlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.BukkitMain; -import com.github.intellectualsites.plotsquared.bukkit.object.BukkitLazyBlock; import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; import com.github.intellectualsites.plotsquared.plot.PlotSquared; @@ -13,7 +15,8 @@ import com.github.intellectualsites.plotsquared.plot.listener.PlotListener; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.bukkit.BukkitAdapter; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotHandler; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.PlotInventory; @@ -29,6 +32,7 @@ import com.github.intellectualsites.plotsquared.plot.util.RegExUtil; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; import com.github.intellectualsites.plotsquared.plot.util.UpdateUtility; +import com.sk89q.worldedit.world.block.BlockType; import io.papermc.lib.PaperLib; import org.bukkit.Bukkit; import org.bukkit.ChatColor; @@ -37,7 +41,6 @@ import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; -import org.bukkit.block.BlockState; import org.bukkit.block.data.BlockData; import org.bukkit.command.PluginCommand; import org.bukkit.entity.Ageable; @@ -142,6 +145,7 @@ import java.util.Objects; import java.util.Optional; import java.util.Set; import java.util.UUID; +import java.util.function.Supplier; import java.util.regex.Pattern; /** @@ -1103,10 +1107,10 @@ import java.util.regex.Pattern; return; } if (!plot.isAdded(plotPlayer.getUUID())) { - Optional> destroy = plot.getFlag(Flags.BREAK); + Optional> destroy = plot.getFlag(Flags.BREAK); Block block = event.getBlock(); if (destroy.isPresent() && destroy.get() - .contains(PlotBlock.get(block.getType().name()))) { + .contains(BukkitAdapter.asBlockType(block.getType()))) { return; } if (Permissions @@ -1388,10 +1392,10 @@ import java.util.regex.Pattern; } PlotPlayer plotPlayer = BukkitUtil.getPlayer(player); if (!plot.isAdded(plotPlayer.getUUID())) { - Optional> destroy = plot.getFlag(Flags.BREAK); + Optional> destroy = plot.getFlag(Flags.BREAK); Block block = event.getBlock(); if (destroy.isPresent() && destroy.get() - .contains(PlotBlock.get(block.getType().name())) || Permissions + .contains(BukkitBlockUtil.get(block)) || Permissions .hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_DESTROY_OTHER)) { return; } @@ -1623,7 +1627,7 @@ import java.util.regex.Pattern; if (!PlotSquared.get().hasPlotArea(event.getWorld().getName())) { return; } - List blocks = event.getBlocks(); + List blocks = event.getBlocks(); if (blocks.isEmpty()) { return; } @@ -1737,7 +1741,7 @@ import java.util.regex.Pattern; } } Block block = player.getTargetBlock(null, 7); - BlockState state = block.getState(); + org.bukkit.block.BlockState state = block.getState(); if (state == null) { return; } @@ -1916,9 +1920,10 @@ import java.util.regex.Pattern; Block block = player.getTargetBlockExact(5, FluidCollisionMode.SOURCE_ONLY); if (block != null && block.getType() != Material.AIR) { Location location = BukkitUtil.getLocation(block.getLocation()); + Material finalType = type; if (!EventUtil.manager - .checkPlayerBlockEvent(pp, PlayerBlockEventType.SPAWN_MOB, location, - new BukkitLazyBlock(PlotBlock.get(type.toString())), true)) { + .checkPlayerBlockEvent(pp, PlayerBlockEventType.SPAWN_MOB, location, () -> BukkitAdapter.asBlockType( + finalType).getDefaultState(), true)) { event.setCancelled(true); event.setUseItemInHand(Event.Result.DENY); } @@ -1936,14 +1941,14 @@ import java.util.regex.Pattern; return; } PlayerBlockEventType eventType = null; - BukkitLazyBlock lb; + Supplier lb; Location location; Action action = event.getAction(); switch (action) { case PHYSICAL: { eventType = PlayerBlockEventType.TRIGGER_PHYSICAL; Block block = event.getClickedBlock(); - lb = new BukkitLazyBlock(block); + lb = BukkitBlockUtil.supply(block); location = BukkitUtil.getLocation(block.getLocation()); break; } @@ -2112,7 +2117,7 @@ import java.util.regex.Pattern; eventType = PlayerBlockEventType.INTERACT_BLOCK; } } - lb = new BukkitLazyBlock(PlotBlock.get(block.getType().toString())); + lb = BukkitBlockUtil.supply(block); if (eventType != null && (eventType != PlayerBlockEventType.INTERACT_BLOCK || !player.isSneaking())) { break; @@ -2131,7 +2136,7 @@ import java.util.regex.Pattern; type = offType; } // in the following, lb needs to have the material of the item in hand i.e. type - lb = new BukkitLazyBlock(PlotBlock.get(type.toString())); + lb = BukkitBlockUtil.supply(type); if (type.isBlock()) { location = BukkitUtil .getLocation(block.getRelative(event.getBlockFace()).getLocation()); @@ -2214,7 +2219,7 @@ import java.util.regex.Pattern; Block block = event.getClickedBlock(); location = BukkitUtil.getLocation(block.getLocation()); eventType = PlayerBlockEventType.BREAK_BLOCK; - lb = new BukkitLazyBlock(block); + lb = BukkitBlockUtil.supply(block); break; default: return; @@ -2473,7 +2478,7 @@ import java.util.regex.Pattern; Captions.PERMISSION_ADMIN_BUILD_UNOWNED); event.setCancelled(true); } else if (!plot.isAdded(pp.getUUID())) { - if (Flags.USE.contains(plot, PlotBlock.get(event.getBucket().name()))) { + if (Flags.USE.contains(plot, BukkitBlockUtil.get(block))) { return; } if (Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_BUILD_OTHER)) { @@ -2533,9 +2538,9 @@ import java.util.regex.Pattern; Captions.PERMISSION_ADMIN_BUILD_UNOWNED); event.setCancelled(true); } else if (!plot.isAdded(plotPlayer.getUUID())) { - Optional> use = plot.getFlag(Flags.USE); + Optional> use = plot.getFlag(Flags.USE); Block block = event.getBlockClicked(); - if (use.isPresent() && use.get().contains(PlotBlock.get(block.getType().name()))) { + if (use.isPresent() && use.get().contains(BukkitBlockUtil.get(block))) { return; } if (Permissions.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_BUILD_OTHER)) { @@ -3091,10 +3096,10 @@ import java.util.regex.Pattern; return; } } else if (!plot.isAdded(pp.getUUID())) { - Set place = plot.getFlag(Flags.PLACE, null); + Set place = plot.getFlag(Flags.PLACE, null); if (place != null) { Block block = event.getBlock(); - if (place.contains(PlotBlock.get(block.getType().name()))) { + if (place.contains(BukkitBlockUtil.get(block))) { return; } } diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlotPlusListener.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlotPlusListener.java index b103ed7de..a3a82441d 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlotPlusListener.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlotPlusListener.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.listeners; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.events.PlayerEnterPlotEvent; import com.github.intellectualsites.plotsquared.bukkit.events.PlayerLeavePlotEvent; import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/SingleWorldListener.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/SingleWorldListener.java index a53527fc9..47274c696 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/SingleWorldListener.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/SingleWorldListener.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.listeners; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.worlds.PlotAreaManager; import com.github.intellectualsites.plotsquared.plot.object.worlds.SinglePlotAreaManager; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/WorldEvents.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/WorldEvents.java index afa821975..243e72dcb 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/WorldEvents.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/WorldEvents.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.listeners; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.generator.BukkitPlotGenerator; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.generator.GeneratorWrapper; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitBlockUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitBlockUtil.java new file mode 100644 index 000000000..9c6672a49 --- /dev/null +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitBlockUtil.java @@ -0,0 +1,30 @@ +package com.github.intellectualsites.plotsquared.bukkit.object; + +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + +import com.github.intellectualsites.plotsquared.plot.object.LazyBlock; +import com.sk89q.worldedit.bukkit.BukkitAdapter; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockState; +import org.bukkit.Material; +import org.bukkit.block.Block; + +import java.util.function.Supplier; + +public class BukkitBlockUtil { + public static Supplier supply(Block block) { + return () -> BukkitAdapter.asBlockType(block.getType()).getDefaultState(); + } + + public static Supplier supply(Material type) { + return () -> BukkitAdapter.asBlockType(type).getDefaultState(); + } + + public static BlockState get(Block block) { + return get(block.getType()); + } + + public static BlockState get(Material material) { + return BukkitAdapter.asBlockType(material).getDefaultState(); + } +} diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitLazyBlock.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitLazyBlock.java deleted file mode 100644 index 0903e78d9..000000000 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitLazyBlock.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.github.intellectualsites.plotsquared.bukkit.object; - -import com.github.intellectualsites.plotsquared.plot.object.LazyBlock; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; -import com.github.intellectualsites.plotsquared.plot.object.StringPlotBlock; -import org.bukkit.block.Block; - -public class BukkitLazyBlock extends LazyBlock { - - private StringPlotBlock pb; - - public BukkitLazyBlock(Block block) { - this.pb = (StringPlotBlock) PlotBlock.get(block.getType().toString()); - } - - public BukkitLazyBlock(StringPlotBlock pb) { - this.pb = pb; - } - - public StringPlotBlock getPlotBlock() { - return this.pb; - } - - -} diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitOfflinePlayer.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitOfflinePlayer.java index 7c52a25de..b26182f3f 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitOfflinePlayer.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitOfflinePlayer.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.OfflinePlotPlayer; import org.bukkit.OfflinePlayer; import org.jetbrains.annotations.NotNull; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitPlayer.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitPlayer.java index 918a5ab3b..80b4fb9c5 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitPlayer.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitPlayer.java @@ -1,10 +1,13 @@ package com.github.intellectualsites.plotsquared.bukkit.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Location; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.bukkit.BukkitAdapter; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.util.EconHandler; import com.github.intellectualsites.plotsquared.plot.util.MathMan; @@ -12,6 +15,7 @@ import com.github.intellectualsites.plotsquared.plot.util.PlotGameMode; import com.github.intellectualsites.plotsquared.plot.util.PlotWeather; import com.github.intellectualsites.plotsquared.plot.util.StringMan; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; +import com.sk89q.worldedit.world.item.ItemType; import io.papermc.lib.PaperLib; import org.bukkit.GameMode; import org.bukkit.Material; @@ -277,8 +281,8 @@ public class BukkitPlayer extends PlotPlayer { this.player.setAllowFlight(fly); } - @Override public void playMusic(@NotNull final Location location, @NotNull final PlotBlock id) { - if (PlotBlock.isEverything(id) || id.isAir()) { + @Override public void playMusic(@NotNull final Location location, @NotNull final ItemType id) { + if (id.getBlockType().getMaterial().isAir()) { // Let's just stop all the discs because why not? for (final Sound sound : Arrays.stream(Sound.values()) .filter(sound -> sound.name().contains("DISC")).collect(Collectors.toList())) { @@ -288,7 +292,7 @@ public class BukkitPlayer extends PlotPlayer { } else { // this.player.playEffect(BukkitUtil.getLocation(location), Effect.RECORD_PLAY, id.to(Material.class)); this.player.playSound(BukkitUtil.getLocation(location), - Sound.valueOf(id.to(Material.class).name()), Float.MAX_VALUE, 1f); + Sound.valueOf(BukkitAdapter.adapt(id).name()), Float.MAX_VALUE, 1f); } } diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/AgeableStats.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/AgeableStats.java index 5769f0e46..b53edc5ea 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/AgeableStats.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/AgeableStats.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.object.entity; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + class AgeableStats { int age; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/ArmorStandStats.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/ArmorStandStats.java index 56b36e2bb..44ebdb8b6 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/ArmorStandStats.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/ArmorStandStats.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.object.entity; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + class ArmorStandStats { final float[] head = new float[3]; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/EntityBaseStats.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/EntityBaseStats.java index c36236a5d..94c93f1fb 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/EntityBaseStats.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/EntityBaseStats.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.object.entity; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + class EntityBaseStats { EntityWrapper passenger; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/EntityWrapper.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/EntityWrapper.java index d0b6f28b5..b0e34a99c 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/EntityWrapper.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/EntityWrapper.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.object.entity; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import lombok.Getter; import lombok.NonNull; import org.bukkit.Location; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/HorseStats.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/HorseStats.java index 7fd976258..86c10e868 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/HorseStats.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/HorseStats.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.object.entity; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import org.bukkit.entity.Horse; class HorseStats { diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/LivingEntityStats.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/LivingEntityStats.java index c702ffaa7..e6f8411f2 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/LivingEntityStats.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/LivingEntityStats.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.object.entity; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/ReplicatingEntityWrapper.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/ReplicatingEntityWrapper.java index a237bf96a..5e7b8f2d2 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/ReplicatingEntityWrapper.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/ReplicatingEntityWrapper.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.object.entity; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import org.bukkit.Art; import org.bukkit.DyeColor; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/TameableStats.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/TameableStats.java index f9e8ded36..4dfa1939b 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/TameableStats.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/TameableStats.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.object.entity; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import org.bukkit.entity.AnimalTamer; class TameableStats { diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/TeleportEntityWrapper.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/TeleportEntityWrapper.java index 7456ae10e..fcfbce2b8 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/TeleportEntityWrapper.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/TeleportEntityWrapper.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.object.entity; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.BukkitMain; import org.bukkit.Chunk; import org.bukkit.Location; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/schematic/StateWrapper.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/schematic/StateWrapper.java index 3d5c75edf..8f05a41f7 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/schematic/StateWrapper.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/schematic/StateWrapper.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.object.schematic; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; @@ -12,7 +14,6 @@ import com.sk89q.jnbt.Tag; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; -import org.bukkit.block.BlockState; import org.bukkit.block.Container; import org.bukkit.block.Sign; import org.bukkit.enchantments.Enchantment; @@ -28,10 +29,10 @@ import java.util.Map.Entry; public class StateWrapper { - public BlockState state = null; + public org.bukkit.block.BlockState state = null; public CompoundTag tag = null; - public StateWrapper(BlockState state) { + public StateWrapper(org.bukkit.block.BlockState state) { this.state = state; } @@ -156,7 +157,7 @@ public class StateWrapper { if (block == null) { return false; } - BlockState state = block.getState(); + org.bukkit.block.BlockState state = block.getState(); switch (tileid) { case "chest": case "beacon": diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitBlockRegistry.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitBlockRegistry.java deleted file mode 100644 index b5ac5f1fb..000000000 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitBlockRegistry.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.github.intellectualsites.plotsquared.bukkit.util; - -import com.github.intellectualsites.plotsquared.plot.object.BlockRegistry; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; -import lombok.NonNull; -import org.bukkit.Material; - -public class BukkitBlockRegistry extends BlockRegistry { - - public BukkitBlockRegistry(final Material... preInitializedItems) { - super(Material.class, preInitializedItems); - } - - @Override public PlotBlock getPlotBlock(@NonNull final Material item) { - return PlotBlock.get(item.name()); - } - -} diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChatManager.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChatManager.java index ef3af32d9..5f5f50ddd 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChatManager.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChatManager.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.chat.FancyMessage; import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChunkManager.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChunkManager.java index d768ac32b..c92bf2452 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChunkManager.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChunkManager.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.object.entity.EntityWrapper; import com.github.intellectualsites.plotsquared.bukkit.object.entity.ReplicatingEntityWrapper; import com.github.intellectualsites.plotsquared.plot.PlotSquared; @@ -8,7 +10,7 @@ import com.github.intellectualsites.plotsquared.plot.listener.WEExtent; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotLoc; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; @@ -369,7 +371,7 @@ public class BukkitChunkManager extends ChunkManager { if (id != null) { value.setBlock(x1, y, z1, id); } else { - value.setBlock(x1, y, z1, PlotBlock.get("air")); + value.setBlock(x1, y, z1, BlockUtil.get("air")); } } for (int y = Math.min(128, ids.length); diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitCommand.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitCommand.java index 190aa077a..49f6bf87a 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitCommand.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitCommand.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.commands.DebugUUID; import com.github.intellectualsites.plotsquared.plot.commands.MainCommand; import com.github.intellectualsites.plotsquared.plot.object.ConsolePlayer; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEconHandler.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEconHandler.java index a9978b76c..9dfb2c725 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEconHandler.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEconHandler.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.object.BukkitOfflinePlayer; import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.plot.object.OfflinePlotPlayer; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEventUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEventUtil.java index 25ca0e16e..8fb7a41db 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEventUtil.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEventUtil.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.events.PlayerClaimPlotEvent; import com.github.intellectualsites.plotsquared.bukkit.events.PlayerEnterPlotEvent; import com.github.intellectualsites.plotsquared.bukkit.events.PlayerLeavePlotEvent; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java index 2d0e2cfa2..063c1363b 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.generator.BukkitPlotGenerator; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Settings; @@ -8,10 +10,11 @@ import com.github.intellectualsites.plotsquared.plot.generator.HybridUtils; import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.bukkit.BukkitAdapter; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; -import com.github.intellectualsites.plotsquared.plot.object.StringPlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.MathMan; @@ -20,6 +23,8 @@ import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.expiry.PlotAnalysis; import com.sk89q.worldedit.world.block.BaseBlock; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.World; @@ -28,6 +33,7 @@ import org.bukkit.block.data.Directional; import org.bukkit.generator.ChunkGenerator; import java.util.HashSet; +import java.util.Set; public class BukkitHybridUtils extends HybridUtils { @@ -36,7 +42,7 @@ public class BukkitHybridUtils extends HybridUtils { // int diff, int variety, int vertices, int rotation, int height_sd /* * diff: compare to base by looping through all blocks - * variety: add to HashSet for each PlotBlock + * variety: add to HashSet for each BlockState * height_sd: loop over all blocks and get top block * * vertices: store air map and compare with neighbours @@ -71,8 +77,8 @@ public class BukkitHybridUtils extends HybridUtils { System.gc(); System.gc(); final BlockBucket[][][] oldBlocks = new BlockBucket[256][width][length]; - final PlotBlock[][][] newBlocks = new PlotBlock[256][width][length]; - final BlockBucket airBucket = BlockBucket.withSingle(StringPlotBlock.EVERYTHING); + final BlockState[][][] newBlocks = new BlockState[256][width][length]; + final BlockBucket airBucket = BlockBucket.withSingle(BlockTypes.AIR.getDefaultState()); PlotArea area = PlotSquared.get().getPlotArea(world, null); @@ -128,7 +134,7 @@ public class BukkitHybridUtils extends HybridUtils { for (int y = 0; y < blocks.length; y++) { if (blocks[y] != null) { result[(minY + y) >> 4][(((minY + y) & 0xF) << 8) | (z << 4) | x] = - BlockBucket.withSingle(PlotBlock.get(blocks[y])); + BlockBucket.withSingle(blocks[y].toImmutableState()); } } } @@ -183,45 +189,45 @@ public class BukkitHybridUtils extends HybridUtils { int i = 0; for (int x = 0; x < width; x++) { for (int z = 0; z < length; z++) { - HashSet types = new HashSet<>(); + Set types = new HashSet<>(); for (int y = 0; y < 256; y++) { BlockBucket old = oldBlocks[y][x][z]; try { if (old == null) { old = airBucket; } - PlotBlock now = newBlocks[y][x][z]; + BlockState now = newBlocks[y][x][z]; if (!old.getBlocks().contains(now)) { changes[i]++; } - if (now.isAir()) { + if (now.getBlockType().getMaterial().isAir()) { air[i]++; } else { // check vertices // modifications_adjacent if (x > 0 && z > 0 && y > 0 && x < width - 1 && z < length - 1 && y < 255) { - if (newBlocks[y - 1][x][z].isAir()) { + if (newBlocks[y - 1][x][z].getBlockType().getMaterial().isAir()) { faces[i]++; } - if (newBlocks[y][x - 1][z].isAir()) { + if (newBlocks[y][x - 1][z].getBlockType().getMaterial().isAir()) { faces[i]++; } - if (newBlocks[y][x][z - 1].isAir()) { + if (newBlocks[y][x][z - 1].getBlockType().getMaterial().isAir()) { faces[i]++; } - if (newBlocks[y + 1][x][z].isAir()) { + if (newBlocks[y + 1][x][z].getBlockType().getMaterial().isAir()) { faces[i]++; } - if (newBlocks[y][x + 1][z].isAir()) { + if (newBlocks[y][x + 1][z].getBlockType().getMaterial().isAir()) { faces[i]++; } - if (newBlocks[y][x][z + 1].isAir()) { + if (newBlocks[y][x][z + 1].getBlockType().getMaterial().isAir()) { faces[i]++; } } - Material material = now.to(Material.class); + Material material = BukkitAdapter.adapt(now.getBlockType()); if (material != null) { BlockData blockData = material.createBlockData(); if (blockData instanceof Directional) { @@ -230,7 +236,7 @@ public class BukkitHybridUtils extends HybridUtils { data[i]++; } } - types.add(now); + types.add(now.getBlockType()); } } catch (NullPointerException e) { e.printStackTrace(); @@ -303,7 +309,7 @@ public class BukkitHybridUtils extends HybridUtils { for (int z = minZ; z <= maxZ; z++) { int zz = cbz + z; for (int y = 0; y < 256; y++) { - PlotBlock block = queue.getBlock(xx, y, zz); + BlockState block = queue.getBlock(xx, y, zz); int xr = xb + x; int zr = zb + z; newBlocks[y][xr][zr] = block; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitInventoryUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitInventoryUtil.java index 2c66f8d3f..60408171b 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitInventoryUtil.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitInventoryUtil.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.plot.object.PlotInventory; import com.github.intellectualsites.plotsquared.plot.object.PlotItemStack; @@ -56,7 +58,7 @@ public class BukkitInventoryUtil extends InventoryUtil { if (item == null) { return null; } - ItemStack stack = new ItemStack(BukkitUtil.getMaterial(item.getPlotBlock()), item.amount); + ItemStack stack = new ItemStack(BukkitUtil.getMaterial(item.getBlockState()), item.amount); ItemMeta meta = null; if (item.name != null) { meta = stack.getItemMeta(); diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitLegacyMappings.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitLegacyMappings.java deleted file mode 100644 index c7d953ea7..000000000 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitLegacyMappings.java +++ /dev/null @@ -1,871 +0,0 @@ -package com.github.intellectualsites.plotsquared.bukkit.util; - -import com.github.intellectualsites.plotsquared.plot.PlotSquared; -import com.github.intellectualsites.plotsquared.plot.object.LegacyPlotBlock; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; -import com.github.intellectualsites.plotsquared.plot.object.StringPlotBlock; -import com.github.intellectualsites.plotsquared.plot.util.LegacyMappings; -import com.github.intellectualsites.plotsquared.plot.util.StringComparison; -import lombok.AccessLevel; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NonNull; -import lombok.RequiredArgsConstructor; -import lombok.ToString; -import org.bukkit.Bukkit; -import org.bukkit.Material; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * Borrowed from https://github.com/Phoenix616/IDConverter/blob/master/mappings/src/main/java/de/themoep/idconverter/IdMappings.java - * Original License: - *

- * Minecraft ID mappings Copyright (C) 2017 Max Lee (https://github.com/Phoenix616) - *

- * This program is free software: you can redistribute it and/or modify it under the terms of the - * GNU General Public License as published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - *

- * You should have received a copy of the GNU General Public License along with this program. If - * not, see . - */ -public final class BukkitLegacyMappings extends LegacyMappings { - - private static final LegacyBlock[] BLOCKS = - new LegacyBlock[] {new LegacyBlock(0, "air"), new LegacyBlock(1, "stone"), - new LegacyBlock(1, 1, "stone", "granite"), - new LegacyBlock(1, 2, "stone", "polished_granite"), - new LegacyBlock(1, 3, "stone", "diorite"), - new LegacyBlock(1, 4, "stone", "polished_diorite"), - new LegacyBlock(1, 5, "stone", "andesite"), - new LegacyBlock(1, 6, "stone", "polished_andesite"), - new LegacyBlock(2, "grass", "grass_block"), new LegacyBlock(3, "dirt"), - new LegacyBlock(3, 1, "dirt", "coarse_dirt"), new LegacyBlock(3, 2, "dirt", "podzol"), - new LegacyBlock(4, "cobblestone"), new LegacyBlock(5, "wood", "oak_planks"), - new LegacyBlock(5, 1, "wood", "spruce_planks"), - new LegacyBlock(5, 2, "wood", "birch_planks"), - new LegacyBlock(5, 3, "wood", "jungle_planks"), - new LegacyBlock(5, 4, "wood", "acacia_planks"), - new LegacyBlock(5, 5, "wood", "dark_oak_planks"), - new LegacyBlock(6, "sapling", "oak_sapling"), - new LegacyBlock(6, 1, "sapling", "spruce_sapling"), - new LegacyBlock(6, 2, "sapling", "birch_sapling"), - new LegacyBlock(6, 3, "sapling", "jungle_sapling"), - new LegacyBlock(6, 4, "sapling", "acacia_sapling"), - new LegacyBlock(6, 5, "sapling", "dark_oak_sapling"), new LegacyBlock(7, "bedrock"), - new LegacyBlock(8, "water", "flowing_water"), - new LegacyBlock(9, "stationary_water", "water"), - new LegacyBlock(10, "lava", "flowing_lava"), - new LegacyBlock(11, "stationary_lava", "lava"), new LegacyBlock(12, "sand"), - new LegacyBlock(12, 1, "sand", "red_sand"), new LegacyBlock(13, "gravel"), - new LegacyBlock(14, "gold_ore"), new LegacyBlock(15, "iron_ore"), - new LegacyBlock(16, "coal_ore"), new LegacyBlock(17, "log", "oak_log"), - new LegacyBlock(17, 1, "log", "oak_log"), new LegacyBlock(17, 2, "log", "spruce_log"), - new LegacyBlock(17, 3, "log", "birch_log"), new LegacyBlock(17, 4, "log", "jungle_log"), - new LegacyBlock(17, 5, "log", "oak_bark"), new LegacyBlock(17, 6, "log", "spruce_bark"), - new LegacyBlock(17, 7, "log", "birch_bark"), - new LegacyBlock(17, 8, "log", "jungle_bark"), - new LegacyBlock(18, "leaves", "oak_leaves"), - new LegacyBlock(18, 1, "leaves", "spruce_leaves"), - new LegacyBlock(18, 2, "leaves", "birch_leaves"), - new LegacyBlock(18, 3, "leaves", "jungle_leaves"), new LegacyBlock(19, "sponge"), - new LegacyBlock(19, 1, "sponge", "wet_sponge"), new LegacyBlock(20, "glass"), - new LegacyBlock(21, "lapis_ore"), new LegacyBlock(22, "lapis_block"), - new LegacyBlock(23, "dispenser"), new LegacyBlock(24, "sandstone"), - new LegacyBlock(24, 1, "sandstone", "chiseled_sandstone"), - new LegacyBlock(24, 2, "sandstone", "cut_sandstone"), new LegacyBlock(25, "note_block"), - new LegacyBlock(26, "bed_block"), new LegacyBlock(27, "powered_rail"), - new LegacyBlock(28, "detector_rail"), - new LegacyBlock(29, "piston_sticky_base", "sticky_piston"), - new LegacyBlock(30, "web", "cobweb"), new LegacyBlock(31, "long_grass", "dead_bush"), - new LegacyBlock(31, 1, "long_grass", "grass"), - new LegacyBlock(31, 2, "long_grass", "fern"), new LegacyBlock(32, "dead_bush"), - new LegacyBlock(33, "piston_base", "piston"), - new LegacyBlock(34, "piston_extension", "piston_head"), - new LegacyBlock(35, "wool", "white_wool"), - new LegacyBlock(35, 1, "wool", "orange_wool"), - new LegacyBlock(35, 2, "wool", "magenta_wool"), - new LegacyBlock(35, 3, "wool", "light_blue_wool"), - new LegacyBlock(35, 4, "wool", "yellow_wool"), - new LegacyBlock(35, 5, "wool", "lime_wool"), - new LegacyBlock(35, 6, "wool", "pink_wool"), - new LegacyBlock(35, 7, "wool", "gray_wool"), - new LegacyBlock(35, 8, "wool", "light_gray_wool"), - new LegacyBlock(35, 9, "wool", "cyan_wool"), - new LegacyBlock(35, 10, "wool", "purple_wool"), - new LegacyBlock(35, 11, "wool", "blue_wool"), - new LegacyBlock(35, 12, "wool", "brown_wool"), - new LegacyBlock(35, 13, "wool", "green_wool"), - new LegacyBlock(35, 14, "wool", "red_wool"), - new LegacyBlock(35, 15, "wool", "black_wool"), - new LegacyBlock(36, "piston_moving_piece", "moving_piston"), - new LegacyBlock(37, "yellow_flower", "dandelion"), - new LegacyBlock(38, "red_rose", "poppy"), - new LegacyBlock(38, 1, "red_rose", "blue_orchid"), - new LegacyBlock(38, 2, "red_rose", "allium"), - new LegacyBlock(38, 3, "red_rose", "azure_bluet"), - new LegacyBlock(38, 4, "red_rose", "red_tulip"), - new LegacyBlock(38, 5, "red_rose", "orange_tulip"), - new LegacyBlock(38, 6, "red_rose", "white_tulip"), - new LegacyBlock(38, 7, "red_rose", "pink_tulip"), - new LegacyBlock(38, 8, "red_rose", "oxeye_daisy"), - new LegacyBlock(39, "brown_mushroom"), new LegacyBlock(40, "red_mushroom"), - new LegacyBlock(41, "gold_block"), new LegacyBlock(42, "iron_block"), - new LegacyBlock(43, "double_step"), - new LegacyBlock(43, 6, "double_step", "smooth_quartz"), - new LegacyBlock(43, 8, "double_step", "smooth_stone"), - new LegacyBlock(43, 9, "double_step", "smooth_sandstone"), - new LegacyBlock(44, "step", "stone_slab", "smooth_stone_slab"), - new LegacyBlock(44, 1, "step", "sandstone_slab"), - new LegacyBlock(44, 2, "step", "petrified_oak_slab"), - new LegacyBlock(44, 3, "step", "cobblestone_slab"), - new LegacyBlock(44, 4, "step", "brick_slab"), - new LegacyBlock(44, 5, "step", "stone_brick_slab"), - new LegacyBlock(44, 6, "step", "nether_brick_slab"), - new LegacyBlock(44, 7, "step", "quartz_slab"), new LegacyBlock(45, "brick", "bricks"), - new LegacyBlock(46, "tnt"), new LegacyBlock(47, "bookshelf"), - new LegacyBlock(48, "mossy_cobblestone"), new LegacyBlock(49, "obsidian"), - new LegacyBlock(50, "torch"), new LegacyBlock(50, 1, "torch", "wall_torch"), - new LegacyBlock(50, 2, "torch", "wall_torch"), - new LegacyBlock(50, 3, "torch", "wall_torch"), - new LegacyBlock(50, 4, "torch", "wall_torch"), new LegacyBlock(50, 5, "torch"), - new LegacyBlock(51, "fire"), new LegacyBlock(52, "mob_spawner"), - new LegacyBlock(53, "wood_stairs", "oak_stairs"), new LegacyBlock(54, "chest", "chest"), - new LegacyBlock(55, "redstone_wire"), new LegacyBlock(56, "diamond_ore"), - new LegacyBlock(57, "diamond_block"), - new LegacyBlock(58, "workbench", "crafting_table"), - new LegacyBlock(59, "crops", "wheat"), new LegacyBlock(60, "soil", "farmland"), - new LegacyBlock(61, "furnace"), new LegacyBlock(62, "burning_furnace"), - new LegacyBlock(63, "sign_post", "sign", "oak_sign"), - new LegacyBlock(64, "wooden_door", "oak_door"), new LegacyBlock(65, "ladder"), - new LegacyBlock(66, "rails", "rail"), new LegacyBlock(67, "cobblestone_stairs"), - new LegacyBlock(68, "wall_sign", "wall_sign", "oak_wall_sign"), - new LegacyBlock(69, "lever"), - new LegacyBlock(70, "stone_plate", "stone_pressure_plate"), - new LegacyBlock(71, "iron_door_block", "iron_door"), - new LegacyBlock(72, "wood_plate", "oak_pressure_plate"), - new LegacyBlock(73, "redstone_ore"), new LegacyBlock(74, "glowing_redstone_ore"), - new LegacyBlock(75, "redstone_torch_off"), - new LegacyBlock(76, "redstone_torch_on", "redstone_torch"), - new LegacyBlock(76, 1, "redstone_torch_on", "redstone_wall_torch"), - new LegacyBlock(76, 2, "redstone_torch_on", "redstone_wall_torch"), - new LegacyBlock(76, 3, "redstone_torch_on", "redstone_wall_torch"), - new LegacyBlock(76, 4, "redstone_torch_on", "redstone_wall_torch"), - new LegacyBlock(76, 5, "redstone_torch_on", "redstone_torch"), - new LegacyBlock(77, "stone_button"), new LegacyBlock(78, "snow"), - new LegacyBlock(79, "ice"), new LegacyBlock(80, "snow_block"), - new LegacyBlock(81, "cactus"), new LegacyBlock(82, "clay"), - new LegacyBlock(83, "sugar_cane_block", "sugar_cane"), new LegacyBlock(84, "jukebox"), - new LegacyBlock(85, "fence", "oak_fence"), - new LegacyBlock(86, "pumpkin", "carved_pumpkin"), new LegacyBlock(87, "netherrack"), - new LegacyBlock(88, "soul_sand"), new LegacyBlock(89, "glowstone"), - new LegacyBlock(90, "portal"), new LegacyBlock(91, "jack_o_lantern"), - new LegacyBlock(92, "cake_block", "cake"), new LegacyBlock(93, "diode_block_off"), - new LegacyBlock(94, "diode_block_on", "repeater"), - new LegacyBlock(95, "stained_glass", "white_stained_glass"), - new LegacyBlock(95, 1, "stained_glass", "orange_stained_glass"), - new LegacyBlock(95, 2, "stained_glass", "magenta_stained_glass"), - new LegacyBlock(95, 3, "stained_glass", "light_blue_stained_glass"), - new LegacyBlock(95, 4, "stained_glass", "yellow_stained_glass"), - new LegacyBlock(95, 5, "stained_glass", "lime_stained_glass"), - new LegacyBlock(95, 6, "stained_glass", "pink_stained_glass"), - new LegacyBlock(95, 7, "stained_glass", "gray_stained_glass"), - new LegacyBlock(95, 8, "stained_glass", "light_gray_stained_glass"), - new LegacyBlock(95, 9, "stained_glass", "cyan_stained_glass"), - new LegacyBlock(95, 10, "stained_glass", "purple_stained_glass"), - new LegacyBlock(95, 11, "stained_glass", "blue_stained_glass"), - new LegacyBlock(95, 12, "stained_glass", "brown_stained_glass"), - new LegacyBlock(95, 13, "stained_glass", "green_stained_glass"), - new LegacyBlock(95, 14, "stained_glass", "red_stained_glass"), - new LegacyBlock(95, 15, "stained_glass", "black_stained_glass"), - new LegacyBlock(96, "trap_door", "oak_trapdoor"), - new LegacyBlock(97, "monster_eggs", "infested_stone"), - new LegacyBlock(97, 1, "monster_eggs", "infested_cobblestone"), - new LegacyBlock(97, 2, "monster_eggs", "infested_stone_bricks"), - new LegacyBlock(97, 3, "monster_eggs", "infested_mossy_stone_bricks"), - new LegacyBlock(97, 4, "monster_eggs", "infested_cracked_stone_bricks"), - new LegacyBlock(97, 5, "monster_eggs", "infested_chiseled_stone_bricks"), - new LegacyBlock(98, "smooth_brick", "stone_bricks"), - new LegacyBlock(98, 1, "smooth_brick", "mossy_stone_bricks"), - new LegacyBlock(98, 2, "smooth_brick", "cracked_stone_bricks"), - new LegacyBlock(98, 3, "smooth_brick", "chiseled_bricks"), - new LegacyBlock(99, "huge_mushroom_1", "brown_mushroom_block"), - new LegacyBlock(99, 1, "huge_mushroom_1"), new LegacyBlock(99, 2, "huge_mushroom_1"), - new LegacyBlock(99, 3, "huge_mushroom_1"), new LegacyBlock(99, 4, "huge_mushroom_1"), - new LegacyBlock(99, 5, "huge_mushroom_1"), new LegacyBlock(99, 6, "huge_mushroom_1"), - new LegacyBlock(99, 7, "huge_mushroom_1"), new LegacyBlock(99, 8, "huge_mushroom_1"), - new LegacyBlock(99, 9, "huge_mushroom_1"), - new LegacyBlock(99, 10, "huge_mushroom_1", "mushroom_stem"), - new LegacyBlock(99, 14, "huge_mushroom_1"), new LegacyBlock(99, 15, "huge_mushroom_1"), - new LegacyBlock(100, "huge_mushroom_2", "red_mushroom_block"), - new LegacyBlock(100, 1, "huge_mushroom_2"), new LegacyBlock(100, 2, "huge_mushroom_2"), - new LegacyBlock(100, 3, "huge_mushroom_2"), new LegacyBlock(100, 4, "huge_mushroom_2"), - new LegacyBlock(100, 5, "huge_mushroom_2"), new LegacyBlock(100, 6, "huge_mushroom_2"), - new LegacyBlock(100, 7, "huge_mushroom_2"), new LegacyBlock(100, 8, "huge_mushroom_2"), - new LegacyBlock(100, 9, "huge_mushroom_2"), - new LegacyBlock(100, 10, "huge_mushroom_2", "mushroom_stem"), - new LegacyBlock(100, 14, "huge_mushroom_2"), - new LegacyBlock(100, 15, "huge_mushroom_2"), - new LegacyBlock(101, "iron_fence", "iron_bars"), - new LegacyBlock(102, "thin_glass", "glass_pane"), new LegacyBlock(103, "melon_block"), - new LegacyBlock(104, "pumpkin_stem"), new LegacyBlock(105, "melon_stem"), - new LegacyBlock(106, "vine"), new LegacyBlock(107, "fence_gate", "oak_fence_gate"), - new LegacyBlock(108, "brick_stairs"), - new LegacyBlock(109, "smooth_stairs", "stone_brick_stairs"), - new LegacyBlock(110, "mycel", "mycelium"), - new LegacyBlock(111, "water_lily", "lily_pad"), - new LegacyBlock(112, "nether_brick", "nether_bricks"), - new LegacyBlock(113, "nether_fence", "nether_brick_fence"), - new LegacyBlock(114, "nether_brick_stairs"), - new LegacyBlock(115, "nether_warts", "nether_wart"), - new LegacyBlock(116, "enchantment_table", "enchanting_table"), - new LegacyBlock(117, "brewing_stand"), new LegacyBlock(118, "cauldron"), - new LegacyBlock(119, "ender_portal", "end_portal"), - new LegacyBlock(120, "ender_portal_frame", "end_portal_frame"), - new LegacyBlock(121, "ender_stone", "end_stone"), new LegacyBlock(122, "dragon_egg"), - new LegacyBlock(123, "redstone_lamp_off"), - new LegacyBlock(124, "redstone_lamp_on", "redstone_lamp"), - new LegacyBlock(125, "wood_double_step"), new LegacyBlock(125, 1, "wood_double_step"), - new LegacyBlock(125, 2, "wood_double_step"), - new LegacyBlock(125, 3, "wood_double_step"), - new LegacyBlock(125, 4, "wood_double_step"), - new LegacyBlock(125, 5, "wood_double_step"), - new LegacyBlock(126, "wood_step", "oak_slab"), - new LegacyBlock(126, 1, "wood_step", "spruce_slab"), - new LegacyBlock(126, 2, "wood_step", "birch_slab"), - new LegacyBlock(126, 3, "wood_step", "jungle_slab"), - new LegacyBlock(126, 4, "wood_step", "acacia_slab"), - new LegacyBlock(126, 5, "wood_step", "dark_oak_slab"), new LegacyBlock(127, "cocoa"), - new LegacyBlock(128, "sandstone_stairs"), new LegacyBlock(129, "emerald_ore"), - new LegacyBlock(130, "ender_chest"), new LegacyBlock(131, "tripwire_hook"), - new LegacyBlock(132, "tripwire"), new LegacyBlock(133, "emerald_block"), - new LegacyBlock(134, "spruce_wood_stairs", "spruce_stairs"), - new LegacyBlock(135, "birch_wood_stairs", "birch_stairs"), - new LegacyBlock(136, "jungle_wood_stairs", "jungle_stairs"), - new LegacyBlock(137, "command", "command_block"), new LegacyBlock(138, "beacon"), - new LegacyBlock(139, "cobble_wall", "cobblestone_wall"), - new LegacyBlock(139, 1, "cobble_wall", "mossy_cobblestone_wall"), - new LegacyBlock(140, "flower_pot"), new LegacyBlock(141, "carrot", "carrots"), - new LegacyBlock(142, "potato", "potatoes"), - new LegacyBlock(143, "wood_button", "oak_button"), - new LegacyBlock(144, "skull", "skeleton_skull"), - new LegacyBlock(144, 1, "skull", "skeleton_wall_skull"), - new LegacyBlock(144, 2, "skull", "skeleton_wall_skull"), - new LegacyBlock(144, 3, "skull", "skeleton_wall_skull"), - new LegacyBlock(144, 4, "skull", "skeleton_wall_skull"), - new LegacyBlock(144, 5, "skull", "skeleton_wall_skull"), new LegacyBlock(145, "anvil"), - new LegacyBlock(145, 1, "anvil", "chipped_anvil"), - new LegacyBlock(145, 2, "anvil", "damaged_anvil"), - new LegacyBlock(146, "trapped_chest"), - new LegacyBlock(147, "gold_plate", "light_weighted_pressure_plate"), - new LegacyBlock(148, "iron_plate", "heavy_weighted_pressure_plate"), - new LegacyBlock(149, "redstone_comparator_off"), - new LegacyBlock(150, "redstone_comparator_on", "comparator"), - new LegacyBlock(151, "daylight_detector"), new LegacyBlock(152, "redstone_block"), - new LegacyBlock(153, "quartz_ore", "nether_quartz_ore"), new LegacyBlock(154, "hopper"), - new LegacyBlock(155, "quartz_block"), new LegacyBlock(156, "quartz_stairs"), - new LegacyBlock(157, "activator_rail"), new LegacyBlock(158, "dropper"), - new LegacyBlock(159, "stained_clay", "white_terracotta"), - new LegacyBlock(159, 1, "stained_clay", "orange_terracotta"), - new LegacyBlock(159, 2, "stained_clay", "magenta_terracotta"), - new LegacyBlock(159, 3, "stained_clay", "light_blue_terracotta"), - new LegacyBlock(159, 4, "stained_clay", "yellow_terracotta"), - new LegacyBlock(159, 5, "stained_clay", "lime_terracotta"), - new LegacyBlock(159, 6, "stained_clay", "pink_terracotta"), - new LegacyBlock(159, 7, "stained_clay", "gray_terracotta"), - new LegacyBlock(159, 8, "stained_clay", "light_gray_terracotta"), - new LegacyBlock(159, 9, "stained_clay", "cyan_terracotta"), - new LegacyBlock(159, 10, "stained_clay", "purple_terracotta"), - new LegacyBlock(159, 11, "stained_clay", "blue_terracotta"), - new LegacyBlock(159, 12, "stained_clay", "brown_terracotta"), - new LegacyBlock(159, 13, "stained_clay", "green_terracotta"), - new LegacyBlock(159, 14, "stained_clay", "red_terracotta"), - new LegacyBlock(159, 15, "stained_clay", "black_terracotta"), - new LegacyBlock(160, "stained_glass_pane", "white_stained_glass_pane"), - new LegacyBlock(160, 1, "stained_glass_pane", "orange_stained_glass_pane"), - new LegacyBlock(160, 2, "stained_glass_pane", "magenta_stained_glass_pane"), - new LegacyBlock(160, 3, "stained_glass_pane", "light_blue_stained_glass_pane"), - new LegacyBlock(160, 4, "stained_glass_pane", "yellow_stained_glass_pane"), - new LegacyBlock(160, 5, "stained_glass_pane", "lime_stained_glass_pane"), - new LegacyBlock(160, 6, "stained_glass_pane", "pink_stained_glass_pane"), - new LegacyBlock(160, 7, "stained_glass_pane", "gray_stained_glass_pane"), - new LegacyBlock(160, 8, "stained_glass_pane", "light_gray_stained_glass_pane"), - new LegacyBlock(160, 9, "stained_glass_pane", "cyan_stained_glass_pane"), - new LegacyBlock(160, 10, "stained_glass_pane", "purple_stained_glass_pane"), - new LegacyBlock(160, 11, "stained_glass_pane", "blue_stained_glass_pane"), - new LegacyBlock(160, 12, "stained_glass_pane", "brown_stained_glass_pane"), - new LegacyBlock(160, 13, "stained_glass_pane", "green_stained_glass_pane"), - new LegacyBlock(160, 14, "stained_glass_pane", "red_stained_glass_pane"), - new LegacyBlock(160, 15, "stained_glass_pane", "black_stained_glass_pane"), - new LegacyBlock(161, "leaves_2", "acacia_leaves"), - new LegacyBlock(161, 1, "leaves_2", "dark_oak_leaves"), - new LegacyBlock(162, "log_2", "acacia_log"), - new LegacyBlock(162, 1, "log_2", "spruce_log"), - new LegacyBlock(162, 2, "log_2", "birch_log"), - new LegacyBlock(162, 3, "log_2", "jungle_log"), - new LegacyBlock(163, "acacia_stairs", "acacia_stairs"), - new LegacyBlock(164, "dark_oak_stairs", "dark_oak_stairs"), - new LegacyBlock(165, "slime_block", "slime_block"), - new LegacyBlock(166, "barrier", "barrier"), - new LegacyBlock(167, "iron_trapdoor", "iron_trapdoor"), - new LegacyBlock(168, "prismarine"), - new LegacyBlock(168, 1, "prismarine", "prismarine_bricks"), - new LegacyBlock(168, 2, "prismarine", "dark_prismarine"), - new LegacyBlock(169, "sea_lantern"), new LegacyBlock(170, "hay_block"), - new LegacyBlock(171, "carpet", "white_carpet"), - new LegacyBlock(171, 1, "carpet", "orange_carpet"), - new LegacyBlock(171, 2, "carpet", "magenta_carpet"), - new LegacyBlock(171, 3, "carpet", "light_blue_carpet"), - new LegacyBlock(171, 4, "carpet", "yellow_carpet"), - new LegacyBlock(171, 5, "carpet", "lime_carpet"), - new LegacyBlock(171, 6, "carpet", "pink_carpet"), - new LegacyBlock(171, 7, "carpet", "gray_carpet"), - new LegacyBlock(171, 8, "carpet", "light_gray_carpet"), - new LegacyBlock(171, 9, "carpet", "cyan_carpet"), - new LegacyBlock(171, 10, "carpet", "purple_carpet"), - new LegacyBlock(171, 11, "carpet", "blue_carpet"), - new LegacyBlock(171, 12, "carpet", "brown_carpet"), - new LegacyBlock(171, 13, "carpet", "green_carpet"), - new LegacyBlock(171, 14, "carpet", "red_carpet"), - new LegacyBlock(171, 15, "carpet", "black_carpet"), - new LegacyBlock(172, "hard_clay", "terracotta"), new LegacyBlock(173, "coal_block"), - new LegacyBlock(174, "packed_ice"), new LegacyBlock(175, "double_plant", "sunflower"), - new LegacyBlock(175, 1, "double_plant", "lilac"), - new LegacyBlock(175, 2, "double_plant", "tall_grass"), - new LegacyBlock(175, 3, "double_plant", "large_fern"), - new LegacyBlock(175, 4, "double_plant", "rose_bush"), - new LegacyBlock(175, 5, "double_plant", "peony"), - new LegacyBlock(176, "standing_banner"), new LegacyBlock(177, "wall_banner"), - new LegacyBlock(178, "daylight_detector_inverted"), - new LegacyBlock(179, "red_sandstone", "red_sandstone"), - new LegacyBlock(179, 1, "red_sandstone", "chiseled_red_sandstone"), - new LegacyBlock(179, 2, "red_sandstone", "cut_red_sandstone"), - new LegacyBlock(180, "red_sandstone_stairs"), - new LegacyBlock(181, "double_stone_slab2"), - new LegacyBlock(181, 8, "double_stone_slab2", "smooth_red_sandstone"), - new LegacyBlock(182, "stone_slab2", "red_sandstone_slab"), - new LegacyBlock(183, "spruce_fence_gate"), new LegacyBlock(184, "birch_fence_gate"), - new LegacyBlock(185, "jungle_fence_gate"), new LegacyBlock(186, "dark_oak_fence_gate"), - new LegacyBlock(187, "acacia_fence_gate"), new LegacyBlock(188, "spruce_fence"), - new LegacyBlock(189, "birch_fence"), new LegacyBlock(190, "jungle_fence"), - new LegacyBlock(191, "dark_oak_fence"), new LegacyBlock(192, "acacia_fence"), - new LegacyBlock(193, "spruce_door"), new LegacyBlock(194, "birch_door"), - new LegacyBlock(195, "jungle_door"), new LegacyBlock(196, "acacia_door"), - new LegacyBlock(197, "dark_oak_door"), new LegacyBlock(198, "end_rod"), - new LegacyBlock(199, "chorus_plant"), new LegacyBlock(200, "chorus_flower"), - new LegacyBlock(201, "purpur_block"), new LegacyBlock(202, "purpur_pillar"), - new LegacyBlock(203, "purpur_stairs"), new LegacyBlock(204, "purpur_double_slab"), - new LegacyBlock(205, "purpur_slab"), - new LegacyBlock(206, "end_bricks", "end_stone_bricks"), - new LegacyBlock(207, "beetroot_block", "beetroots"), new LegacyBlock(208, "grass_path"), - new LegacyBlock(209, "end_gateway"), - new LegacyBlock(210, "command_repeating", "repeating_command_block"), - new LegacyBlock(211, "command_chain", "chain_command_block"), - new LegacyBlock(212, "frosted_ice"), new LegacyBlock(213, "magma", "magma_block"), - new LegacyBlock(214, "nether_wart_block"), - new LegacyBlock(215, "red_nether_brick", "red_nether_bricks"), - new LegacyBlock(216, "bone_block"), new LegacyBlock(217, "structure_void"), - new LegacyBlock(218, "observer"), new LegacyBlock(219, "white_shulker_box"), - new LegacyBlock(220, "orange_shulker_box"), new LegacyBlock(221, "magenta_shulker_box"), - new LegacyBlock(222, "light_blue_shulker_box"), - new LegacyBlock(223, "yellow_shulker_box"), new LegacyBlock(224, "lime_shulker_box"), - new LegacyBlock(225, "pink_shulker_box"), new LegacyBlock(226, "gray_shulker_box"), - new LegacyBlock(227, "silver_shulker_box", "light_gray_shulker_box"), - new LegacyBlock(228, "cyan_shulker_box"), new LegacyBlock(229, "purple_shulker_box"), - new LegacyBlock(230, "blue_shulker_box"), new LegacyBlock(231, "brown_shulker_box"), - new LegacyBlock(232, "green_shulker_box"), new LegacyBlock(233, "red_shulker_box"), - new LegacyBlock(234, "black_shulker_box"), - new LegacyBlock(235, "white_glazed_terracotta"), - new LegacyBlock(236, "orange_glazed_terracotta"), - new LegacyBlock(237, "magenta_glazed_terracotta"), - new LegacyBlock(238, "light_blue_glazed_terracotta"), - new LegacyBlock(239, "yellow_glazed_terracotta"), - new LegacyBlock(240, "lime_glazed_terracotta"), - new LegacyBlock(241, "pink_glazed_terracotta"), - new LegacyBlock(242, "gray_glazed_terracotta"), - new LegacyBlock(243, "silver_glazed_terracotta", "light_gray_glazed_terracotta"), - new LegacyBlock(244, "cyan_glazed_terracotta"), - new LegacyBlock(245, "purple_glazed_terracotta"), - new LegacyBlock(246, "blue_glazed_terracotta"), - new LegacyBlock(247, "brown_glazed_terracotta"), - new LegacyBlock(248, "green_glazed_terracotta"), - new LegacyBlock(249, "red_glazed_terracotta"), - new LegacyBlock(250, "black_glazed_terracotta"), - new LegacyBlock(251, "concrete", "white_concrete"), - new LegacyBlock(251, 1, "concrete", "orange_concrete"), - new LegacyBlock(251, 2, "concrete", "magenta_concrete"), - new LegacyBlock(251, 3, "concrete", "light_blue_concrete"), - new LegacyBlock(251, 4, "concrete", "yellow_concrete"), - new LegacyBlock(251, 5, "concrete", "lime_concrete"), - new LegacyBlock(251, 6, "concrete", "pink_concrete"), - new LegacyBlock(251, 7, "concrete", "gray_concrete"), - new LegacyBlock(251, 8, "concrete", "light_gray_concrete"), - new LegacyBlock(251, 9, "concrete", "cyan_concrete"), - new LegacyBlock(251, 10, "concrete", "purple_concrete"), - new LegacyBlock(251, 11, "concrete", "blue_concrete"), - new LegacyBlock(251, 12, "concrete", "brown_concrete"), - new LegacyBlock(251, 13, "concrete", "green_concrete"), - new LegacyBlock(251, 14, "concrete", "red_concrete"), - new LegacyBlock(251, 15, "concrete", "black_concrete"), - new LegacyBlock(252, "concrete_powder", "white_concrete_powder"), - new LegacyBlock(252, 1, "concrete_powder", "orange_concrete_powder"), - new LegacyBlock(252, 2, "concrete_powder", "magenta_concrete_powder"), - new LegacyBlock(252, 3, "concrete_powder", "light_blue_concrete_powder"), - new LegacyBlock(252, 4, "concrete_powder", "yellow_concrete_powder"), - new LegacyBlock(252, 5, "concrete_powder", "lime_concrete_powder"), - new LegacyBlock(252, 6, "concrete_powder", "pink_concrete_powder"), - new LegacyBlock(252, 7, "concrete_powder", "gray_concrete_powder"), - new LegacyBlock(252, 8, "concrete_powder", "light_gray_concrete_powder"), - new LegacyBlock(252, 9, "concrete_powder", "cyan_concrete_powder"), - new LegacyBlock(252, 10, "concrete_powder", "purple_concrete_powder"), - new LegacyBlock(252, 11, "concrete_powder", "blue_concrete_powder"), - new LegacyBlock(252, 12, "concrete_powder", "brown_concrete_powder"), - new LegacyBlock(252, 13, "concrete_powder", "green_concrete_powder"), - new LegacyBlock(252, 14, "concrete_powder", "red_concrete_powder"), - new LegacyBlock(252, 15, "concrete_powder", "black_concrete_powder"), - new LegacyBlock(255, "structure_block"), - new LegacyBlock(256, "iron_spade", "iron_shovel"), new LegacyBlock(257, "iron_pickaxe"), - new LegacyBlock(258, "iron_axe"), new LegacyBlock(259, "flint_and_steel"), - new LegacyBlock(260, "apple"), new LegacyBlock(261, "bow"), - new LegacyBlock(262, "arrow"), new LegacyBlock(263, "coal"), - new LegacyBlock(263, 1, "coal", "charcoal"), new LegacyBlock(264, "diamond"), - new LegacyBlock(265, "iron_ingot"), new LegacyBlock(266, "gold_ingot"), - new LegacyBlock(267, "iron_sword"), new LegacyBlock(268, "wood_sword", "wooden_sword"), - new LegacyBlock(269, "wood_spade", "wooden_shovel"), - new LegacyBlock(270, "wood_pickaxe", "wooden_pickaxe"), - new LegacyBlock(271, "wood_axe", "wooden_axe"), new LegacyBlock(272, "stone_sword"), - new LegacyBlock(273, "stone_spade", "stone_shovel"), - new LegacyBlock(274, "stone_pickaxe"), new LegacyBlock(275, "stone_axe"), - new LegacyBlock(276, "diamond_sword"), - new LegacyBlock(277, "diamond_spade", "diamond_shovel"), - new LegacyBlock(278, "diamond_pickaxe"), new LegacyBlock(279, "diamond_axe"), - new LegacyBlock(280, "stick"), new LegacyBlock(281, "bowl"), - new LegacyBlock(282, "mushroom_soup", "mushroom_stew"), - new LegacyBlock(283, "gold_sword", "golden_sword"), - new LegacyBlock(284, "gold_spade", "golden_shovel"), - new LegacyBlock(285, "gold_pickaxe", "golden_pickaxe"), - new LegacyBlock(286, "gold_axe", "golden_axe"), new LegacyBlock(287, "string"), - new LegacyBlock(288, "feather"), new LegacyBlock(289, "sulphur", "gunpowder"), - new LegacyBlock(290, "wood_hoe", "wooden_hoe"), new LegacyBlock(291, "stone_hoe"), - new LegacyBlock(292, "iron_hoe"), new LegacyBlock(293, "diamond_hoe"), - new LegacyBlock(294, "gold_hoe", "golden_hoe"), - new LegacyBlock(295, "seeds", "wheat_seeds"), new LegacyBlock(296, "wheat"), - new LegacyBlock(297, "bread"), new LegacyBlock(298, "leather_helmet"), - new LegacyBlock(299, "leather_chestplate"), new LegacyBlock(300, "leather_leggings"), - new LegacyBlock(301, "leather_boots"), new LegacyBlock(302, "chainmail_helmet"), - new LegacyBlock(303, "chainmail_chestplate"), - new LegacyBlock(304, "chainmail_leggings"), new LegacyBlock(305, "chainmail_boots"), - new LegacyBlock(306, "iron_helmet"), new LegacyBlock(307, "iron_chestplate"), - new LegacyBlock(308, "iron_leggings"), new LegacyBlock(309, "iron_boots"), - new LegacyBlock(310, "diamond_helmet"), new LegacyBlock(311, "diamond_chestplate"), - new LegacyBlock(312, "diamond_leggings"), new LegacyBlock(313, "diamond_boots"), - new LegacyBlock(314, "gold_helmet", "golden_helmet"), - new LegacyBlock(315, "gold_chestplate", "golden_chestplate"), - new LegacyBlock(316, "gold_leggings", "golden_leggings"), - new LegacyBlock(317, "gold_boots", "golden_boots"), new LegacyBlock(318, "flint"), - new LegacyBlock(319, "pork", "porkchop"), - new LegacyBlock(320, "grilled_pork", "cooked_porkchop"), - new LegacyBlock(321, "painting"), new LegacyBlock(322, "golden_apple", "golden_apple"), - new LegacyBlock(322, 1, "golden_apple", "enchanted_golden_apple"), - new LegacyBlock(323, "sign"), new LegacyBlock(324, "wood_door", "oak_door"), - new LegacyBlock(325, "bucket"), new LegacyBlock(326, "water_bucket"), - new LegacyBlock(327, "lava_bucket"), new LegacyBlock(328, "minecart"), - new LegacyBlock(329, "saddle"), new LegacyBlock(330, "iron_door"), - new LegacyBlock(331, "redstone"), new LegacyBlock(332, "snow_ball", "snowball"), - new LegacyBlock(333, "boat", "oak_boat"), new LegacyBlock(334, "leather"), - new LegacyBlock(335, "milk_bucket"), new LegacyBlock(336, "clay_brick", "brick"), - new LegacyBlock(337, "clay_ball"), new LegacyBlock(338, "sugar_cane"), - new LegacyBlock(339, "paper"), new LegacyBlock(340, "book"), - new LegacyBlock(341, "slime_ball"), - new LegacyBlock(342, "storage_minecart", "chest_minecart"), - new LegacyBlock(343, "powered_minecart", "furnace_minecart"), - new LegacyBlock(344, "egg"), new LegacyBlock(345, "compass"), - new LegacyBlock(346, "fishing_rod"), new LegacyBlock(347, "watch", "clock"), - new LegacyBlock(348, "glowstone_dust"), new LegacyBlock(349, "raw_fish", "cod"), - new LegacyBlock(349, 1, "raw_fish", "salmon"), - new LegacyBlock(349, 2, "raw_fish", "tropical_fish"), - new LegacyBlock(349, 3, "raw_fish", "pufferfish"), - new LegacyBlock(350, "cooked_fish", "cooked_cod"), - new LegacyBlock(350, 1, "cooked_fish", "cooked_salmon"), - new LegacyBlock(351, "ink_sack", "ink_sac"), - new LegacyBlock(351, 1, "ink_sack", "rose_red"), - new LegacyBlock(351, 2, "ink_sack", "cactus_green"), - new LegacyBlock(351, 3, "ink_sack", "cocoa_beans"), - new LegacyBlock(351, 4, "ink_sack", "lapis_lazuli"), - new LegacyBlock(351, 5, "ink_sack", "purple_dye"), - new LegacyBlock(351, 6, "ink_sack", "cyan_dye"), - new LegacyBlock(351, 7, "ink_sack", "light_gray_dye"), - new LegacyBlock(351, 8, "ink_sack", "gray_dye"), - new LegacyBlock(351, 9, "ink_sack", "pink_dye"), - new LegacyBlock(351, 10, "ink_sack", "lime_dye"), - new LegacyBlock(351, 11, "ink_sack", "dandelion_yellow"), - new LegacyBlock(351, 12, "ink_sack", "light_blue_dye"), - new LegacyBlock(351, 13, "ink_sack", "magenta_dye"), - new LegacyBlock(351, 14, "ink_sack", "orange_dye"), - new LegacyBlock(351, 15, "ink_sack", "bone_meal"), new LegacyBlock(352, "bone"), - new LegacyBlock(353, "sugar", "sugar"), new LegacyBlock(354, "cake", "cake"), - new LegacyBlock(355, "bed", "white_bed"), new LegacyBlock(355, 1, "bed", "orange_bed"), - new LegacyBlock(355, 2, "bed", "magenta_bed"), - new LegacyBlock(355, 3, "bed", "light_blue_bed"), - new LegacyBlock(355, 4, "bed", "yellow_bed"), - new LegacyBlock(355, 5, "bed", "lime_bed"), new LegacyBlock(355, 6, "bed", "pink_bed"), - new LegacyBlock(355, 7, "bed", "gray_bed"), - new LegacyBlock(355, 8, "bed", "light_gray_bed"), - new LegacyBlock(355, 9, "bed", "cyan_bed"), - new LegacyBlock(355, 10, "bed", "purple_bed"), - new LegacyBlock(355, 11, "bed", "blue_bed"), - new LegacyBlock(355, 12, "bed", "brown_bed"), - new LegacyBlock(355, 13, "bed", "green_bed"), - new LegacyBlock(355, 14, "bed", "red_bed"), - new LegacyBlock(355, 15, "bed", "black_bed"), new LegacyBlock(356, "diode", "repeater"), - new LegacyBlock(357, "cookie", "cookie"), new LegacyBlock(358, "map"), - new LegacyBlock(359, "shears"), new LegacyBlock(360, "melon", "melon"), - new LegacyBlock(361, "pumpkin_seeds", "pumpkin_seeds"), - new LegacyBlock(362, "melon_seeds", "melon_seeds"), - new LegacyBlock(363, "raw_beef", "beef"), new LegacyBlock(364, "cooked_beef"), - new LegacyBlock(365, "raw_chicken", "chicken"), new LegacyBlock(366, "cooked_chicken"), - new LegacyBlock(367, "rotten_flesh"), new LegacyBlock(368, "ender_pearl"), - new LegacyBlock(369, "blaze_rod"), new LegacyBlock(370, "ghast_tear"), - new LegacyBlock(371, "gold_nugget"), - new LegacyBlock(372, "nether_stalk", "nether_wart"), - new LegacyBlock(373, "potion", "potion"), new LegacyBlock(374, "glass_bottle"), - new LegacyBlock(375, "spider_eye"), new LegacyBlock(376, "fermented_spider_eye"), - new LegacyBlock(377, "blaze_powder"), new LegacyBlock(378, "magma_cream"), - new LegacyBlock(379, "brewing_stand_item", "brewing_stand"), - new LegacyBlock(380, "cauldron_item", "cauldron"), - new LegacyBlock(381, "eye_of_ender", "ender_eye"), - new LegacyBlock(382, "speckled_melon"), new LegacyBlock(383, "monster_egg"), - new LegacyBlock(383, 4, "monster_egg", "elder_guardian_spawn_egg"), - new LegacyBlock(383, 5, "monster_egg", "wither_skeleton_spawn_egg"), - new LegacyBlock(383, 6, "monster_egg", "stray_spawn_egg"), - new LegacyBlock(383, 23, "monster_egg", "husk_spawn_egg"), - new LegacyBlock(383, 27, "monster_egg", "zombie_villager_spawn_egg"), - new LegacyBlock(383, 28, "monster_egg", "skeleton_horse_spawn_egg"), - new LegacyBlock(383, 29, "monster_egg", "zombie_horse_spawn_egg"), - new LegacyBlock(383, 31, "monster_egg", "donkey_spawn_egg"), - new LegacyBlock(383, 32, "monster_egg", "mule_spawn_egg"), - new LegacyBlock(383, 34, "monster_egg", "evocation_illager_spawn_egg"), - new LegacyBlock(383, 35, "monster_egg", "vex_spawn_egg"), - new LegacyBlock(383, 36, "monster_egg", "vindication_illager_spawn_egg"), - new LegacyBlock(383, 50, "monster_egg", "creeper_spawn_egg"), - new LegacyBlock(383, 51, "monster_egg", "skeleton_spawn_egg"), - new LegacyBlock(383, 52, "monster_egg", "spider_spawn_egg"), - new LegacyBlock(383, 54, "monster_egg", "zombie_spawn_egg"), - new LegacyBlock(383, 55, "monster_egg", "slime_spawn_egg"), - new LegacyBlock(383, 56, "monster_egg", "ghast_spawn_egg"), - new LegacyBlock(383, 57, "monster_egg", "zombie_pigman_spawn_egg"), - new LegacyBlock(383, 58, "monster_egg", "enderman_spawn_egg"), - new LegacyBlock(383, 59, "monster_egg", "cave_spider_spawn_egg"), - new LegacyBlock(383, 60, "monster_egg", "silverfish_spawn_egg"), - new LegacyBlock(383, 61, "monster_egg", "blaze_spawn_egg"), - new LegacyBlock(383, 62, "monster_egg", "magma_cube_spawn_egg"), - new LegacyBlock(383, 65, "monster_egg", "bat_spawn_egg"), - new LegacyBlock(383, 66, "monster_egg", "witch_spawn_egg"), - new LegacyBlock(383, 67, "monster_egg", "endermite_spawn_egg"), - new LegacyBlock(383, 68, "monster_egg", "guardian_spawn_egg"), - new LegacyBlock(383, 69, "monster_egg", "shulker_spawn_egg"), - new LegacyBlock(383, 90, "monster_egg", "pig_spawn_egg"), - new LegacyBlock(383, 91, "monster_egg", "sheep_spawn_egg"), - new LegacyBlock(383, 92, "monster_egg", "cow_spawn_egg"), - new LegacyBlock(383, 93, "monster_egg", "chicken_spawn_egg"), - new LegacyBlock(383, 94, "monster_egg", "squid_spawn_egg"), - new LegacyBlock(383, 95, "monster_egg", "wolf_spawn_egg"), - new LegacyBlock(383, 96, "monster_egg", "mooshroom_spawn_egg"), - new LegacyBlock(383, 98, "monster_egg", "ocelot_spawn_egg"), - new LegacyBlock(383, 100, "monster_egg", "horse_spawn_egg"), - new LegacyBlock(383, 101, "monster_egg", "rabbit_spawn_egg"), - new LegacyBlock(383, 102, "monster_egg", "polar_bear_spawn_egg"), - new LegacyBlock(383, 103, "monster_egg", "llama_spawn_egg"), - new LegacyBlock(383, 120, "monster_egg", "villager_spawn_egg"), - new LegacyBlock(384, "exp_bottle", "experience_bottle"), - new LegacyBlock(385, "fireball", "fire_charge"), - new LegacyBlock(386, "book_and_quill", "writable_book"), - new LegacyBlock(387, "written_book"), new LegacyBlock(388, "emerald"), - new LegacyBlock(389, "item_frame"), - new LegacyBlock(390, "flower_pot_item", "flower_pot"), - new LegacyBlock(391, "carrot_item", "carrot"), - new LegacyBlock(392, "potato_item", "potato"), new LegacyBlock(393, "baked_potato"), - new LegacyBlock(394, "poisonous_potato"), new LegacyBlock(395, "empty_map", "map"), - new LegacyBlock(396, "golden_carrot"), - new LegacyBlock(397, "skull_item", "skeleton_skull"), - new LegacyBlock(397, 1, "skull_item", "wither_skeleton_skull"), - new LegacyBlock(397, 2, "skull_item", "zombie_head"), - new LegacyBlock(397, 3, "skull_item", "player_head"), - new LegacyBlock(397, 4, "skull_item", "creeper_head"), - new LegacyBlock(397, 5, "skull_item", "dragon_head"), - new LegacyBlock(398, "carrot_stick"), new LegacyBlock(399, "nether_star"), - new LegacyBlock(400, "pumpkin_pie"), - new LegacyBlock(401, "firework", "firework_rocket"), - new LegacyBlock(402, "firework_charge", "firework_star"), - new LegacyBlock(403, "enchanted_book"), - new LegacyBlock(404, "redstone_comparator", "comparator"), - new LegacyBlock(405, "nether_brick_item", "nether_brick"), - new LegacyBlock(406, "quartz"), - new LegacyBlock(407, "explosive_minecart", "tnt_minecart"), - new LegacyBlock(408, "hopper_minecart"), new LegacyBlock(409, "prismarine_shard"), - new LegacyBlock(410, "prismarine_crystals"), new LegacyBlock(411, "rabbit"), - new LegacyBlock(412, "cooked_rabbit"), new LegacyBlock(413, "rabbit_stew"), - new LegacyBlock(414, "rabbit_foot"), new LegacyBlock(415, "rabbit_hide"), - new LegacyBlock(416, "armor_stand"), - new LegacyBlock(417, "iron_barding", "iron_horse_armor"), - new LegacyBlock(418, "gold_barding", "gold_horse_armor"), - new LegacyBlock(419, "diamond_barding", "diamond_horse_armor"), - new LegacyBlock(420, "leash", "lead"), new LegacyBlock(421, "name_tag"), - new LegacyBlock(422, "command_minecart", "command_block_minecart"), - new LegacyBlock(423, "mutton"), new LegacyBlock(424, "cooked_mutton"), - new LegacyBlock(425, "banner", "white_banner"), - new LegacyBlock(425, 1, "banner", "orange_banner"), - new LegacyBlock(425, 2, "banner", "magenta_banner"), - new LegacyBlock(425, 3, "banner", "light_blue_banner"), - new LegacyBlock(425, 4, "banner", "yellow_banner"), - new LegacyBlock(425, 5, "banner", "lime_banner"), - new LegacyBlock(425, 6, "banner", "pink_banner"), - new LegacyBlock(425, 7, "banner", "gray_banner"), - new LegacyBlock(425, 8, "banner", "light_gray_banner"), - new LegacyBlock(425, 9, "banner", "cyan_banner"), - new LegacyBlock(425, 10, "banner", "purple_banner"), - new LegacyBlock(425, 11, "banner", "blue_banner"), - new LegacyBlock(425, 12, "banner", "brown_banner"), - new LegacyBlock(425, 13, "banner", "green_banner"), - new LegacyBlock(425, 14, "banner", "red_banner"), - new LegacyBlock(425, 15, "banner", "black_banner"), new LegacyBlock(426, "end_crystal"), - new LegacyBlock(427, "spruce_door_item", "spruce_door"), - new LegacyBlock(428, "birch_door_item", "birch_door"), - new LegacyBlock(429, "jungle_door_item", "jungle_door"), - new LegacyBlock(430, "acacia_door_item", "acacia_door"), - new LegacyBlock(431, "dark_oak_door_item", "dark_oak_door"), - new LegacyBlock(432, "chorus_fruit"), new LegacyBlock(433, "chorus_fruit_popped"), - new LegacyBlock(434, "beetroot"), new LegacyBlock(435, "beetroot_seeds"), - new LegacyBlock(436, "beetroot_soup"), - new LegacyBlock(437, "dragons_breath", "dragon_breath"), - new LegacyBlock(438, "splash_potion"), new LegacyBlock(439, "spectral_arrow"), - new LegacyBlock(440, "tipped_arrow"), new LegacyBlock(441, "lingering_potion"), - new LegacyBlock(442, "shield"), new LegacyBlock(443, "elytra"), - new LegacyBlock(444, "boat_spruce", "spruce_boat"), - new LegacyBlock(445, "boat_birch", "birch_boat"), - new LegacyBlock(446, "boat_jungle", "jungle_boat"), - new LegacyBlock(447, "boat_acacia", "acacia_boat"), - new LegacyBlock(448, "boat_dark_oak", "dark_oak_boat"), - new LegacyBlock(449, "totem", "totem_of_undying"), - new LegacyBlock(450, "shulker_shell"), new LegacyBlock(452, "iron_nugget"), - new LegacyBlock(453, "knowledge_book"), - new LegacyBlock(2256, "gold_record", "music_disc_13"), - new LegacyBlock(2257, "green_record", "music_disc_cat"), - new LegacyBlock(2258, "record_3", "music_disc_blocks"), - new LegacyBlock(2259, "record_4", "music_disc_chirp"), - new LegacyBlock(2260, "record_5", "music_disc_far"), - new LegacyBlock(2261, "record_6", "music_disc_mall"), - new LegacyBlock(2262, "record_7", "music_disc_mellohi"), - new LegacyBlock(2263, "record_8", "music_disc_stal"), - new LegacyBlock(2264, "record_9", "music_disc_strad"), - new LegacyBlock(2265, "record_10", "music_disc_ward"), - new LegacyBlock(2266, "record_11", "music_disc_11"), - new LegacyBlock(2267, "record_12", "music_disc_wait")}; - - private static final Map LEGACY_ID_AND_DATA_TO_STRING_PLOT_BLOCK = - new HashMap<>(); - private static final Map NEW_STRING_TO_LEGACY_PLOT_BLOCK = new HashMap<>(); - private static final Map OLD_STRING_TO_STRING_PLOT_BLOCK = new HashMap<>(); - - @SuppressWarnings("deprecation") public BukkitLegacyMappings() { - this.addAll(Arrays.asList(BLOCKS)); - // Make sure to add new blocks as well - final List missing = new ArrayList<>(); - for (final Material material : Material.values()) { - final String materialName = material.name().toLowerCase(Locale.ENGLISH); - if (NEW_STRING_TO_LEGACY_PLOT_BLOCK.get(materialName) == null) { - try { - final LegacyBlock missingBlock = - new LegacyBlock(material.getId(), materialName, materialName); - missing.add(missingBlock); - } catch (Exception ignored) { - } - } - } - addAll(missing); - } - - private void addAll(@NonNull final Collection blocks) { - for (final LegacyBlock legacyBlock : blocks) { - LEGACY_ID_AND_DATA_TO_STRING_PLOT_BLOCK - .put(new IdDataPair(legacyBlock.getNumericalId(), legacyBlock.getDataValue()), - legacyBlock.toStringPlotBlock()); - NEW_STRING_TO_LEGACY_PLOT_BLOCK - .put(legacyBlock.getNewName(), legacyBlock.toLegacyPlotBlock()); - OLD_STRING_TO_STRING_PLOT_BLOCK - .put(legacyBlock.getLegacyName(), legacyBlock.toStringPlotBlock()); - Material material; - try { - material = Material.valueOf(legacyBlock.getNewName()); - } catch (final Exception e) { - try { - material = Material.getMaterial(legacyBlock.getLegacyName(), true); - } catch (NoSuchMethodError error) { - PlotSquared.log("You can't use this version of PlotSquared on a server " - + "less than Minecraft 1.13.2"); - Bukkit.shutdown(); - break; - } - } - legacyBlock.material = material; - } - } - - public Collection getPlotBlocks() { - return Arrays.stream(BLOCKS).map(block -> PlotBlock.get(block.getNewName())) - .collect(Collectors.toList()); - } - - public StringComparison.ComparisonResult getClosestsMatch( - @NonNull final String string) { - final StringComparison comparison = - new StringComparison<>(string, getPlotBlocks()); - return comparison.getBestMatchAdvanced(); - } - - /** - * Try to find a legacy plot block by any means possible. Strategy: - Check if the name contains - * a namespace, if so, strip it - Check if there's a (new) material matching the name - Check if - * there's a legacy material matching the name - Check if there's a numerical ID matching the - * name - Return null if everything else fails - * - * @param string String ID - * @return LegacyBlock if found, else null - */ - public PlotBlock fromAny(@NonNull final String string) { - if (string.isEmpty()) { - return StringPlotBlock.EVERYTHING; - } - String workingString = string; - String[] parts = null; - IdDataPair idDataPair = null; - if (string.contains(":")) { - parts = string.split(":"); - if (parts.length > 1) { - if (parts[0].equalsIgnoreCase("minecraft")) { - workingString = parts[1]; - } else { - if (parts[0].matches("^\\d+$")) { - idDataPair = - new IdDataPair(Integer.parseInt(parts[0]), Integer.parseInt(parts[0])); - } else { - workingString = parts[0]; - } - } - } - } else if (string.matches("^\\d+$")) { - idDataPair = new IdDataPair(Integer.parseInt(string), 0); - } - PlotBlock plotBlock; - if (Material.matchMaterial(workingString) != null) { - return PlotBlock.get(workingString); - } else if (NEW_STRING_TO_LEGACY_PLOT_BLOCK.containsKey(workingString.toLowerCase())) { - return PlotBlock.get(workingString); - } else if ((plotBlock = fromLegacyToString(idDataPair)) != null) { - return plotBlock; - } else if ((plotBlock = fromLegacyToString(workingString)) != null) { - return plotBlock; - } else { - try { - if (parts != null && parts.length > 1) { - final int id = Integer.parseInt(parts[0]); - final int data = Integer.parseInt(parts[1]); - return fromLegacyToString(id, data); - } else { - return fromLegacyToString(Integer.parseInt(workingString), 0); - } - } catch (final Throwable exception) { - return null; - } - } - } - - public PlotBlock fromLegacyToString(final int id, final int data) { - return LEGACY_ID_AND_DATA_TO_STRING_PLOT_BLOCK.get(new IdDataPair(id, data)); - } - - public PlotBlock fromLegacyToString(IdDataPair idDataPair) { - if (idDataPair == null) { - return null; - } - return LEGACY_ID_AND_DATA_TO_STRING_PLOT_BLOCK.get(idDataPair); - } - - public PlotBlock fromLegacyToString(final String id) { - return OLD_STRING_TO_STRING_PLOT_BLOCK.get(id); - } - - public PlotBlock fromStringToLegacy(final String id) { - return NEW_STRING_TO_LEGACY_PLOT_BLOCK.get(id.toLowerCase(Locale.ENGLISH)); - } - - @Getter @EqualsAndHashCode @ToString @RequiredArgsConstructor - private static final class IdDataPair { - private final int id; - private final int data; - } - - - @Getter @RequiredArgsConstructor(access = AccessLevel.PRIVATE) - public static final class LegacyBlock { - - private final int numericalId; - private final int dataValue; - private final String legacyName; - private final String newName; - - private Material material; - - LegacyBlock(final int numericalId, final int dataValue, @NonNull final String legacyName) { - this(numericalId, dataValue, legacyName, legacyName); - } - - LegacyBlock(final int numericalId, final int dataValue, @NonNull final String legacyName, - @NonNull final String newName, @NonNull final String new14Name) { - this(numericalId, dataValue, legacyName, - PlotSquared.get().IMP.getServerVersion()[1] == 13 ? newName : new14Name); - } - - LegacyBlock(final int numericalId, @NonNull final String legacyName, - @NonNull final String newName, @NonNull final String new14Name) { - this(numericalId, 0, legacyName, - Bukkit.getBukkitVersion().split("-")[0].split("\\.")[1].equals("13") ? - newName : - new14Name); - } - - LegacyBlock(final int numericalId, @NonNull final String legacyName, - @NonNull final String newName) { - this(numericalId, 0, legacyName, newName); - } - - LegacyBlock(final int numericalId, @NonNull final String legacyName) { - this(numericalId, legacyName, legacyName); - } - - PlotBlock toStringPlotBlock() { - return StringPlotBlock.get(newName); - } - - PlotBlock toLegacyPlotBlock() { - return LegacyPlotBlock.get(numericalId, dataValue); - } - - @Override public String toString() { - return this.newName; - } - } - -} diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSchematicHandler.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSchematicHandler.java index 3f980d37c..ad2233ed2 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSchematicHandler.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSchematicHandler.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.object.schematic.StateWrapper; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSetupUtils.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSetupUtils.java index 59be5f5e7..44c2e13d5 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSetupUtils.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSetupUtils.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.generator.BukkitPlotGenerator; import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.configuration.file.YamlConfiguration; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitTaskManager.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitTaskManager.java index 56448ff34..aaf9c787f 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitTaskManager.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitTaskManager.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.BukkitMain; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import org.bukkit.Bukkit; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java index 00bc7809f..d264cdc05 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java @@ -1,15 +1,16 @@ package com.github.intellectualsites.plotsquared.bukkit.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; -import com.github.intellectualsites.plotsquared.plot.object.LegacyPlotBlock; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.bukkit.BukkitAdapter; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; -import com.github.intellectualsites.plotsquared.plot.object.StringPlotBlock; import com.github.intellectualsites.plotsquared.plot.object.schematic.PlotItem; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.MathMan; @@ -25,7 +26,6 @@ import org.bukkit.World; import org.bukkit.block.Biome; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; -import org.bukkit.block.BlockState; import org.bukkit.block.Sign; import org.bukkit.block.data.Directional; import org.bukkit.block.data.type.WallSign; @@ -263,23 +263,11 @@ import java.util.Set; location.getPitch()); } - public static BukkitLegacyMappings getBukkitLegacyMappings() { - return (BukkitLegacyMappings) PlotSquared.imp().getLegacyMappings(); + public static Material getMaterial(@NonNull final BlockState plotBlock) { + return BukkitAdapter.adapt(plotBlock.getBlockType()); } - public static Material getMaterial(@NonNull final PlotBlock plotBlock) { - if (plotBlock instanceof StringPlotBlock) { - return Material - .getMaterial(((StringPlotBlock) plotBlock).getItemId().toUpperCase(Locale.ENGLISH)); - } else { - final LegacyPlotBlock legacyPlotBlock = (LegacyPlotBlock) plotBlock; - return getBukkitLegacyMappings() - .fromLegacyToString(legacyPlotBlock.getId(), legacyPlotBlock.getData()) - .to(Material.class); - } - } - - @Override public boolean isBlockSame(PlotBlock block1, PlotBlock block2) { + @Override public boolean isBlockSame(BlockState block1, BlockState block2) { if (block1.equals(block2)) { return true; } @@ -380,7 +368,7 @@ import java.util.Set; sign.setFacing(facing); block.setBlockData(sign, false); } - final BlockState blockstate = block.getState(); + final org.bukkit.block.BlockState blockstate = block.getState(); if (blockstate instanceof Sign) { final Sign sign = (Sign) blockstate; for (int i = 0; i < lines.length; i++) { @@ -408,13 +396,13 @@ import java.util.Set; public boolean addItems(@NonNull final String worldName, @NonNull final PlotItem items) { final World world = getWorld(worldName); final Block block = world.getBlockAt(items.x, items.y, items.z); - final BlockState state = block.getState(); + final org.bukkit.block.BlockState state = block.getState(); if (state instanceof InventoryHolder) { InventoryHolder holder = (InventoryHolder) state; Inventory inv = holder.getInventory(); for (int i = 0; i < items.types.length; i++) { // ItemStack item = new ItemStack(LegacyMappings.fromLegacyId(items.id[i]).getMaterial(), items.amount[i], items.data[i]); - ItemStack item = new ItemStack(items.types[i].to(Material.class), items.amount[i]); + ItemStack item = new ItemStack(BukkitAdapter.adapt(items.types[i]), items.amount[i]); inv.addItem(item); } state.update(true); @@ -423,33 +411,11 @@ import java.util.Set; return false; } - @Override public boolean isBlockSolid(@NonNull final PlotBlock block) { - try { - Material material = getMaterial(block); - if (material.isLegacy()) { - material = getBukkitLegacyMappings().fromLegacyToString(material.name()) - .to(Material.class); - } - if (material.isBlock() && material.isSolid() && !material.hasGravity()) { - String name = material.name().toLowerCase(Locale.ENGLISH); - if (material.isOccluding() || name.contains("stairs") || name.contains("slab") - || name.contains("wool")) { - switch (material) { - case NOTE_BLOCK: - case SPAWNER: - return false; - default: - return true; - } - } - } - return false; - } catch (Exception ignored) { - return false; - } + @Override public boolean isBlockSolid(@NonNull final BlockState block) { + return block.getBlockType().getMaterial().isSolid(); } - @Override public String getClosestMatchingName(@NonNull final PlotBlock block) { + @Override public String getClosestMatchingName(@NonNull final BlockState block) { try { return getMaterial(block).name(); } catch (Exception ignored) { @@ -458,12 +424,9 @@ import java.util.Set; } @Override @Nullable - public StringComparison.ComparisonResult getClosestBlock(String name) { - final PlotBlock plotBlock = BukkitUtil.getBukkitLegacyMappings().fromAny(name); - if (plotBlock != null) { - return new StringComparison().new ComparisonResult(1, plotBlock); - } - return BukkitUtil.getBukkitLegacyMappings().getClosestsMatch(name); + public StringComparison.ComparisonResult getClosestBlock(String name) { + BlockState state = BlockUtil.get(name); + return new StringComparison().new ComparisonResult(1, state); } @Override @@ -482,10 +445,10 @@ import java.util.Set; return new BukkitWorld(Bukkit.getWorld(world)); } - @Override public PlotBlock getBlock(@NonNull final Location location) { + @Override public BlockState getBlock(@NonNull final Location location) { final World world = getWorld(location.getWorld()); final Block block = world.getBlockAt(location.getX(), location.getY(), location.getZ()); - return PlotBlock.get(block.getType().name()); + return BlockUtil.get(block.getType().name()); } @Override public String getMainWorld() { diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitVersion.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitVersion.java index 8bfa3da59..a073aa23d 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitVersion.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitVersion.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public class BukkitVersion { public static int[] v1_13_2 = {1, 13, 2}; public static int[] v1_13_1 = {1, 13, 1}; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/Metrics.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/Metrics.java index e3870d940..45b6568d9 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/Metrics.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/Metrics.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import org.bukkit.Bukkit; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.Player; @@ -48,6 +50,7 @@ public class Metrics { new byte[]{'o', 'r', 'g', '.', 'b', 's', 't', 'a', 't', 's', '.', 'b', 'u', 'k', 'k', 'i', 't'}); final String examplePackage = new String(new byte[]{'y', 'o', 'u', 'r', '.', 'p', 'a', 'c', 'k', 'a', 'g', 'e'}); // We want to make sure nobody just copy & pastes the example and use the wrong package names + if (Metrics.class.getPackage().getName().equals(defaultPackage) || Metrics.class.getPackage().getName().equals(examplePackage)) { throw new IllegalStateException("bStats Metrics class has not been relocated correctly!"); } diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/NbtFactory.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/NbtFactory.java index 10407f5ec..35030fa6a 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/NbtFactory.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/NbtFactory.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.google.common.base.Splitter; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/OfflinePlayerUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/OfflinePlayerUtil.java index a4ee94f80..7a2d53b27 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/OfflinePlayerUtil.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/OfflinePlayerUtil.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; import org.bukkit.entity.Entity; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SendChunk.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SendChunk.java index 8b5e89b27..0b8683cc8 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SendChunk.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SendChunk.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.Location; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SetGenCB.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SetGenCB.java index 45814d639..17b046ec9 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SetGenCB.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SetGenCB.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.generator.BukkitAugmentedGenerator; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.generator.GeneratorWrapper; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/BukkitLocalQueue.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/BukkitLocalQueue.java index e7d05eedc..687626ad0 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/BukkitLocalQueue.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/BukkitLocalQueue.java @@ -1,10 +1,11 @@ package com.github.intellectualsites.plotsquared.bukkit.util.block; +import com.github.intellectualsites.plotsquared.bukkit.object.BukkitBlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.object.schematic.StateWrapper; import com.github.intellectualsites.plotsquared.plot.PlotSquared; -import com.github.intellectualsites.plotsquared.plot.object.LegacyPlotBlock; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; -import com.github.intellectualsites.plotsquared.plot.object.StringPlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.block.BasicLocalBlockQueue; import com.sk89q.jnbt.CompoundTag; @@ -19,7 +20,6 @@ import org.bukkit.block.Biome; import org.bukkit.block.Block; import org.bukkit.block.data.BlockData; -import java.util.Locale; import java.util.concurrent.ExecutionException; public class BukkitLocalQueue extends BasicLocalBlockQueue { @@ -38,13 +38,13 @@ public class BukkitLocalQueue extends BasicLocalBlockQueue { } - @Override public PlotBlock getBlock(int x, int y, int z) { + @Override public BlockState getBlock(int x, int y, int z) { World worldObj = Bukkit.getWorld(getWorld()); if (worldObj != null) { Block block = worldObj.getBlockAt(x, y, z); - return PlotBlock.get(block.getType().toString()); + return BukkitBlockUtil.get(block); } else { - return PlotBlock.get(0, 0); + return BlockUtil.get(0, 0); } } @@ -95,7 +95,7 @@ public class BukkitLocalQueue extends BasicLocalBlockQueue { BlockData blockData = BukkitAdapter.adapt(block); Block existing = chunk.getBlock(x, y, z); - if (equals(PlotBlock.get(block), existing) && existing + if (BukkitBlockUtil.get(existing).equals(block) && existing .getBlockData().matches(blockData)) { continue; } @@ -116,38 +116,13 @@ public class BukkitLocalQueue extends BasicLocalBlockQueue { }); } - private void setMaterial(@NonNull final PlotBlock plotBlock, @NonNull final Block block) { - final Material material; - if (plotBlock instanceof StringPlotBlock) { - material = Material - .getMaterial(((StringPlotBlock) plotBlock).getItemId().toUpperCase(Locale.ENGLISH)); - if (material == null) { - throw new IllegalStateException(String - .format("Could not find material that matches %s", - ((StringPlotBlock) plotBlock).getItemId())); - } - } else { - final LegacyPlotBlock legacyPlotBlock = (LegacyPlotBlock) plotBlock; - material = PlotSquared.get().IMP.getLegacyMappings() - .fromLegacyToString(legacyPlotBlock.getId(), legacyPlotBlock.getData()) - .to(Material.class); - if (material == null) { - throw new IllegalStateException(String - .format("Could not find material that matches %s", legacyPlotBlock.toString())); - } - } + private void setMaterial(@NonNull final BlockState plotBlock, @NonNull final Block block) { + Material material = BukkitAdapter.adapt(plotBlock.getBlockType()); block.setType(material, false); } - private boolean equals(@NonNull final PlotBlock plotBlock, @NonNull final Block block) { - if (plotBlock instanceof StringPlotBlock) { - return ((StringPlotBlock) plotBlock).idEquals(block.getType().name()); - } - final LegacyPlotBlock legacyPlotBlock = (LegacyPlotBlock) plotBlock; - return Material.getMaterial(PlotSquared.get().IMP.getLegacyMappings() - .fromLegacyToString(((LegacyPlotBlock) plotBlock).id, - ((LegacyPlotBlock) plotBlock).data).toString()) == block.getType() && ( - legacyPlotBlock.id == 0 || legacyPlotBlock.data == block.getData()); + private boolean equals(@NonNull final BlockState plotBlock, @NonNull final Block block) { + return plotBlock.equals(BukkitBlockUtil.get(block)); } public void setBiomes(LocalChunk lc) { diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/GenChunk.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/GenChunk.java index fc2bc3574..41d04222c 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/GenChunk.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/GenChunk.java @@ -1,9 +1,12 @@ package com.github.intellectualsites.plotsquared.bukkit.util.block; +import com.github.intellectualsites.plotsquared.bukkit.object.BukkitBlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; import com.github.intellectualsites.plotsquared.plot.object.ChunkWrapper; import com.github.intellectualsites.plotsquared.plot.object.Location; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; import com.sk89q.worldedit.bukkit.BukkitAdapter; @@ -22,7 +25,7 @@ import java.util.Arrays; public class GenChunk extends ScopedLocalBlockQueue { public final Biome[] biomes; - public PlotBlock[][] result; + public BlockState[][] result; public BiomeGrid biomeGrid; public Chunk chunk; public String world; @@ -68,14 +71,14 @@ public class GenChunk extends ScopedLocalBlockQueue { } } - @Override public void setCuboid(Location pos1, Location pos2, PlotBlock block) { + @Override public void setCuboid(Location pos1, Location pos2, BlockState block) { if (result != null && pos1.getX() == 0 && pos1.getZ() == 0 && pos2.getX() == 15 && pos2.getZ() == 15) { for (int y = pos1.getY(); y <= pos2.getY(); y++) { int layer = y >> 4; - PlotBlock[] data = result[layer]; + BlockState[] data = result[layer]; if (data == null) { - result[layer] = data = new PlotBlock[4096]; + result[layer] = data = new BlockState[4096]; } int start = y << 8; int end = start + 256; @@ -88,8 +91,7 @@ public class GenChunk extends ScopedLocalBlockQueue { int maxX = Math.max(pos1.getX(), pos2.getX()); int maxY = Math.max(pos1.getY(), pos2.getY()); int maxZ = Math.max(pos1.getZ(), pos2.getZ()); - chunkData - .setRegion(minX, minY, minZ, maxX + 1, maxY + 1, maxZ + 1, block.to(Material.class)); + chunkData.setRegion(minX, minY, minZ, maxX + 1, maxY + 1, maxZ + 1, BukkitAdapter.adapt(block)); } @Override public boolean setBiome(int x, int z, String biome) { @@ -104,21 +106,21 @@ public class GenChunk extends ScopedLocalBlockQueue { return false; } - @Override public boolean setBlock(int x, int y, int z, PlotBlock id) { + @Override public boolean setBlock(int x, int y, int z, BlockState id) { if (this.result == null) { - this.chunkData.setBlock(x, y, z, id.to(Material.class)); + this.chunkData.setBlock(x, y, z, BukkitAdapter.adapt(id)); return true; } - this.chunkData.setBlock(x, y, z, id.to(Material.class)); + this.chunkData.setBlock(x, y, z, BukkitAdapter.adapt(id)); this.storeCache(x, y, z, id); return true; } - private void storeCache(final int x, final int y, final int z, final PlotBlock id) { + private void storeCache(final int x, final int y, final int z, final BlockState id) { int i = MainUtil.CACHE_I[y][x][z]; - PlotBlock[] v = this.result[i]; + BlockState[] v = this.result[i]; if (v == null) { - this.result[i] = v = new PlotBlock[4096]; + this.result[i] = v = new BlockState[4096]; } int j = MainUtil.CACHE_J[y][x][z]; v[j] = id; @@ -130,18 +132,18 @@ public class GenChunk extends ScopedLocalBlockQueue { return true; } this.chunkData.setBlock(x, y, z, BukkitAdapter.adapt(id)); - this.storeCache(x, y, z, PlotBlock.get(id.getBlockType().getId())); + this.storeCache(x, y, z, BlockUtil.get(id.getBlockType().getId())); return true; } - @Override public PlotBlock getBlock(int x, int y, int z) { + @Override public BlockState getBlock(int x, int y, int z) { int i = MainUtil.CACHE_I[y][x][z]; if (result == null) { - return PlotBlock.get(chunkData.getType(x, y, z)); + return BukkitBlockUtil.get(chunkData.getType(x, y, z)); } - PlotBlock[] array = result[i]; + BlockState[] array = result[i]; if (array == null) { - return PlotBlock.get(""); + return BlockUtil.get(""); } int j = MainUtil.CACHE_J[y][x][z]; return array[j]; @@ -171,9 +173,9 @@ public class GenChunk extends ScopedLocalBlockQueue { GenChunk toReturn = new GenChunk(); if (this.result != null) { for (int i = 0; i < this.result.length; i++) { - PlotBlock[] matrix = this.result[i]; + BlockState[] matrix = this.result[i]; if (matrix != null) { - toReturn.result[i] = new PlotBlock[matrix.length]; + toReturn.result[i] = new BlockState[matrix.length]; System.arraycopy(matrix, 0, toReturn.result[i], 0, matrix.length); } } diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/DatFileFilter.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/DatFileFilter.java index 2fb0892a7..2be775fb3 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/DatFileFilter.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/DatFileFilter.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.uuid; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.io.File; import java.io.FilenameFilter; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/DefaultUUIDWrapper.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/DefaultUUIDWrapper.java index 40d902f8e..04cdea922 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/DefaultUUIDWrapper.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/DefaultUUIDWrapper.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.uuid; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.object.BukkitOfflinePlayer; import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.plot.object.OfflinePlotPlayer; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/FileUUIDHandler.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/FileUUIDHandler.java index 440aca318..351668cb5 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/FileUUIDHandler.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/FileUUIDHandler.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.uuid; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.util.NbtFactory; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/LowerOfflineUUIDWrapper.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/LowerOfflineUUIDWrapper.java index 3f33387b9..41129644e 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/LowerOfflineUUIDWrapper.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/LowerOfflineUUIDWrapper.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.uuid; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.OfflinePlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.google.common.base.Charsets; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/OfflineUUIDWrapper.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/OfflineUUIDWrapper.java index 306f67e4e..74f067cc9 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/OfflineUUIDWrapper.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/OfflineUUIDWrapper.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.uuid; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.bukkit.object.BukkitOfflinePlayer; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.OfflinePlotPlayer; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/SQLUUIDHandler.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/SQLUUIDHandler.java index 4c74be5b6..434bd8760 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/SQLUUIDHandler.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/SQLUUIDHandler.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.uuid; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/api/PlotAPI.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/api/PlotAPI.java index 610362953..adb7235cf 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/api/PlotAPI.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/api/PlotAPI.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.api; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.configuration.file.YamlConfiguration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Argument.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Argument.java index 7ae1985ce..f50397294 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Argument.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Argument.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.PlotId; public abstract class Argument { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Command.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Command.java index 691daa93e..6472310fd 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Command.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Command.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.configuration.file.YamlConfiguration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.commands.CommandCategory; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/CommandCaller.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/CommandCaller.java index 3b5ee295e..eca768ecc 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/CommandCaller.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/CommandCaller.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.commands.RequiredType; public interface CommandCaller { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/CommandDeclaration.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/CommandDeclaration.java index 851a03174..6377796fc 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/CommandDeclaration.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/CommandDeclaration.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.commands.CommandCategory; import com.github.intellectualsites.plotsquared.plot.commands.RequiredType; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/Configuration.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/Configuration.java index c2b4b4d95..be132d9d3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/Configuration.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/Configuration.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.configuration; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.util.Map; /** diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/ConfigurationOptions.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/ConfigurationOptions.java index 81c96196d..808f942c9 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/ConfigurationOptions.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/ConfigurationOptions.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.configuration; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + /** * Various settings for controlling the input and output of a {@link * Configuration}. diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/ConfigurationSection.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/ConfigurationSection.java index 0752dfb57..6579332c8 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/ConfigurationSection.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/ConfigurationSection.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.configuration; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.util.List; import java.util.Map; import java.util.Set; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/InvalidConfigurationException.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/InvalidConfigurationException.java index e9c099ed1..81377a83e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/InvalidConfigurationException.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/InvalidConfigurationException.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.configuration; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + /** * Exception thrown when attempting to load an invalid {@link Configuration}. */ diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemoryConfiguration.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemoryConfiguration.java index 20131cbe1..0dbb112a6 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemoryConfiguration.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemoryConfiguration.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.configuration; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.util.Map; /** diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemoryConfigurationOptions.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemoryConfigurationOptions.java index 22f9d751b..89b99ffb3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemoryConfigurationOptions.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemoryConfigurationOptions.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.configuration; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + /** * Various settings for controlling the input and output of a {@link * MemoryConfiguration}. diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemorySection.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemorySection.java index 14233b758..68ef0f660 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemorySection.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemorySection.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.configuration; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.LinkedHashSet; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/FileConfiguration.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/FileConfiguration.java index e8123cfc9..686347a17 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/FileConfiguration.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/FileConfiguration.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.configuration.file; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.configuration.Configuration; import com.github.intellectualsites.plotsquared.configuration.InvalidConfigurationException; import com.github.intellectualsites.plotsquared.configuration.MemoryConfiguration; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/FileConfigurationOptions.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/FileConfigurationOptions.java index 6eb99bb6e..fe1e19ce2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/FileConfigurationOptions.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/FileConfigurationOptions.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.configuration.file; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.configuration.Configuration; import com.github.intellectualsites.plotsquared.configuration.MemoryConfiguration; import com.github.intellectualsites.plotsquared.configuration.MemoryConfigurationOptions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConfiguration.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConfiguration.java index d8c41c3da..7388ecd53 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConfiguration.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConfiguration.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.configuration.file; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.configuration.Configuration; import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.configuration.InvalidConfigurationException; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConfigurationOptions.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConfigurationOptions.java index a7e71cdaf..b0dfae09d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConfigurationOptions.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConfigurationOptions.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.configuration.file; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + /** * Various settings for controlling the input and output of a {@link * YamlConfiguration}. diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConstructor.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConstructor.java index 1f52f7abb..b0e288250 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConstructor.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConstructor.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.configuration.file; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.configuration.serialization.ConfigurationSerialization; import org.yaml.snakeyaml.constructor.SafeConstructor; import org.yaml.snakeyaml.error.YAMLException; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlRepresenter.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlRepresenter.java index ebe1aebee..99263c761 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlRepresenter.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlRepresenter.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.configuration.file; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.configuration.serialization.ConfigurationSerializable; import com.github.intellectualsites.plotsquared.configuration.serialization.ConfigurationSerialization; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/ConfigurationSerializable.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/ConfigurationSerializable.java index f83e7a468..415f162d9 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/ConfigurationSerializable.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/ConfigurationSerializable.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.configuration.serialization; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.util.Map; /** diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/ConfigurationSerialization.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/ConfigurationSerialization.java index cb1abd54a..9f0374354 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/ConfigurationSerialization.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/ConfigurationSerialization.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.configuration.serialization; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.configuration.Configuration; import java.lang.reflect.Constructor; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/DelegateDeserialization.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/DelegateDeserialization.java index 8a071cb2e..7267d5c2d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/DelegateDeserialization.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/DelegateDeserialization.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.configuration.serialization; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/SerializableAs.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/SerializableAs.java index 79b50998c..c88a9c277 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/SerializableAs.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/SerializableAs.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.configuration.serialization; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONArray.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONArray.java index 62ee01329..cb4d5f99f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONArray.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONArray.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.json; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.io.IOException; import java.io.StringWriter; import java.io.Writer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONException.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONException.java index 67de10815..690dd78b2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONException.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONException.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.json; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + /** * The JSONException is thrown by the JSON.org classes when things are amiss. * diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONObject.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONObject.java index 965e95644..dc4d37bac 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONObject.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONObject.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.json; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.io.IOException; import java.io.StringWriter; import java.io.Writer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONString.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONString.java index 019776e58..116091822 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONString.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONString.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.json; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + /** * The JSONString interface allows a toJSONString() method so that a class can change the * behavior of JSONObject.toString(), JSONArray.toString(), and diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONTokener.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONTokener.java index 195ceeb5d..673202d3b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONTokener.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONTokener.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.json; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/Property.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/Property.java index 7ace1989b..50faeb1c6 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/Property.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/Property.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.json; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.util.Enumeration; import java.util.Iterator; import java.util.Properties; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/XML.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/XML.java index 51a0cdb10..65ce81e65 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/XML.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/XML.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.json; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.util.Iterator; /** diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/XMLTokener.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/XMLTokener.java index 96d65541f..84ee565f4 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/XMLTokener.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/XMLTokener.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.json; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.util.HashMap; /** diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java index fb62a61ce..77f36bb41 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java @@ -4,14 +4,12 @@ import com.github.intellectualsites.plotsquared.plot.generator.GeneratorWrapper; import com.github.intellectualsites.plotsquared.plot.generator.HybridUtils; import com.github.intellectualsites.plotsquared.plot.generator.IndependentPlotGenerator; import com.github.intellectualsites.plotsquared.plot.logger.ILogger; -import com.github.intellectualsites.plotsquared.plot.object.BlockRegistry; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.util.ChatManager; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; import com.github.intellectualsites.plotsquared.plot.util.EconHandler; import com.github.intellectualsites.plotsquared.plot.util.EventUtil; import com.github.intellectualsites.plotsquared.plot.util.InventoryUtil; -import com.github.intellectualsites.plotsquared.plot.util.LegacyMappings; import com.github.intellectualsites.plotsquared.plot.util.SchematicHandler; import com.github.intellectualsites.plotsquared.plot.util.SetupUtils; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; @@ -89,8 +87,12 @@ public interface IPlotMain extends ILogger { /** * Gets the NMS package prefix. + +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; * * @return The NMS package prefix + +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; */ String getNMSPackage(); @@ -246,9 +248,4 @@ public interface IPlotMain extends ILogger { @NotNull IndependentPlotGenerator getDefaultGenerator(); List getPluginIds(); - - BlockRegistry getBlockRegistry(); - - LegacyMappings getLegacyMappings(); - } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/Platform.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/Platform.java index 1736edf6f..0278e90b6 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/Platform.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/Platform.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public enum Platform { Bukkit, Sponge, Spigot, Paper diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java index d6c7b437c..88c9009a8 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.configuration.MemorySection; import com.github.intellectualsites.plotsquared.configuration.file.YamlConfiguration; @@ -24,7 +26,7 @@ import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotCluster; import com.github.intellectualsites.plotsquared.plot.object.PlotFilter; import com.github.intellectualsites.plotsquared.plot.object.PlotId; @@ -154,7 +156,7 @@ import java.util.zip.ZipInputStream; // // Register configuration serializable classes // - ConfigurationSerialization.registerClass(PlotBlock.class, "PlotBlock"); +// ConfigurationSerialization.registerClass(BlockState.class, "BlockState"); ConfigurationSerialization.registerClass(BlockBucket.class, "BlockBucket"); try { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotVersion.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotVersion.java index 4646a787a..13cd48798 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotVersion.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotVersion.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public class PlotVersion { public final int year, month, day, hash, build; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Add.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Add.java index d92dd4ea3..c51dbb1e7 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Add.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Add.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Alias.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Alias.java index 401446243..8250c4d20 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Alias.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Alias.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java index 0f39ebe94..a01145e72 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java index bf0a221b8..45a6fae1c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Biome.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Biome.java index 8b9ecb790..1a18c5150 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Biome.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Biome.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Buy.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Buy.java index dbfd37768..343c7d96b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Buy.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Buy.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Chat.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Chat.java index c2a3daf84..b8fca9445 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Chat.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Chat.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Claim.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Claim.java index aba59ad05..a691ff4b3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Claim.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Claim.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Clear.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Clear.java index 9dcd475a1..fe3a45a8c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Clear.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Clear.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Cluster.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Cluster.java index 088273c9c..d0bc4127f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Cluster.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Cluster.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/CommandCategory.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/CommandCategory.java index 3958f2d39..fc910e50a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/CommandCategory.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/CommandCategory.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Captions; import lombok.RequiredArgsConstructor; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Comment.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Comment.java index 171a5bfe5..4ddd2b302 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Comment.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Comment.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Location; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Condense.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Condense.java index a9341f373..c00065f20 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Condense.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Condense.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Confirm.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Confirm.java index 75a4709b8..4d9473387 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Confirm.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Confirm.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Continue.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Continue.java index 961742c1b..9261ef796 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Continue.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Continue.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Copy.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Copy.java index de77513bc..9ca4816f9 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Copy.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Copy.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Location; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/CreateRoadSchematic.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/CreateRoadSchematic.java index 14fa6347e..52d00568d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/CreateRoadSchematic.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/CreateRoadSchematic.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.generator.HybridPlotWorld; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Database.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Database.java index abbddc9ca..13e957a08 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Database.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Database.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Debug.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Debug.java index c1970f969..fe86acaaa 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Debug.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Debug.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugAllowUnsafe.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugAllowUnsafe.java index 8413eae22..f827a5ffa 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugAllowUnsafe.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugAllowUnsafe.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugClaimTest.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugClaimTest.java index 411a3290b..7876177b5 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugClaimTest.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugClaimTest.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugExec.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugExec.java index 6d5894616..82dc57b24 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugExec.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugExec.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; @@ -15,7 +17,7 @@ import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.OfflinePlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.PlotMessage; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; @@ -124,7 +126,7 @@ import java.util.concurrent.CompletableFuture; // Classes this.scope.put("Location", Location.class); - this.scope.put("PlotBlock", PlotBlock.class); + this.scope.put("BlockState", BlockState.class); this.scope.put("Plot", Plot.class); this.scope.put("PlotId", PlotId.class); this.scope.put("Runnable", Runnable.class); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugFixFlags.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugFixFlags.java index ca848a6bb..946abaf82 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugFixFlags.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugFixFlags.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Argument; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugImportWorlds.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugImportWorlds.java index 978c95e34..1d72d34a6 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugImportWorlds.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugImportWorlds.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugLoadTest.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugLoadTest.java index f12ce8d1e..adfd640b9 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugLoadTest.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugLoadTest.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugPaste.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugPaste.java index 9ea6d7bdd..522f11b8f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugPaste.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugPaste.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugRoadRegen.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugRoadRegen.java index a268f8903..33559079c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugRoadRegen.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugRoadRegen.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.generator.HybridPlotManager; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugSaveTest.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugSaveTest.java index 0c544d096..698e7099a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugSaveTest.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugSaveTest.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Delete.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Delete.java index 72c6da126..adf8491e5 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Delete.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Delete.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Deny.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Deny.java index 5ddfde305..dc9dec874 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Deny.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Deny.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Argument; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Desc.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Desc.java index d3b261ba8..2ef572d73 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Desc.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Desc.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.flag.FlagManager; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Dislike.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Dislike.java index 372231481..315a9fea8 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Dislike.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Dislike.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Done.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Done.java index 055cfabd9..282ab8331 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Done.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Done.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Download.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Download.java index 776cff0f8..fbbffdf2d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Download.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Download.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCmd.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCmd.java index 746ddfe98..a0d1598b3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCmd.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCmd.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; @@ -10,10 +12,10 @@ import com.github.intellectualsites.plotsquared.plot.flag.FlagManager; import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.flag.IntegerFlag; import com.github.intellectualsites.plotsquared.plot.flag.ListFlag; -import com.github.intellectualsites.plotsquared.plot.flag.PlotBlockListFlag; +import com.github.intellectualsites.plotsquared.plot.flag.BlockStateListFlag; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.MathMan; @@ -21,6 +23,7 @@ import com.github.intellectualsites.plotsquared.plot.util.Permissions; import com.github.intellectualsites.plotsquared.plot.util.PlotWeather; import com.github.intellectualsites.plotsquared.plot.util.StringComparison; import com.github.intellectualsites.plotsquared.plot.util.StringMan; +import com.sk89q.worldedit.world.block.BlockType; import java.util.ArrayList; import java.util.Arrays; @@ -32,6 +35,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.Set; @CommandDeclaration(command = "setflag", aliases = {"f", "flag", "setflag"}, usage = "/plot flag ", description = "Set plot flags", category = CommandCategory.SETTINGS, requiredType = RequiredType.NONE, permission = "plots.flag") @@ -61,12 +65,12 @@ public class FlagCmd extends SubCommand { } catch (NumberFormatException ignore) { } - } else if (flag instanceof PlotBlockListFlag) { - final PlotBlockListFlag blockListFlag = (PlotBlockListFlag) flag; - final HashSet parsedBlocks = blockListFlag.parseValue(value); - for (final PlotBlock block : parsedBlocks) { + } else if (flag instanceof BlockStateListFlag) { + final BlockStateListFlag blockListFlag = (BlockStateListFlag) flag; + Set parsedBlocks = blockListFlag.parseValue(value); + for (final BlockType block : parsedBlocks) { final String permission = Captions.PERMISSION_SET_FLAG_KEY_VALUE - .f(key.toLowerCase(), block.getRawId().toString().toLowerCase()); + .f(key.toLowerCase(), block.toString().toLowerCase()); final boolean result = Permissions.hasPermission(player, permission); if (!result) { MainUtil.sendMessage(player, Captions.NO_PERMISSION, diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/GenerateDocs.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/GenerateDocs.java index 7a1d2cddc..92cb8da1a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/GenerateDocs.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/GenerateDocs.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.util.StringMan; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Grant.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Grant.java index 60ecbeab0..289badf46 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Grant.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Grant.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Help.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Help.java index 7949df513..5ffd80e45 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Help.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Help.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandCaller; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Inbox.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Inbox.java index 030ef0f44..9cbdde212 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Inbox.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Inbox.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Info.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Info.java index fe42e5dd4..5182f86d4 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Info.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Info.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Kick.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Kick.java index eb36f8e67..5899da372 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Kick.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Kick.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Argument; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Leave.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Leave.java index b51993326..a07330424 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Leave.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Leave.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Like.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Like.java index 378da26c2..30e84f3bd 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Like.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Like.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/ListCmd.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/ListCmd.java index 2b70e48e5..537e4bd1a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/ListCmd.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/ListCmd.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.PlotSquared.SortType; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Load.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Load.java index 4b0305969..65fc58fc3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Load.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Load.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/MainCommand.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/MainCommand.java index dd060c88e..4ebb48b83 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/MainCommand.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/MainCommand.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandCaller; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Merge.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Merge.java index 43204b266..c8d9ae379 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Merge.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Merge.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Middle.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Middle.java index f3acaf5a0..3a9bd453c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Middle.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Middle.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Location; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Move.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Move.java index 02c7494cb..4026bb1e3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Move.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Move.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Music.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Music.java index a763a3c51..fb077e811 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Music.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Music.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.flag.Flags; @@ -8,6 +10,7 @@ import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotInventory; import com.github.intellectualsites.plotsquared.plot.object.PlotItemStack; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.sk89q.worldedit.world.item.ItemTypes; import java.util.Arrays; import java.util.Collection; @@ -39,11 +42,11 @@ import java.util.Locale; if (item == null) { return true; } - if (item.getPlotBlock().equalsAny(7, "bedrock")) { + if (item.getType() == ItemTypes.BEDROCK) { plot.removeFlag(Flags.MUSIC); Captions.FLAG_REMOVED.send(player); } else if (item.name.toLowerCase(Locale.ENGLISH).contains("disc")) { - plot.setFlag(Flags.MUSIC, item.getPlotBlock().getRawId()); + plot.setFlag(Flags.MUSIC, item); Captions.FLAG_ADDED.send(player); } else { Captions.FLAG_NOT_ADDED.send(player); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Near.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Near.java index d897fb3cf..25e83c4bd 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Near.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Near.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Owner.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Owner.java index 55dbdbda4..daa0ae30e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Owner.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Owner.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/PluginCmd.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/PluginCmd.java index 8e31051fb..f0b0b0fa4 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/PluginCmd.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/PluginCmd.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.json.JSONObject; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Purge.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Purge.java index 0825b9610..99d104071 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Purge.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Purge.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Rate.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Rate.java index f81f02719..884c23f16 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Rate.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Rate.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RegenAllRoads.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RegenAllRoads.java index e47cb610f..76a641095 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RegenAllRoads.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RegenAllRoads.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Relight.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Relight.java index cc5c8c21a..a84ee8584 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Relight.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Relight.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Reload.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Reload.java index db900e91e..777ea37d9 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Reload.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Reload.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.configuration.MemorySection; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Remove.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Remove.java index 038355d83..147405038 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Remove.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Remove.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Argument; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RequiredType.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RequiredType.java index 2dc75f919..5329ae2e2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RequiredType.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RequiredType.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandCaller; public enum RequiredType { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Save.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Save.java index d000f55e2..a348bf461 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Save.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Save.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SchematicCmd.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SchematicCmd.java index 130f2ad1d..d389924f4 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SchematicCmd.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SchematicCmd.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Set.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Set.java index 582dfb38a..ae25ccaa5 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Set.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Set.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; @@ -10,7 +12,7 @@ import com.github.intellectualsites.plotsquared.plot.flag.FlagManager; import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.Plot; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotManager; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; @@ -60,7 +62,7 @@ import java.util.stream.IntStream; Captions.PERMISSION_SET_COMPONENT.f(component)); return false; } - // PlotBlock[] blocks; + // BlockState[] blocks; BlockBucket bucket; try { if (args.length < 2) { @@ -73,7 +75,7 @@ import java.util.stream.IntStream; } catch (final UnknownBlockException unknownBlockException) { final String unknownBlock = unknownBlockException.getUnknownValue(); Captions.NOT_VALID_BLOCK.send(player, unknownBlock); - StringComparison.ComparisonResult match = + StringComparison.ComparisonResult match = WorldUtil.IMP.getClosestBlock(unknownBlock); if (match != null) { final String found = @@ -87,8 +89,8 @@ import java.util.stream.IntStream; } if (!allowUnsafe) { - for (final PlotBlock block : bucket.getBlocks()) { - if (!block.isAir() && !WorldUtil.IMP.isBlockSolid(block)) { + for (final BlockState block : bucket.getBlocks()) { + if (!block.getBlockType().getMaterial().isAir() && !WorldUtil.IMP.isBlockSolid(block)) { Captions.NOT_ALLOWED_BLOCK.send(player, block.toString()); return false; } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetCommand.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetCommand.java index 8b746c624..d4b12fa7a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetCommand.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetCommand.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetHome.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetHome.java index 4b742ad94..3359fe060 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetHome.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetHome.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.BlockLoc; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java index 82190f1b2..4ea9f7411 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SubCommand.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SubCommand.java index 458442ff2..7c58f0f3d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SubCommand.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SubCommand.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Argument; import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Swap.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Swap.java index b3ec2ff05..2a9f0529e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Swap.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Swap.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Location; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Target.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Target.java index 4dd37bdb0..03a3cf3d3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Target.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Target.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Argument; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Template.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Template.java index 85a0fe633..14385ff1d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Template.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Template.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.configuration.InvalidConfigurationException; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Toggle.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Toggle.java index 87411f1c6..8ae7c5e40 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Toggle.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Toggle.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trim.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trim.java index 000aa9b56..4f1740821 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trim.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trim.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trust.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trust.java index c0cd3309e..d357ed435 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trust.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trust.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Unlink.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Unlink.java index 66682ccda..8e4bd39b3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Unlink.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Unlink.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Location; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java index e2b7fa382..0f5c5f45b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/WE_Anywhere.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/WE_Anywhere.java index 36744cc44..add8d4540 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/WE_Anywhere.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/WE_Anywhere.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.commands; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java index c319303b6..3a7613dd1 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.config; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandCaller; import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.configuration.file.YamlConfiguration; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Config.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Config.java index 7234743cf..177715d39 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Config.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Config.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.config; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.configuration.MemorySection; import com.github.intellectualsites.plotsquared.configuration.file.YamlConfiguration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java index 3d636e0dd..ea2f6f538 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java @@ -1,7 +1,9 @@ package com.github.intellectualsites.plotsquared.plot.config; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.util.StringComparison; import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; import lombok.Getter; @@ -76,11 +78,11 @@ public class Configuration { } else { block = part; } - final StringComparison.ComparisonResult value = + final StringComparison.ComparisonResult value = WorldUtil.IMP.getClosestBlock(block); if (value == null) { throw new UnknownBlockException(block); - } else if (Settings.Enabled_Components.PREVENT_UNSAFE && !value.best.isAir() + } else if (Settings.Enabled_Components.PREVENT_UNSAFE && !value.best.getBlockType().getMaterial().isAir() && !WorldUtil.IMP.isBlockSolid(value.best)) { throw new UnsafeBlockException(value.best); } @@ -110,11 +112,11 @@ public class Configuration { } else { block = part; } - StringComparison.ComparisonResult value = + StringComparison.ComparisonResult value = WorldUtil.IMP.getClosestBlock(block); if (value == null || value.match > 1) { return false; - } else if (Settings.Enabled_Components.PREVENT_UNSAFE && !value.best.isAir() + } else if (Settings.Enabled_Components.PREVENT_UNSAFE && !value.best.getBlockType().getMaterial().isAir() && !WorldUtil.IMP.isBlockSolid(value.best)) { throw new UnsafeBlockException(value.best); } @@ -162,9 +164,9 @@ public class Configuration { public static final class UnsafeBlockException extends IllegalArgumentException { - @Getter private final PlotBlock unsafeBlock; + @Getter private final BlockState unsafeBlock; - UnsafeBlockException(@NonNull final PlotBlock unsafeBlock) { + UnsafeBlockException(@NonNull final BlockState unsafeBlock) { super(String.format("%s is not a valid block", unsafeBlock)); this.unsafeBlock = unsafeBlock; } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/ConfigurationNode.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/ConfigurationNode.java index 31539d5c2..05127f68d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/ConfigurationNode.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/ConfigurationNode.java @@ -1,7 +1,9 @@ package com.github.intellectualsites.plotsquared.plot.config; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.util.StringMan; import java.util.ArrayList; @@ -66,7 +68,7 @@ public class ConfigurationNode { if (this.value instanceof BlockBucket) { return this.value.toString(); } - if (this.value instanceof PlotBlock) { + if (this.value instanceof BlockState) { return this.value.toString(); } return this.value; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java index b1e239c78..8b2e4398d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.config; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.configuration.file.YamlConfiguration; import java.io.File; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Storage.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Storage.java index 962e0468f..59385e623 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Storage.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Storage.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.config; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.io.File; import java.util.ArrayList; import java.util.Collections; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDB.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDB.java index 5beef2aab..81565c4e2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDB.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDB.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.database; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/DBFunc.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/DBFunc.java index 47a03cf60..38fc283b7 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/DBFunc.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/DBFunc.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.database; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/Database.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/Database.java index 4acecc01f..1126a7d83 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/Database.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/Database.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.database; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/MySQL.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/MySQL.java index f8b2cedb0..1a27ff618 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/MySQL.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/MySQL.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.database; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Storage; import com.github.intellectualsites.plotsquared.plot.util.StringMan; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java index a62924e9e..55cb57b57 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.database; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLite.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLite.java index 10ceb8784..2bb1d3dd5 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLite.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLite.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.database; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import java.io.File; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/StmtMod.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/StmtMod.java index 837d3a66a..a390960c3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/StmtMod.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/StmtMod.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.database; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.util.StringMan; import java.sql.PreparedStatement; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BlockStateListFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BlockStateListFlag.java new file mode 100644 index 000000000..ee80b560e --- /dev/null +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BlockStateListFlag.java @@ -0,0 +1,40 @@ +package com.github.intellectualsites.plotsquared.plot.flag; + +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + +import com.github.intellectualsites.plotsquared.plot.config.Captions; +import com.sk89q.worldedit.world.block.BlockState; +import com.github.intellectualsites.plotsquared.plot.util.StringMan; +import com.sk89q.worldedit.world.block.BlockType; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.Set; +import java.util.function.Function; +import java.util.stream.Collectors; + +public class BlockStateListFlag extends ListFlag> { + + public BlockStateListFlag(String name) { + super(Captions.FLAG_CATEGORY_BLOCK_LIST, name); + } + + @Override public String valueToString(Object value) { + return StringMan.join((Set) value, ","); + } + + @Override public Set parseValue(final String value) { + return Arrays.stream(BlockUtil.parse(value)).map(BlockState::getBlockType).collect(Collectors.toSet()); + } + + @Override public String getValueDescription() { + return "Flag value must be a block list"; + } + + public boolean contains(Plot plot, BlockState value) { + return contains(plot, value.getBlockType()); + } +} diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BooleanFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BooleanFlag.java index 841df766c..a44168e73 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BooleanFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BooleanFlag.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.flag; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/DoubleFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/DoubleFlag.java index 8cc665471..505f5cab6 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/DoubleFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/DoubleFlag.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.flag; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Captions; public class DoubleFlag extends Flag { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/EnumFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/EnumFlag.java index 88119bbaa..c86299a22 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/EnumFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/EnumFlag.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.flag; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.util.StringMan; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flag.java index 21047d9cd..03269827e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flag.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.flag; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.util.StringComparison; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/FlagManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/FlagManager.java index 51391f788..4a4a7d64a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/FlagManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/FlagManager.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.flag; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flags.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flags.java index b21d6fb25..a84d041bc 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flags.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flags.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.flag; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; @@ -58,9 +60,9 @@ public final class Flags { public static final BooleanFlag BLOCK_IGNITION = new BooleanFlag("block-ignition"); public static final BooleanFlag SOIL_DRY = new BooleanFlag("soil-dry"); public static final StringListFlag BLOCKED_CMDS = new StringListFlag("blocked-cmds"); - public static final PlotBlockListFlag USE = new PlotBlockListFlag("use"); - public static final PlotBlockListFlag BREAK = new PlotBlockListFlag("break"); - public static final PlotBlockListFlag PLACE = new PlotBlockListFlag("place"); + public static final BlockStateListFlag USE = new BlockStateListFlag("use"); + public static final BlockStateListFlag BREAK = new BlockStateListFlag("break"); + public static final BlockStateListFlag PLACE = new BlockStateListFlag("place"); public static final BooleanFlag DEVICE_INTERACT = new BooleanFlag("device-interact"); public static final BooleanFlag VEHICLE_BREAK = new BooleanFlag("vehicle-break"); public static final BooleanFlag VEHICLE_PLACE = new BooleanFlag("vehicle-place"); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/GameModeFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/GameModeFlag.java index 26510b35b..b67ae58ba 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/GameModeFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/GameModeFlag.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.flag; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.util.PlotGameMode; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntegerFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntegerFlag.java index ced532cd1..2a83fbac7 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntegerFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntegerFlag.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.flag; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntegerListFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntegerListFlag.java index 1f24cb4a3..55260ec6f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntegerListFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntegerListFlag.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.flag; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.util.StringMan; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntervalFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntervalFlag.java index 0468c59b2..af2b1345c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntervalFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntervalFlag.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.flag; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Captions; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/ListFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/ListFlag.java index 3085288b1..7f1fd1aff 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/ListFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/ListFlag.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.flag; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/LongFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/LongFlag.java index 8d57e8865..b5ad2fca2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/LongFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/LongFlag.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.flag; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Captions; public class LongFlag extends Flag { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/PlotBlockListFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/PlotBlockListFlag.java deleted file mode 100644 index d042ecb4d..000000000 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/PlotBlockListFlag.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.github.intellectualsites.plotsquared.plot.flag; - -import com.github.intellectualsites.plotsquared.plot.PlotSquared; -import com.github.intellectualsites.plotsquared.plot.config.Captions; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; -import com.github.intellectualsites.plotsquared.plot.util.LegacyMappings; -import com.github.intellectualsites.plotsquared.plot.util.StringMan; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.Objects; -import java.util.stream.Collectors; - -public class PlotBlockListFlag extends ListFlag> { - - public PlotBlockListFlag(String name) { - super(Captions.FLAG_CATEGORY_BLOCK_LIST, name); - } - - @Override public String valueToString(Object value) { - return StringMan.join((HashSet) value, ","); - } - - @Override public HashSet parseValue(final String value) { - final LegacyMappings legacyMappings = PlotSquared.get().IMP.getLegacyMappings(); - return Arrays.stream(value.split(",")).map(legacyMappings::fromAny).filter(Objects::nonNull) - .collect(Collectors.toCollection(HashSet::new)); - } - - @Override public String getValueDescription() { - return "Flag value must be a block list"; - } -} diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/PlotWeatherFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/PlotWeatherFlag.java index 43544748f..beb3e8836 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/PlotWeatherFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/PlotWeatherFlag.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.flag; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.util.PlotWeather; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/StringFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/StringFlag.java index 31447847c..504b04a40 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/StringFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/StringFlag.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.flag; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Captions; public class StringFlag extends Flag { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/StringListFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/StringListFlag.java index a1e28aa3d..9717de1d9 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/StringListFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/StringListFlag.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.flag; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.util.StringMan; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/TeleportDenyFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/TeleportDenyFlag.java index 6c02516fd..9dfa64dc5 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/TeleportDenyFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/TeleportDenyFlag.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.flag; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/AugmentedUtils.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/AugmentedUtils.java index 2a85581ad..1e2d1df5f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/AugmentedUtils.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/AugmentedUtils.java @@ -1,16 +1,19 @@ package com.github.intellectualsites.plotsquared.plot.generator; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotManager; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; -import com.github.intellectualsites.plotsquared.plot.object.StringPlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.util.block.DelegateLocalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; +import com.sk89q.worldedit.world.block.BlockTypes; import org.jetbrains.annotations.NotNull; import java.util.Set; @@ -64,7 +67,7 @@ public class AugmentedUtils { txx = Math.min(15, area.getRegion().maxX - blockX); tzz = Math.min(15, area.getRegion().maxZ - blockZ); primaryMask = new DelegateLocalBlockQueue(queue) { - @Override public boolean setBlock(int x, int y, int z, PlotBlock id) { + @Override public boolean setBlock(int x, int y, int z, BlockState id) { if (area.contains(x, z)) { return super.setBlock(x, y, z, id); } @@ -84,7 +87,7 @@ public class AugmentedUtils { primaryMask = queue; } LocalBlockQueue secondaryMask; - PlotBlock air = StringPlotBlock.EVERYTHING; + BlockState air = BlockTypes.AIR.getDefaultState(); if (area.TERRAIN == 2) { PlotManager manager = area.getPlotManager(); final boolean[][] canPlace = new boolean[16][16]; @@ -108,7 +111,7 @@ public class AugmentedUtils { } toReturn = true; secondaryMask = new DelegateLocalBlockQueue(primaryMask) { - @Override public boolean setBlock(int x, int y, int z, PlotBlock id) { + @Override public boolean setBlock(int x, int y, int z, BlockState id) { if (canPlace[x - blockX][z - blockZ]) { return super.setBlock(x, y, z, id); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java index a15b9ab1b..293303bcf 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java @@ -1,11 +1,13 @@ package com.github.intellectualsites.plotsquared.plot.generator; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.Direction; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; import com.github.intellectualsites.plotsquared.plot.util.MathMan; @@ -284,9 +286,9 @@ public class ClassicPlotManager extends SquarePlotManager { queue.setCuboid( new Location(classicPlotWorld.worldname, sx, Math.min(classicPlotWorld.WALL_HEIGHT, classicPlotWorld.ROAD_HEIGHT) + 1, sz + 1), new Location(classicPlotWorld.worldname, ex, maxY, ez - 1), - PlotBlock.get((short) 0, (byte) 0)); + BlockUtil.get((short) 0, (byte) 0)); queue.setCuboid(new Location(classicPlotWorld.worldname, sx, 0, sz + 1), - new Location(classicPlotWorld.worldname, ex, 0, ez - 1), PlotBlock.get((short) 7, (byte) 0)); + new Location(classicPlotWorld.worldname, ex, 0, ez - 1), BlockUtil.get((short) 7, (byte) 0)); queue.setCuboid(new Location(classicPlotWorld.worldname, sx, 1, sz + 1), new Location(classicPlotWorld.worldname, sx, classicPlotWorld.WALL_HEIGHT, ez - 1), classicPlotWorld.WALL_FILLING); queue.setCuboid(new Location(classicPlotWorld.worldname, sx, classicPlotWorld.WALL_HEIGHT + 1, sz + 1), @@ -312,9 +314,9 @@ public class ClassicPlotManager extends SquarePlotManager { new Location(classicPlotWorld.worldname, sx + 1, Math.min(classicPlotWorld.WALL_HEIGHT, classicPlotWorld.ROAD_HEIGHT) + 1, sz), new Location(classicPlotWorld.worldname, ex - 1, classicPlotWorld.getPlotManager().getWorldHeight(), - ez), PlotBlock.get((short) 0, (byte) 0)); + ez), BlockUtil.get((short) 0, (byte) 0)); queue.setCuboid(new Location(classicPlotWorld.worldname, sx + 1, 0, sz), - new Location(classicPlotWorld.worldname, ex - 1, 0, ez), PlotBlock.get((short) 7, (byte) 0)); + new Location(classicPlotWorld.worldname, ex - 1, 0, ez), BlockUtil.get((short) 7, (byte) 0)); queue.setCuboid(new Location(classicPlotWorld.worldname, sx + 1, 1, sz), new Location(classicPlotWorld.worldname, ex - 1, classicPlotWorld.WALL_HEIGHT, sz), classicPlotWorld.WALL_FILLING); queue.setCuboid(new Location(classicPlotWorld.worldname, sx + 1, classicPlotWorld.WALL_HEIGHT + 1, sz), @@ -337,10 +339,10 @@ public class ClassicPlotManager extends SquarePlotManager { LocalBlockQueue queue = classicPlotWorld.getQueue(false); queue.setCuboid(new Location(classicPlotWorld.worldname, sx + 1, classicPlotWorld.ROAD_HEIGHT + 1, sz + 1), new Location(classicPlotWorld.worldname, ex - 1, classicPlotWorld.getPlotManager().getWorldHeight(), ez - 1), - PlotBlock.get((short) 0, (byte) 0)); + BlockUtil.get((short) 0, (byte) 0)); queue.setCuboid(new Location(classicPlotWorld.worldname, sx + 1, 0, sz + 1), new Location(classicPlotWorld.worldname, ex - 1, 0, ez - 1), - PlotBlock.get((short) 7, (byte) 0)); + BlockUtil.get((short) 7, (byte) 0)); queue.setCuboid(new Location(classicPlotWorld.worldname, sx + 1, 1, sz + 1), new Location(classicPlotWorld.worldname, ex - 1, classicPlotWorld.ROAD_HEIGHT, ez - 1), classicPlotWorld.ROAD_BLOCK); return queue.enqueue(); @@ -358,7 +360,7 @@ public class ClassicPlotManager extends SquarePlotManager { new Location(classicPlotWorld.worldname, sx, Math.min(classicPlotWorld.PLOT_HEIGHT, classicPlotWorld.ROAD_HEIGHT) + 1, sz), new Location(classicPlotWorld.worldname, ex, classicPlotWorld.getPlotManager().getWorldHeight(), ez), - PlotBlock.get((short) 0, (byte) 0)); + BlockUtil.get((short) 0, (byte) 0)); queue.setCuboid(new Location(classicPlotWorld.worldname, sx, 1, sz + 1), new Location(classicPlotWorld.worldname, ex, classicPlotWorld.PLOT_HEIGHT - 1, ez - 1), classicPlotWorld.MAIN_BLOCK); queue.setCuboid(new Location(classicPlotWorld.worldname, sx, classicPlotWorld.PLOT_HEIGHT, sz + 1), @@ -378,7 +380,7 @@ public class ClassicPlotManager extends SquarePlotManager { new Location(classicPlotWorld.worldname, sx, Math.min(classicPlotWorld.PLOT_HEIGHT, classicPlotWorld.ROAD_HEIGHT) + 1, sz), new Location(classicPlotWorld.worldname, ex, classicPlotWorld.getPlotManager().getWorldHeight(), ez), - PlotBlock.get((short) 0, (byte) 0)); + BlockUtil.get((short) 0, (byte) 0)); queue.setCuboid(new Location(classicPlotWorld.worldname, sx + 1, 1, sz), new Location(classicPlotWorld.worldname, ex - 1, classicPlotWorld.PLOT_HEIGHT - 1, ez), classicPlotWorld.MAIN_BLOCK); queue.setCuboid(new Location(classicPlotWorld.worldname, sx + 1, classicPlotWorld.PLOT_HEIGHT, sz), @@ -395,7 +397,7 @@ public class ClassicPlotManager extends SquarePlotManager { LocalBlockQueue queue = classicPlotWorld.getQueue(false); queue.setCuboid(new Location(classicPlotWorld.worldname, sx, classicPlotWorld.ROAD_HEIGHT + 1, sz), new Location(classicPlotWorld.worldname, ex, classicPlotWorld.getPlotManager().getWorldHeight(), ez), - PlotBlock.get((short) 0, (byte) 0)); + BlockUtil.get((short) 0, (byte) 0)); queue.setCuboid(new Location(classicPlotWorld.worldname, sx, 1, sz), new Location(classicPlotWorld.worldname, ex, classicPlotWorld.ROAD_HEIGHT - 1, ez), classicPlotWorld.MAIN_BLOCK); queue.setCuboid(new Location(classicPlotWorld.worldname, sx, classicPlotWorld.ROAD_HEIGHT, sz), diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotWorld.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotWorld.java index ec80b3b84..7048ee8cf 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotWorld.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotWorld.java @@ -1,12 +1,14 @@ package com.github.intellectualsites.plotsquared.plot.generator; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Configuration; import com.github.intellectualsites.plotsquared.plot.config.ConfigurationNode; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import org.jetbrains.annotations.NotNull; @@ -18,18 +20,18 @@ import java.util.Locale; public int ROAD_HEIGHT = 62; public int PLOT_HEIGHT = 62; public int WALL_HEIGHT = 62; - public BlockBucket MAIN_BLOCK = BlockBucket.withSingle(PlotBlock.get("stone")); - // new PlotBlock[] {PlotBlock.get("stone")}; - public BlockBucket TOP_BLOCK = BlockBucket.withSingle(PlotBlock.get("grass_block")); - //new PlotBlock[] {PlotBlock.get("grass")}; - public BlockBucket WALL_BLOCK = BlockBucket.withSingle(PlotBlock.get("stone_slab")); - // PlotBlock.get((short) 44, (byte) 0); - public BlockBucket CLAIMED_WALL_BLOCK = BlockBucket.withSingle(PlotBlock.get("sandstone_slab")); - // PlotBlock.get((short) 44, (byte) 1); - public BlockBucket WALL_FILLING = BlockBucket.withSingle(PlotBlock.get("stone")); - //PlotBlock.get((short) 1, (byte) 0); - public BlockBucket ROAD_BLOCK = BlockBucket.withSingle(PlotBlock.get("quartz_block")); - // PlotBlock.get((short) 155, (byte) 0); + public BlockBucket MAIN_BLOCK = BlockBucket.withSingle(BlockUtil.get("stone")); + // new BlockState[] {BlockUtil.get("stone")}; + public BlockBucket TOP_BLOCK = BlockBucket.withSingle(BlockUtil.get("grass_block")); + //new BlockState[] {BlockUtil.get("grass")}; + public BlockBucket WALL_BLOCK = BlockBucket.withSingle(BlockUtil.get("stone_slab")); + // BlockUtil.get((short) 44, (byte) 0); + public BlockBucket CLAIMED_WALL_BLOCK = BlockBucket.withSingle(BlockUtil.get("sandstone_slab")); + // BlockUtil.get((short) 44, (byte) 1); + public BlockBucket WALL_FILLING = BlockBucket.withSingle(BlockUtil.get("stone")); + //BlockUtil.get((short) 1, (byte) 0); + public BlockBucket ROAD_BLOCK = BlockBucket.withSingle(BlockUtil.get("quartz_block")); + // BlockUtil.get((short) 155, (byte) 0); public boolean PLOT_BEDROCK = true; public ClassicPlotWorld(String worldName, String id, diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GeneratorWrapper.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GeneratorWrapper.java index ec5f971fc..ffe895f8b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GeneratorWrapper.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GeneratorWrapper.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.generator; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.PlotArea; public interface GeneratorWrapper { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GridPlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GridPlotManager.java index a0ed41226..2590fd181 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GridPlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GridPlotManager.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.generator; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotManager; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GridPlotWorld.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GridPlotWorld.java index b0cc10323..d91d22f94 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GridPlotWorld.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GridPlotWorld.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.generator; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import org.jetbrains.annotations.NotNull; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridGen.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridGen.java index 6cb57ba8f..29b1ee67d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridGen.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridGen.java @@ -1,11 +1,13 @@ package com.github.intellectualsites.plotsquared.plot.generator; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; @@ -43,7 +45,7 @@ public class HybridGen extends IndependentPlotGenerator { for (short x = 0; x < 16; x++) { for (short z = 0; z < 16; z++) { blockBuckets[0][(z << 4) | x] = - BlockBucket.withSingle(PlotBlock.get("bedrock")); + BlockBucket.withSingle(BlockUtil.get("bedrock")); } } } @@ -74,7 +76,7 @@ public class HybridGen extends IndependentPlotGenerator { if (hpw.PLOT_BEDROCK) { for (short x = 0; x < 16; x++) { for (short z = 0; z < 16; z++) { - result.setBlock(x, 0, z, PlotBlock.get("bedrock")); + result.setBlock(x, 0, z, BlockUtil.get("bedrock")); } } } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java index 528ad57f9..17129cc29 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.generator; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.commands.Template; import com.github.intellectualsites.plotsquared.plot.config.Settings; @@ -7,7 +9,7 @@ import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.FileBytes; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; @@ -174,13 +176,13 @@ public class HybridPlotManager extends ClassicPlotManager { // The component blocks final BlockBucket plotfloor = hybridPlotWorld.TOP_BLOCK; final BlockBucket filling = hybridPlotWorld.MAIN_BLOCK; - final PlotBlock bedrock; + final BlockState bedrock; if (hybridPlotWorld.PLOT_BEDROCK) { - bedrock = PlotBlock.get((short) 7, (byte) 0); + bedrock = BlockUtil.get((short) 7, (byte) 0); } else { - bedrock = PlotBlock.get((short) 0, (byte) 0); + bedrock = BlockUtil.get((short) 0, (byte) 0); } - final PlotBlock air = PlotBlock.get((short) 0, (byte) 0); + final BlockState air = BlockUtil.get((short) 0, (byte) 0); final String biome = hybridPlotWorld.PLOT_BIOME; final LocalBlockQueue queue = hybridPlotWorld.getQueue(false); ChunkManager.chunkTask(pos1, pos2, new RunnableVal() { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotWorld.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotWorld.java index 2f8c7c823..c53e1c9b6 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotWorld.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotWorld.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.generator; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; @@ -14,7 +16,7 @@ import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.github.intellectualsites.plotsquared.plot.util.SchematicHandler; import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.CompoundTagBuilder; -import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard; +import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.extent.transform.BlockTransformExtent; import com.sk89q.worldedit.internal.helper.MCDirections; import com.sk89q.worldedit.math.BlockVector3; @@ -178,7 +180,7 @@ public class HybridPlotWorld extends ClassicPlotWorld { if (schematic3 != null) { this.PLOT_SCHEMATIC = true; - BlockArrayClipboard blockArrayClipboard3 = schematic3.getClipboard(); + Clipboard blockArrayClipboard3 = schematic3.getClipboard(); BlockVector3 d3 = blockArrayClipboard3.getDimensions(); short w3 = (short) d3.getX(); @@ -252,9 +254,9 @@ public class HybridPlotWorld extends ClassicPlotWorld { } this.ROAD_SCHEMATIC_ENABLED = true; // Do not populate road if using schematic population - // TODO: What? this.ROAD_BLOCK = BlockBucket.empty(); // PlotBlock.getEmptyData(this.ROAD_BLOCK); // PlotBlock.get(this.ROAD_BLOCK.id, (byte) 0); + // TODO: What? this.ROAD_BLOCK = BlockBucket.empty(); // BlockState.getEmptyData(this.ROAD_BLOCK); // BlockUtil.get(this.ROAD_BLOCK.id, (byte) 0); - BlockArrayClipboard blockArrayClipboard1 = schematic1.getClipboard(); + Clipboard blockArrayClipboard1 = schematic1.getClipboard(); BlockVector3 d1 = blockArrayClipboard1.getDimensions(); short w1 = (short) d1.getX(); @@ -277,7 +279,7 @@ public class HybridPlotWorld extends ClassicPlotWorld { } } - BlockArrayClipboard blockArrayClipboard2 = schematic2.getClipboard(); + Clipboard blockArrayClipboard2 = schematic2.getClipboard(); BlockVector3 d2 = blockArrayClipboard2.getDimensions(); short w2 = (short) d2.getX(); short l2 = (short) d2.getZ(); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java index 9e09ea977..a638059a1 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.generator; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.flag.FlagManager; @@ -8,7 +10,7 @@ import com.github.intellectualsites.plotsquared.plot.listener.WEExtent; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.PlotManager; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; @@ -111,12 +113,12 @@ public abstract class HybridUtils { } public int checkModified(LocalBlockQueue queue, int x1, int x2, int y1, int y2, int z1, int z2, - PlotBlock[] blocks) { + BlockState[] blocks) { int count = 0; for (int y = y1; y <= y2; y++) { for (int x = x1; x <= x2; x++) { for (int z = z1; z <= z2; z++) { - PlotBlock block = queue.getBlock(x, y, z); + BlockState block = queue.getBlock(x, y, z); boolean same = Arrays.stream(blocks).anyMatch(p -> WorldUtil.IMP.isBlockSame(block, p)); if (!same) { @@ -307,8 +309,8 @@ public abstract class HybridUtils { for (int z = sz; z <= ez; z++) { for (int y = sy; y <= pm.getWorldHeight(); y++) { if (y > ey) { - PlotBlock block = queue.getBlock(x, y, z); - if (!block.isAir()) { + BlockState block = queue.getBlock(x, y, z); + if (!block.getBlockType().getMaterial().isAir()) { ey = y; } } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/IndependentPlotGenerator.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/IndependentPlotGenerator.java index def532368..bda8a6ccb 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/IndependentPlotGenerator.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/IndependentPlotGenerator.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.generator; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/PlotGenerator.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/PlotGenerator.java index 88c7f2557..0880a9e8b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/PlotGenerator.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/PlotGenerator.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.generator; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.PlotManager; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotManager.java index 8ee343b3f..cc3f292cb 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotManager.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.generator; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.Direction; import com.github.intellectualsites.plotsquared.plot.object.Location; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotWorld.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotWorld.java index c2d1ddb31..6ed48568d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotWorld.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotWorld.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.generator; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.PlotId; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/ExtentWrapper.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/ExtentWrapper.java index 5d0c86858..adfaf450d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/ExtentWrapper.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/ExtentWrapper.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.listener; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlayerBlockEventType.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlayerBlockEventType.java index 815f5ea43..177b92699 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlayerBlockEventType.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlayerBlockEventType.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.listener; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public enum PlayerBlockEventType { // Non interactive EAT, READ, diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java index 7aee40de0..ec6051199 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.listener; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.flag.Flag; @@ -8,7 +10,8 @@ import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.github.intellectualsites.plotsquared.plot.util.block.ItemUtil; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.util.ByteArrayUtilities; @@ -22,6 +25,8 @@ import com.github.intellectualsites.plotsquared.plot.util.StringMan; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; +import com.sk89q.worldedit.world.item.ItemType; +import com.sk89q.worldedit.world.item.ItemTypes; import java.util.HashMap; import java.util.Map; @@ -144,21 +149,21 @@ public class PlotListener { Optional musicFlag = plot.getFlag(Flags.MUSIC); if (musicFlag.isPresent()) { final String id = musicFlag.get(); - final PlotBlock block = PlotBlock.get(id); - final String rawId = block.getRawId().toString(); - if (rawId.contains("disc") || PlotBlock.isEverything(block) || block.isAir()) { + final ItemType item = ItemUtil.get(id); + final String rawId = item.getId(); + if (rawId.contains("disc") || item == ItemTypes.AIR) { Location location = player.getLocation(); Location lastLocation = player.getMeta("music"); if (lastLocation != null) { - player.playMusic(lastLocation, PlotBlock.get("air")); - if (PlotBlock.isEverything(block) || block.isAir()) { + player.playMusic(lastLocation, ItemTypes.AIR); + if (item == ItemTypes.AIR) { player.deleteMeta("music"); } } - if (!(PlotBlock.isEverything(block) || block.isAir())) { + if (!(item == ItemTypes.AIR)) { try { player.setMeta("music", location); - player.playMusic(location, block); + player.playMusic(location, item); } catch (Exception ignored) { } } @@ -167,7 +172,7 @@ public class PlotListener { Location lastLoc = player.getMeta("music"); if (lastLoc != null) { player.deleteMeta("music"); - player.playMusic(lastLoc, PlotBlock.get("air")); + player.playMusic(lastLoc, ItemTypes.AIR); } } CommentManager.sendTitle(player, plot); @@ -275,7 +280,7 @@ public class PlotListener { Location lastLoc = player.getMeta("music"); if (lastLoc != null) { player.deleteMeta("music"); - player.playMusic(lastLoc, PlotBlock.get("air")); + player.playMusic(lastLoc, ItemTypes.AIR); } } return true; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/ProcessedWEExtent.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/ProcessedWEExtent.java index 7d2d824b4..8818ed437 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/ProcessedWEExtent.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/ProcessedWEExtent.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.listener; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEExtent.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEExtent.java index 073819fa3..39d30935b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEExtent.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEExtent.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.listener; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.BaseEntity; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEManager.java index 3692efa51..c562f4f9a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEManager.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.listener; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.flag.Flags; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WESubscriber.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WESubscriber.java index 78379fd9e..5f9cac7fc 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WESubscriber.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WESubscriber.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.listener; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/logger/DelegateLogger.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/logger/DelegateLogger.java index ed925a135..ca9b988bb 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/logger/DelegateLogger.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/logger/DelegateLogger.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.logger; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public class DelegateLogger implements ILogger { private final ILogger parent; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/logger/ILogger.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/logger/ILogger.java index 16fb343bf..050f2a365 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/logger/ILogger.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/logger/ILogger.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.logger; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public interface ILogger { void log(String message); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java index bd15eddf9..b0ddc9d06 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java @@ -1,9 +1,13 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.configuration.serialization.ConfigurationSerializable; import com.github.intellectualsites.plotsquared.plot.config.Configuration; import com.github.intellectualsites.plotsquared.plot.object.collection.RandomCollection; import com.google.common.collect.ImmutableMap; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockTypes; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NonNull; @@ -24,23 +28,23 @@ import java.util.Random; * has a specified chance of being randomly picked */ @EqualsAndHashCode @SuppressWarnings({"unused", "WeakerAccess"}) public final class BlockBucket - implements Iterable, ConfigurationSerializable { + implements Iterable, ConfigurationSerializable { private final Random random = new Random(); - private final Map blocks; + private final Map blocks; private final BucketIterator bucketIterator = new BucketIterator(); private boolean compiled, singleItem; - private PlotBlock head; + private BlockState head; - private RandomCollection randomBlocks; - private PlotBlock single; + private RandomCollection randomBlocks; + private BlockState single; public BlockBucket() { this.blocks = new HashMap<>(); } - public static BlockBucket withSingle(@NonNull final PlotBlock block) { + public static BlockBucket withSingle(@NonNull final BlockState block) { final BlockBucket blockBucket = new BlockBucket(); blockBucket.addBlock(block, 100); return blockBucket; @@ -53,15 +57,15 @@ import java.util.Random; return Configuration.BLOCK_BUCKET.parseString(map.get("blocks").toString()); } - public void addBlock(@NonNull final PlotBlock block) { + public void addBlock(@NonNull final BlockState block) { this.addBlock(block, -1); } - public void addBlock(@NonNull final PlotBlock block, final int chance) { + public void addBlock(@NonNull final BlockState block, final int chance) { addBlock(block, (double) chance); } - private void addBlock(@NonNull final PlotBlock block, double chance) { + private void addBlock(@NonNull final BlockState block, double chance) { if (chance == -1) chance = 1; this.blocks.put(block, chance); @@ -81,7 +85,7 @@ import java.util.Random; * @return Immutable collection containing all blocks that can * be found in the bucket */ - public Collection getBlocks() { + public Collection getBlocks() { if (!isCompiled()) { this.compile(); } @@ -94,7 +98,7 @@ import java.util.Random; * @param count Number of blocks * @return Immutable collection containing randomly selected blocks */ - public Collection getBlocks(final int count) { + public Collection getBlocks(final int count) { return Arrays.asList(getBlockArray(count)); } @@ -104,8 +108,8 @@ import java.util.Random; * @param count Number of blocks * @return Immutable collection containing randomly selected blocks */ - public PlotBlock[] getBlockArray(final int count) { - final PlotBlock[] blocks = new PlotBlock[count]; + public BlockState[] getBlockArray(final int count) { + final BlockState[] blocks = new BlockState[count]; if (this.singleItem) { Arrays.fill(blocks, 0, count, getBlock()); } else { @@ -142,7 +146,7 @@ import java.util.Random; } } - @NotNull @Override public Iterator iterator() { + @NotNull @Override public Iterator iterator() { return this.bucketIterator; } @@ -155,7 +159,7 @@ import java.util.Random; * * @return Randomly picked block (cased on specified rates) */ - public PlotBlock getBlock() { + public BlockState getBlock() { if (!isCompiled()) { this.compile(); } @@ -165,19 +169,22 @@ import java.util.Random; if (randomBlocks != null) { return randomBlocks.next(); } - return StringPlotBlock.EVERYTHING; + return BlockTypes.AIR.getDefaultState(); } @Override public String toString() { if (!isCompiled()) { compile(); } + if (blocks.size() == 1) { + return blocks.entrySet().iterator().next().getKey().toString(); + } final StringBuilder builder = new StringBuilder(); - Iterator> iterator = blocks.entrySet().iterator(); + Iterator> iterator = blocks.entrySet().iterator(); while (iterator.hasNext()) { - Entry entry = iterator.next(); - PlotBlock block = entry.getKey(); - builder.append(block.getRawId()); + Entry entry = iterator.next(); + BlockState block = entry.getKey(); + builder.append(block); Double weight = entry.getValue(); if (weight != 1) { builder.append(":").append(weight.intValue()); @@ -213,13 +220,13 @@ import java.util.Random; } - private final class BucketIterator implements Iterator { + private final class BucketIterator implements Iterator { @Override public boolean hasNext() { return true; } - @Override public PlotBlock next() { + @Override public BlockState next() { return getBlock(); } } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockLoc.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockLoc.java index a4f02a9ef..07094aec5 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockLoc.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockLoc.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public class BlockLoc { private final int x; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockRegistry.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockRegistry.java deleted file mode 100644 index e125ca188..000000000 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockRegistry.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.github.intellectualsites.plotsquared.plot.object; - -import lombok.Getter; -import lombok.NonNull; - -import java.util.HashMap; -import java.util.Map; - -public abstract class BlockRegistry { - - @Getter private final Class type; - private final Map map = new HashMap<>(); - - public BlockRegistry(@NonNull final Class type, final T... preInitializedItems) { - this.type = type; - for (final T preInitializedItem : preInitializedItems) { - this.addMapping(getPlotBlock(preInitializedItem), preInitializedItem); - } - } - - public final void addMapping(@NonNull final PlotBlock plotBlock, @NonNull final T t) { - if (map.containsKey(plotBlock)) { - return; - } - this.map.put(plotBlock, t); - } - - public abstract PlotBlock getPlotBlock(final T item); - - public final T getItem(final PlotBlock plotBlock) { - return this.map.get(plotBlock); - } - -} diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ChunkWrapper.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ChunkWrapper.java index e665ea752..c1bc5c98d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ChunkWrapper.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ChunkWrapper.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.github.intellectualsites.plotsquared.plot.util.StringMan; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/CmdInstance.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/CmdInstance.java index 27cb55216..182aa061e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/CmdInstance.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/CmdInstance.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public class CmdInstance { public final Runnable command; public final long timestamp; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java index 490a6e211..8da0f74a3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java @@ -1,10 +1,15 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.commands.RequiredType; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.util.PlotGameMode; import com.github.intellectualsites.plotsquared.plot.util.PlotWeather; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.item.ItemType; +import com.sk89q.worldedit.world.item.ItemTypes; import org.jetbrains.annotations.NotNull; import java.util.UUID; @@ -120,7 +125,7 @@ public class ConsolePlayer extends PlotPlayer { @Override public void setFlight(boolean fly) { } - @Override public void playMusic(@NotNull Location location, @NotNull PlotBlock id) { + @Override public void playMusic(@NotNull Location location, @NotNull ItemType id) { } @Override public void kick(String message) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Direction.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Direction.java index 3c3900dc1..f54e103a1 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Direction.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Direction.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public enum Direction { ALL(-1, "all"), NORTH(0, "north"), EAST(1, "east"), SOUTH(2, "south"), WEST(3, "west"), NORTHEAST(4, "northeast"), SOUTHEAST(5, "southeast"), SOUTHWEST(6, diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Expression.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Expression.java index bb466c082..30c2f88b3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Expression.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Expression.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.commands.DebugExec; import com.github.intellectualsites.plotsquared.plot.commands.MainCommand; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/FileBytes.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/FileBytes.java index d34521ee9..9c6c63022 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/FileBytes.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/FileBytes.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public class FileBytes { public final String path; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LazyBlock.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LazyBlock.java index 3413bd235..490c256f5 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LazyBlock.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LazyBlock.java @@ -1,10 +1,13 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.sk89q.worldedit.world.block.BlockState; + public abstract class LazyBlock { - public abstract StringPlotBlock getPlotBlock(); + public abstract BlockState getBlockState(); public String getId() { - return getPlotBlock().getItemId(); + return getBlockState().toString(); } } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LazyResult.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LazyResult.java index 8487c44be..a2391a86f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LazyResult.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LazyResult.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public abstract class LazyResult { private T result; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LegacyPlotBlock.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LegacyPlotBlock.java deleted file mode 100644 index 0596cd010..000000000 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LegacyPlotBlock.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.github.intellectualsites.plotsquared.plot.object; - -import com.sk89q.worldedit.world.block.BaseBlock; -import com.sk89q.worldedit.world.registry.LegacyMapper; -import lombok.Getter; -import lombok.Setter; - -public class LegacyPlotBlock extends PlotBlock { - - public static final PlotBlock EVERYTHING = new LegacyPlotBlock((short) 0, (byte) 0); - public static final PlotBlock[] CACHE = new PlotBlock[65535]; - - static { - for (int i = 0; i < 65535; i++) { - short id = (short) (i >> 4); - byte data = (byte) (i & 15); - CACHE[i] = new LegacyPlotBlock(id, data); - } - } - - @Setter private BaseBlock baseBlock = null; - @Getter public final short id; - @Getter public final byte data; - - public LegacyPlotBlock(short id, byte data) { - this.id = id; - this.data = data; - } - - @Override public Object getRawId() { - return this.id; - } - - @Override public BaseBlock getBaseBlock() { - if (baseBlock == null) { - baseBlock = LegacyMapper.getInstance().getBlockFromLegacy(id, data).toBaseBlock(); - } - return baseBlock; - } - - @Override public boolean isAir() { - return this.id == 0; - } - - @Override public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - LegacyPlotBlock other = (LegacyPlotBlock) obj; - return (this.id == other.id) && ((this.data == other.data) || (this.data == -1) || ( - other.data == -1)); - } - - @Override public int hashCode() { - return this.id; - } - - @Override public String toString() { - if (this.data == -1) { - return this.id + ""; - } - return this.id + ":" + this.data; - } - -} diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java index 5f2b6bafe..8e7edf51a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.sk89q.worldedit.math.BlockVector2; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/OfflinePlotPlayer.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/OfflinePlotPlayer.java index 85e6e72d8..f2e1a8dab 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/OfflinePlotPlayer.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/OfflinePlotPlayer.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.util.UUID; public interface OfflinePlotPlayer { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java index 6708289f3..edb28ba12 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Configuration; @@ -1282,7 +1284,7 @@ public class Plot { if (!isLoaded()) { return location; } - if (!WorldUtil.IMP.getBlock(location).isAir()) { + if (!WorldUtil.IMP.getBlock(location).getBlockType().getMaterial().isAir()) { location.setY(Math.max(1 + WorldUtil.IMP .getHighestBlock(this.getWorldName(), location.getX(), location.getZ()), bottom.getY())); @@ -1456,7 +1458,7 @@ public class Plot { } Location location = manager.getSignLoc(this); LocalBlockQueue queue = GlobalBlockQueue.IMP.getNewQueue(getWorldName(), false); - queue.setBlock(location.getX(), location.getY(), location.getZ(), PlotBlock.get("air")); + queue.setBlock(location.getX(), location.getY(), location.getZ(), BlockUtil.get("air")); queue.flush(); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java index b3217297d..99b4709cd 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Configuration; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotBlock.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotBlock.java deleted file mode 100644 index 5b9de5852..000000000 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotBlock.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.github.intellectualsites.plotsquared.plot.object; - -import com.github.intellectualsites.plotsquared.configuration.serialization.ConfigurationSerializable; -import com.github.intellectualsites.plotsquared.plot.PlotSquared; -import com.github.intellectualsites.plotsquared.plot.config.Settings; -import com.google.common.collect.ImmutableMap; -import com.sk89q.worldedit.world.block.BaseBlock; -import lombok.NonNull; - -import java.util.Collection; -import java.util.Map; - -public abstract class PlotBlock implements ConfigurationSerializable { - - private static Class conversionType; - private static BlockRegistry blockRegistry; - - protected PlotBlock() { - } - - public static boolean isEverything(@NonNull final PlotBlock block) { - return block.equals(LegacyPlotBlock.EVERYTHING) || block.equals(StringPlotBlock.EVERYTHING); - } - - public static boolean containsEverything(@NonNull final Collection blocks) { - for (final PlotBlock block : blocks) { - if (isEverything(block)) { - return true; - } - } - return false; - } - - public static PlotBlock get(char combinedId) { - switch (combinedId) { - case 0: - return null; - case 1: - return get(0, 0); - default: - return get(combinedId >> 4, combinedId & 15); - } - } - - public static PlotBlock deserialize(@NonNull final Map map) { - if (map.containsKey("material")) { - final Object object = map.get("material"); - return get(object.toString()); - } - return null; - } - - public static StringPlotBlock get(@NonNull final String itemId) { - if (Settings.Enabled_Components.BLOCK_CACHE) { - return StringPlotBlock.getOrAdd(itemId); - } - return new StringPlotBlock(itemId); - } - - public static PlotBlock get(int id, int data) { - return Settings.Enabled_Components.BLOCK_CACHE && data > 0 ? - LegacyPlotBlock.CACHE[(id << 4) + data] : - new LegacyPlotBlock((short) id, (byte) data); - } - - public static PlotBlock getEmptyData(@NonNull final PlotBlock plotBlock) { - if (plotBlock instanceof StringPlotBlock) { - return plotBlock; - } - return get(((LegacyPlotBlock) plotBlock).getId(), (byte) 0); - } - - public static PlotBlock get(@NonNull final BaseBlock baseBlock) { - StringPlotBlock plotBlock = get(baseBlock.getBlockType().getId()); - plotBlock.setBaseBlock(baseBlock); - return plotBlock; - } - - public static PlotBlock get(@NonNull final Object type) { - if (blockRegistry == null) { - blockRegistry = PlotSquared.imp().getBlockRegistry(); - if (blockRegistry == null) { - throw new UnsupportedOperationException( - "The PlotSquared implementation has not registered a custom block registry." - + " This method can't be used."); - } - conversionType = blockRegistry.getType(); - } - if (!type.getClass().equals(conversionType)) { - throw new UnsupportedOperationException( - "The PlotSquared implementation has not registered a block registry for this object type"); - } - return blockRegistry.getPlotBlock(type); - } - - @Override public Map serialize() { - return ImmutableMap.of("material", this.getRawId()); - } - - public T to(@NonNull final Class clazz) { - if (blockRegistry == null) { - blockRegistry = PlotSquared.imp().getBlockRegistry(); - if (blockRegistry == null) { - throw new UnsupportedOperationException( - "The PlotSquared implementation has not registered a custom block registry." - + " This method can't be used."); - } - conversionType = blockRegistry.getType(); - } - if (!clazz.equals(conversionType)) { - throw new UnsupportedOperationException( - "The PlotSquared implementation has not registered a block registry for this object type"); - } - return clazz.cast(blockRegistry.getItem(this)); - } - - public abstract boolean isAir(); - - public final boolean equalsAny(final int id, @NonNull final String stringId) { - if (this instanceof StringPlotBlock) { - final StringPlotBlock stringPlotBlock = (StringPlotBlock) this; - return stringPlotBlock.idEquals(stringId); - } - final LegacyPlotBlock legacyPlotBlock = (LegacyPlotBlock) this; - return legacyPlotBlock.id == id; - } - - @Override public abstract boolean equals(Object obj); - - @Override public abstract int hashCode(); - - @Override public abstract String toString(); - - public abstract Object getRawId(); - - public abstract BaseBlock getBaseBlock(); - -} diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java index d5d7c95d3..ef68d8d45 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotFilter.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotFilter.java index 09759c09d..bd941da6b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotFilter.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotFilter.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public abstract class PlotFilter { public boolean allowsArea(final PlotArea area) { return true; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotHandler.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotHandler.java index 4faa17b76..62cfeec49 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotHandler.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotHandler.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.util.Set; import java.util.UUID; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotId.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotId.java index 21e7dc777..1076ad443 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotId.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotId.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotInventory.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotInventory.java index 4598a2fff..927f80872 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotInventory.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotInventory.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.util.InventoryUtil; import lombok.NonNull; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotItemStack.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotItemStack.java index c0a9d93d0..b306ebed9 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotItemStack.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotItemStack.java @@ -1,7 +1,13 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.util.StringComparison; import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.item.ItemType; +import com.sk89q.worldedit.world.item.ItemTypes; +import com.sk89q.worldedit.world.registry.LegacyMapper; import lombok.Getter; public class PlotItemStack { @@ -9,7 +15,7 @@ public class PlotItemStack { public final int amount; public final String name; public final String[] lore; - @Getter private final PlotBlock plotBlock; + @Getter private final ItemType type; /** * @param id Legacy numerical item ID @@ -21,10 +27,11 @@ public class PlotItemStack { */ @Deprecated public PlotItemStack(final int id, final short data, final int amount, final String name, final String... lore) { + this.amount = amount; this.name = name; this.lore = lore; - this.plotBlock = PlotBlock.get(id, data); + this.type = LegacyMapper.getInstance().getItemFromLegacy(id, data); } /** @@ -35,10 +42,13 @@ public class PlotItemStack { */ public PlotItemStack(final String id, final int amount, final String name, final String... lore) { - StringComparison.ComparisonResult match = WorldUtil.IMP.getClosestBlock(id); - this.plotBlock = match.best; + this.type = ItemTypes.get(id); this.amount = amount; this.name = name; this.lore = lore; } + + public BlockState getBlockState() { + return type.getBlockType().getDefaultState(); + } } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotLoc.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotLoc.java index 33e57f753..e2ca83a64 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotLoc.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotLoc.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.util.StringMan; import lombok.AllArgsConstructor; import org.jetbrains.annotations.Nullable; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotManager.java index 0b39b2b7d..9120a576f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotManager.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.commands.Template; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotMessage.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotMessage.java index 64e6fedb3..f7865a7c6 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotMessage.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotMessage.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.chat.PlainChatManager; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java index e7ee3d40f..7019d10ce 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandCaller; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.commands.RequiredType; @@ -19,6 +21,8 @@ import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; import com.google.common.base.Preconditions; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.item.ItemType; import lombok.NonNull; import org.jetbrains.annotations.NotNull; @@ -470,7 +474,7 @@ public abstract class PlotPlayer implements CommandCaller, OfflinePlotPlayer { * @param location where to play the music * @param id the record item id */ - public abstract void playMusic(@NotNull Location location, @NotNull PlotBlock id); + public abstract void playMusic(@NotNull Location location, @NotNull ItemType id); /** * Check if this player is banned. diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotSettings.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotSettings.java index 8d7904690..4bc9b159f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotSettings.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotSettings.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.object.comment.PlotComment; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PseudoRandom.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PseudoRandom.java index 490f8c926..3dfb4c1fa 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PseudoRandom.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PseudoRandom.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public class PseudoRandom { public static final PseudoRandom random = new PseudoRandom(); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Rating.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Rating.java index 911b2e6c5..b00e3cac7 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Rating.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Rating.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Settings; import java.util.ArrayList; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RegionWrapper.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RegionWrapper.java index ced127a22..3f4db9a7c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RegionWrapper.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RegionWrapper.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public class RegionWrapper { public final int minX; public final int maxX; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal.java index 90074a63a..3ac0da1a8 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public abstract class RunnableVal implements Runnable { public T value; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal2.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal2.java index ee46a417f..1872b5c1c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal2.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal2.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public abstract class RunnableVal2 implements Runnable { public T value1; public U value2; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal3.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal3.java index cb6b2a8be..4a4d47663 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal3.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal3.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public abstract class RunnableVal3 implements Runnable { public T value1; public U value2; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/SetupObject.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/SetupObject.java index e203fa870..ba7a5f47c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/SetupObject.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/SetupObject.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.ConfigurationNode; import com.github.intellectualsites.plotsquared.plot.util.SetupUtils; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/StringPlotBlock.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/StringPlotBlock.java deleted file mode 100644 index d4119ae92..000000000 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/StringPlotBlock.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.github.intellectualsites.plotsquared.plot.object; - -import com.sk89q.worldedit.world.block.BaseBlock; -import com.sk89q.worldedit.world.block.BlockTypes; -import lombok.Getter; -import lombok.NonNull; -import lombok.Setter; - -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - -public class StringPlotBlock extends PlotBlock { - - public static final PlotBlock EVERYTHING = new StringPlotBlock("air"); - private static final Map STRING_PLOT_BLOCK_CACHE = new HashMap<>(); - @Getter private final String nameSpace; - @Getter private final String itemId; - @Setter private BaseBlock baseBlock = null; - private boolean isForeign = false; - - public StringPlotBlock(@NonNull final String nameSpace, @NonNull final String itemId) { - this.nameSpace = nameSpace.toLowerCase(Locale.ENGLISH); - this.itemId = itemId.toLowerCase(Locale.ENGLISH); - this.determineForeign(); - } - - public StringPlotBlock(@NonNull final String itemId) { - if (itemId.contains(":")) { - final String[] parts = itemId.split(":"); - if (parts.length < 2) { - throw new IllegalArgumentException(String.format("Cannot parse \"%s\"", itemId)); - } - this.nameSpace = parts[0].toLowerCase(Locale.ENGLISH); - this.itemId = parts[1].toLowerCase(Locale.ENGLISH); - } else { - this.nameSpace = "minecraft"; - if (itemId.isEmpty()) { - this.itemId = "air"; - } else { - this.itemId = itemId.toLowerCase(Locale.ENGLISH); - } - } - this.determineForeign(); - } - - public static StringPlotBlock getOrAdd(@NonNull final String itemId) { - // final String id = itemId.toLowerCase(Locale.ENGLISH); - - StringPlotBlock plotBlock = STRING_PLOT_BLOCK_CACHE.get(itemId); - if (plotBlock == null) { - plotBlock = new StringPlotBlock(itemId); - STRING_PLOT_BLOCK_CACHE.put(itemId, plotBlock); - } - - return plotBlock; - } - - private void determineForeign() { - this.isForeign = !this.nameSpace.equals("minecraft"); - } - - @Override public String toString() { - return this.isForeign ? String.format("%s:%s", nameSpace, itemId) : itemId; - } - - @Override public boolean isAir() { - return this.itemId.isEmpty() || this.itemId.equalsIgnoreCase("air"); - } - - @Override public int hashCode() { - return this.toString().hashCode(); - } - - public boolean idEquals(@NonNull final String id) { - return id.equalsIgnoreCase(this.itemId); - } - - @Override public Object getRawId() { - return this.getItemId(); - } - - @Override public BaseBlock getBaseBlock() { - if (baseBlock == null) { - baseBlock = BlockTypes.get(itemId).getDefaultState().toBaseBlock(); - } - return baseBlock; - } - - @Override public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null || getClass() != obj.getClass()) { - return false; - } - StringPlotBlock other = (StringPlotBlock) obj; - return other.nameSpace.equals(this.nameSpace) && other.itemId.equals(this.itemId); - } -} diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/StringWrapper.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/StringWrapper.java index 12d0a11aa..aa1e6e471 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/StringWrapper.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/StringWrapper.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + /** * */ diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/chat/PlainChatManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/chat/PlainChatManager.java index 0353eb313..1af1fbf19 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/chat/PlainChatManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/chat/PlainChatManager.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object.chat; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.PlotMessage; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/FlatRandomCollection.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/FlatRandomCollection.java index 341fbb4f3..ef3cad495 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/FlatRandomCollection.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/FlatRandomCollection.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object.collection; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.util.MathMan; import java.util.ArrayList; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/RandomCollection.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/RandomCollection.java index b8dfa0a12..5778883f3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/RandomCollection.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/RandomCollection.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object.collection; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.util.Map; import java.util.Random; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/SimpleRandomCollection.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/SimpleRandomCollection.java index e75b64cb4..143649029 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/SimpleRandomCollection.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/SimpleRandomCollection.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object.collection; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.util.Map; import java.util.NavigableMap; import java.util.Random; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/CommentInbox.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/CommentInbox.java index 30d9b1230..b0b964060 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/CommentInbox.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/CommentInbox.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object.comment; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxOwner.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxOwner.java index 29cf003cf..bf1f56d25 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxOwner.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxOwner.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object.comment; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxPublic.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxPublic.java index 598904b0f..80e417801 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxPublic.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxPublic.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object.comment; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxReport.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxReport.java index fa44db6c2..e597fcd02 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxReport.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxReport.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object.comment; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/PlotComment.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/PlotComment.java index ada90457f..97579f29e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/PlotComment.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/PlotComment.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object.comment; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.PlotId; public class PlotComment { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/ItemType.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/ItemType.java deleted file mode 100644 index f558b5243..000000000 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/ItemType.java +++ /dev/null @@ -1,307 +0,0 @@ -package com.github.intellectualsites.plotsquared.plot.object.schematic; - -import java.util.EnumSet; -import java.util.HashMap; -import java.util.Map; - -public enum ItemType { - AIR("air", 0), STONE("stone", 1), GRANITE("stone", 1, 1), POLISHED_GRANITE("stone", 1, - 2), DIORITE("stone", 1, 3), POLISHED_DIORITE("stone", 1, 4), ANDESITE("stone", 1, - 5), POLISHED_ANDESITE("stone", 1, 6), GRASS("grass", 2), DIRT("dirt", 3), COARSE_DIRT( - "dirt", 3, 1), PODZOL("dirt", 3, 2), COBBLESTONE("cobblestone", 4), OAK_WOOD_PLANK("planks", - 5), SPRUCE_WOOD_PLANK("planks", 5, 1), BIRCH_WOOD_PLANK("planks", 5, 2), JUNGLE_WOOD_PLANK( - "planks", 5, 3), ACACIA_WOOD_PLANK("planks", 5, 4), DARK_OAK_WOOD_PLANK("planks", 5, - 5), OAK_SAPLING("sapling", 6), SPRUCE_SAPLING("sapling", 6, 1), BIRCH_SAPLING("sapling", 6, - 2), JUNGLE_SAPLING("sapling", 6, 3), ACACIA_SAPLING("sapling", 6, 4), DARK_OAK_SAPLING( - "sapling", 6, 5), BEDROCK("bedrock", 7), FLOWING_WATER("flowing_water", 8), STILL_WATER( - "water", 9), FLOWING_LAVA("flowing_lava", 10), STILL_LAVA("lava", 11), SAND("sand", - 12), RED_SAND("sand", 12, 1), GRAVEL("gravel", 13), GOLD_ORE("gold_ore", 14), IRON_ORE( - "iron_ore", 15), COAL_ORE("coal_ore", 16), OAK_WOOD("log", 17), SPRUCE_WOOD("log", 17, - 1), BIRCH_WOOD("log", 17, 2), JUNGLE_WOOD("log", 17, 3), OAK_LEAVES("leaves", - 18), SPRUCE_LEAVES("leaves", 18, 1), BIRCH_LEAVES("leaves", 18, 2), JUNGLE_LEAVES("leaves", - 18, 3), SPONGE("sponge", 19), WET_SPONGE("sponge", 19, 1), GLASS("glass", - 20), LAPIS_LAZULI_ORE("lapis_ore", 21), LAPIS_LAZULI_BLOCK("lapis_block", 22), DISPENSER( - "dispenser", 23), SANDSTONE("sandstone", 24), CHISELED_SANDSTONE("sandstone", 24, - 1), SMOOTH_SANDSTONE("sandstone", 24, 2), NOTE_BLOCK("noteblock", 25), BED("bed", - 26), POWERED_RAIL("golden_rail", 27), DETECTOR_RAIL("detector_rail", 28), STICKY_PISTON( - "sticky_piston", 29), COBWEB("web", 30), DEAD_SHRUB("tallgrass", 31), TALLGRASS("tallgrass", - 31, 1), FERN("tallgrass", 31, 2), DEAD_SHRUB1("deadbush", 32), PISTON("piston", - 33), PISTON_HEAD("piston_head", 34), WHITE_WOOL("wool", 35), ORANGE_WOOL("wool", 35, - 1), MAGENTA_WOOL("wool", 35, 2), LIGHT_BLUE_WOOL("wool", 35, 3), YELLOW_WOOL("wool", 35, - 4), LIME_WOOL("wool", 35, 5), PINK_WOOL("wool", 35, 6), GRAY_WOOL("wool", 35, - 7), LIGHT_GRAY_WOOL("wool", 35, 8), CYAN_WOOL("wool", 35, 9), PURPLE_WOOL("wool", 35, - 10), BLUE_WOOL("wool", 35, 11), BROWN_WOOL("wool", 35, 12), GREEN_WOOL("wool", 35, - 13), RED_WOOL("wool", 35, 14), BLACK_WOOL("wool", 35, 15), DANDELION("yellow_flower", - 37), POPPY("red_flower", 38), BLUE_ORCHID("red_flower", 38, 1), ALLIUM("red_flower", 38, - 2), AZURE_BLUET("red_flower", 38, 3), RED_TULIP("red_flower", 38, 4), ORANGE_TULIP( - "red_flower", 38, 5), WHITE_TULIP("red_flower", 38, 6), PINK_TULIP("red_flower", 38, - 7), OXEYE_DAISY("red_flower", 38, 8), BROWN_MUSHROOM("brown_mushroom", 39), RED_MUSHROOM( - "red_mushroom", 40), GOLD_BLOCK("gold_block", 41), IRON_BLOCK("iron_block", - 42), DOUBLE_STONE_SLAB("double_stone_slab", 43), DOUBLE_SANDSTONE_SLAB("double_stone_slab", - 43, 1), DOUBLE_WOODEN_SLAB("double_stone_slab", 43, 2), DOUBLE_COBBLESTONE_SLAB( - "double_stone_slab", 43, 3), DOUBLE_BRICK_SLAB("double_stone_slab", 43, - 4), DOUBLE_STONE_BRICK_SLAB("double_stone_slab", 43, 5), DOUBLE_NETHER_BRICK_SLAB( - "double_stone_slab", 43, 6), DOUBLE_QUARTZ_SLAB("double_stone_slab", 43, 7), STONE_SLAB( - "stone_slab", 44), SANDSTONE_SLAB("stone_slab", 44, 1), WOODEN_SLAB("stone_slab", 44, - 2), COBBLESTONE_SLAB("stone_slab", 44, 3), BRICK_SLAB("stone_slab", 44, - 4), STONE_BRICK_SLAB("stone_slab", 44, 5), NETHER_BRICK_SLAB("stone_slab", 44, - 6), QUARTZ_SLAB("stone_slab", 44, 7), BRICKS("brick_block", 45), TNT("tnt", 46), BOOKSHELF( - "bookshelf", 47), MOSS_STONE("mossy_cobblestone", 48), OBSIDIAN("obsidian", 49), TORCH( - "torch", 50), FIRE("fire", 51), MONSTER_SPAWNER("mob_spawner", 52), OAK_WOOD_STAIRS( - "oak_stairs", 53), CHEST("chest", 54), REDSTONE_WIRE("redstone_wire", 55), DIAMOND_ORE( - "diamond_ore", 56), DIAMOND_BLOCK("diamond_block", 57), CRAFTING_TABLE("crafting_table", - 58), WHEAT_CROPS("wheat", 59), FARMLAND("farmland", 60), FURNACE("furnace", - 61), BURNING_FURNACE("lit_furnace", 62), STANDING_SIGN_BLOCK("standing_sign", - 63), OAK_DOOR_BLOCK("wooden_door", 64), LADDER("ladder", 65), RAIL("rail", - 66), COBBLESTONE_STAIRS("stone_stairs", 67), WALL_MOUNTED_SIGN_BLOCK("wall_sign", - 68), LEVER("lever", 69), STONE_PRESSURE_PLATE("stone_pressure_plate", 70), IRON_DOOR_BLOCK( - "iron_door", 71), WOODEN_PRESSURE_PLATE("wooden_pressure_plate", 72), REDSTONE_ORE( - "redstone_ore", 73), GLOWING_REDSTONE_ORE("lit_redstone_ore", 74), REDSTONE_TORCH_OFF( - "unlit_redstone_torch", 75), REDSTONE_TORCH_ON("redstone_torch", 76), STONE_BUTTON( - "stone_button", 77), SNOW("snow_layer", 78), ICE("ice", 79), SNOW_BLOCK("snow", 80), CACTUS( - "cactus", 81), CLAY("clay", 82), SUGAR_CANES("reeds", 83), JUKEBOX("jukebox", - 84), OAK_FENCE("fence", 85), PUMPKIN("pumpkin", 86), NETHERRACK("netherrack", - 87), SOUL_SAND("soul_sand", 88), GLOWSTONE("glowstone", 89), NETHER_PORTAL("portal", - 90), JACK_OLANTERN("lit_pumpkin", 91), CAKE_BLOCK("cake", 92), REDSTONE_REPEATER_BLOCK_OFF( - "unpowered_repeater", 93), REDSTONE_REPEATER_BLOCK_ON("powered_repeater", - 94), WHITE_STAINED_GLASS("stained_glass", 95), ORANGE_STAINED_GLASS("stained_glass", 95, - 1), MAGENTA_STAINED_GLASS("stained_glass", 95, 2), LIGHT_BLUE_STAINED_GLASS("stained_glass", - 95, 3), YELLOW_STAINED_GLASS("stained_glass", 95, 4), LIME_STAINED_GLASS("stained_glass", - 95, 5), PINK_STAINED_GLASS("stained_glass", 95, 6), GRAY_STAINED_GLASS("stained_glass", 95, - 7), LIGHT_GRAY_STAINED_GLASS("stained_glass", 95, 8), CYAN_STAINED_GLASS("stained_glass", - 95, 9), PURPLE_STAINED_GLASS("stained_glass", 95, 10), BLUE_STAINED_GLASS("stained_glass", - 95, 11), BROWN_STAINED_GLASS("stained_glass", 95, 12), GREEN_STAINED_GLASS("stained_glass", - 95, 13), RED_STAINED_GLASS("stained_glass", 95, 14), BLACK_STAINED_GLASS("stained_glass", - 95, 15), WOODEN_TRAPDOOR("trapdoor", 96), STONE_MONSTER_EGG("monster_egg", - 97), COBBLESTONE_MONSTER_EGG("monster_egg", 97, 1), STONE_BRICK_MONSTER_EGG("monster_egg", - 97, 2), MOSSY_STONE_BRICK_MONSTER_EGG("monster_egg", 97, - 3), CRACKED_STONE_BRICK_MONSTER_EGG("monster_egg", 97, 4), CHISELED_STONE_BRICK_MONSTER_EGG( - "monster_egg", 97, 5), STONE_BRICKS("stonebrick", 98), MOSSY_STONE_BRICKS("stonebrick", 98, - 1), CRACKED_STONE_BRICKS("stonebrick", 98, 2), CHISELED_STONE_BRICKS("stonebrick", 98, - 3), RED_MUSHROOM_CAP("stonebrick", 99), BROWN_MUSHROOM_CAP("stonebrick", 100), IRON_BARS( - "iron_bars", 101), GLASS_PANE("glass_pane", 102), MELON_BLOCK("melon_block", - 103), PUMPKIN_STEM("pumpkin_stem", 104), MELON_STEM("melon_stem", 105), VINES("vine", - 106), OAK_FENCE_GATE("fence_gate", 107), BRICK_STAIRS("brick_stairs", - 108), STONE_BRICK_STAIRS("stone_brick_stairs", 109), MYCELIUM("mycelium", 110), LILY_PAD( - "waterlily", 111), NETHER_BRICK("nether_brick", 112), NETHER_BRICK_FENCE( - "nether_brick_fence", 113), NETHER_BRICK_STAIRS("nether_brick_stairs", 114), NETHER_WART( - "nether_wart", 115), ENCHANTMENT_TABLE("enchanting_table", 116), BREWING_STAND( - "brewing_stand", 117), CAULDRON("cauldron", 118), END_PORTAL("end_portal", - 119), END_PORTAL_FRAME("end_portal_frame", 120), END_STONE("end_stone", 121), DRAGON_EGG( - "dragon_egg", 122), REDSTONE_LAMP_INACTIVE("redstone_lamp", 123), REDSTONE_LAMP_ACTIVE( - "lit_redstone_lamp", 124), DOUBLE_OAK_WOOD_SLAB("double_wooden_slab", - 125), DOUBLE_SPRUCE_WOOD_SLAB("double_wooden_slab", 125, 1), DOUBLE_BIRCH_WOOD_SLAB( - "double_wooden_slab", 125, 2), DOUBLE_JUNGLE_WOOD_SLAB("double_wooden_slab", 125, - 3), DOUBLE_ACACIA_WOOD_SLAB("double_wooden_slab", 125, 4), DOUBLE_DARK_OAK_WOOD_SLAB( - "double_wooden_slab", 125, 5), OAK_WOOD_SLAB("wooden_slab", 126), SPRUCE_WOOD_SLAB( - "wooden_slab", 126, 1), BIRCH_WOOD_SLAB("wooden_slab", 126, 2), JUNGLE_WOOD_SLAB( - "wooden_slab", 126, 3), ACACIA_WOOD_SLAB("wooden_slab", 126, 4), DARK_OAK_WOOD_SLAB( - "wooden_slab", 126, 5), COCOA("cocoa", 127), SANDSTONE_STAIRS("sandstone_stairs", - 128), EMERALD_ORE("emerald_ore", 129), ENDER_CHEST("ender_chest", 130), TRIPWIRE_HOOK( - "tripwire_hook", 131), TRIPWIRE("tripwire_hook", 132), EMERALD_BLOCK("emerald_block", - 133), SPRUCE_WOOD_STAIRS("spruce_stairs", 134), BIRCH_WOOD_STAIRS("birch_stairs", - 135), JUNGLE_WOOD_STAIRS("jungle_stairs", 136), COMMAND_BLOCK("command_block", 137), BEACON( - "beacon", 138), COBBLESTONE_WALL("cobblestone_wall", 139), MOSSY_COBBLESTONE_WALL( - "cobblestone_wall", 139, 1), FLOWER_POT("flower_pot", 140), CARROTS("carrots", - 141), POTATOES("potatoes", 142), WOODEN_BUTTON("wooden_button", 143), MOB_HEAD("skull", - 144), ANVIL("anvil", 145), TRAPPED_CHEST("trapped_chest", - 146), WEIGHTED_PRESSURE_PLATE_LIGHT("light_weighted_pressure_plate", - 147), WEIGHTED_PRESSURE_PLATE_HEAVY("heavy_weighted_pressure_plate", - 148), REDSTONE_COMPARATOR_INACTIVE("unpowered_comparator", 149), REDSTONE_COMPARATOR_ACTIVE( - "powered_comparator", 150), DAYLIGHT_SENSOR("daylight_detector", 151), REDSTONE_BLOCK( - "redstone_block", 152), NETHER_QUARTZ_ORE("quartz_ore", 153), HOPPER("hopper", - 154), QUARTZ_BLOCK("quartz_block", 155), CHISELED_QUARTZ_BLOCK("quartz_block", 155, - 1), PILLAR_QUARTZ_BLOCK("quartz_block", 155, 2), QUARTZ_STAIRS("quartz_stairs", - 156), ACTIVATOR_RAIL("activator_rail", 157), DROPPER("dropper", 158), WHITE_STAINED_CLAY( - "stained_hardened_clay", 159), ORANGE_STAINED_CLAY("stained_hardened_clay", 159, - 1), MAGENTA_STAINED_CLAY("stained_hardened_clay", 159, 2), LIGHT_BLUE_STAINED_CLAY( - "stained_hardened_clay", 159, 3), YELLOW_STAINED_CLAY("stained_hardened_clay", 159, - 4), LIME_STAINED_CLAY("stained_hardened_clay", 159, 5), PINK_STAINED_CLAY( - "stained_hardened_clay", 159, 6), GRAY_STAINED_CLAY("stained_hardened_clay", 159, - 7), LIGHT_GRAY_STAINED_CLAY("stained_hardened_clay", 159, 8), CYAN_STAINED_CLAY( - "stained_hardened_clay", 159, 9), PURPLE_STAINED_CLAY("stained_hardened_clay", 159, - 10), BLUE_STAINED_CLAY("stained_hardened_clay", 159, 11), BROWN_STAINED_CLAY( - "stained_hardened_clay", 159, 12), GREEN_STAINED_CLAY("stained_hardened_clay", 159, - 13), RED_STAINED_CLAY("stained_hardened_clay", 159, 14), BLACK_STAINED_CLAY( - "stained_hardened_clay", 159, 15), WHITE_STAINED_GLASS_PANE("stained_glass_pane", - 160), ORANGE_STAINED_GLASS_PANE("stained_glass_pane", 160, 1), MAGENTA_STAINED_GLASS_PANE( - "stained_glass_pane", 160, 2), LIGHT_BLUE_STAINED_GLASS_PANE("stained_glass_pane", 160, - 3), YELLOW_STAINED_GLASS_PANE("stained_glass_pane", 160, 4), LIME_STAINED_GLASS_PANE( - "stained_glass_pane", 160, 5), PINK_STAINED_GLASS_PANE("stained_glass_pane", 160, - 6), GRAY_STAINED_GLASS_PANE("stained_glass_pane", 160, 7), LIGHT_GRAY_STAINED_GLASS_PANE( - "stained_glass_pane", 160, 8), CYAN_STAINED_GLASS_PANE("stained_glass_pane", 160, - 9), PURPLE_STAINED_GLASS_PANE("stained_glass_pane", 160, 10), BLUE_STAINED_GLASS_PANE( - "stained_glass_pane", 160, 11), BROWN_STAINED_GLASS_PANE("stained_glass_pane", 160, - 12), GREEN_STAINED_GLASS_PANE("stained_glass_pane", 160, 13), RED_STAINED_GLASS_PANE( - "stained_glass_pane", 160, 14), BLACK_STAINED_GLASS_PANE("stained_glass_pane", 160, - 15), ACACIA_LEAVES("leaves2", 161), DARK_OAK_LEAVES("leaves2", 161, 1), ACACIA_WOOD("log2", - 162), DARK_OAK_WOOD("log2", 162, 1), ACACIA_WOOD_STAIRS("acacia_stairs", - 163), DARK_OAK_WOOD_STAIRS("dark_oak_stairs", 164), SLIME_BLOCK("slime", 165), BARRIER( - "barrier", 166), IRON_TRAPDOOR("iron_trapdoor", 167), PRISMARINE("prismarine", - 168), PRISMARINE_BRICKS("prismarine", 168, 1), DARK_PRISMARINE("prismarine", 168, - 2), SEA_LANTERN("sea_lantern", 169), HAY_BALE("hay_block", 170), WHITE_CARPET("carpet", - 171), ORANGE_CARPET("carpet", 171, 1), MAGENTA_CARPET("carpet", 171, 2), LIGHT_BLUE_CARPET( - "carpet", 171, 3), YELLOW_CARPET("carpet", 171, 4), LIME_CARPET("carpet", 171, - 5), PINK_CARPET("carpet", 171, 6), GRAY_CARPET("carpet", 171, 7), LIGHT_GRAY_CARPET( - "carpet", 171, 8), CYAN_CARPET("carpet", 171, 9), PURPLE_CARPET("carpet", 171, - 10), BLUE_CARPET("carpet", 171, 11), BROWN_CARPET("carpet", 171, 12), GREEN_CARPET("carpet", - 171, 13), RED_CARPET("carpet", 171, 14), BLACK_CARPET("carpet", 171, 15), HARDENED_CLAY( - "hardened_clay", 172), BLOCK_OF_COAL("coal_block", 173), PACKED_ICE("packed_ice", - 174), SUNFLOWER("double_plant", 175), LILAC("double_plant", 175, 1), DOUBLE_TALLGRASS( - "double_plant", 175, 2), LARGE_FERN("double_plant", 175, 3), ROSE_BUSH("double_plant", 175, - 4), PEONY("double_plant", 175, 5), FREE_STANDING_BANNER("standing_banner", - 176), WALL_MOUNTED_BANNER("wall_banner", 177), INVERTED_DAYLIGHT_SENSOR( - "daylight_detector_inverted", 178), RED_SANDSTONE("red_sandstone", - 179), SMOOTH_RED_SANDSTONE("red_sandstone", 179, 1), CHISELED_RED_SANDSTONE("red_sandstone", - 179, 2), RED_SANDSTONE_STAIRS("red_sandstone_stairs", 180), DOUBLE_RED_SANDSTONE_SLAB( - "stone_slab2", 181), RED_SANDSTONE_SLAB("double_stone_slab2", 182), SPRUCE_FENCE_GATE( - "spruce_fence_gate", 183), BIRCH_FENCE_GATE("birch_fence_gate", 184), JUNGLE_FENCE_GATE( - "jungle_fence_gate", 185), DARK_OAK_FENCE_GATE("dark_oak_fence_gate", - 186), ACACIA_FENCE_GATE("acacia_fence_gate", 187), SPRUCE_FENCE("spruce_fence", - 188), BIRCH_FENCE("birch_fence", 189), JUNGLE_FENCE("jungle_fence", 190), DARK_OAK_FENCE( - "dark_oak_fence", 191), ACACIA_FENCE("acacia_fence", 192), SPRUCE_DOOR_BLOCK("spruce_door", - 193), BIRCH_DOOR_BLOCK("birch_door", 194), JUNGLE_DOOR_BLOCK("jungle_door", - 195), ACACIA_DOOR_BLOCK("acacia_door", 196), DARK_OAK_DOOR_BLOCK("dark_oak_door", - 197), IRON_SHOVEL("iron_shovel", 256), IRON_PICKAXE("iron_pickaxe", 257), IRON_AXE( - "iron_axe", 258), FLINT_AND_STEEL("flint_and_steel", 259), APPLE("apple", 260), BOW("bow", - 261), ARROW("arrow", 262), COAL("coal", 263), CHARCOAL("coal", 263, 1), DIAMOND("diamond", - 264), IRON_INGOT("iron_ingot", 265), GOLD_INGOT("gold_ingot", 266), IRON_SWORD("iron_sword", - 267), WOODEN_SWORD("wooden_sword", 268), WOODEN_SHOVEL("wooden_shovel", - 269), WOODEN_PICKAXE("wooden_pickaxe", 270), WOODEN_AXE("wooden_axe", 271), STONE_SWORD( - "stone_sword", 272), STONE_SHOVEL("stone_shovel", 273), STONE_PICKAXE("stone_pickaxe", - 274), STONE_AXE("stone_axe", 275), DIAMOND_SWORD("diamond_sword", 276), DIAMOND_SHOVEL( - "diamond_shovel", 277), DIAMOND_PICKAXE("diamond_pickaxe", 278), DIAMOND_AXE("diamond_axe", - 279), STICK("stick", 280), BOWL("bowl", 281), MUSHROOM_STEW("mushroom_stew", - 282), GOLDEN_SWORD("golden_sword", 283), GOLDEN_SHOVEL("golden_shovel", - 284), GOLDEN_PICKAXE("golden_pickaxe", 285), GOLDEN_AXE("golden_axe", 286), STRING("string", - 287), FEATHER("feather", 288), GUNPOWDER("gunpowder", 289), WOODEN_HOE("wooden_hoe", - 290), STONE_HOE("stone_hoe", 291), IRON_HOE("iron_hoe", 292), DIAMOND_HOE("diamond_hoe", - 293), GOLDEN_HOE("golden_hoe", 294), WHEAT_SEEDS("wheat_seeds", 295), WHEAT("wheat", - 296), BREAD("bread", 297), LEATHER_HELMET("leather_helmet", 298), LEATHER_TUNIC( - "leather_chestplate", 299), LEATHER_PANTS("leather_leggings", 300), LEATHER_BOOTS( - "leather_boots", 301), CHAINMAIL_HELMET("chainmail_helmet", 302), CHAINMAIL_CHESTPLATE( - "chainmail_chestplate", 303), CHAINMAIL_LEGGINGS("chainmail_leggings", - 304), CHAINMAIL_BOOTS("chainmail_boots", 305), IRON_HELMET("iron_helmet", - 306), IRON_CHESTPLATE("iron_chestplate", 307), IRON_LEGGINGS("iron_leggings", - 308), IRON_BOOTS("iron_boots", 309), DIAMOND_HELMET("diamond_helmet", - 310), DIAMOND_CHESTPLATE("diamond_chestplate", 311), DIAMOND_LEGGINGS("diamond_leggings", - 312), DIAMOND_BOOTS("diamond_boots", 313), GOLDEN_HELMET("golden_helmet", - 314), GOLDEN_CHESTPLATE("golden_chestplate", 315), GOLDEN_LEGGINGS("golden_leggings", - 316), GOLDEN_BOOTS("golden_boots", 317), FLINT("flint_and_steel", 318), RAW_PORKCHOP( - "porkchop", 319), COOKED_PORKCHOP("cooked_porkchop", 320), PAINTING("painting", - 321), GOLDEN_APPLE("golden_apple", 322), ENCHANTED_GOLDEN_APPLE("golden_apple", 322, - 1), SIGN("sign", 323), OAK_DOOR("wooden_door", 324), BUCKET("bucket", 325), WATER_BUCKET( - "water_bucket", 326), LAVA_BUCKET("lava_bucket", 327), MINECART("minecart", 328), SADDLE( - "saddle", 329), IRON_DOOR("iron_door", 330), REDSTONE("redstone", 331), SNOWBALL("snowball", - 332), BOAT("boat", 333), LEATHER("leather", 334), MILK_BUCKET("milk_bucket", 335), BRICK( - "brick", 336), CLAY1("clay_ball", 337), SUGAR_CANES1("reeds", 338), PAPER("paper", - 339), BOOK("book", 340), SLIMEBALL("slime_ball", 341), MINECART_WITH_CHEST("chest_minecart", - 342), MINECART_WITH_FURNACE("furnace_minecart", 343), EGG("egg", 344), COMPASS("compass", - 345), FISHING_ROD("fishing_rod", 346), CLOCK("clock", 347), GLOWSTONE_DUST("glowstone_dust", - 348), RAW_FISH("fish", 349), RAW_SALMON("fish", 349, 1), CLOWNFISH("fish", 349, - 2), PUFFERFISH("fish", 349, 3), COOKED_FISH("cooked_fish", 350), COOKED_SALMON( - "cooked_fish", 350, 1), INK_SACK("dye", 351), ROSE_RED("dye", 351, 1), CACTUS_GREEN("dye", - 351, 2), COCO_BEANS("dye", 351, 3), LAPIS_LAZULI("dye", 351, 4), PURPLE_DYE("dye", 351, - 5), CYAN_DYE("dye", 351, 6), LIGHT_GRAY_DYE("dye", 351, 7), GRAY_DYE("dye", 351, - 8), PINK_DYE("dye", 351, 9), LIME_DYE("dye", 351, 10), DANDELION_YELLOW("dye", 351, - 11), LIGHT_BLUE_DYE("dye", 351, 12), MAGENTA_DYE("dye", 351, 13), ORANGE_DYE("dye", 351, - 14), BONE_MEAL("dye", 351, 15), BONE("bone", 352), SUGAR("sugar", 353), CAKE("cake", - 354), BED1("bed", 355), REDSTONE_REPEATER("repeater", 356), COOKIE("cookie", 357), MAP( - "filled_map", 358), SHEARS("shears", 359), MELON("melon", 360), PUMPKIN_SEEDS( - "pumpkin_seeds", 361), MELON_SEEDS("melon_seeds", 362), RAW_BEEF("beef", 363), STEAK( - "cooked_beef", 364), RAW_CHICKEN("chicken", 365), COOKED_CHICKEN("cooked_chicken", - 366), ROTTEN_FLESH("rotten_flesh", 367), ENDER_PEARL("ender_pearl", 368), BLAZE_ROD( - "blaze_rod", 369), GHAST_TEAR("ghast_tear", 370), GOLD_NUGGET("gold_nugget", - 371), NETHER_WART1("nether_wart", 372), POTION("potion", 373), GLASS_BOTTLE("glass_bottle", - 374), SPIDER_EYE("spider_eye", 375), FERMENTED_SPIDER_EYE("fermented_spider_eye", - 376), BLAZE_POWDER("blaze_powder", 377), MAGMA_CREAM("magma_cream", 378), BREWING_STAND1( - "brewing_stand", 379), CAULDRON1("cauldron", 380), EYE_OF_ENDER("ender_eye", - 381), GLISTERING_MELON("speckled_melon", 382), SPAWN_CREEPER("spawn_egg", 383, - 50), SPAWN_SKELETON("spawn_egg", 383, 51), SPAWN_SPIDER("spawn_egg", 383, 52), SPAWN_ZOMBIE( - "spawn_egg", 383, 54), SPAWN_SLIME("spawn_egg", 383, 55), SPAWN_GHAST("spawn_egg", 383, - 56), SPAWN_PIGMAN("spawn_egg", 383, 57), SPAWN_ENDERMAN("spawn_egg", 383, - 58), SPAWN_CAVE_SPIDER("spawn_egg", 383, 59), SPAWN_SILVERFISH("spawn_egg", 383, - 60), SPAWN_BLAZE("spawn_egg", 383, 61), SPAWN_MAGMA_CUBE("spawn_egg", 383, 62), SPAWN_BAT( - "spawn_egg", 383, 65), SPAWN_WITCH("spawn_egg", 383, 66), SPAWN_ENDERMITE("spawn_egg", 383, - 67), SPAWN_GUARDIAN("spawn_egg", 383, 68), SPAWN_PIG("spawn_egg", 383, 90), SPAWN_SHEEP( - "spawn_egg", 383, 91), SPAWN_COW("spawn_egg", 383, 92), SPAWN_CHICKEN("spawn_egg", 383, - 93), SPAWN_SQUID("spawn_egg", 383, 94), SPAWN_WOLF("spawn_egg", 383, 95), SPAWN_MOOSHROOM( - "spawn_egg", 383, 96), SPAWN_OCELOT("spawn_egg", 383, 98), SPAWN_HORSE("spawn_egg", 383, - 100), SPAWN_RABBIT("spawn_egg", 383, 101), SPAWN_VILLAGER("spawn_egg", 383, - 120), BOTTLE_O_ENCHANTING("experience_bottle", 384), FIRE_CHARGE("fire_charge", - 385), BOOK_AND_QUILL("writable_book", 386), WRITTEN_BOOK("written_book", 387), EMERALD( - "emerald", 388), ITEM_FRAME("item_frame", 389), FLOWER_POT1("flower_pot", 390), CARROT( - "carrot", 391), POTATO("potato", 392), BAKED_POTATO("baked_potato", 393), POISONOUS_POTATO( - "poisonous_potato", 394), EMPTY_MAP("map", 395), GOLDEN_CARROT("golden_carrot", - 396), MOB_HEAD_SKELETON("skull", 397), MOB_HEAD_WITHER_SKELETON("skull", 397, - 1), MOB_HEAD_ZOMBIE("skull", 397, 2), MOB_HEAD_HUMAN("skull", 397, 3), MOB_HEAD_CREEPER( - "skull", 397, 4), CARROT_ON_A_STICK("carrot_on_a_stick", 398), NETHER_STAR("nether_star", - 399), PUMPKIN_PIE("pumpkin_pie", 400), FIREWORK_ROCKET("fireworks", 401), FIREWORK_STAR( - "firework_charge", 402), ENCHANTED_BOOK("enchanted_book", 403), REDSTONE_COMPARATOR( - "comparator", 404), NETHER_BRICK1("netherbrick", 405), NETHER_QUARTZ("quartz", - 406), MINECART_WITH_TNT("tnt_minecart", 407), MINECART_WITH_HOPPER("hopper_minecart", - 408), PRISMARINE_SHARD("prismarine_shard", 409), PRISMARINE_CRYSTALS("prismarine_crystals", - 410), RAW_RABBIT("rabbit", 411), COOKED_RABBIT("cooked_rabbit", 412), RABBIT_STEW( - "rabbit_stew", 413), RABBITS_FOOT("rabbit_foot", 414), RABBIT_HIDE("rabbit_hide", - 415), ARMOR_STAND("armor_stand", 416), IRON_HORSE_ARMOR("iron_horse_armor", - 417), GOLDEN_HORSE_ARMOR("golden_horse_armor", 418), DIAMOND_HORSE_ARMOR( - "diamond_horse_armor", 419), LEAD("lead", 420), NAME_TAG("name_tag", - 421), MINECART_WITH_COMMAND_BLOCK("command_block_minecart", 422), RAW_MUTTON("mutton", - 423), COOKED_MUTTON("cooked_mutton", 424), BANNER("banner", 425), SPRUCE_DOOR("spruce_door", - 427), BIRCH_DOOR("birch_door", 428), JUNGLE_DOOR("jungle_door", 429), ACACIA_DOOR( - "acacia_door", 430), DARK_OAK_DOOR("dark_oak_door", 431), DISC_13("record_13", - 2256), CAT_DISC("record_cat", 2257), BLOCKS_DISC("record_blocks", 2258), CHIRP_DISC( - "record_chirp", 2259), FAR_DISC("record_far", 2260), MALL_DISC("record_mall", - 2261), MELLOHI_DISC("record_mellohi", 2262), STAL_DISC("record_stal", 2263), STRAD_DISC( - "record_strad", 2264), WARD_DISC("record_ward", 2265), DISC_11("record_11", - 2266), WAIT_DISC("record_wait", 2267), END_ROD("end_rod", 198), CHORUS_PLANT("chorus_plant", - 199), CHORUS_FLOWER("chorus_flower", 200), PURPUR_BLOCK("purpur_block", 201), PURPUR_PILLAR( - "purpur_pillar", 202), PURPUR_STAIRS("purpur_stairs", 203), PURPUR_DOUBLE_SLAB( - "purpur_double_slab", 204), PURPUR_SLAB("purpur_slab", 205), END_BRICKS("end_bricks", - 206), BEETROOTS("beetroots", 207), GRASS_PATH("grass_path", 208), END_GATEWAY("end_gateway", - 209), REPEATING_COMMAND_BLOCK("repeating_command_block", 210), CHAIN_COMMAND_BLOCK( - "chain_command_block", 211), FROSTED_ICE("frosted_ice", 212), STRUCTURE_BLOCK( - "structure_block", 255); - - private static final Map ids = new HashMap<>(); - private static final Map datas = new HashMap<>(); - - static { - for (ItemType type : EnumSet.allOf(ItemType.class)) { - ids.put(type.name, type.id); - datas.put(type.name, type.data); - } - } - - private final int id; - private final byte data; - private final String name; - - ItemType(String name, int id) { - this.id = id; - this.data = 0; - this.name = name; - } - - ItemType(String name, int id, int data) { - this.id = id; - this.data = (byte) data; - this.name = name; - } - - public static int getId(String name) { - Integer value = ids.get(name); - if (value == null) { - return 0; - } - return value; - } - - public static byte getData(String name) { - Byte value = datas.get(name); - if (value == null) { - return 0; - } - return value; - } -} diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/PlotItem.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/PlotItem.java index 2b7e31295..6e3cc6688 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/PlotItem.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/PlotItem.java @@ -1,6 +1,9 @@ package com.github.intellectualsites.plotsquared.plot.object.schematic; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.item.ItemType; public class PlotItem { @@ -9,10 +12,10 @@ public class PlotItem { public final int z; // public final short[] id; // public final byte[] data; - public final PlotBlock[] types; + public final ItemType[] types; public final byte[] amount; - public PlotItem(short x, short y, short z, PlotBlock[] types, byte[] amount) { + public PlotItem(short x, short y, short z, ItemType[] types, byte[] amount) { this.x = x; this.y = y; this.z = z; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/Schematic.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/Schematic.java index e2c222df5..5977c1eb3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/Schematic.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/Schematic.java @@ -1,9 +1,11 @@ package com.github.intellectualsites.plotsquared.plot.object.schematic; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.sk89q.jnbt.NBTOutputStream; import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard; +import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.extent.clipboard.io.SpongeSchematicWriter; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BaseBlock; @@ -17,10 +19,10 @@ import java.util.Map; public class Schematic { // Lossy but fast - @Getter private final BlockArrayClipboard clipboard; + @Getter private final Clipboard clipboard; @Getter private Map flags = new HashMap<>(); - public Schematic(BlockArrayClipboard clip) { + public Schematic(Clipboard clip) { this.clipboard = clip; } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/StoredEntity.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/StoredEntity.java index a19404da2..6f31b68ed 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/StoredEntity.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/StoredEntity.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object.schematic; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.extent.Extent; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/stream/AbstractDelegateOutputStream.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/stream/AbstractDelegateOutputStream.java index 994f6a465..0223c45f6 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/stream/AbstractDelegateOutputStream.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/stream/AbstractDelegateOutputStream.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object.stream; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.io.IOException; import java.io.OutputStream; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/DefaultPlotAreaManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/DefaultPlotAreaManager.java index 8d5152a1b..a60d788df 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/DefaultPlotAreaManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/DefaultPlotAreaManager.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object.worlds; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/PlotAreaManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/PlotAreaManager.java index 7a59dab9d..b5156eae9 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/PlotAreaManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/PlotAreaManager.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object.worlds; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java index 7f63e2ed0..cfeba3ff2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object.worlds; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.object.BlockLoc; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java index 1f5e70856..a8b2c421f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object.worlds; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Configuration; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotAreaManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotAreaManager.java index f2e0b3c03..2dd7399ad 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotAreaManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotAreaManager.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object.worlds; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotManager.java index 49d3788d5..dedeeacdf 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotManager.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object.worlds; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.Location; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SingleWorldGenerator.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SingleWorldGenerator.java index d50e3d22f..a01bf0e70 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SingleWorldGenerator.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SingleWorldGenerator.java @@ -1,11 +1,13 @@ package com.github.intellectualsites.plotsquared.plot.object.worlds; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.generator.IndependentPlotGenerator; import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; @@ -35,7 +37,7 @@ public class SingleWorldGenerator extends IndependentPlotGenerator { blockBuckets[layer] = new BlockBucket[4096]; } blockBuckets[layer][((y & 0xF) << 8) | (z << 4) | x] = - BlockBucket.withSingle(PlotBlock.get("bedrock")); + BlockBucket.withSingle(BlockUtil.get("bedrock")); } } } @@ -47,7 +49,7 @@ public class SingleWorldGenerator extends IndependentPlotGenerator { blockBuckets[layer] = new BlockBucket[4096]; } blockBuckets[layer][((y & 0xF) << 8) | (z << 4) | x] = - BlockBucket.withSingle(PlotBlock.get("dirt")); + BlockBucket.withSingle(BlockUtil.get("dirt")); } } } @@ -59,7 +61,7 @@ public class SingleWorldGenerator extends IndependentPlotGenerator { blockBuckets[layer] = new BlockBucket[4096]; } blockBuckets[layer][((y & 0xF) << 8) | (z << 4) | x] = - BlockBucket.withSingle(PlotBlock.get("grass_block")); + BlockBucket.withSingle(BlockUtil.get("grass_block")); } } } @@ -71,12 +73,12 @@ public class SingleWorldGenerator extends IndependentPlotGenerator { if (area.VOID) { Location min = result.getMin(); if (min.getX() == 0 && min.getZ() == 0) { - result.setBlock(0, 0, 0, PlotBlock.get("bedrock")); + result.setBlock(0, 0, 0, BlockUtil.get("bedrock")); } } else { - result.setCuboid(bedrock1, bedrock2, PlotBlock.get("bedrock")); - result.setCuboid(dirt1, dirt2, PlotBlock.get("dirt")); - result.setCuboid(grass1, grass2, PlotBlock.get("grass_block")); + result.setCuboid(bedrock1, bedrock2, BlockUtil.get("bedrock")); + result.setCuboid(dirt1, dirt2, BlockUtil.get("dirt")); + result.setCuboid(grass1, grass2, BlockUtil.get("grass_block")); } result.fillBiome("PLAINS"); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ArrayUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ArrayUtil.java index 6052c2a93..9dd004cf1 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ArrayUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ArrayUtil.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.util.Arrays; public class ArrayUtil { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ByteArrayUtilities.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ByteArrayUtilities.java index ace8bb7e4..3b3b9d0c7 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ByteArrayUtilities.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ByteArrayUtilities.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public class ByteArrayUtilities { public static byte[] integerToBytes(int i) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChatManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChatManager.java index 1177206e6..5ffba6493 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChatManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChatManager.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.PlotMessage; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java index 206f2b710..e67c11265 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/CmdConfirm.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/CmdConfirm.java index e6cdc4134..a502f7538 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/CmdConfirm.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/CmdConfirm.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.CmdInstance; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/CommentManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/CommentManager.java index 4eff629d6..281b2f71b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/CommentManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/CommentManager.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ConsoleColors.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ConsoleColors.java index f8860887f..12afc3798 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ConsoleColors.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ConsoleColors.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public class ConsoleColors { public static String fromString(String input) { input = input.replaceAll("&0", fromChatColor("&0")).replaceAll("&1", fromChatColor("&1")) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EconHandler.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EconHandler.java index 4912b6e83..8554b2d78 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EconHandler.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EconHandler.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.ConsolePlayer; import com.github.intellectualsites.plotsquared.plot.object.OfflinePlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EntityUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EntityUtil.java index 51e093d46..ad8a19479 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EntityUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EntityUtil.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.flag.IntegerFlag; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EventUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EventUtil.java index 5d443a43e..51f055fea 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EventUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EventUtil.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; @@ -10,18 +12,22 @@ import com.github.intellectualsites.plotsquared.plot.object.LazyBlock; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.Rating; import com.github.intellectualsites.plotsquared.plot.object.worlds.SinglePlotArea; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; import org.jetbrains.annotations.Nullable; import java.util.HashSet; import java.util.List; import java.util.Optional; +import java.util.Set; import java.util.UUID; +import java.util.function.Supplier; public abstract class EventUtil { @@ -101,7 +107,7 @@ public abstract class EventUtil { } public boolean checkPlayerBlockEvent(PlotPlayer player, PlayerBlockEventType type, - Location location, LazyBlock block, boolean notifyPerms) { + Location location, Supplier block, boolean notifyPerms) { PlotArea area = location.getPlotArea(); assert area != null; Plot plot = area.getPlot(location); @@ -127,19 +133,19 @@ public abstract class EventUtil { Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(), notifyPerms); } - Optional> use = plot.getFlag(Flags.USE); + Optional> use = plot.getFlag(Flags.USE); if (use.isPresent()) { - HashSet value = use.get(); - if (PlotBlock.containsEverything(value) || value - .contains(block.getPlotBlock())) { + Set value = use.get(); + if (value.contains(BlockTypes.AIR) || value + .contains(block.get())) { return true; } } - Optional> destroy = plot.getFlag(Flags.BREAK); + Optional> destroy = plot.getFlag(Flags.BREAK); if (destroy.isPresent()) { - HashSet value = destroy.get(); - if (PlotBlock.containsEverything(value) || value - .contains(block.getPlotBlock())) { + Set value = destroy.get(); + if (value.contains(BlockTypes.AIR) || value + .contains(block.get())) { return true; } } @@ -221,10 +227,10 @@ public abstract class EventUtil { Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(), notifyPerms); } - Optional> flagValue = plot.getFlag(Flags.USE); - HashSet value = flagValue.orElse(null); - if (value == null || !PlotBlock.containsEverything(value) && !value - .contains(block.getPlotBlock())) { + Optional> flagValue = plot.getFlag(Flags.USE); + Set value = flagValue.orElse(null); + if (value == null || !value.contains(BlockTypes.AIR) && !value + .contains(block.get())) { return Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(), false) || !(!notifyPerms || MainUtil @@ -244,10 +250,10 @@ public abstract class EventUtil { Captions.PERMISSION_ADMIN_BUILD_UNOWNED.getTranslated(), notifyPerms); } - Optional> flagValue = plot.getFlag(Flags.PLACE); - HashSet value = flagValue.orElse(null); - if (value == null || !PlotBlock.containsEverything(value) && !value - .contains(block.getPlotBlock())) { + Optional> flagValue = plot.getFlag(Flags.PLACE); + Set value = flagValue.orElse(null); + if (value == null || !value.contains(BlockTypes.AIR) && !value + .contains(block.get())) { if (Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_BUILD_OTHER.getTranslated(), false)) { return true; @@ -271,10 +277,10 @@ public abstract class EventUtil { if (plot.getFlag(Flags.DEVICE_INTERACT).orElse(false)) { return true; } - Optional> flagValue = plot.getFlag(Flags.USE); - HashSet value = flagValue.orElse(null); - if (value == null || !PlotBlock.containsEverything(value) && !value - .contains(block.getPlotBlock())) { + Optional> flagValue = plot.getFlag(Flags.USE); + Set value = flagValue.orElse(null); + if (value == null || !value.contains(BlockTypes.AIR) && !value + .contains(block.get())) { if (Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(), false)) { @@ -298,10 +304,10 @@ public abstract class EventUtil { if (plot.getFlag(Flags.HOSTILE_INTERACT).orElse(false)) { return true; } - Optional> flagValue = plot.getFlag(Flags.USE); - HashSet value = flagValue.orElse(null); - if (value == null || !PlotBlock.containsEverything(value) && !value - .contains(block.getPlotBlock())) { + Optional> flagValue = plot.getFlag(Flags.USE); + Set value = flagValue.orElse(null); + if (value == null || !value.contains(BlockTypes.AIR) && !value + .contains(block.get())) { if (Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(), false)) { @@ -327,10 +333,10 @@ public abstract class EventUtil { if (plot.getFlag(Flags.MISC_INTERACT).orElse(false)) { return true; } - Optional> flag = plot.getFlag(Flags.USE); - HashSet value = flag.orElse(null); - if (value == null || !PlotBlock.containsEverything(value) && !value - .contains(block.getPlotBlock())) { + Optional> flag = plot.getFlag(Flags.USE); + Set value = flag.orElse(null); + if (value == null || !value.contains(BlockTypes.AIR) && !value + .contains(block.get())) { if (Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(), false)) { @@ -357,10 +363,10 @@ public abstract class EventUtil { if (plot.getFlag(Flags.VEHICLE_USE).orElse(false)) { return true; } - Optional> flag = plot.getFlag(Flags.USE); - HashSet value = flag.orElse(null); - if (value == null || !PlotBlock.containsEverything(value) && !value - .contains(block.getPlotBlock())) { + Optional> flag = plot.getFlag(Flags.USE); + Set value = flag.orElse(null); + if (value == null || !value.contains(BlockTypes.AIR) && !value + .contains(block.get())) { if (Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(), false)) { @@ -387,10 +393,10 @@ public abstract class EventUtil { if (plot.getFlag(Flags.MOB_PLACE).orElse(false)) { return true; } - Optional> flagValue = plot.getFlag(Flags.PLACE); - HashSet value = flagValue.orElse(null); - if (value == null || !PlotBlock.containsEverything(value) && !value - .contains(block.getPlotBlock())) { + Optional> flagValue = plot.getFlag(Flags.PLACE); + Set value = flagValue.orElse(null); + if (value == null || !value.contains(BlockTypes.AIR) && !value + .contains(block.get())) { if (Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(), false)) { @@ -417,10 +423,10 @@ public abstract class EventUtil { if (plot.getFlag(Flags.MISC_PLACE).orElse(false)) { return true; } - Optional> flag = plot.getFlag(Flags.PLACE); - HashSet value = flag.orElse(null); - if (value == null || !PlotBlock.containsEverything(value) && !value - .contains(block.getPlotBlock())) { + Optional> flag = plot.getFlag(Flags.PLACE); + Set value = flag.orElse(null); + if (value == null || !value.contains(BlockTypes.AIR) && !value + .contains(block.get())) { if (Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(), false)) { @@ -448,10 +454,10 @@ public abstract class EventUtil { if (plot.getFlag(Flags.VEHICLE_PLACE).orElse(false)) { return true; } - Optional> flag = plot.getFlag(Flags.PLACE); - HashSet value = flag.orElse(null); - if (value == null || !PlotBlock.containsEverything(value) && !value - .contains(block.getPlotBlock())) { + Optional> flag = plot.getFlag(Flags.PLACE); + Set value = flag.orElse(null); + if (value == null || !value.contains(BlockTypes.AIR) && !value + .contains(block.get())) { if (Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(), false)) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/HttpUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/HttpUtil.java index 761c5aa0a..ff5bfd98c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/HttpUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/HttpUtil.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.config.Settings; import java.io.BufferedReader; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/IncendoPaster.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/IncendoPaster.java index b5ebe5d17..300958f55 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/IncendoPaster.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/IncendoPaster.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.google.common.base.Charsets; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/InventoryUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/InventoryUtil.java index 03b87fc2b..3ce6f49cd 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/InventoryUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/InventoryUtil.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.PlotInventory; import com.github.intellectualsites.plotsquared.plot.object.PlotItemStack; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/LegacyConverter.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/LegacyConverter.java index dfbc0b3eb..e9dca64af 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/LegacyConverter.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/LegacyConverter.java @@ -1,10 +1,12 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import lombok.NonNull; import java.util.Collection; @@ -36,7 +38,7 @@ import java.util.Map; } private BlockBucket blockToBucket(@NonNull final String block) { - final PlotBlock plotBlock = WorldUtil.IMP.getClosestBlock(block).best; + final BlockState plotBlock = WorldUtil.IMP.getClosestBlock(block).best; return BlockBucket.withSingle(plotBlock); } @@ -48,9 +50,9 @@ import java.util.Map; section.set(string, blocks.toString()); } - private BlockBucket blockListToBucket(@NonNull final PlotBlock[] blocks) { - final Map counts = new HashMap<>(); - for (final PlotBlock block : blocks) { + private BlockBucket blockListToBucket(@NonNull final BlockState[] blocks) { + final Map counts = new HashMap<>(); + for (final BlockState block : blocks) { counts.putIfAbsent(block, 0); counts.put(block, counts.get(block) + 1); } @@ -63,7 +65,7 @@ import java.util.Map; } final BlockBucket bucket = new BlockBucket(); if (includeRatios) { - for (final Map.Entry count : counts.entrySet()) { + for (final Map.Entry count : counts.entrySet()) { bucket.addBlock(count.getKey(), count.getValue()); } } else { @@ -72,9 +74,9 @@ import java.util.Map; return bucket; } - private PlotBlock[] splitBlockList(@NonNull final List list) { + private BlockState[] splitBlockList(@NonNull final List list) { return list.stream().map(s -> WorldUtil.IMP.getClosestBlock(s).best) - .toArray(PlotBlock[]::new); + .toArray(BlockState[]::new); } private void convertBlock(@NonNull final ConfigurationSection section, @@ -86,14 +88,14 @@ import java.util.Map; private void convertBlockList(@NonNull final ConfigurationSection section, @NonNull final String key, @NonNull final List blockList) { - final PlotBlock[] blocks = this.splitBlockList(blockList); + final BlockState[] blocks = this.splitBlockList(blockList); final BlockBucket bucket = this.blockListToBucket(blocks); this.setString(section, key, bucket); PlotSquared.log( Captions.LEGACY_CONFIG_REPLACED.f(plotBlockArrayString(blocks), bucket.toString())); } - private String plotBlockArrayString(@NonNull final PlotBlock[] blocks) { + private String plotBlockArrayString(@NonNull final BlockState[] blocks) { final StringBuilder builder = new StringBuilder(); for (int i = 0; i < blocks.length; i++) { builder.append(blocks[i].toString()); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/LegacyMappings.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/LegacyMappings.java deleted file mode 100644 index d79ad6653..000000000 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/LegacyMappings.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.github.intellectualsites.plotsquared.plot.util; - -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; - -public abstract class LegacyMappings { - - public abstract PlotBlock fromAny(final String string); - - public abstract PlotBlock fromLegacyToString(final int id, final int data); - - public abstract PlotBlock fromLegacyToString(final String id); - - public abstract PlotBlock fromStringToLegacy(final String id); - -} diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java index af4b21e3c..e998c787d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandCaller; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.commands.Like; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MathMan.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MathMan.java index 00ea391ba..c82000adc 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MathMan.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MathMan.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public class MathMan { private static final int ATAN2_BITS = 7; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/Permissions.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/Permissions.java index c9a332bb9..8143a7588 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/Permissions.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/Permissions.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandCaller; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/PlotGameMode.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/PlotGameMode.java index b3b1fd5a7..f881f95e6 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/PlotGameMode.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/PlotGameMode.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public enum PlotGameMode { NOT_SET(-1, ""), SURVIVAL(0, "survival"), CREATIVE(1, "creative"), ADVENTURE(2, "adventure"), SPECTATOR(3, "spectator"); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/PlotWeather.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/PlotWeather.java index 62ea9cc33..759f423c3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/PlotWeather.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/PlotWeather.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public enum PlotWeather { RAIN, CLEAR, RESET } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ReflectionUtils.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ReflectionUtils.java index 621766c17..64cce0b02 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ReflectionUtils.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ReflectionUtils.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/RegExUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/RegExUtil.java index b9fc6ff09..56493658a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/RegExUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/RegExUtil.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.util.HashMap; import java.util.Map; import java.util.regex.Pattern; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java index 90a9b905f..7fa86c242 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.json.JSONArray; import com.github.intellectualsites.plotsquared.json.JSONException; import com.github.intellectualsites.plotsquared.plot.PlotSquared; @@ -19,7 +21,7 @@ import com.sk89q.jnbt.NBTInputStream; import com.sk89q.jnbt.NBTOutputStream; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard; +import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats; import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader; @@ -180,7 +182,7 @@ public abstract class SchematicHandler { return; } // block type and data arrays - final BlockArrayClipboard blockArrayClipboard = schematic.getClipboard(); + final Clipboard blockArrayClipboard = schematic.getClipboard(); // Calculate the optimal height to paste the schematic at final int y_offset_actual; if (autoHeight) { @@ -330,7 +332,7 @@ public abstract class SchematicHandler { ClipboardFormat format = ClipboardFormats.findByFile(file); if (format != null) { ClipboardReader reader = format.getReader(new FileInputStream(file)); - BlockArrayClipboard clip = (BlockArrayClipboard) reader.read(); + Clipboard clip = reader.read(); return new Schematic(clip); } else { throw new UnsupportedFormatException( @@ -357,13 +359,13 @@ public abstract class SchematicHandler { try { SpongeSchematicReader schematicReader = new SpongeSchematicReader(new NBTInputStream(new GZIPInputStream(is))); - BlockArrayClipboard clip = (BlockArrayClipboard) schematicReader.read(); + Clipboard clip = schematicReader.read(); return new Schematic(clip); } catch (IOException ignored) { try { MCEditSchematicReader schematicReader = new MCEditSchematicReader(new NBTInputStream(new GZIPInputStream(is))); - BlockArrayClipboard clip = (BlockArrayClipboard) schematicReader.read(); + Clipboard clip = schematicReader.read(); return new Schematic(clip); } catch (IOException e) { e.printStackTrace(); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SetupUtils.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SetupUtils.java index b77d991fe..670e01798 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SetupUtils.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SetupUtils.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.generator.GeneratorWrapper; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.SetupObject; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/StringComparison.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/StringComparison.java index dd6a1f960..f2a6cbde2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/StringComparison.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/StringComparison.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import java.util.ArrayList; import java.util.Collection; import java.util.Collections; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/StringMan.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/StringMan.java index 047b4a71f..304f55b32 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/StringMan.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/StringMan.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import org.jetbrains.annotations.NotNull; import java.lang.reflect.Array; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/TaskManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/TaskManager.java index f6e86cd92..a558487c5 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/TaskManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/TaskManager.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandler.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandler.java index 9967e88eb..5fb4bfba7 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandler.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandler.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandlerImplementation.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandlerImplementation.java index b5e37ed93..927cc646c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandlerImplementation.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandlerImplementation.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UpdateUtility.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UpdateUtility.java index 0ad79b41b..d3f35e4b7 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UpdateUtility.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UpdateUtility.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import lombok.Getter; import lombok.NonNull; import lombok.RequiredArgsConstructor; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java index a503e1882..a82e50d9e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java @@ -1,9 +1,11 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; @@ -50,15 +52,15 @@ public abstract class WorldUtil { public abstract void saveWorld(String world); - public abstract String getClosestMatchingName(PlotBlock plotBlock); + public abstract String getClosestMatchingName(BlockState plotBlock); - public abstract boolean isBlockSolid(PlotBlock block); + public abstract boolean isBlockSolid(BlockState block); - public abstract StringComparison.ComparisonResult getClosestBlock(String name); + public abstract StringComparison.ComparisonResult getClosestBlock(String name); public abstract String getBiome(String world, int x, int z); - public abstract PlotBlock getBlock(Location location); + public abstract BlockState getBlock(Location location); public abstract int getHighestBlock(String world, int x, int z); @@ -161,5 +163,5 @@ public abstract class WorldUtil { return null; } - public abstract boolean isBlockSame(PlotBlock block1, PlotBlock block2); + public abstract boolean isBlockSame(BlockState block1, BlockState block2); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/area/QuadMap.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/area/QuadMap.java index 133088a2e..212778ccd 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/area/QuadMap.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/area/QuadMap.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util.area; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; import java.util.HashSet; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BasicLocalBlockQueue.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BasicLocalBlockQueue.java index ad20a5b99..d524e2af9 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BasicLocalBlockQueue.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BasicLocalBlockQueue.java @@ -1,6 +1,8 @@ package com.github.intellectualsites.plotsquared.plot.util.block; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.MathMan; @@ -30,7 +32,7 @@ public abstract class BasicLocalBlockQueue extends LocalBlockQueue { public abstract LocalChunk getLocalChunk(int x, int z); - @Override public abstract PlotBlock getBlock(int x, int y, int z); + @Override public abstract BlockState getBlock(int x, int y, int z); public abstract void setComponents(LocalChunk lc) throws ExecutionException, InterruptedException; @@ -111,11 +113,11 @@ public abstract class BasicLocalBlockQueue extends LocalBlockQueue { return true; } - @Override public boolean setBlock(int x, int y, int z, PlotBlock id) { - // Trying to mix PlotBlock and BaseBlock leads to all kinds of issues. - // Since BaseBlock has more features than PlotBlock, simply convert - // all PlotBlocks to BaseBlocks - return setBlock(x, y, z, id.getBaseBlock()); + @Override public boolean setBlock(int x, int y, int z, BlockState id) { + // Trying to mix BlockState and BaseBlock leads to all kinds of issues. + // Since BaseBlock has more features than BlockState, simply convert + // all BlockStates to BaseBlocks + return setBlock(x, y, z, id.toBaseBlock()); } @Override public final boolean setBiome(int x, int z, String biome) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BlockUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BlockUtil.java new file mode 100644 index 000000000..c83375edc --- /dev/null +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BlockUtil.java @@ -0,0 +1,89 @@ +package com.github.intellectualsites.plotsquared.plot.util.block; + +import com.github.intellectualsites.plotsquared.configuration.serialization.ConfigurationSerializable; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + +import com.github.intellectualsites.plotsquared.plot.util.MathMan; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.extension.input.InputParseException; +import com.sk89q.worldedit.extension.input.ParserContext; +import com.sk89q.worldedit.internal.registry.InputParser; +import com.sk89q.worldedit.world.block.BaseBlock; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.block.FuzzyBlockState; +import com.sk89q.worldedit.world.registry.LegacyMapper; +import lombok.NonNull; + +import java.util.Map; + +public final class BlockUtil { + private BlockUtil(){} + + private static final ParserContext PARSER_CONTEXT = new ParserContext(); + + private static final InputParser PARSER; + + static { + PARSER_CONTEXT.setRestricted(false); + PARSER_CONTEXT.setPreferringWildcard(false); + PARSER_CONTEXT.setTryLegacy(true); + PARSER = WorldEdit.getInstance().getBlockFactory().getParsers().get(0); + } + + public static final BlockState get(int id) { + return LegacyMapper.getInstance().getBlockFromLegacy(id); + } + + public static final BlockState get(int id, int data) { + return LegacyMapper.getInstance().getBlockFromLegacy(id, data); + } + + public static final BlockState get(String id) { + if (id.length() == 1 && id.charAt(0) == '*') { + return FuzzyBlockState.builder().type(BlockTypes.AIR).build(); + } + BlockType type = BlockType.REGISTRY.get(id); + if (type != null) { + return type.getDefaultState(); + } + if (Character.isDigit(id.charAt(0))) { + String[] split = id.split(":"); + if (MathMan.isInteger(split[0])) { + if (split.length == 2) { + if (MathMan.isInteger(split[1])) { + return get(Integer.parseInt(split[0]), Integer.parseInt(split[1])); + } + } else { + return get(Integer.parseInt(split[0])); + } + } + } + try { + BaseBlock block = PARSER.parseFromInput(id, PARSER_CONTEXT); + return block.toImmutableState(); + } catch (InputParseException e) { + e.printStackTrace(); + return null; + } + } + + public static final BlockState[] parse(String commaDelimited) { + String[] split = commaDelimited.split(",(?![^\\(\\[]*[\\]\\)])"); + BlockState[] result = new BlockState[split.length]; + for (int i = 0; i < split.length; i++) { + result[i] = get(split[i]); + } + return result; + } + + public static BlockState deserialize(@NonNull final Map map) { + if (map.containsKey("material")) { + final Object object = map.get("material"); + return get(object.toString()); + } + return null; + } + +} diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/DelegateLocalBlockQueue.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/DelegateLocalBlockQueue.java index c5c17b4a4..61e08a208 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/DelegateLocalBlockQueue.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/DelegateLocalBlockQueue.java @@ -1,6 +1,8 @@ package com.github.intellectualsites.plotsquared.plot.util.block; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + +import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BaseBlock; public class DelegateLocalBlockQueue extends LocalBlockQueue { @@ -62,11 +64,11 @@ public class DelegateLocalBlockQueue extends LocalBlockQueue { return parent.setBlock(x, y, z, id); } - @Override public boolean setBlock(int x, int y, int z, PlotBlock id) { + @Override public boolean setBlock(int x, int y, int z, BlockState id) { return parent.setBlock(x, y, z, id); } - @Override public PlotBlock getBlock(int x, int y, int z) { + @Override public BlockState getBlock(int x, int y, int z) { return parent.getBlock(x, y, z); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/GlobalBlockQueue.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/GlobalBlockQueue.java index 049b13d32..3aadb6ebf 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/GlobalBlockQueue.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/GlobalBlockQueue.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util.block; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal2; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/ItemUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/ItemUtil.java new file mode 100644 index 000000000..243d098ab --- /dev/null +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/ItemUtil.java @@ -0,0 +1,30 @@ +package com.github.intellectualsites.plotsquared.plot.util.block; + +import com.github.intellectualsites.plotsquared.plot.util.MathMan; +import com.sk89q.worldedit.world.item.ItemType; +import com.sk89q.worldedit.world.item.ItemTypes; +import com.sk89q.worldedit.world.registry.LegacyMapper; + +import java.util.Locale; + +public final class ItemUtil { + private ItemUtil(){} + + public static ItemType get(String input) { + input = input.toLowerCase(Locale.ROOT); + if (Character.isDigit(input.charAt(0))) { + String[] split = input.split(":"); + if (MathMan.isInteger(split[0])) { + if (split.length == 2) { + if (MathMan.isInteger(split[1])) { + return LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(split[0]), Integer.parseInt(split[1])); + } + } else { + return LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(split[0])); + } + } + } + if (!input.split("\\[", 2)[0].contains(":")) input = "minecraft:" + input; + return ItemTypes.get(input); + } +} diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/LocalBlockQueue.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/LocalBlockQueue.java index 1ce8ccd11..8fc6011e2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/LocalBlockQueue.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/LocalBlockQueue.java @@ -1,8 +1,10 @@ package com.github.intellectualsites.plotsquared.plot.util.block; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.Location; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.util.SchematicHandler; import com.github.intellectualsites.plotsquared.plot.util.StringMan; @@ -53,7 +55,7 @@ public abstract class LocalBlockQueue { * @param z the z coordinate from 0 to 15 inclusive * @param id the id to set the block to */ - public abstract boolean setBlock(final int x, final int y, final int z, final PlotBlock id); + public abstract boolean setBlock(final int x, final int y, final int z, final BlockState id); public abstract boolean setBlock(final int x, final int y, final int z, final BaseBlock id); @@ -62,7 +64,7 @@ public abstract class LocalBlockQueue { return true; } - public abstract PlotBlock getBlock(int x, int y, int z); + public abstract BlockState getBlock(int x, int y, int z); public abstract boolean setBiome(int x, int z, String biome); @@ -100,7 +102,7 @@ public abstract class LocalBlockQueue { return GlobalBlockQueue.IMP.enqueue(this); } - public void setCuboid(Location pos1, Location pos2, PlotBlock block) { + public void setCuboid(Location pos1, Location pos2, BlockState block) { int yMin = Math.min(pos1.getY(), pos2.getY()); int yMax = Math.min(255, Math.max(pos1.getY(), pos2.getY())); int xMin = Math.min(pos1.getX(), pos2.getX()); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/OffsetLocalBlockQueue.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/OffsetLocalBlockQueue.java index d0a561111..075865ff5 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/OffsetLocalBlockQueue.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/OffsetLocalBlockQueue.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util.block; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.sk89q.worldedit.world.block.BaseBlock; public class OffsetLocalBlockQueue extends DelegateLocalBlockQueue { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/QueueProvider.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/QueueProvider.java index 3c96e0d5f..aebe4707d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/QueueProvider.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/QueueProvider.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util.block; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public abstract class QueueProvider { public static QueueProvider of(final Class primary, final Class fallback) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/ScopedLocalBlockQueue.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/ScopedLocalBlockQueue.java index 7e41887ed..0c404c548 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/ScopedLocalBlockQueue.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/ScopedLocalBlockQueue.java @@ -1,10 +1,12 @@ package com.github.intellectualsites.plotsquared.plot.util.block; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotManager; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal3; import com.sk89q.worldedit.world.block.BaseBlock; @@ -55,7 +57,7 @@ public class ScopedLocalBlockQueue extends DelegateLocalBlockQueue { .setBlock(x + minX, y + minY, z + minZ, id); } - @Override public boolean setBlock(int x, int y, int z, PlotBlock id) { + @Override public boolean setBlock(int x, int y, int z, BlockState id) { return x >= 0 && x <= dx && y >= 0 && y <= dy && z >= 0 && z <= dz && super .setBlock(x + minX, y + minY, z + minZ, id); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpireManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpireManager.java index dbd9773f0..906b15247 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpireManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpireManager.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util.expiry; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpirySettings.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpirySettings.java index ab95068da..95f4067f2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpirySettings.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpirySettings.java @@ -1,4 +1,6 @@ package com.github.intellectualsites.plotsquared.plot.util.expiry; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + public class ExpirySettings { } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpiryTask.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpiryTask.java index e959948b4..3e1c964dd 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpiryTask.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpiryTask.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util.expiry; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/PlotAnalysis.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/PlotAnalysis.java index 484759d66..4f18151cc 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/PlotAnalysis.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/PlotAnalysis.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util.expiry; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.flag.Flags; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpMenu.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpMenu.java index c10d9507b..1733d93b3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpMenu.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpMenu.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util.helpmenu; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandCaller; import com.github.intellectualsites.plotsquared.plot.commands.CommandCategory; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpObject.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpObject.java index 9981dd0f1..01c8e5f29 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpObject.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpObject.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util.helpmenu; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.Argument; import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpPage.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpPage.java index 5b165d32a..c701b2b9b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpPage.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpPage.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util.helpmenu; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.commands.CommandCaller; import com.github.intellectualsites.plotsquared.plot.commands.CommandCategory; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/uuid/UUIDWrapper.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/uuid/UUIDWrapper.java index c2a0af542..58f0ed56b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/uuid/UUIDWrapper.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/uuid/UUIDWrapper.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.uuid; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.object.OfflinePlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import org.jetbrains.annotations.NotNull; diff --git a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/FlagTest.java b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/FlagTest.java index c2b81a729..4b94e58a2 100644 --- a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/FlagTest.java +++ b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/FlagTest.java @@ -1,20 +1,24 @@ package com.github.intellectualsites.plotsquared.plot; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.database.AbstractDBTest; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.object.Plot; -import com.github.intellectualsites.plotsquared.plot.object.PlotBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.util.EventUtil; import com.github.intellectualsites.plotsquared.plot.util.EventUtilTest; +import com.sk89q.worldedit.world.block.BlockType; import org.junit.Before; import org.junit.Test; import java.util.Collection; import java.util.HashSet; import java.util.Optional; +import java.util.Set; import java.util.UUID; import static org.junit.Assert.assertEquals; @@ -36,13 +40,13 @@ public class FlagTest { Optional flag = plot.getFlag(use); if (flag.isPresent()) { System.out.println(Flags.USE.valueToString(flag.get())); - testBlock = PlotBlock.get((short) 1, (byte) 0); + testBlock = BlockUtil.get((short) 1, (byte) 0); flag.get().add(testBlock); } flag.ifPresent(collection -> System.out.println(Flags.USE.valueToString(collection))); - Optional> flag2 = plot.getFlag(Flags.USE); + Optional> flag2 = plot.getFlag(Flags.USE); if (flag2.isPresent()) { - // assertThat(flag2.get(), (Matcher>) IsCollectionContaining.hasItem(testBlock)); + // assertThat(flag2.get(), (Matcher>) IsCollectionContaining.hasItem(testBlock)); } if (flag.isPresent() && flag2.isPresent()) { assertEquals(flag.get(), flag2.get()); diff --git a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/PlotVersionTest.java b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/PlotVersionTest.java index 069c886da..d5570365f 100644 --- a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/PlotVersionTest.java +++ b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/PlotVersionTest.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import org.junit.Test; public class PlotVersionTest { diff --git a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDBTest.java b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDBTest.java index a2cc07d1b..37e7d8ba6 100644 --- a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDBTest.java +++ b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDBTest.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.database; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; diff --git a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/object/LocationTest.java b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/object/LocationTest.java index a421137c0..da13420fa 100644 --- a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/object/LocationTest.java +++ b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/object/LocationTest.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.object; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import org.junit.Test; import java.util.logging.Logger; diff --git a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/util/EventUtilTest.java b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/util/EventUtilTest.java index fd2a8db15..f5cfba022 100644 --- a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/util/EventUtilTest.java +++ b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/util/EventUtilTest.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandlerImplementationTest.java b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandlerImplementationTest.java index 58e43ff65..15b6ded37 100644 --- a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandlerImplementationTest.java +++ b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandlerImplementationTest.java @@ -1,5 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; + import com.github.intellectualsites.plotsquared.plot.database.AbstractDBTest; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; diff --git a/build.gradle b/build.gradle index 667ba16f8..99e3b3d1c 100644 --- a/build.gradle +++ b/build.gradle @@ -48,6 +48,14 @@ version = String.format("%s.%s", rootVersion, buildNumber) description = rootProject.name +allprojects { + gradle.projectsEvaluated { + tasks.withType(JavaCompile) { + options.compilerArgs << "-Xmaxerrs" << "1000" + } + } +} + subprojects { apply(plugin: "java") apply(plugin: "maven") From 7e6dc48d697432a26038d972ae5d1d561becaf56 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 4 Nov 2019 19:58:24 +0000 Subject: [PATCH 03/22] imports --- .../plotsquared/bukkit/BukkitMain.java | 4 ---- .../plotsquared/bukkit/chat/ArrayWrapper.java | 2 -- .../plotsquared/bukkit/chat/FancyMessage.java | 2 -- .../bukkit/chat/JsonRepresentedObject.java | 2 -- .../plotsquared/bukkit/chat/JsonString.java | 2 -- .../plotsquared/bukkit/chat/MessagePart.java | 2 -- .../plotsquared/bukkit/chat/Reflection.java | 2 -- .../plotsquared/bukkit/chat/TextualComponent.java | 2 -- .../plotsquared/bukkit/commands/DebugUUID.java | 2 -- .../bukkit/events/PlayerClaimPlotEvent.java | 2 -- .../bukkit/events/PlayerEnterPlotEvent.java | 2 -- .../bukkit/events/PlayerLeavePlotEvent.java | 2 -- .../bukkit/events/PlayerPlotDeniedEvent.java | 2 -- .../bukkit/events/PlayerPlotHelperEvent.java | 2 -- .../bukkit/events/PlayerPlotTrustedEvent.java | 2 -- .../bukkit/events/PlayerTeleportToPlotEvent.java | 2 -- .../plotsquared/bukkit/events/PlotAutoMergeEvent.java | 2 -- .../bukkit/events/PlotChangeOwnerEvent.java | 2 -- .../plotsquared/bukkit/events/PlotClearEvent.java | 2 -- .../bukkit/events/PlotComponentSetEvent.java | 2 -- .../plotsquared/bukkit/events/PlotDeleteEvent.java | 2 -- .../plotsquared/bukkit/events/PlotEvent.java | 2 -- .../plotsquared/bukkit/events/PlotFlagAddEvent.java | 2 -- .../bukkit/events/PlotFlagRemoveEvent.java | 2 -- .../plotsquared/bukkit/events/PlotMergeEvent.java | 2 -- .../plotsquared/bukkit/events/PlotRateEvent.java | 2 -- .../plotsquared/bukkit/events/PlotUnlinkEvent.java | 2 -- .../bukkit/generator/BukkitAugmentedGenerator.java | 2 -- .../bukkit/generator/BukkitPlotGenerator.java | 2 -- .../bukkit/generator/DelegatePlotGenerator.java | 5 +---- .../bukkit/generator/PlotBlockPopulator.java | 2 -- .../plotsquared/bukkit/listeners/ChunkListener.java | 2 -- .../bukkit/listeners/EntitySpawnListener.java | 2 -- .../bukkit/listeners/ForceFieldListener.java | 2 -- .../plotsquared/bukkit/listeners/PlayerEvents.java | 8 +++----- .../bukkit/listeners/PlotPlusListener.java | 2 -- .../bukkit/listeners/SingleWorldListener.java | 2 -- .../plotsquared/bukkit/listeners/WorldEvents.java | 2 -- .../plotsquared/bukkit/object/BukkitBlockUtil.java | 4 ---- .../bukkit/object/BukkitOfflinePlayer.java | 2 -- .../plotsquared/bukkit/object/BukkitPlayer.java | 6 +----- .../bukkit/object/entity/AgeableStats.java | 2 -- .../bukkit/object/entity/ArmorStandStats.java | 2 -- .../bukkit/object/entity/EntityBaseStats.java | 2 -- .../bukkit/object/entity/EntityWrapper.java | 2 -- .../plotsquared/bukkit/object/entity/HorseStats.java | 2 -- .../bukkit/object/entity/LivingEntityStats.java | 2 -- .../object/entity/ReplicatingEntityWrapper.java | 2 -- .../bukkit/object/entity/TameableStats.java | 2 -- .../bukkit/object/entity/TeleportEntityWrapper.java | 2 -- .../bukkit/object/schematic/StateWrapper.java | 2 -- .../plotsquared/bukkit/util/BukkitChatManager.java | 2 -- .../plotsquared/bukkit/util/BukkitChunkManager.java | 4 +--- .../plotsquared/bukkit/util/BukkitCommand.java | 2 -- .../plotsquared/bukkit/util/BukkitEconHandler.java | 2 -- .../plotsquared/bukkit/util/BukkitEventUtil.java | 2 -- .../plotsquared/bukkit/util/BukkitHybridUtils.java | 7 ++----- .../plotsquared/bukkit/util/BukkitInventoryUtil.java | 2 -- .../bukkit/util/BukkitSchematicHandler.java | 2 -- .../plotsquared/bukkit/util/BukkitSetupUtils.java | 2 -- .../plotsquared/bukkit/util/BukkitTaskManager.java | 2 -- .../plotsquared/bukkit/util/BukkitUtil.java | 8 +++----- .../plotsquared/bukkit/util/BukkitVersion.java | 2 -- .../plotsquared/bukkit/util/Metrics.java | 2 -- .../plotsquared/bukkit/util/NbtFactory.java | 2 -- .../plotsquared/bukkit/util/OfflinePlayerUtil.java | 2 -- .../plotsquared/bukkit/util/SendChunk.java | 2 -- .../plotsquared/bukkit/util/SetGenCB.java | 2 -- .../bukkit/util/block/BukkitLocalQueue.java | 5 ++--- .../plotsquared/bukkit/util/block/GenChunk.java | 6 ++---- .../plotsquared/bukkit/uuid/DatFileFilter.java | 2 -- .../plotsquared/bukkit/uuid/DefaultUUIDWrapper.java | 2 -- .../plotsquared/bukkit/uuid/FileUUIDHandler.java | 2 -- .../bukkit/uuid/LowerOfflineUUIDWrapper.java | 2 -- .../plotsquared/bukkit/uuid/OfflineUUIDWrapper.java | 2 -- .../plotsquared/bukkit/uuid/SQLUUIDHandler.java | 2 -- .../intellectualsites/plotsquared/api/PlotAPI.java | 2 -- .../plotsquared/commands/Argument.java | 2 -- .../plotsquared/commands/Command.java | 2 -- .../plotsquared/commands/CommandCaller.java | 2 -- .../plotsquared/commands/CommandDeclaration.java | 2 -- .../plotsquared/configuration/Configuration.java | 2 -- .../configuration/ConfigurationOptions.java | 2 -- .../configuration/ConfigurationSection.java | 2 -- .../configuration/InvalidConfigurationException.java | 2 -- .../configuration/MemoryConfiguration.java | 2 -- .../configuration/MemoryConfigurationOptions.java | 2 -- .../plotsquared/configuration/MemorySection.java | 2 -- .../configuration/file/FileConfiguration.java | 2 -- .../configuration/file/FileConfigurationOptions.java | 2 -- .../configuration/file/YamlConfiguration.java | 2 -- .../configuration/file/YamlConfigurationOptions.java | 2 -- .../configuration/file/YamlConstructor.java | 2 -- .../configuration/file/YamlRepresenter.java | 2 -- .../serialization/ConfigurationSerializable.java | 2 -- .../serialization/ConfigurationSerialization.java | 2 -- .../serialization/DelegateDeserialization.java | 2 -- .../configuration/serialization/SerializableAs.java | 2 -- .../intellectualsites/plotsquared/json/JSONArray.java | 2 -- .../plotsquared/json/JSONException.java | 2 -- .../plotsquared/json/JSONObject.java | 2 -- .../plotsquared/json/JSONString.java | 2 -- .../plotsquared/json/JSONTokener.java | 2 -- .../intellectualsites/plotsquared/json/Property.java | 2 -- .../intellectualsites/plotsquared/json/XML.java | 2 -- .../plotsquared/json/XMLTokener.java | 2 -- .../intellectualsites/plotsquared/plot/Platform.java | 2 -- .../plotsquared/plot/PlotSquared.java | 3 --- .../plotsquared/plot/PlotVersion.java | 2 -- .../plotsquared/plot/commands/Add.java | 2 -- .../plotsquared/plot/commands/Alias.java | 2 -- .../plotsquared/plot/commands/Area.java | 2 -- .../plotsquared/plot/commands/Auto.java | 2 -- .../plotsquared/plot/commands/Biome.java | 2 -- .../plotsquared/plot/commands/Buy.java | 2 -- .../plotsquared/plot/commands/Chat.java | 2 -- .../plotsquared/plot/commands/Claim.java | 2 -- .../plotsquared/plot/commands/Clear.java | 2 -- .../plotsquared/plot/commands/Cluster.java | 2 -- .../plotsquared/plot/commands/CommandCategory.java | 2 -- .../plotsquared/plot/commands/Comment.java | 2 -- .../plotsquared/plot/commands/Condense.java | 2 -- .../plotsquared/plot/commands/Confirm.java | 2 -- .../plotsquared/plot/commands/Continue.java | 2 -- .../plotsquared/plot/commands/Copy.java | 2 -- .../plot/commands/CreateRoadSchematic.java | 2 -- .../plotsquared/plot/commands/Database.java | 2 -- .../plotsquared/plot/commands/Debug.java | 2 -- .../plotsquared/plot/commands/DebugAllowUnsafe.java | 2 -- .../plotsquared/plot/commands/DebugClaimTest.java | 2 -- .../plotsquared/plot/commands/DebugExec.java | 4 +--- .../plotsquared/plot/commands/DebugFixFlags.java | 2 -- .../plotsquared/plot/commands/DebugImportWorlds.java | 2 -- .../plotsquared/plot/commands/DebugLoadTest.java | 2 -- .../plotsquared/plot/commands/DebugPaste.java | 2 -- .../plotsquared/plot/commands/DebugRoadRegen.java | 2 -- .../plotsquared/plot/commands/DebugSaveTest.java | 2 -- .../plotsquared/plot/commands/Delete.java | 2 -- .../plotsquared/plot/commands/Deny.java | 2 -- .../plotsquared/plot/commands/Desc.java | 2 -- .../plotsquared/plot/commands/Dislike.java | 2 -- .../plotsquared/plot/commands/Done.java | 2 -- .../plotsquared/plot/commands/Download.java | 2 -- .../plotsquared/plot/commands/FlagCmd.java | 6 +----- .../plotsquared/plot/commands/GenerateDocs.java | 2 -- .../plotsquared/plot/commands/Grant.java | 2 -- .../plotsquared/plot/commands/Help.java | 2 -- .../plotsquared/plot/commands/Inbox.java | 2 -- .../plotsquared/plot/commands/Info.java | 2 -- .../plotsquared/plot/commands/Kick.java | 2 -- .../plotsquared/plot/commands/Leave.java | 2 -- .../plotsquared/plot/commands/Like.java | 2 -- .../plotsquared/plot/commands/ListCmd.java | 2 -- .../plotsquared/plot/commands/Load.java | 2 -- .../plotsquared/plot/commands/MainCommand.java | 2 -- .../plotsquared/plot/commands/Merge.java | 2 -- .../plotsquared/plot/commands/Middle.java | 2 -- .../plotsquared/plot/commands/Move.java | 2 -- .../plotsquared/plot/commands/Music.java | 2 -- .../plotsquared/plot/commands/Near.java | 2 -- .../plotsquared/plot/commands/Owner.java | 2 -- .../plotsquared/plot/commands/PluginCmd.java | 2 -- .../plotsquared/plot/commands/Purge.java | 2 -- .../plotsquared/plot/commands/Rate.java | 2 -- .../plotsquared/plot/commands/RegenAllRoads.java | 2 -- .../plotsquared/plot/commands/Relight.java | 2 -- .../plotsquared/plot/commands/Reload.java | 2 -- .../plotsquared/plot/commands/Remove.java | 2 -- .../plotsquared/plot/commands/RequiredType.java | 2 -- .../plotsquared/plot/commands/Save.java | 2 -- .../plotsquared/plot/commands/SchematicCmd.java | 2 -- .../plotsquared/plot/commands/Set.java | 4 +--- .../plotsquared/plot/commands/SetCommand.java | 2 -- .../plotsquared/plot/commands/SetHome.java | 2 -- .../plotsquared/plot/commands/Setup.java | 2 -- .../plotsquared/plot/commands/SubCommand.java | 2 -- .../plotsquared/plot/commands/Swap.java | 2 -- .../plotsquared/plot/commands/Target.java | 2 -- .../plotsquared/plot/commands/Template.java | 2 -- .../plotsquared/plot/commands/Toggle.java | 2 -- .../plotsquared/plot/commands/Trim.java | 2 -- .../plotsquared/plot/commands/Trust.java | 2 -- .../plotsquared/plot/commands/Unlink.java | 2 -- .../plotsquared/plot/commands/Visit.java | 2 -- .../plotsquared/plot/commands/WE_Anywhere.java | 2 -- .../plotsquared/plot/config/Captions.java | 2 -- .../plotsquared/plot/config/Config.java | 2 -- .../plotsquared/plot/config/Configuration.java | 4 +--- .../plotsquared/plot/config/ConfigurationNode.java | 4 +--- .../plotsquared/plot/config/Settings.java | 2 -- .../plotsquared/plot/config/Storage.java | 2 -- .../plotsquared/plot/database/AbstractDB.java | 2 -- .../plotsquared/plot/database/DBFunc.java | 2 -- .../plotsquared/plot/database/Database.java | 2 -- .../plotsquared/plot/database/MySQL.java | 2 -- .../plotsquared/plot/database/SQLManager.java | 2 -- .../plotsquared/plot/database/SQLite.java | 2 -- .../plotsquared/plot/database/StmtMod.java | 2 -- .../plotsquared/plot/flag/BlockStateListFlag.java | 11 +++-------- .../plotsquared/plot/flag/BooleanFlag.java | 2 -- .../plotsquared/plot/flag/DoubleFlag.java | 2 -- .../plotsquared/plot/flag/EnumFlag.java | 2 -- .../intellectualsites/plotsquared/plot/flag/Flag.java | 2 -- .../plotsquared/plot/flag/FlagManager.java | 2 -- .../plotsquared/plot/flag/Flags.java | 2 -- .../plotsquared/plot/flag/GameModeFlag.java | 2 -- .../plotsquared/plot/flag/IntegerFlag.java | 2 -- .../plotsquared/plot/flag/IntegerListFlag.java | 2 -- .../plotsquared/plot/flag/IntervalFlag.java | 2 -- .../plotsquared/plot/flag/ListFlag.java | 2 -- .../plotsquared/plot/flag/LongFlag.java | 2 -- .../plotsquared/plot/flag/PlotWeatherFlag.java | 2 -- .../plotsquared/plot/flag/StringFlag.java | 2 -- .../plotsquared/plot/flag/StringListFlag.java | 2 -- .../plotsquared/plot/flag/TeleportDenyFlag.java | 2 -- .../plotsquared/plot/generator/AugmentedUtils.java | 5 +---- .../plot/generator/ClassicPlotManager.java | 4 +--- .../plotsquared/plot/generator/ClassicPlotWorld.java | 4 +--- .../plotsquared/plot/generator/GeneratorWrapper.java | 2 -- .../plotsquared/plot/generator/GridPlotManager.java | 2 -- .../plotsquared/plot/generator/GridPlotWorld.java | 2 -- .../plotsquared/plot/generator/HybridGen.java | 4 +--- .../plotsquared/plot/generator/HybridPlotManager.java | 5 ++--- .../plotsquared/plot/generator/HybridPlotWorld.java | 2 -- .../plotsquared/plot/generator/HybridUtils.java | 4 +--- .../plot/generator/IndependentPlotGenerator.java | 2 -- .../plotsquared/plot/generator/PlotGenerator.java | 2 -- .../plotsquared/plot/generator/SquarePlotManager.java | 2 -- .../plotsquared/plot/generator/SquarePlotWorld.java | 2 -- .../plotsquared/plot/listener/ExtentWrapper.java | 2 -- .../plot/listener/PlayerBlockEventType.java | 2 -- .../plotsquared/plot/listener/PlotListener.java | 5 +---- .../plotsquared/plot/listener/ProcessedWEExtent.java | 2 -- .../plotsquared/plot/listener/WEExtent.java | 2 -- .../plotsquared/plot/listener/WEManager.java | 2 -- .../plotsquared/plot/listener/WESubscriber.java | 2 -- .../plotsquared/plot/logger/DelegateLogger.java | 2 -- .../plotsquared/plot/logger/ILogger.java | 2 -- .../plotsquared/plot/object/BlockBucket.java | 2 -- .../plotsquared/plot/object/BlockLoc.java | 2 -- .../plotsquared/plot/object/ChunkWrapper.java | 2 -- .../plotsquared/plot/object/CmdInstance.java | 2 -- .../plotsquared/plot/object/ConsolePlayer.java | 4 ---- .../plotsquared/plot/object/Direction.java | 2 -- .../plotsquared/plot/object/Expression.java | 2 -- .../plotsquared/plot/object/FileBytes.java | 2 -- .../plotsquared/plot/object/LazyBlock.java | 1 - .../plotsquared/plot/object/LazyResult.java | 2 -- .../plotsquared/plot/object/Location.java | 2 -- .../plotsquared/plot/object/OfflinePlotPlayer.java | 2 -- .../plotsquared/plot/object/Plot.java | 3 +-- .../plotsquared/plot/object/PlotArea.java | 2 -- .../plotsquared/plot/object/PlotCluster.java | 2 -- .../plotsquared/plot/object/PlotFilter.java | 2 -- .../plotsquared/plot/object/PlotHandler.java | 2 -- .../plotsquared/plot/object/PlotId.java | 2 -- .../plotsquared/plot/object/PlotInventory.java | 2 -- .../plotsquared/plot/object/PlotItemStack.java | 4 ---- .../plotsquared/plot/object/PlotLoc.java | 2 -- .../plotsquared/plot/object/PlotManager.java | 2 -- .../plotsquared/plot/object/PlotMessage.java | 2 -- .../plotsquared/plot/object/PlotPlayer.java | 3 --- .../plotsquared/plot/object/PlotSettings.java | 2 -- .../plotsquared/plot/object/PseudoRandom.java | 2 -- .../plotsquared/plot/object/Rating.java | 2 -- .../plotsquared/plot/object/RegionWrapper.java | 2 -- .../plotsquared/plot/object/RunnableVal.java | 2 -- .../plotsquared/plot/object/RunnableVal2.java | 2 -- .../plotsquared/plot/object/RunnableVal3.java | 2 -- .../plotsquared/plot/object/SetupObject.java | 2 -- .../plotsquared/plot/object/StringWrapper.java | 2 -- .../plot/object/chat/PlainChatManager.java | 2 -- .../plot/object/collection/FlatRandomCollection.java | 2 -- .../plot/object/collection/RandomCollection.java | 2 -- .../object/collection/SimpleRandomCollection.java | 2 -- .../plotsquared/plot/object/comment/CommentInbox.java | 2 -- .../plotsquared/plot/object/comment/InboxOwner.java | 2 -- .../plotsquared/plot/object/comment/InboxPublic.java | 2 -- .../plotsquared/plot/object/comment/InboxReport.java | 2 -- .../plotsquared/plot/object/comment/PlotComment.java | 2 -- .../plotsquared/plot/object/schematic/PlotItem.java | 3 --- .../plotsquared/plot/object/schematic/Schematic.java | 2 -- .../plot/object/schematic/StoredEntity.java | 2 -- .../object/stream/AbstractDelegateOutputStream.java | 2 -- .../plot/object/worlds/DefaultPlotAreaManager.java | 2 -- .../plot/object/worlds/PlotAreaManager.java | 2 -- .../plotsquared/plot/object/worlds/SinglePlot.java | 2 -- .../plot/object/worlds/SinglePlotArea.java | 2 -- .../plot/object/worlds/SinglePlotAreaManager.java | 2 -- .../plot/object/worlds/SinglePlotManager.java | 2 -- .../plot/object/worlds/SingleWorldGenerator.java | 4 +--- .../plotsquared/plot/util/ArrayUtil.java | 2 -- .../plotsquared/plot/util/ByteArrayUtilities.java | 2 -- .../plotsquared/plot/util/ChatManager.java | 2 -- .../plotsquared/plot/util/ChunkManager.java | 2 -- .../plotsquared/plot/util/CmdConfirm.java | 2 -- .../plotsquared/plot/util/CommentManager.java | 2 -- .../plotsquared/plot/util/ConsoleColors.java | 2 -- .../plotsquared/plot/util/EconHandler.java | 2 -- .../plotsquared/plot/util/EntityUtil.java | 2 -- .../plotsquared/plot/util/EventUtil.java | 6 +----- .../plotsquared/plot/util/HttpUtil.java | 2 -- .../plotsquared/plot/util/IncendoPaster.java | 2 -- .../plotsquared/plot/util/InventoryUtil.java | 2 -- .../plotsquared/plot/util/LegacyConverter.java | 2 -- .../plotsquared/plot/util/MainUtil.java | 2 -- .../plotsquared/plot/util/MathMan.java | 2 -- .../plotsquared/plot/util/Permissions.java | 2 -- .../plotsquared/plot/util/PlotGameMode.java | 2 -- .../plotsquared/plot/util/PlotWeather.java | 2 -- .../plotsquared/plot/util/ReflectionUtils.java | 2 -- .../plotsquared/plot/util/RegExUtil.java | 2 -- .../plotsquared/plot/util/SchematicHandler.java | 2 -- .../plotsquared/plot/util/SetupUtils.java | 2 -- .../plotsquared/plot/util/StringComparison.java | 2 -- .../plotsquared/plot/util/StringMan.java | 2 -- .../plotsquared/plot/util/TaskManager.java | 2 -- .../plotsquared/plot/util/UUIDHandler.java | 2 -- .../plot/util/UUIDHandlerImplementation.java | 2 -- .../plotsquared/plot/util/UpdateUtility.java | 2 -- .../plotsquared/plot/util/WorldUtil.java | 4 +--- .../plotsquared/plot/util/area/QuadMap.java | 2 -- .../plot/util/block/BasicLocalBlockQueue.java | 4 +--- .../plotsquared/plot/util/block/BlockUtil.java | 3 --- .../plot/util/block/DelegateLocalBlockQueue.java | 4 +--- .../plotsquared/plot/util/block/GlobalBlockQueue.java | 2 -- .../plotsquared/plot/util/block/LocalBlockQueue.java | 4 +--- .../plot/util/block/OffsetLocalBlockQueue.java | 2 -- .../plotsquared/plot/util/block/QueueProvider.java | 2 -- .../plot/util/block/ScopedLocalBlockQueue.java | 4 +--- .../plotsquared/plot/util/expiry/ExpireManager.java | 2 -- .../plotsquared/plot/util/expiry/ExpirySettings.java | 2 -- .../plotsquared/plot/util/expiry/ExpiryTask.java | 2 -- .../plotsquared/plot/util/expiry/PlotAnalysis.java | 2 -- .../plotsquared/plot/util/helpmenu/HelpMenu.java | 2 -- .../plotsquared/plot/util/helpmenu/HelpObject.java | 2 -- .../plotsquared/plot/util/helpmenu/HelpPage.java | 2 -- .../plotsquared/plot/uuid/UUIDWrapper.java | 2 -- .../intellectualsites/plotsquared/plot/FlagTest.java | 5 +---- .../plotsquared/plot/PlotVersionTest.java | 2 -- .../plotsquared/plot/database/AbstractDBTest.java | 2 -- .../plotsquared/plot/object/LocationTest.java | 2 -- .../plotsquared/plot/util/EventUtilTest.java | 2 -- .../plot/util/UUIDHandlerImplementationTest.java | 2 -- 344 files changed, 40 insertions(+), 750 deletions(-) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java index 08a8dc4be..79579010b 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.generator.BukkitPlotGenerator; import com.github.intellectualsites.plotsquared.bukkit.listeners.ChunkListener; import com.github.intellectualsites.plotsquared.bukkit.listeners.EntitySpawnListener; @@ -67,7 +65,6 @@ import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; import com.github.intellectualsites.plotsquared.plot.util.block.QueueProvider; import com.github.intellectualsites.plotsquared.plot.uuid.UUIDWrapper; import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.bukkit.BukkitBlockRegistry; import io.papermc.lib.PaperLib; import lombok.Getter; import lombok.NonNull; @@ -75,7 +72,6 @@ import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Chunk; import org.bukkit.Location; -import org.bukkit.Material; import org.bukkit.OfflinePlayer; import org.bukkit.World; import org.bukkit.command.PluginCommand; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/ArrayWrapper.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/ArrayWrapper.java index 2b61b3d53..064d77d86 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/ArrayWrapper.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/ArrayWrapper.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.chat; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import org.apache.commons.lang.Validate; import java.lang.reflect.Array; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/FancyMessage.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/FancyMessage.java index 911ca6b3c..348f50f9a 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/FancyMessage.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/FancyMessage.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.chat; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/JsonRepresentedObject.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/JsonRepresentedObject.java index 32c365171..04f036526 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/JsonRepresentedObject.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/JsonRepresentedObject.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.chat; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.google.gson.stream.JsonWriter; import java.io.IOException; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/JsonString.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/JsonString.java index 9d9d7ab9c..7f8dd4d29 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/JsonString.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/JsonString.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.chat; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.google.gson.stream.JsonWriter; import org.bukkit.configuration.serialization.ConfigurationSerializable; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/MessagePart.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/MessagePart.java index deeeea0b3..64bdda48d 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/MessagePart.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/MessagePart.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.chat; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.google.common.collect.BiMap; import com.google.common.collect.ImmutableBiMap; import com.google.gson.stream.JsonWriter; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/Reflection.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/Reflection.java index 3d9e731c1..717e164ee 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/Reflection.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/Reflection.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.chat; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import org.bukkit.Bukkit; import java.lang.reflect.Field; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/TextualComponent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/TextualComponent.java index c292f7d5f..14e3d2305 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/TextualComponent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/TextualComponent.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.chat; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import com.google.gson.stream.JsonWriter; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/commands/DebugUUID.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/commands/DebugUUID.java index 9765d38b9..49d399da1 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/commands/DebugUUID.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/commands/DebugUUID.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.uuid.DatFileFilter; import com.github.intellectualsites.plotsquared.bukkit.uuid.DefaultUUIDWrapper; import com.github.intellectualsites.plotsquared.bukkit.uuid.LowerOfflineUUIDWrapper; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerClaimPlotEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerClaimPlotEvent.java index c8fbc78a4..269b64296 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerClaimPlotEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerClaimPlotEvent.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.events; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.Plot; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerEnterPlotEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerEnterPlotEvent.java index c0b0702e0..a40365b40 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerEnterPlotEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerEnterPlotEvent.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.events; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.Plot; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerLeavePlotEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerLeavePlotEvent.java index 04ea1a344..36482d44c 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerLeavePlotEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerLeavePlotEvent.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.events; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.Plot; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotDeniedEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotDeniedEvent.java index 23c011e8f..c9c4d56b9 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotDeniedEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotDeniedEvent.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.events; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.Plot; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotHelperEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotHelperEvent.java index 174bd1673..573d53ea8 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotHelperEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotHelperEvent.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.events; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.Plot; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotTrustedEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotTrustedEvent.java index 4ee2d9ca0..f2f9efe71 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotTrustedEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotTrustedEvent.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.events; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.Plot; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerTeleportToPlotEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerTeleportToPlotEvent.java index 6a4c4bccd..79d43391e 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerTeleportToPlotEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerTeleportToPlotEvent.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.events; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import org.bukkit.entity.Player; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotAutoMergeEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotAutoMergeEvent.java index 8722d86b4..059b296cf 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotAutoMergeEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotAutoMergeEvent.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.events; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import lombok.Getter; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotChangeOwnerEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotChangeOwnerEvent.java index 4c71093b3..3fba03284 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotChangeOwnerEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotChangeOwnerEvent.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.events; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import org.bukkit.entity.Player; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotClearEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotClearEvent.java index e4354d4fe..b4ab469a2 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotClearEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotClearEvent.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.events; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import org.bukkit.event.Cancellable; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotComponentSetEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotComponentSetEvent.java index 4c347657e..6911ccdd4 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotComponentSetEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotComponentSetEvent.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.events; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import org.bukkit.event.HandlerList; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotDeleteEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotDeleteEvent.java index 4720a0353..5199496ff 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotDeleteEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotDeleteEvent.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.events; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import org.bukkit.event.Cancellable; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotEvent.java index d8ea39fc3..ae4b0c1d7 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotEvent.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.events; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.Plot; import org.bukkit.event.Event; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotFlagAddEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotFlagAddEvent.java index e55b33920..e8c4ac63c 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotFlagAddEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotFlagAddEvent.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.events; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.object.Plot; import org.bukkit.event.Cancellable; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotFlagRemoveEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotFlagRemoveEvent.java index b8617e361..3e3e48b55 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotFlagRemoveEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotFlagRemoveEvent.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.events; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.object.Plot; import org.bukkit.event.Cancellable; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotMergeEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotMergeEvent.java index 9e1822960..55488011e 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotMergeEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotMergeEvent.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.events; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.Plot; import lombok.Getter; import lombok.Setter; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotRateEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotRateEvent.java index 9e494ba1c..b6ca46593 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotRateEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotRateEvent.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.events; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.Rating; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotUnlinkEvent.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotUnlinkEvent.java index 00a4d39dc..5db7d04d4 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotUnlinkEvent.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotUnlinkEvent.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.events; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import lombok.Getter; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/BukkitAugmentedGenerator.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/BukkitAugmentedGenerator.java index 85872ca9c..03b0c8123 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/BukkitAugmentedGenerator.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/BukkitAugmentedGenerator.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.generator; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.generator.AugmentedUtils; import org.bukkit.Chunk; import org.bukkit.World; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/BukkitPlotGenerator.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/BukkitPlotGenerator.java index 4fc0618cd..beafb2dc8 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/BukkitPlotGenerator.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/BukkitPlotGenerator.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.generator; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; import com.github.intellectualsites.plotsquared.bukkit.util.block.GenChunk; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/DelegatePlotGenerator.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/DelegatePlotGenerator.java index 0ffcad59c..c410a3e0b 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/DelegatePlotGenerator.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/DelegatePlotGenerator.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.generator; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.generator.HybridPlotWorld; @@ -9,10 +7,9 @@ import com.github.intellectualsites.plotsquared.plot.generator.IndependentPlotGe import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.sk89q.worldedit.bukkit.BukkitAdapter; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.util.MathMan; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; import lombok.RequiredArgsConstructor; import org.bukkit.World; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/PlotBlockPopulator.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/PlotBlockPopulator.java index 3e24f900f..de06df5a3 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/PlotBlockPopulator.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/PlotBlockPopulator.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.generator; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.generator.IndependentPlotGenerator; import com.github.intellectualsites.plotsquared.plot.object.ChunkWrapper; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/ChunkListener.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/ChunkListener.java index aa13e9dc5..046c0de8f 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/ChunkListener.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/ChunkListener.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.listeners; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.object.Location; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/EntitySpawnListener.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/EntitySpawnListener.java index 2e5c8fcc8..a982f39fd 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/EntitySpawnListener.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/EntitySpawnListener.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.listeners; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/ForceFieldListener.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/ForceFieldListener.java index 86136afeb..d2d588970 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/ForceFieldListener.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/ForceFieldListener.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.listeners; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java index d622d6d71..721121ba0 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java @@ -1,9 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.listeners; -import com.github.intellectualsites.plotsquared.bukkit.object.BukkitBlockUtil; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.BukkitMain; +import com.github.intellectualsites.plotsquared.bukkit.object.BukkitBlockUtil; import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; import com.github.intellectualsites.plotsquared.plot.PlotSquared; @@ -15,8 +13,6 @@ import com.github.intellectualsites.plotsquared.plot.listener.PlotListener; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.sk89q.worldedit.bukkit.BukkitAdapter; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotHandler; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.PlotInventory; @@ -32,6 +28,8 @@ import com.github.intellectualsites.plotsquared.plot.util.RegExUtil; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; import com.github.intellectualsites.plotsquared.plot.util.UpdateUtility; +import com.sk89q.worldedit.bukkit.BukkitAdapter; +import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; import io.papermc.lib.PaperLib; import org.bukkit.Bukkit; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlotPlusListener.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlotPlusListener.java index a3a82441d..b103ed7de 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlotPlusListener.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlotPlusListener.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.listeners; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.events.PlayerEnterPlotEvent; import com.github.intellectualsites.plotsquared.bukkit.events.PlayerLeavePlotEvent; import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/SingleWorldListener.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/SingleWorldListener.java index 47274c696..a53527fc9 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/SingleWorldListener.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/SingleWorldListener.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.listeners; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.worlds.PlotAreaManager; import com.github.intellectualsites.plotsquared.plot.object.worlds.SinglePlotAreaManager; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/WorldEvents.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/WorldEvents.java index 243e72dcb..afa821975 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/WorldEvents.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/WorldEvents.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.listeners; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.generator.BukkitPlotGenerator; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.generator.GeneratorWrapper; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitBlockUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitBlockUtil.java index 9c6672a49..1730ebd51 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitBlockUtil.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitBlockUtil.java @@ -1,11 +1,7 @@ package com.github.intellectualsites.plotsquared.bukkit.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - -import com.github.intellectualsites.plotsquared.plot.object.LazyBlock; import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockState; import org.bukkit.Material; import org.bukkit.block.Block; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitOfflinePlayer.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitOfflinePlayer.java index b26182f3f..7c52a25de 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitOfflinePlayer.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitOfflinePlayer.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.OfflinePlotPlayer; import org.bukkit.OfflinePlayer; import org.jetbrains.annotations.NotNull; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitPlayer.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitPlayer.java index 80b4fb9c5..35fa0d20b 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitPlayer.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitPlayer.java @@ -1,13 +1,9 @@ package com.github.intellectualsites.plotsquared.bukkit.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Location; -import com.sk89q.worldedit.bukkit.BukkitAdapter; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.util.EconHandler; import com.github.intellectualsites.plotsquared.plot.util.MathMan; @@ -15,10 +11,10 @@ import com.github.intellectualsites.plotsquared.plot.util.PlotGameMode; import com.github.intellectualsites.plotsquared.plot.util.PlotWeather; import com.github.intellectualsites.plotsquared.plot.util.StringMan; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; +import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.world.item.ItemType; import io.papermc.lib.PaperLib; import org.bukkit.GameMode; -import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.WeatherType; import org.bukkit.entity.Player; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/AgeableStats.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/AgeableStats.java index b53edc5ea..5769f0e46 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/AgeableStats.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/AgeableStats.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.object.entity; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - class AgeableStats { int age; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/ArmorStandStats.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/ArmorStandStats.java index 44ebdb8b6..56b36e2bb 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/ArmorStandStats.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/ArmorStandStats.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.object.entity; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - class ArmorStandStats { final float[] head = new float[3]; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/EntityBaseStats.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/EntityBaseStats.java index 94c93f1fb..c36236a5d 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/EntityBaseStats.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/EntityBaseStats.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.object.entity; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - class EntityBaseStats { EntityWrapper passenger; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/EntityWrapper.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/EntityWrapper.java index b0e34a99c..d0b6f28b5 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/EntityWrapper.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/EntityWrapper.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.object.entity; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import lombok.Getter; import lombok.NonNull; import org.bukkit.Location; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/HorseStats.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/HorseStats.java index 86c10e868..7fd976258 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/HorseStats.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/HorseStats.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.object.entity; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import org.bukkit.entity.Horse; class HorseStats { diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/LivingEntityStats.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/LivingEntityStats.java index e6f8411f2..c702ffaa7 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/LivingEntityStats.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/LivingEntityStats.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.object.entity; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/ReplicatingEntityWrapper.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/ReplicatingEntityWrapper.java index 5e7b8f2d2..a237bf96a 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/ReplicatingEntityWrapper.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/ReplicatingEntityWrapper.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.object.entity; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import org.bukkit.Art; import org.bukkit.DyeColor; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/TameableStats.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/TameableStats.java index 4dfa1939b..f9e8ded36 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/TameableStats.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/TameableStats.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.object.entity; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import org.bukkit.entity.AnimalTamer; class TameableStats { diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/TeleportEntityWrapper.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/TeleportEntityWrapper.java index fcfbce2b8..7456ae10e 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/TeleportEntityWrapper.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/entity/TeleportEntityWrapper.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.object.entity; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.BukkitMain; import org.bukkit.Chunk; import org.bukkit.Location; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/schematic/StateWrapper.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/schematic/StateWrapper.java index 8f05a41f7..1d2d80198 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/schematic/StateWrapper.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/schematic/StateWrapper.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.object.schematic; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChatManager.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChatManager.java index 5f5f50ddd..ef3af32d9 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChatManager.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChatManager.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.chat.FancyMessage; import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChunkManager.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChunkManager.java index c92bf2452..e6731d6ce 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChunkManager.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChunkManager.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.object.entity.EntityWrapper; import com.github.intellectualsites.plotsquared.bukkit.object.entity.ReplicatingEntityWrapper; import com.github.intellectualsites.plotsquared.plot.PlotSquared; @@ -10,12 +8,12 @@ import com.github.intellectualsites.plotsquared.plot.listener.WEExtent; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotLoc; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitCommand.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitCommand.java index 49f6bf87a..190aa077a 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitCommand.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitCommand.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.commands.DebugUUID; import com.github.intellectualsites.plotsquared.plot.commands.MainCommand; import com.github.intellectualsites.plotsquared.plot.object.ConsolePlayer; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEconHandler.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEconHandler.java index 9dfb2c725..a9978b76c 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEconHandler.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEconHandler.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.object.BukkitOfflinePlayer; import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.plot.object.OfflinePlotPlayer; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEventUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEventUtil.java index 8fb7a41db..25ca0e16e 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEventUtil.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEventUtil.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.events.PlayerClaimPlotEvent; import com.github.intellectualsites.plotsquared.bukkit.events.PlayerEnterPlotEvent; import com.github.intellectualsites.plotsquared.bukkit.events.PlayerLeavePlotEvent; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java index 063c1363b..29c4c63b7 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.generator.BukkitPlotGenerator; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Settings; @@ -10,11 +8,8 @@ import com.github.intellectualsites.plotsquared.plot.generator.HybridUtils; import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.sk89q.worldedit.bukkit.BukkitAdapter; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.MathMan; @@ -22,7 +17,9 @@ import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.expiry.PlotAnalysis; +import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.world.block.BaseBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; import org.bukkit.Bukkit; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitInventoryUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitInventoryUtil.java index 60408171b..a5a64b307 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitInventoryUtil.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitInventoryUtil.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.plot.object.PlotInventory; import com.github.intellectualsites.plotsquared.plot.object.PlotItemStack; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSchematicHandler.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSchematicHandler.java index ad2233ed2..3f980d37c 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSchematicHandler.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSchematicHandler.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.object.schematic.StateWrapper; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSetupUtils.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSetupUtils.java index 44c2e13d5..59be5f5e7 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSetupUtils.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSetupUtils.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.generator.BukkitPlotGenerator; import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.configuration.file.YamlConfiguration; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitTaskManager.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitTaskManager.java index aaf9c787f..56448ff34 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitTaskManager.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitTaskManager.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.BukkitMain; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import org.bukkit.Bukkit; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java index d264cdc05..38c7e069d 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java @@ -1,14 +1,10 @@ package com.github.intellectualsites.plotsquared.bukkit.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; -import com.sk89q.worldedit.bukkit.BukkitAdapter; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; import com.github.intellectualsites.plotsquared.plot.object.schematic.PlotItem; @@ -17,7 +13,10 @@ import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.github.intellectualsites.plotsquared.plot.util.StringComparison; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.bukkit.BukkitWorld; +import com.sk89q.worldedit.world.block.BlockState; import lombok.NonNull; import org.bukkit.Bukkit; import org.bukkit.Material; @@ -41,7 +40,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; -import java.util.Locale; import java.util.Set; @SuppressWarnings({"unused", "WeakerAccess"}) public class BukkitUtil extends WorldUtil { diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitVersion.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitVersion.java index a073aa23d..8bfa3da59 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitVersion.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitVersion.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public class BukkitVersion { public static int[] v1_13_2 = {1, 13, 2}; public static int[] v1_13_1 = {1, 13, 1}; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/Metrics.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/Metrics.java index 45b6568d9..edc2f9669 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/Metrics.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/Metrics.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import org.bukkit.Bukkit; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.Player; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/NbtFactory.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/NbtFactory.java index 35030fa6a..10407f5ec 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/NbtFactory.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/NbtFactory.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.google.common.base.Splitter; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/OfflinePlayerUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/OfflinePlayerUtil.java index 7a2d53b27..a4ee94f80 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/OfflinePlayerUtil.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/OfflinePlayerUtil.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; import org.bukkit.entity.Entity; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SendChunk.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SendChunk.java index 0b8683cc8..8b5e89b27 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SendChunk.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SendChunk.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.Location; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SetGenCB.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SetGenCB.java index 17b046ec9..45814d639 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SetGenCB.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SetGenCB.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.generator.BukkitAugmentedGenerator; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.generator.GeneratorWrapper; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/BukkitLocalQueue.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/BukkitLocalQueue.java index 687626ad0..54e153845 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/BukkitLocalQueue.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/BukkitLocalQueue.java @@ -1,16 +1,15 @@ package com.github.intellectualsites.plotsquared.bukkit.util.block; import com.github.intellectualsites.plotsquared.bukkit.object.BukkitBlockUtil; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.object.schematic.StateWrapper; import com.github.intellectualsites.plotsquared.plot.PlotSquared; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.block.BasicLocalBlockQueue; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.world.block.BaseBlock; +import com.sk89q.worldedit.world.block.BlockState; import io.papermc.lib.PaperLib; import lombok.NonNull; import org.bukkit.Bukkit; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/GenChunk.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/GenChunk.java index 41d04222c..50dd042ad 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/GenChunk.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/GenChunk.java @@ -1,20 +1,18 @@ package com.github.intellectualsites.plotsquared.bukkit.util.block; import com.github.intellectualsites.plotsquared.bukkit.object.BukkitBlockUtil; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; import com.github.intellectualsites.plotsquared.plot.object.ChunkWrapper; import com.github.intellectualsites.plotsquared.plot.object.Location; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.world.block.BaseBlock; +import com.sk89q.worldedit.world.block.BlockState; import lombok.Getter; import lombok.Setter; import org.bukkit.Chunk; -import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Biome; import org.bukkit.generator.ChunkGenerator.BiomeGrid; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/DatFileFilter.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/DatFileFilter.java index 2be775fb3..2fb0892a7 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/DatFileFilter.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/DatFileFilter.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.uuid; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.io.File; import java.io.FilenameFilter; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/DefaultUUIDWrapper.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/DefaultUUIDWrapper.java index 04cdea922..40d902f8e 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/DefaultUUIDWrapper.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/DefaultUUIDWrapper.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.uuid; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.object.BukkitOfflinePlayer; import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.plot.object.OfflinePlotPlayer; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/FileUUIDHandler.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/FileUUIDHandler.java index 351668cb5..440aca318 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/FileUUIDHandler.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/FileUUIDHandler.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.uuid; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.util.NbtFactory; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/LowerOfflineUUIDWrapper.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/LowerOfflineUUIDWrapper.java index 41129644e..3f33387b9 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/LowerOfflineUUIDWrapper.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/LowerOfflineUUIDWrapper.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.uuid; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.OfflinePlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.google.common.base.Charsets; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/OfflineUUIDWrapper.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/OfflineUUIDWrapper.java index 74f067cc9..306f67e4e 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/OfflineUUIDWrapper.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/OfflineUUIDWrapper.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.uuid; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.bukkit.object.BukkitOfflinePlayer; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.OfflinePlotPlayer; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/SQLUUIDHandler.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/SQLUUIDHandler.java index 434bd8760..4c74be5b6 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/SQLUUIDHandler.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/uuid/SQLUUIDHandler.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.bukkit.uuid; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/api/PlotAPI.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/api/PlotAPI.java index adb7235cf..610362953 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/api/PlotAPI.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/api/PlotAPI.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.api; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.configuration.file.YamlConfiguration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Argument.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Argument.java index f50397294..7ae1985ce 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Argument.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Argument.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.PlotId; public abstract class Argument { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Command.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Command.java index 6472310fd..691daa93e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Command.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Command.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.configuration.file.YamlConfiguration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.commands.CommandCategory; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/CommandCaller.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/CommandCaller.java index eca768ecc..3b5ee295e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/CommandCaller.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/CommandCaller.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.commands.RequiredType; public interface CommandCaller { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/CommandDeclaration.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/CommandDeclaration.java index 6377796fc..851a03174 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/CommandDeclaration.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/CommandDeclaration.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.commands.CommandCategory; import com.github.intellectualsites.plotsquared.plot.commands.RequiredType; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/Configuration.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/Configuration.java index be132d9d3..c2b4b4d95 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/Configuration.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/Configuration.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.configuration; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.util.Map; /** diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/ConfigurationOptions.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/ConfigurationOptions.java index 808f942c9..81c96196d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/ConfigurationOptions.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/ConfigurationOptions.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.configuration; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - /** * Various settings for controlling the input and output of a {@link * Configuration}. diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/ConfigurationSection.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/ConfigurationSection.java index 6579332c8..0752dfb57 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/ConfigurationSection.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/ConfigurationSection.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.configuration; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.util.List; import java.util.Map; import java.util.Set; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/InvalidConfigurationException.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/InvalidConfigurationException.java index 81377a83e..e9c099ed1 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/InvalidConfigurationException.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/InvalidConfigurationException.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.configuration; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - /** * Exception thrown when attempting to load an invalid {@link Configuration}. */ diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemoryConfiguration.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemoryConfiguration.java index 0dbb112a6..20131cbe1 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemoryConfiguration.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemoryConfiguration.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.configuration; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.util.Map; /** diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemoryConfigurationOptions.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemoryConfigurationOptions.java index 89b99ffb3..22f9d751b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemoryConfigurationOptions.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemoryConfigurationOptions.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.configuration; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - /** * Various settings for controlling the input and output of a {@link * MemoryConfiguration}. diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemorySection.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemorySection.java index 68ef0f660..14233b758 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemorySection.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/MemorySection.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.configuration; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.LinkedHashSet; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/FileConfiguration.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/FileConfiguration.java index 686347a17..e8123cfc9 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/FileConfiguration.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/FileConfiguration.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.configuration.file; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.configuration.Configuration; import com.github.intellectualsites.plotsquared.configuration.InvalidConfigurationException; import com.github.intellectualsites.plotsquared.configuration.MemoryConfiguration; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/FileConfigurationOptions.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/FileConfigurationOptions.java index fe1e19ce2..6eb99bb6e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/FileConfigurationOptions.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/FileConfigurationOptions.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.configuration.file; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.configuration.Configuration; import com.github.intellectualsites.plotsquared.configuration.MemoryConfiguration; import com.github.intellectualsites.plotsquared.configuration.MemoryConfigurationOptions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConfiguration.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConfiguration.java index 7388ecd53..d8c41c3da 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConfiguration.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConfiguration.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.configuration.file; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.configuration.Configuration; import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.configuration.InvalidConfigurationException; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConfigurationOptions.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConfigurationOptions.java index b0dfae09d..a7e71cdaf 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConfigurationOptions.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConfigurationOptions.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.configuration.file; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - /** * Various settings for controlling the input and output of a {@link * YamlConfiguration}. diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConstructor.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConstructor.java index b0e288250..1f52f7abb 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConstructor.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConstructor.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.configuration.file; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.configuration.serialization.ConfigurationSerialization; import org.yaml.snakeyaml.constructor.SafeConstructor; import org.yaml.snakeyaml.error.YAMLException; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlRepresenter.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlRepresenter.java index 99263c761..ebe1aebee 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlRepresenter.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlRepresenter.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.configuration.file; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.configuration.serialization.ConfigurationSerializable; import com.github.intellectualsites.plotsquared.configuration.serialization.ConfigurationSerialization; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/ConfigurationSerializable.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/ConfigurationSerializable.java index 415f162d9..f83e7a468 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/ConfigurationSerializable.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/ConfigurationSerializable.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.configuration.serialization; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.util.Map; /** diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/ConfigurationSerialization.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/ConfigurationSerialization.java index 9f0374354..cb1abd54a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/ConfigurationSerialization.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/ConfigurationSerialization.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.configuration.serialization; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.configuration.Configuration; import java.lang.reflect.Constructor; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/DelegateDeserialization.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/DelegateDeserialization.java index 7267d5c2d..8a071cb2e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/DelegateDeserialization.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/DelegateDeserialization.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.configuration.serialization; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/SerializableAs.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/SerializableAs.java index c88a9c277..79b50998c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/SerializableAs.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/serialization/SerializableAs.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.configuration.serialization; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONArray.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONArray.java index cb4d5f99f..62ee01329 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONArray.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONArray.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.json; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.io.IOException; import java.io.StringWriter; import java.io.Writer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONException.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONException.java index 690dd78b2..67de10815 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONException.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONException.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.json; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - /** * The JSONException is thrown by the JSON.org classes when things are amiss. * diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONObject.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONObject.java index dc4d37bac..965e95644 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONObject.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONObject.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.json; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.io.IOException; import java.io.StringWriter; import java.io.Writer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONString.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONString.java index 116091822..019776e58 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONString.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONString.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.json; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - /** * The JSONString interface allows a toJSONString() method so that a class can change the * behavior of JSONObject.toString(), JSONArray.toString(), and diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONTokener.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONTokener.java index 673202d3b..195ceeb5d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONTokener.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONTokener.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.json; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/Property.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/Property.java index 50faeb1c6..7ace1989b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/Property.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/Property.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.json; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.util.Enumeration; import java.util.Iterator; import java.util.Properties; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/XML.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/XML.java index 65ce81e65..51a0cdb10 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/XML.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/XML.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.json; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.util.Iterator; /** diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/XMLTokener.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/XMLTokener.java index 84ee565f4..96d65541f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/XMLTokener.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/XMLTokener.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.json; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.util.HashMap; /** diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/Platform.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/Platform.java index 0278e90b6..1736edf6f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/Platform.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/Platform.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public enum Platform { Bukkit, Sponge, Spigot, Paper diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java index 88c9009a8..31f06f9d0 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.configuration.MemorySection; import com.github.intellectualsites.plotsquared.configuration.file.YamlConfiguration; @@ -26,7 +24,6 @@ import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotCluster; import com.github.intellectualsites.plotsquared.plot.object.PlotFilter; import com.github.intellectualsites.plotsquared.plot.object.PlotId; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotVersion.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotVersion.java index 13cd48798..4646a787a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotVersion.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotVersion.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public class PlotVersion { public final int year, month, day, hash, build; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Add.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Add.java index c51dbb1e7..d92dd4ea3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Add.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Add.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Alias.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Alias.java index 8250c4d20..401446243 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Alias.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Alias.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java index a01145e72..0f39ebe94 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java index 45a6fae1c..bf0a221b8 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Biome.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Biome.java index 1a18c5150..8b9ecb790 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Biome.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Biome.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Buy.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Buy.java index 343c7d96b..dbfd37768 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Buy.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Buy.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Chat.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Chat.java index b8fca9445..c2a3daf84 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Chat.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Chat.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Claim.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Claim.java index a691ff4b3..aba59ad05 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Claim.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Claim.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Clear.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Clear.java index fe3a45a8c..9dcd475a1 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Clear.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Clear.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Cluster.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Cluster.java index d0bc4127f..088273c9c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Cluster.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Cluster.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/CommandCategory.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/CommandCategory.java index fc910e50a..3958f2d39 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/CommandCategory.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/CommandCategory.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Captions; import lombok.RequiredArgsConstructor; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Comment.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Comment.java index 4ddd2b302..171a5bfe5 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Comment.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Comment.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Location; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Condense.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Condense.java index c00065f20..a9341f373 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Condense.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Condense.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Confirm.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Confirm.java index 4d9473387..75a4709b8 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Confirm.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Confirm.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Continue.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Continue.java index 9261ef796..961742c1b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Continue.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Continue.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Copy.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Copy.java index 9ca4816f9..de77513bc 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Copy.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Copy.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Location; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/CreateRoadSchematic.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/CreateRoadSchematic.java index 52d00568d..14fa6347e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/CreateRoadSchematic.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/CreateRoadSchematic.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.generator.HybridPlotWorld; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Database.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Database.java index 13e957a08..abbddc9ca 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Database.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Database.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Debug.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Debug.java index fe86acaaa..c1970f969 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Debug.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Debug.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugAllowUnsafe.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugAllowUnsafe.java index f827a5ffa..8413eae22 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugAllowUnsafe.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugAllowUnsafe.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugClaimTest.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugClaimTest.java index 7876177b5..411a3290b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugClaimTest.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugClaimTest.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugExec.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugExec.java index 82dc57b24..8bafa55b7 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugExec.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugExec.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; @@ -17,7 +15,6 @@ import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.OfflinePlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.PlotMessage; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; @@ -39,6 +36,7 @@ import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; import com.github.intellectualsites.plotsquared.plot.util.expiry.PlotAnalysis; import com.google.common.io.Files; +import com.sk89q.worldedit.world.block.BlockState; import javax.script.Bindings; import javax.script.ScriptContext; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugFixFlags.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugFixFlags.java index 946abaf82..ca848a6bb 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugFixFlags.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugFixFlags.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Argument; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugImportWorlds.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugImportWorlds.java index 1d72d34a6..978c95e34 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugImportWorlds.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugImportWorlds.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugLoadTest.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugLoadTest.java index adfd640b9..f12ce8d1e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugLoadTest.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugLoadTest.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugPaste.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugPaste.java index 522f11b8f..9ea6d7bdd 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugPaste.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugPaste.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugRoadRegen.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugRoadRegen.java index 33559079c..a268f8903 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugRoadRegen.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugRoadRegen.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.generator.HybridPlotManager; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugSaveTest.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugSaveTest.java index 698e7099a..0c544d096 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugSaveTest.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugSaveTest.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Delete.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Delete.java index adf8491e5..72c6da126 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Delete.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Delete.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Deny.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Deny.java index dc9dec874..5ddfde305 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Deny.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Deny.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Argument; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Desc.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Desc.java index 2ef572d73..d3b261ba8 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Desc.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Desc.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.flag.FlagManager; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Dislike.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Dislike.java index 315a9fea8..372231481 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Dislike.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Dislike.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Done.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Done.java index 282ab8331..055cfabd9 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Done.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Done.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Download.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Download.java index fbbffdf2d..776cff0f8 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Download.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Download.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCmd.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCmd.java index a0d1598b3..8ec105c88 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCmd.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCmd.java @@ -1,21 +1,18 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; +import com.github.intellectualsites.plotsquared.plot.flag.BlockStateListFlag; import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.flag.FlagManager; import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.flag.IntegerFlag; import com.github.intellectualsites.plotsquared.plot.flag.ListFlag; -import com.github.intellectualsites.plotsquared.plot.flag.BlockStateListFlag; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.MathMan; @@ -30,7 +27,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/GenerateDocs.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/GenerateDocs.java index 92cb8da1a..7a1d2cddc 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/GenerateDocs.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/GenerateDocs.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.util.StringMan; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Grant.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Grant.java index 289badf46..60ecbeab0 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Grant.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Grant.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Help.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Help.java index 5ffd80e45..7949df513 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Help.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Help.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandCaller; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Inbox.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Inbox.java index 9cbdde212..030ef0f44 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Inbox.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Inbox.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Info.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Info.java index 5182f86d4..fe42e5dd4 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Info.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Info.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Kick.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Kick.java index 5899da372..eb36f8e67 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Kick.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Kick.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Argument; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Leave.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Leave.java index a07330424..b51993326 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Leave.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Leave.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Like.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Like.java index 30e84f3bd..378da26c2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Like.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Like.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/ListCmd.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/ListCmd.java index 537e4bd1a..2b70e48e5 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/ListCmd.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/ListCmd.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.PlotSquared.SortType; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Load.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Load.java index 65fc58fc3..4b0305969 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Load.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Load.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/MainCommand.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/MainCommand.java index 4ebb48b83..dd060c88e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/MainCommand.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/MainCommand.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandCaller; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Merge.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Merge.java index c8d9ae379..43204b266 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Merge.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Merge.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Middle.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Middle.java index 3a9bd453c..f3acaf5a0 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Middle.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Middle.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Location; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Move.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Move.java index 4026bb1e3..02c7494cb 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Move.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Move.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Music.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Music.java index fb077e811..e60ee9ba1 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Music.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Music.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.flag.Flags; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Near.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Near.java index 25e83c4bd..d897fb3cf 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Near.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Near.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Owner.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Owner.java index daa0ae30e..55dbdbda4 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Owner.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Owner.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/PluginCmd.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/PluginCmd.java index f0b0b0fa4..8e31051fb 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/PluginCmd.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/PluginCmd.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.json.JSONObject; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Purge.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Purge.java index 99d104071..0825b9610 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Purge.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Purge.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Rate.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Rate.java index 884c23f16..f81f02719 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Rate.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Rate.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RegenAllRoads.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RegenAllRoads.java index 76a641095..e47cb610f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RegenAllRoads.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RegenAllRoads.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Relight.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Relight.java index a84ee8584..cc5c8c21a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Relight.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Relight.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Reload.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Reload.java index 777ea37d9..db900e91e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Reload.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Reload.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.configuration.MemorySection; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Remove.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Remove.java index 147405038..038355d83 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Remove.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Remove.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Argument; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RequiredType.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RequiredType.java index 5329ae2e2..2dc75f919 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RequiredType.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RequiredType.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandCaller; public enum RequiredType { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Save.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Save.java index a348bf461..d000f55e2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Save.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Save.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SchematicCmd.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SchematicCmd.java index d389924f4..130f2ad1d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SchematicCmd.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SchematicCmd.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Set.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Set.java index ae25ccaa5..771063217 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Set.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Set.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; @@ -12,7 +10,6 @@ import com.github.intellectualsites.plotsquared.plot.flag.FlagManager; import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.Plot; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotManager; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; @@ -21,6 +18,7 @@ import com.github.intellectualsites.plotsquared.plot.util.StringComparison; import com.github.intellectualsites.plotsquared.plot.util.StringMan; import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; +import com.sk89q.worldedit.world.block.BlockState; import java.util.ArrayList; import java.util.Arrays; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetCommand.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetCommand.java index d4b12fa7a..8b746c624 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetCommand.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetCommand.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetHome.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetHome.java index 3359fe060..4b742ad94 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetHome.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetHome.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.BlockLoc; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java index 4ea9f7411..82190f1b2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SubCommand.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SubCommand.java index 7c58f0f3d..458442ff2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SubCommand.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SubCommand.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Argument; import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Swap.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Swap.java index 2a9f0529e..b3ec2ff05 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Swap.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Swap.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Location; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Target.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Target.java index 03a3cf3d3..4dd37bdb0 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Target.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Target.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Argument; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Template.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Template.java index 14385ff1d..85a0fe633 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Template.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Template.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.configuration.InvalidConfigurationException; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Toggle.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Toggle.java index 8ae7c5e40..87411f1c6 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Toggle.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Toggle.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trim.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trim.java index 4f1740821..000aa9b56 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trim.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trim.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trust.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trust.java index d357ed435..c0cd3309e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trust.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trust.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Unlink.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Unlink.java index 8e4bd39b3..66682ccda 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Unlink.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Unlink.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Location; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java index 0f5c5f45b..e2b7fa382 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/WE_Anywhere.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/WE_Anywhere.java index add8d4540..36744cc44 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/WE_Anywhere.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/WE_Anywhere.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.commands; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java index 3a7613dd1..c319303b6 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.config; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandCaller; import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.configuration.file.YamlConfiguration; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Config.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Config.java index 177715d39..7234743cf 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Config.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Config.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.config; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.configuration.MemorySection; import com.github.intellectualsites.plotsquared.configuration.file.YamlConfiguration; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java index ea2f6f538..d8e141069 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java @@ -1,11 +1,9 @@ package com.github.intellectualsites.plotsquared.plot.config; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.util.StringComparison; import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; +import com.sk89q.worldedit.world.block.BlockState; import lombok.Getter; import lombok.NonNull; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/ConfigurationNode.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/ConfigurationNode.java index 05127f68d..2b6167e97 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/ConfigurationNode.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/ConfigurationNode.java @@ -1,10 +1,8 @@ package com.github.intellectualsites.plotsquared.plot.config; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.util.StringMan; +import com.sk89q.worldedit.world.block.BlockState; import java.util.ArrayList; import java.util.Arrays; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java index 8b2e4398d..b1e239c78 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.config; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.configuration.file.YamlConfiguration; import java.io.File; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Storage.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Storage.java index 59385e623..962e0468f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Storage.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Storage.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.config; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.io.File; import java.util.ArrayList; import java.util.Collections; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDB.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDB.java index 81565c4e2..5beef2aab 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDB.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDB.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.database; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/DBFunc.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/DBFunc.java index 38fc283b7..47a03cf60 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/DBFunc.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/DBFunc.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.database; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/Database.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/Database.java index 1126a7d83..4acecc01f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/Database.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/Database.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.database; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/MySQL.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/MySQL.java index 1a27ff618..f8b2cedb0 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/MySQL.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/MySQL.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.database; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Storage; import com.github.intellectualsites.plotsquared.plot.util.StringMan; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java index 55cb57b57..a62924e9e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.database; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLite.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLite.java index 2bb1d3dd5..10ceb8784 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLite.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLite.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.database; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import java.io.File; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/StmtMod.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/StmtMod.java index a390960c3..837d3a66a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/StmtMod.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/StmtMod.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.database; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.util.StringMan; import java.sql.PreparedStatement; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BlockStateListFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BlockStateListFlag.java index ee80b560e..61a5a25a1 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BlockStateListFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BlockStateListFlag.java @@ -1,19 +1,14 @@ package com.github.intellectualsites.plotsquared.plot.flag; -import com.github.intellectualsites.plotsquared.plot.object.Plot; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Captions; -import com.sk89q.worldedit.world.block.BlockState; +import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.util.StringMan; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Objects; import java.util.Set; -import java.util.function.Function; import java.util.stream.Collectors; public class BlockStateListFlag extends ListFlag> { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BooleanFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BooleanFlag.java index a44168e73..841df766c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BooleanFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BooleanFlag.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.flag; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/DoubleFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/DoubleFlag.java index 505f5cab6..8cc665471 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/DoubleFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/DoubleFlag.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.flag; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Captions; public class DoubleFlag extends Flag { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/EnumFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/EnumFlag.java index c86299a22..88119bbaa 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/EnumFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/EnumFlag.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.flag; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.util.StringMan; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flag.java index 03269827e..21047d9cd 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flag.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.flag; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.util.StringComparison; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/FlagManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/FlagManager.java index 4a4a7d64a..51391f788 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/FlagManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/FlagManager.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.flag; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flags.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flags.java index a84d041bc..bf04cd3fd 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flags.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flags.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.flag; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/GameModeFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/GameModeFlag.java index b67ae58ba..26510b35b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/GameModeFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/GameModeFlag.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.flag; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.util.PlotGameMode; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntegerFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntegerFlag.java index 2a83fbac7..ced532cd1 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntegerFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntegerFlag.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.flag; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntegerListFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntegerListFlag.java index 55260ec6f..1f24cb4a3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntegerListFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntegerListFlag.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.flag; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.util.StringMan; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntervalFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntervalFlag.java index af2b1345c..0468c59b2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntervalFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/IntervalFlag.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.flag; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Captions; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/ListFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/ListFlag.java index 7f1fd1aff..3085288b1 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/ListFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/ListFlag.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.flag; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/LongFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/LongFlag.java index b5ad2fca2..8d57e8865 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/LongFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/LongFlag.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.flag; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Captions; public class LongFlag extends Flag { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/PlotWeatherFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/PlotWeatherFlag.java index beb3e8836..43544748f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/PlotWeatherFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/PlotWeatherFlag.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.flag; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.util.PlotWeather; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/StringFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/StringFlag.java index 504b04a40..31447847c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/StringFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/StringFlag.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.flag; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Captions; public class StringFlag extends Flag { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/StringListFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/StringListFlag.java index 9717de1d9..a1e28aa3d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/StringListFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/StringListFlag.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.flag; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.util.StringMan; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/TeleportDenyFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/TeleportDenyFlag.java index 9dfa64dc5..6c02516fd 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/TeleportDenyFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/TeleportDenyFlag.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.flag; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/AugmentedUtils.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/AugmentedUtils.java index 1e2d1df5f..73a9e75d0 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/AugmentedUtils.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/AugmentedUtils.java @@ -1,18 +1,15 @@ package com.github.intellectualsites.plotsquared.plot.generator; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotManager; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.util.block.DelegateLocalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; +import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; import org.jetbrains.annotations.NotNull; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java index 293303bcf..d3eee1165 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java @@ -1,16 +1,14 @@ package com.github.intellectualsites.plotsquared.plot.generator; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.Direction; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; import com.github.intellectualsites.plotsquared.plot.util.MathMan; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotWorld.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotWorld.java index 7048ee8cf..249df910c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotWorld.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotWorld.java @@ -1,15 +1,13 @@ package com.github.intellectualsites.plotsquared.plot.generator; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Configuration; import com.github.intellectualsites.plotsquared.plot.config.ConfigurationNode; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; import org.jetbrains.annotations.NotNull; import java.lang.reflect.Field; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GeneratorWrapper.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GeneratorWrapper.java index ffe895f8b..ec5f971fc 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GeneratorWrapper.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GeneratorWrapper.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.generator; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.PlotArea; public interface GeneratorWrapper { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GridPlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GridPlotManager.java index 2590fd181..a0ed41226 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GridPlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GridPlotManager.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.generator; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotManager; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GridPlotWorld.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GridPlotWorld.java index d91d22f94..b0cc10323 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GridPlotWorld.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/GridPlotWorld.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.generator; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import org.jetbrains.annotations.NotNull; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridGen.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridGen.java index 29b1ee67d..aae8b3643 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridGen.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridGen.java @@ -1,15 +1,13 @@ package com.github.intellectualsites.plotsquared.plot.generator; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.util.MathMan; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; import com.sk89q.worldedit.world.block.BaseBlock; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java index 17129cc29..e87860190 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.generator; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.commands.Template; import com.github.intellectualsites.plotsquared.plot.config.Settings; @@ -9,16 +7,17 @@ import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.FileBytes; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.MathMan; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; import com.google.common.collect.Sets; import com.sk89q.worldedit.world.block.BaseBlock; +import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; import java.io.File; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotWorld.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotWorld.java index c53e1c9b6..6b44487ce 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotWorld.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotWorld.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.generator; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java index a638059a1..cc3a5ba02 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.generator; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.flag.FlagManager; @@ -10,7 +8,6 @@ import com.github.intellectualsites.plotsquared.plot.listener.WEExtent; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.PlotManager; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; @@ -26,6 +23,7 @@ import com.github.intellectualsites.plotsquared.plot.util.expiry.PlotAnalysis; import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.world.block.BaseBlock; +import com.sk89q.worldedit.world.block.BlockState; import java.io.File; import java.util.ArrayDeque; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/IndependentPlotGenerator.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/IndependentPlotGenerator.java index bda8a6ccb..def532368 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/IndependentPlotGenerator.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/IndependentPlotGenerator.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.generator; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/PlotGenerator.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/PlotGenerator.java index 0880a9e8b..88c7f2557 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/PlotGenerator.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/PlotGenerator.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.generator; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.PlotManager; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotManager.java index cc3f292cb..8ee343b3f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotManager.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.generator; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.Direction; import com.github.intellectualsites.plotsquared.plot.object.Location; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotWorld.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotWorld.java index 6ed48568d..c2d1ddb31 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotWorld.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotWorld.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.generator; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.PlotId; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/ExtentWrapper.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/ExtentWrapper.java index adfaf450d..5d0c86858 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/ExtentWrapper.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/ExtentWrapper.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.listener; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlayerBlockEventType.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlayerBlockEventType.java index 177b92699..815f5ea43 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlayerBlockEventType.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlayerBlockEventType.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.listener; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public enum PlayerBlockEventType { // Non interactive EAT, READ, diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java index ec6051199..a91a97f90 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.listener; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.flag.Flag; @@ -10,8 +8,6 @@ import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.github.intellectualsites.plotsquared.plot.util.block.ItemUtil; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.util.ByteArrayUtilities; @@ -24,6 +20,7 @@ import com.github.intellectualsites.plotsquared.plot.util.PlotWeather; import com.github.intellectualsites.plotsquared.plot.util.StringMan; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; +import com.github.intellectualsites.plotsquared.plot.util.block.ItemUtil; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemTypes; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/ProcessedWEExtent.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/ProcessedWEExtent.java index 8818ed437..7d2d824b4 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/ProcessedWEExtent.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/ProcessedWEExtent.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.listener; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEExtent.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEExtent.java index 39d30935b..073819fa3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEExtent.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEExtent.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.listener; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.BaseEntity; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEManager.java index c562f4f9a..3692efa51 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEManager.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.listener; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.flag.Flags; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WESubscriber.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WESubscriber.java index 5f9cac7fc..78379fd9e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WESubscriber.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WESubscriber.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.listener; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/logger/DelegateLogger.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/logger/DelegateLogger.java index ca9b988bb..ed925a135 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/logger/DelegateLogger.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/logger/DelegateLogger.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.logger; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public class DelegateLogger implements ILogger { private final ILogger parent; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/logger/ILogger.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/logger/ILogger.java index 050f2a365..16fb343bf 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/logger/ILogger.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/logger/ILogger.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.logger; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public interface ILogger { void log(String message); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java index b0ddc9d06..cc8e9cd72 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.configuration.serialization.ConfigurationSerializable; import com.github.intellectualsites.plotsquared.plot.config.Configuration; import com.github.intellectualsites.plotsquared.plot.object.collection.RandomCollection; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockLoc.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockLoc.java index 07094aec5..a4f02a9ef 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockLoc.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockLoc.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public class BlockLoc { private final int x; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ChunkWrapper.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ChunkWrapper.java index c1bc5c98d..e665ea752 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ChunkWrapper.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ChunkWrapper.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.github.intellectualsites.plotsquared.plot.util.StringMan; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/CmdInstance.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/CmdInstance.java index 182aa061e..27cb55216 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/CmdInstance.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/CmdInstance.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public class CmdInstance { public final Runnable command; public final long timestamp; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java index 8da0f74a3..4d9f23e5f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java @@ -1,15 +1,11 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.commands.RequiredType; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.util.PlotGameMode; import com.github.intellectualsites.plotsquared.plot.util.PlotWeather; -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.item.ItemType; -import com.sk89q.worldedit.world.item.ItemTypes; import org.jetbrains.annotations.NotNull; import java.util.UUID; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Direction.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Direction.java index f54e103a1..3c3900dc1 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Direction.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Direction.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public enum Direction { ALL(-1, "all"), NORTH(0, "north"), EAST(1, "east"), SOUTH(2, "south"), WEST(3, "west"), NORTHEAST(4, "northeast"), SOUTHEAST(5, "southeast"), SOUTHWEST(6, diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Expression.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Expression.java index 30c2f88b3..bb466c082 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Expression.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Expression.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.commands.DebugExec; import com.github.intellectualsites.plotsquared.plot.commands.MainCommand; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/FileBytes.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/FileBytes.java index 9c6c63022..d34521ee9 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/FileBytes.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/FileBytes.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public class FileBytes { public final String path; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LazyBlock.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LazyBlock.java index 490c256f5..9f3345a83 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LazyBlock.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LazyBlock.java @@ -1,6 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; import com.sk89q.worldedit.world.block.BlockState; public abstract class LazyBlock { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LazyResult.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LazyResult.java index a2391a86f..8487c44be 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LazyResult.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/LazyResult.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public abstract class LazyResult { private T result; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java index 8e7edf51a..5f2b6bafe 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.sk89q.worldedit.math.BlockVector2; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/OfflinePlotPlayer.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/OfflinePlotPlayer.java index f2e1a8dab..85e6e72d8 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/OfflinePlotPlayer.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/OfflinePlotPlayer.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.util.UUID; public interface OfflinePlotPlayer { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java index edb28ba12..c753cefe7 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Configuration; @@ -24,6 +22,7 @@ import com.github.intellectualsites.plotsquared.plot.util.StringMan; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java index 99b4709cd..b3217297d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Configuration; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java index ef68d8d45..d5d7c95d3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotFilter.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotFilter.java index bd941da6b..09759c09d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotFilter.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotFilter.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public abstract class PlotFilter { public boolean allowsArea(final PlotArea area) { return true; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotHandler.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotHandler.java index 62cfeec49..4faa17b76 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotHandler.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotHandler.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.util.Set; import java.util.UUID; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotId.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotId.java index 1076ad443..21e7dc777 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotId.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotId.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotInventory.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotInventory.java index 927f80872..4598a2fff 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotInventory.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotInventory.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.util.InventoryUtil; import lombok.NonNull; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotItemStack.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotItemStack.java index b306ebed9..b142eda79 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotItemStack.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotItemStack.java @@ -1,9 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - -import com.github.intellectualsites.plotsquared.plot.util.StringComparison; -import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemTypes; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotLoc.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotLoc.java index e2ca83a64..33e57f753 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotLoc.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotLoc.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.util.StringMan; import lombok.AllArgsConstructor; import org.jetbrains.annotations.Nullable; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotManager.java index 9120a576f..0b39b2b7d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotManager.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.commands.Template; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotMessage.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotMessage.java index f7865a7c6..64e6fedb3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotMessage.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotMessage.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.chat.PlainChatManager; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java index 7019d10ce..5eddb6364 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandCaller; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.commands.RequiredType; @@ -21,7 +19,6 @@ import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; import com.google.common.base.Preconditions; -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.item.ItemType; import lombok.NonNull; import org.jetbrains.annotations.NotNull; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotSettings.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotSettings.java index 4bc9b159f..8d7904690 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotSettings.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotSettings.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.object.comment.PlotComment; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PseudoRandom.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PseudoRandom.java index 3dfb4c1fa..490f8c926 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PseudoRandom.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PseudoRandom.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public class PseudoRandom { public static final PseudoRandom random = new PseudoRandom(); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Rating.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Rating.java index b00e3cac7..911b2e6c5 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Rating.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Rating.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Settings; import java.util.ArrayList; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RegionWrapper.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RegionWrapper.java index 3f4db9a7c..ced127a22 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RegionWrapper.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RegionWrapper.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public class RegionWrapper { public final int minX; public final int maxX; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal.java index 3ac0da1a8..90074a63a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public abstract class RunnableVal implements Runnable { public T value; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal2.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal2.java index 1872b5c1c..ee46a417f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal2.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal2.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public abstract class RunnableVal2 implements Runnable { public T value1; public U value2; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal3.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal3.java index 4a4d47663..cb6b2a8be 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal3.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RunnableVal3.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public abstract class RunnableVal3 implements Runnable { public T value1; public U value2; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/SetupObject.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/SetupObject.java index ba7a5f47c..e203fa870 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/SetupObject.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/SetupObject.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.ConfigurationNode; import com.github.intellectualsites.plotsquared.plot.util.SetupUtils; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/StringWrapper.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/StringWrapper.java index aa1e6e471..12d0a11aa 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/StringWrapper.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/StringWrapper.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - /** * */ diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/chat/PlainChatManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/chat/PlainChatManager.java index 1af1fbf19..0353eb313 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/chat/PlainChatManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/chat/PlainChatManager.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object.chat; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.PlotMessage; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/FlatRandomCollection.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/FlatRandomCollection.java index ef3cad495..341fbb4f3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/FlatRandomCollection.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/FlatRandomCollection.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object.collection; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.util.MathMan; import java.util.ArrayList; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/RandomCollection.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/RandomCollection.java index 5778883f3..b8dfa0a12 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/RandomCollection.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/RandomCollection.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object.collection; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.util.Map; import java.util.Random; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/SimpleRandomCollection.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/SimpleRandomCollection.java index 143649029..e75b64cb4 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/SimpleRandomCollection.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/collection/SimpleRandomCollection.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object.collection; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.util.Map; import java.util.NavigableMap; import java.util.Random; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/CommentInbox.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/CommentInbox.java index b0b964060..30d9b1230 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/CommentInbox.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/CommentInbox.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object.comment; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxOwner.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxOwner.java index bf1f56d25..29cf003cf 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxOwner.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxOwner.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object.comment; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxPublic.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxPublic.java index 80e417801..598904b0f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxPublic.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxPublic.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object.comment; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxReport.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxReport.java index e597fcd02..fa44db6c2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxReport.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/InboxReport.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object.comment; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/PlotComment.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/PlotComment.java index 97579f29e..ada90457f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/PlotComment.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/PlotComment.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object.comment; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.PlotId; public class PlotComment { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/PlotItem.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/PlotItem.java index 6e3cc6688..16397d0da 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/PlotItem.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/PlotItem.java @@ -1,8 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object.schematic; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.item.ItemType; public class PlotItem { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/Schematic.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/Schematic.java index 5977c1eb3..cdd1f25f1 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/Schematic.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/Schematic.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object.schematic; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.sk89q.jnbt.NBTOutputStream; import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.WorldEditException; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/StoredEntity.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/StoredEntity.java index 6f31b68ed..a19404da2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/StoredEntity.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/schematic/StoredEntity.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object.schematic; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.extent.Extent; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/stream/AbstractDelegateOutputStream.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/stream/AbstractDelegateOutputStream.java index 0223c45f6..994f6a465 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/stream/AbstractDelegateOutputStream.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/stream/AbstractDelegateOutputStream.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object.stream; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.io.IOException; import java.io.OutputStream; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/DefaultPlotAreaManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/DefaultPlotAreaManager.java index a60d788df..8d5152a1b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/DefaultPlotAreaManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/DefaultPlotAreaManager.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object.worlds; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/PlotAreaManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/PlotAreaManager.java index b5156eae9..7a59dab9d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/PlotAreaManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/PlotAreaManager.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object.worlds; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java index cfeba3ff2..7f63e2ed0 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object.worlds; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.object.BlockLoc; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java index a8b2c421f..1f5e70856 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object.worlds; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Configuration; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotAreaManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotAreaManager.java index 2dd7399ad..f2e0b3c03 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotAreaManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotAreaManager.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object.worlds; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotManager.java index dedeeacdf..49d3788d5 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotManager.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object.worlds; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.Location; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SingleWorldGenerator.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SingleWorldGenerator.java index a01bf0e70..a7f3e2b62 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SingleWorldGenerator.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SingleWorldGenerator.java @@ -1,14 +1,12 @@ package com.github.intellectualsites.plotsquared.plot.object.worlds; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.generator.IndependentPlotGenerator; import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotId; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; public class SingleWorldGenerator extends IndependentPlotGenerator { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ArrayUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ArrayUtil.java index 9dd004cf1..6052c2a93 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ArrayUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ArrayUtil.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.util.Arrays; public class ArrayUtil { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ByteArrayUtilities.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ByteArrayUtilities.java index 3b3b9d0c7..ace8bb7e4 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ByteArrayUtilities.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ByteArrayUtilities.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public class ByteArrayUtilities { public static byte[] integerToBytes(int i) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChatManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChatManager.java index 5ffba6493..1177206e6 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChatManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChatManager.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.PlotMessage; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java index e67c11265..206f2b710 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/CmdConfirm.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/CmdConfirm.java index a502f7538..e6cdc4134 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/CmdConfirm.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/CmdConfirm.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.CmdInstance; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/CommentManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/CommentManager.java index 281b2f71b..4eff629d6 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/CommentManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/CommentManager.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ConsoleColors.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ConsoleColors.java index 12afc3798..f8860887f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ConsoleColors.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ConsoleColors.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public class ConsoleColors { public static String fromString(String input) { input = input.replaceAll("&0", fromChatColor("&0")).replaceAll("&1", fromChatColor("&1")) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EconHandler.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EconHandler.java index 8554b2d78..4912b6e83 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EconHandler.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EconHandler.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.ConsolePlayer; import com.github.intellectualsites.plotsquared.plot.object.OfflinePlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EntityUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EntityUtil.java index ad8a19479..51e093d46 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EntityUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EntityUtil.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.flag.IntegerFlag; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EventUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EventUtil.java index 51f055fea..dc8830769 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EventUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EventUtil.java @@ -1,28 +1,24 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.listener.PlayerBlockEventType; -import com.github.intellectualsites.plotsquared.plot.object.LazyBlock; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.Rating; import com.github.intellectualsites.plotsquared.plot.object.worlds.SinglePlotArea; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; +import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; import org.jetbrains.annotations.Nullable; -import java.util.HashSet; import java.util.List; import java.util.Optional; import java.util.Set; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/HttpUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/HttpUtil.java index ff5bfd98c..761c5aa0a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/HttpUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/HttpUtil.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.config.Settings; import java.io.BufferedReader; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/IncendoPaster.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/IncendoPaster.java index 300958f55..b5ebe5d17 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/IncendoPaster.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/IncendoPaster.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.google.common.base.Charsets; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/InventoryUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/InventoryUtil.java index 3ce6f49cd..03b87fc2b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/InventoryUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/InventoryUtil.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.PlotInventory; import com.github.intellectualsites.plotsquared.plot.object.PlotItemStack; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/LegacyConverter.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/LegacyConverter.java index e9dca64af..93faabe87 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/LegacyConverter.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/LegacyConverter.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java index e998c787d..af4b21e3c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandCaller; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.commands.Like; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MathMan.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MathMan.java index c82000adc..00ea391ba 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MathMan.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MathMan.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public class MathMan { private static final int ATAN2_BITS = 7; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/Permissions.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/Permissions.java index 8143a7588..c9a332bb9 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/Permissions.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/Permissions.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandCaller; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/PlotGameMode.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/PlotGameMode.java index f881f95e6..b3b1fd5a7 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/PlotGameMode.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/PlotGameMode.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public enum PlotGameMode { NOT_SET(-1, ""), SURVIVAL(0, "survival"), CREATIVE(1, "creative"), ADVENTURE(2, "adventure"), SPECTATOR(3, "spectator"); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/PlotWeather.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/PlotWeather.java index 759f423c3..62ea9cc33 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/PlotWeather.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/PlotWeather.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public enum PlotWeather { RAIN, CLEAR, RESET } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ReflectionUtils.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ReflectionUtils.java index 64cce0b02..621766c17 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ReflectionUtils.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ReflectionUtils.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/RegExUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/RegExUtil.java index 56493658a..b9fc6ff09 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/RegExUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/RegExUtil.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.util.HashMap; import java.util.Map; import java.util.regex.Pattern; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java index 7fa86c242..a1c920d9e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.json.JSONArray; import com.github.intellectualsites.plotsquared.json.JSONException; import com.github.intellectualsites.plotsquared.plot.PlotSquared; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SetupUtils.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SetupUtils.java index 670e01798..b77d991fe 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SetupUtils.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SetupUtils.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.generator.GeneratorWrapper; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.SetupObject; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/StringComparison.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/StringComparison.java index f2a6cbde2..dd6a1f960 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/StringComparison.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/StringComparison.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import java.util.ArrayList; import java.util.Collection; import java.util.Collections; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/StringMan.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/StringMan.java index 304f55b32..047b4a71f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/StringMan.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/StringMan.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import org.jetbrains.annotations.NotNull; import java.lang.reflect.Array; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/TaskManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/TaskManager.java index a558487c5..f6e86cd92 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/TaskManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/TaskManager.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandler.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandler.java index 5fb4bfba7..9967e88eb 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandler.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandler.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandlerImplementation.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandlerImplementation.java index 927cc646c..b5e37ed93 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandlerImplementation.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandlerImplementation.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UpdateUtility.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UpdateUtility.java index d3f35e4b7..0ad79b41b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UpdateUtility.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UpdateUtility.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import lombok.Getter; import lombok.NonNull; import lombok.RequiredArgsConstructor; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java index a82e50d9e..9d60a80ba 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java @@ -1,11 +1,8 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; @@ -16,6 +13,7 @@ import com.sk89q.jnbt.NBTInputStream; import com.sk89q.jnbt.NBTOutputStream; import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.math.BlockVector2; +import com.sk89q.worldedit.world.block.BlockState; import java.io.ByteArrayOutputStream; import java.io.File; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/area/QuadMap.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/area/QuadMap.java index 212778ccd..133088a2e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/area/QuadMap.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/area/QuadMap.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util.area; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; import java.util.HashSet; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BasicLocalBlockQueue.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BasicLocalBlockQueue.java index d524e2af9..08bfab890 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BasicLocalBlockQueue.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BasicLocalBlockQueue.java @@ -1,13 +1,11 @@ package com.github.intellectualsites.plotsquared.plot.util.block; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.sk89q.worldedit.world.block.BaseBlock; +import com.sk89q.worldedit.world.block.BlockState; import org.jetbrains.annotations.NotNull; import java.util.concurrent.ConcurrentHashMap; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BlockUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BlockUtil.java index c83375edc..f377de6e4 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BlockUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BlockUtil.java @@ -1,8 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util.block; -import com.github.intellectualsites.plotsquared.configuration.serialization.ConfigurationSerializable; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extension.input.InputParseException; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/DelegateLocalBlockQueue.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/DelegateLocalBlockQueue.java index 61e08a208..cf695f3d6 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/DelegateLocalBlockQueue.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/DelegateLocalBlockQueue.java @@ -1,9 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util.block; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BaseBlock; +import com.sk89q.worldedit.world.block.BlockState; public class DelegateLocalBlockQueue extends LocalBlockQueue { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/GlobalBlockQueue.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/GlobalBlockQueue.java index 3aadb6ebf..049b13d32 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/GlobalBlockQueue.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/GlobalBlockQueue.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util.block; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal2; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/LocalBlockQueue.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/LocalBlockQueue.java index 8fc6011e2..572f70228 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/LocalBlockQueue.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/LocalBlockQueue.java @@ -1,10 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util.block; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.Location; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.util.SchematicHandler; import com.github.intellectualsites.plotsquared.plot.util.StringMan; @@ -13,6 +10,7 @@ import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.world.block.BaseBlock; +import com.sk89q.worldedit.world.block.BlockState; import java.util.Map; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/OffsetLocalBlockQueue.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/OffsetLocalBlockQueue.java index 075865ff5..d0a561111 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/OffsetLocalBlockQueue.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/OffsetLocalBlockQueue.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util.block; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.sk89q.worldedit.world.block.BaseBlock; public class OffsetLocalBlockQueue extends DelegateLocalBlockQueue { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/QueueProvider.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/QueueProvider.java index aebe4707d..3c96e0d5f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/QueueProvider.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/QueueProvider.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util.block; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public abstract class QueueProvider { public static QueueProvider of(final Class primary, final Class fallback) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/ScopedLocalBlockQueue.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/ScopedLocalBlockQueue.java index 0c404c548..416a2c36e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/ScopedLocalBlockQueue.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/ScopedLocalBlockQueue.java @@ -1,15 +1,13 @@ package com.github.intellectualsites.plotsquared.plot.util.block; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotManager; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal3; import com.sk89q.worldedit.world.block.BaseBlock; +import com.sk89q.worldedit.world.block.BlockState; public class ScopedLocalBlockQueue extends DelegateLocalBlockQueue { private final int minX; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpireManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpireManager.java index 906b15247..dbd9773f0 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpireManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpireManager.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util.expiry; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpirySettings.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpirySettings.java index 95f4067f2..ab95068da 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpirySettings.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpirySettings.java @@ -1,6 +1,4 @@ package com.github.intellectualsites.plotsquared.plot.util.expiry; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - public class ExpirySettings { } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpiryTask.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpiryTask.java index 3e1c964dd..e959948b4 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpiryTask.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpiryTask.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util.expiry; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/PlotAnalysis.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/PlotAnalysis.java index 4f18151cc..484759d66 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/PlotAnalysis.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/PlotAnalysis.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util.expiry; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.flag.Flags; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpMenu.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpMenu.java index 1733d93b3..c10d9507b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpMenu.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpMenu.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util.helpmenu; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.commands.CommandCaller; import com.github.intellectualsites.plotsquared.plot.commands.CommandCategory; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpObject.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpObject.java index 01c8e5f29..9981dd0f1 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpObject.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpObject.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util.helpmenu; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.Argument; import com.github.intellectualsites.plotsquared.commands.Command; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpPage.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpPage.java index c701b2b9b..5b165d32a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpPage.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpPage.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util.helpmenu; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.commands.CommandCaller; import com.github.intellectualsites.plotsquared.plot.commands.CommandCategory; import com.github.intellectualsites.plotsquared.plot.config.Captions; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/uuid/UUIDWrapper.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/uuid/UUIDWrapper.java index 58f0ed56b..c2a0af542 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/uuid/UUIDWrapper.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/uuid/UUIDWrapper.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.uuid; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.object.OfflinePlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import org.jetbrains.annotations.NotNull; diff --git a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/FlagTest.java b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/FlagTest.java index 4b94e58a2..6c322864b 100644 --- a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/FlagTest.java +++ b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/FlagTest.java @@ -1,22 +1,19 @@ package com.github.intellectualsites.plotsquared.plot; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.database.AbstractDBTest; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.object.Plot; -import com.sk89q.worldedit.world.block.BlockState; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.util.EventUtil; import com.github.intellectualsites.plotsquared.plot.util.EventUtilTest; +import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; import com.sk89q.worldedit.world.block.BlockType; import org.junit.Before; import org.junit.Test; import java.util.Collection; -import java.util.HashSet; import java.util.Optional; import java.util.Set; import java.util.UUID; diff --git a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/PlotVersionTest.java b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/PlotVersionTest.java index d5570365f..069c886da 100644 --- a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/PlotVersionTest.java +++ b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/PlotVersionTest.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import org.junit.Test; public class PlotVersionTest { diff --git a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDBTest.java b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDBTest.java index 37e7d8ba6..a2cc07d1b 100644 --- a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDBTest.java +++ b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDBTest.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.database; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; diff --git a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/object/LocationTest.java b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/object/LocationTest.java index da13420fa..a421137c0 100644 --- a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/object/LocationTest.java +++ b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/object/LocationTest.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.object; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import org.junit.Test; import java.util.logging.Logger; diff --git a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/util/EventUtilTest.java b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/util/EventUtilTest.java index f5cfba022..fd2a8db15 100644 --- a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/util/EventUtilTest.java +++ b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/util/EventUtilTest.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; diff --git a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandlerImplementationTest.java b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandlerImplementationTest.java index 15b6ded37..58e43ff65 100644 --- a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandlerImplementationTest.java +++ b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandlerImplementationTest.java @@ -1,7 +1,5 @@ package com.github.intellectualsites.plotsquared.plot.util; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; - import com.github.intellectualsites.plotsquared.plot.database.AbstractDBTest; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; From ba3ff08d6c1ed4d4479cb7bda22756debcb1b3b3 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 4 Nov 2019 20:17:29 +0000 Subject: [PATCH 04/22] Update BlockStateListFlag.java --- .../plotsquared/plot/flag/BlockStateListFlag.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BlockStateListFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BlockStateListFlag.java index 61a5a25a1..1ca476618 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BlockStateListFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BlockStateListFlag.java @@ -26,7 +26,7 @@ public class BlockStateListFlag extends ListFlag> { } @Override public String getValueDescription() { - return "Flag value must be a block list"; + return Captions.FLAG_ERROR_PLOTBLOCKLIST.getTranslated(); } public boolean contains(Plot plot, BlockState value) { From 88732bb88cd2f066654fdc17786cf9e9fe4f0c4a Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 4 Nov 2019 21:08:33 +0000 Subject: [PATCH 05/22] Use CuboidRegion instead of RegionWrapper --- .../plotsquared/bukkit/chat/Reflection.java | 8 +- .../generator/DelegatePlotGenerator.java | 2 +- .../bukkit/util/BukkitChunkManager.java | 41 +++--- .../bukkit/util/BukkitHybridUtils.java | 8 +- .../bukkit/util/BukkitSchematicHandler.java | 12 +- .../plotsquared/bukkit/util/BukkitUtil.java | 10 +- .../bukkit/util/block/BukkitLocalQueue.java | 2 +- .../bukkit/util/block/GenChunk.java | 2 +- .../plotsquared/plot/IPlotMain.java | 4 +- .../plotsquared/plot/PlotSquared.java | 4 +- .../plotsquared/plot/commands/Area.java | 11 +- .../plotsquared/plot/commands/Trim.java | 15 ++- .../plot/flag/BlockStateListFlag.java | 2 +- .../plot/generator/AugmentedUtils.java | 13 +- .../plot/generator/ClassicPlotManager.java | 34 ++--- .../plot/generator/ClassicPlotWorld.java | 2 +- .../plotsquared/plot/generator/HybridGen.java | 2 +- .../plot/generator/HybridPlotManager.java | 2 +- .../plot/generator/HybridUtils.java | 17 +-- .../plot/generator/SquarePlotManager.java | 13 +- .../plot/listener/PlotListener.java | 2 +- .../plot/listener/ProcessedWEExtent.java | 7 +- .../plotsquared/plot/listener/WEExtent.java | 7 +- .../plotsquared/plot/listener/WEManager.java | 51 ++++---- .../plot/listener/WESubscriber.java | 5 +- .../plot/object/ConsolePlayer.java | 7 +- .../plotsquared/plot/object/Location.java | 4 - .../plotsquared/plot/object/Plot.java | 121 +++++++++--------- .../plotsquared/plot/object/PlotArea.java | 36 +++--- .../plotsquared/plot/object/PlotCluster.java | 8 +- .../plot/object/RegionWrapper.java | 71 ---------- .../object/worlds/DefaultPlotAreaManager.java | 6 +- .../plot/object/worlds/PlotAreaManager.java | 4 +- .../plot/object/worlds/SinglePlot.java | 13 +- .../object/worlds/SinglePlotAreaManager.java | 4 +- .../object/worlds/SingleWorldGenerator.java | 2 +- .../plotsquared/plot/util/ChunkManager.java | 20 +-- .../plotsquared/plot/util/MainUtil.java | 22 +++- .../plot/util/SchematicHandler.java | 20 +-- .../plotsquared/plot/util/WorldUtil.java | 4 +- .../plotsquared/plot/util/area/QuadMap.java | 41 +++--- .../plot/util/{block => world}/BlockUtil.java | 2 +- .../plot/util/{block => world}/ItemUtil.java | 2 +- .../plot/util/world/RegionUtil.java | 40 ++++++ .../plotsquared/plot/FlagTest.java | 2 +- 45 files changed, 357 insertions(+), 348 deletions(-) delete mode 100644 Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RegionWrapper.java rename Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/{block => world}/BlockUtil.java (97%) rename Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/{block => world}/ItemUtil.java (94%) create mode 100644 Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/RegionUtil.java diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/Reflection.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/Reflection.java index 717e164ee..ebe7e81b3 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/Reflection.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/Reflection.java @@ -22,7 +22,7 @@ public final class Reflection { /** * Stores loaded classes from the {@code org.bukkit.craftbukkit} package (and subpackages). -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; */ private static final Map> _loadedOBCClasses = new HashMap<>(); private static final Map, Map> _loadedFields = new HashMap<>(); @@ -40,10 +40,10 @@ import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; /** * Gets the version string from the package name of the CraftBukkit server implementation. -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; * This is needed to bypass the JAR package name changing on each update. -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; * * @return The version string of the OBC and NMS packages, including the trailing dot. */ @@ -86,7 +86,7 @@ import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; * * @param className The name of the class, excluding the package, within OBC. This name may contain a subpackage name, such as {@code inventory.CraftItemStack}. -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; * @return The class instance representing the specified OBC class, or {@code null} if it could not be loaded. */ public synchronized static Class getOBCClass(String className) { diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/DelegatePlotGenerator.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/DelegatePlotGenerator.java index c410a3e0b..aab23d804 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/DelegatePlotGenerator.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/DelegatePlotGenerator.java @@ -9,7 +9,7 @@ import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.util.MathMan; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; import lombok.RequiredArgsConstructor; import org.bukkit.World; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChunkManager.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChunkManager.java index e6731d6ce..44bad9589 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChunkManager.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChunkManager.java @@ -9,11 +9,12 @@ import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotLoc; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.github.intellectualsites.plotsquared.plot.util.world.RegionUtil; +import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; @@ -44,15 +45,15 @@ import java.util.concurrent.CompletableFuture; public class BukkitChunkManager extends ChunkManager { - public static boolean isIn(RegionWrapper region, int x, int z) { - return x >= region.minX && x <= region.maxX && z >= region.minZ && z <= region.maxZ; + public static boolean isIn(CuboidRegion region, int x, int z) { + return x >= region.getMinimumPoint().getX() && x <= region.getMaximumPoint().getX() && z >= region.getMinimumPoint().getZ() && z <= region.getMaximumPoint().getZ(); } public static ContentMap swapChunk(World world1, World world2, Chunk pos1, Chunk pos2, - RegionWrapper r1, RegionWrapper r2) { + CuboidRegion r1, CuboidRegion r2) { ContentMap map = new ContentMap(); - int relX = r2.minX - r1.minX; - int relZ = r2.minZ - r1.minZ; + int relX = r2.getMinimumPoint().getX() - r1.getMinimumPoint().getX(); + int relZ = r2.getMinimumPoint().getZ() - r1.getMinimumPoint().getZ(); map.saveEntitiesIn(pos1, r1, relX, relZ, true); map.saveEntitiesIn(pos2, r2, -relX, -relZ, true); @@ -69,8 +70,8 @@ public class BukkitChunkManager extends ChunkManager { LocalBlockQueue queue1 = GlobalBlockQueue.IMP.getNewQueue(worldName1, false); LocalBlockQueue queue2 = GlobalBlockQueue.IMP.getNewQueue(worldName2, false); - for (int x = Math.max(r1.minX, sx); x <= Math.min(r1.maxX, sx + 15); x++) { - for (int z = Math.max(r1.minZ, sz); z <= Math.min(r1.maxZ, sz + 15); z++) { + for (int x = Math.max(r1.getMinimumPoint().getX(), sx); x <= Math.min(r1.getMaximumPoint().getX(), sx + 15); x++) { + for (int z = Math.max(r1.getMinimumPoint().getZ(), sz); z <= Math.min(r1.getMaximumPoint().getZ(), sz + 15); z++) { for (int y = 0; y < 256; y++) { Block block1 = world1.getBlockAt(x, y, z); BaseBlock baseBlock1 = bukkitWorld1.getFullBlock(BlockVector3.at(x, y, z)); @@ -198,8 +199,8 @@ public class BukkitChunkManager extends ChunkManager { final int relX = newPos.getX() - pos1.getX(); final int relZ = newPos.getZ() - pos1.getZ(); - final RegionWrapper region = - new RegionWrapper(pos1.getX(), pos2.getX(), pos1.getZ(), pos2.getZ()); + final CuboidRegion region = + RegionUtil.createRegion(pos1.getX(), pos2.getX(), pos1.getZ(), pos2.getZ()); final World oldWorld = Bukkit.getWorld(pos1.getWorld()); final BukkitWorld oldBukkitWorld = new BukkitWorld(oldWorld); final World newWorld = Bukkit.getWorld(newPos.getWorld()); @@ -350,8 +351,8 @@ public class BukkitChunkManager extends ChunkManager { if (checkX2 && checkZ2) { map.saveRegion(bukkitWorldObj, xxt2, xxt, zzt2, zzt); // } - RegionWrapper currentPlotClear = - new RegionWrapper(pos1.getX(), pos2.getX(), pos1.getZ(), pos2.getZ()); + CuboidRegion currentPlotClear = + RegionUtil.createRegion(pos1.getX(), pos2.getX(), pos1.getZ(), pos2.getZ()); map.saveEntitiesOut(chunkObj, currentPlotClear); AugmentedUtils.bypass(ignoreAugment, () -> setChunkInPlotArea(null, new RunnableVal() { @@ -434,10 +435,10 @@ public class BukkitChunkManager extends ChunkManager { @Override public void swap(Location bot1, Location top1, Location bot2, Location top2, final Runnable whenDone) { - RegionWrapper region1 = - new RegionWrapper(bot1.getX(), top1.getX(), bot1.getZ(), top1.getZ()); - RegionWrapper region2 = - new RegionWrapper(bot2.getX(), top2.getX(), bot2.getZ(), top2.getZ()); + CuboidRegion region1 = + RegionUtil.createRegion(bot1.getX(), top1.getX(), bot1.getZ(), top1.getZ()); + CuboidRegion region2 = + RegionUtil.createRegion(bot2.getX(), top2.getX(), bot2.getZ(), top2.getZ()); final World world1 = Bukkit.getWorld(bot1.getWorld()); World world2 = Bukkit.getWorld(bot2.getWorld()); @@ -622,7 +623,7 @@ public class BukkitChunkManager extends ChunkManager { } } - void saveEntitiesOut(Chunk chunk, RegionWrapper region) { + void saveEntitiesOut(Chunk chunk, CuboidRegion region) { for (Entity entity : chunk.getEntities()) { Location location = BukkitUtil.getLocation(entity); int x = location.getX(); @@ -639,11 +640,11 @@ public class BukkitChunkManager extends ChunkManager { } } - void saveEntitiesIn(Chunk chunk, RegionWrapper region) { + void saveEntitiesIn(Chunk chunk, CuboidRegion region) { saveEntitiesIn(chunk, region, 0, 0, false); } - void saveEntitiesIn(Chunk chunk, RegionWrapper region, int offsetX, int offsetZ, + void saveEntitiesIn(Chunk chunk, CuboidRegion region, int offsetX, int offsetZ, boolean delete) { for (Entity entity : chunk.getEntities()) { Location location = BukkitUtil.getLocation(entity); diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java index 29c4c63b7..95f4b2ebc 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java @@ -8,7 +8,7 @@ import com.github.intellectualsites.plotsquared.plot.generator.HybridUtils; import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; @@ -34,7 +34,7 @@ import java.util.Set; public class BukkitHybridUtils extends HybridUtils { - @Override public void analyzeRegion(final String world, final RegionWrapper region, + @Override public void analyzeRegion(final String world, final CuboidRegion region, final RunnableVal whenDone) { // int diff, int variety, int vertices, int rotation, int height_sd /* @@ -56,8 +56,8 @@ public class BukkitHybridUtils extends HybridUtils { return; } - final Location bot = new Location(world, region.minX, region.minY, region.minZ); - final Location top = new Location(world, region.maxX, region.maxY, region.maxZ); + final Location bot = new Location(world, region.getMinimumPoint().getX(), region.getMinimumPoint().getY(), region.getMinimumPoint().getZ()); + final Location top = new Location(world, region.getMaximumPoint().getX(), region.getMaximumPoint().getY(), region.getMaximumPoint().getZ()); final int bx = bot.getX(); final int bz = bot.getZ(); diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSchematicHandler.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSchematicHandler.java index 3f980d37c..ed0a8cfcc 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSchematicHandler.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitSchematicHandler.java @@ -2,7 +2,7 @@ package com.github.intellectualsites.plotsquared.bukkit.util; import com.github.intellectualsites.plotsquared.bukkit.object.schematic.StateWrapper; import com.github.intellectualsites.plotsquared.plot.object.Location; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.SchematicHandler; @@ -35,7 +35,7 @@ import java.util.stream.IntStream; */ public class BukkitSchematicHandler extends SchematicHandler { - @Override public void getCompoundTag(final String world, final Set regions, + @Override public void getCompoundTag(final String world, final Set regions, final RunnableVal whenDone) { // async TaskManager.runTaskAsync(new Runnable() { @@ -74,7 +74,7 @@ public class BukkitSchematicHandler extends SchematicHandler { List tileEntities = new ArrayList<>(); ByteArrayOutputStream buffer = new ByteArrayOutputStream(width * height * length); // Queue - final ArrayDeque queue = new ArrayDeque<>(regions); + final ArrayDeque queue = new ArrayDeque<>(regions); TaskManager.runTask(new Runnable() { @Override public void run() { if (queue.isEmpty()) { @@ -95,9 +95,9 @@ public class BukkitSchematicHandler extends SchematicHandler { return; } final Runnable regionTask = this; - RegionWrapper region = queue.poll(); - Location pos1 = new Location(world, region.minX, region.minY, region.minZ); - Location pos2 = new Location(world, region.maxX, region.maxY, region.maxZ); + CuboidRegion region = queue.poll(); + Location pos1 = new Location(world, region.getMinimumPoint().getX(), region.getMinimumPoint().getY(), region.getMinimumPoint().getZ()); + Location pos2 = new Location(world, region.getMaximumPoint().getX(), region.getMaximumPoint().getY(), region.getMaximumPoint().getZ()); final int p1x = pos1.getX(); final int sy = pos1.getY(); final int p1z = pos1.getZ(); diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java index 38c7e069d..a73872bee 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java @@ -6,14 +6,14 @@ import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.object.schematic.PlotItem; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.github.intellectualsites.plotsquared.plot.util.StringComparison; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.bukkit.BukkitWorld; import com.sk89q.worldedit.world.block.BlockState; @@ -428,12 +428,12 @@ import java.util.Set; } @Override - public void setBiomes(@NonNull final String worldName, @NonNull final RegionWrapper region, + public void setBiomes(@NonNull final String worldName, @NonNull final CuboidRegion region, @NonNull final String biomeString) { final World world = getWorld(worldName); final Biome biome = Biome.valueOf(biomeString.toUpperCase()); - for (int x = region.minX; x <= region.maxX; x++) { - for (int z = region.minZ; z <= region.maxZ; z++) { + for (int x = region.getMinimumPoint().getX(); x <= region.getMaximumPoint().getX(); x++) { + for (int z = region.getMinimumPoint().getZ(); z <= region.getMaximumPoint().getZ(); z++) { world.setBiome(x, z, biome); } } diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/BukkitLocalQueue.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/BukkitLocalQueue.java index 54e153845..9f5dc4e7f 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/BukkitLocalQueue.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/BukkitLocalQueue.java @@ -5,7 +5,7 @@ import com.github.intellectualsites.plotsquared.bukkit.object.schematic.StateWra import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.block.BasicLocalBlockQueue; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.world.block.BaseBlock; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/GenChunk.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/GenChunk.java index 50dd042ad..a93c22679 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/GenChunk.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/block/GenChunk.java @@ -5,7 +5,7 @@ import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; import com.github.intellectualsites.plotsquared.plot.object.ChunkWrapper; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.world.block.BaseBlock; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java index 77f36bb41..3a47773b7 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java @@ -88,11 +88,11 @@ public interface IPlotMain extends ILogger { /** * Gets the NMS package prefix. -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; * * @return The NMS package prefix -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; */ String getNMSPackage(); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java index 31f06f9d0..a08a8b1c2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java @@ -29,7 +29,7 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotFilter; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.PlotManager; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.object.StringWrapper; import com.github.intellectualsites.plotsquared.plot.object.worlds.DefaultPlotAreaManager; import com.github.intellectualsites.plotsquared.plot.object.worlds.PlotAreaManager; @@ -2008,7 +2008,7 @@ import java.util.zip.ZipInputStream; return Collections.unmodifiableSet(result); } - public Set getPlotAreas(final String world, final RegionWrapper region) { + public Set getPlotAreas(final String world, final CuboidRegion region) { final PlotArea[] areas = plotAreaManager.getPlotAreas(world, region); final Set set = new HashSet<>(); Collections.addAll(set, areas); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java index 0f39ebe94..f773c1e1c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java @@ -12,7 +12,8 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.PlotMessage; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.github.intellectualsites.plotsquared.plot.util.world.RegionUtil; +import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal3; import com.github.intellectualsites.plotsquared.plot.object.SetupObject; @@ -99,7 +100,7 @@ import java.util.Set; area.ROAD_WIDTH / 2; final int offsetX = bx - (area.ROAD_WIDTH == 0 ? 0 : lower); final int offsetZ = bz - (area.ROAD_WIDTH == 0 ? 0 : lower); - final RegionWrapper region = new RegionWrapper(bx, tx, bz, tz); + final CuboidRegion region = RegionUtil.createRegion(bx, tx, bz, tz); Set areas = PlotSquared.get().getPlotAreas(area.worldname, region); if (!areas.isEmpty()) { @@ -460,10 +461,10 @@ import java.util.Set; if (area.TYPE != 2) { center = WorldUtil.IMP.getSpawn(area.worldname); } else { - RegionWrapper region = area.getRegion(); + CuboidRegion region = area.getRegion(); center = - new Location(area.worldname, region.minX + (region.maxX - region.minX) / 2, - 0, region.minZ + (region.maxZ - region.minZ) / 2); + new Location(area.worldname, region.getMinimumPoint().getX() + (region.getMaximumPoint().getX() - region.getMinimumPoint().getX()) / 2, + 0, region.getMinimumPoint().getZ() + (region.getMaximumPoint().getZ() - region.getMinimumPoint().getZ()) / 2); center.setY(1 + WorldUtil.IMP .getHighestBlock(area.worldname, center.getX(), center.getZ())); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trim.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trim.java index 000aa9b56..66a024ec4 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trim.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trim.java @@ -6,7 +6,8 @@ import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.github.intellectualsites.plotsquared.plot.util.world.RegionUtil; +import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal2; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; @@ -176,18 +177,18 @@ import java.util.Set; } int bx = cbx << 4; int bz = cbz << 4; - RegionWrapper region = new RegionWrapper(bx, bx + 511, bz, bz + 511); + CuboidRegion region = RegionUtil.createRegion(bx, bx + 511, bz, bz + 511); for (Plot plot : PlotSquared.get().getPlots(world)) { Location bot = plot.getBottomAbs(); Location top = plot.getExtendedTopAbs(); - RegionWrapper plotReg = - new RegionWrapper(bot.getX(), top.getX(), bot.getZ(), + CuboidRegion plotReg = + RegionUtil.createRegion(bot.getX(), top.getX(), bot.getZ(), top.getZ()); - if (!region.intersects(plotReg)) { + if (!RegionUtil.intersects(region, plotReg)) { continue; } - for (int x = plotReg.minX >> 4; x <= plotReg.maxX >> 4; x++) { - for (int z = plotReg.minZ >> 4; z <= plotReg.maxZ >> 4; z++) { + for (int x = plotReg.getMinimumPoint().getX() >> 4; x <= plotReg.getMaximumPoint().getX() >> 4; x++) { + for (int z = plotReg.getMinimumPoint().getZ() >> 4; z <= plotReg.getMaximumPoint().getZ() >> 4; z++) { BlockVector2 loc = BlockVector2.at(x, z); chunks.remove(loc); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BlockStateListFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BlockStateListFlag.java index 1ca476618..b9f3367d0 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BlockStateListFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BlockStateListFlag.java @@ -3,7 +3,7 @@ package com.github.intellectualsites.plotsquared.plot.flag; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.util.StringMan; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/AugmentedUtils.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/AugmentedUtils.java index 73a9e75d0..f5aa2e440 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/AugmentedUtils.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/AugmentedUtils.java @@ -4,7 +4,8 @@ import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotManager; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.github.intellectualsites.plotsquared.plot.util.world.RegionUtil; +import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.util.block.DelegateLocalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; @@ -33,7 +34,7 @@ public class AugmentedUtils { final int blockX = chunkX << 4; final int blockZ = chunkZ << 4; - RegionWrapper region = new RegionWrapper(blockX, blockX + 15, blockZ, blockZ + 15); + CuboidRegion region = RegionUtil.createRegion(blockX, blockX + 15, blockZ, blockZ + 15); Set areas = PlotSquared.get().getPlotAreas(world, region); if (areas.isEmpty()) { return false; @@ -59,10 +60,10 @@ public class AugmentedUtils { int tzz; // gen if (area.TYPE == 2) { - bxx = Math.max(0, area.getRegion().minX - blockX); - bzz = Math.max(0, area.getRegion().minZ - blockZ); - txx = Math.min(15, area.getRegion().maxX - blockX); - tzz = Math.min(15, area.getRegion().maxZ - blockZ); + bxx = Math.max(0, area.getRegion().getMinimumPoint().getX() - blockX); + bzz = Math.max(0, area.getRegion().getMinimumPoint().getZ() - blockZ); + txx = Math.min(15, area.getRegion().getMaximumPoint().getX() - blockX); + tzz = Math.min(15, area.getRegion().getMaximumPoint().getZ() - blockZ); primaryMask = new DelegateLocalBlockQueue(queue) { @Override public boolean setBlock(int x, int y, int z, BlockState id) { if (area.contains(x, z)) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java index d3eee1165..b0ef7e138 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java @@ -6,9 +6,9 @@ import com.github.intellectualsites.plotsquared.plot.object.Direction; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotId; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.util.MathMan; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; @@ -59,11 +59,11 @@ public class ClassicPlotManager extends SquarePlotManager { Plot plot = classicPlotWorld.getPlotAbs(plotId); LocalBlockQueue queue = classicPlotWorld.getQueue(false); if (plot.isBasePlot()) { - for (RegionWrapper region : plot.getRegions()) { + for (CuboidRegion region : plot.getRegions()) { Location pos1 = - new Location(classicPlotWorld.worldname, region.minX, classicPlotWorld.PLOT_HEIGHT, region.minZ); + new Location(classicPlotWorld.worldname, region.getMinimumPoint().getX(), classicPlotWorld.PLOT_HEIGHT, region.getMinimumPoint().getZ()); Location pos2 = - new Location(classicPlotWorld.worldname, region.maxX, classicPlotWorld.PLOT_HEIGHT, region.maxZ); + new Location(classicPlotWorld.worldname, region.getMaximumPoint().getX(), classicPlotWorld.PLOT_HEIGHT, region.getMaximumPoint().getZ()); queue.setCuboid(pos1, pos2, blocks); } } @@ -77,9 +77,9 @@ public class ClassicPlotManager extends SquarePlotManager { } LocalBlockQueue queue = classicPlotWorld.getQueue(false); int maxY = getWorldHeight(); - for (RegionWrapper region : plot.getRegions()) { - Location pos1 = new Location(classicPlotWorld.worldname, region.minX, 1, region.minZ); - Location pos2 = new Location(classicPlotWorld.worldname, region.maxX, maxY, region.maxZ); + for (CuboidRegion region : plot.getRegions()) { + Location pos1 = new Location(classicPlotWorld.worldname, region.getMinimumPoint().getX(), 1, region.getMinimumPoint().getZ()); + Location pos2 = new Location(classicPlotWorld.worldname, region.getMaximumPoint().getX(), maxY, region.getMaximumPoint().getZ()); queue.setCuboid(pos1, pos2, blocks); } return queue.enqueue(); @@ -92,10 +92,10 @@ public class ClassicPlotManager extends SquarePlotManager { } LocalBlockQueue queue = classicPlotWorld.getQueue(false); int maxY = getWorldHeight(); - for (RegionWrapper region : plot.getRegions()) { + for (CuboidRegion region : plot.getRegions()) { Location pos1 = - new Location(classicPlotWorld.worldname, region.minX, classicPlotWorld.PLOT_HEIGHT + 1, region.minZ); - Location pos2 = new Location(classicPlotWorld.worldname, region.maxX, maxY, region.maxZ); + new Location(classicPlotWorld.worldname, region.getMinimumPoint().getX(), classicPlotWorld.PLOT_HEIGHT + 1, region.getMinimumPoint().getZ()); + Location pos2 = new Location(classicPlotWorld.worldname, region.getMaximumPoint().getX(), maxY, region.getMaximumPoint().getZ()); queue.setCuboid(pos1, pos2, blocks); } return queue.enqueue(); @@ -107,10 +107,10 @@ public class ClassicPlotManager extends SquarePlotManager { return false; } LocalBlockQueue queue = classicPlotWorld.getQueue(false); - for (RegionWrapper region : plot.getRegions()) { - Location pos1 = new Location(classicPlotWorld.worldname, region.minX, 1, region.minZ); + for (CuboidRegion region : plot.getRegions()) { + Location pos1 = new Location(classicPlotWorld.worldname, region.getMinimumPoint().getX(), 1, region.getMinimumPoint().getZ()); Location pos2 = - new Location(classicPlotWorld.worldname, region.maxX, classicPlotWorld.PLOT_HEIGHT - 1, region.maxZ); + new Location(classicPlotWorld.worldname, region.getMaximumPoint().getX(), classicPlotWorld.PLOT_HEIGHT - 1, region.getMaximumPoint().getZ()); queue.setCuboid(pos1, pos2, blocks); } return queue.enqueue(); @@ -173,9 +173,9 @@ public class ClassicPlotManager extends SquarePlotManager { } } if (plot.isBasePlot()) { - for (RegionWrapper region : plot.getRegions()) { - Location pos1 = new Location(classicPlotWorld.worldname, region.minX, maxY, region.minZ); - Location pos2 = new Location(classicPlotWorld.worldname, region.maxX, maxY, region.maxZ); + for (CuboidRegion region : plot.getRegions()) { + Location pos1 = new Location(classicPlotWorld.worldname, region.getMinimumPoint().getX(), maxY, region.getMinimumPoint().getZ()); + Location pos2 = new Location(classicPlotWorld.worldname, region.getMaximumPoint().getX(), maxY, region.getMaximumPoint().getZ()); queue.setCuboid(pos1, pos2, blocks); } } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotWorld.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotWorld.java index 249df910c..4d1ad357c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotWorld.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotWorld.java @@ -7,7 +7,7 @@ import com.github.intellectualsites.plotsquared.plot.config.ConfigurationNode; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.PlotId; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; import org.jetbrains.annotations.NotNull; import java.lang.reflect.Field; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridGen.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridGen.java index aae8b3643..7df870508 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridGen.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridGen.java @@ -7,7 +7,7 @@ import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.util.MathMan; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; import com.sk89q.worldedit.world.block.BaseBlock; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java index e87860190..0ab0947a4 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java @@ -12,7 +12,7 @@ import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.MathMan; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; import com.google.common.collect.Sets; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java index cc3a5ba02..f397c3fc2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java @@ -10,7 +10,8 @@ import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.PlotManager; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.github.intellectualsites.plotsquared.plot.util.world.RegionUtil; +import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; import com.github.intellectualsites.plotsquared.plot.util.MathMan; @@ -45,11 +46,11 @@ public abstract class HybridUtils { public static PlotArea area; public static boolean UPDATE = false; - public abstract void analyzeRegion(String world, RegionWrapper region, + public abstract void analyzeRegion(String world, CuboidRegion region, RunnableVal whenDone); public void analyzePlot(final Plot origin, final RunnableVal whenDone) { - final ArrayDeque zones = new ArrayDeque<>(origin.getRegions()); + final ArrayDeque zones = new ArrayDeque<>(origin.getRegions()); final ArrayList analysis = new ArrayList<>(); Runnable run = new Runnable() { @Override public void run() { @@ -97,7 +98,7 @@ public abstract class HybridUtils { TaskManager.runTask(whenDone); return; } - RegionWrapper region = zones.poll(); + CuboidRegion region = zones.poll(); final Runnable task = this; analyzeRegion(origin.getWorldName(), region, new RunnableVal() { @Override public void run(PlotAnalysis value) { @@ -271,10 +272,10 @@ public abstract class HybridUtils { int tz = sz - 1; int ty = get_ey(plotManager, queue, sx, ex, bz, tz, sy); - Set sideRoad = - new HashSet<>(Collections.singletonList(new RegionWrapper(sx, ex, sy, ey, sz, ez))); - final Set intersection = - new HashSet<>(Collections.singletonList(new RegionWrapper(sx, ex, sy, ty, bz, tz))); + Set sideRoad = + new HashSet<>(Collections.singletonList(RegionUtil.createRegion(sx, ex, sy, ey, sz, ez))); + final Set intersection = + new HashSet<>(Collections.singletonList(RegionUtil.createRegion(sx, ex, sy, ty, bz, tz))); final String dir = "schematics" + File.separator + "GEN_ROAD_SCHEMATIC" + File.separator + plot.getArea() diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotManager.java index 8ee343b3f..b05249d39 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotManager.java @@ -6,13 +6,14 @@ import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotId; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import java.util.Arrays; import java.util.HashSet; import java.util.Iterator; +import java.util.Set; /** * A plot manager with a square grid layout, with square shaped plots. @@ -28,20 +29,20 @@ public abstract class SquarePlotManager extends GridPlotManager { @Override public boolean clearPlot(final Plot plot, final Runnable whenDone) { - final HashSet regions = plot.getRegions(); + final Set regions = plot.getRegions(); Runnable run = new Runnable() { @Override public void run() { if (regions.isEmpty()) { whenDone.run(); return; } - Iterator iterator = regions.iterator(); - RegionWrapper region = iterator.next(); + Iterator iterator = regions.iterator(); + CuboidRegion region = iterator.next(); iterator.remove(); Location pos1 = - new Location(plot.getWorldName(), region.minX, region.minY, region.minZ); + new Location(plot.getWorldName(), region.getMinimumPoint().getX(), region.getMinimumPoint().getY(), region.getMinimumPoint().getZ()); Location pos2 = - new Location(plot.getWorldName(), region.maxX, region.maxY, region.maxZ); + new Location(plot.getWorldName(), region.getMaximumPoint().getX(), region.getMaximumPoint().getY(), region.getMaximumPoint().getZ()); ChunkManager.manager.regenerateRegion(pos1, pos2, false, this); } }; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java index a91a97f90..7426b99c8 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java @@ -20,7 +20,7 @@ import com.github.intellectualsites.plotsquared.plot.util.PlotWeather; import com.github.intellectualsites.plotsquared.plot.util.StringMan; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; -import com.github.intellectualsites.plotsquared.plot.util.block.ItemUtil; +import com.github.intellectualsites.plotsquared.plot.util.world.ItemUtil; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemTypes; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/ProcessedWEExtent.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/ProcessedWEExtent.java index 7d2d824b4..f72fb0520 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/ProcessedWEExtent.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/ProcessedWEExtent.java @@ -3,7 +3,7 @@ package com.github.intellectualsites.plotsquared.plot.listener; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; @@ -20,10 +20,11 @@ import com.sk89q.worldedit.world.block.BlockStateHolder; import java.lang.reflect.Field; import java.util.HashSet; +import java.util.Set; public class ProcessedWEExtent extends AbstractDelegateExtent { - private final HashSet mask; + private final Set mask; private final String world; private final int max; int BScount = 0; @@ -33,7 +34,7 @@ public class ProcessedWEExtent extends AbstractDelegateExtent { private int count; private Extent parent; - public ProcessedWEExtent(String world, HashSet mask, int max, Extent child, + public ProcessedWEExtent(String world, Set mask, int max, Extent child, Extent parent) { super(child); this.mask = mask; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEExtent.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEExtent.java index 073819fa3..ea9f404b8 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEExtent.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEExtent.java @@ -1,6 +1,6 @@ package com.github.intellectualsites.plotsquared.plot.listener; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; @@ -16,14 +16,15 @@ import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes; import java.util.HashSet; +import java.util.Set; public class WEExtent extends AbstractDelegateExtent { public static BlockState AIRSTATE = BlockTypes.AIR.getDefaultState(); public static BaseBlock AIRBASE = BlockTypes.AIR.getDefaultState().toBaseBlock(); - private final HashSet mask; + private final Set mask; - public WEExtent(HashSet mask, Extent extent) { + public WEExtent(Set mask, Extent extent) { super(extent); this.mask = mask; } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEManager.java index 3692efa51..8d0081273 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEManager.java @@ -7,62 +7,65 @@ import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.github.intellectualsites.plotsquared.plot.util.world.RegionUtil; +import com.sk89q.worldedit.math.BlockVector3; +import com.sk89q.worldedit.regions.CuboidRegion; import java.util.HashSet; +import java.util.Set; import java.util.UUID; public class WEManager { - public static boolean maskContains(HashSet mask, int x, int y, int z) { - for (RegionWrapper region : mask) { - if (region.isIn(x, y, z)) { + public static boolean maskContains(Set mask, int x, int y, int z) { + for (CuboidRegion region : mask) { + if (RegionUtil.contains(region, x, y, z)) { return true; } } return false; } - public static boolean maskContains(HashSet mask, int x, int z) { - for (RegionWrapper region : mask) { - if (region.isIn(x, z)) { + public static boolean maskContains(Set mask, int x, int z) { + for (CuboidRegion region : mask) { + if (RegionUtil.contains(region, x, z)) { return true; } } return false; } - public static boolean maskContains(HashSet mask, double dx, double dy, + public static boolean maskContains(Set mask, double dx, double dy, double dz) { int x = Math.toIntExact(Math.round(dx >= 0 ? dx - 0.5 : dx + 0.5)); int y = Math.toIntExact(Math.round(dy - 0.5)); int z = Math.toIntExact(Math.round(dz >= 0 ? dz - 0.5 : dz + 0.5)); - for (RegionWrapper region : mask) { - if (region.isIn(x, y, z)) { + for (CuboidRegion region : mask) { + if (RegionUtil.contains(region, x, y, z)) { return true; } } return false; } - public static boolean maskContains(HashSet mask, double dx, double dz) { + public static boolean maskContains(Set mask, double dx, double dz) { int x = Math.toIntExact(Math.round(dx >= 0 ? dx - 0.5 : dx + 0.5)); int z = Math.toIntExact(Math.round(dz >= 0 ? dz - 0.5 : dz + 0.5)); - for (RegionWrapper region : mask) { - if (region.isIn(x, z)) { + for (CuboidRegion region : mask) { + if (RegionUtil.contains(region, x, z)) { return true; } } return false; } - public static HashSet getMask(PlotPlayer player) { - HashSet regions = new HashSet<>(); + public static HashSet getMask(PlotPlayer player) { + HashSet regions = new HashSet<>(); UUID uuid = player.getUUID(); Location location = player.getLocation(); String world = location.getWorld(); if (!PlotSquared.get().hasPlotArea(world)) { - regions.add(new RegionWrapper(Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, + regions.add(RegionUtil.createRegion(Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, Integer.MAX_VALUE)); return regions; } @@ -78,10 +81,10 @@ public class WEManager { if (plot != null && (!Settings.Done.RESTRICT_BUILDING || !Flags.DONE.isSet(plot)) && ( (allowMember && plot.isAdded(uuid)) || (!allowMember && (plot.isOwner(uuid)) || plot .getTrusted().contains(uuid))) && !(Flags.NO_WORLDEDIT.isTrue(plot))) { - for (RegionWrapper region : plot.getRegions()) { - RegionWrapper copy = - new RegionWrapper(region.minX, region.maxX, area.MIN_BUILD_HEIGHT, - area.MAX_BUILD_HEIGHT, region.minZ, region.maxZ); + for (CuboidRegion region : plot.getRegions()) { + BlockVector3 pos1 = region.getMinimumPoint().withY(area.MIN_BUILD_HEIGHT); + BlockVector3 pos2 = region.getMaximumPoint().withY(area.MAX_BUILD_HEIGHT); + CuboidRegion copy = new CuboidRegion(pos1, pos2); regions.add(copy); } player.setMeta("WorldEditRegionPlot", plot); @@ -89,12 +92,12 @@ public class WEManager { return regions; } - public static boolean intersects(RegionWrapper region1, RegionWrapper region2) { - return region1.intersects(region2); + public static boolean intersects(CuboidRegion region1, CuboidRegion region2) { + return RegionUtil.intersects(region1, region2); } - public static boolean regionContains(RegionWrapper selection, HashSet mask) { - for (RegionWrapper region : mask) { + public static boolean regionContains(CuboidRegion selection, HashSet mask) { + for (CuboidRegion region : mask) { if (intersects(region, selection)) { return true; } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WESubscriber.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WESubscriber.java index 78379fd9e..a56063d08 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WESubscriber.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WESubscriber.java @@ -5,7 +5,7 @@ import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.Permissions; import com.sk89q.worldedit.WorldEdit; @@ -19,6 +19,7 @@ import com.sk89q.worldedit.util.eventbus.Subscribe; import com.sk89q.worldedit.world.World; import java.util.HashSet; +import java.util.Set; public class WESubscriber { @@ -37,7 +38,7 @@ public class WESubscriber { if (actor != null && actor.isPlayer()) { String name = actor.getName(); PlotPlayer plotPlayer = PlotPlayer.wrap(name); - HashSet mask; + Set mask; if (plotPlayer == null) { Player player = (Player) actor; Location location = player.getLocation(); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java index 4d9f23e5f..28ad5669b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java @@ -5,6 +5,7 @@ import com.github.intellectualsites.plotsquared.plot.commands.RequiredType; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.util.PlotGameMode; import com.github.intellectualsites.plotsquared.plot.util.PlotWeather; +import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.world.item.ItemType; import org.jetbrains.annotations.NotNull; @@ -18,9 +19,9 @@ public class ConsolePlayer extends PlotPlayer { PlotArea area = PlotSquared.get().getFirstPlotArea(); Location location; if (area != null) { - RegionWrapper region = area.getRegion(); - location = new Location(area.worldname, region.minX + region.maxX / 2, 0, - region.minZ + region.maxZ / 2); + CuboidRegion region = area.getRegion(); + location = new Location(area.worldname, region.getMinimumPoint().getX() + region.getMaximumPoint().getX() / 2, 0, + region.getMinimumPoint().getZ() + region.getMaximumPoint().getZ() / 2); } else { location = new Location("world", 0, 0, 0); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java index 5f2b6bafe..30c8b19c8 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java @@ -27,10 +27,6 @@ public class Location implements Cloneable, Comparable { this.blockVector3 = BlockVector3.at(x, y, z); } - public Location() { - this.world = ""; - } - public Location(String world, int x, int y, int z) { this(world, x, y, z, 0f, 0f); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java index c753cefe7..9718eb198 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java @@ -22,7 +22,7 @@ import com.github.intellectualsites.plotsquared.plot.util.StringMan; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; @@ -32,6 +32,8 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.math.BlockVector2; +import com.sk89q.worldedit.math.BlockVector3; +import com.sk89q.worldedit.regions.CuboidRegion; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -66,13 +68,13 @@ import java.util.stream.Collectors; */ public class Plot { - private static final int MAX_HEIGHT = 256; + public static final int MAX_HEIGHT = 256; /** * @deprecated raw access is deprecated */ - @Deprecated private static HashSet connected_cache; - private static HashSet regions_cache; + @Deprecated private static Set connected_cache; + private static Set regions_cache; @NotNull private final PlotId id; @@ -865,7 +867,7 @@ public class Plot { return false; } } - final HashSet regions = this.getRegions(); + final Set regions = this.getRegions(); final Set plots = this.getConnectedPlots(); final ArrayDeque queue = new ArrayDeque<>(plots); if (isDelete) { @@ -877,10 +879,10 @@ public class Plot { @Override public void run() { if (queue.isEmpty()) { Runnable run = () -> { - for (RegionWrapper region : regions) { - Location[] corners = region.getCorners(getWorldName()); - ChunkManager.manager.clearAllEntities(corners[0], corners[1]); - } +// for (CuboidRegion region : regions) { +// Location[] corners = MainUtil.getCorners(getWorldName(), region); +// ChunkManager.manager.clearAllEntities(corners[0], corners[1]); +// } TaskManager.runTask(whenDone); }; for (Plot current : plots) { @@ -920,7 +922,7 @@ public class Plot { * @param whenDone The task to run when finished, or null */ public void setBiome(final String biome, final Runnable whenDone) { - final ArrayDeque regions = new ArrayDeque<>(this.getRegions()); + final ArrayDeque regions = new ArrayDeque<>(this.getRegions()); final int extendBiome; if (area instanceof SquarePlotWorld) { extendBiome = (((SquarePlotWorld) area).ROAD_WIDTH > 0) ? 1 : 0; @@ -934,11 +936,11 @@ public class Plot { TaskManager.runTask(whenDone); return; } - RegionWrapper region = regions.poll(); - Location pos1 = new Location(getWorldName(), region.minX - extendBiome, region.minY, - region.minZ - extendBiome); - Location pos2 = new Location(getWorldName(), region.maxX + extendBiome, region.maxY, - region.maxZ + extendBiome); + CuboidRegion region = regions.poll(); + Location pos1 = new Location(getWorldName(), region.getMinimumPoint().getX() - extendBiome, region.getMinimumPoint().getY(), + region.getMinimumPoint().getZ() - extendBiome); + Location pos2 = new Location(getWorldName(), region.getMaximumPoint().getX() + extendBiome, region.getMaximumPoint().getY(), + region.getMaximumPoint().getZ() + extendBiome); ChunkManager.chunkTask(pos1, pos2, new RunnableVal() { @Override public void run(int[] value) { BlockVector2 loc = BlockVector2.at(value[0], value[1]); @@ -1254,9 +1256,9 @@ public class Plot { } public Location getSide() { - RegionWrapper largest = getLargestRegion(); - int x = (largest.maxX >> 1) - (largest.minX >> 1) + largest.minX; - int z = largest.minZ - 1; + CuboidRegion largest = getLargestRegion(); + int x = (largest.getMaximumPoint().getX() >> 1) - (largest.getMinimumPoint().getX() >> 1) + largest.getMinimumPoint().getX(); + int z = largest.getMinimumPoint().getZ() - 1; PlotManager manager = getManager(); int y = isLoaded() ? WorldUtil.IMP.getHighestBlock(getWorldName(), x, z) : 62; if (area.ALLOW_SIGNS && (y <= 0 || y >= 255)) { @@ -1328,9 +1330,9 @@ public class Plot { int z; if (loc.getX() == Integer.MAX_VALUE && loc.getZ() == Integer.MAX_VALUE) { // center - RegionWrapper largest = plot.getLargestRegion(); - x = (largest.maxX >> 1) - (largest.minX >> 1) + largest.minX; - z = (largest.maxZ >> 1) - (largest.minZ >> 1) + largest.minZ; + CuboidRegion largest = plot.getLargestRegion(); + x = (largest.getMaximumPoint().getX() >> 1) - (largest.getMinimumPoint().getX() >> 1) + largest.getMinimumPoint().getX(); + z = (largest.getMaximumPoint().getZ() >> 1) - (largest.getMinimumPoint().getZ() >> 1) + largest.getMinimumPoint().getZ(); } else { // specific Location bot = plot.getBottomAbs(); @@ -1348,9 +1350,9 @@ public class Plot { public double getVolume() { double count = 0; - for (RegionWrapper region : getRegions()) { + for (CuboidRegion region : getRegions()) { count += - (region.maxX - (double) region.minX + 1) * (region.maxZ - (double) region.minZ + 1) + (region.getMaximumPoint().getX() - (double) region.getMinimumPoint().getX() + 1) * (region.getMaximumPoint().getZ() - (double) region.getMinimumPoint().getZ() + 1) * MAX_HEIGHT; } return count; @@ -1436,9 +1438,9 @@ public class Plot { public void refreshChunks() { LocalBlockQueue queue = GlobalBlockQueue.IMP.getNewQueue(getWorldName(), false); HashSet chunks = new HashSet<>(); - for (RegionWrapper region : Plot.this.getRegions()) { - for (int x = region.minX >> 4; x <= region.maxX >> 4; x++) { - for (int z = region.minZ >> 4; z <= region.maxZ >> 4; z++) { + for (CuboidRegion region : Plot.this.getRegions()) { + for (int x = region.getMinimumPoint().getX() >> 4; x <= region.getMaximumPoint().getX() >> 4; x++) { + for (int z = region.getMinimumPoint().getZ() >> 4; z <= region.getMaximumPoint().getZ() >> 4; z++) { if (chunks.add(BlockVector2.at(x, z))) { queue.refreshChunk(x, z); } @@ -2593,7 +2595,7 @@ public class Plot { * * @return */ - @NotNull public HashSet getRegions() { + @NotNull public Set getRegions() { if (regions_cache != null && connected_cache != null && connected_cache.contains(this)) { return regions_cache; } @@ -2601,14 +2603,13 @@ public class Plot { Location pos1 = this.getBottomAbs(); Location pos2 = this.getTopAbs(); connected_cache = Sets.newHashSet(this); - regions_cache = Sets.newHashSet( - new RegionWrapper(pos1.getX(), pos2.getX(), pos1.getY(), pos2.getY(), pos1.getZ(), - pos2.getZ())); + CuboidRegion rg = new CuboidRegion(pos1.getBlockVector3(), pos2.getBlockVector3()); + regions_cache = Collections.singleton(rg); return regions_cache; } Set plots = this.getConnectedPlots(); - HashSet regions = regions_cache = new HashSet<>(); - HashSet visited = new HashSet<>(); + Set regions = regions_cache = new HashSet<>(); + Set visited = new HashSet<>(); for (Plot current : plots) { if (visited.contains(current.getId())) { continue; @@ -2685,12 +2686,14 @@ public class Plot { Location toploc = plot.getExtendedTopAbs(); Location botabs = plot.getBottomAbs(); Location topabs = plot.getTopAbs(); - regions.add(new RegionWrapper(botabs.getX(), topabs.getX(), topabs.getZ() + 1, - toploc.getZ())); + BlockVector3 pos1 = BlockVector3.at(botabs.getX(), 0, topabs.getZ() + 1); + BlockVector3 pos2 = BlockVector3.at(topabs.getX(), Plot.MAX_HEIGHT - 1, toploc.getZ()); + regions.add(new CuboidRegion(pos1, pos2)); if (plot.getMerged(Direction.SOUTHEAST)) { + pos1 = BlockVector3.at(topabs.getX() + 1, 0, topabs.getZ() + 1); + pos2 = BlockVector3.at(toploc.getX(), Plot.MAX_HEIGHT - 1, toploc.getZ()); regions.add( - new RegionWrapper(topabs.getX() + 1, toploc.getX(), topabs.getZ() + 1, - toploc.getZ())); + new CuboidRegion(pos1, pos2)); // intersection } } @@ -2703,18 +2706,22 @@ public class Plot { Location toploc = plot.getExtendedTopAbs(); Location botabs = plot.getBottomAbs(); Location topabs = plot.getTopAbs(); - regions.add(new RegionWrapper(topabs.getX() + 1, toploc.getX(), botabs.getZ(), - topabs.getZ())); + BlockVector3 pos1 = BlockVector3.at(topabs.getX() + 1, 0, botabs.getZ()); + BlockVector3 pos2 = BlockVector3.at(toploc.getX(), Plot.MAX_HEIGHT - 1, topabs.getZ()); + regions.add(new CuboidRegion(pos1, pos2)); if (plot.getMerged(Direction.SOUTHEAST)) { + pos1 = BlockVector3.at(topabs.getX() + 1, 0, topabs.getZ()); + pos2 = BlockVector3.at(toploc.getX(), Plot.MAX_HEIGHT - 1, toploc.getZ()); regions.add( - new RegionWrapper(topabs.getX() + 1, toploc.getX(), topabs.getZ() + 1, - toploc.getZ())); + new CuboidRegion(pos1, pos2)); // intersection } } } + BlockVector3 pos1 = BlockVector3.at(gbotabs.getX() + 1, 0, gbotabs.getZ()); + BlockVector3 pos2 = BlockVector3.at(gtopabs.getX(), Plot.MAX_HEIGHT - 1, gtopabs.getZ()); regions.add( - new RegionWrapper(gbotabs.getX(), gtopabs.getX(), gbotabs.getZ(), gtopabs.getZ())); + new CuboidRegion(pos1, pos2)); } return regions; } @@ -2724,13 +2731,13 @@ public class Plot { * * @return */ - public RegionWrapper getLargestRegion() { - HashSet regions = this.getRegions(); - RegionWrapper max = null; + public CuboidRegion getLargestRegion() { + Set regions = this.getRegions(); + CuboidRegion max = null; double area = Double.NEGATIVE_INFINITY; - for (RegionWrapper region : regions) { + for (CuboidRegion region : regions) { double current = - (region.maxX - (double) region.minX + 1) * (region.maxZ - (double) region.minZ + 1); + (region.getMaximumPoint().getX() - (double) region.getMinimumPoint().getX() + 1) * (region.getMaximumPoint().getZ() - (double) region.getMinimumPoint().getZ() + 1); if (current > area) { max = region; area = current; @@ -2759,9 +2766,9 @@ public class Plot { */ public List getAllCorners() { Area area = new Area(); - for (RegionWrapper region : this.getRegions()) { - Rectangle2D rect = new Rectangle2D.Double(region.minX - 0.6, region.minZ - 0.6, - region.maxX - region.minX + 1.2, region.maxZ - region.minZ + 1.2); + for (CuboidRegion region : this.getRegions()) { + Rectangle2D rect = new Rectangle2D.Double(region.getMinimumPoint().getX() - 0.6, region.getMinimumPoint().getZ() - 0.6, + region.getMaximumPoint().getX() - region.getMinimumPoint().getX() + 1.2, region.getMaximumPoint().getZ() - region.getMinimumPoint().getZ() + 1.2); Area rectArea = new Area(rect); area.add(rectArea); } @@ -2976,7 +2983,7 @@ public class Plot { } // world border destination.updateWorldBorder(); - final ArrayDeque regions = new ArrayDeque<>(this.getRegions()); + final ArrayDeque regions = new ArrayDeque<>(this.getRegions()); // move / swap data final PlotArea originArea = getArea(); for (Plot plot : plots) { @@ -2991,8 +2998,8 @@ public class Plot { TaskManager.runTask(whenDone); return; } - RegionWrapper region = regions.poll(); - Location[] corners = region.getCorners(getWorldName()); + CuboidRegion region = regions.poll(); + Location[] corners = MainUtil.getCorners(getWorldName(), region); Location pos1 = corners[0]; Location pos2 = corners[1]; Location pos3 = pos1.clone().add(offsetX, 0, offsetZ); @@ -3019,8 +3026,8 @@ public class Plot { return; } final Runnable task = this; - RegionWrapper region = regions.poll(); - Location[] corners = region.getCorners(getWorldName()); + CuboidRegion region = regions.poll(); + Location[] corners = MainUtil.getCorners(getWorldName(), region); final Location pos1 = corners[0]; final Location pos2 = corners[1]; Location newPos = pos1.clone().add(offsetX, 0, offsetZ); @@ -3093,7 +3100,7 @@ public class Plot { } } // copy terrain - final ArrayDeque regions = new ArrayDeque<>(this.getRegions()); + final ArrayDeque regions = new ArrayDeque<>(this.getRegions()); Runnable run = new Runnable() { @Override public void run() { if (regions.isEmpty()) { @@ -3104,8 +3111,8 @@ public class Plot { TaskManager.runTask(whenDone); return; } - RegionWrapper region = regions.poll(); - Location[] corners = region.getCorners(getWorldName()); + CuboidRegion region = regions.poll(); + Location[] corners = MainUtil.getCorners(getWorldName(), region); Location pos1 = corners[0]; Location pos2 = corners[1]; Location newPos = pos1.clone().add(offsetX, 0, offsetZ); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java index b3217297d..970c427b8 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java @@ -19,8 +19,12 @@ import com.github.intellectualsites.plotsquared.plot.util.StringMan; import com.github.intellectualsites.plotsquared.plot.util.area.QuadMap; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; +import com.github.intellectualsites.plotsquared.plot.util.world.RegionUtil; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; +import com.sk89q.worldedit.math.BlockVector2; +import com.sk89q.worldedit.math.BlockVector3; +import com.sk89q.worldedit.regions.CuboidRegion; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -79,7 +83,7 @@ public abstract class PlotArea { public int MIN_BUILD_HEIGHT = 1; public PlotGameMode GAMEMODE = PlotGameMode.CREATIVE; private int hash; - private RegionWrapper region; + private CuboidRegion region; private ConcurrentHashMap meta; private QuadMap clusters; @@ -128,16 +132,16 @@ public abstract class PlotArea { } /** - * Returns the region for this PlotArea or a RegionWrapper encompassing + * Returns the region for this PlotArea or a CuboidRegion encompassing * the whole world if none exists. * - * @return RegionWrapper + * @return CuboidRegion */ - public RegionWrapper getRegion() { + public CuboidRegion getRegion() { this.region = getRegionAbs(); if (this.region == null) { - return new RegionWrapper(Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, - Integer.MAX_VALUE); + return new CuboidRegion(BlockVector3.at(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE), + BlockVector3.at(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE)); } return this.region; } @@ -145,15 +149,16 @@ public abstract class PlotArea { /** * Returns the region for this PlotArea. * - * @return RegionWrapper or null if no applicable region + * @return CuboidRegion or null if no applicable region */ - private RegionWrapper getRegionAbs() { + private CuboidRegion getRegionAbs() { if (this.region == null) { if (this.min != null) { Location bot = getPlotManager().getPlotBottomLocAbs(this.min); Location top = getPlotManager().getPlotTopLocAbs(this.max); - this.region = new RegionWrapper(bot.getX() - 1, top.getX() + 1, bot.getZ() - 1, - top.getZ() + 1); + BlockVector3 pos1 = bot.getBlockVector3().subtract(BlockVector3.ONE); + BlockVector3 pos2 = top.getBlockVector3().add(BlockVector3.ONE); + this.region = new CuboidRegion(pos1, pos2); } } return this.region; @@ -497,7 +502,7 @@ public abstract class PlotArea { } public boolean contains(final int x, final int z) { - return this.TYPE != 2 || getRegionAbs().isIn(x, z); + return this.TYPE != 2 || RegionUtil.contains(getRegionAbs(), x, z); } public boolean contains(@NotNull final PlotId id) { @@ -507,7 +512,7 @@ public abstract class PlotArea { public boolean contains(@NotNull final Location location) { return StringMan.isEqual(location.getWorld(), this.worldname) && (getRegionAbs() == null - || this.region.isIn(location.getX(), location.getZ())); + || this.region.contains(location.getBlockVector3())); } @NotNull Set getPlotsAbs(final UUID uuid) { @@ -940,9 +945,10 @@ public abstract class PlotArea { public void addCluster(@Nullable final PlotCluster plotCluster) { if (this.clusters == null) { this.clusters = new QuadMap(Integer.MAX_VALUE, 0, 0, 62) { - @Override public RegionWrapper getRegion(PlotCluster value) { - return new RegionWrapper(value.getP1().x, value.getP2().x, value.getP1().y, - value.getP2().y); + @Override public CuboidRegion getRegion(PlotCluster value) { + BlockVector2 pos1 = BlockVector2.at(value.getP1().x, value.getP1().y); + BlockVector2 pos2 = BlockVector2.at(value.getP2().x, value.getP2().y); + return new CuboidRegion(pos1.toBlockVector3(), pos2.toBlockVector3(Plot.MAX_HEIGHT - 1)); } }; } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java index d5d7c95d3..4a653d8dd 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java @@ -2,6 +2,8 @@ package com.github.intellectualsites.plotsquared.plot.object; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; +import com.github.intellectualsites.plotsquared.plot.util.world.RegionUtil; +import com.sk89q.worldedit.regions.CuboidRegion; import java.util.HashSet; import java.util.UUID; @@ -15,7 +17,7 @@ public class PlotCluster { public int temp; private PlotId pos1; private PlotId pos2; - private RegionWrapper region; + private CuboidRegion region; public PlotCluster(PlotArea area, PlotId pos1, PlotId pos2, UUID owner) { this.area = area; @@ -56,10 +58,10 @@ public class PlotCluster { } private void setRegion() { - this.region = new RegionWrapper(this.pos1.x, this.pos2.x, this.pos1.y, this.pos2.y); + this.region = RegionUtil.createRegion(this.pos1.x, this.pos2.x, this.pos1.y, this.pos2.y); } - public RegionWrapper getRegion() { + public CuboidRegion getRegion() { return this.region; } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RegionWrapper.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RegionWrapper.java deleted file mode 100644 index ced127a22..000000000 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/RegionWrapper.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.github.intellectualsites.plotsquared.plot.object; - -public class RegionWrapper { - public final int minX; - public final int maxX; - public final int minY; - public final int maxY; - public final int minZ; - public final int maxZ; - - public RegionWrapper(int minX, int maxX, int minZ, int maxZ) { - this.maxX = maxX; - this.minX = minX; - this.maxZ = maxZ; - this.minZ = minZ; - this.minY = 0; - this.maxY = 256; - } - - public RegionWrapper(int minX, int maxX, int minY, int maxY, int minZ, int maxZ) { - this.maxX = maxX; - this.minX = minX; - this.maxZ = maxZ; - this.minZ = minZ; - this.minY = minY; - this.maxY = maxY; - } - - public boolean isIn(int x, int y, int z) { - return x >= this.minX && x <= this.maxX && z >= this.minZ && z <= this.maxZ - && y >= this.minY && y <= this.maxY; - } - - public boolean isIn(int x, int z) { - return x >= this.minX && x <= this.maxX && z >= this.minZ && z <= this.maxZ; - } - - public boolean intersects(RegionWrapper other) { - return other.minX <= this.maxX && other.maxX >= this.minX && other.minY <= this.maxY - && other.maxY >= this.minY; - } - - @Override public int hashCode() { - return this.minX + 13 * this.maxX + 23 * this.minZ + 39 * this.maxZ; - } - - @Override public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (obj == this) { - return true; - } - if (obj instanceof RegionWrapper) { - RegionWrapper other = (RegionWrapper) obj; - return this.minX == other.minX && this.minZ == other.minZ && this.minY == other.minY - && this.maxX == other.maxX && this.maxZ == other.maxZ && this.maxY == other.maxY; - } - return false; - } - - @Override public String toString() { - return this.minX + "->" + this.maxX + "," + this.minZ + "->" + this.maxZ; - } - - public Location[] getCorners(String world) { - Location pos1 = new Location(world, this.minX, this.minY, this.minZ); - Location pos2 = new Location(world, this.maxX, this.maxY, this.maxZ); - return new Location[] {pos1, pos2}; - } -} diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/DefaultPlotAreaManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/DefaultPlotAreaManager.java index 8d5152a1b..0191b53df 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/DefaultPlotAreaManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/DefaultPlotAreaManager.java @@ -2,7 +2,7 @@ package com.github.intellectualsites.plotsquared.plot.object.worlds; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.util.StringMan; import com.github.intellectualsites.plotsquared.plot.util.area.QuadMap; @@ -99,7 +99,7 @@ public class DefaultPlotAreaManager implements PlotAreaManager { QuadMap map = this.plotAreaGrid.get(plotArea.worldname); if (map == null) { map = new QuadMap(Integer.MAX_VALUE, 0, 0) { - @Override public RegionWrapper getRegion(PlotArea value) { + @Override public CuboidRegion getRegion(PlotArea value) { return value.getRegion(); } }; @@ -201,7 +201,7 @@ public class DefaultPlotAreaManager implements PlotAreaManager { } } - @Override public PlotArea[] getPlotAreas(String world, RegionWrapper region) { + @Override public PlotArea[] getPlotAreas(String world, CuboidRegion region) { if (region == null) { PlotArea[] areas = this.plotAreaMap.get(world); if (areas == null) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/PlotAreaManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/PlotAreaManager.java index 7a59dab9d..b34ad2787 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/PlotAreaManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/PlotAreaManager.java @@ -2,7 +2,7 @@ package com.github.intellectualsites.plotsquared.plot.object.worlds; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.sk89q.worldedit.regions.CuboidRegion; public interface PlotAreaManager { PlotArea getApplicablePlotArea(Location location); @@ -11,7 +11,7 @@ public interface PlotAreaManager { PlotArea getPlotArea(String world, String id); - PlotArea[] getPlotAreas(String world, RegionWrapper region); + PlotArea[] getPlotAreas(String world, CuboidRegion region); PlotArea[] getAllPlotAreas(); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java index 7f63e2ed0..a9a620daa 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java @@ -8,18 +8,21 @@ import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.sk89q.worldedit.math.BlockVector3; +import com.sk89q.worldedit.regions.CuboidRegion; import com.google.common.collect.Sets; import org.jetbrains.annotations.NotNull; import java.util.Collection; +import java.util.Collections; import java.util.HashSet; +import java.util.Set; import java.util.UUID; public class SinglePlot extends Plot { - private HashSet regions = Sets.newHashSet( - new RegionWrapper(Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, - Integer.MAX_VALUE)); + private Set regions = Collections.singleton( + new CuboidRegion(BlockVector3.at(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE), + BlockVector3.at(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE))); public SinglePlot(PlotArea area, PlotId id, UUID owner) { super(area, id, owner); @@ -66,7 +69,7 @@ public class SinglePlot extends Plot { return super.isLoaded(); } - @NotNull @Override public HashSet getRegions() { + @NotNull @Override public Set getRegions() { return regions; } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotAreaManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotAreaManager.java index f2e0b3c03..620a689b3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotAreaManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotAreaManager.java @@ -2,7 +2,7 @@ package com.github.intellectualsites.plotsquared.plot.object.worlds; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.util.ArrayUtil; import com.github.intellectualsites.plotsquared.plot.util.SetupUtils; @@ -90,7 +90,7 @@ public class SinglePlotAreaManager extends DefaultPlotAreaManager { return isWorld(location.getWorld()) || location.getWorld().equals("*") ? area : null; } - @Override public PlotArea[] getPlotAreas(String world, RegionWrapper region) { + @Override public PlotArea[] getPlotAreas(String world, CuboidRegion region) { PlotArea[] found = super.getPlotAreas(world, region); if (found != null && found.length != 0) { return found; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SingleWorldGenerator.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SingleWorldGenerator.java index a7f3e2b62..0042ca222 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SingleWorldGenerator.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SingleWorldGenerator.java @@ -6,7 +6,7 @@ import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotId; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; import com.github.intellectualsites.plotsquared.plot.util.block.ScopedLocalBlockQueue; public class SingleWorldGenerator extends IndependentPlotGenerator { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java index 206f2b710..be8a79207 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java @@ -3,7 +3,7 @@ package com.github.intellectualsites.plotsquared.plot.util; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; @@ -80,7 +80,7 @@ public abstract class ChunkManager { return false; } - public static void largeRegionTask(final String world, final RegionWrapper region, + public static void largeRegionTask(final String world, final CuboidRegion region, final RunnableVal task, final Runnable whenDone) { TaskManager.runTaskAsync(() -> { HashSet chunks = new HashSet<>(); @@ -90,16 +90,16 @@ public abstract class ChunkManager { int bz = mcr.getZ() << 9; int tx = bx + 511; int tz = bz + 511; - if (bx <= region.maxX && tx >= region.minX && bz <= region.maxZ - && tz >= region.minZ) { + if (bx <= region.getMaximumPoint().getX() && tx >= region.getMinimumPoint().getX() && bz <= region.getMaximumPoint().getZ() + && tz >= region.getMinimumPoint().getZ()) { for (int x = bx >> 4; x <= (tx >> 4); x++) { int cbx = x << 4; int ctx = cbx + 15; - if (cbx <= region.maxX && ctx >= region.minX) { + if (cbx <= region.getMaximumPoint().getX() && ctx >= region.getMinimumPoint().getX()) { for (int z = bz >> 4; z <= (tz >> 4); z++) { int cbz = z << 4; int ctz = cbz + 15; - if (cbz <= region.maxZ && ctz >= region.minZ) { + if (cbz <= region.getMaximumPoint().getZ() && ctz >= region.getMinimumPoint().getZ()) { chunks.add(BlockVector2.at(x, z)); } } @@ -118,16 +118,16 @@ public abstract class ChunkManager { public static void chunkTask(final Plot plot, final RunnableVal task, final Runnable whenDone, final int allocate) { - final ArrayList regions = new ArrayList<>(plot.getRegions()); + final ArrayList regions = new ArrayList<>(plot.getRegions()); Runnable smallTask = new Runnable() { @Override public void run() { if (regions.isEmpty()) { TaskManager.runTask(whenDone); return; } - RegionWrapper value = regions.remove(0); - Location pos1 = new Location(plot.getWorldName(), value.minX, 0, value.minZ); - Location pos2 = new Location(plot.getWorldName(), value.maxX, 0, value.maxZ); + CuboidRegion value = regions.remove(0); + Location pos1 = new Location(plot.getWorldName(), value.getMinimumPoint().getX(), 0, value.getMinimumPoint().getZ()); + Location pos2 = new Location(plot.getWorldName(), value.getMaximumPoint().getX(), 0, value.getMaximumPoint().getZ()); chunkTask(pos1, pos2, task, this, allocate); } }; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java index af4b21e3c..d06beab3f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java @@ -16,7 +16,9 @@ import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.sk89q.worldedit.math.BlockVector2; +import com.sk89q.worldedit.math.BlockVector3; +import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.object.stream.AbstractDelegateOutputStream; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; @@ -372,6 +374,14 @@ public class MainUtil { return plot.getFlag(Flags.SERVER_PLOT).orElse(false); } + @NotNull public static Location[] getCorners(String world, CuboidRegion region) { + BlockVector3 min = region.getMinimumPoint(); + BlockVector3 max = region.getMaximumPoint(); + Location pos1 = new Location(world, min.getX(), min.getY(), min.getZ()); + Location pos2 = new Location(world, max.getX(), max.getY(), max.getZ()); + return new Location[] {pos1, pos2}; + } + /** * Get the corner locations for a list of regions. * @@ -380,11 +390,11 @@ public class MainUtil { * @return * @see Plot#getCorners() */ - @NotNull public static Location[] getCorners(String world, Collection regions) { + @NotNull public static Location[] getCorners(String world, Collection regions) { Location min = null; Location max = null; - for (RegionWrapper region : regions) { - Location[] corners = region.getCorners(world); + for (CuboidRegion region : regions) { + Location[] corners = getCorners(world, region); if (min == null) { min = corners[0]; max = corners[1]; @@ -558,7 +568,9 @@ public class MainUtil { * @param biome */ public static void setBiome(String world, int p1x, int p1z, int p2x, int p2z, String biome) { - RegionWrapper region = new RegionWrapper(p1x, p2x, p1z, p2z); + BlockVector3 pos1 = BlockVector2.at(p1x, p1z).toBlockVector3(); + BlockVector3 pos2 = BlockVector2.at(p2x, p2z).toBlockVector3(Plot.MAX_HEIGHT - 1); + CuboidRegion region = new CuboidRegion(pos1, pos2); WorldUtil.IMP.setBiomes(world, region, biome); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java index a1c920d9e..75f8d79f0 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java @@ -10,7 +10,7 @@ import com.github.intellectualsites.plotsquared.plot.generator.ClassicPlotWorld; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.object.schematic.Schematic; import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; @@ -168,13 +168,13 @@ public abstract class SchematicHandler { final int LENGTH = dimension.getZ(); final int HEIGHT = dimension.getY(); // Validate dimensions - RegionWrapper region = plot.getLargestRegion(); - if (((region.maxX - region.minX + xOffset + 1) < WIDTH) || ( - (region.maxZ - region.minZ + zOffset + 1) < LENGTH) || (HEIGHT > 256)) { + CuboidRegion region = plot.getLargestRegion(); + if (((region.getMaximumPoint().getX() - region.getMinimumPoint().getX() + xOffset + 1) < WIDTH) || ( + (region.getMaximumPoint().getZ() - region.getMinimumPoint().getZ() + zOffset + 1) < LENGTH) || (HEIGHT > 256)) { PlotSquared.debug("Schematic is too large"); PlotSquared.debug( "(" + WIDTH + ',' + LENGTH + ',' + HEIGHT + ") is bigger than (" + ( - region.maxX - region.minX) + ',' + (region.maxZ - region.minZ) + region.getMaximumPoint().getX() - region.getMinimumPoint().getX()) + ',' + (region.getMaximumPoint().getZ() - region.getMinimumPoint().getZ()) + ",256)"); TaskManager.runTask(whenDone); return; @@ -192,16 +192,16 @@ public abstract class SchematicHandler { y_offset_actual = yOffset + ((ClassicPlotWorld) pw).PLOT_HEIGHT; } else { y_offset_actual = yOffset + 1 + MainUtil - .getHeighestBlock(plot.getWorldName(), region.minX + 1, - region.minZ + 1); + .getHeighestBlock(plot.getWorldName(), region.getMinimumPoint().getX() + 1, + region.getMinimumPoint().getZ() + 1); } } } else { y_offset_actual = yOffset; } Location pos1 = - new Location(plot.getWorldName(), region.minX + xOffset, y_offset_actual, - region.minZ + zOffset); + new Location(plot.getWorldName(), region.getMinimumPoint().getX() + xOffset, y_offset_actual, + region.getMinimumPoint().getZ() + zOffset); Location pos2 = pos1.clone().add(WIDTH - 1, HEIGHT - 1, LENGTH - 1); final int p1x = pos1.getX(); final int p1z = pos1.getZ(); @@ -445,7 +445,7 @@ public abstract class SchematicHandler { return true; } - public abstract void getCompoundTag(String world, Set regions, + public abstract void getCompoundTag(String world, Set regions, RunnableVal whenDone); public void getCompoundTag(final Plot plot, final RunnableVal whenDone) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java index 9d60a80ba..52be1a312 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java @@ -4,7 +4,7 @@ import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.object.schematic.PlotItem; import com.sk89q.jnbt.CompoundTag; @@ -66,7 +66,7 @@ public abstract class WorldUtil { public abstract void setSign(String world, int x, int y, int z, String[] lines); - public abstract void setBiomes(String world, RegionWrapper region, String biome); + public abstract void setBiomes(String world, CuboidRegion region, String biome); public abstract com.sk89q.worldedit.world.World getWeWorld(String world); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/area/QuadMap.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/area/QuadMap.java index 133088a2e..e016cfeea 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/area/QuadMap.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/area/QuadMap.java @@ -1,6 +1,7 @@ package com.github.intellectualsites.plotsquared.plot.util.area; -import com.github.intellectualsites.plotsquared.plot.object.RegionWrapper; +import com.github.intellectualsites.plotsquared.plot.util.world.RegionUtil; +import com.sk89q.worldedit.regions.CuboidRegion; import java.util.HashSet; import java.util.Set; @@ -96,9 +97,9 @@ public class QuadMap { this.objects.add(area); return; } - RegionWrapper region = getRegion(area); - if (region.minX >= this.x) { - if (region.minZ >= this.z) { + CuboidRegion region = getRegion(area); + if (region.getMinimumPoint().getX() >= this.x) { + if (region.getMinimumPoint().getZ() >= this.z) { if (this.one == null) { this.one = newInstance(this.newsize, this.x + this.newsize, this.z + this.newsize, @@ -107,7 +108,7 @@ public class QuadMap { this.one.add(area); recalculateSkip(); return; - } else if (region.maxZ < this.z) { + } else if (region.getMaximumPoint().getZ() < this.z) { if (this.two == null) { this.two = newInstance(this.newsize, this.x + this.newsize, this.z - this.newsize, @@ -117,8 +118,8 @@ public class QuadMap { recalculateSkip(); return; } - } else if (region.maxX < this.x) { - if (region.minZ >= this.z) { + } else if (region.getMaximumPoint().getX() < this.x) { + if (region.getMinimumPoint().getZ() >= this.z) { if (this.four == null) { this.four = newInstance(this.newsize, this.x - this.newsize, this.z + this.newsize, @@ -127,7 +128,7 @@ public class QuadMap { this.four.add(area); recalculateSkip(); return; - } else if (region.maxZ < this.z) { + } else if (region.getMaximumPoint().getZ() < this.z) { if (this.three == null) { this.three = newInstance(this.newsize, this.x - this.newsize, this.z - this.newsize, @@ -144,14 +145,14 @@ public class QuadMap { this.objects.add(area); } - public RegionWrapper getRegion(T value) { + public CuboidRegion getRegion(T value) { return null; } public QuadMap newInstance(int newsize, int x, int z, int min) { try { return new QuadMap(newsize, x, z, min) { - @Override public RegionWrapper getRegion(T value) { + @Override public CuboidRegion getRegion(T value) { return QuadMap.this.getRegion(value); } }; @@ -172,9 +173,9 @@ public class QuadMap { this.skip = null; } } else { - RegionWrapper region = getRegion(area); - if (region.minX >= this.x) { - if (region.minZ >= this.z) { + CuboidRegion region = getRegion(area); + if (region.getMinimumPoint().getX() >= this.x) { + if (region.getMinimumPoint().getZ() >= this.z) { if (this.one != null) { if (this.one.remove(area)) { this.one = null; @@ -190,7 +191,7 @@ public class QuadMap { } } } else { - if (region.minZ >= this.z) { + if (region.getMinimumPoint().getZ() >= this.z) { if (this.four != null) { if (this.four.remove(area)) { this.four = null; @@ -224,11 +225,11 @@ public class QuadMap { this.skip = map.skip == null ? map : map.skip; } - public Set get(RegionWrapper region) { + public Set get(CuboidRegion region) { HashSet set = new HashSet<>(); if (this.objects != null) { for (T obj : this.objects) { - if (getRegion(obj).intersects(region)) { + if (RegionUtil.intersects(getRegion(obj), region)) { set.add(obj); } } @@ -254,15 +255,15 @@ public class QuadMap { return set; } - public boolean intersects(RegionWrapper other) { - return (other.minX <= this.x + this.size) && (other.maxX >= this.x - this.size) && ( - other.minZ <= this.z + this.size) && (other.maxZ >= this.z - this.size); + public boolean intersects(CuboidRegion other) { + return (other.getMinimumPoint().getX() <= this.x + this.size) && (other.getMaximumPoint().getX() >= this.x - this.size) && ( + other.getMinimumPoint().getZ() <= this.z + this.size) && (other.getMaximumPoint().getZ() >= this.z - this.size); } public T get(int x, int z) { if (this.objects != null) { for (T obj : this.objects) { - if (getRegion(obj).isIn(x, z)) { + if (RegionUtil.contains(getRegion(obj), x, z)) { return obj; } } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BlockUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/BlockUtil.java similarity index 97% rename from Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BlockUtil.java rename to Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/BlockUtil.java index f377de6e4..6ea6d1c6c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/BlockUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/BlockUtil.java @@ -1,4 +1,4 @@ -package com.github.intellectualsites.plotsquared.plot.util.block; +package com.github.intellectualsites.plotsquared.plot.util.world; import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.sk89q.worldedit.WorldEdit; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/ItemUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/ItemUtil.java similarity index 94% rename from Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/ItemUtil.java rename to Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/ItemUtil.java index 243d098ab..415df8fe1 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/ItemUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/ItemUtil.java @@ -1,4 +1,4 @@ -package com.github.intellectualsites.plotsquared.plot.util.block; +package com.github.intellectualsites.plotsquared.plot.util.world; import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.sk89q.worldedit.world.item.ItemType; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/RegionUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/RegionUtil.java new file mode 100644 index 000000000..271f76dac --- /dev/null +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/RegionUtil.java @@ -0,0 +1,40 @@ +package com.github.intellectualsites.plotsquared.plot.util.world; + +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.sk89q.worldedit.math.BlockVector3; +import com.sk89q.worldedit.regions.CuboidRegion; + +public class RegionUtil { + public static CuboidRegion createRegion(int pos1x, int pos2x, int pos1z, int pos2z) { + return createRegion(pos1x, pos2x, 0, Plot.MAX_HEIGHT - 1, pos1z, pos2z); + } + + public static CuboidRegion createRegion(int pos1x, int pos2x, int pos1y, int pos2y, int pos1z, int pos2z) { + BlockVector3 pos1 = BlockVector3.at(pos1x, pos1y, pos1z); + BlockVector3 pos2 = BlockVector3.at(pos2x, pos2y, pos2z); + return new CuboidRegion(pos1, pos2); + } + + public static boolean contains(CuboidRegion region, int x, int z) { + BlockVector3 min = region.getMinimumPoint(); + BlockVector3 max = region.getMaximumPoint(); + return x >= min.getX() && x <= max.getX() && z >= min.getZ() && z <= max.getZ(); + } + + public static boolean contains(CuboidRegion region, int x, int y, int z) { + BlockVector3 min = region.getMinimumPoint(); + BlockVector3 max = region.getMaximumPoint(); + return x >= min.getX() && x <= max.getX() && z >= min.getZ() && z <= max.getZ() && y >= min.getY() && y <= max.getY(); + } + + // Because WE (not fawe) lack this for CuboidRegion + public static boolean intersects(CuboidRegion region, CuboidRegion other) { + BlockVector3 regionMin = region.getMinimumPoint(); + BlockVector3 regionMax = region.getMaximumPoint(); + + BlockVector3 otherMin = other.getMinimumPoint(); + BlockVector3 otherMax = other.getMaximumPoint(); + + return otherMin.getX() <= regionMax.getX() && otherMax.getX() >= regionMin.getX() && otherMin.getZ() <= regionMax.getZ() && otherMax.getZ() >= regionMin.getZ(); + } +} diff --git a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/FlagTest.java b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/FlagTest.java index 6c322864b..8bbc1193f 100644 --- a/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/FlagTest.java +++ b/Core/src/test/java/com/github/intellectualsites/plotsquared/plot/FlagTest.java @@ -8,7 +8,7 @@ import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.util.EventUtil; import com.github.intellectualsites.plotsquared.plot.util.EventUtilTest; -import com.github.intellectualsites.plotsquared.plot.util.block.BlockUtil; +import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; import com.sk89q.worldedit.world.block.BlockType; import org.junit.Before; import org.junit.Test; From 2cb734bba2955ef55b16042f145736e13f327a28 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 4 Nov 2019 21:55:40 +0000 Subject: [PATCH 06/22] editsession util --- .../plotsquared/bukkit/BukkitMain.java | 11 ++ .../bukkit/object/BukkitPlayer.java | 6 + .../bukkit/util/BukkitTaskManager.java | 6 +- .../plotsquared/api/PlotAPI.java | 1 + .../plotsquared/plot/IPlotMain.java | 3 + .../plot/object/ConsolePlayer.java | 6 + .../plotsquared/plot/object/Plot.java | 2 +- .../plotsquared/plot/object/PlotPlayer.java | 3 + .../plot/util/world/OperationUtil.java | 116 ++++++++++++++++++ 9 files changed, 151 insertions(+), 3 deletions(-) create mode 100644 Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/OperationUtil.java diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java index 25ad69723..7d4c8bf4b 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java @@ -65,6 +65,10 @@ import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; import com.github.intellectualsites.plotsquared.plot.util.block.QueueProvider; import com.github.intellectualsites.plotsquared.plot.uuid.UUIDWrapper; import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.bukkit.BukkitAdapter; +import com.sk89q.worldedit.bukkit.BukkitCommandSender; +import com.sk89q.worldedit.bukkit.WorldEditPlugin; +import com.sk89q.worldedit.extension.platform.Actor; import io.papermc.lib.PaperLib; import lombok.Getter; import lombok.NonNull; @@ -74,6 +78,7 @@ import org.bukkit.Chunk; import org.bukkit.Location; import org.bukkit.OfflinePlayer; import org.bukkit.World; +import org.bukkit.command.ConsoleCommandSender; import org.bukkit.command.PluginCommand; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; @@ -823,4 +828,10 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain } return names; } + + @Override public Actor getConsole() { + @NotNull ConsoleCommandSender console = Bukkit.getServer().getConsoleSender(); + WorldEditPlugin wePlugin = ((WorldEditPlugin) Bukkit.getPluginManager().getPlugin("WorldEdit")); + return wePlugin.wrapCommandSender(console); + } } diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitPlayer.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitPlayer.java index 35fa0d20b..9ca1bbbae 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitPlayer.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitPlayer.java @@ -12,6 +12,8 @@ import com.github.intellectualsites.plotsquared.plot.util.PlotWeather; import com.github.intellectualsites.plotsquared.plot.util.StringMan; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; import com.sk89q.worldedit.bukkit.BukkitAdapter; +import com.sk89q.worldedit.bukkit.WorldEditPlugin; +import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.world.item.ItemType; import io.papermc.lib.PaperLib; import org.bukkit.GameMode; @@ -55,6 +57,10 @@ public class BukkitPlayer extends PlotPlayer { super.populatePersistentMetaMap(); } + @Override public Actor toActor() { + return BukkitAdapter.adapt(player); + } + @NotNull @Override public Location getLocation() { final Location location = super.getLocation(); return location == null ? BukkitUtil.getLocation(this.player) : location; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitTaskManager.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitTaskManager.java index 56448ff34..cbe09142c 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitTaskManager.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitTaskManager.java @@ -3,6 +3,8 @@ package com.github.intellectualsites.plotsquared.bukkit.util; import com.github.intellectualsites.plotsquared.bukkit.BukkitMain; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import org.bukkit.Bukkit; +import org.bukkit.scheduler.BukkitTask; +import org.jetbrains.annotations.NotNull; public class BukkitTaskManager extends TaskManager { @@ -24,8 +26,8 @@ public class BukkitTaskManager extends TaskManager { } @Override public void taskAsync(Runnable runnable) { - this.bukkitMain.getServer().getScheduler().runTaskAsynchronously(this.bukkitMain, runnable) - .getTaskId(); + @NotNull BukkitTask task = this.bukkitMain.getServer().getScheduler() + .runTaskAsynchronously(this.bukkitMain, runnable); } @Override public void task(Runnable runnable) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/api/PlotAPI.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/api/PlotAPI.java index 610362953..740db8fca 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/api/PlotAPI.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/api/PlotAPI.java @@ -14,6 +14,7 @@ import com.github.intellectualsites.plotsquared.plot.util.SchematicHandler; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.uuid.UUIDWrapper; +import com.sk89q.worldedit.extension.platform.Actor; import lombok.NoArgsConstructor; import java.util.Collections; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java index 3a47773b7..b532cb4ce 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java @@ -16,6 +16,7 @@ import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandlerImplementation; import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; import com.github.intellectualsites.plotsquared.plot.util.block.QueueProvider; +import com.sk89q.worldedit.extension.platform.Actor; import org.jetbrains.annotations.NotNull; import java.io.File; @@ -248,4 +249,6 @@ import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; @NotNull IndependentPlotGenerator getDefaultGenerator(); List getPluginIds(); + + Actor getConsole(); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java index 28ad5669b..ae9fffb89 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java @@ -5,6 +5,8 @@ import com.github.intellectualsites.plotsquared.plot.commands.RequiredType; import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.util.PlotGameMode; import com.github.intellectualsites.plotsquared.plot.util.PlotWeather; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.world.item.ItemType; import org.jetbrains.annotations.NotNull; @@ -36,6 +38,10 @@ public class ConsolePlayer extends PlotPlayer { return instance; } + @Override public Actor toActor() { + return PlotSquared.get().IMP.getConsole(); + } + @Override public boolean canTeleport(@NotNull Location location) { return true; } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java index 9718eb198..33e482428 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java @@ -1116,7 +1116,7 @@ public class Plot { * Delete a plot (use null for the runnable if you don't need to be notified on completion) * * @see PlotSquared#removePlot(Plot, boolean) - * @see #clear(Runnable) to simply clear a plot + * @see #clear(boolean, boolean, Runnable) to simply clear a plot */ public boolean deletePlot(final Runnable whenDone) { if (!this.hasOwner()) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java index 5eddb6364..f48cbc981 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java @@ -19,6 +19,7 @@ import com.github.intellectualsites.plotsquared.plot.util.TaskManager; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; import com.google.common.base.Preconditions; +import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.world.item.ItemType; import lombok.NonNull; import org.jetbrains.annotations.NotNull; @@ -86,6 +87,8 @@ public abstract class PlotPlayer implements CommandCaller, OfflinePlotPlayer { return UUIDHandler.getPlayer(name); } + public abstract Actor toActor(); + /** * Set some session only metadata for this player. * diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/OperationUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/OperationUtil.java new file mode 100644 index 000000000..05b969065 --- /dev/null +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/OperationUtil.java @@ -0,0 +1,116 @@ +package com.github.intellectualsites.plotsquared.plot.util.world; + +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.util.TaskManager; +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.ListeningExecutorService; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.entity.Player; +import com.sk89q.worldedit.extension.platform.Actor; +import com.sk89q.worldedit.extension.platform.Capability; +import com.sk89q.worldedit.extension.platform.Platform; +import com.sk89q.worldedit.world.World; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; +import java.util.concurrent.Future; +import java.util.function.Consumer; + +public class OperationUtil { + private static final boolean ASYNC; + + static { + boolean hasFawe = true; + try { + Class.forName("com.boydti.fawe.Fawe"); + } catch (ClassNotFoundException ignore) { + hasFawe = false; + } + ASYNC = hasFawe; + } + + public Future withEditSession(@NotNull PlotPlayer plotPlayer, @NotNull Consumer consumer, @Nullable Consumer exceptionHandler) { + if (ASYNC) { + ListeningExecutorService exec = WorldEdit.getInstance().getExecutorService(); + return exec.submit( + () -> withEditSessionOnThread(plotPlayer, consumer, exceptionHandler)); + } else { + withEditSessionOnThread(plotPlayer, consumer, exceptionHandler); + } + return Futures.immediateFuture(true); + } + + private void withEditSessionOnThread(PlotPlayer plotPlayer, Consumer consumer, Consumer exceptionHandler) { + Actor actor = plotPlayer.toActor(); + World weWorld = getWorld(plotPlayer, actor); + LocalSession session = getSession(actor); + try (EditSession ess = createEditSession(weWorld, actor, session)) { + try { + consumer.accept(ess); + } finally { + ess.close(); + session.remember(ess); + } + } catch (Throwable e) { + if (exceptionHandler != null) { + exceptionHandler.accept(e); + } else { + e.printStackTrace(); + } + } + } + + private static World getWorld(String worldName) { + Platform platform = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING); + List worlds = platform.getWorlds(); + for (World current : worlds) { + if (current.getName().equals(worldName)) { + return current; + } + } + return null; + } + + private static World getWorld(PlotPlayer plotPlayer, Actor actor) { + World weWorld; + if (actor instanceof Player) { + weWorld = ((Player) actor).getWorld(); + } else { + @NotNull Location loc = plotPlayer.getLocation(); + String world = loc.getWorld(); + weWorld = getWorld(world); + } + return weWorld; + } + + private static EditSession createEditSession(PlotPlayer plotPlayer) { + Actor actor = plotPlayer.toActor(); + World weWorld = getWorld(plotPlayer, actor); + return createEditSession(weWorld, actor); + } + + private static LocalSession getSession(Actor actor) { + return WorldEdit.getInstance().getSessionManager().get(actor); + } + + private static EditSession createEditSession(World world, Actor actor) { + return createEditSession(world, actor, getSession(actor)); + } + + private static EditSession createEditSession(World world, Actor actor, LocalSession session) { + EditSession editSession; + Player player = actor.isPlayer() ? (Player) actor : null; + editSession = WorldEdit.getInstance().getEditSessionFactory() + .getEditSession(world, -1, null, player); + + editSession.setFastMode(!actor.isPlayer()); + editSession.setReorderMode(EditSession.ReorderMode.FAST); + return editSession; + } +} From 252fdefef3d11d945c6f9d701fdd15de30130210 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Wed, 6 Nov 2019 11:39:55 +0000 Subject: [PATCH 07/22] bad regex replace --- .../plotsquared/bukkit/chat/Reflection.java | 8 -------- .../intellectualsites/plotsquared/plot/IPlotMain.java | 4 ---- 2 files changed, 12 deletions(-) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/Reflection.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/Reflection.java index ebe7e81b3..f3f004284 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/Reflection.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/chat/Reflection.java @@ -21,8 +21,6 @@ public final class Reflection { private static final Map> _loadedNMSClasses = new HashMap<>(); /** * Stores loaded classes from the {@code org.bukkit.craftbukkit} package (and subpackages). - -import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; */ private static final Map> _loadedOBCClasses = new HashMap<>(); private static final Map, Map> _loadedFields = new HashMap<>(); @@ -39,11 +37,7 @@ import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; /** * Gets the version string from the package name of the CraftBukkit server implementation. - -import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; * This is needed to bypass the JAR package name changing on each update. - -import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; * * @return The version string of the OBC and NMS packages, including the trailing dot. */ @@ -85,8 +79,6 @@ import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; * The class instances returned by this method are cached, such that no lookup will be done twice (unless multiple threads are accessing this method simultaneously). * * @param className The name of the class, excluding the package, within OBC. This name may contain a subpackage name, such as {@code inventory.CraftItemStack}. - -import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; * @return The class instance representing the specified OBC class, or {@code null} if it could not be loaded. */ public synchronized static Class getOBCClass(String className) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java index b532cb4ce..bf4bf888a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java @@ -88,12 +88,8 @@ public interface IPlotMain extends ILogger { /** * Gets the NMS package prefix. - -import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; * * @return The NMS package prefix - -import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil; */ String getNMSPackage(); From 1570c4d08a4b14bf6255be722cf048a0dcea6d46 Mon Sep 17 00:00:00 2001 From: Matt <4009945+MattBDev@users.noreply.github.com> Date: Wed, 6 Nov 2019 14:20:32 -0500 Subject: [PATCH 08/22] Add missing import --- .../intellectualsites/plotsquared/bukkit/util/BukkitUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java index a73872bee..b2ceb0e4b 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java @@ -3,9 +3,9 @@ package com.github.intellectualsites.plotsquared.bukkit.util; import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; -import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.object.schematic.PlotItem; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; From 07fcd53bf86bdec7810cdd7d9887c2b5d2a04123 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Fri, 8 Nov 2019 05:17:51 +0000 Subject: [PATCH 09/22] Fixes IntellectualSites/PlotSquaredSuggestions#58 --- .../plot/generator/ClassicPlotManager.java | 48 ++++++++----------- .../plotsquared/plot/object/BlockBucket.java | 8 +++- .../plotsquared/plot/object/PlotManager.java | 17 ++++++- 3 files changed, 41 insertions(+), 32 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java index b0ef7e138..640ee389c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java @@ -51,7 +51,9 @@ public class ClassicPlotManager extends SquarePlotManager { @Override public boolean unClaimPlot(Plot plot, Runnable whenDone) { setWallFilling(plot.getId(), classicPlotWorld.WALL_FILLING); - setWall(plot.getId(), classicPlotWorld.WALL_BLOCK); + if (!classicPlotWorld.WALL_BLOCK.isAir() || !classicPlotWorld.WALL_BLOCK.equals(classicPlotWorld.CLAIMED_WALL_BLOCK)) { + setWall(plot.getId(), classicPlotWorld.WALL_BLOCK); + } return GlobalBlockQueue.IMP.addEmptyTask(whenDone); } @@ -409,44 +411,29 @@ public class ClassicPlotManager extends SquarePlotManager { * @return false if part of the merge failed, otherwise true if successful. */ @Override public boolean finishPlotMerge(List plotIds) { - final BlockBucket block = classicPlotWorld.CLAIMED_WALL_BLOCK; - boolean success = true; - for (PlotId plotId : plotIds) { - success &= setWall(plotId, block); + final BlockBucket claim = classicPlotWorld.CLAIMED_WALL_BLOCK; + if (!claim.isAir() || !claim.equals(classicPlotWorld.WALL_BLOCK)) { + for (PlotId plotId : plotIds) { + setWall(plotId, claim); + } } if (Settings.General.MERGE_REPLACE_WALL) { final BlockBucket wallBlock = classicPlotWorld.WALL_FILLING; for (PlotId id : plotIds) { - success &= setWallFilling(id, wallBlock); + setWallFilling(id, wallBlock); } } - return success; + return true; } @Override public boolean finishPlotUnlink(List plotIds) { - final BlockBucket block = classicPlotWorld.CLAIMED_WALL_BLOCK; - boolean success = true; - for (PlotId id : plotIds) { - success &= setWall(id, block); - } - return success; - } - - /** - * Sets all the blocks along all the plot walls to their correct state (claimed or unclaimed). - * - * @return true if the wall blocks were successfully set - */ - @Override public boolean regenerateAllPlotWalls() { - boolean success = true; - for (Plot plot : classicPlotWorld.getPlots()) { - if (plot.hasOwner()) { - success &= setWall(plot.getId(), classicPlotWorld.CLAIMED_WALL_BLOCK); - } else { - success &= setWall(plot.getId(), classicPlotWorld.WALL_BLOCK); + final BlockBucket claim = classicPlotWorld.CLAIMED_WALL_BLOCK; + if (!claim.isAir() || !claim.equals(classicPlotWorld.WALL_BLOCK)) { + for (PlotId id : plotIds) { + setWall(id, claim); } } - return success; + return true; // return false if unlink has been denied } @Override public boolean startPlotMerge(List plotIds) { @@ -459,7 +446,10 @@ public class ClassicPlotManager extends SquarePlotManager { @Override public boolean claimPlot(Plot plot) { final BlockBucket claim = classicPlotWorld.CLAIMED_WALL_BLOCK; - return setWall(plot.getId(), claim); + if (!claim.isAir() || !claim.equals(classicPlotWorld.WALL_BLOCK)) { + return setWall(plot.getId(), claim); + } + return true; } @Override public String[] getPlotComponents(PlotId plotId) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java index cc8e9cd72..43b519fc3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java @@ -25,7 +25,7 @@ import java.util.Random; * A block bucket is a container of block types, where each block * has a specified chance of being randomly picked */ -@EqualsAndHashCode @SuppressWarnings({"unused", "WeakerAccess"}) public final class BlockBucket +@EqualsAndHashCode(of={"blocks"}) @SuppressWarnings({"unused", "WeakerAccess"}) public final class BlockBucket implements Iterable, ConfigurationSerializable { private final Random random = new Random(); @@ -194,6 +194,11 @@ import java.util.Random; return builder.toString(); } + public boolean isAir() { + compile(); + return blocks.isEmpty() || (single != null && single.getBlockType().getMaterial().isAir()); + } + @Override public Map serialize() { if (!isCompiled()) { compile(); @@ -201,7 +206,6 @@ import java.util.Random; return ImmutableMap.of("blocks", this.toString()); } - @Getter @EqualsAndHashCode @RequiredArgsConstructor private final static class Range { private final int min; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotManager.java index 0b39b2b7d..8f50f3504 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotManager.java @@ -90,6 +90,21 @@ public abstract class PlotManager { return 255; } - public abstract boolean regenerateAllPlotWalls(); + /** + * Sets all the blocks along all the plot walls to their correct state (claimed or unclaimed). + * + * @return true if the wall blocks were successfully set + */ + public boolean regenerateAllPlotWalls() { + boolean success = true; + for (Plot plot : plotArea.getPlots()) { + if (plot.hasOwner()) { + success &= claimPlot(plot); + } else { + success &= unClaimPlot(plot, null); + } + } + return success; + } } From ed588476e00f4627f94a1bedae18d74611f91023 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Fri, 8 Nov 2019 22:31:01 +0000 Subject: [PATCH 10/22] Fix single plot areas --- .../plotsquared/plot/object/PlotId.java | 10 +++++++++- .../plot/object/worlds/SinglePlot.java | 2 +- .../plot/object/worlds/SinglePlotArea.java | 17 ++++++++++++----- .../object/worlds/SinglePlotAreaManager.java | 2 +- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotId.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotId.java index 21e7dc777..a777a6b6f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotId.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotId.java @@ -25,6 +25,14 @@ public class PlotId { this.y = y; } + public int getX() { + return x; + } + + public int getY() { + return y; + } + /** * Get a Plot Id based on a string * @@ -40,7 +48,7 @@ public class PlotId { } @Nullable public static PlotId fromStringOrNull(@NotNull String string) { - String[] parts = string.split("[;|,]"); + String[] parts = string.split("[;,.]"); if (parts.length < 2) { return null; } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java index a9a620daa..788e7a99a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java @@ -44,7 +44,7 @@ public class SinglePlot extends Plot { } @Override public String getWorldName() { - return getId().toCommaSeparatedString(); + return getId().getX() + "." + getId().getY(); } @Override public SinglePlotArea getArea() { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java index 1f5e70856..f04d340eb 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java @@ -47,7 +47,7 @@ public class SinglePlotArea extends GridPlotWorld { } public void loadWorld(final PlotId id) { - String worldName = id.toCommaSeparatedString(); + String worldName = id.getX() + "." + id.getY(); if (WorldUtil.IMP.isWorld(worldName)) { return; } @@ -59,12 +59,19 @@ public class SinglePlotArea extends GridPlotWorld { setup.step = new ConfigurationNode[0]; setup.world = worldName; + File container = PlotSquared.imp().getWorldContainer(); + File destination = new File(container, worldName); + + {// convert old + File oldFile = new File(container, id.toCommaSeparatedString()); + if (oldFile.exists()) { + oldFile.renameTo(destination); + } + } // Duplicate 0;0 if (setup.type != 0) { - File container = PlotSquared.imp().getWorldContainer(); - File destination = new File(container, worldName); if (!destination.exists()) { - File src = new File(container, "0,0"); + File src = new File(container, "0.0"); if (src.exists()) { if (!destination.exists()) { destination.mkdirs(); @@ -93,7 +100,7 @@ public class SinglePlotArea extends GridPlotWorld { TaskManager.IMP.sync(new RunnableVal() { @Override public void run(Object value) { - String worldName = id.toCommaSeparatedString(); + String worldName = id.getX() + "." + id.getY(); if (WorldUtil.IMP.isWorld(worldName)) { return; } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotAreaManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotAreaManager.java index 620a689b3..d35257b9b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotAreaManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotAreaManager.java @@ -44,7 +44,7 @@ public class SinglePlotAreaManager extends DefaultPlotAreaManager { } case 1: if ((c <= '/') || (c >= ':')) { - if (c == ';' || c == ',') { + if (c == '.') { mode = 2; continue; } From c155c65a8fe58ab8dece2975b469fd505ab68c92 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sun, 10 Nov 2019 11:23:25 +0000 Subject: [PATCH 11/22] Remove modifier reflection Fixes #2484 --- .../intellectualsites/plotsquared/plot/config/Config.java | 6 +----- .../intellectualsites/plotsquared/plot/config/Settings.java | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Config.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Config.java index 7234743cf..f7bd5118e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Config.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Config.java @@ -365,12 +365,8 @@ public class Config { * @throws NoSuchFieldException * @throws IllegalAccessException */ - private static void setAccessible(Field field) - throws NoSuchFieldException, IllegalAccessException { + private static void setAccessible(Field field) { field.setAccessible(true); - Field modifiersField = Field.class.getDeclaredField("modifiers"); - modifiersField.setAccessible(true); - modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); } /** diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java index b1e239c78..8dd1be8a8 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java @@ -16,10 +16,10 @@ public class Settings extends Config { @Comment("These first 7 aren't configurable") // This is a comment @Final // Indicates that this value isn't configurable - public static final String ISSUES = "https://github.com/IntellectualSites/PlotSquared/issues"; - @Final public static final String SUGGESTION = + public static String ISSUES = "https://github.com/IntellectualSites/PlotSquared/issues"; + @Final public static String SUGGESTION = "https://github.com/IntellectualSites/PlotSquaredSuggestions"; - @Final public static final String WIKI = + @Final public static String WIKI = "https://github.com/IntellectualSites/PlotSquared/wiki"; @Final public static String DATE; // These values are set from P2 before loading @Final public static String BUILD; // These values are set from P2 before loading From c5121894789f3ff9c3ef0fdfd298172e1c6d561d Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sun, 10 Nov 2019 11:31:47 +0000 Subject: [PATCH 12/22] fix import --- .../intellectualsites/plotsquared/bukkit/util/BukkitUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java index b2ceb0e4b..a73872bee 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java @@ -3,9 +3,9 @@ package com.github.intellectualsites.plotsquared.bukkit.util; import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; +import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; -import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.object.schematic.PlotItem; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; From baca8808ee50fc38f23772223954db1c4a4e9b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Sun, 10 Nov 2019 13:26:15 +0100 Subject: [PATCH 13/22] Add missing Location import. --- .../intellectualsites/plotsquared/bukkit/util/BukkitUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java index b2ceb0e4b..a73872bee 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java @@ -3,9 +3,9 @@ package com.github.intellectualsites.plotsquared.bukkit.util; import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; +import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; -import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.object.schematic.PlotItem; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; From 3e30e9554f0f19e86b3c184212ff29134cd1065f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Sun, 10 Nov 2019 13:26:59 +0100 Subject: [PATCH 14/22] Add missing RunnableVal import. --- .../intellectualsites/plotsquared/bukkit/util/BukkitUtil.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java index 0e640db8c..026689c2d 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java @@ -6,6 +6,7 @@ import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.sk89q.worldedit.regions.CuboidRegion; import com.github.intellectualsites.plotsquared.plot.object.schematic.PlotItem; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; From 729452038bd3701762d7880218616246ca6dc1a6 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sun, 10 Nov 2019 12:43:47 +0000 Subject: [PATCH 15/22] Check if integer --- .../plot/config/Configuration.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java index d8e141069..a4fe5a8b5 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java @@ -1,12 +1,16 @@ package com.github.intellectualsites.plotsquared.plot.config; import com.github.intellectualsites.plotsquared.plot.object.BlockBucket; +import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.github.intellectualsites.plotsquared.plot.util.StringComparison; +import com.github.intellectualsites.plotsquared.plot.util.StringMan; import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; import com.sk89q.worldedit.world.block.BlockState; import lombok.Getter; import lombok.NonNull; +import java.util.Arrays; + /** * Main Configuration Utility */ @@ -64,15 +68,15 @@ public class Configuration { final BlockBucket blockBucket = new BlockBucket(); final String[] parts = string.split(","); for (final String part : parts) { - String block; + String block = part; int chance = -1; - if (part.contains(":")) { final String[] innerParts = part.split(":"); - if (innerParts.length > 1) { - chance = Integer.parseInt(innerParts[1]); + String chanceStr = innerParts[innerParts.length - 1]; + if (innerParts.length > 1 && MathMan.isInteger(chanceStr)) { + chance = Integer.parseInt(chanceStr); + block = StringMan.join(Arrays.copyOf(innerParts, innerParts.length - 1), ":"); } - block = innerParts[0]; } else { block = part; } @@ -97,16 +101,17 @@ public class Configuration { } final String[] parts = string.split(","); for (final String part : parts) { - String block; + String block = part; if (part.contains(":")) { final String[] innerParts = part.split(":"); - if (innerParts.length > 1) { - final int chance = Integer.parseInt(innerParts[1]); + String chanceStr = innerParts[innerParts.length - 1]; + if (innerParts.length > 1 && MathMan.isInteger(chanceStr)) { + final int chance = Integer.parseInt(chanceStr); if (chance < 1 || chance > 100) { return false; } + block = StringMan.join(Arrays.copyOf(innerParts, innerParts.length - 1), ":"); } - block = innerParts[0]; } else { block = part; } From 34eb7d05dcf52972b447b6d0cab1226a2ff7cabb Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sun, 10 Nov 2019 12:45:51 +0000 Subject: [PATCH 16/22] Print actual value for setup? --- .../intellectualsites/plotsquared/plot/commands/Setup.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java index 82190f1b2..eb7826ee5 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java @@ -276,8 +276,9 @@ import java.util.UUID; Captions.NOT_ALLOWED_BLOCK.send(player, e.getUnsafeBlock().toString()); } if (valid) { - sendMessage(player, Captions.SETUP_VALID_ARG, step.getConstant(), args[0]); step.setValue(args[0]); + Object value = step.getValue(); + sendMessage(player, Captions.SETUP_VALID_ARG, step.getConstant(), value); object.setup_index++; if (object.setup_index == object.step.length) { onCommand(player, args); From 8c1985f9c036edc123b3fc124216b40752dd37f0 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sun, 10 Nov 2019 13:08:34 +0000 Subject: [PATCH 17/22] Split by regex --- .../intellectualsites/plotsquared/plot/PlotSquared.java | 2 +- .../plotsquared/plot/config/Configuration.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java index a08a8b1c2..fd57be3d8 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java @@ -1320,7 +1320,7 @@ import java.util.zip.ZipInputStream; .filter(validArgument -> args.toLowerCase(Locale.ENGLISH).contains(validArgument)) .count(); - String[] split = args.toLowerCase(Locale.ENGLISH).split(","); + String[] split = args.toLowerCase(Locale.ENGLISH).split(",(?![^\\(\\[]*[\\]\\)])"); if (split.length > expected) { // This means we have multi-block block buckets diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java index a4fe5a8b5..dc143f1e4 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java @@ -66,7 +66,7 @@ public class Configuration { return new BlockBucket(); } final BlockBucket blockBucket = new BlockBucket(); - final String[] parts = string.split(","); + final String[] parts = string.split(",(?![^\\(\\[]*[\\]\\)])"); for (final String part : parts) { String block = part; int chance = -1; @@ -99,7 +99,7 @@ public class Configuration { if (string == null || string.isEmpty()) { return false; } - final String[] parts = string.split(","); + final String[] parts = string.split(",(?![^\\(\\[]*[\\]\\)])"); for (final String part : parts) { String block = part; if (part.contains(":")) { From 7dcecf486dcde089751876ee0dadcd28916e64d3 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sun, 10 Nov 2019 13:18:15 +0000 Subject: [PATCH 18/22] Use regex for block bucket, yay --- .../plot/config/Configuration.java | 45 +++++++++---------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java index dc143f1e4..ec2e1dd34 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java @@ -10,6 +10,8 @@ import lombok.Getter; import lombok.NonNull; import java.util.Arrays; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * Main Configuration Utility @@ -61,6 +63,9 @@ public class Configuration { public static final SettingValue BLOCK_BUCKET = new SettingValue("BLOCK_BUCKET") { + + private Pattern pattern = Pattern.compile("((?[A-Za-z_]+):)?(?([A-Za-z_]+(\\[?[\\S\\s]+\\])?))(:(?[0-9]{1,3}))?"); + @Override public BlockBucket parseString(final String string) { if (string == null || string.isEmpty()) { return new BlockBucket(); @@ -68,18 +73,12 @@ public class Configuration { final BlockBucket blockBucket = new BlockBucket(); final String[] parts = string.split(",(?![^\\(\\[]*[\\]\\)])"); for (final String part : parts) { - String block = part; - int chance = -1; - if (part.contains(":")) { - final String[] innerParts = part.split(":"); - String chanceStr = innerParts[innerParts.length - 1]; - if (innerParts.length > 1 && MathMan.isInteger(chanceStr)) { - chance = Integer.parseInt(chanceStr); - block = StringMan.join(Arrays.copyOf(innerParts, innerParts.length - 1), ":"); - } - } else { - block = part; - } + Matcher matcher = pattern.matcher(part); + String namespace = matcher.group("namespace"); + String block = matcher.group("block"); + String chanceStr = matcher.group("chance"); + if (namespace == null) namespace = "minecraft"; + int chance = chanceStr == null ? -1 : Integer.parseInt(chanceStr); final StringComparison.ComparisonResult value = WorldUtil.IMP.getClosestBlock(block); if (value == null) { @@ -101,19 +100,15 @@ public class Configuration { } final String[] parts = string.split(",(?![^\\(\\[]*[\\]\\)])"); for (final String part : parts) { - String block = part; - if (part.contains(":")) { - final String[] innerParts = part.split(":"); - String chanceStr = innerParts[innerParts.length - 1]; - if (innerParts.length > 1 && MathMan.isInteger(chanceStr)) { - final int chance = Integer.parseInt(chanceStr); - if (chance < 1 || chance > 100) { - return false; - } - block = StringMan.join(Arrays.copyOf(innerParts, innerParts.length - 1), ":"); - } - } else { - block = part; + Matcher matcher = pattern.matcher(part); + String namespace = matcher.group("namespace"); + String block = matcher.group("block"); + String chanceStr = matcher.group("chance"); + if (namespace == null) namespace = "minecraft"; + int chance = chanceStr == null ? -1 : Integer.parseInt(chanceStr); + + if ((chance != -1 && (chance < 1 || chance > 100)) || block == null) { + return false; } StringComparison.ComparisonResult value = WorldUtil.IMP.getClosestBlock(block); From f1b8510708bf86260f9ae9eff9e630c3c8c2d9a5 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sun, 10 Nov 2019 13:24:04 +0000 Subject: [PATCH 19/22] forgot to find --- .../plotsquared/plot/config/Configuration.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java index ec2e1dd34..94188b35b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Configuration.java @@ -74,6 +74,7 @@ public class Configuration { final String[] parts = string.split(",(?![^\\(\\[]*[\\]\\)])"); for (final String part : parts) { Matcher matcher = pattern.matcher(part); + matcher.find(); String namespace = matcher.group("namespace"); String block = matcher.group("block"); String chanceStr = matcher.group("chance"); @@ -101,6 +102,7 @@ public class Configuration { final String[] parts = string.split(",(?![^\\(\\[]*[\\]\\)])"); for (final String part : parts) { Matcher matcher = pattern.matcher(part); + matcher.find(); String namespace = matcher.group("namespace"); String block = matcher.group("block"); String chanceStr = matcher.group("chance"); From 93894aca963473936b63812e16e8ee6d6aad1ba1 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sun, 10 Nov 2019 13:27:37 +0000 Subject: [PATCH 20/22] Force lowercase --- .../intellectualsites/plotsquared/plot/util/world/BlockUtil.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/BlockUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/BlockUtil.java index 6ea6d1c6c..7f57e80c2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/BlockUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/BlockUtil.java @@ -41,6 +41,7 @@ public final class BlockUtil { if (id.length() == 1 && id.charAt(0) == '*') { return FuzzyBlockState.builder().type(BlockTypes.AIR).build(); } + id = id.toLowerCase(); BlockType type = BlockType.REGISTRY.get(id); if (type != null) { return type.getDefaultState(); From fe438fd62afb936e398e3ecebacac6f38a257c94 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sun, 10 Nov 2019 13:29:58 +0000 Subject: [PATCH 21/22] swallow stacktrace --- .../intellectualsites/plotsquared/plot/util/world/BlockUtil.java | 1 - 1 file changed, 1 deletion(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/BlockUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/BlockUtil.java index 7f57e80c2..14ff2652c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/BlockUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/BlockUtil.java @@ -62,7 +62,6 @@ public final class BlockUtil { BaseBlock block = PARSER.parseFromInput(id, PARSER_CONTEXT); return block.toImmutableState(); } catch (InputParseException e) { - e.printStackTrace(); return null; } } From 1d9ad9482264d263782c62d61f8a09a414bdaa40 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sun, 10 Nov 2019 14:01:12 +0000 Subject: [PATCH 22/22] Fix plot getRegions off by 1 --- .../plotsquared/plot/object/Plot.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java index 33e482428..67fe23387 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java @@ -879,10 +879,10 @@ public class Plot { @Override public void run() { if (queue.isEmpty()) { Runnable run = () -> { -// for (CuboidRegion region : regions) { -// Location[] corners = MainUtil.getCorners(getWorldName(), region); -// ChunkManager.manager.clearAllEntities(corners[0], corners[1]); -// } + for (CuboidRegion region : regions) { + Location[] corners = MainUtil.getCorners(getWorldName(), region); + ChunkManager.manager.clearAllEntities(corners[0], corners[1]); + } TaskManager.runTask(whenDone); }; for (Plot current : plots) { @@ -2710,7 +2710,7 @@ public class Plot { BlockVector3 pos2 = BlockVector3.at(toploc.getX(), Plot.MAX_HEIGHT - 1, topabs.getZ()); regions.add(new CuboidRegion(pos1, pos2)); if (plot.getMerged(Direction.SOUTHEAST)) { - pos1 = BlockVector3.at(topabs.getX() + 1, 0, topabs.getZ()); + pos1 = BlockVector3.at(topabs.getX() + 1, 0, topabs.getZ() + 1); pos2 = BlockVector3.at(toploc.getX(), Plot.MAX_HEIGHT - 1, toploc.getZ()); regions.add( new CuboidRegion(pos1, pos2));