if (player.isBusy()) {
player.resetPath();
return;
}
player.resetAll();
Point location = Point.location(p.readShort(), p.readShort());
int id = p.readShort();
final ActiveTile tile = world.getTile(location);
final Item item = getItem(id, tile, player);
if (item == null) {
// player.setSuspiciousPlayer(true);
player.resetPath();
return;
}
if (!item.getDef().canTrade()) {
if (item.droppedby() != 0
&& org.moparscape.msc.gs.tools.DataConversions
.usernameToHash(player.getUsername()) != item
.droppedby()) {
player.getActionSender().sendMessage(
"This item is non-tradable.");
return;
}
}
if (player.isPMod() && !player.isMod())
return;
if (item.getDef().isMembers() && !World.isMembers()) {
player.getActionSender().sendMessage(
"This feature is only avaliable on a members server");
return;
}
player.setStatus(Action.TAKING_GITEM);
boolean blocked = false;
try {
PathHandler pa = new PathHandler(player);
for (int i : new int[] { 1, 2, 4, 8 }) {
if (pa.isBlocking(location.getX(), location.getY(), i)) {
blocked = true;
}
}
} catch (Exception e) {
e.printStackTrace();