Fail Safe NPCs
This commit is contained in:
parent
a69b1de69e
commit
e26e174837
@ -42,22 +42,17 @@ public class SenderColl<E extends SenderEntity<E>> extends Coll<E> implements Se
|
|||||||
// OVERRIDE: Coll
|
// OVERRIDE: Coll
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public static void denyNpc(Object oid)
|
|
||||||
{
|
|
||||||
if (MUtil.isNpc(oid)) throw new IllegalArgumentException("NPCs are not allowed: " + oid);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public E get(Object oid)
|
public E get(Object oid)
|
||||||
{
|
{
|
||||||
denyNpc(oid);
|
if (MUtil.isNpc(oid)) return null;
|
||||||
return super.get(oid);
|
return super.get(oid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public E get(Object oid, boolean creative)
|
public E get(Object oid, boolean creative)
|
||||||
{
|
{
|
||||||
denyNpc(oid);
|
if (MUtil.isNpc(oid)) return null;
|
||||||
return super.get(oid, creative);
|
return super.get(oid, creative);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user