Allow knockback to be set to 0, for the rare person that might for whatever reason want to disable border knockback

This commit is contained in:
Brettflan 2012-11-04 15:07:41 -06:00
parent 9fd230a218
commit 470b19160d
2 changed files with 7 additions and 3 deletions

View File

@ -134,6 +134,10 @@ public class BorderData
public Location correctedPosition(Location loc, boolean round)
{
// if knockback is set to 0, simply return
if (Config.KnockBack() == 0.0)
return loc;
// if this border has a shape override set, use it
if (shapeRound != null)
round = shapeRound.booleanValue();

View File

@ -354,13 +354,13 @@ public class WBCommand implements CommandExecutor
}
catch(NumberFormatException ex)
{
sender.sendMessage(clrErr + "The knockback must be a decimal value of at least 1.0.");
sender.sendMessage(clrErr + "The knockback must be a decimal value of at least 1.0, or it can be 0.");
return true;
}
if (numBlocks < 1.0)
if (numBlocks < 0.0 || (numBlocks > 0.0 && numBlocks < 1.0))
{
sender.sendMessage(clrErr + "The knockback must be a decimal value of at least 1.0.");
sender.sendMessage(clrErr + "The knockback must be a decimal value of at least 1.0, or it can be 0.");
return true;
}