Dodge ProtocolLib UOE

This commit is contained in:
Olof Larsson 2016-05-20 23:16:05 +02:00
parent bdfc3d3dcf
commit 6caa385eb5
No known key found for this signature in database
GPG Key ID: BBEF14F97DA52474

View File

@ -354,8 +354,18 @@ public class MUtil
{ {
if ( ! (object instanceof Metadatable)) return false; if ( ! (object instanceof Metadatable)) return false;
Metadatable metadatable = (Metadatable)object; Metadatable metadatable = (Metadatable)object;
try
{
return metadatable.hasMetadata("NPC"); return metadatable.hasMetadata("NPC");
} }
catch (UnsupportedOperationException e)
{
// ProtocolLib
// UnsupportedOperationException: The method hasMetadata is not supported for temporary players.
return false;
}
}
public static boolean isntNpc(Object object) public static boolean isntNpc(Object object)
{ {
return !isNpc(object); return !isNpc(object);