Read deed consumers from DeedTemplate
Deed placement (ObjectActionMsgHandler, PlaceAssetMsgHandler) reads deed_structure_id from DeedTemplate._deeds. The deed, employment contract and charter type checks (PlaceAssetMsgHandler, ActivateNPCMsgHandler, GuildCreationFinalizeHandler, UseCharterMsg, Item.serialize) read item_type through the cache template bridge. Charters go through the shared getter rather than _deeds because template 545 "Charter" is a CHARTER in the ITEM folder. Parity (offline, static_item_templates vs COBJECTS, scripts/p13.py, 881 templates: all 880 DEED plus ITEM 545): 0 differences in item_type and deed_structure_id. Every DB DEED, EMPLOYMENTCONTRACT, PETTOTEM and FURNITUREDEED id is in the DEED folder. No value changes expected. No pet totem or furniture deed consumer reads template fields, so neither changes. JSON-Refactor-Plan Task 1.3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3e087bd1ac
commit
c774746736
6 files changed
+8
-7
No files matched your search
@@ -46,7 +46,7 @@ public class ActivateNPCMsgHandler extends AbstractClientMsgHandler {
|
|||||||
// Filter hirelings by slot type
|
// Filter hirelings by slot type
|
||||||
|
|
||||||
for (Item hirelings : player.getInventory()) {
|
for (Item hirelings : player.getInventory()) {
|
||||||
if (hirelings.template.item_type.equals(ItemType.EMPLOYMENTCONTRACT)) {
|
if (hirelings.template.cacheTemplate.getItemType().equals(ItemType.EMPLOYMENTCONTRACT)) {
|
||||||
|
|
||||||
contract = DbManager.ContractQueries.GET_CONTRACT(hirelings.templateID);
|
contract = DbManager.ContractQueries.GET_CONTRACT(hirelings.templateID);
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class GuildCreationFinalizeHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
// Item must be a valid charterType (type 10 in db)
|
// Item must be a valid charterType (type 10 in db)
|
||||||
|
|
||||||
if (charter == null || (charter.template.item_type.equals(ItemType.CHARTER) == false)) {
|
if (charter == null || (charter.template.cacheTemplate.getItemType().equals(ItemType.CHARTER) == false)) {
|
||||||
ErrorPopupMsg.sendErrorPopup(player, GuildManager.NO_CHARTER_FOUND);
|
ErrorPopupMsg.sendErrorPopup(player, GuildManager.NO_CHARTER_FOUND);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import engine.net.Dispatch;
|
|||||||
import engine.net.client.ClientConnection;
|
import engine.net.client.ClientConnection;
|
||||||
import engine.net.client.msg.*;
|
import engine.net.client.msg.*;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.parsers.objects.DeedTemplate;
|
||||||
import engine.powers.PowersBase;
|
import engine.powers.PowersBase;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -99,7 +100,7 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
|
|||||||
pam.setX(loc.getX() + 64); //offset grid from tol
|
pam.setX(loc.getX() + 64); //offset grid from tol
|
||||||
pam.setY(loc.getY());
|
pam.setY(loc.getY());
|
||||||
pam.setZ(loc.getZ() + 64); //offset grid from tol
|
pam.setZ(loc.getZ() + 64); //offset grid from tol
|
||||||
pam.addPlacementInfo(item.template.deed_structure_id);
|
pam.addPlacementInfo(DeedTemplate._deeds.get(item.templateID).deed_structure_id);
|
||||||
|
|
||||||
dispatch = Dispatch.borrow(player, pam);
|
dispatch = Dispatch.borrow(player, pam);
|
||||||
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||||
|
|||||||
@@ -356,8 +356,8 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
Item contract = null;
|
Item contract = null;
|
||||||
|
|
||||||
for (Item inventoryItem : playerCharacter.getInventory()) {
|
for (Item inventoryItem : playerCharacter.getInventory()) {
|
||||||
if (inventoryItem.template.item_type.equals(ItemType.DEED) &&
|
if (inventoryItem.template.cacheTemplate.getItemType().equals(ItemType.DEED) &&
|
||||||
inventoryItem.template.deed_structure_id == buildingList.getBlueprintUUID()) {
|
DeedTemplate._deeds.get(inventoryItem.templateID).deed_structure_id == buildingList.getBlueprintUUID()) {
|
||||||
contract = inventoryItem;
|
contract = inventoryItem;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class UseCharterMsg extends ClientNetMsg {
|
|||||||
|
|
||||||
if (close) {
|
if (close) {
|
||||||
for (Item i : player.getInventory()) {
|
for (Item i : player.getInventory()) {
|
||||||
if (i.template.item_type.equals(ItemType.CHARTER)) {
|
if (i.template.cacheTemplate.getItemType().equals(ItemType.CHARTER)) {
|
||||||
charterUUID = i.getObjectUUID();
|
charterUUID = i.getObjectUUID();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -298,7 +298,7 @@ public class Item extends AbstractWorldObject {
|
|||||||
writer.put((byte) 0);
|
writer.put((byte) 0);
|
||||||
|
|
||||||
|
|
||||||
if (item.template.item_type.equals(ItemType.EMPLOYMENTCONTRACT) == false) {
|
if (item.template.cacheTemplate.getItemType().equals(ItemType.EMPLOYMENTCONTRACT) == false) {
|
||||||
writer.putShort((short) 0);
|
writer.putShort((short) 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user