Dodge ProtocolLib UOE
This commit is contained in:
parent
bdfc3d3dcf
commit
6caa385eb5
@ -352,10 +352,20 @@ public class MUtil
|
||||
|
||||
public static boolean isNpc(Object object)
|
||||
{
|
||||
if (!(object instanceof Metadatable)) return false;
|
||||
if ( ! (object instanceof Metadatable)) return false;
|
||||
Metadatable metadatable = (Metadatable)object;
|
||||
try
|
||||
{
|
||||
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)
|
||||
{
|
||||
return !isNpc(object);
|
||||
|
Loading…
Reference in New Issue
Block a user