Fixed shimmering rings
This commit is contained in:
parent
df563793c5
commit
f8566437d5
|
@ -5,7 +5,6 @@ import java.util.Map;
|
|||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
|
@ -70,9 +69,15 @@ public class ShimmeringRingKitSelector extends KitSelectorGadget
|
|||
|
||||
// Updates height and direction of particles
|
||||
double height = _circleHeight.get(entity);
|
||||
boolean up = (height == 0) || ((height == getEntityHeight(entity)) ? false : _direction.get(entity));
|
||||
_direction.put(entity, up);
|
||||
if (up)
|
||||
if (height <= 0)
|
||||
{
|
||||
_direction.put(entity, true);
|
||||
}
|
||||
else if (height >= getEntityHeight(entity))
|
||||
{
|
||||
_direction.put(entity, false);
|
||||
}
|
||||
if (_direction.get(entity))
|
||||
height += 0.1;
|
||||
else
|
||||
height -= 0.1;
|
||||
|
@ -90,8 +95,26 @@ public class ShimmeringRingKitSelector extends KitSelectorGadget
|
|||
|
||||
private double getEntityHeight(Entity entity)
|
||||
{
|
||||
net.minecraft.server.v1_8_R3.Entity nmsEntity = ((CraftEntity) entity).getHandle();
|
||||
return nmsEntity.getBoundingBox().e - nmsEntity.getBoundingBox().b;
|
||||
switch (entity.getType())
|
||||
{
|
||||
case SHEEP:
|
||||
case PIG:
|
||||
case BAT:
|
||||
case MAGMA_CUBE:
|
||||
case GUARDIAN:
|
||||
case CHICKEN:
|
||||
case SLIME:
|
||||
case SQUID:
|
||||
case WOLF:
|
||||
case OCELOT:
|
||||
return 0.75;
|
||||
case SPIDER:
|
||||
case CAVE_SPIDER:
|
||||
return 0.5;
|
||||
case ENDERMAN:
|
||||
return 3;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue