Updated Effect constants, removed incorrect/misleading SWIFTNESS constant

So what? I'd rather crash plugins than have them suddenly behave strangely because SWIFTNESS is now an alias for SPEED instead of HASTE.
This commit is contained in:
Dylan K. Taylor 2017-03-21 11:49:18 +00:00
parent 2d927db264
commit c21768df26
2 changed files with 5 additions and 5 deletions

View File

@ -33,14 +33,13 @@ use pocketmine\utils\Config;
class Effect{
const SPEED = 1;
const SLOWNESS = 2;
const HASTE = 3, SWIFTNESS = 3;
const HASTE = 3;
const FATIGUE = 4, MINING_FATIGUE = 4;
const STRENGTH = 5;
const INSTANT_HEALTH = 6, HEALING = 6;
const INSTANT_DAMAGE = 7, HARMING = 7;
const JUMP = 8;
const NAUSEA = 9;
const CONFUSION = 9;
const NAUSEA = 9, CONFUSION = 9;
const REGENERATION = 10;
const DAMAGE_RESISTANCE = 11;
const FIRE_RESISTANCE = 12;
@ -55,6 +54,7 @@ class Effect{
const HEALTH_BOOST = 21;
const ABSORPTION = 22; // TODO implement
const SATURATION = 23;
const LEVITATION = 24; //TODO
/** @var Effect[] */
protected static $effects = [];

View File

@ -1494,8 +1494,8 @@ class Level implements ChunkManager, Metadatable{
$breakTime = 0.15;
}
if($player->hasEffect(Effect::SWIFTNESS)){
$breakTime *= 1 - (0.2 * ($player->getEffect(Effect::SWIFTNESS)->getAmplifier() + 1));
if($player->hasEffect(Effect::HASTE)){
$breakTime *= 1 - (0.2 * ($player->getEffect(Effect::HASTE)->getAmplifier() + 1));
}
if($player->hasEffect(Effect::MINING_FATIGUE)){