Reformat and clean up "net" package

This commit is contained in:
P0nk
2021-09-09 23:26:02 +02:00
parent 69f4580637
commit 6be6ea9927
235 changed files with 3556 additions and 3398 deletions

View File

@@ -31,7 +31,6 @@ import tools.FilePrinter;
import java.awt.*;
/**
*
* @author Matze
* @author Ronan
*/
@@ -45,15 +44,17 @@ public final class ItemPickupHandler extends AbstractPacketHandler {
int oid = p.readInt();
Character chr = c.getPlayer();
MapObject ob = chr.getMap().getMapObject(oid);
if(ob == null) return;
if (ob == null) {
return;
}
Point charPos = chr.getPosition();
Point obPos = ob.getPosition();
if (Math.abs(charPos.getX() - obPos.getX()) > 800 || Math.abs(charPos.getY() - obPos.getY()) > 600) {
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to pick up an item too far away. Mapid: " + chr.getMapId() + " Player pos: " + charPos + " Object pos: " + obPos);
return;
}
chr.pickupItem(ob);
}
}