From efbe1a737da0df7ee6db6baf8880f1de1326748b Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Fri, 14 Feb 2020 14:35:11 -0500 Subject: [PATCH] Commented out Lighting commands --- .../main/java/com/boydti/fawe/FaweAPI.java | 23 +++-------- .../worldedit/command/RegionCommands.java | 40 ++++++++++--------- 2 files changed, 26 insertions(+), 37 deletions(-) diff --git a/worldedit-core/src/main/java/com/boydti/fawe/FaweAPI.java b/worldedit-core/src/main/java/com/boydti/fawe/FaweAPI.java index e45d011c5..f5508c3cd 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/FaweAPI.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/FaweAPI.java @@ -134,18 +134,6 @@ public class FaweAPI { } } - /** - * Create a command with the provided aliases and register all methods of the class as sub commands.
- * - You should try to register commands during startup - * - If no aliases are specified, all methods become root commands - * - * @param clazz The class containing all the sub command methods - * @param aliases The aliases to give the command (or none) - */ - public static void registerCommands(Object clazz, String... aliases) { -// PlatformCommandManager.getInstance().registerCommands(clazz, aliases); TODO NOT IMPLEMENTED - } - /** * You can either use a IQueueExtent or an EditSession to change blocks
* - The IQueueExtent skips a bit of overhead so it's marginally faster
@@ -255,12 +243,12 @@ public class FaweAPI { if (!file.exists() || file.isDirectory()) { throw new IllegalArgumentException("Not a file!"); } - if (!file.getName().toLowerCase().endsWith(".bd")) { - throw new IllegalArgumentException("Not a BD file!"); - } if (Settings.IMP.HISTORY.USE_DISK) { throw new IllegalArgumentException("History on disk not enabled!"); } + if (!file.getName().toLowerCase().endsWith(".bd")) { + throw new IllegalArgumentException("Not a BD file!"); + } String[] path = file.getPath().split(File.separator); if (path.length < 3) { throw new IllegalArgumentException("Not in history directory!"); @@ -277,8 +265,7 @@ public class FaweAPI { } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Invalid UUID from file path: " + uuidString); } - DiskStorageHistory history = new DiskStorageHistory(world, uuid, Integer.parseInt(file.getName().split("\\.")[0])); - return history; + return new DiskStorageHistory(world, uuid, Integer.parseInt(file.getName().split("\\.")[0])); } /** @@ -291,7 +278,7 @@ public class FaweAPI { * @param timediff - The max age of the file in milliseconds * @param shallow - If shallow is true, FAWE will only read the first Settings.IMP.BUFFER_SIZE bytes to obtain history info
* Reading only part of the file will result in unreliable bounds info for large edits - * @return + * @return a list of DiskStorageHistory Objects */ public static List getBDFiles(Location origin, UUID user, int radius, long timediff, boolean shallow) { Extent extent = origin.getExtent(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java index a4219c312..56e81e526 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java @@ -142,15 +142,16 @@ public class RegionCommands { ) @CommandPermissions("worldedit.light.fix") public void fixLighting(Player player) throws WorldEditException { - final Location loc = player.getLocation(); - Region selection = player.getSelection(); - if (selection == null) { - final int cx = loc.getBlockX() >> 4; - final int cz = loc.getBlockZ() >> 4; - selection = new CuboidRegion(BlockVector3.at(cx - 8, 0, cz - 8).multiply(16), BlockVector3.at(cx + 8, 0, cz + 8).multiply(16)); - } - int count = FaweAPI.fixLighting(player.getWorld(), selection,null); - player.print(Caption.of("fawe.info.lighting.propagate.selection" , count)); + player.print("Temporarily not working"); +// final Location loc = player.getLocation(); +// Region selection = player.getSelection(); +// if (selection == null) { +// final int cx = loc.getBlockX() >> 4; +// final int cz = loc.getBlockZ() >> 4; +// selection = new CuboidRegion(BlockVector3.at(cx - 8, 0, cz - 8).multiply(16), BlockVector3.at(cx + 8, 0, cz + 8).multiply(16)); +// } +// int count = FaweAPI.fixLighting(player.getWorld(), selection,null); +// player.print(Caption.of("fawe.info.lighting.propagate.selection" , count)); } @Command( @@ -171,14 +172,15 @@ public class RegionCommands { ) @CommandPermissions("worldedit.light.remove") public void removeLighting(Player player) { - Region selection = player.getSelection(); - if (selection == null) { - final int cx = player.getLocation().getBlockX() >> 4; - final int cz = player.getLocation().getBlockZ() >> 4; - selection = new CuboidRegion(BlockVector3.at(cx - 8, 0, cz - 8).multiply(16), BlockVector3.at(cx + 8, 0, cz + 8).multiply(16)); - } - int count = FaweAPI.fixLighting(player.getWorld(), selection, null); - player.print(Caption.of("fawe.info.updated.lighting.selection" , count)); + player.print("Temporarily not working"); +// Region selection = player.getSelection(); +// if (selection == null) { +// final int cx = player.getLocation().getBlockX() >> 4; +// final int cz = player.getLocation().getBlockZ() >> 4; +// selection = new CuboidRegion(BlockVector3.at(cx - 8, 0, cz - 8).multiply(16), BlockVector3.at(cx + 8, 0, cz + 8).multiply(16)); +// } +// int count = FaweAPI.fixLighting(player.getWorld(), selection, null); +// player.print(Caption.of("fawe.info.updated.lighting.selection" , count)); } @Command( @@ -207,7 +209,7 @@ public class RegionCommands { ) @CommandPermissions("worldedit.light.set") public void setlighting(Player player, EditSession editSession, @Selection Region region, @Range(from = 0, to = 15) int value) { - // TODO NOT IMPLEMENTED + player.print("Temporarily not working"); } @Command( @@ -216,7 +218,7 @@ public class RegionCommands { ) @CommandPermissions("worldedit.light.set") public void setskylighting(Player player, @Selection Region region, @Range(from = 0, to= 15) int value) { - // TODO NOT IMPLEMENTED + player.print("Temporarily not working"); } @Command(