Uncomment SleighHorse

This commit is contained in:
libraryaddict 2014-12-11 15:24:10 +13:00
parent 6b1fa91565
commit 3a8ab0afb0

View File

@ -74,110 +74,110 @@ public class SleighHorse
public void onTick() public void onTick()
{ {
// EntityTrackerEntry entityTrackerEntry = (EntityTrackerEntry) ((CraftWorld) Ent.getWorld()).getHandle().tracker.trackedEntities EntityTrackerEntry entityTrackerEntry = (EntityTrackerEntry) ((CraftWorld) Ent.getWorld()).getHandle().tracker.trackedEntities
// .get(Ent.getEntityId()); .get(Ent.getEntityId());
// if (entityTrackerEntry != null) if (entityTrackerEntry != null)
// { {
// Location newLocation = Ent.getLocation().add(0, 0.5, 0); Location newLocation = Ent.getLocation().add(0, 0.5, 0);
// newLocation.setPitch(_lastFacing.getPitch()); newLocation.setPitch(_lastFacing.getPitch());
//
// if (!newLocation.equals(_lastFacing)) if (!newLocation.equals(_lastFacing))
// { {
// Packet[] packets1_8 = new Packet[2]; Packet[] packets1_8 = new Packet[2];
// _lastMovement.add(new Vector(newLocation.getX() - _lastFacing.getX(), newLocation.getY() - _lastFacing.getY(), _lastMovement.add(new Vector(newLocation.getX() - _lastFacing.getX(), newLocation.getY() - _lastFacing.getY(),
// newLocation.getZ() - _lastFacing.getZ())); newLocation.getZ() - _lastFacing.getZ()));
// final int xP = (int) Math.floor(32 * _lastMovement.getX()); final int xP = (int) Math.floor(32 * _lastMovement.getX());
// final int yP = (int) Math.floor(32 * _lastMovement.getY()); final int yP = (int) Math.floor(32 * _lastMovement.getY());
// final int zP = (int) Math.floor(32 * _lastMovement.getZ()); final int zP = (int) Math.floor(32 * _lastMovement.getZ());
// _lastMovement.subtract(new Vector(xP / 32D, yP / 32D, zP / 32D)); _lastMovement.subtract(new Vector(xP / 32D, yP / 32D, zP / 32D));
// _lastFacing = newLocation; _lastFacing = newLocation;
// int[] angles = getAngles(_lastFacing.getYaw()); int[] angles = getAngles(_lastFacing.getYaw());
// boolean tp = false; boolean tp = false;
// for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
// { {
// int pX = angles[i * 2] - _previousDir[i * 2]; int pX = angles[i * 2] - _previousDir[i * 2];
// int pZ = angles[(i * 2) + 1] - _previousDir[(i * 2) + 1]; int pZ = angles[(i * 2) + 1] - _previousDir[(i * 2) + 1];
// int x = xP + pX; int x = xP + pX;
// int y = yP; int y = yP;
// int z = zP + pZ; int z = zP + pZ;
// if (x >= -128 && x <= 127 && y >= -128 && y <= 127 && z >= -128 && z <= 127) if (x >= -128 && x <= 127 && y >= -128 && y <= 127 && z >= -128 && z <= 127)
// { {
// PacketPlayOutEntity relMove = pX != 0 || pZ != 0 ? new PacketPlayOutRelEntityMoveLook() PacketPlayOutEntity relMove = pX != 0 || pZ != 0 ? new PacketPlayOutRelEntityMoveLook()
// : new PacketPlayOutRelEntityMove(); : new PacketPlayOutRelEntityMove();
// relMove.a = hornsAndNose[i]; relMove.a = hornsAndNose[i];
// relMove.b = (byte) x; relMove.b = (byte) x;
// relMove.c = (byte) y; relMove.c = (byte) y;
// relMove.d = (byte) z; relMove.d = (byte) z;
// relMove.e = ((byte) (int) (newLocation.getYaw() * 256.0F / 360.0F)); relMove.e = ((byte) (int) (newLocation.getYaw() * 256.0F / 360.0F));
// packets1_8[i] = relMove; packets1_8[i] = relMove;
// } }
// else else
// { {
// x = (int) Math.floor(32 * newLocation.getX()); x = (int) Math.floor(32 * newLocation.getX());
// y = (int) Math.floor(32 * newLocation.getY()); y = (int) Math.floor(32 * newLocation.getY());
// z = (int) Math.floor(32 * newLocation.getZ()); z = (int) Math.floor(32 * newLocation.getZ());
// tp = true; tp = true;
// PacketPlayOutEntityTeleport teleportPacket = new PacketPlayOutEntityTeleport(); PacketPlayOutEntityTeleport teleportPacket = new PacketPlayOutEntityTeleport();
// teleportPacket.a = hornsAndNose[i]; teleportPacket.a = hornsAndNose[i];
// teleportPacket.b = x + pX; teleportPacket.b = x + pX;
// teleportPacket.c = y; teleportPacket.c = y;
// teleportPacket.d = z + pZ; teleportPacket.d = z + pZ;
// teleportPacket.e = ((byte) (int) (newLocation.getYaw() * 256.0F / 360.0F)); teleportPacket.e = ((byte) (int) (newLocation.getYaw() * 256.0F / 360.0F));
// packets1_8[i] = teleportPacket; packets1_8[i] = teleportPacket;
// } }
// } }
// if (tp) if (tp)
// { {
// int x = (int) Math.floor(32 * newLocation.getX()); int x = (int) Math.floor(32 * newLocation.getX());
// int y = (int) Math.floor(32 * newLocation.getY()); int y = (int) Math.floor(32 * newLocation.getY());
// int z = (int) Math.floor(32 * newLocation.getZ()); int z = (int) Math.floor(32 * newLocation.getZ());
// _lastMovement = new Vector(newLocation.getX() - (x / 32D), newLocation.getY() - (y / 32D), newLocation.getZ() _lastMovement = new Vector(newLocation.getX() - (x / 32D), newLocation.getY() - (y / 32D), newLocation.getZ()
// - (z / 32D)); - (z / 32D));
// } }
// _previousDir = angles; _previousDir = angles;
// HashSet trackedPlayers = (HashSet) entityTrackerEntry.trackedPlayers; HashSet trackedPlayers = (HashSet) entityTrackerEntry.trackedPlayers;
// HashSet<EntityPlayer> cloned = (HashSet) trackedPlayers.clone(); HashSet<EntityPlayer> cloned = (HashSet) trackedPlayers.clone();
// for (EntityPlayer p : cloned) for (EntityPlayer p : cloned)
// { {
// if (!UtilPlayer.is1_8(p.getBukkitEntity())) if (!UtilPlayer.is1_8(p.getBukkitEntity()))
// continue; continue;
// for (Packet packet : packets1_8) for (Packet packet : packets1_8)
// { {
// p.playerConnection.sendPacket(packet); p.playerConnection.sendPacket(packet);
// } }
// } }
// } }
// } }
} }
public void spawnHorns(Player player) public void spawnHorns(Player player)
{ {
// if (!UtilPlayer.is1_8(player)) if (!UtilPlayer.is1_8(player))
// return; return;
// Location loc = Ent == null ? _lastFacing : Ent.getLocation().add(0, 0.5, 0); Location loc = Ent == null ? _lastFacing : Ent.getLocation().add(0, 0.5, 0);
// for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
// { {
// int id = hornsAndNose[i]; int id = hornsAndNose[i];
// PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving(); PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving();
// packet.a = id; packet.a = id;
// packet.b = 30; packet.b = 30;
// packet.c = (int) (loc.getX() * 32) + this._previousDir[i * 2]; packet.c = (int) (loc.getX() * 32) + this._previousDir[i * 2];
// packet.d = (int) (loc.getY() * 32); packet.d = (int) (loc.getY() * 32);
// packet.e = (int) (loc.getZ() * 32) + this._previousDir[(i * 2) + 1]; packet.e = (int) (loc.getZ() * 32) + this._previousDir[(i * 2) + 1];
// packet.f = ((byte) (int) (loc.getYaw() * 256.0F / 360.0F)); packet.f = ((byte) (int) (loc.getYaw() * 256.0F / 360.0F));
// // Setup datawatcher for armor stand // Setup datawatcher for armor stand
// DataWatcher watcher = new DataWatcher(null); DataWatcher watcher = new DataWatcher(null);
// watcher.a(0, (byte) 32); watcher.a(0, (byte) 32);
// watcher.a(10, (byte) 4); watcher.a(10, (byte) 4);
// watcher.a(11, new Vector(0, i * 180, (i == 0 ? -1 : 1) * 60f)); watcher.a(11, new Vector(0, i * 180, (i == 0 ? -1 : 1) * 60f));
// packet.l = watcher; packet.l = watcher;
// PacketPlayOutEntityEquipment enquipPacket = new PacketPlayOutEntityEquipment(); PacketPlayOutEntityEquipment enquipPacket = new PacketPlayOutEntityEquipment();
// enquipPacket.a = id; enquipPacket.a = id;
// enquipPacket.b = 4; enquipPacket.b = 4;
// enquipPacket.c = CraftItemStack.asNMSCopy(new ItemStack(Material.DEAD_BUSH)); enquipPacket.c = CraftItemStack.asNMSCopy(new ItemStack(Material.DEAD_BUSH));
// ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
// ((CraftPlayer) player).getHandle().playerConnection.sendPacket(enquipPacket); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(enquipPacket);
// } }
} }
public void spawnHorse() public void spawnHorse()