Let exp orbs be a little bit nicer

This commit is contained in:
Andrew 2013-08-20 05:45:25 +12:00
parent 505f996b46
commit 9b4e9b4b62
2 changed files with 47 additions and 42 deletions

View File

@ -129,7 +129,6 @@ public class Disguise {
fallSpeed = 0; fallSpeed = 0;
break; break;
case DROPPED_ITEM: case DROPPED_ITEM:
case EXPERIENCE_ORB:
case MAGMA_CUBE: case MAGMA_CUBE:
case PRIMED_TNT: case PRIMED_TNT:
fallSpeed = 0.2; fallSpeed = 0.2;
@ -139,6 +138,10 @@ public class Disguise {
case FALLING_BLOCK: case FALLING_BLOCK:
fallSpeed = 0.04; fallSpeed = 0.04;
break; break;
case EXPERIENCE_ORB:
fallSpeed = 0.0221;
movement = true;
break;
case SPIDER: case SPIDER:
case CAVE_SPIDER: case CAVE_SPIDER:
fallSpeed = 0.0040; fallSpeed = 0.0040;
@ -178,6 +181,7 @@ public class Disguise {
if (vector.getY() != 0 && !(vector.getY() < 0 && alwaysSendVelocity && entity.isOnGround())) { if (vector.getY() != 0 && !(vector.getY() < 0 && alwaysSendVelocity && entity.isOnGround())) {
return; return;
} }
if (getType() != DisguiseType.EXPERIENCE_ORB || !entity.isOnGround()) {
PacketContainer lookPacket = null; PacketContainer lookPacket = null;
PacketContainer selfLookPacket = null; PacketContainer selfLookPacket = null;
if (getType() == DisguiseType.WITHER_SKULL) { if (getType() == DisguiseType.WITHER_SKULL) {
@ -214,13 +218,15 @@ public class Disguise {
mods.write(3, (int) (vector.getZ() * 8000)); mods.write(3, (int) (vector.getZ() * 8000));
try { try {
if (lookPacket != null) if (lookPacket != null)
ProtocolLibrary.getProtocolManager().sendServerPacket(player.getBukkitEntity(), lookPacket, ProtocolLibrary.getProtocolManager().sendServerPacket(player.getBukkitEntity(),
false); lookPacket, false);
ProtocolLibrary.getProtocolManager().sendServerPacket(player.getBukkitEntity(), packet, false); ProtocolLibrary.getProtocolManager()
.sendServerPacket(player.getBukkitEntity(), packet, false);
} catch (InvocationTargetException e) { } catch (InvocationTargetException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
}
// If we need to send more packets because else it still 'sinks' // If we need to send more packets because else it still 'sinks'
if (sendMovementPacket) { if (sendMovementPacket) {
PacketContainer packet = new PacketContainer(Packets.Server.REL_ENTITY_MOVE); PacketContainer packet = new PacketContainer(Packets.Server.REL_ENTITY_MOVE);

View File

@ -380,7 +380,6 @@ public class PacketsManager {
case EGG: case EGG:
case ENDER_PEARL: case ENDER_PEARL:
case ENDER_SIGNAL: case ENDER_SIGNAL:
case EXPERIENCE_ORB:
case FIREWORK: case FIREWORK:
case MINECART: case MINECART:
case MINECART_CHEST: case MINECART_CHEST: