Fixed effect amplifier overflow crash, close #147 (#191)

This commit is contained in:
Dylan K. Taylor
2016-12-27 21:30:54 +00:00
committed by GitHub
parent 942b35ee4c
commit 10c8632417
3 changed files with 12 additions and 3 deletions

View File

@@ -90,6 +90,13 @@ class EffectCommand extends VanillaCommand{
if(count($args) >= 4){
$amplification = (int) $args[3];
if($amplification > 255){
$sender->sendMessage(new TranslationContainer(TextFormat::RED . "%commands.generic.num.tooBig", [(string) $args[3], "255"]));
return true;
}elseif($amplification < 0){
$sender->sendMessage(new TranslationContainer(TextFormat::RED . "%commands.generic.num.tooSmall", [(string) $args[3], "0"]));
return true;
}
}
if(count($args) >= 5){