Untitled

 avatar
unknown
java
4 years ago
927 B
4
Indexable
} else if (packetId == PLAYER_OPTION_5_PACKET) {
			int playerIndex = stream.readUnsignedShortLE128();
			boolean forceRun = stream.readUnsignedByte() == 1;
			Player p2 = World.getPlayers().get(playerIndex);
			if (p2 == null || p2.isDead() || p2.hasFinished() || !player.getMapRegionsIds().contains(p2.getRegionId())
					|| player.getLockDelay() >= Utils.currentTimeMillis() || player == p2) {
				return;
			}
			if (!p2.withinDistance(player, 14)) {
				player.sendMessage("Unable to find " + p2.getDisplayName() + ".");
				return;
			}
			if (player.getAttackedByDelay() + 5000 > Utils.currentTimeMillis()) {
				player.sendMessage("You can't examine " + p2.getDisplayName()
						+ "'s stats until 5 seconds after the end of combat.");
				return;
			}
			player.stopAll();
			ViewProfile.sendInterface(player, p2);
			player.getDialogueManager().startDialogue(PlayerExamine.playerExamineD, p2);
		}
Editor is loading...