geforkt von Mirrors/FastAsyncWorldEdit
Add radius checks to a few more utility commands.
Dieser Commit ist enthalten in:
Ursprung
90797d12f4
Commit
9eeb0acffe
@ -275,6 +275,7 @@ public class UtilityCommands {
|
|||||||
public void replaceNear(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException {
|
public void replaceNear(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException {
|
||||||
|
|
||||||
int size = Math.max(1, args.getInteger(0));
|
int size = Math.max(1, args.getInteger(0));
|
||||||
|
we.checkMaxRadius(size);
|
||||||
int affected;
|
int affected;
|
||||||
Set<BaseBlock> from;
|
Set<BaseBlock> from;
|
||||||
Pattern to;
|
Pattern to;
|
||||||
@ -288,9 +289,11 @@ public class UtilityCommands {
|
|||||||
|
|
||||||
if (args.argsLength() == 2) {
|
if (args.argsLength() == 2) {
|
||||||
from = null;
|
from = null;
|
||||||
|
context.setRestricted(true);
|
||||||
to = we.getPatternFactory().parseFromInput(args.getString(1), context);
|
to = we.getPatternFactory().parseFromInput(args.getString(1), context);
|
||||||
} else {
|
} else {
|
||||||
from = we.getBlockFactory().parseFromListInput(args.getString(1), context);
|
from = we.getBlockFactory().parseFromListInput(args.getString(1), context);
|
||||||
|
context.setRestricted(true);
|
||||||
to = we.getPatternFactory().parseFromInput(args.getString(2), context);
|
to = we.getPatternFactory().parseFromInput(args.getString(2), context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -317,8 +320,8 @@ public class UtilityCommands {
|
|||||||
@CommandPermissions("worldedit.snow")
|
@CommandPermissions("worldedit.snow")
|
||||||
@Logging(PLACEMENT)
|
@Logging(PLACEMENT)
|
||||||
public void snow(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException {
|
public void snow(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException {
|
||||||
|
|
||||||
double size = args.argsLength() > 0 ? Math.max(1, args.getDouble(0)) : 10;
|
double size = args.argsLength() > 0 ? Math.max(1, args.getDouble(0)) : 10;
|
||||||
|
we.checkMaxRadius(size);
|
||||||
|
|
||||||
int affected = editSession.simulateSnow(session.getPlacementPosition(player), size);
|
int affected = editSession.simulateSnow(session.getPlacementPosition(player), size);
|
||||||
player.print(affected + " surfaces covered. Let it snow~");
|
player.print(affected + " surfaces covered. Let it snow~");
|
||||||
@ -334,8 +337,8 @@ public class UtilityCommands {
|
|||||||
@CommandPermissions("worldedit.thaw")
|
@CommandPermissions("worldedit.thaw")
|
||||||
@Logging(PLACEMENT)
|
@Logging(PLACEMENT)
|
||||||
public void thaw(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException {
|
public void thaw(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException {
|
||||||
|
|
||||||
double size = args.argsLength() > 0 ? Math.max(1, args.getDouble(0)) : 10;
|
double size = args.argsLength() > 0 ? Math.max(1, args.getDouble(0)) : 10;
|
||||||
|
we.checkMaxRadius(size);
|
||||||
|
|
||||||
int affected = editSession.thaw(session.getPlacementPosition(player), size);
|
int affected = editSession.thaw(session.getPlacementPosition(player), size);
|
||||||
player.print(affected + " surfaces thawed.");
|
player.print(affected + " surfaces thawed.");
|
||||||
@ -345,6 +348,7 @@ public class UtilityCommands {
|
|||||||
aliases = { "/green", "green" },
|
aliases = { "/green", "green" },
|
||||||
usage = "[radius]",
|
usage = "[radius]",
|
||||||
desc = "Greens the area",
|
desc = "Greens the area",
|
||||||
|
help = "Converts dirt to grass blocks. -f also converts coarse dirt.",
|
||||||
flags = "f",
|
flags = "f",
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 1
|
max = 1
|
||||||
@ -352,8 +356,8 @@ public class UtilityCommands {
|
|||||||
@CommandPermissions("worldedit.green")
|
@CommandPermissions("worldedit.green")
|
||||||
@Logging(PLACEMENT)
|
@Logging(PLACEMENT)
|
||||||
public void green(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException {
|
public void green(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException {
|
||||||
|
|
||||||
final double size = args.argsLength() > 0 ? Math.max(1, args.getDouble(0)) : 10;
|
final double size = args.argsLength() > 0 ? Math.max(1, args.getDouble(0)) : 10;
|
||||||
|
we.checkMaxRadius(size);
|
||||||
final boolean onlyNormalDirt = !args.hasFlag('f');
|
final boolean onlyNormalDirt = !args.hasFlag('f');
|
||||||
|
|
||||||
final int affected = editSession.green(session.getPlacementPosition(player), size, onlyNormalDirt);
|
final int affected = editSession.green(session.getPlacementPosition(player), size, onlyNormalDirt);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren