Plex-FAWE/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

656 lines
26 KiB
Java
Raw Normal View History

/*
* WorldEdit, a Minecraft world manipulation toolkit
* Copyright (C) sk89q <http://www.sk89q.com>
* 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 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 <https://www.gnu.org/licenses/>.
*/
package com.sk89q.worldedit.command;
Feature/1.17 (#1120) * start v6 * Update classes to v6 method signatures * change rootVersion to signify p2v6 compat * Use 16 as toolchain version but target 11 for build output * add minimessage as api * Require v6 and don't attempt to "setup" hook from FAWE * Address comments * *address /all/ comments * FAWE classes should only act as a delegate * Uppercase logger * Settings for v6-hook have moved to P2-v6, remove unneeded if statements * Rename classes to Delegate * add whenDone task to setCuboids * Remove bad spaces * Fix plot swap * Initial work on 1.17 support * Remove data versions from the Bukkit adapters (#1507) * Remove data versions from the Bukkit adapters * Don't allow saving schematics without an adapter in place on Bukkit. * Removed confusing line (cherry picked from commit 2056218b4a8644836b1d127105dfa289e9cdbc1c) * More progress * Fix chunk sending * Repackage from com.boydti to com.fastasyncworldedit.<module> (#1119) * Preliminary work on repackaging * Rename build artifacts matching our pattern * Finish up repackaging * Fix a few field accesses and old imports * Dirty fix for chunks container ChunkSections outside of 0-15 * Correctly read from NibbleArrays for lighting * Fix getSections and BlockMaterial for 1.17 * Fix writing blocks to the world. - The issue isn't the presence of a "-1" chunk, it's the constructor for ChunkSection requiring the layer (0 to 15) rather than the y chord * Fix more field accesses * More work towards 1.17 * Update Upstream a57f66f Fix watchdog, add negative y support. (1782) * Add azalea tree to `/tool tree` * Don't define toolchain twice * Repackage GriefDefender * Relocate under new namespace * Bye bye ecma left overs * Add 1.17 to issue templates and instructions * Move to adventure-nbt (#918) * Initial work for adventure-nbt * Some more FAWE specific stuff * Fix erroneous deprecation check * Workflow change * Continued merging all adventure NBT related changes * Continued merging all adventure NBT related changes * Made a constructor public again This needs to be public for BlockTransformExtent.java * Finished converting all NBT data to adventure. * Make this compile * Fix conflicts Co-authored-by: Matt <4009945+MattBDev@users.noreply.github.com> * Update adapters to 1.17 * Change build prefix to 1.17 * Move more nms classes to adapters * Move left over nms classes * Move Spigot 1.17 class * Remove unneeded adapter loader code The loader will find the appropriate class now itself * Update adapters * Update adapters * Lazy fix tests * Update adapters * Update Upstream 43da91a Remove method reflection for getMinHeight in BukkitWorld. (1796) * Relocate adventure-nbt under proper namespace * Add LazyCompoundTag as a non-version-specific class to be used by adapters * Better integration between old NBT and Adventure NBT - begin fixing the issues seen recently * Correctly NBT conversion method * LazyCompoundTags should actually be overriding and correctly returning a CompoundBinaryTag. * Update worldedit-adapters Fixes #1141 * Remove unnecessary massive lag machine * Refactor apply to applyBlock in subclasses * applyBlock should be overriden by all subclasses. Default apply to applyBlock * Closes #1130 Closes #1132 * Squashed commit of the following: commit a9bfa1a07c77083c844a0c3ba62f4bd94bed107c Author: NotMyFault <mc.cache@web.de> Date: Sun Jun 27 21:53:21 2021 +0200 [ci skip] Update gradle wrapper validation commit aa7471f95317d28a16f62e4b200de8d0fea2fa95 Author: Matthew Miller <mnmiller1@me.com> Date: Sat Oct 10 15:49:13 2020 +1000 Add ^x,y,z relative offset support to the offset parser (#1545) * Add ^x,y,z relative offset support to the offset parser * Wrap in a try-catch (cherry picked from commit 28bdf7ff9254bbc85bb4f5f792b303943a3930a8) * Add `fawe.error.schematic.not.found` translation key * Update Upstream 728a152 Skip notify if chunk section doesn't exist (1794) * Fixed #1157 * Add a null check to prevent NPE in nbt code * Update adapters * Update Upstream fbb047a Optimize legacy schematic loading (1808) * Hurr durr I don't want to update Java * Update Upstream 0790e6e Fix CLI Mess (1811) * Fixes #1160 * Expose minimessage transitively thru PlotSquared Touches #32 * [ci skip] Remove unneeded maven repository * Steal tab completion from PlotSquared for P2 related commands * Don't error on startup when building locally Co-Authored-By: goldfishapp <8278196+goldfishapp@users.noreply.github.com> * [ci skip] Update gh actions to Java 16 * Update textures to grab 1.17 jar Co-authored-by: NotMyFault <mc.cache@web.de> Co-authored-by: SirYwell <hannesgreule@outlook.de> Co-authored-by: Matthew Miller <mnmiller1@me.com> Co-authored-by: Matt <4009945+MattBDev@users.noreply.github.com> Co-authored-by: goldfishapp <8278196+goldfishapp@users.noreply.github.com>
2021-07-01 20:16:25 +00:00
import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.configuration.Caption;
Feature/propagate diff and object cleanup (#1190) * Feature/main/propagate diff annotations (#1187) * 25% done * More work * More work * 50% * More work * 75% * 100% & cleanup * Update adapters * Squish squash, applesauce commit 275ba9bd8424270b513009e24123df5d158b1990 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat Jul 17 01:10:20 2021 +0200 Update dependency com.comphenix.protocol:ProtocolLib to v4.7.0 (#1173) Co-authored-by: Renovate Bot <bot@renovateapp.com> commit 9fd898480419ebe7c57e59caf56b8cf34fef0aae Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat Jul 17 01:09:29 2021 +0200 Update dependency org.checkerframework:checker-qual to v3.16.0 (#1184) Co-authored-by: Renovate Bot <bot@renovateapp.com> commit 861fb45e5c8d3c82a0d9fdb270f8ebe3ebbafac4 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 19:07:02 2021 +0100 Fix #1075 commit 420c45a29ac8a2cdd0110e9a9b225abf9e726a26 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 18:48:21 2021 +0100 Entity removal should be on the main thread as we're just passing through rather than doing chunk operations - Fixes #1164 - Not working: butcher/remove history commit 4d4db7dcd0c2ce99d59c32072247f0fc61fd27f6 Author: SirYwell <hannesgreule@outlook.de> Date: Fri Jul 16 17:52:44 2021 +0200 Make sure leaves category is loaded for heightmaps (fixes #1176) commit c98f6e4f37e256133bdee5179cb1c319d8c2c203 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 10:44:52 2021 +0100 Do not allow generation commands to generate outside selection commit 2485f5eccc875faff9730b5107e2559612042bad Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 10:43:15 2021 +0100 EditSession needs to override some Extent methods to ensure block changes are correctly set through the various extents Fixes #1152 commit d9418ec8aefaa3f843f61babf87c40e01502a9e1 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 09:52:44 2021 +0100 Undo part of 41073bb1a0f73c58308cad13c9206ca16ed67831 Fixes #1178 * Update Upstream fb1fb84 Fixed typo and grammar * We don't support custom heights yet * Casing inconsistency * Address a few comments * Address comments * Don't refactor to AP classpath * Document annotation style * Refactoring & shade cleanup * Address a few comments * More work * Resolve comments not being resolved yet * Feature/main/propagate diff annotations (#1187) (#1194) * Remove beta package, fix history packages, move classes out of object package * Resolve comments not being resolved yet * Remove beta package, fix history packages, move classes out of object package Co-authored-by: NotMyFault <mc.cache@web.de> * brushes should be under brush * More refactoring - Filters/processors should be in the same place and are related to extents - Transforms are in `extent.transform` in upstream * Move history classes under history * Update adapters Co-authored-by: dordsor21 <dordsor21@gmail.com>
2021-07-23 15:48:51 +00:00
import com.fastasyncworldedit.core.extent.ResettableExtent;
Feature/1.17 (#1120) * start v6 * Update classes to v6 method signatures * change rootVersion to signify p2v6 compat * Use 16 as toolchain version but target 11 for build output * add minimessage as api * Require v6 and don't attempt to "setup" hook from FAWE * Address comments * *address /all/ comments * FAWE classes should only act as a delegate * Uppercase logger * Settings for v6-hook have moved to P2-v6, remove unneeded if statements * Rename classes to Delegate * add whenDone task to setCuboids * Remove bad spaces * Fix plot swap * Initial work on 1.17 support * Remove data versions from the Bukkit adapters (#1507) * Remove data versions from the Bukkit adapters * Don't allow saving schematics without an adapter in place on Bukkit. * Removed confusing line (cherry picked from commit 2056218b4a8644836b1d127105dfa289e9cdbc1c) * More progress * Fix chunk sending * Repackage from com.boydti to com.fastasyncworldedit.<module> (#1119) * Preliminary work on repackaging * Rename build artifacts matching our pattern * Finish up repackaging * Fix a few field accesses and old imports * Dirty fix for chunks container ChunkSections outside of 0-15 * Correctly read from NibbleArrays for lighting * Fix getSections and BlockMaterial for 1.17 * Fix writing blocks to the world. - The issue isn't the presence of a "-1" chunk, it's the constructor for ChunkSection requiring the layer (0 to 15) rather than the y chord * Fix more field accesses * More work towards 1.17 * Update Upstream a57f66f Fix watchdog, add negative y support. (1782) * Add azalea tree to `/tool tree` * Don't define toolchain twice * Repackage GriefDefender * Relocate under new namespace * Bye bye ecma left overs * Add 1.17 to issue templates and instructions * Move to adventure-nbt (#918) * Initial work for adventure-nbt * Some more FAWE specific stuff * Fix erroneous deprecation check * Workflow change * Continued merging all adventure NBT related changes * Continued merging all adventure NBT related changes * Made a constructor public again This needs to be public for BlockTransformExtent.java * Finished converting all NBT data to adventure. * Make this compile * Fix conflicts Co-authored-by: Matt <4009945+MattBDev@users.noreply.github.com> * Update adapters to 1.17 * Change build prefix to 1.17 * Move more nms classes to adapters * Move left over nms classes * Move Spigot 1.17 class * Remove unneeded adapter loader code The loader will find the appropriate class now itself * Update adapters * Update adapters * Lazy fix tests * Update adapters * Update Upstream 43da91a Remove method reflection for getMinHeight in BukkitWorld. (1796) * Relocate adventure-nbt under proper namespace * Add LazyCompoundTag as a non-version-specific class to be used by adapters * Better integration between old NBT and Adventure NBT - begin fixing the issues seen recently * Correctly NBT conversion method * LazyCompoundTags should actually be overriding and correctly returning a CompoundBinaryTag. * Update worldedit-adapters Fixes #1141 * Remove unnecessary massive lag machine * Refactor apply to applyBlock in subclasses * applyBlock should be overriden by all subclasses. Default apply to applyBlock * Closes #1130 Closes #1132 * Squashed commit of the following: commit a9bfa1a07c77083c844a0c3ba62f4bd94bed107c Author: NotMyFault <mc.cache@web.de> Date: Sun Jun 27 21:53:21 2021 +0200 [ci skip] Update gradle wrapper validation commit aa7471f95317d28a16f62e4b200de8d0fea2fa95 Author: Matthew Miller <mnmiller1@me.com> Date: Sat Oct 10 15:49:13 2020 +1000 Add ^x,y,z relative offset support to the offset parser (#1545) * Add ^x,y,z relative offset support to the offset parser * Wrap in a try-catch (cherry picked from commit 28bdf7ff9254bbc85bb4f5f792b303943a3930a8) * Add `fawe.error.schematic.not.found` translation key * Update Upstream 728a152 Skip notify if chunk section doesn't exist (1794) * Fixed #1157 * Add a null check to prevent NPE in nbt code * Update adapters * Update Upstream fbb047a Optimize legacy schematic loading (1808) * Hurr durr I don't want to update Java * Update Upstream 0790e6e Fix CLI Mess (1811) * Fixes #1160 * Expose minimessage transitively thru PlotSquared Touches #32 * [ci skip] Remove unneeded maven repository * Steal tab completion from PlotSquared for P2 related commands * Don't error on startup when building locally Co-Authored-By: goldfishapp <8278196+goldfishapp@users.noreply.github.com> * [ci skip] Update gh actions to Java 16 * Update textures to grab 1.17 jar Co-authored-by: NotMyFault <mc.cache@web.de> Co-authored-by: SirYwell <hannesgreule@outlook.de> Co-authored-by: Matthew Miller <mnmiller1@me.com> Co-authored-by: Matt <4009945+MattBDev@users.noreply.github.com> Co-authored-by: goldfishapp <8278196+goldfishapp@users.noreply.github.com>
2021-07-01 20:16:25 +00:00
import com.fastasyncworldedit.core.util.CachedTextureUtil;
import com.fastasyncworldedit.core.util.CleanTextureUtil;
import com.fastasyncworldedit.core.util.MathMan;
import com.fastasyncworldedit.core.util.RandomTextureUtil;
import com.fastasyncworldedit.core.util.StringMan;
import com.fastasyncworldedit.core.util.TextureUtil;
import com.google.common.collect.ImmutableList;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.command.util.CommandPermissions;
import com.sk89q.worldedit.command.util.CommandPermissionsConditionGenerator;
import com.sk89q.worldedit.command.util.HookMode;
import com.sk89q.worldedit.command.util.WorldEditAsyncCommandBuilder;
import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.extension.input.InputParseException;
2019-07-17 10:50:54 +00:00
import com.sk89q.worldedit.extension.input.ParserContext;
import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extension.platform.Capability;
import com.sk89q.worldedit.extension.platform.Locatable;
2020-07-14 02:50:59 +00:00
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.function.mask.Mask;
import com.sk89q.worldedit.internal.command.CommandRegistrationHandler;
import com.sk89q.worldedit.internal.command.CommandUtil;
Feature/propagate diff and object cleanup (#1190) * Feature/main/propagate diff annotations (#1187) * 25% done * More work * More work * 50% * More work * 75% * 100% & cleanup * Update adapters * Squish squash, applesauce commit 275ba9bd8424270b513009e24123df5d158b1990 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat Jul 17 01:10:20 2021 +0200 Update dependency com.comphenix.protocol:ProtocolLib to v4.7.0 (#1173) Co-authored-by: Renovate Bot <bot@renovateapp.com> commit 9fd898480419ebe7c57e59caf56b8cf34fef0aae Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat Jul 17 01:09:29 2021 +0200 Update dependency org.checkerframework:checker-qual to v3.16.0 (#1184) Co-authored-by: Renovate Bot <bot@renovateapp.com> commit 861fb45e5c8d3c82a0d9fdb270f8ebe3ebbafac4 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 19:07:02 2021 +0100 Fix #1075 commit 420c45a29ac8a2cdd0110e9a9b225abf9e726a26 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 18:48:21 2021 +0100 Entity removal should be on the main thread as we're just passing through rather than doing chunk operations - Fixes #1164 - Not working: butcher/remove history commit 4d4db7dcd0c2ce99d59c32072247f0fc61fd27f6 Author: SirYwell <hannesgreule@outlook.de> Date: Fri Jul 16 17:52:44 2021 +0200 Make sure leaves category is loaded for heightmaps (fixes #1176) commit c98f6e4f37e256133bdee5179cb1c319d8c2c203 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 10:44:52 2021 +0100 Do not allow generation commands to generate outside selection commit 2485f5eccc875faff9730b5107e2559612042bad Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 10:43:15 2021 +0100 EditSession needs to override some Extent methods to ensure block changes are correctly set through the various extents Fixes #1152 commit d9418ec8aefaa3f843f61babf87c40e01502a9e1 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 09:52:44 2021 +0100 Undo part of 41073bb1a0f73c58308cad13c9206ca16ed67831 Fixes #1178 * Update Upstream fb1fb84 Fixed typo and grammar * We don't support custom heights yet * Casing inconsistency * Address a few comments * Address comments * Don't refactor to AP classpath * Document annotation style * Refactoring & shade cleanup * Address a few comments * More work * Resolve comments not being resolved yet * Feature/main/propagate diff annotations (#1187) (#1194) * Remove beta package, fix history packages, move classes out of object package * Resolve comments not being resolved yet * Remove beta package, fix history packages, move classes out of object package Co-authored-by: NotMyFault <mc.cache@web.de> * brushes should be under brush * More refactoring - Filters/processors should be in the same place and are related to extents - Transforms are in `extent.transform` in upstream * Move history classes under history * Update adapters Co-authored-by: dordsor21 <dordsor21@gmail.com>
2021-07-23 15:48:51 +00:00
import com.sk89q.worldedit.internal.cui.ServerCUIHandler;
import com.sk89q.worldedit.util.SideEffect;
import com.sk89q.worldedit.util.SideEffectSet;
2021-04-04 17:56:57 +00:00
import com.sk89q.worldedit.util.auth.AuthorizationException;
import com.sk89q.worldedit.util.formatting.component.PaginationBox;
import com.sk89q.worldedit.util.formatting.component.SideEffectBox;
import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TextComponent;
2020-07-14 02:50:59 +00:00
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.item.ItemType;
import org.enginehub.piston.CommandManager;
import org.enginehub.piston.CommandManagerService;
import org.enginehub.piston.CommandParameters;
2020-07-14 02:50:59 +00:00
import org.enginehub.piston.annotation.Command;
import org.enginehub.piston.annotation.CommandContainer;
import org.enginehub.piston.annotation.param.Arg;
import org.enginehub.piston.annotation.param.ArgFlag;
import org.enginehub.piston.annotation.param.Switch;
2019-07-17 10:50:54 +00:00
import java.io.FileNotFoundException;
2020-07-14 02:50:59 +00:00
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.concurrent.Callable;
import java.util.stream.Collectors;
2020-07-14 02:50:59 +00:00
import static com.google.common.base.Preconditions.checkNotNull;
/**
* General WorldEdit commands.
*/
@CommandContainer(superTypes = CommandPermissionsConditionGenerator.Registration.class)
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;
}
public static void register(
CommandRegistrationHandler registration,
CommandManager commandManager,
CommandManagerService commandManagerService,
WorldEdit worldEdit
) {
// Collect the tool commands
CommandManager collect = commandManagerService.newCommandManager();
registration.register(
collect,
GeneralCommandsRegistration.builder(),
new GeneralCommands(worldEdit)
);
Set<org.enginehub.piston.Command> commands = collect.getAllCommands()
.collect(Collectors.toSet());
for (org.enginehub.piston.Command command : commands) {
Feature/propagate diff and object cleanup (#1190) * Feature/main/propagate diff annotations (#1187) * 25% done * More work * More work * 50% * More work * 75% * 100% & cleanup * Update adapters * Squish squash, applesauce commit 275ba9bd8424270b513009e24123df5d158b1990 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat Jul 17 01:10:20 2021 +0200 Update dependency com.comphenix.protocol:ProtocolLib to v4.7.0 (#1173) Co-authored-by: Renovate Bot <bot@renovateapp.com> commit 9fd898480419ebe7c57e59caf56b8cf34fef0aae Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat Jul 17 01:09:29 2021 +0200 Update dependency org.checkerframework:checker-qual to v3.16.0 (#1184) Co-authored-by: Renovate Bot <bot@renovateapp.com> commit 861fb45e5c8d3c82a0d9fdb270f8ebe3ebbafac4 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 19:07:02 2021 +0100 Fix #1075 commit 420c45a29ac8a2cdd0110e9a9b225abf9e726a26 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 18:48:21 2021 +0100 Entity removal should be on the main thread as we're just passing through rather than doing chunk operations - Fixes #1164 - Not working: butcher/remove history commit 4d4db7dcd0c2ce99d59c32072247f0fc61fd27f6 Author: SirYwell <hannesgreule@outlook.de> Date: Fri Jul 16 17:52:44 2021 +0200 Make sure leaves category is loaded for heightmaps (fixes #1176) commit c98f6e4f37e256133bdee5179cb1c319d8c2c203 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 10:44:52 2021 +0100 Do not allow generation commands to generate outside selection commit 2485f5eccc875faff9730b5107e2559612042bad Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 10:43:15 2021 +0100 EditSession needs to override some Extent methods to ensure block changes are correctly set through the various extents Fixes #1152 commit d9418ec8aefaa3f843f61babf87c40e01502a9e1 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 09:52:44 2021 +0100 Undo part of 41073bb1a0f73c58308cad13c9206ca16ed67831 Fixes #1178 * Update Upstream fb1fb84 Fixed typo and grammar * We don't support custom heights yet * Casing inconsistency * Address a few comments * Address comments * Don't refactor to AP classpath * Document annotation style * Refactoring & shade cleanup * Address a few comments * More work * Resolve comments not being resolved yet * Feature/main/propagate diff annotations (#1187) (#1194) * Remove beta package, fix history packages, move classes out of object package * Resolve comments not being resolved yet * Remove beta package, fix history packages, move classes out of object package Co-authored-by: NotMyFault <mc.cache@web.de> * brushes should be under brush * More refactoring - Filters/processors should be in the same place and are related to extents - Transforms are in `extent.transform` in upstream * Move history classes under history * Update adapters Co-authored-by: dordsor21 <dordsor21@gmail.com>
2021-07-23 15:48:51 +00:00
/*FAWE start - if in FAWE, //fast will remain for now
(command.getName().equals("/fast")) {
// deprecate to `//perf`
commandManager.register(CommandUtil.deprecate(
command, "//fast duplicates //perf " +
"and will be removed in WorldEdit 8",
GeneralCommands::replaceFastForPerf
));
continue;
}
*/
commandManager.register(command);
}
}
private static Component replaceFastForPerf(
org.enginehub.piston.Command oldCmd,
CommandParameters oldParams
) {
if (oldParams.getMetadata() == null) {
return CommandUtil.createNewCommandReplacementText("//perf");
}
ImmutableList<String> args = oldParams.getMetadata().getArguments();
if (args.isEmpty()) {
return TextComponent.of("There is not yet a replacement for //fast" +
" with no arguments");
}
String arg0 = args.get(0).toLowerCase(Locale.ENGLISH);
String flipped;
switch (arg0) {
case "on":
flipped = "off";
break;
case "off":
flipped = "on";
break;
default:
return TextComponent.of("There is no replacement for //fast " + arg0);
}
return CommandUtil.createNewCommandReplacementText("//perf " + flipped);
}
@Command(
name = "/limit",
desc = "Modify block change limit"
)
@CommandPermissions("worldedit.limit")
public void limit(
Actor actor, LocalSession session,
@Arg(desc = "The limit to set", def = "")
Integer limit
) {
LocalConfiguration config = worldEdit.getConfiguration();
boolean mayDisable = actor.hasPermission("worldedit.limit.unrestricted");
limit = limit == null ? config.defaultChangeLimit : Math.max(-1, limit);
if (!mayDisable && config.maxChangeLimit > -1) {
if (limit > config.maxChangeLimit) {
actor.print(Caption.of("worldedit.limit.too-high", TextComponent.of(config.maxChangeLimit)));
return;
}
}
session.setBlockChangeLimit(limit);
Component component = TextComponent.empty().append(Caption.of("worldedit.limit.set", TextComponent.of(limit)));
if (limit != config.defaultChangeLimit) {
component.append(TextComponent.space()).append(Caption.of("worldedit.limit.return-to-default"));
}
actor.print(component);
}
@Command(
name = "/timeout",
desc = "Modify evaluation timeout time."
)
@CommandPermissions("worldedit.timeout")
public void timeout(
Actor actor, LocalSession session,
@Arg(desc = "The timeout time to set", def = "")
Integer limit
) {
LocalConfiguration config = worldEdit.getConfiguration();
boolean mayDisable = actor.hasPermission("worldedit.timeout.unrestricted");
limit = limit == null ? config.calculationTimeout : Math.max(-1, limit);
if (!mayDisable && config.maxCalculationTimeout > -1) {
if (limit > config.maxCalculationTimeout) {
actor.print(Caption.of("worldedit.timeout.too-high", TextComponent.of(config.maxCalculationTimeout)));
return;
}
}
session.setTimeout(limit);
Component component = TextComponent.empty().append(Caption.of("worldedit.timeout.set", TextComponent.of(limit)));
if (limit != config.calculationTimeout) {
2021-05-24 09:36:37 +00:00
component.append(Caption.of("worldedit.timeout.return-to-default"));
}
actor.print(component);
}
@Command(
name = "/perf",
desc = "Toggle side effects for performance",
descFooter = "Note that this command is GOING to change in the future." +
" Do not depend on the exact format of this command yet."
)
@CommandPermissions("worldedit.perf")
void perf(
Actor actor, LocalSession session,
@Arg(desc = "The side effect", def = "")
SideEffect sideEffect,
@Arg(desc = "The new side effect state", def = "")
SideEffect.State newState,
@Switch(name = 'h', desc = "Show the info box")
boolean showInfoBox
) throws WorldEditException {
if (sideEffect != null) {
SideEffect.State currentState = session.getSideEffectSet().getState(sideEffect);
if (newState != null && newState == currentState) {
if (!showInfoBox) {
actor.print(Caption.of(
"worldedit.perf.sideeffect.already-set",
TranslatableComponent.of(sideEffect.getDisplayName()),
TranslatableComponent.of(newState.getDisplayName())
));
}
return;
}
if (newState != null) {
session.setSideEffectSet(session.getSideEffectSet().with(sideEffect, newState));
if (!showInfoBox) {
actor.print(Caption.of(
"worldedit.perf.sideeffect.set",
TranslatableComponent.of(sideEffect.getDisplayName()),
TranslatableComponent.of(newState.getDisplayName())
));
}
} else {
actor.print(Caption.of(
"worldedit.perf.sideeffect.get",
TranslatableComponent.of(sideEffect.getDisplayName()),
TranslatableComponent.of(currentState.getDisplayName())
));
}
} else if (newState != null) {
SideEffectSet applier = session.getSideEffectSet();
for (SideEffect sideEffectEntry : SideEffect.values()) {
applier = applier.with(sideEffectEntry, newState);
}
session.setSideEffectSet(applier);
if (!showInfoBox) {
actor.print(Caption.of(
"worldedit.perf.sideeffect.set-all",
TranslatableComponent.of(newState.getDisplayName())
));
}
}
if (sideEffect == null || showInfoBox) {
SideEffectBox sideEffectBox = new SideEffectBox(session.getSideEffectSet());
actor.print(sideEffectBox.create(1));
}
}
@Command(
name = "/reorder",
desc = "Sets the reorder mode of WorldEdit"
)
@CommandPermissions("worldedit.reorder")
public void reorderMode(
Actor actor, LocalSession session,
@Arg(desc = "The reorder mode", def = "")
EditSession.ReorderMode reorderMode
) {
if (reorderMode == null) {
actor.print(Caption.of("worldedit.reorder.current", TextComponent.of(session.getReorderMode().getDisplayName())));
} else {
session.setReorderMode(reorderMode);
actor.print(Caption.of("worldedit.reorder.set", TextComponent.of(session.getReorderMode().getDisplayName())));
}
}
@Command(
name = "/drawsel",
desc = "Toggle drawing the current selection"
)
@CommandPermissions("worldedit.drawsel")
public void drawSelection(
Player player, LocalSession session,
@Arg(desc = "The new draw selection state", def = "")
Boolean drawSelection
) throws WorldEditException {
if (!WorldEdit.getInstance().getConfiguration().serverSideCUI) {
2021-05-24 09:36:37 +00:00
throw new AuthorizationException(Caption.of("worldedit.error.disabled"));
}
boolean useServerCui = session.shouldUseServerCUI();
if (drawSelection != null && drawSelection == useServerCui) {
player.print(Caption.of("worldedit.drawsel." + (useServerCui ? "enabled" : "disabled") + ".already"));
2019-11-18 09:50:52 +00:00
return;
}
if (useServerCui) {
session.setUseServerCUI(false);
session.updateServerCUI(player);
player.print(Caption.of("worldedit.drawsel.disabled"));
} else {
session.setUseServerCUI(true);
session.updateServerCUI(player);
Feature/propagate diff and object cleanup (#1190) * Feature/main/propagate diff annotations (#1187) * 25% done * More work * More work * 50% * More work * 75% * 100% & cleanup * Update adapters * Squish squash, applesauce commit 275ba9bd8424270b513009e24123df5d158b1990 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat Jul 17 01:10:20 2021 +0200 Update dependency com.comphenix.protocol:ProtocolLib to v4.7.0 (#1173) Co-authored-by: Renovate Bot <bot@renovateapp.com> commit 9fd898480419ebe7c57e59caf56b8cf34fef0aae Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat Jul 17 01:09:29 2021 +0200 Update dependency org.checkerframework:checker-qual to v3.16.0 (#1184) Co-authored-by: Renovate Bot <bot@renovateapp.com> commit 861fb45e5c8d3c82a0d9fdb270f8ebe3ebbafac4 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 19:07:02 2021 +0100 Fix #1075 commit 420c45a29ac8a2cdd0110e9a9b225abf9e726a26 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 18:48:21 2021 +0100 Entity removal should be on the main thread as we're just passing through rather than doing chunk operations - Fixes #1164 - Not working: butcher/remove history commit 4d4db7dcd0c2ce99d59c32072247f0fc61fd27f6 Author: SirYwell <hannesgreule@outlook.de> Date: Fri Jul 16 17:52:44 2021 +0200 Make sure leaves category is loaded for heightmaps (fixes #1176) commit c98f6e4f37e256133bdee5179cb1c319d8c2c203 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 10:44:52 2021 +0100 Do not allow generation commands to generate outside selection commit 2485f5eccc875faff9730b5107e2559612042bad Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 10:43:15 2021 +0100 EditSession needs to override some Extent methods to ensure block changes are correctly set through the various extents Fixes #1152 commit d9418ec8aefaa3f843f61babf87c40e01502a9e1 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 09:52:44 2021 +0100 Undo part of 41073bb1a0f73c58308cad13c9206ca16ed67831 Fixes #1178 * Update Upstream fb1fb84 Fixed typo and grammar * We don't support custom heights yet * Casing inconsistency * Address a few comments * Address comments * Don't refactor to AP classpath * Document annotation style * Refactoring & shade cleanup * Address a few comments * More work * Resolve comments not being resolved yet * Feature/main/propagate diff annotations (#1187) (#1194) * Remove beta package, fix history packages, move classes out of object package * Resolve comments not being resolved yet * Remove beta package, fix history packages, move classes out of object package Co-authored-by: NotMyFault <mc.cache@web.de> * brushes should be under brush * More refactoring - Filters/processors should be in the same place and are related to extents - Transforms are in `extent.transform` in upstream * Move history classes under history * Update adapters Co-authored-by: dordsor21 <dordsor21@gmail.com>
2021-07-23 15:48:51 +00:00
int maxSize = ServerCUIHandler.getMaxServerCuiSize();
player.print(Caption.of(
"worldedit.drawsel.enabled",
TextComponent.of(maxSize),
TextComponent.of(maxSize),
TextComponent.of(maxSize)
));
}
}
@Command(
name = "/world",
desc = "Sets the world override"
)
@CommandPermissions("worldedit.world")
public void world(
Actor actor, LocalSession session,
@Arg(desc = "The world override", def = "") World world
) {
session.setWorldOverride(world);
if (world == null) {
actor.print(Caption.of("worldedit.world.remove"));
} else {
actor.print(Caption.of("worldedit.world.set", TextComponent.of(world.getId())));
}
}
@Command(
name = "/watchdog",
desc = "Changes watchdog hook state.",
descFooter = "This is dependent on platform implementation. " +
"Not all platforms support watchdog hooks, or contain a watchdog."
)
@CommandPermissions("worldedit.watchdog")
public void watchdog(
Actor actor, LocalSession session,
@Arg(desc = "The mode to set the watchdog hook to", def = "")
HookMode hookMode
) {
if (WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getWatchdog() == null) {
actor.print(Caption.of("worldedit.watchdog.no-hook"));
return;
}
boolean previousMode = session.isTickingWatchdog();
if (hookMode != null && (hookMode == HookMode.ACTIVE) == previousMode) {
actor.print(Caption.of(previousMode ? "worldedit.watchdog.active.already" : "worldedit.watchdog.inactive.already"));
return;
}
session.setTickingWatchdog(!previousMode);
actor.print(Caption.of(previousMode ? "worldedit.watchdog.inactive" : "worldedit.watchdog.active"));
}
@Command(
name = "gmask",
aliases = {"/gmask"},
desc = "Set the global mask"
)
@CommandPermissions("worldedit.global-mask")
public void gmask(
Actor actor, LocalSession session,
@Arg(desc = "The mask to set", def = "")
Mask mask
) {
if (mask == null) {
session.setMask(null);
actor.print(Caption.of("worldedit.gmask.disabled"));
} else {
session.setMask(mask);
actor.print(Caption.of("worldedit.gmask.set"));
}
}
@Command(
name = "toggleplace",
aliases = {"/toggleplace"},
desc = "Switch between your position and pos1 for placement"
)
2020-11-13 20:08:57 +00:00
@CommandPermissions("worldedit.toggleplace")
public void togglePlace(Actor actor, LocalSession session) {
if (!(actor instanceof Locatable)) {
actor.print(Caption.of("worldedit.toggleplace.not-locatable"));
return;
}
if (session.togglePlacementPosition()) {
actor.print(Caption.of("worldedit.toggleplace.pos1"));
} else {
actor.print(Caption.of("worldedit.toggleplace.player"));
}
}
@Command(
name = "searchitem",
aliases = {"/searchitem", "/l", "/search"},
desc = "Search for an item"
)
@CommandPermissions("worldedit.searchitem")
public void searchItem(
Actor actor,
@Switch(name = 'b', desc = "Only search for blocks")
boolean blocksOnly,
@Switch(name = 'i', desc = "Only search for items")
boolean itemsOnly,
@ArgFlag(name = 'p', desc = "Page of results to return", def = "1")
int page,
@Arg(desc = "Search query", variable = true)
List<String> query
) {
String search = String.join(" ", query);
if (search.length() <= 2) {
actor.print(Caption.of("worldedit.searchitem.too-short"));
return;
}
if (blocksOnly && itemsOnly) {
actor.print(Caption.of("worldedit.searchitem.either-b-or-i"));
return;
}
WorldEditAsyncCommandBuilder.createAndSendMessage(actor, new ItemSearcher(search, blocksOnly, itemsOnly, page),
Caption.of("worldedit.searchitem.searching")
);
}
Feature/propagate diff and object cleanup (#1190) * Feature/main/propagate diff annotations (#1187) * 25% done * More work * More work * 50% * More work * 75% * 100% & cleanup * Update adapters * Squish squash, applesauce commit 275ba9bd8424270b513009e24123df5d158b1990 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat Jul 17 01:10:20 2021 +0200 Update dependency com.comphenix.protocol:ProtocolLib to v4.7.0 (#1173) Co-authored-by: Renovate Bot <bot@renovateapp.com> commit 9fd898480419ebe7c57e59caf56b8cf34fef0aae Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat Jul 17 01:09:29 2021 +0200 Update dependency org.checkerframework:checker-qual to v3.16.0 (#1184) Co-authored-by: Renovate Bot <bot@renovateapp.com> commit 861fb45e5c8d3c82a0d9fdb270f8ebe3ebbafac4 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 19:07:02 2021 +0100 Fix #1075 commit 420c45a29ac8a2cdd0110e9a9b225abf9e726a26 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 18:48:21 2021 +0100 Entity removal should be on the main thread as we're just passing through rather than doing chunk operations - Fixes #1164 - Not working: butcher/remove history commit 4d4db7dcd0c2ce99d59c32072247f0fc61fd27f6 Author: SirYwell <hannesgreule@outlook.de> Date: Fri Jul 16 17:52:44 2021 +0200 Make sure leaves category is loaded for heightmaps (fixes #1176) commit c98f6e4f37e256133bdee5179cb1c319d8c2c203 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 10:44:52 2021 +0100 Do not allow generation commands to generate outside selection commit 2485f5eccc875faff9730b5107e2559612042bad Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 10:43:15 2021 +0100 EditSession needs to override some Extent methods to ensure block changes are correctly set through the various extents Fixes #1152 commit d9418ec8aefaa3f843f61babf87c40e01502a9e1 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 09:52:44 2021 +0100 Undo part of 41073bb1a0f73c58308cad13c9206ca16ed67831 Fixes #1178 * Update Upstream fb1fb84 Fixed typo and grammar * We don't support custom heights yet * Casing inconsistency * Address a few comments * Address comments * Don't refactor to AP classpath * Document annotation style * Refactoring & shade cleanup * Address a few comments * More work * Resolve comments not being resolved yet * Feature/main/propagate diff annotations (#1187) (#1194) * Remove beta package, fix history packages, move classes out of object package * Resolve comments not being resolved yet * Remove beta package, fix history packages, move classes out of object package Co-authored-by: NotMyFault <mc.cache@web.de> * brushes should be under brush * More refactoring - Filters/processors should be in the same place and are related to extents - Transforms are in `extent.transform` in upstream * Move history classes under history * Update adapters Co-authored-by: dordsor21 <dordsor21@gmail.com>
2021-07-23 15:48:51 +00:00
//FAWE start
2019-07-17 10:50:54 +00:00
@Command(
name = "/gtexture",
aliases = {"gtexture"},
2019-11-11 21:02:28 +00:00
descFooter = "The global destination mask applies to all edits you do and masks based on the destination blocks (i.e., the blocks in the world).",
2019-07-17 10:50:54 +00:00
desc = "Set the global mask"
)
@CommandPermissions("worldedit.global-texture")
public void gtexture(
Actor actor,
World worldArg,
LocalSession session,
EditSession editSession,
@Arg(name = "context", desc = "InjectedValueAccess", def = "") List<String> arguments
) throws WorldEditException, FileNotFoundException {
2019-07-22 09:05:14 +00:00
// gtexture <randomize> <min=0> <max=100>
// TODO NOT IMPLEMENTED convert this to an ArgumentConverter
if (arguments.isEmpty()) {
2019-07-17 10:50:54 +00:00
session.setTextureUtil(null);
actor.print(Caption.of("fawe.worldedit.general.texture.disabled"));
2019-07-17 10:50:54 +00:00
} else {
2019-07-22 09:05:14 +00:00
String arg = arguments.get(0);
String argLower = arg.toLowerCase(Locale.ROOT);
2019-07-17 10:50:54 +00:00
TextureUtil util = Fawe.instance().getTextureUtil();
2019-07-17 10:50:54 +00:00
int randomIndex = 1;
boolean checkRandomization = true;
2019-07-22 09:05:14 +00:00
if (arguments.size() >= 2 && MathMan.isInteger(arguments.get(0)) && MathMan.isInteger(arguments.get(1))) {
2019-07-17 10:50:54 +00:00
// complexity
2019-07-22 09:05:14 +00:00
int min = Integer.parseInt(arguments.get(0));
int max = Integer.parseInt(arguments.get(1));
if (min < 0 || max > 100) {
2021-05-24 09:36:37 +00:00
throw new InputParseException(Caption.of("fawe.error.too-simple"));
}
if (min != 0 || max != 100) {
util = new CleanTextureUtil(util, min, max);
}
2019-07-17 10:50:54 +00:00
randomIndex = 2;
2019-07-22 09:05:14 +00:00
} else if (arguments.size() == 1 && argLower.equals("true") || argLower.equals("false")) {
if (argLower.equals("true")) {
util = new RandomTextureUtil(util);
}
2019-07-17 10:50:54 +00:00
checkRandomization = false;
} else {
if (argLower.equals("#copy") || argLower.equals("#clipboard")) {
2019-07-28 19:26:44 +00:00
Clipboard clipboard = session.getClipboard().getClipboard();
2019-07-17 10:50:54 +00:00
util = TextureUtil.fromClipboard(clipboard);
} else if (argLower.equals("*") || argLower.equals("true")) {
util = Fawe.instance().getTextureUtil();
2019-07-17 10:50:54 +00:00
} else {
ParserContext parserContext = new ParserContext();
parserContext.setActor(actor);
2019-11-20 00:11:54 +00:00
parserContext.setWorld(worldArg);
2019-07-17 10:50:54 +00:00
parserContext.setSession(session);
parserContext.setExtent(editSession);
Mask mask = worldEdit.getMaskFactory().parseFromInput(arg, parserContext);
util = TextureUtil.fromMask(mask);
}
}
if (checkRandomization) {
2019-07-22 09:05:14 +00:00
if (arguments.size() > randomIndex) {
boolean random = Boolean.parseBoolean(arguments.get(randomIndex));
if (random) {
util = new RandomTextureUtil(util);
}
2019-07-17 10:50:54 +00:00
}
}
if (!(util instanceof CachedTextureUtil)) {
util = new CachedTextureUtil(util);
}
2019-07-17 10:50:54 +00:00
session.setTextureUtil(util);
actor.print(Caption.of("fawe.worldedit.general.texture.set", StringMan.join(arguments, " ")));
2019-07-17 10:50:54 +00:00
}
}
@Command(
name = "/gsmask",
aliases = {"gsmask", "globalsourcemask", "/globalsourcemask"},
desc = "Set the global source mask",
descFooter = "The global source mask applies to all edits you do and masks based on the source blocks (e.g., the blocks in your clipboard)"
2019-07-17 10:50:54 +00:00
)
@CommandPermissions({"worldedit.global-mask", "worldedit.mask.global"})
public void gsmask(
Actor actor,
LocalSession session,
EditSession editSession,
@Arg(desc = "The mask to set", def = "") Mask maskOpt
) throws WorldEditException {
2019-08-06 20:18:44 +00:00
session.setSourceMask(maskOpt);
if (maskOpt == null) {
actor.print(Caption.of("fawe.worldedit.general.source.mask.disabled"));
2019-07-17 10:50:54 +00:00
} else {
actor.print(Caption.of("fawe.worldedit.general.source.mask"));
2019-07-17 10:50:54 +00:00
}
}
@Command(
name = "/gtransform",
aliases = {"gtransform"},
desc = "Set the global transform"
2019-07-17 10:50:54 +00:00
)
@CommandPermissions({"worldedit.global-transform", "worldedit.transform.global"})
public void gtransform(
Actor actor,
EditSession editSession,
LocalSession session,
@Arg(desc = "The transform to set", def = "") ResettableExtent transform
) throws WorldEditException {
2019-07-21 11:39:36 +00:00
session.setTransform(transform);
if (transform == null) {
actor.print(Caption.of("fawe.worldedit.general.transform.disabled"));
2019-07-17 10:50:54 +00:00
} else {
actor.print(Caption.of("fawe.worldedit.general.transform"));
2019-07-17 10:50:54 +00:00
}
}
@Command(
name = "/tips",
aliases = {"tips"},
desc = "Toggle FAWE tips"
2019-07-17 10:50:54 +00:00
)
@CommandPermissions("fawe.tips")
public void tips(Actor actor, LocalSession session) throws WorldEditException {
if (actor.togglePermission("fawe.tips")) {
actor.print(Caption.of("fawe.info.worldedit.toggle.tips.on"));
2019-07-17 10:50:54 +00:00
} else {
actor.print(Caption.of("fawe.info.worldedit.toggle.tips.off"));
2019-07-17 10:50:54 +00:00
}
}
Feature/propagate diff and object cleanup (#1190) * Feature/main/propagate diff annotations (#1187) * 25% done * More work * More work * 50% * More work * 75% * 100% & cleanup * Update adapters * Squish squash, applesauce commit 275ba9bd8424270b513009e24123df5d158b1990 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat Jul 17 01:10:20 2021 +0200 Update dependency com.comphenix.protocol:ProtocolLib to v4.7.0 (#1173) Co-authored-by: Renovate Bot <bot@renovateapp.com> commit 9fd898480419ebe7c57e59caf56b8cf34fef0aae Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat Jul 17 01:09:29 2021 +0200 Update dependency org.checkerframework:checker-qual to v3.16.0 (#1184) Co-authored-by: Renovate Bot <bot@renovateapp.com> commit 861fb45e5c8d3c82a0d9fdb270f8ebe3ebbafac4 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 19:07:02 2021 +0100 Fix #1075 commit 420c45a29ac8a2cdd0110e9a9b225abf9e726a26 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 18:48:21 2021 +0100 Entity removal should be on the main thread as we're just passing through rather than doing chunk operations - Fixes #1164 - Not working: butcher/remove history commit 4d4db7dcd0c2ce99d59c32072247f0fc61fd27f6 Author: SirYwell <hannesgreule@outlook.de> Date: Fri Jul 16 17:52:44 2021 +0200 Make sure leaves category is loaded for heightmaps (fixes #1176) commit c98f6e4f37e256133bdee5179cb1c319d8c2c203 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 10:44:52 2021 +0100 Do not allow generation commands to generate outside selection commit 2485f5eccc875faff9730b5107e2559612042bad Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 10:43:15 2021 +0100 EditSession needs to override some Extent methods to ensure block changes are correctly set through the various extents Fixes #1152 commit d9418ec8aefaa3f843f61babf87c40e01502a9e1 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 09:52:44 2021 +0100 Undo part of 41073bb1a0f73c58308cad13c9206ca16ed67831 Fixes #1178 * Update Upstream fb1fb84 Fixed typo and grammar * We don't support custom heights yet * Casing inconsistency * Address a few comments * Address comments * Don't refactor to AP classpath * Document annotation style * Refactoring & shade cleanup * Address a few comments * More work * Resolve comments not being resolved yet * Feature/main/propagate diff annotations (#1187) (#1194) * Remove beta package, fix history packages, move classes out of object package * Resolve comments not being resolved yet * Remove beta package, fix history packages, move classes out of object package Co-authored-by: NotMyFault <mc.cache@web.de> * brushes should be under brush * More refactoring - Filters/processors should be in the same place and are related to extents - Transforms are in `extent.transform` in upstream * Move history classes under history * Update adapters Co-authored-by: dordsor21 <dordsor21@gmail.com>
2021-07-23 15:48:51 +00:00
@Command(
name = "/fast",
desc = "Toggle fast mode"
)
@CommandPermissions("worldedit.fast")
@Deprecated
void fast(
Actor actor, LocalSession session,
@Arg(desc = "The new fast mode state", def = "")
Boolean fastMode
) {
Feature/propagate diff and object cleanup (#1190) * Feature/main/propagate diff annotations (#1187) * 25% done * More work * More work * 50% * More work * 75% * 100% & cleanup * Update adapters * Squish squash, applesauce commit 275ba9bd8424270b513009e24123df5d158b1990 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat Jul 17 01:10:20 2021 +0200 Update dependency com.comphenix.protocol:ProtocolLib to v4.7.0 (#1173) Co-authored-by: Renovate Bot <bot@renovateapp.com> commit 9fd898480419ebe7c57e59caf56b8cf34fef0aae Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat Jul 17 01:09:29 2021 +0200 Update dependency org.checkerframework:checker-qual to v3.16.0 (#1184) Co-authored-by: Renovate Bot <bot@renovateapp.com> commit 861fb45e5c8d3c82a0d9fdb270f8ebe3ebbafac4 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 19:07:02 2021 +0100 Fix #1075 commit 420c45a29ac8a2cdd0110e9a9b225abf9e726a26 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 18:48:21 2021 +0100 Entity removal should be on the main thread as we're just passing through rather than doing chunk operations - Fixes #1164 - Not working: butcher/remove history commit 4d4db7dcd0c2ce99d59c32072247f0fc61fd27f6 Author: SirYwell <hannesgreule@outlook.de> Date: Fri Jul 16 17:52:44 2021 +0200 Make sure leaves category is loaded for heightmaps (fixes #1176) commit c98f6e4f37e256133bdee5179cb1c319d8c2c203 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 10:44:52 2021 +0100 Do not allow generation commands to generate outside selection commit 2485f5eccc875faff9730b5107e2559612042bad Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 10:43:15 2021 +0100 EditSession needs to override some Extent methods to ensure block changes are correctly set through the various extents Fixes #1152 commit d9418ec8aefaa3f843f61babf87c40e01502a9e1 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 09:52:44 2021 +0100 Undo part of 41073bb1a0f73c58308cad13c9206ca16ed67831 Fixes #1178 * Update Upstream fb1fb84 Fixed typo and grammar * We don't support custom heights yet * Casing inconsistency * Address a few comments * Address comments * Don't refactor to AP classpath * Document annotation style * Refactoring & shade cleanup * Address a few comments * More work * Resolve comments not being resolved yet * Feature/main/propagate diff annotations (#1187) (#1194) * Remove beta package, fix history packages, move classes out of object package * Resolve comments not being resolved yet * Remove beta package, fix history packages, move classes out of object package Co-authored-by: NotMyFault <mc.cache@web.de> * brushes should be under brush * More refactoring - Filters/processors should be in the same place and are related to extents - Transforms are in `extent.transform` in upstream * Move history classes under history * Update adapters Co-authored-by: dordsor21 <dordsor21@gmail.com>
2021-07-23 15:48:51 +00:00
boolean hasFastMode = session.hasFastMode();
if (fastMode != null && fastMode == hasFastMode) {
actor.print(Caption.of(fastMode ? "worldedit.fast.enabled.already" : "worldedit.fast.disabled.already"));
return;
}
if (hasFastMode) {
session.setFastMode(false);
actor.print(Caption.of("worldedit.fast.disabled"));
} else {
session.setFastMode(true);
actor.print(Caption.of("worldedit.fast.enabled"));
}
}
private static class ItemSearcher implements Callable<Component> {
private final boolean blocksOnly;
private final boolean itemsOnly;
private final String search;
private final int page;
ItemSearcher(String search, boolean blocksOnly, boolean itemsOnly, int page) {
this.blocksOnly = blocksOnly;
this.itemsOnly = itemsOnly;
this.search = search;
this.page = page;
}
@Override
public Component call() throws Exception {
String command = "/searchitem " + (blocksOnly ? "-b " : "") + (itemsOnly ? "-i " : "") + "-p %page% " + search;
Map<String, Component> results = new TreeMap<>();
String idMatch = search.replace(' ', '_');
String nameMatch = search.toLowerCase(Locale.ROOT);
for (ItemType searchType : ItemType.REGISTRY) {
if (blocksOnly && !searchType.hasBlockType()) {
continue;
}
if (itemsOnly && searchType.hasBlockType()) {
continue;
}
final String id = searchType.getId();
if (id.contains(idMatch)) {
Component name = searchType.getRichName();
results.put(id, TextComponent.builder()
.append(name)
.append(" (" + id + ")")
.build());
}
}
List<Component> list = new ArrayList<>(results.values());
return PaginationBox.fromComponents("Search results for '" + search + "'", command, list)
.create(page);
}
}
Feature/propagate diff and object cleanup (#1190) * Feature/main/propagate diff annotations (#1187) * 25% done * More work * More work * 50% * More work * 75% * 100% & cleanup * Update adapters * Squish squash, applesauce commit 275ba9bd8424270b513009e24123df5d158b1990 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat Jul 17 01:10:20 2021 +0200 Update dependency com.comphenix.protocol:ProtocolLib to v4.7.0 (#1173) Co-authored-by: Renovate Bot <bot@renovateapp.com> commit 9fd898480419ebe7c57e59caf56b8cf34fef0aae Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat Jul 17 01:09:29 2021 +0200 Update dependency org.checkerframework:checker-qual to v3.16.0 (#1184) Co-authored-by: Renovate Bot <bot@renovateapp.com> commit 861fb45e5c8d3c82a0d9fdb270f8ebe3ebbafac4 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 19:07:02 2021 +0100 Fix #1075 commit 420c45a29ac8a2cdd0110e9a9b225abf9e726a26 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 18:48:21 2021 +0100 Entity removal should be on the main thread as we're just passing through rather than doing chunk operations - Fixes #1164 - Not working: butcher/remove history commit 4d4db7dcd0c2ce99d59c32072247f0fc61fd27f6 Author: SirYwell <hannesgreule@outlook.de> Date: Fri Jul 16 17:52:44 2021 +0200 Make sure leaves category is loaded for heightmaps (fixes #1176) commit c98f6e4f37e256133bdee5179cb1c319d8c2c203 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 10:44:52 2021 +0100 Do not allow generation commands to generate outside selection commit 2485f5eccc875faff9730b5107e2559612042bad Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 10:43:15 2021 +0100 EditSession needs to override some Extent methods to ensure block changes are correctly set through the various extents Fixes #1152 commit d9418ec8aefaa3f843f61babf87c40e01502a9e1 Author: dordsor21 <dordsor21@gmail.com> Date: Fri Jul 16 09:52:44 2021 +0100 Undo part of 41073bb1a0f73c58308cad13c9206ca16ed67831 Fixes #1178 * Update Upstream fb1fb84 Fixed typo and grammar * We don't support custom heights yet * Casing inconsistency * Address a few comments * Address comments * Don't refactor to AP classpath * Document annotation style * Refactoring & shade cleanup * Address a few comments * More work * Resolve comments not being resolved yet * Feature/main/propagate diff annotations (#1187) (#1194) * Remove beta package, fix history packages, move classes out of object package * Resolve comments not being resolved yet * Remove beta package, fix history packages, move classes out of object package Co-authored-by: NotMyFault <mc.cache@web.de> * brushes should be under brush * More refactoring - Filters/processors should be in the same place and are related to extents - Transforms are in `extent.transform` in upstream * Move history classes under history * Update adapters Co-authored-by: dordsor21 <dordsor21@gmail.com>
2021-07-23 15:48:51 +00:00
//FAWE end
}