mirror of
https://github.com/PryPurity/WorldBorder.git
synced 2024-09-27 03:52:37 +02:00
minor cleanup and formatting changes to last commit, and added +/- info to radius command help
This commit is contained in:
parent
dc1d125552
commit
2c02a33275
@ -19,7 +19,8 @@ public class CmdRadius extends WBCmd
|
||||
|
||||
addCmdExample(nameEmphasizedW() + "<radiusX> [radiusZ] - change radius.");
|
||||
helpText = "Using this command you can adjust the radius of an existing border. If [radiusZ] is not " +
|
||||
"specified, the radiusX value will be used for both.";
|
||||
"specified, the radiusX value will be used for both. You can also optionally specify + or - at the start " +
|
||||
"of <radiusX> and [radiusZ] to increase or decrease the existing radius rather than setting a new value.";
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -41,27 +42,36 @@ public class CmdRadius extends WBCmd
|
||||
int radiusZ;
|
||||
try
|
||||
{
|
||||
if (params.get(0).startsWith('+')){
|
||||
if (params.get(0).startsWith("+"))
|
||||
{
|
||||
// Add to the current radius
|
||||
radiusX = Config.getBorder(worldName).getRadiusX();
|
||||
radiusX = border.getRadiusX();
|
||||
radiusX += Integer.parseInt(params.get(0).substring(1));
|
||||
}else if(params.get(0).startsWith('-')){
|
||||
// Subtract from the current radius
|
||||
radiusX = Config.getBorder(worldName).getRadiusX();
|
||||
radiusX -= Integer.parseInt(params.get(0).substring(1));
|
||||
}else{
|
||||
radiusX = Integer.parseInt(params.get(0));
|
||||
}
|
||||
if (params.size() == 2)
|
||||
if (params.get(0).startsWith('+')){
|
||||
// Add to the current radius
|
||||
radiusZ = Config.getBorder(worldName).getRadiusZ();
|
||||
radiusZ += Integer.parseInt(params.get(1).substring(1));
|
||||
}else if(params.get(0).startsWith('-')){
|
||||
else if(params.get(0).startsWith("-"))
|
||||
{
|
||||
// Subtract from the current radius
|
||||
radiusZ = Config.getBorder(worldName).getRadiusZ();
|
||||
radiusX = border.getRadiusX();
|
||||
radiusX -= Integer.parseInt(params.get(0).substring(1));
|
||||
}
|
||||
else
|
||||
radiusX = Integer.parseInt(params.get(0));
|
||||
|
||||
if (params.size() == 2)
|
||||
{
|
||||
if (params.get(0).startsWith("+"))
|
||||
{
|
||||
// Add to the current radius
|
||||
radiusZ = border.getRadiusZ();
|
||||
radiusZ += Integer.parseInt(params.get(1).substring(1));
|
||||
}
|
||||
else if(params.get(0).startsWith("-"))
|
||||
{
|
||||
// Subtract from the current radius
|
||||
radiusZ = border.getRadiusZ();
|
||||
radiusZ -= Integer.parseInt(params.get(1).substring(1));
|
||||
}else{
|
||||
}
|
||||
else
|
||||
radiusZ = Integer.parseInt(params.get(1));
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user