mirror of
https://github.com/PryPurity/WorldBorder.git
synced 2024-09-27 03:52:37 +02:00
Merge pull request #36 from Maximvdw/patch-1
Added + and - before radius as an optional char
This commit is contained in:
commit
dc1d125552
@ -41,9 +41,29 @@ public class CmdRadius extends WBCmd
|
|||||||
int radiusZ;
|
int radiusZ;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
radiusX = Integer.parseInt(params.get(0));
|
if (params.get(0).startsWith('+')){
|
||||||
|
// Add to the current radius
|
||||||
|
radiusX = Config.getBorder(worldName).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.size() == 2)
|
||||||
radiusZ = Integer.parseInt(params.get(1));
|
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('-')){
|
||||||
|
// Subtract from the current radius
|
||||||
|
radiusZ = Config.getBorder(worldName).getRadiusZ();
|
||||||
|
radiusZ -= Integer.parseInt(params.get(1).substring(1));
|
||||||
|
}else{
|
||||||
|
radiusZ = Integer.parseInt(params.get(1));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
radiusZ = radiusX;
|
radiusZ = radiusX;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user