Addition of Player hasEnteredWorld method.
This commit is contained in:
		| @@ -459,6 +459,7 @@ public class Player extends Playable | ||||
| 	private String _htmlPrefix = ""; | ||||
| 	 | ||||
| 	private volatile boolean _isOnline = false; | ||||
| 	private boolean _enteredWorld = false; | ||||
| 	private long _onlineTime; | ||||
| 	private long _onlineBeginTime; | ||||
| 	private long _lastAccess; | ||||
| @@ -6309,8 +6310,10 @@ public class Player extends Playable | ||||
| 		broadcastPacket(new Ride(this)); | ||||
| 		setMountObjectID(0); | ||||
| 		storePetFood(petId); | ||||
| 		 | ||||
| 		// Notify self and others about speed change | ||||
| 		broadcastUserInfo(); | ||||
| 		 | ||||
| 		return true; | ||||
| 	} | ||||
| 	 | ||||
| @@ -7583,6 +7586,16 @@ public class Player extends Playable | ||||
| 		return 0; | ||||
| 	} | ||||
| 	 | ||||
| 	public void setEnteredWorld() | ||||
| 	{ | ||||
| 		_enteredWorld = true; | ||||
| 	} | ||||
| 	 | ||||
| 	public boolean hasEnteredWorld() | ||||
| 	{ | ||||
| 		return _enteredWorld; | ||||
| 	} | ||||
| 	 | ||||
| 	/** | ||||
| 	 * Verifies if the player is in offline mode.<br> | ||||
| 	 * The offline mode may happen for different reasons:<br> | ||||
|   | ||||
| @@ -1510,7 +1510,6 @@ public abstract class Inventory extends ItemContainer | ||||
| 				} | ||||
| 			} | ||||
| 			 | ||||
| 			 | ||||
| 			// Add new item in slot of paperdoll | ||||
| 			if (item != null) | ||||
| 			{ | ||||
| @@ -1603,7 +1602,7 @@ public abstract class Inventory extends ItemContainer | ||||
| 	 */ | ||||
| 	private void checkEquipTask() | ||||
| 	{ | ||||
| 		if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && (getOwner().getActingPlayer().getUptime() > 5000)) | ||||
| 		if ((_skillItemTask == null) && (getOwner() != null) && getOwner().isPlayer() && getOwner().getActingPlayer().hasEnteredWorld()) | ||||
| 		{ | ||||
| 			getOwner().getActingPlayer().setUsingSkillItem(true); | ||||
| 			_skillItemTask = ThreadPool.schedule(() -> | ||||
|   | ||||
| @@ -796,6 +796,9 @@ public class EnterWorld implements IClientIncomingPacket | ||||
| 				player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT); | ||||
| 			} | ||||
| 		}, 5500); | ||||
| 		 | ||||
| 		// EnterWorld has finished. | ||||
| 		player.setEnteredWorld(); | ||||
| 	} | ||||
| 	 | ||||
| 	/** | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 MobiusDevelopment
					MobiusDevelopment