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 server.ItemInformationProvider;
import server.ItemInformationProvider.ScriptedItem;
/**
*
* @author Jay Estrella
*/
public final class ScriptedItemHandler extends AbstractPacketHandler {
@@ -40,16 +39,18 @@ public final class ScriptedItemHandler extends AbstractPacketHandler {
p.readInt(); // trash stamp, thanks RMZero213
short itemSlot = p.readShort(); // item slot, thanks RMZero213
int itemId = p.readInt();
ItemInformationProvider ii = ItemInformationProvider.getInstance();
ScriptedItem info = ii.getScriptedItemInfo(itemId);
if (info == null) return;
if (info == null) {
return;
}
Item item = c.getPlayer().getInventory(ItemConstants.getInventoryType(itemId)).getItem(itemSlot);
if (item == null || item.getItemId() != itemId || item.getQuantity() < 1) {
return;
}
ItemScriptManager ism = ItemScriptManager.getInstance();
ism.runItemScript(c, info);
}