Check if the packets from transformPackets are null before attempting to use them

This commit is contained in:
libraryaddict
2014-03-24 01:45:02 +13:00
parent e7bee27319
commit 1dbe7ad056
2 changed files with 31 additions and 24 deletions

View File

@@ -295,7 +295,8 @@ public class DisguiseUtilities {
}
/**
* @param A convidence method for me to refresh trackers in other plugins
* @param A
* convidence method for me to refresh trackers in other plugins
*/
public static void refreshTrackers(Entity entity) {
try {
@@ -530,6 +531,9 @@ public class DisguiseUtilities {
private static void sendSelfPacket(Player player, PacketContainer packet, int fakeId) {
PacketContainer[] packets = PacketsManager.transformPacket(packet, player, player);
try {
if (packets == null) {
packets = new PacketContainer[] { packet };
}
for (PacketContainer p : packets) {
p = p.deepClone();
p.getIntegers().write(0, fakeId);