mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-12 10:08:34 +00:00
@ -34,6 +34,7 @@ import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.command.argument.HeightConverter;
|
||||
import com.sk89q.worldedit.command.util.CommandPermissions;
|
||||
import com.sk89q.worldedit.command.util.CommandPermissionsConditionGenerator;
|
||||
import com.sk89q.worldedit.command.util.CreatureButcher;
|
||||
@ -54,10 +55,12 @@ import com.sk89q.worldedit.function.operation.Operations;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.function.visitor.EntityVisitor;
|
||||
import com.sk89q.worldedit.internal.annotation.Direction;
|
||||
import com.sk89q.worldedit.internal.annotation.VertHeight;
|
||||
import com.sk89q.worldedit.internal.expression.EvaluationException;
|
||||
import com.sk89q.worldedit.internal.expression.Expression;
|
||||
import com.sk89q.worldedit.internal.expression.ExpressionException;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector2;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.regions.CylinderRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
@ -464,6 +467,7 @@ public class UtilityCommands {
|
||||
return affected;
|
||||
}
|
||||
|
||||
|
||||
@Command(
|
||||
name = "snow",
|
||||
aliases = { "/snow" },
|
||||
@ -472,13 +476,27 @@ public class UtilityCommands {
|
||||
@CommandPermissions("worldedit.snow")
|
||||
@Logging(PLACEMENT)
|
||||
public int snow(Actor actor, LocalSession session, EditSession editSession,
|
||||
@Arg(desc = "The radius of the circle to snow in", def = "10")
|
||||
double size) throws WorldEditException {
|
||||
@Arg(desc = "The radius of the cylinder to snow in", def = "10")
|
||||
double size,
|
||||
@Arg(
|
||||
desc = "The height of the cylinder to snow in",
|
||||
def = HeightConverter.DEFAULT_VALUE
|
||||
)
|
||||
@VertHeight
|
||||
int height,
|
||||
@Switch(name = 's', desc = "Stack snow layers")
|
||||
boolean stack) throws WorldEditException {
|
||||
size = Math.max(1, size);
|
||||
height = Math.max(1, height);
|
||||
we.checkMaxRadius(size);
|
||||
|
||||
int affected = editSession.simulateSnow(session.getPlacementPosition(actor), size);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.snow.created", TextComponent.of(affected)));
|
||||
BlockVector3 position = session.getPlacementPosition(actor);
|
||||
|
||||
CylinderRegion region = new CylinderRegion(position, Vector2.at(size, size), position.getBlockY() - height, position.getBlockY() + height);
|
||||
int affected = editSession.simulateSnow(region, stack);
|
||||
actor.printInfo(TranslatableComponent.of(
|
||||
"worldedit.snow.created", TextComponent.of(affected)
|
||||
));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -490,13 +508,22 @@ public class UtilityCommands {
|
||||
@CommandPermissions("worldedit.thaw")
|
||||
@Logging(PLACEMENT)
|
||||
public int thaw(Actor actor, LocalSession session, EditSession editSession,
|
||||
@Arg(desc = "The radius of the circle to thaw in", def = "10")
|
||||
double size) throws WorldEditException {
|
||||
@Arg(desc = "The radius of the cylinder to thaw in", def = "10")
|
||||
double size,
|
||||
@Arg(
|
||||
desc = "The height of the cylinder to thaw in",
|
||||
def = HeightConverter.DEFAULT_VALUE
|
||||
)
|
||||
@VertHeight
|
||||
int height) throws WorldEditException {
|
||||
size = Math.max(1, size);
|
||||
height = Math.max(1, height);
|
||||
we.checkMaxRadius(size);
|
||||
|
||||
int affected = editSession.thaw(session.getPlacementPosition(actor), size);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.thaw.removed", TextComponent.of(affected)));
|
||||
int affected = editSession.thaw(session.getPlacementPosition(actor), size, height);
|
||||
actor.printInfo(TranslatableComponent.of(
|
||||
"worldedit.thaw.removed", TextComponent.of(affected)
|
||||
));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -508,16 +535,27 @@ public class UtilityCommands {
|
||||
@CommandPermissions("worldedit.green")
|
||||
@Logging(PLACEMENT)
|
||||
public int green(Actor actor, LocalSession session, EditSession editSession,
|
||||
@Arg(desc = "The radius of the circle to convert in", def = "10")
|
||||
@Arg(desc = "The radius of the cylinder to convert in", def = "10")
|
||||
double size,
|
||||
@Arg(
|
||||
desc = "The height of the cylinder to convert in",
|
||||
def = HeightConverter.DEFAULT_VALUE
|
||||
)
|
||||
@VertHeight
|
||||
int height,
|
||||
@Switch(name = 'f', desc = "Also convert coarse dirt")
|
||||
boolean convertCoarse) throws WorldEditException {
|
||||
size = Math.max(1, size);
|
||||
height = Math.max(1, height);
|
||||
we.checkMaxRadius(size);
|
||||
final boolean onlyNormalDirt = !convertCoarse;
|
||||
|
||||
final int affected = editSession.green(session.getPlacementPosition(actor), size, onlyNormalDirt);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.green.changed", TextComponent.of(affected)));
|
||||
final int affected = editSession.green(
|
||||
session.getPlacementPosition(actor), size, height, onlyNormalDirt
|
||||
);
|
||||
actor.printInfo(TranslatableComponent.of(
|
||||
"worldedit.green.changed", TextComponent.of(affected)
|
||||
));
|
||||
return affected;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user