Update for 1.7 spigot hack

This commit is contained in:
Andrew 2013-11-11 10:13:44 +13:00
parent e537fb8923
commit 962bbece37
2 changed files with 8 additions and 9 deletions

View File

@ -10,8 +10,6 @@ import me.libraryaddict.disguise.disguisetypes.DisguiseType;
import me.libraryaddict.disguise.disguisetypes.MiscDisguise;
import me.libraryaddict.disguise.disguisetypes.MobDisguise;
import me.libraryaddict.disguise.disguisetypes.PlayerDisguise;
import me.libraryaddict.disguise.disguisetypes.watchers.DroppedItemWatcher;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;

View File

@ -220,19 +220,20 @@ public class PacketsManager {
StructureModifier<Object> mods = spawnPackets[0].getModifier();
mods.write(0, disguisedEntity.getEntityId());
mods.write(1, ((PlayerDisguise) disguise).getName());
mods.write(2, (int) Math.floor(loc.getX() * 32));
mods.write(3, (int) Math.floor(loc.getY() * 32));
mods.write(4, (int) Math.floor(loc.getZ() * 32));
mods.write(5, yaw);
mods.write(6, (byte) (int) (loc.getPitch() * 256F / 360F));
mods.write(2, ((PlayerDisguise) disguise).getName());
mods.write(3, (int) Math.floor(loc.getX() * 32));
mods.write(4, (int) Math.floor(loc.getY() * 32));
mods.write(5, (int) Math.floor(loc.getZ() * 32));
mods.write(6, yaw);
mods.write(7, (byte) (int) (loc.getPitch() * 256F / 360F));
ItemStack item = null;
if (disguisedEntity instanceof Player && ((Player) disguisedEntity).getItemInHand() != null) {
item = CraftItemStack.asNMSCopy(((Player) disguisedEntity).getItemInHand());
} else if (disguisedEntity instanceof LivingEntity) {
item = CraftItemStack.asNMSCopy(((CraftLivingEntity) disguisedEntity).getEquipment().getItemInHand());
}
mods.write(7, (item == null ? 0 : item.id));
mods.write(8, createDataWatcher(nmsEntity.getDataWatcher(), disguise.getWatcher()));
mods.write(8, (item == null ? 0 : item.id));
mods.write(9, createDataWatcher(nmsEntity.getDataWatcher(), disguise.getWatcher()));
} else if (disguise.getType().isMob()) {