From e27b6fb6c363aac239fa416deafc13726670b4dc Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Fri, 19 Apr 2019 19:01:17 +0200 Subject: [PATCH 1/7] Done :ok_hand: --- .../voxelsniper/util/BlockWrapper.java | 118 ++++++++---------- .../voxelsniper/util/UndoDelegate.java | 28 ++--- .../voxelsniper/util/VoxelList.java | 31 ++--- 3 files changed, 71 insertions(+), 106 deletions(-) diff --git a/favs/src/main/java/com/thevoxelbox/voxelsniper/util/BlockWrapper.java b/favs/src/main/java/com/thevoxelbox/voxelsniper/util/BlockWrapper.java index d8f31240c..7b29aa1a5 100644 --- a/favs/src/main/java/com/thevoxelbox/voxelsniper/util/BlockWrapper.java +++ b/favs/src/main/java/com/thevoxelbox/voxelsniper/util/BlockWrapper.java @@ -7,8 +7,7 @@ import org.bukkit.World; /** * @author MikeMatrix */ -public class BlockWrapper -{ +public class BlockWrapper { private int id; private Material type; @@ -22,8 +21,7 @@ public class BlockWrapper * @param block */ @SuppressWarnings("deprecation") - public BlockWrapper(final AsyncBlock block) - { + public BlockWrapper(final AsyncBlock block) { this.setId(block.getTypeId()); this.setX(block.getX()); this.setY(block.getY()); @@ -35,111 +33,93 @@ public class BlockWrapper /** * @return the data */ - public final int getPropertyId() - { + public final int getPropertyId() { return this.data; } + /** + * @param data the data to set + */ + public final void setPropertyId(final int data) { + this.data = data; + } + public Material getType() { return type; } + public void setType(Material type) { + this.type = type; + } + /** * @return the id */ - public final int getId() - { + public final int getId() { return this.id; } + /** + * @param id the id to set + */ + public final void setId(final int id) { + this.id = id; + } + /** * @return the world */ - public final World getWorld() - { + public final World getWorld() { return this.world; } + /** + * @param world the world to set + */ + public final void setWorld(final World world) { + this.world = world; + } + /** * @return the x */ - public final int getX() - { + public final int getX() { return this.x; } + /** + * @param x the x to set + */ + public final void setX(final int x) { + this.x = x; + } + /** * @return the y */ - public final int getY() - { + public final int getY() { return this.y; } + /** + * @param y the y to set + */ + public final void setY(final int y) { + this.y = y; + } + /** * @return the z */ - public final int getZ() - { + public final int getZ() { return this.z; } /** - * @param data - * the data to set + * @param z the z to set */ - public final void setPropertyId(final int data) - { - this.data = data; - } - - /** - * @param id - * the id to set - */ - public final void setId(final int id) - { - this.id = id; - } - - /** - * @param world - * the world to set - */ - public final void setWorld(final World world) - { - this.world = world; - } - - /** - * @param x - * the x to set - */ - public final void setX(final int x) - { - this.x = x; - } - - /** - * @param y - * the y to set - */ - public final void setY(final int y) - { - this.y = y; - } - - /** - * @param z - * the z to set - */ - public final void setZ(final int z) - { + public final void setZ(final int z) { this.z = z; } - public void setType(Material type) { - this.type = type; - } - } diff --git a/favs/src/main/java/com/thevoxelbox/voxelsniper/util/UndoDelegate.java b/favs/src/main/java/com/thevoxelbox/voxelsniper/util/UndoDelegate.java index 685dca303..0cf10403c 100644 --- a/favs/src/main/java/com/thevoxelbox/voxelsniper/util/UndoDelegate.java +++ b/favs/src/main/java/com/thevoxelbox/voxelsniper/util/UndoDelegate.java @@ -1,4 +1,3 @@ - package com.thevoxelbox.voxelsniper.util; import com.thevoxelbox.voxelsniper.Undo; @@ -10,26 +9,23 @@ import org.bukkit.block.data.BlockData; /** * */ -public class UndoDelegate implements BlockChangeDelegate -{ +public class UndoDelegate implements BlockChangeDelegate { private final World targetWorld; private Undo currentUndo; - - public Undo getUndo() - { + + public UndoDelegate(World targetWorld) { + this.targetWorld = targetWorld; + this.currentUndo = new Undo(); + } + + public Undo getUndo() { final Undo pastUndo = currentUndo; currentUndo = new Undo(); return pastUndo; } - public UndoDelegate(World targetWorld) - { - this.targetWorld = targetWorld; - this.currentUndo = new Undo(); - } @SuppressWarnings("deprecation") - public boolean setBlock(Block b) - { + public boolean setBlock(Block b) { this.currentUndo.put(this.targetWorld.getBlockAt(b.getLocation())); this.targetWorld.getBlockAt(b.getLocation()).setBlockData(b.getBlockData()); return true; @@ -48,14 +44,12 @@ public class UndoDelegate implements BlockChangeDelegate } @Override - public int getHeight() - { + public int getHeight() { return this.targetWorld.getMaxHeight(); } @Override - public boolean isEmpty(int x, int y, int z) - { + public boolean isEmpty(int x, int y, int z) { return this.targetWorld.getBlockAt(x, y, z).isEmpty(); } } diff --git a/favs/src/main/java/com/thevoxelbox/voxelsniper/util/VoxelList.java b/favs/src/main/java/com/thevoxelbox/voxelsniper/util/VoxelList.java index 77b513db9..34fd3c4d0 100644 --- a/favs/src/main/java/com/thevoxelbox/voxelsniper/util/VoxelList.java +++ b/favs/src/main/java/com/thevoxelbox/voxelsniper/util/VoxelList.java @@ -16,39 +16,34 @@ import java.util.List; /** * Container class for multiple ID/Datavalue pairs. */ -public class VoxelList -{ +public class VoxelList { private BlockMask mask = new BlockMask(); /** * Adds the specified id, data value pair to the VoxelList. A data value of -1 will operate on all data values of that id. - * + * * @param i */ - public void add(BlockState i) - { + public void add(BlockState i) { this.mask = mask.toBuilder().add(i).build(NullExtent.INSTANCE); } - public void add(BlockMask mask) - { + public void add(BlockMask mask) { this.mask = (BlockMask) mask.and(mask); } /** * Removes the specified id, data value pair from the VoxelList. - * + * * @return true if this list contained the specified element */ - public boolean removeValue(final BlockState state) - { + public boolean removeValue(final BlockState state) { this.mask = mask.toBuilder().remove(state).build(NullExtent.INSTANCE); return true; } - public boolean removeValue(final BlockMask state) - { + public boolean removeValue(final BlockMask state) { this.mask = (BlockMask) mask.and(state.inverse()); return true; } @@ -57,16 +52,14 @@ public class VoxelList * @param i * @return true if this list contains the specified element */ - public boolean contains(final BlockData i) - { + public boolean contains(final BlockData i) { return mask.test(BukkitAdapter.adapt(i)); } /** * Clears the VoxelList. */ - public void clear() - { + public void clear() { mask = mask.toBuilder().clear().build(NullExtent.INSTANCE); } @@ -75,8 +68,7 @@ public class VoxelList * * @return true if this list contains no elements */ - public boolean isEmpty() - { + public boolean isEmpty() { return mask.toBuilder().isEmpty(); } @@ -85,8 +77,7 @@ public class VoxelList * * @return defensive copy of the List with pairs */ - public String toString() - { + public String toString() { return mask.toString(); } From 53f47c7edc9ab6ce20e07adbbb4d9547a07b6ffe Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Sun, 21 Apr 2019 00:49:57 +0200 Subject: [PATCH 2/7] Update offset to match CI --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 2eef07f19..5cc523b4c 100644 --- a/build.gradle +++ b/build.gradle @@ -47,7 +47,7 @@ ext { date = git.head().getDate().format("yy.MM.dd") revision = "-${git.head().abbreviatedId}" parents = git.head().parentIds; - index = -2116; // Offset to match CI + index = -2122; // Offset to match CI for (; parents != null && !parents.isEmpty(); index++) { parents = git.getResolve().toCommit(parents.get(0)).getParentIds() } From f4938eeffec3ee25fb6a47a756923ebfab0051c2 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Sun, 21 Apr 2019 01:01:09 +0200 Subject: [PATCH 3/7] Revert "Update offset to match CI" Ffs --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 5cc523b4c..736e7b041 100644 --- a/build.gradle +++ b/build.gradle @@ -47,7 +47,7 @@ ext { date = git.head().getDate().format("yy.MM.dd") revision = "-${git.head().abbreviatedId}" parents = git.head().parentIds; - index = -2122; // Offset to match CI + index = -2110; // Offset to match CI for (; parents != null && !parents.isEmpty(); index++) { parents = git.getResolve().toCommit(parents.get(0)).getParentIds() } From 640fac6374ce303e42e0e0fe4c14c05433158d60 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Sun, 21 Apr 2019 10:28:50 +0200 Subject: [PATCH 4/7] Add flags --- build.gradle | 2 +- .../java/com/sk89q/worldedit/command/ClipboardCommands.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 736e7b041..81b67c8be 100644 --- a/build.gradle +++ b/build.gradle @@ -47,7 +47,7 @@ ext { date = git.head().getDate().format("yy.MM.dd") revision = "-${git.head().abbreviatedId}" parents = git.head().parentIds; - index = -2110; // Offset to match CI + index = -2109; // Offset to match CI for (; parents != null && !parents.isEmpty(); index++) { parents = git.getResolve().toCommit(parents.get(0)).getParentIds() } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java index 70f9fb6d6..dce724a2f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java @@ -437,7 +437,7 @@ public class ClipboardCommands extends MethodCommands { @Command( aliases = {"/paste"}, usage = "", - flags = "sao", + flags = "saobe", desc = "Paste the clipboard's contents", help = "Pastes the clipboard's contents.\n" + From f56460c9aca5d2d3832e3e9d642c4be6d08a9e14 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Sun, 21 Apr 2019 15:38:50 +0200 Subject: [PATCH 5/7] Fix permission packs --- .../src/main/resources/DummyFawe.src | Bin 1073 -> 1988 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/worldedit-bukkit/src/main/resources/DummyFawe.src b/worldedit-bukkit/src/main/resources/DummyFawe.src index 969870c12381a7fa4cc896cd40b63f204fce15e8..d41a1a0efe2dde47be13726aa3192a33a6538655 100644 GIT binary patch delta 1122 zcmV-o1fBb_2*eMt3<7@?0000801SMUPRwG~khcQ>0Fe{`015yA0B~$|XK8LOd2MW! zn9Hu?HVlUM0rC#PEDJ=yw5w*<0@GLMVlWF@qHQ&_q>54!&(l|SZgVoxrDqkGpGb<5 zs9(pxgooWp9Cp%9qO-FKTJ&&6@h5+QIc_&6^sH^NfBGyw z|F-Wu!cm*y({=++?;qC1m_EfYTF-~w*DsUP9)JJ!+jis7Pns8u58KUdw|aME1OFSr zqgp>Me+qku6b`%KBi=vCQIqm$9@NhcMB+K1dJbHPZg#*dJPwc0Kg8&P_?68vZ_;=d z;t~G=ke+l9zr25B7PPD618UOd6|wGN_ed60*~e0M2l6O7U@hM}%T4UO><&!3<2toB zGm~H>(nrH%l<2gbP-xTJ0+9&DPzFeImXKpK$5M=C@CtF(1!>n=@Jh%S>QGwkfH{oi zh!X@YMQ?rj!F6z5#5z@|!INS*VZ$^D!8c&m&2@_4``mvze=)2}+^ zZGilOjYuy(p0|xTXCCw3BzQAeYT0e_ul&vuy8yHK}rH+>444m|E%_|xXv55qhXjB8Ju$7dk z(>f0gWEg*aOowfnAmjKW{!d!MVE@N}nBCyl#xBNGQhTmIX);(rWb~&RW0P7Sm}{QU z1oRciK!_elf3L+n0})r4KJ}&=!;`gPtU!~k)}VY^Z;;1gzr3du3P<72OLRTfaB2yE=!4+6rV_|ySVO9ci10000700#ia0RRB!1poj50OivGbN~PV delta 200 zcmX@Yzma1D4^s{o0|N&KgX}f|-#Z0L*E|>)7~FvvD9TWfQ<|Qcr&pPqbK3ii@7ACK zZymitopoot`OfQ~@+|Z{sq^sZDc>_^HV1i}JAc*t)OsJylUKaGb^NaupYl9&`q@)0 zZ(Xf(XV_0^OTLoS_*lfqFgbxuW-~KeFr$|UGj4l Date: Sun, 21 Apr 2019 19:01:49 +0200 Subject: [PATCH 6/7] Moving some commands --- .../thevoxelbox/voxelsniper/VoxelSniper.java | 21 ++- .../voxelsniper/command/VoxelUndoCommand.java | 5 +- .../worldedit/command/GeneralCommands.java | 144 ------------------ .../worldedit/command/OptionsCommands.java | 66 ++++++++ .../internal/util/DocumentationPrinter.java | 1 - 5 files changed, 79 insertions(+), 158 deletions(-) delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java diff --git a/favs/src/main/java/com/thevoxelbox/voxelsniper/VoxelSniper.java b/favs/src/main/java/com/thevoxelbox/voxelsniper/VoxelSniper.java index d518da511..9072ef36c 100644 --- a/favs/src/main/java/com/thevoxelbox/voxelsniper/VoxelSniper.java +++ b/favs/src/main/java/com/thevoxelbox/voxelsniper/VoxelSniper.java @@ -15,9 +15,17 @@ import org.bukkit.plugin.java.JavaPlugin; */ public class VoxelSniper extends JavaPlugin { private static VoxelSniper instance; - private SniperManager sniperManager = new SniperManager(this); private final VoxelSniperListener voxelSniperListener = new VoxelSniperListener(this); + private SniperManager sniperManager = new SniperManager(this); private VoxelSniperConfiguration voxelSniperConfiguration; + private Brushes brushManager = new Brushes(); + + /** + * @return {@link VoxelSniper} + */ + public static VoxelSniper getInstance() { + return VoxelSniper.instance; + } /** * Returns {@link com.thevoxelbox.voxelsniper.Brushes} for current instance. @@ -28,15 +36,6 @@ public class VoxelSniper extends JavaPlugin { return brushManager; } - private Brushes brushManager = new Brushes(); - - /** - * @return {@link VoxelSniper} - */ - public static VoxelSniper getInstance() { - return VoxelSniper.instance; - } - /** * Returns object for accessing global VoxelSniper options. * @@ -67,7 +66,7 @@ public class VoxelSniper extends JavaPlugin { return voxelSniperListener.onCommand((Player) sender, arguments, command.getName()); } - getLogger().info("Only Players can execute commands."); + getLogger().info("Only players can execute VoxelSniper commands."); return true; } diff --git a/favs/src/main/java/com/thevoxelbox/voxelsniper/command/VoxelUndoCommand.java b/favs/src/main/java/com/thevoxelbox/voxelsniper/command/VoxelUndoCommand.java index 6a71efa71..ad7601a75 100644 --- a/favs/src/main/java/com/thevoxelbox/voxelsniper/command/VoxelUndoCommand.java +++ b/favs/src/main/java/com/thevoxelbox/voxelsniper/command/VoxelUndoCommand.java @@ -1,5 +1,6 @@ package com.thevoxelbox.voxelsniper.command; +import com.boydti.fawe.config.BBC; import com.thevoxelbox.voxelsniper.Sniper; import com.thevoxelbox.voxelsniper.VoxelSniper; import com.thevoxelbox.voxelsniper.api.command.VoxelCommand; @@ -21,12 +22,12 @@ public class VoxelUndoCommand extends VoxelCommand { int amount = Integer.parseInt(args[0]); sniper.undo(amount); } catch (NumberFormatException exception) { - player.sendMessage("Error while parsing amount of undo. Number format exception."); + player.sendMessage(BBC.getPrefix() + "Number expected; string given."); } } else { sniper.undo(); } - plugin.getLogger().info("Player \"" + player.getName() + "\" used /u"); +// plugin.getLogger().info("Player \"" + player.getName() + "\" used /u"); return true; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java deleted file mode 100644 index 8f8de97d2..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser 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 Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.command; - -import com.boydti.fawe.config.BBC; -import com.sk89q.minecraft.util.commands.Command; -import com.sk89q.minecraft.util.commands.CommandContext; -import com.sk89q.minecraft.util.commands.CommandPermissions; -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.extension.input.DisallowedUsageException; -import com.sk89q.worldedit.entity.Player; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * General WorldEdit commands. - */ -public class GeneralCommands { - - private final WorldEdit worldEdit; - - /** - * Create a new instance. - * - * @param worldEdit reference to WorldEdit - */ - public GeneralCommands(WorldEdit worldEdit) { - checkNotNull(worldEdit); - this.worldEdit = worldEdit; - } - - @Command( - aliases = { "/limit" }, - usage = "[limit]", - desc = "Modify block change limit", - min = 0, - max = 1 - ) - @CommandPermissions("worldedit.limit") - public void limit(Player player, LocalSession session, CommandContext args) throws WorldEditException { - - LocalConfiguration config = worldEdit.getConfiguration(); - boolean mayDisable = player.hasPermission("worldedit.limit.unrestricted"); - - int limit = args.argsLength() == 0 ? config.defaultChangeLimit : Math.max(-1, args.getInteger(0)); - if (!mayDisable && config.maxChangeLimit > -1) { - if (limit > config.maxChangeLimit) { - player.printError(BBC.getPrefix() + "Your maximum allowable limit is " + config.maxChangeLimit + "."); - return; - } - } - - session.setBlockChangeLimit(limit); - - if (limit != config.defaultChangeLimit) { - player.print(BBC.getPrefix() + "Block change limit set to " + limit + ". (Use //limit to go back to the default.)"); - } else { - player.print(BBC.getPrefix() + "Block change limit set to " + limit + "."); - } - } - - @Command( - aliases = { "/timeout" }, - usage = "[time]", - desc = "Modify evaluation timeout time.", - min = 0, - max = 1 - ) - @CommandPermissions("worldedit.timeout") - public void timeout(Player player, LocalSession session, CommandContext args) throws WorldEditException { - - LocalConfiguration config = worldEdit.getConfiguration(); - boolean mayDisable = player.hasPermission("worldedit.timeout.unrestricted"); - - int limit = args.argsLength() == 0 ? config.calculationTimeout : Math.max(-1, args.getInteger(0)); - if (!mayDisable && config.maxCalculationTimeout > -1) { - if (limit > config.maxCalculationTimeout) { - player.printError(BBC.getPrefix() + "Your maximum allowable timeout is " + config.maxCalculationTimeout + " ms."); - return; - } - } - - session.setTimeout(limit); - - if (limit != config.calculationTimeout) { - player.print(BBC.getPrefix() + "Timeout time set to " + limit + " ms. (Use //timeout to go back to the default.)"); - } else { - player.print(BBC.getPrefix() + "Timeout time set to " + limit + " ms."); - } - } - - @Command( - aliases = { "/drawsel" }, - usage = "[on|off]", - desc = "Toggle drawing the current selection", - min = 0, - max = 1 - ) - @CommandPermissions("worldedit.drawsel") - public void drawSelection(Player player, LocalSession session, CommandContext args) throws WorldEditException { - - if (!WorldEdit.getInstance().getConfiguration().serverSideCUI) { - throw new DisallowedUsageException("This functionality is disabled in the configuration!"); - } - String newState = args.getString(0, null); - if (session.shouldUseServerCUI()) { - if ("on".equals(newState)) { - player.printError(BBC.getPrefix() + "Server CUI already enabled."); - return; - } - - session.setUseServerCUI(false); - session.updateServerCUI(player); - player.print("Server CUI disabled."); - } else { - if ("off".equals(newState)) { - player.printError(BBC.getPrefix() + "Server CUI already disabled."); - return; - } - - session.setUseServerCUI(true); - session.updateServerCUI(player); - player.print("Server CUI enabled. This only supports cuboid regions, with a maximum size of 32x32x32."); - } - } - -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/OptionsCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/OptionsCommands.java index efde0d097..f2454cff2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/OptionsCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/OptionsCommands.java @@ -10,6 +10,7 @@ import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.worldedit.*; +import com.sk89q.worldedit.extension.input.DisallowedUsageException; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.entity.Player; @@ -239,6 +240,71 @@ public class OptionsCommands { } } + @Command( + aliases = { "/timeout" }, + usage = "[time]", + desc = "Modify evaluation timeout time.", + min = 0, + max = 1 + ) + @CommandPermissions("worldedit.timeout") + public void timeout(Player player, LocalSession session, CommandContext args) throws WorldEditException { + + LocalConfiguration config = worldEdit.getConfiguration(); + boolean mayDisable = player.hasPermission("worldedit.timeout.unrestricted"); + + int limit = args.argsLength() == 0 ? config.calculationTimeout : Math.max(-1, args.getInteger(0)); + if (!mayDisable && config.maxCalculationTimeout > -1) { + if (limit > config.maxCalculationTimeout) { + player.printError(BBC.getPrefix() + "Your maximum allowable timeout is " + config.maxCalculationTimeout + " ms."); + return; + } + } + + session.setTimeout(limit); + + if (limit != config.calculationTimeout) { + player.print(BBC.getPrefix() + "Timeout time set to " + limit + " ms. (Use //timeout to go back to the default.)"); + } else { + player.print(BBC.getPrefix() + "Timeout time set to " + limit + " ms."); + } + } + + @Command( + aliases = { "/drawsel" }, + usage = "[on|off]", + desc = "Toggle drawing the current selection", + min = 0, + max = 1 + ) + @CommandPermissions("worldedit.drawsel") + public void drawSelection(Player player, LocalSession session, CommandContext args) throws WorldEditException { + + if (!WorldEdit.getInstance().getConfiguration().serverSideCUI) { + throw new DisallowedUsageException(BBC.getPrefix() + "This functionality is disabled in the configuration!"); + } + String newState = args.getString(0, null); + if (session.shouldUseServerCUI()) { + if ("on".equals(newState)) { + player.printError(BBC.getPrefix() + "Server CUI already enabled."); + return; + } + + session.setUseServerCUI(false); + session.updateServerCUI(player); + player.print(BBC.getPrefix() + "Server CUI disabled."); + } else { + if ("off".equals(newState)) { + player.printError(BBC.getPrefix() + "Server CUI already disabled."); + return; + } + + session.setUseServerCUI(true); + session.updateServerCUI(player); + player.print(BBC.getPrefix() + "Server CUI enabled. This only supports cuboid regions, with a maximum size of 32x32x32."); + } + } + @Command( aliases = {"/searchitem", "/l", "/search", "searchitem"}, usage = "", diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java index fbb4fb163..90871c4c1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java @@ -64,7 +64,6 @@ public final class DocumentationPrinter { classes.add(BiomeCommands.class); classes.add(ChunkCommands.class); classes.add(ClipboardCommands.class); - classes.add(GeneralCommands.class); classes.add(GenerationCommands.class); classes.add(HistoryCommands.class); classes.add(NavigationCommands.class); From 03f3b09ca918c2d2f686ecb56fcf64f999610cb1 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Mon, 22 Apr 2019 15:11:43 +0100 Subject: [PATCH 7/7] allow input of build number --- build.gradle | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 81b67c8be..fae84bd06 100644 --- a/build.gradle +++ b/build.gradle @@ -47,11 +47,15 @@ ext { date = git.head().getDate().format("yy.MM.dd") revision = "-${git.head().abbreviatedId}" parents = git.head().parentIds; - index = -2109; // Offset to match CI - for (; parents != null && !parents.isEmpty(); index++) { - parents = git.getResolve().toCommit(parents.get(0)).getParentIds() + if (project.hasProperty('buildnumber')) { + buildNumber = "$buildnumber" + } else { + index = -2109; // Offset to match CI + for (; parents != null && !parents.isEmpty(); index++) { + parents = git.getResolve().toCommit(parents.get(0)).getParentIds() + } + buildNumber = "${index}" } - buildNumber = "${index}" } if ( project.hasProperty("lzNoVersion") ) { // gradle build -PlzNoVersion