Reformat and clean up "net" package
This commit is contained in:
@@ -29,23 +29,22 @@ import net.packet.InPacket;
|
||||
import tools.PacketCreator;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Matze
|
||||
*/
|
||||
public final class ItemMoveHandler extends AbstractPacketHandler {
|
||||
@Override
|
||||
public final void handlePacket(InPacket p, Client c) {
|
||||
p.skip(4);
|
||||
if(c.getPlayer().getAutobanManager().getLastSpam(6) + 300 > currentServerTime()) {
|
||||
if (c.getPlayer().getAutobanManager().getLastSpam(6) + 300 > currentServerTime()) {
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
InventoryType type = InventoryType.getByType(p.readByte());
|
||||
short src = p.readShort(); //is there any reason to use byte instead of short in src and action?
|
||||
short action = p.readShort();
|
||||
short quantity = p.readShort();
|
||||
|
||||
|
||||
if (src < 0 && action > 0) {
|
||||
InventoryManipulator.unequip(c, src, action);
|
||||
} else if (action < 0) {
|
||||
@@ -55,8 +54,10 @@ public final class ItemMoveHandler extends AbstractPacketHandler {
|
||||
} else {
|
||||
InventoryManipulator.move(c, type, src, action);
|
||||
}
|
||||
|
||||
if (c.getPlayer().getMap().getHPDec() > 0) c.getPlayer().resetHpDecreaseTask();
|
||||
|
||||
if (c.getPlayer().getMap().getHPDec() > 0) {
|
||||
c.getPlayer().resetHpDecreaseTask();
|
||||
}
|
||||
c.getPlayer().getAutobanManager().spam(6);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user