From 85a66339e2de8b3b402f3b981290b61981cc52dc Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 7 Apr 2024 13:08:00 -0400 Subject: [PATCH] inline accessors --- .../handlers/ItemProductionMsgHandler.java | 22 ++--- .../net/client/msg/ItemProductionMsg.java | 96 +------------------ 2 files changed, 14 insertions(+), 104 deletions(-) diff --git a/src/engine/net/client/handlers/ItemProductionMsgHandler.java b/src/engine/net/client/handlers/ItemProductionMsgHandler.java index dddb73d7..7a0dce43 100644 --- a/src/engine/net/client/handlers/ItemProductionMsgHandler.java +++ b/src/engine/net/client/handlers/ItemProductionMsgHandler.java @@ -373,7 +373,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { // Grab reference to vendor we are interacting with - vendorNPC = (NPC) DbManager.getObject(mbEnums.GameObjectType.NPC, msg.getNpcUUID()); + vendorNPC = (NPC) DbManager.getObject(mbEnums.GameObjectType.NPC, msg.npcUUID); // Oops? @@ -386,39 +386,39 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { case PRODUCE: boolean isRandom = false; - if (msg.getUnknown03() != 0 && msg.getpToken() == 0 && msg.getsToken() == 0) + if (msg.unknown03 != 0 && msg.pToken == 0 && msg.sToken == 0) isRandom = true; //Create Multiple Item Function.. Fill all empty slots - if (msg.getSize() > 0) { + if (msg.size > 0) { int emptySlots = vendorNPC.getRank() - vendorNPC.getRolling().size(); if (emptySlots > 0) { for (int i = 0; i < emptySlots; i++) { - vendorNPC.produceItem(player.getObjectUUID(), msg.getTotal_to_produce(), isRandom, msg.getpToken(), msg.getsToken(), msg.getName(), msg.getTemplateID()); + vendorNPC.produceItem(player.getObjectUUID(), msg.total_to_produce, isRandom, msg.pToken, msg.sToken, msg.name, msg.templateID); } } } else - vendorNPC.produceItem(player.getObjectUUID(), msg.getTotal_to_produce(), isRandom, msg.getpToken(), msg.getsToken(), msg.getName(), msg.getTemplateID()); + vendorNPC.produceItem(player.getObjectUUID(), msg.total_to_produce, isRandom, msg.pToken, msg.sToken, msg.name, msg.templateID); break; case JUNK: - junkItem(msg.getTemplateID(), vendorNPC, origin); + junkItem(msg.templateID, vendorNPC, origin); break; case RECYCLE: - recycleItem(msg.getItems(), vendorNPC, origin); + recycleItem(msg.items, vendorNPC, origin); msg.actionType = mbEnums.ProductionActionType.TAKE; dispatch = Dispatch.borrow(player, msg); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); break; case COMPLETE: - vendorNPC.completeItem(msg.getTemplateID()); + vendorNPC.completeItem(msg.templateID); break; case DEPOSIT: - depositItem(msg.getTemplateID(), vendorNPC, origin); + depositItem(msg.templateID, vendorNPC, origin); break; case SETPRICE: - setItemPrice(msg.getItemType(), msg.getTemplateID(), msg.getItemPrice(), vendorNPC, origin); + setItemPrice(msg.itemType, msg.templateID, msg.itemPrice, vendorNPC, origin); break; case TAKE: - takeItem(msg.getItems(), vendorNPC, origin); + takeItem(msg.items, vendorNPC, origin); dispatch = Dispatch.borrow(player, msg); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); break; diff --git a/src/engine/net/client/msg/ItemProductionMsg.java b/src/engine/net/client/msg/ItemProductionMsg.java index 7165b952..7dce78ff 100644 --- a/src/engine/net/client/msg/ItemProductionMsg.java +++ b/src/engine/net/client/msg/ItemProductionMsg.java @@ -206,7 +206,6 @@ public class ItemProductionMsg extends ClientNetMsg { break; case TAKE: case RECYCLE: - writer.putInt(0); writer.putInt(0); writer.putInt(1); @@ -237,6 +236,7 @@ public class ItemProductionMsg extends ClientNetMsg { writer.putInt(1); MobLoot toRoll = MobLoot.getFromCache(this.templateID); writer.putInt(-1497023830); + if (toRoll != null && toRoll.getPrefix() != null && !toRoll.getPrefix().isEmpty()) { EffectsBase eb = PowersManager.getEffectByIDString(toRoll.getPrefix()); if (eb == null) @@ -265,13 +265,8 @@ public class ItemProductionMsg extends ClientNetMsg { writer.putInt(this.templateID); writer.putInt(0); //items left to produce? - if (toRoll != null) { - writer.putInt(toRoll.templateID); - writer.putInt(toRoll.getValue()); - } else { - writer.putInt(0); - writer.putInt(0); - } + writer.putInt(toRoll.templateID); + writer.putInt(toRoll.getValue()); NPC vendor = NPC.getFromCache(this.npcUUID); if (vendor != null) { @@ -341,7 +336,6 @@ public class ItemProductionMsg extends ClientNetMsg { writer.putInt(0); break; } - } /** @@ -432,91 +426,7 @@ public class ItemProductionMsg extends ClientNetMsg { else reader.getShort(); break; - } } - public int getItemType() { - return itemType; - } - - public int getUnknown01() { - return unknown01; - } - - public void setUnknown01(int unknown01) { - this.unknown01 = unknown01; - } - - public int getTotal_to_produce() { - return total_to_produce; - } - - public void setTotal_to_produce(int unknown02) { - this.total_to_produce = unknown02; - } - - public int getUnknown03() { - return unknown03; - } - - public void setUnknown03(int unknown03) { - this.unknown03 = unknown03; - } - - public int getTemplateID() { - return templateID; - } - - public void setTemplateID(int templateID) { - this.templateID = templateID; - } - - public int getpToken() { - return pToken; - } - - public void setpToken(int pToken) { - this.pToken = pToken; - } - - public int getsToken() { - return sToken; - } - - public void setsToken(int sToken) { - this.sToken = sToken; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public int getSize() { - return size; - } - - public void setSize(int size) { - this.size = size; - } - - public int getNpcUUID() { - return npcUUID; - } - - public HashMap getItems() { - return items; - } - - /** - * @return the itemPrice - */ - public int getItemPrice() { - return itemPrice; - } - }