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;
}
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
// Just return.
if (entity == null || disguise == null)

View File

@ -770,7 +770,8 @@ public class PacketsManager {
@Override
public void onPacketSending(PacketEvent event) {
// 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());
// If the player is disguised, views self disguises and is hiding a item.
if (disguise != null && disguise.isSelfDisguiseVisible()