Replaced instanceof L2ItemInstance with isItem method.
This commit is contained in:
@ -460,7 +460,7 @@ public class L2CharacterAI extends AbstractAI
|
||||
// Stop the actor auto-attack client side by sending Server->Client packet AutoAttackStop (broadcast)
|
||||
clientStopAutoAttack();
|
||||
|
||||
if ((object instanceof L2ItemInstance) && (((L2ItemInstance) object).getItemLocation() != ItemLocation.VOID))
|
||||
if (object.isItem() && (((L2ItemInstance) object).getItemLocation() != ItemLocation.VOID))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -980,7 +980,7 @@ public class L2CharacterAI extends AbstractAI
|
||||
}
|
||||
|
||||
// while flying there is no move to cast
|
||||
if (_actor.getAI().getIntention() == AI_INTENTION_CAST && _actor.isPlayer() && _actor.checkTransformed(transform -> !transform.isCombat()))
|
||||
if ((_actor.getAI().getIntention() == AI_INTENTION_CAST) && _actor.isPlayer() && _actor.checkTransformed(transform -> !transform.isCombat()))
|
||||
{
|
||||
_actor.sendPacket(SystemMessageId.THE_DISTANCE_IS_TOO_FAR_AND_SO_THE_CASTING_HAS_BEEN_STOPPED);
|
||||
_actor.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
|
@ -182,7 +182,7 @@ public class TradeList
|
||||
}
|
||||
|
||||
final L2Object o = L2World.getInstance().findObject(objectId);
|
||||
if (!(o instanceof L2ItemInstance))
|
||||
if (!o.isItem())
|
||||
{
|
||||
LOGGER.warning(_owner.getName() + ": Trying to add something other than an item!");
|
||||
return null;
|
||||
|
@ -482,7 +482,7 @@ public class L2PetInstance extends L2Summon
|
||||
getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
broadcastPacket(new StopMove(this));
|
||||
|
||||
if (!(object instanceof L2ItemInstance))
|
||||
if (!object.isItem())
|
||||
{
|
||||
// dont try to pickup anything that is not an item :)
|
||||
LOGGER_PET.warning(this + " trying to pickup wrong target." + object);
|
||||
|
@ -266,7 +266,7 @@ public final class L2ItemInstance extends L2Object
|
||||
* <BR>
|
||||
* <B><U> Assert </U> :</B><BR>
|
||||
* <BR>
|
||||
* <li>this instanceof L2ItemInstance</li>
|
||||
* <li>this.isItem().</li>
|
||||
* <li>_worldRegion != null <I>(L2Object is visible at the beginning)</I></li><BR>
|
||||
* <BR>
|
||||
* <B><U> Example of use </U> :</B><BR>
|
||||
|
@ -102,7 +102,7 @@ public final class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (activeChar.isGM())
|
||||
{
|
||||
final L2Object obj = L2World.getInstance().findObject(_objectId);
|
||||
if (obj instanceof L2ItemInstance)
|
||||
if (obj.isItem())
|
||||
{
|
||||
if (_count > ((L2ItemInstance) obj).getCount())
|
||||
{
|
||||
|
@ -41,7 +41,7 @@ public class RequestExRqItemLink implements IClientIncomingPacket
|
||||
public void run(L2GameClient client)
|
||||
{
|
||||
final L2Object object = L2World.getInstance().findObject(_objectId);
|
||||
if (object instanceof L2ItemInstance)
|
||||
if (object.isItem())
|
||||
{
|
||||
final L2ItemInstance item = (L2ItemInstance) object;
|
||||
if (item.isPublished())
|
||||
|
@ -94,7 +94,7 @@ public final class UseItem implements IClientIncomingPacket
|
||||
if (activeChar.isGM())
|
||||
{
|
||||
final L2Object obj = L2World.getInstance().findObject(_objectId);
|
||||
if (obj instanceof L2ItemInstance)
|
||||
if (obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(activeChar, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
Reference in New Issue
Block a user