Make private method public. Remove the error being thrown for temperary player

This commit is contained in:
libraryaddict 2013-12-02 23:21:10 +13:00
parent 9fd631d397
commit 55427dc1fe
2 changed files with 3 additions and 2 deletions

View file

@ -28,7 +28,7 @@ public class DisguiseAPI {
return hearSelfDisguise; return hearSelfDisguise;
} }
private static void disguiseEntity(Entity entity, Disguise disguise) { public static void disguiseEntity(Entity entity, Disguise disguise) {
// If they are trying to disguise a null entity or use a null disguise // If they are trying to disguise a null entity or use a null disguise
// Just return. // Just return.
if (entity == null || disguise == null) if (entity == null || disguise == null)

View file

@ -770,7 +770,8 @@ public class PacketsManager {
@Override @Override
public void onPacketSending(PacketEvent event) { public void onPacketSending(PacketEvent event) {
// If the inventory is the players inventory // If the inventory is the players inventory
if (event.getPlayer().getVehicle() == null && event.getPacket().getIntegers().read(0) == 0) { if (event.getPlayer().isOnline() && event.getPlayer().getVehicle() == null
&& event.getPacket().getIntegers().read(0) == 0) {
Disguise disguise = DisguiseAPI.getDisguise(event.getPlayer(), event.getPlayer()); Disguise disguise = DisguiseAPI.getDisguise(event.getPlayer(), event.getPlayer());
// If the player is disguised, views self disguises and is hiding a item. // If the player is disguised, views self disguises and is hiding a item.
if (disguise != null && disguise.isSelfDisguiseVisible() if (disguise != null && disguise.isSelfDisguiseVisible()