diff --git a/src/me/libraryaddict/disguise/Commands/DisguiseCommand.java b/src/me/libraryaddict/disguise/Commands/DisguiseCommand.java index 10134e79..e623d19a 100644 --- a/src/me/libraryaddict/disguise/Commands/DisguiseCommand.java +++ b/src/me/libraryaddict/disguise/Commands/DisguiseCommand.java @@ -90,7 +90,7 @@ public class DisguiseCommand implements CommandExecutor { + " isn't true or false!"); return true; } - adult = args[1].equalsIgnoreCase("false"); + adult = args[1].equalsIgnoreCase("false"); // Adult = !arg } disguise = new MobDisguise(disguiseType, adult); } else if (disguiseType.isMisc()) { diff --git a/src/me/libraryaddict/disguise/Commands/DisguiseEntityCommand.java b/src/me/libraryaddict/disguise/Commands/DisguiseEntityCommand.java index 491a1700..ddf4a0c0 100644 --- a/src/me/libraryaddict/disguise/Commands/DisguiseEntityCommand.java +++ b/src/me/libraryaddict/disguise/Commands/DisguiseEntityCommand.java @@ -95,7 +95,7 @@ public class DisguiseEntityCommand implements CommandExecutor { + " isn't true or false!"); return true; } - adult = args[1].equalsIgnoreCase("false"); + adult = args[1].equalsIgnoreCase("false"); // Adult = !arg } disguise = new MobDisguise(disguiseType, adult); } else if (disguiseType.isMisc()) { diff --git a/src/me/libraryaddict/disguise/Commands/DisguisePlayerCommand.java b/src/me/libraryaddict/disguise/Commands/DisguisePlayerCommand.java index dab09a92..dae7ed6d 100644 --- a/src/me/libraryaddict/disguise/Commands/DisguisePlayerCommand.java +++ b/src/me/libraryaddict/disguise/Commands/DisguisePlayerCommand.java @@ -96,7 +96,7 @@ public class DisguisePlayerCommand implements CommandExecutor { + " isn't true or false!"); return true; } - adult = args[1].equalsIgnoreCase("false"); + adult = args[2].equalsIgnoreCase("false"); // Adult = !arg } disguise = new MobDisguise(disguiseType, adult); } else if (disguiseType.isMisc()) { diff --git a/src/me/libraryaddict/disguise/Commands/DisguiseRadiusCommand.java b/src/me/libraryaddict/disguise/Commands/DisguiseRadiusCommand.java index 34b15a12..acc7a098 100644 --- a/src/me/libraryaddict/disguise/Commands/DisguiseRadiusCommand.java +++ b/src/me/libraryaddict/disguise/Commands/DisguiseRadiusCommand.java @@ -104,7 +104,7 @@ public class DisguiseRadiusCommand implements CommandExecutor { + " isn't true or false!"); return true; } - adult = args[1].equalsIgnoreCase("false"); + adult = args[2].equalsIgnoreCase("false"); // Adult = !arg } disguise = new MobDisguise(disguiseType, adult); } else if (disguiseType.isMisc()) { diff --git a/src/me/libraryaddict/disguise/DisguiseTypes/Values.java b/src/me/libraryaddict/disguise/DisguiseTypes/Values.java index 12f0a3ae..be17d367 100644 --- a/src/me/libraryaddict/disguise/DisguiseTypes/Values.java +++ b/src/me/libraryaddict/disguise/DisguiseTypes/Values.java @@ -40,9 +40,11 @@ public class Values { values.put(type, this); declared = classType; } + public HashMap getAttributesValues() { return attributesValues; } + public Class getEntityClass() { return declared; } diff --git a/src/me/libraryaddict/disguise/LibsDisguises.java b/src/me/libraryaddict/disguise/LibsDisguises.java index 1dca2356..26df1032 100644 --- a/src/me/libraryaddict/disguise/LibsDisguises.java +++ b/src/me/libraryaddict/disguise/LibsDisguises.java @@ -6,10 +6,7 @@ import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; -import me.libraryaddict.disguise.Commands.DisguiseCommand; -import me.libraryaddict.disguise.Commands.DisguisePlayerCommand; -import me.libraryaddict.disguise.Commands.UndisguiseCommand; -import me.libraryaddict.disguise.Commands.UndisguisePlayerCommand; +import me.libraryaddict.disguise.Commands.*; import me.libraryaddict.disguise.DisguiseTypes.Disguise; import me.libraryaddict.disguise.DisguiseTypes.DisguiseType; import me.libraryaddict.disguise.DisguiseTypes.PlayerDisguise; @@ -131,7 +128,6 @@ public class LibsDisguises extends JavaPlugin implements Listener { StructureModifier mods = event.getPacket().getModifier(); String name = (String) mods.read(1); if (!name.equals(((PlayerDisguise) disguise).getName())) { - // manager.sendServerPacket(observer, disguise.constructDestroyPacket(entity.getEntityId())); final PacketContainer[] packets = disguise.constructPacket(entity); event.setPacket(packets[0]); if (packets.length > 1) { @@ -147,7 +143,6 @@ public class LibsDisguises extends JavaPlugin implements Listener { } } } else { - // manager.sendServerPacket(observer, disguise.constructDestroyPacket(entity.getEntityId())); final PacketContainer[] packets = disguise.constructPacket(entity); event.setPacket(packets[0]); if (packets.length > 1) { @@ -166,7 +161,6 @@ public class LibsDisguises extends JavaPlugin implements Listener { || event.getPacketID() == Packets.Server.ADD_EXP_ORB || event.getPacketID() == Packets.Server.VEHICLE_SPAWN || event.getPacketID() == Packets.Server.ENTITY_PAINTING) { - // manager.sendServerPacket(observer, disguise.constructDestroyPacket(entity.getEntityId())); final PacketContainer[] packets = disguise.constructPacket(entity); event.setPacket(packets[0]); if (packets.length > 1) { @@ -226,10 +220,16 @@ public class LibsDisguises extends JavaPlugin implements Listener { } } }); + DisguiseListener listener = new DisguiseListener(this); + Bukkit.getPluginManager().registerEvents(listener, this); getCommand("disguise").setExecutor(new DisguiseCommand()); getCommand("undisguise").setExecutor(new UndisguiseCommand()); getCommand("disguiseplayer").setExecutor(new DisguisePlayerCommand()); getCommand("undisguiseplayer").setExecutor(new UndisguisePlayerCommand()); + getCommand("undisguiseentity").setExecutor(new UndisguiseEntityCommand(listener)); + getCommand("disguiseentity").setExecutor(new DisguiseEntityCommand(listener)); + getCommand("disguiseradius").setExecutor(new DisguiseRadiusCommand()); + getCommand("undisguiseradius").setExecutor(new UndisguiseRadiusCommand()); saveDefaultConfig(); permission = getConfig().getString("Permission"); if (getConfig().getBoolean("NotifyUpdate")) {