mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-05 04:26:42 +00:00
some codestyle application
This commit is contained in:
@ -1500,4 +1500,5 @@ public class BrushCommands {
|
||||
player.print(Caption.of("worldedit.brush.operation.equip", TextComponent.of(factory.toString())));
|
||||
ToolCommands.sendUnbindInstruction(player, UNBIND_COMMAND_COMPONENT);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ import com.fastasyncworldedit.core.extent.clipboard.DiskOptimizedClipboard;
|
||||
import com.fastasyncworldedit.core.extent.clipboard.MultiClipboardHolder;
|
||||
import com.fastasyncworldedit.core.extent.clipboard.ReadOnlyClipboard;
|
||||
import com.fastasyncworldedit.core.extent.clipboard.URIClipboardHolder;
|
||||
import com.fastasyncworldedit.core.internal.exception.FaweException;
|
||||
import com.fastasyncworldedit.core.internal.io.FastByteArrayOutputStream;
|
||||
import com.fastasyncworldedit.core.object.FaweLimit;
|
||||
import com.fastasyncworldedit.core.util.ImgurUtility;
|
||||
|
@ -75,9 +75,9 @@ public class ExpandCommands {
|
||||
command.condition(new PermissionCondition(ImmutableSet.of("worldedit.selection.expand")));
|
||||
|
||||
command.addPart(SubCommandPart.builder(
|
||||
Caption.of("vert"),
|
||||
TextComponent.of("Vertical expansion sub-command")
|
||||
)
|
||||
Caption.of("vert"),
|
||||
TextComponent.of("Vertical expansion sub-command")
|
||||
)
|
||||
.withCommands(ImmutableSet.of(createVertCommand(commandManager)))
|
||||
.optional()
|
||||
.build());
|
||||
|
@ -51,7 +51,6 @@ import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.util.TreeGenerator.TreeType;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import org.enginehub.piston.annotation.Command;
|
||||
@ -637,11 +636,14 @@ public class GenerationCommands {
|
||||
((AbstractExtentMask) mask).setExtent(editSession);
|
||||
}
|
||||
checkCommandArgument(minY >= editSession.getMinY(), Caption.of("fawe.error.outside-range-lower", "miny",
|
||||
editSession.getMinY()));
|
||||
editSession.getMinY()
|
||||
));
|
||||
checkCommandArgument(maxY <= editSession.getMaxY(), Caption.of("fawe.error.outside-range-upper", "maxy",
|
||||
editSession.getMaxY()));
|
||||
editSession.getMaxY()
|
||||
));
|
||||
checkCommandArgument(minY < maxY, Caption.of("fawe.error.argument-size-mismatch", "miny",
|
||||
"maxy"));
|
||||
"maxy"
|
||||
));
|
||||
editSession.addOre(region, mask, material, size, freq, rarity, minY, maxY);
|
||||
actor.print(Caption.of("fawe.worldedit.visitor.visitor.block", editSession.getBlockChangeCount()));
|
||||
}
|
||||
|
@ -147,8 +147,8 @@ class LegacySnapshotCommands {
|
||||
|
||||
if (snapshot == null) {
|
||||
actor.print(Caption.of(
|
||||
"worldedit.snapshot.none-before",
|
||||
TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date))
|
||||
"worldedit.snapshot.none-before",
|
||||
TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date))
|
||||
)
|
||||
);
|
||||
} else {
|
||||
@ -167,8 +167,8 @@ class LegacySnapshotCommands {
|
||||
Snapshot snapshot = config.snapshotRepo.getSnapshotAfter(date, world.getName());
|
||||
if (snapshot == null) {
|
||||
actor.print(Caption.of(
|
||||
"worldedit.snapshot.none-after",
|
||||
TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date))
|
||||
"worldedit.snapshot.none-after",
|
||||
TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date))
|
||||
)
|
||||
);
|
||||
} else {
|
||||
|
@ -320,10 +320,10 @@ public class RegionCommands {
|
||||
) throws WorldEditException {
|
||||
if (from == null) {
|
||||
from = new ExistingBlockMask(editSession);
|
||||
//FAWE start > the mask will have been initialised with a WorldWrapper extent (very bad/slow
|
||||
//FAWE start > the mask will have been initialised with a WorldWrapper extent (very bad/slow
|
||||
} else if (from instanceof AbstractExtentMask) {
|
||||
((AbstractExtentMask) from).setExtent(editSession);
|
||||
//FAWE end
|
||||
//FAWE end
|
||||
}
|
||||
if (from instanceof AbstractExtentMask) {
|
||||
((AbstractExtentMask) from).setExtent(editSession);
|
||||
|
@ -272,8 +272,8 @@ public class SnapshotCommands {
|
||||
|
||||
if (snapshot == null) {
|
||||
actor.print(Caption.of(
|
||||
"worldedit.snapshot.none-before",
|
||||
TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date))
|
||||
"worldedit.snapshot.none-before",
|
||||
TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date))
|
||||
)
|
||||
);
|
||||
} else {
|
||||
@ -314,8 +314,8 @@ public class SnapshotCommands {
|
||||
}
|
||||
if (snapshot == null) {
|
||||
actor.print(Caption.of(
|
||||
"worldedit.snapshot.none-after",
|
||||
TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date))
|
||||
"worldedit.snapshot.none-after",
|
||||
TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date))
|
||||
)
|
||||
);
|
||||
} else {
|
||||
|
@ -122,9 +122,9 @@ public class ToolCommands {
|
||||
.collect(Collectors.toSet());
|
||||
commandManager.register("tool", command -> {
|
||||
command.addPart(SubCommandPart.builder(
|
||||
Caption.of("tool"),
|
||||
TextComponent.of("The tool to bind")
|
||||
)
|
||||
Caption.of("tool"),
|
||||
TextComponent.of("The tool to bind")
|
||||
)
|
||||
.withCommands(nonGlobalCommands)
|
||||
.required()
|
||||
.build());
|
||||
|
@ -367,11 +367,13 @@ public class ToolUtilCommands {
|
||||
desc = "Set the brush transform"
|
||||
)
|
||||
@CommandPermissions({"worldedit.brush.options.transform", "worldedit.transform.brush"})
|
||||
public void transform(Player player, LocalSession session, EditSession editSession,
|
||||
@Arg(desc = "The transform", def = "") ResettableExtent transform,
|
||||
@Switch(name = 'h', desc = "Whether the offhand should be considered or not")
|
||||
boolean offHand,
|
||||
Arguments arguments) throws WorldEditException {
|
||||
public void transform(
|
||||
Player player, LocalSession session, EditSession editSession,
|
||||
@Arg(desc = "The transform", def = "") ResettableExtent transform,
|
||||
@Switch(name = 'h', desc = "Whether the offhand should be considered or not")
|
||||
boolean offHand,
|
||||
Arguments arguments
|
||||
) throws WorldEditException {
|
||||
BrushTool tool = session.getBrushTool(player, false);
|
||||
if (tool == null) {
|
||||
player.print(Caption.of("fawe.worldedit.brush.brush.none"));
|
||||
|
@ -414,7 +414,9 @@ public class UtilityCommands {
|
||||
size = Math.max(1, size);
|
||||
we.checkMaxRadius(size);
|
||||
|
||||
height = height != null ? Math.min((world.getMaxY() - world.getMinY() + 1), height + 1) : (world.getMaxY() - world.getMinY() + 1);
|
||||
height = height != null
|
||||
? Math.min((world.getMaxY() - world.getMinY() + 1), height + 1)
|
||||
: (world.getMaxY() - world.getMinY() + 1);
|
||||
int affected = editSession.removeAbove(session.getPlacementPosition(actor), size, height);
|
||||
actor.print(Caption.of("worldedit.removeabove.removed", TextComponent.of(affected)));
|
||||
return affected;
|
||||
@ -437,7 +439,9 @@ public class UtilityCommands {
|
||||
size = Math.max(1, size);
|
||||
we.checkMaxRadius(size);
|
||||
|
||||
height = height != null ? Math.min((world.getMaxY() - world.getMinY() + 1), height + 1) : (world.getMaxY() - world.getMinY() + 1);
|
||||
height = height != null
|
||||
? Math.min((world.getMaxY() - world.getMinY() + 1), height + 1)
|
||||
: (world.getMaxY() - world.getMinY() + 1);
|
||||
int affected = editSession.removeBelow(session.getPlacementPosition(actor), size, height);
|
||||
actor.print(Caption.of("worldedit.removebelow.removed", TextComponent.of(affected)));
|
||||
return affected;
|
||||
|
@ -30,11 +30,11 @@ public class BooleanConverter {
|
||||
commandManager.registerConverter(
|
||||
Key.of(Boolean.class),
|
||||
MultiKeyConverter.builder(
|
||||
ImmutableSetMultimap.<Boolean, String>builder()
|
||||
.putAll(false, "off", "f", "false", "n", "no")
|
||||
.putAll(true, "on", "t", "true", "y", "yes")
|
||||
.build()
|
||||
)
|
||||
ImmutableSetMultimap.<Boolean, String>builder()
|
||||
.putAll(false, "off", "f", "false", "n", "no")
|
||||
.putAll(true, "on", "t", "true", "y", "yes")
|
||||
.build()
|
||||
)
|
||||
.errorMessage(arg -> "Not a boolean value: " + arg)
|
||||
.build()
|
||||
);
|
||||
|
@ -60,6 +60,7 @@ public class FactoryConverter<T> implements ArgumentConverter<T> {
|
||||
private final String description;
|
||||
@Nullable
|
||||
private final Consumer<ParserContext> contextTweaker;
|
||||
|
||||
private FactoryConverter(
|
||||
WorldEdit worldEdit,
|
||||
Function<WorldEdit, AbstractFactory<T>> factoryExtractor,
|
||||
|
@ -34,12 +34,12 @@ public class RegionFactoryConverter {
|
||||
commandManager.registerConverter(
|
||||
Key.of(RegionFactory.class),
|
||||
MultiKeyConverter.builder(
|
||||
ImmutableSetMultimap.<RegionFactory, String>builder()
|
||||
.put(new CuboidRegionFactory(), "cuboid")
|
||||
.put(new SphereRegionFactory(), "sphere")
|
||||
.putAll(new CylinderRegionFactory(1), "cyl", "cylinder")
|
||||
.build()
|
||||
)
|
||||
ImmutableSetMultimap.<RegionFactory, String>builder()
|
||||
.put(new CuboidRegionFactory(), "cuboid")
|
||||
.put(new SphereRegionFactory(), "sphere")
|
||||
.putAll(new CylinderRegionFactory(1), "cyl", "cylinder")
|
||||
.build()
|
||||
)
|
||||
.errorMessage(arg -> "Not a known region type: " + arg)
|
||||
.build()
|
||||
);
|
||||
|
@ -53,17 +53,17 @@ public final class RegistryConverter<V extends Keyed> implements ArgumentConvert
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void register(CommandManager commandManager) {
|
||||
ImmutableList.of(
|
||||
BlockType.class,
|
||||
BlockCategory.class,
|
||||
ItemType.class,
|
||||
ItemCategory.class,
|
||||
BiomeType.class,
|
||||
EntityType.class,
|
||||
FluidType.class,
|
||||
FluidCategory.class,
|
||||
GameMode.class,
|
||||
WeatherType.class
|
||||
)
|
||||
BlockType.class,
|
||||
BlockCategory.class,
|
||||
ItemType.class,
|
||||
ItemCategory.class,
|
||||
BiomeType.class,
|
||||
EntityType.class,
|
||||
FluidType.class,
|
||||
FluidCategory.class,
|
||||
GameMode.class,
|
||||
WeatherType.class
|
||||
)
|
||||
.stream()
|
||||
.map(c -> (Class<Keyed>) c)
|
||||
.forEach(registryType ->
|
||||
|
@ -88,7 +88,8 @@ public class FloodFillTool implements BlockTool {
|
||||
Mask mask = initialType.toMask(editSession);
|
||||
BlockReplace function = new BlockReplace(editSession, pattern);
|
||||
RecursiveVisitor visitor = new RecursiveVisitor(mask, function, range, editSession.getMinY(),
|
||||
editSession.getMaxY(), editSession);
|
||||
editSession.getMaxY(), editSession
|
||||
);
|
||||
visitor.visit(origin);
|
||||
Operations.completeLegacy(visitor);
|
||||
//FAWE end
|
||||
|
@ -77,7 +77,7 @@ public class QueryTool implements BlockTool {
|
||||
}
|
||||
|
||||
builder.append(TextComponent.of(" (" + world.getBlockLightLevel(blockPoint) + "/"
|
||||
+ world.getBlockLightLevel(blockPoint.add(0, 1, 0)) + ")", TextColor.WHITE)
|
||||
+ world.getBlockLightLevel(blockPoint.add(0, 1, 0)) + ")", TextColor.WHITE)
|
||||
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, Caption.of("worldedit.tool.info.light.hover"))));
|
||||
|
||||
player.print(builder.build());
|
||||
|
@ -235,6 +235,7 @@ public final class SuggestionHelper {
|
||||
}
|
||||
|
||||
//FAWE start
|
||||
|
||||
/**
|
||||
* Returns a stream of suggestions for booleans.
|
||||
*
|
||||
|
Reference in New Issue
Block a user