mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
Switch
This commit is contained in:
parent
3113d8dd69
commit
2da3367f3d
@ -41,7 +41,7 @@ import com.sk89q.worldedit.internal.annotation.Selection;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.util.command.binding.Switch;
|
||||
import org.enginehub.piston.annotation.param.Switch;
|
||||
import com.sk89q.worldedit.util.command.parametric.Optional;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
@ -147,7 +147,7 @@ public class AnvilCommands {
|
||||
descFooter = "The -d flag disabled wildcard data matching\n"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.replaceall")
|
||||
public void replaceAll(Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, String to, @Switch('d') boolean useData) throws WorldEditException {
|
||||
public void replaceAll(Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, String to, @Switch(name='d', desc = "TODO") boolean useData) throws WorldEditException {
|
||||
// final FaweBlockMatcher matchFrom;
|
||||
// if (from == null) {
|
||||
// matchFrom = FaweBlockMatcher.NOT_AIR;
|
||||
@ -208,7 +208,7 @@ public class AnvilCommands {
|
||||
"The auto-save interval is the recommended value for `file-duration` and `chunk-inactivity`"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.deleteallunclaimed")
|
||||
public void deleteAllUnclaimed(Player player, int inhabitedTicks, @Arg(name = "filedurationmillis", desc = "int", def = "60000") int fileDurationMillis, @Switch('d') boolean debug) throws WorldEditException {
|
||||
public void deleteAllUnclaimed(Player player, int inhabitedTicks, @Arg(name = "filedurationmillis", desc = "int", def = "60000") int fileDurationMillis, @Switch(name='d', desc = "TODO") boolean debug) throws WorldEditException {
|
||||
String folder = player.getWorld().getName();
|
||||
DeleteUnclaimedFilter filter = new DeleteUnclaimedFilter(player.getWorld(), fileDurationMillis, inhabitedTicks, fileDurationMillis);
|
||||
if (debug) filter.enableDebug();
|
||||
@ -227,7 +227,7 @@ public class AnvilCommands {
|
||||
"The auto-save interval is the recommended value for `file-duration` and `chunk-inactivity`"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.deleteunclaimed")
|
||||
public void deleteUnclaimed(Player player, EditSession editSession, @Selection Region selection, int inhabitedTicks, @Arg(name = "filedurationmillis", desc = "int", def = "60000") int fileDurationMillis, @Switch('d') boolean debug) throws WorldEditException {
|
||||
public void deleteUnclaimed(Player player, EditSession editSession, @Selection Region selection, int inhabitedTicks, @Arg(name = "filedurationmillis", desc = "int", def = "60000") int fileDurationMillis, @Switch(name='d', desc = "TODO") boolean debug) throws WorldEditException {
|
||||
DeleteUnclaimedFilter filter = new DeleteUnclaimedFilter(player.getWorld(), fileDurationMillis, inhabitedTicks, fileDurationMillis);
|
||||
if (debug) filter.enableDebug();
|
||||
DeleteUnclaimedFilter result = runWithSelection(player, editSession, selection, filter);
|
||||
@ -258,7 +258,7 @@ public class AnvilCommands {
|
||||
"Use -v to also delete unvisited chunks\n"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.trimallplots")
|
||||
public void trimAllPlots(Player player, @Switch('v') boolean deleteUnvisited) throws WorldEditException {
|
||||
public void trimAllPlots(Player player, @Switch(name='v', desc = "TODO") boolean deleteUnvisited) throws WorldEditException {
|
||||
String folder = player.getWorld().getName();
|
||||
int visitTime = deleteUnvisited ? 1 : -1;
|
||||
PlotTrimFilter filter = new PlotTrimFilter(player.getWorld(), 0, visitTime, 600000);
|
||||
@ -274,7 +274,7 @@ public class AnvilCommands {
|
||||
desc = "Delete chunks matching a specific biome"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.trimallair")
|
||||
public void deleteBiome(Player player, String folder, BiomeType biome, @Switch('u') boolean unsafe) {
|
||||
public void deleteBiome(Player player, String folder, BiomeType biome, @Switch(name='u', desc = "TODO") boolean unsafe) {
|
||||
DeleteBiomeFilterSimple filter = new DeleteBiomeFilterSimple(biome);
|
||||
DeleteBiomeFilterSimple result = runWithWorld(player, folder, filter, true, unsafe);
|
||||
if (result != null) player.print(BBC.VISITOR_BLOCK.format(result.getTotal()));
|
||||
@ -285,7 +285,7 @@ public class AnvilCommands {
|
||||
desc = "Trim all air in the world"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.trimallair")
|
||||
public void trimAllAir(Player player, String folder, @Switch('u') boolean unsafe) throws WorldEditException {
|
||||
public void trimAllAir(Player player, String folder, @Switch(name='u', desc = "TODO") boolean unsafe) throws WorldEditException {
|
||||
TrimAirFilter filter = new TrimAirFilter();
|
||||
TrimAirFilter result = runWithWorld(player, folder, filter, true, unsafe);
|
||||
if (result != null) player.print(BBC.VISITOR_BLOCK.format(result.getTotal()));
|
||||
@ -308,7 +308,7 @@ public class AnvilCommands {
|
||||
desc = "Replace all blocks in the selection with another"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.replaceall")
|
||||
public void replaceAllPattern(Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch('d') boolean useData, @Switch('m') boolean useMap) throws WorldEditException {
|
||||
public void replaceAllPattern(Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch(name='d', desc = "TODO") boolean useData, @Switch(name='m', desc = "TODO") boolean useMap) throws WorldEditException {
|
||||
// MCAFilterCounter filter;
|
||||
// if (useMap) {
|
||||
// if (to instanceof RandomPattern) {
|
||||
@ -336,7 +336,7 @@ public class AnvilCommands {
|
||||
desc = "Count all blocks in a world"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.countall")
|
||||
public void countAll(Player player, EditSession editSession, String folder, String arg, @Switch('d') boolean useData) throws WorldEditException {
|
||||
public void countAll(Player player, EditSession editSession, String folder, String arg, @Switch(name='d', desc = "TODO") boolean useData) throws WorldEditException {
|
||||
// Set<BaseBlock> searchBlocks = worldEdit.getBlocks(player, arg, true);
|
||||
// MCAFilterCounter filter;
|
||||
// if (useData || arg.contains(":")) { // Optimize for both cases
|
||||
@ -408,7 +408,7 @@ public class AnvilCommands {
|
||||
desc = "Count blocks in a selection"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.count")
|
||||
public void count(Player player, EditSession editSession, @Selection Region selection, String arg, @Switch('d') boolean useData) throws WorldEditException {
|
||||
public void count(Player player, EditSession editSession, @Selection Region selection, String arg, @Switch(name='d', desc = "TODO") boolean useData) throws WorldEditException {
|
||||
// Set<BaseBlock> searchBlocks = worldEdit.getBlocks(player, arg, true);
|
||||
// MCAFilterCounter filter;
|
||||
// if (useData || arg.contains(":")) { // Optimize for both cases
|
||||
@ -429,7 +429,7 @@ public class AnvilCommands {
|
||||
desc = "Replace all blocks in the selection with another"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.distr")
|
||||
public void distr(Player player, EditSession editSession, @Selection Region selection, @Switch('d') boolean useData) throws WorldEditException {
|
||||
public void distr(Player player, EditSession editSession, @Selection Region selection, @Switch(name='d', desc = "TODO") boolean useData) throws WorldEditException {
|
||||
// long total = 0;
|
||||
// long[] count;
|
||||
// MCAFilter<long[]> counts;
|
||||
@ -507,7 +507,7 @@ public class AnvilCommands {
|
||||
desc = "Replace all blocks in the selection with another"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.replace")
|
||||
public void replace(Player player, EditSession editSession, @Selection Region selection, @Arg(name = "from", desc = "String", def = "") String from, String to, @Switch('d') boolean useData) throws WorldEditException {
|
||||
public void replace(Player player, EditSession editSession, @Selection Region selection, @Arg(name = "from", desc = "String", def = "") String from, String to, @Switch(name='d', desc = "TODO") boolean useData) throws WorldEditException {
|
||||
// final FaweBlockMatcher matchFrom;
|
||||
// if (from == null) {
|
||||
// matchFrom = FaweBlockMatcher.NOT_AIR;
|
||||
@ -528,8 +528,8 @@ public class AnvilCommands {
|
||||
desc = "Replace all blocks in the selection with a pattern"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.replace")
|
||||
// Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch('d') boolean useData, @Switch('m') boolean useMap
|
||||
public void replacePattern(Player player, EditSession editSession, @Selection Region selection, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch('d') boolean useData, @Switch('m') boolean useMap) throws WorldEditException {
|
||||
// Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch(name='d', desc = "TODO") boolean useData, @Switch(name='m', desc = "TODO") boolean useMap
|
||||
public void replacePattern(Player player, EditSession editSession, @Selection Region selection, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch(name='d', desc = "TODO") boolean useData, @Switch(name='m', desc = "TODO") boolean useMap) throws WorldEditException {
|
||||
// MCAFilterCounter filter;
|
||||
// if (useMap) {
|
||||
// if (to instanceof RandomPattern) {
|
||||
@ -559,7 +559,7 @@ public class AnvilCommands {
|
||||
desc = "Set all blocks in the selection with a pattern"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.set")
|
||||
// Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch('d') boolean useData, @Switch('m') boolean useMap
|
||||
// Player player, String folder, @Arg(name = "from", desc = "String", def = "") String from, final Pattern to, @Switch(name='d', desc = "TODO") boolean useData, @Switch(name='m', desc = "TODO") boolean useMap
|
||||
public void set(Player player, EditSession editSession, @Selection Region selection, final Pattern to) throws WorldEditException {
|
||||
MCAFilterCounter filter = new SetPatternFilter(to);
|
||||
MCAFilterCounter result = runWithSelection(player, editSession, selection, filter);
|
||||
@ -617,7 +617,7 @@ public class AnvilCommands {
|
||||
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.pastechunks")
|
||||
public void paste(Player player, LocalSession session, EditSession editSession, @Switch('c') boolean alignChunk) throws WorldEditException, IOException {
|
||||
public void paste(Player player, LocalSession session, EditSession editSession, @Switch(name='c', desc = "TODO") boolean alignChunk) throws WorldEditException, IOException {
|
||||
// FawePlayer fp = FawePlayer.wrap(player);
|
||||
// MCAClipboard clipboard = fp.getMeta(FawePlayer.METADATA_KEYS.ANVIL_CLIPBOARD);
|
||||
// if (clipboard == null) {
|
||||
|
@ -48,7 +48,7 @@ import com.sk89q.worldedit.session.ClipboardHolder;
|
||||
import com.sk89q.worldedit.session.request.Request;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.util.command.Dispatcher;
|
||||
import com.sk89q.worldedit.util.command.binding.Switch;
|
||||
import org.enginehub.piston.annotation.param.Switch;
|
||||
import com.sk89q.worldedit.util.command.parametric.Optional;
|
||||
import com.sk89q.worldedit.util.command.parametric.ParameterException;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
@ -75,6 +75,7 @@ import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import org.enginehub.piston.annotation.CommandContainer;
|
||||
import org.enginehub.piston.annotation.param.Arg;
|
||||
|
||||
import static com.boydti.fawe.util.image.ImageUtil.load;
|
||||
|
||||
@ -241,7 +242,7 @@ public class CFICommands extends MethodCommands {
|
||||
desc = "Set the floor and main block"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.cfi")
|
||||
public void column(FawePlayer fp, Pattern pattern, @Optional FawePrimitiveBinding.ImageUri image, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch('w') boolean disableWhiteOnly) throws ParameterException{
|
||||
public void column(FawePlayer fp, Pattern pattern, @Optional FawePrimitiveBinding.ImageUri image, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch(name='w', desc = "TODO") boolean disableWhiteOnly) throws ParameterException{
|
||||
HeightMapMCAGenerator gen = assertSettings(fp).getGenerator();
|
||||
if (image != null) gen.setColumn(load(image), pattern, !disableWhiteOnly);
|
||||
else if (mask != null) gen.setColumn(mask, pattern);
|
||||
@ -256,14 +257,14 @@ public class CFICommands extends MethodCommands {
|
||||
desc = "Set the floor (default: grass)"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.cfi")
|
||||
public void floorCmd(FawePlayer fp, Pattern pattern, @Optional FawePrimitiveBinding.ImageUri image, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch('w') boolean disableWhiteOnly) throws ParameterException{
|
||||
public void floorCmd(FawePlayer fp, Pattern pattern, @Optional FawePrimitiveBinding.ImageUri image, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch(name='w', desc = "TODO") boolean disableWhiteOnly) throws ParameterException{
|
||||
floor(fp, pattern, image, mask, disableWhiteOnly);
|
||||
fp.sendMessage("Set floor!");
|
||||
assertSettings(fp).resetComponent();
|
||||
component(fp);
|
||||
}
|
||||
|
||||
private void floor(FawePlayer fp, Pattern pattern, @Optional FawePrimitiveBinding.ImageUri image, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch('w') boolean disableWhiteOnly) throws ParameterException {
|
||||
private void floor(FawePlayer fp, Pattern pattern, @Optional FawePrimitiveBinding.ImageUri image, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch(name='w', desc = "TODO") boolean disableWhiteOnly) throws ParameterException {
|
||||
HeightMapMCAGenerator gen = assertSettings(fp).getGenerator();
|
||||
if (image != null) gen.setFloor(load(image), pattern, !disableWhiteOnly);
|
||||
else if (mask != null) gen.setFloor(mask, pattern);
|
||||
@ -275,14 +276,14 @@ public class CFICommands extends MethodCommands {
|
||||
desc = "Set the main block (default: stone)"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.cfi")
|
||||
public void mainCmd(FawePlayer fp, Pattern pattern, @Optional FawePrimitiveBinding.ImageUri image, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch('w') boolean disableWhiteOnly) throws ParameterException{
|
||||
public void mainCmd(FawePlayer fp, Pattern pattern, @Optional FawePrimitiveBinding.ImageUri image, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch(name='w', desc = "TODO") boolean disableWhiteOnly) throws ParameterException{
|
||||
main(fp, pattern, image, mask, disableWhiteOnly);
|
||||
fp.sendMessage("Set main!");
|
||||
assertSettings(fp).resetComponent();
|
||||
component(fp);
|
||||
}
|
||||
|
||||
public void main(FawePlayer fp, Pattern pattern, @Optional FawePrimitiveBinding.ImageUri image, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch('w') boolean disableWhiteOnly) throws ParameterException{
|
||||
public void main(FawePlayer fp, Pattern pattern, @Optional FawePrimitiveBinding.ImageUri image, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch(name='w', desc = "TODO") boolean disableWhiteOnly) throws ParameterException{
|
||||
HeightMapMCAGenerator gen = assertSettings(fp).getGenerator();
|
||||
if (image != null) gen.setMain(load(image), pattern, !disableWhiteOnly);
|
||||
else if (mask != null) gen.setMain(mask, pattern);
|
||||
@ -298,7 +299,7 @@ public class CFICommands extends MethodCommands {
|
||||
"e.g. Tallgrass"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.cfi")
|
||||
public void overlay(FawePlayer fp, Pattern pattern, @Optional FawePrimitiveBinding.ImageUri image, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch('w') boolean disableWhiteOnly) throws ParameterException{
|
||||
public void overlay(FawePlayer fp, Pattern pattern, @Optional FawePrimitiveBinding.ImageUri image, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch(name='w', desc = "TODO") boolean disableWhiteOnly) throws ParameterException{
|
||||
HeightMapMCAGenerator gen = assertSettings(fp).getGenerator();
|
||||
if (image != null) gen.setOverlay(load(image), pattern, !disableWhiteOnly);
|
||||
else if (mask != null) gen.setOverlay(mask, pattern);
|
||||
@ -316,13 +317,13 @@ public class CFICommands extends MethodCommands {
|
||||
" - A good value for radius and iterations would be 1 8."
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.cfi")
|
||||
public void smoothCmd(FawePlayer fp, int radius, int iterations, @Optional FawePrimitiveBinding.ImageUri image, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch('w') boolean disableWhiteOnly) throws ParameterException{
|
||||
public void smoothCmd(FawePlayer fp, int radius, int iterations, @Optional FawePrimitiveBinding.ImageUri image, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch(name='w', desc = "TODO") boolean disableWhiteOnly) throws ParameterException{
|
||||
smooth(fp, radius, iterations, image, mask, disableWhiteOnly);
|
||||
assertSettings(fp).resetComponent();
|
||||
component(fp);
|
||||
}
|
||||
|
||||
private void smooth(FawePlayer fp, int radius, int iterations, @Optional FawePrimitiveBinding.ImageUri image, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch('w') boolean disableWhiteOnly) throws ParameterException{
|
||||
private void smooth(FawePlayer fp, int radius, int iterations, @Optional FawePrimitiveBinding.ImageUri image, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch(name='w', desc = "TODO") boolean disableWhiteOnly) throws ParameterException{
|
||||
HeightMapMCAGenerator gen = assertSettings(fp).getGenerator();
|
||||
if (image != null) gen.smooth(load(image), !disableWhiteOnly, radius, iterations);
|
||||
else gen.smooth(mask, radius, iterations);
|
||||
@ -333,7 +334,7 @@ public class CFICommands extends MethodCommands {
|
||||
desc = "Create some snow"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.cfi")
|
||||
public void snow(FawePlayer fp, @Optional FawePrimitiveBinding.ImageUri image, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch('w') boolean disableWhiteOnly) throws ParameterException{
|
||||
public void snow(FawePlayer fp, @Optional FawePrimitiveBinding.ImageUri image, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch(name='w', desc = "TODO") boolean disableWhiteOnly) throws ParameterException{
|
||||
HeightMapMCAGenerator gen = assertSettings(fp).getGenerator();
|
||||
floor(fp, BlockTypes.SNOW.getDefaultState().with(PropertyKey.LAYERS, 7), image, mask, disableWhiteOnly);
|
||||
main(fp, BlockTypes.SNOW_BLOCK, image, mask, disableWhiteOnly);
|
||||
@ -498,7 +499,7 @@ public class CFICommands extends MethodCommands {
|
||||
" - If a mask is used, the biome will be set anywhere the mask applies"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.cfi")
|
||||
public void biome(FawePlayer fp, BiomeType biome, @Optional FawePrimitiveBinding.ImageUri image, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch('w') boolean disableWhiteOnly) throws ParameterException{
|
||||
public void biome(FawePlayer fp, BiomeType biome, @Optional FawePrimitiveBinding.ImageUri image, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch(name='w', desc = "TODO") boolean disableWhiteOnly) throws ParameterException{
|
||||
HeightMapMCAGenerator gen = assertSettings(fp).getGenerator();
|
||||
if (image != null) gen.setBiome(load(image), biome, !disableWhiteOnly);
|
||||
else if (mask != null) gen.setBiome(mask, biome);
|
||||
@ -661,7 +662,7 @@ public class CFICommands extends MethodCommands {
|
||||
)
|
||||
// ![79,174,212,5:3,5:4,18,161,20]
|
||||
@CommandPermissions("worldedit.anvil.cfi")
|
||||
public void glass(FawePlayer fp, FawePrimitiveBinding.ImageUri image, @Optional FawePrimitiveBinding.ImageUri imageMask, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch('w') boolean disableWhiteOnly) throws ParameterException, WorldEditException {
|
||||
public void glass(FawePlayer fp, FawePrimitiveBinding.ImageUri image, @Optional FawePrimitiveBinding.ImageUri imageMask, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch(name='w', desc = "TODO") boolean disableWhiteOnly) throws ParameterException, WorldEditException {
|
||||
CFISettings settings = assertSettings(fp);
|
||||
settings.getGenerator().setColorWithGlass(load(image));
|
||||
msg("Set color with glass!").send(fp);
|
||||
@ -678,7 +679,7 @@ public class CFICommands extends MethodCommands {
|
||||
"The -w (disableWhiteOnly) will randomly apply depending on the pixel luminance"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.cfi")
|
||||
public void color(FawePlayer fp, FawePrimitiveBinding.ImageUri image, @Optional FawePrimitiveBinding.ImageUri imageMask, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch('w') boolean disableWhiteOnly) throws ParameterException, WorldEditException {
|
||||
public void color(FawePlayer fp, FawePrimitiveBinding.ImageUri image, @Optional FawePrimitiveBinding.ImageUri imageMask, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch(name='w', desc = "TODO") boolean disableWhiteOnly) throws ParameterException, WorldEditException {
|
||||
CFISettings settings = assertSettings(fp);
|
||||
HeightMapMCAGenerator gen = settings.getGenerator();
|
||||
if (imageMask != null) gen.setColor(load(image), load(imageMask), !disableWhiteOnly);
|
||||
@ -698,7 +699,7 @@ public class CFICommands extends MethodCommands {
|
||||
"The -w (disableWhiteOnly) will randomly apply depending on the pixel luminance"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.cfi")
|
||||
public void blockbiome(FawePlayer fp, FawePrimitiveBinding.ImageUri image, @Optional FawePrimitiveBinding.ImageUri imageMask, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch('w') boolean disableWhiteOnly) throws ParameterException, WorldEditException {
|
||||
public void blockbiome(FawePlayer fp, FawePrimitiveBinding.ImageUri image, @Optional FawePrimitiveBinding.ImageUri imageMask, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch(name='w', desc = "TODO") boolean disableWhiteOnly) throws ParameterException, WorldEditException {
|
||||
CFISettings settings = assertSettings(fp);
|
||||
settings.getGenerator().setBlockAndBiomeColor(load(image), mask, load(imageMask), !disableWhiteOnly);
|
||||
msg("Set color with blocks and biomes!").send(fp);
|
||||
@ -714,7 +715,7 @@ public class CFICommands extends MethodCommands {
|
||||
" - If you changed the block to something other than grass you will not see anything."
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.cfi")
|
||||
public void biomecolor(FawePlayer fp, FawePrimitiveBinding.ImageUri image, @Optional FawePrimitiveBinding.ImageUri imageMask, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch('w') boolean disableWhiteOnly) throws ParameterException, WorldEditException {
|
||||
public void biomecolor(FawePlayer fp, FawePrimitiveBinding.ImageUri image, @Optional FawePrimitiveBinding.ImageUri imageMask, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch(name='w', desc = "TODO") boolean disableWhiteOnly) throws ParameterException, WorldEditException {
|
||||
CFISettings settings = assertSettings(fp);
|
||||
settings.getGenerator().setBiomeColor(load(image));
|
||||
msg("Set color with biomes!").send(fp);
|
||||
@ -806,7 +807,7 @@ public class CFICommands extends MethodCommands {
|
||||
desc = "Select a mask"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.cfi")
|
||||
public void mask(FawePlayer fp, @Optional FawePrimitiveBinding.ImageUri imageMask, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch('w') boolean disableWhiteOnly, CommandContext context) throws ParameterException{
|
||||
public void mask(FawePlayer fp, @Optional FawePrimitiveBinding.ImageUri imageMask, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch(name='w', desc = "TODO") boolean disableWhiteOnly, CommandContext context) throws ParameterException{
|
||||
CFISettings settings = assertSettings(fp);
|
||||
String[] split = getArguments(context).split(" ");
|
||||
int index = 2;
|
||||
|
@ -313,7 +313,7 @@ public class BrushCommands {
|
||||
@CommandPermissions("worldedit.brush.recursive")
|
||||
public BrushSettings recursiveBrush(Player player, LocalSession session, EditSession editSession, Pattern fill,
|
||||
@Arg(desc = "The radius to sample for blending", def = "5")
|
||||
double radius, @Switch('d') boolean depthFirst, CommandContext context) throws WorldEditException {
|
||||
double radius, @Switch(name='d', desc = "TODO") boolean depthFirst, CommandContext context) throws WorldEditException {
|
||||
worldEdit.checkMaxBrushRadius(radius);
|
||||
Brush brush = new RecurseBrush(depthFirst);
|
||||
CommandLocals locals = context.getLocals();
|
||||
@ -358,7 +358,7 @@ public class BrushCommands {
|
||||
@CommandPermissions("worldedit.brush.line")
|
||||
public BrushSettings lineBrush(Player player, EditSession editSession, LocalSession session, Pattern fill,
|
||||
@Arg(desc = "The radius to sample for blending", def = "0")
|
||||
double radius, @Switch('h') boolean shell, @Switch('s') boolean select, @Switch('f') boolean flat, CommandContext context) throws WorldEditException {
|
||||
double radius, @Switch(name='h', desc = "TODO") boolean shell, @Switch(name='s', desc = "TODO") boolean select, @Switch(name='f', desc = "TODO") boolean flat, CommandContext context) throws WorldEditException {
|
||||
worldEdit.checkMaxBrushRadius(radius);
|
||||
Brush brush = new LineBrush(shell, select, flat);
|
||||
CommandLocals locals = context.getLocals();
|
||||
@ -494,7 +494,7 @@ public class BrushCommands {
|
||||
@CommandPermissions("worldedit.brush.spline")
|
||||
public BrushSettings catenaryBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("1.2") @Range(min=1) double lengthFactor,
|
||||
@Arg(desc = "The radius to sample for blending", def = "0")
|
||||
double radius, @Switch('h') boolean shell, @Switch('s') boolean select, @Switch('d') boolean facingDirection, CommandContext context) throws WorldEditException {
|
||||
double radius, @Switch(name='h', desc = "TODO") boolean shell, @Switch(name='s', desc = "TODO") boolean select, @Switch(name='d', desc = "TODO") boolean facingDirection, CommandContext context) throws WorldEditException {
|
||||
worldEdit.checkMaxBrushRadius(radius);
|
||||
Brush brush = new CatenaryBrush(shell, select, facingDirection, lengthFactor);
|
||||
CommandLocals locals = context.getLocals();
|
||||
@ -728,7 +728,7 @@ public class BrushCommands {
|
||||
"The -r flag will apply random rotation"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.stencil")
|
||||
public BrushSettings stencilBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, @Arg(name = "image", desc = "String", def = "") String image, @Optional("0") @Step(90) @Range(min=0, max=360) final int rotation, @Arg(name = "yscale", desc = "double", def = "1") final double yscale, @Switch('w') boolean onlyWhite, @Switch('r') boolean randomRotate, CommandContext context) throws WorldEditException, FileNotFoundException, ParameterException {
|
||||
public BrushSettings stencilBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, @Arg(name = "image", desc = "String", def = "") String image, @Optional("0") @Step(90) @Range(min=0, max=360) final int rotation, @Arg(name = "yscale", desc = "double", def = "1") final double yscale, @Switch(name='w', desc = "TODO") boolean onlyWhite, @Switch(name='r', desc = "TODO") boolean randomRotate, CommandContext context) throws WorldEditException, FileNotFoundException, ParameterException {
|
||||
worldEdit.checkMaxBrushRadius(radius);
|
||||
InputStream stream = getHeightmapStream(image);
|
||||
HeightBrush brush;
|
||||
@ -779,7 +779,7 @@ public class BrushCommands {
|
||||
"The -f blends the image with the existing terrain"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.stencil")
|
||||
public BrushSettings imageBrush(Player player, EditSession editSession, LocalSession session, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, FawePrimitiveBinding.ImageUri imageUri, @Optional("1") @Range(min=Double.MIN_NORMAL) final double yscale, @Switch('a') boolean alpha, @Switch('f') boolean fadeOut, CommandContext context) throws WorldEditException, IOException, ParameterException {
|
||||
public BrushSettings imageBrush(Player player, EditSession editSession, LocalSession session, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, FawePrimitiveBinding.ImageUri imageUri, @Optional("1") @Range(min=Double.MIN_NORMAL) final double yscale, @Switch(name='a', desc = "TODO") boolean alpha, @Switch(name='f', desc = "TODO") boolean fadeOut, CommandContext context) throws WorldEditException, IOException, ParameterException {
|
||||
BufferedImage image = imageUri.load();
|
||||
worldEdit.checkMaxBrushRadius(radius);
|
||||
if (yscale != 1) {
|
||||
@ -871,7 +871,7 @@ public class BrushCommands {
|
||||
"Video: https://youtu.be/RPZIaTbqoZw?t=34s"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.scatter")
|
||||
public BrushSettings scatterBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, @Arg(name = "points", desc = "double", def = "5") double points, @Arg(name = "distance", desc = "double", def = "1") double distance, @Switch('o') boolean overlay, CommandContext context) throws WorldEditException {
|
||||
public BrushSettings scatterBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, @Arg(name = "points", desc = "double", def = "5") double points, @Arg(name = "distance", desc = "double", def = "1") double distance, @Switch(name='o', desc = "TODO") boolean overlay, CommandContext context) throws WorldEditException {
|
||||
worldEdit.checkMaxBrushRadius(radius);
|
||||
Brush brush;
|
||||
if (overlay) {
|
||||
@ -917,7 +917,7 @@ public class BrushCommands {
|
||||
"The -r flag will apply random rotation"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.populateschematic")
|
||||
public BrushSettings scatterSchemBrush(Player player, EditSession editSession, LocalSession session, Mask mask, String clipboard, @Arg(name = "radius", desc = "Expression", def = "30") Expression radius, @Arg(name = "density", desc = "double", def = "50") double density, @Switch('r') boolean rotate, CommandContext context) throws WorldEditException {
|
||||
public BrushSettings scatterSchemBrush(Player player, EditSession editSession, LocalSession session, Mask mask, String clipboard, @Arg(name = "radius", desc = "Expression", def = "30") Expression radius, @Arg(name = "density", desc = "double", def = "50") double density, @Switch(name='r', desc = "TODO") boolean rotate, CommandContext context) throws WorldEditException {
|
||||
worldEdit.checkMaxBrushRadius(radius);
|
||||
|
||||
|
||||
@ -1415,7 +1415,7 @@ public class BrushCommands {
|
||||
"Snow Pic: https://i.imgur.com/Hrzn0I4.png"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.height")
|
||||
public BrushSettings heightBrush(Player player, LocalSession session, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, @Arg(name = "image", desc = "String", def = "") final String image, @Optional("0") @Step(90) @Range(min=0, max=360) final int rotation, @Arg(name = "yscale", desc = "double", def = "1") final double yscale, @Switch('r') boolean randomRotate, @Switch('l') boolean layers, @Switch('s') boolean dontSmooth, CommandContext context) throws WorldEditException, FileNotFoundException, ParameterException {
|
||||
public BrushSettings heightBrush(Player player, LocalSession session, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, @Arg(name = "image", desc = "String", def = "") final String image, @Optional("0") @Step(90) @Range(min=0, max=360) final int rotation, @Arg(name = "yscale", desc = "double", def = "1") final double yscale, @Switch(name='r', desc = "TODO") boolean randomRotate, @Switch(name='l', desc = "TODO") boolean layers, @Switch(name='s', desc = "TODO") boolean dontSmooth, CommandContext context) throws WorldEditException, FileNotFoundException, ParameterException {
|
||||
return terrainBrush(player, session, radius, image, rotation, yscale, false, randomRotate, layers, !dontSmooth, ScalableHeightMap.Shape.CONE, context);
|
||||
}
|
||||
|
||||
@ -1429,7 +1429,7 @@ public class BrushCommands {
|
||||
" - The `-s` flag disables smoothing"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.height")
|
||||
public BrushSettings cliffBrush(Player player, LocalSession session, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, @Arg(name = "image", desc = "String", def = "") String image, @Optional("0") @Step(90) @Range(min=0, max=360) final int rotation, @Arg(name = "yscale", desc = "double", def = "1") final double yscale, @Switch('r') boolean randomRotate, @Switch('l') boolean layers, @Switch('s') boolean dontSmooth, CommandContext context) throws WorldEditException, FileNotFoundException, ParameterException {
|
||||
public BrushSettings cliffBrush(Player player, LocalSession session, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, @Arg(name = "image", desc = "String", def = "") String image, @Optional("0") @Step(90) @Range(min=0, max=360) final int rotation, @Arg(name = "yscale", desc = "double", def = "1") final double yscale, @Switch(name='r', desc = "TODO") boolean randomRotate, @Switch(name='l', desc = "TODO") boolean layers, @Switch(name='s', desc = "TODO") boolean dontSmooth, CommandContext context) throws WorldEditException, FileNotFoundException, ParameterException {
|
||||
return terrainBrush(player, session, radius, image, rotation, yscale, true, randomRotate, layers, !dontSmooth, ScalableHeightMap.Shape.CYLINDER, context);
|
||||
}
|
||||
|
||||
@ -1443,7 +1443,7 @@ public class BrushCommands {
|
||||
desc = "This brush raises or lowers land towards the clicked point"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.height")
|
||||
public BrushSettings flattenBrush(Player player, LocalSession session, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, @Arg(name = "image", desc = "String", def = "") final String image, @Optional("0") @Step(90) @Range(min=0, max=360) final int rotation, @Arg(name = "yscale", desc = "double", def = "1") final double yscale, @Switch('r') boolean randomRotate, @Switch('l') boolean layers, @Switch('s') boolean dontSmooth, CommandContext context) throws WorldEditException, FileNotFoundException, ParameterException {
|
||||
public BrushSettings flattenBrush(Player player, LocalSession session, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, @Arg(name = "image", desc = "String", def = "") final String image, @Optional("0") @Step(90) @Range(min=0, max=360) final int rotation, @Arg(name = "yscale", desc = "double", def = "1") final double yscale, @Switch(name='r', desc = "TODO") boolean randomRotate, @Switch(name='l', desc = "TODO") boolean layers, @Switch(name='s', desc = "TODO") boolean dontSmooth, CommandContext context) throws WorldEditException, FileNotFoundException, ParameterException {
|
||||
return terrainBrush(player, session, radius, image, rotation, yscale, true, randomRotate, layers, !dontSmooth, ScalableHeightMap.Shape.CONE, context);
|
||||
}
|
||||
|
||||
@ -1519,7 +1519,7 @@ public class BrushCommands {
|
||||
"Video: https://www.youtube.com/watch?v=RPZIaTbqoZw"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.copy")
|
||||
public BrushSettings copy(Player player, LocalSession session, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, @Switch('r') boolean randomRotate, @Switch('a') boolean autoRotate, CommandContext context) throws WorldEditException {
|
||||
public BrushSettings copy(Player player, LocalSession session, @Arg(name = "radius", desc = "Expression", def = "5") Expression radius, @Switch(name='r', desc = "TODO") boolean randomRotate, @Switch(name='a', desc = "TODO") boolean autoRotate, CommandContext context) throws WorldEditException {
|
||||
worldEdit.checkMaxBrushRadius(radius);
|
||||
player.print(BBC.BRUSH_COPY.f(radius));
|
||||
|
||||
|
@ -30,8 +30,9 @@ import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.util.HandSide;
|
||||
import com.sk89q.worldedit.util.command.binding.Range;
|
||||
import com.sk89q.worldedit.util.command.binding.Switch;
|
||||
import com.sk89q.worldedit.util.command.parametric.Optional;
|
||||
import org.enginehub.piston.annotation.param.Arg;
|
||||
import org.enginehub.piston.annotation.param.Switch;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
@ -62,7 +63,7 @@ public class BrushOptionsCommands extends MethodCommands {
|
||||
"use the -g flag to save globally"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.save")
|
||||
public void saveBrush(Player player, LocalSession session, String name, @Switch('g') boolean root) throws WorldEditException, IOException {
|
||||
public void saveBrush(Player player, LocalSession session, String name, @Switch(name='g', desc = "TODO") boolean root) throws WorldEditException, IOException {
|
||||
BrushTool tool = session.getBrushTool(player);
|
||||
if (tool != null) {
|
||||
root |= name.startsWith("../");
|
||||
@ -135,7 +136,7 @@ public class BrushOptionsCommands extends MethodCommands {
|
||||
" -p <page> prints the requested page\n"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.list")
|
||||
public void list(Actor actor, CommandContext args, @Switch('p') @Arg(name = "page", desc = "int", def = "1") int page) throws WorldEditException {
|
||||
public void list(Actor actor, CommandContext args, @Switch(name='p', desc = "TODO") @Arg(name = "page", desc = "int", def = "1") int page) throws WorldEditException {
|
||||
String baseCmd = Commands.getAlias(BrushCommands.class, "brush") + " " + Commands.getAlias(BrushOptionsCommands.class, "loadbrush");
|
||||
File dir = MainUtil.getFile(Fawe.imp().getDirectory(), "brushes");
|
||||
UtilityCommands.list(dir, actor, args, page, null, true, baseCmd);
|
||||
@ -309,7 +310,7 @@ public class BrushOptionsCommands extends MethodCommands {
|
||||
max = -1
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.scroll")
|
||||
public void scroll(Player player, EditSession editSession, LocalSession session, @Optional @Switch('h') boolean offHand, CommandContext args) throws WorldEditException {
|
||||
public void scroll(Player player, EditSession editSession, LocalSession session, @Optional @Switch(name='h', desc = "TODO") boolean offHand, CommandContext args) throws WorldEditException {
|
||||
BrushTool bt = session.getBrushTool(player, false);
|
||||
if (bt == null) {
|
||||
BBC.BRUSH_NONE.send(player);
|
||||
@ -335,7 +336,7 @@ public class BrushOptionsCommands extends MethodCommands {
|
||||
max = -1
|
||||
)
|
||||
@CommandPermissions({"worldedit.brush.options.mask", "worldedit.mask.brush"})
|
||||
public void mask(Player player, LocalSession session, EditSession editSession, @Optional @Switch('h') boolean offHand, CommandContext context) throws WorldEditException {
|
||||
public void mask(Player player, LocalSession session, EditSession editSession, @Optional @Switch(name='h', desc = "TODO") boolean offHand, CommandContext context) throws WorldEditException {
|
||||
BrushTool tool = session.getBrushTool(player, false);
|
||||
if (tool == null) {
|
||||
player.print(BBC.BRUSH_NONE.f());
|
||||
@ -367,7 +368,7 @@ public class BrushOptionsCommands extends MethodCommands {
|
||||
max = -1
|
||||
)
|
||||
@CommandPermissions({"worldedit.brush.options.mask", "worldedit.mask.brush"})
|
||||
public void smask(Player player, LocalSession session, EditSession editSession, @Optional @Switch('h') boolean offHand, CommandContext context) throws WorldEditException {
|
||||
public void smask(Player player, LocalSession session, EditSession editSession, @Optional @Switch(name='h', desc = "TODO") boolean offHand, CommandContext context) throws WorldEditException {
|
||||
BrushTool tool = session.getBrushTool(player, false);
|
||||
if (tool == null) {
|
||||
player.print(BBC.BRUSH_NONE.f());
|
||||
@ -397,7 +398,7 @@ public class BrushOptionsCommands extends MethodCommands {
|
||||
max = -1
|
||||
)
|
||||
@CommandPermissions({"worldedit.brush.options.transform", "worldedit.transform.brush"})
|
||||
public void transform(Player player, LocalSession session, EditSession editSession, @Optional @Switch('h') boolean offHand, CommandContext context) throws WorldEditException {
|
||||
public void transform(Player player, LocalSession session, EditSession editSession, @Optional @Switch(name='h', desc = "TODO") boolean offHand, CommandContext context) throws WorldEditException {
|
||||
BrushTool tool = session.getBrushTool(player, false);
|
||||
if (tool == null) {
|
||||
player.print(BBC.BRUSH_NONE.f());
|
||||
@ -427,7 +428,7 @@ public class BrushOptionsCommands extends MethodCommands {
|
||||
desc = "Set the brush material"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.options.material")
|
||||
public void material(Player player, EditSession editSession, LocalSession session, Pattern pattern, @Switch('h') boolean offHand, CommandContext context) throws WorldEditException {
|
||||
public void material(Player player, EditSession editSession, LocalSession session, Pattern pattern, @Switch(name='h', desc = "TODO") boolean offHand, CommandContext context) throws WorldEditException {
|
||||
BrushTool tool = session.getBrushTool(player, false);
|
||||
if (tool == null) {
|
||||
player.print(BBC.BRUSH_NONE.f());
|
||||
@ -466,7 +467,7 @@ public class BrushOptionsCommands extends MethodCommands {
|
||||
desc = "Set the brush size"
|
||||
)
|
||||
@CommandPermissions("worldedit.brush.options.size")
|
||||
public void size(Player player, LocalSession session, CommandContext args, @Switch('h') boolean offHand) throws WorldEditException {
|
||||
public void size(Player player, LocalSession session, CommandContext args, @Switch(name='h', desc = "TODO") boolean offHand) throws WorldEditException {
|
||||
int radius = args.getInteger(0);
|
||||
worldEdit.checkMaxBrushRadius(radius);
|
||||
BrushTool tool = session.getBrushTool(player, false);
|
||||
|
@ -45,7 +45,7 @@ import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.util.command.binding.Range;
|
||||
import com.sk89q.worldedit.util.command.binding.Switch;
|
||||
import org.enginehub.piston.annotation.param.Switch;
|
||||
import com.sk89q.worldedit.util.command.parametric.Optional;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import java.io.File;
|
||||
@ -79,7 +79,7 @@ public class HistoryCommands extends MethodCommands {
|
||||
" - Import from disk: /frb #import"
|
||||
)
|
||||
@CommandPermissions("worldedit.history.rollback")
|
||||
public void faweRollback(final Player player, LocalSession session, final String user, @Optional("0") @Range(min = 0) int radius, @Arg(name = "time", desc = "String", def = "0") String time, @Switch('r') boolean restore) throws WorldEditException {
|
||||
public void faweRollback(final Player player, LocalSession session, final String user, @Optional("0") @Range(min = 0) int radius, @Arg(name = "time", desc = "String", def = "0") String time, @Switch(name='r', desc = "TODO") boolean restore) throws WorldEditException {
|
||||
if (!Settings.IMP.HISTORY.USE_DATABASE) {
|
||||
BBC.SETTING_DISABLE.send(player, "history.use-database (Import with /frb #import )");
|
||||
return;
|
||||
|
@ -16,7 +16,7 @@ import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.regions.shape.WorldEditExpressionEnvironment;
|
||||
import com.sk89q.worldedit.session.request.RequestSelection;
|
||||
import com.sk89q.worldedit.util.command.binding.Switch;
|
||||
import org.enginehub.piston.annotation.param.Switch;
|
||||
import com.sk89q.worldedit.util.command.parametric.Optional;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
@ -257,7 +257,7 @@ public class MaskCommands extends MethodCommands {
|
||||
"Example: /[3][20]\n" +
|
||||
"Explanation: Allows any block where the adjacent block is between 3 and 20 blocks below"
|
||||
)
|
||||
public Mask angle(Extent extent, String min, String max, @Switch('o') boolean overlay, @Arg(name = "distance", desc = "int", def = "1") int distance) throws ExpressionException {
|
||||
public Mask angle(Extent extent, String min, String max, @Switch(name='o', desc = "TODO") boolean overlay, @Arg(name = "distance", desc = "int", def = "1") int distance) throws ExpressionException {
|
||||
double y1, y2;
|
||||
boolean override;
|
||||
if (max.endsWith("d")) {
|
||||
@ -282,7 +282,7 @@ public class MaskCommands extends MethodCommands {
|
||||
"Explanation: Restrict near where the angle changes between 0-45 degrees within 5 blocks\n" +
|
||||
"Note: Use negatives for decreasing slope"
|
||||
)
|
||||
public Mask roc(Extent extent, String min, String max, @Switch('o') boolean overlay, @Arg(name = "distance", desc = "int", def = "4") int distance) throws ExpressionException {
|
||||
public Mask roc(Extent extent, String min, String max, @Switch(name='o', desc = "TODO") boolean overlay, @Arg(name = "distance", desc = "int", def = "4") int distance) throws ExpressionException {
|
||||
double y1, y2;
|
||||
boolean override;
|
||||
if (max.endsWith("d")) {
|
||||
@ -307,7 +307,7 @@ public class MaskCommands extends MethodCommands {
|
||||
"Explanation: Restrict to near 45 degrees of local maxima\n" +
|
||||
"Note: Use negatives for local minima"
|
||||
)
|
||||
public Mask extrema(Extent extent, String min, String max, @Switch('o') boolean overlay, @Arg(name = "distance", desc = "int", def = "4") int distance) throws ExpressionException {
|
||||
public Mask extrema(Extent extent, String min, String max, @Switch(name='o', desc = "TODO") boolean overlay, @Arg(name = "distance", desc = "int", def = "4") int distance) throws ExpressionException {
|
||||
double y1, y2;
|
||||
boolean override;
|
||||
if (max.endsWith("d")) {
|
||||
|
@ -412,7 +412,7 @@ public class RegionCommands {
|
||||
)
|
||||
@CommandPermissions("worldedit.region.smooth")
|
||||
@Logging(REGION)
|
||||
public void smooth(FawePlayer player, EditSession editSession, @Selection Region region, @Arg(name = "iterations", desc = "int", def = "1") int iterations, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch('s') boolean snow, CommandContext context) throws WorldEditException {
|
||||
public void smooth(FawePlayer player, EditSession editSession, @Selection Region region, @Arg(name = "iterations", desc = "int", def = "1") int iterations, @Arg(name = "mask", desc = "Mask", def = "") Mask mask, @Switch(name='s', desc = "TODO") boolean snow, CommandContext context) throws WorldEditException {
|
||||
BlockVector3 min = region.getMinimumPoint();
|
||||
BlockVector3 max = region.getMaximumPoint();
|
||||
long volume = (((long) max.getX() - (long) min.getX() + 1) * ((long) max.getY() - (long) min.getY() + 1) * ((long) max.getZ() - (long) min.getZ() + 1));
|
||||
@ -491,10 +491,10 @@ public class RegionCommands {
|
||||
boolean moveSelection,
|
||||
@Switch(name = 'a', desc = "Ignore air blocks")
|
||||
boolean ignoreAirBlocks
|
||||
@Switch('b') boolean copyBiomes,
|
||||
@Switch(name='b', desc = "TODO") boolean copyBiomes,
|
||||
|
||||
@Switch('e') boolean skipEntities,
|
||||
@Switch('a') boolean skipAir,
|
||||
@Switch(name='e', desc = "TODO") boolean skipEntities,
|
||||
@Switch(name='a', desc = "TODO") boolean skipAir,
|
||||
CommandContext context) throws WorldEditException {
|
||||
player.checkConfirmationRegion(() -> {
|
||||
int affected = editSession.moveRegion(region, direction, count, !skipAir, !skipEntities, copyBiomes, replace);
|
||||
@ -525,7 +525,7 @@ public class RegionCommands {
|
||||
public void fall(FawePlayer player, EditSession editSession, LocalSession session,
|
||||
@Selection Region region,
|
||||
@Arg(name = "replace", desc = "BlockStateHolder", def = "air") BlockStateHolder replace,
|
||||
@Switch('m') boolean notFullHeight,
|
||||
@Switch(name='m', desc = "TODO") boolean notFullHeight,
|
||||
CommandContext context) throws WorldEditException {
|
||||
player.checkConfirmationRegion(() -> {
|
||||
int affected = editSession.fall(region, !notFullHeight, replace);
|
||||
@ -551,7 +551,7 @@ public class RegionCommands {
|
||||
@Switch(name = 'b', desc = "//TODO") boolean copyBiomes,
|
||||
@Switch(name = 'e', desc = "//TODO") boolean skipEntities,
|
||||
@Switch(name = 'a', desc = "Ignore air blocks")
|
||||
boolean ignoreAirBlocks, @Switch('m') Mask sourceMask, CommandContext context) throws WorldEditException {
|
||||
boolean ignoreAirBlocks, @Switch(name='m', desc = "TODO") Mask sourceMask, CommandContext context) throws WorldEditException {
|
||||
player.checkConfirmationStack(() -> {
|
||||
if (sourceMask != null) {
|
||||
editSession.addSourceMask(sourceMask);
|
||||
|
@ -557,7 +557,7 @@ public class SchematicCommands {
|
||||
" -f <format> restricts by format\n"
|
||||
)
|
||||
@CommandPermissions("worldedit.schematic.show")
|
||||
public void show(Player player, CommandContext args, @Switch('f') String formatName) {
|
||||
public void show(Player player, CommandContext args, @Switch(name='f', desc = "TODO") String formatName) {
|
||||
FawePlayer fp = FawePlayer.wrap(player);
|
||||
if (args.argsLength() == 0) {
|
||||
if (fp.getSession().getVirtualWorld() != null) fp.setVirtualWorld(null);
|
||||
|
@ -20,7 +20,7 @@
|
||||
package com.sk89q.worldedit.util.command.parametric;
|
||||
|
||||
import com.sk89q.minecraft.util.commands.CommandLocals;
|
||||
import com.sk89q.worldedit.util.command.binding.Switch;
|
||||
import org.enginehub.piston.annotation.param.Switch;
|
||||
|
||||
/**
|
||||
* Determines the type of binding.
|
||||
|
@ -38,7 +38,7 @@ import com.sk89q.worldedit.util.command.NullCompleter;
|
||||
import com.sk89q.worldedit.util.command.ProcessedCallable;
|
||||
import com.sk89q.worldedit.util.command.binding.PrimitiveBindings;
|
||||
import com.sk89q.worldedit.util.command.binding.StandardBindings;
|
||||
import com.sk89q.worldedit.util.command.binding.Switch;
|
||||
import org.enginehub.piston.annotation.param.Switch;
|
||||
import com.thoughtworks.paranamer.Paranamer;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Type;
|
||||
|
@ -33,7 +33,7 @@ import com.sk89q.worldedit.util.command.MissingParameterException;
|
||||
import com.sk89q.worldedit.util.command.Parameter;
|
||||
import com.sk89q.worldedit.util.command.SimpleDescription;
|
||||
import com.sk89q.worldedit.util.command.UnconsumedParameterException;
|
||||
import com.sk89q.worldedit.util.command.binding.Switch;
|
||||
import org.enginehub.piston.annotation.param.Switch;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
Loading…
Reference in New Issue
Block a user