mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-01-03 14:57:37 +00:00
Add missing radius checks.
Courtesy @mathiascode.
This commit is contained in:
parent
8880385878
commit
6ab74dc7e5
@ -205,6 +205,7 @@ public class GenerationCommands {
|
|||||||
@Arg(desc = "The density of the forest, between 0 and 100", def = "5")
|
@Arg(desc = "The density of the forest, between 0 and 100", def = "5")
|
||||||
double density) throws WorldEditException {
|
double density) throws WorldEditException {
|
||||||
checkCommandArgument(0 <= density && density <= 100, "Density must be between 0 and 100");
|
checkCommandArgument(0 <= density && density <= 100, "Density must be between 0 and 100");
|
||||||
|
worldEdit.checkMaxRadius(size);
|
||||||
density /= 100;
|
density /= 100;
|
||||||
int affected = editSession.makeForest(session.getPlacementPosition(player), size, density, type);
|
int affected = editSession.makeForest(session.getPlacementPosition(player), size, density, type);
|
||||||
player.print(affected + " trees created.");
|
player.print(affected + " trees created.");
|
||||||
@ -220,6 +221,7 @@ public class GenerationCommands {
|
|||||||
public int pumpkins(Player player, LocalSession session, EditSession editSession,
|
public int pumpkins(Player player, LocalSession session, EditSession editSession,
|
||||||
@Arg(desc = "The size of the patch", def = "10")
|
@Arg(desc = "The size of the patch", def = "10")
|
||||||
int size) throws WorldEditException {
|
int size) throws WorldEditException {
|
||||||
|
worldEdit.checkMaxRadius(size);
|
||||||
int affected = editSession.makePumpkinPatches(session.getPlacementPosition(player), size);
|
int affected = editSession.makePumpkinPatches(session.getPlacementPosition(player), size);
|
||||||
player.print(affected + " pumpkin patches created.");
|
player.print(affected + " pumpkin patches created.");
|
||||||
return affected;
|
return affected;
|
||||||
@ -252,8 +254,8 @@ public class GenerationCommands {
|
|||||||
int size,
|
int size,
|
||||||
@Switch(name = 'h', desc = "Make a hollow pyramid")
|
@Switch(name = 'h', desc = "Make a hollow pyramid")
|
||||||
boolean hollow) throws WorldEditException {
|
boolean hollow) throws WorldEditException {
|
||||||
BlockVector3 pos = session.getPlacementPosition(player);
|
|
||||||
worldEdit.checkMaxRadius(size);
|
worldEdit.checkMaxRadius(size);
|
||||||
|
BlockVector3 pos = session.getPlacementPosition(player);
|
||||||
int affected = editSession.makePyramid(pos, pattern, size, !hollow);
|
int affected = editSession.makePyramid(pos, pattern, size, !hollow);
|
||||||
player.findFreePosition();
|
player.findFreePosition();
|
||||||
player.print(affected + " block(s) have been created.");
|
player.print(affected + " block(s) have been created.");
|
||||||
|
Loading…
Reference in New Issue
Block a user