Move the remaining legacy item template lookups to CObjectTemplate
Dev commands, BuildingManager, ChatManager, ForgeManager, NPCManager, NPC, Warehouse, WorkOrder and ManageNPCMsg now call CObjectTemplate.lookup instead of ItemTemplate.templates.get. Forge production cost reads getItemResourceCosts(). Only the DB loader and linkCacheTemplates still use the legacy class (removed in Task 1.8). Removes the static_item_templates ParityCheck comparator. Final parity (offline p17.py, 7586 rows): every id has a cache template, 0 item_type differences, 0 item_resource_costs differences (84 ITEMs have costs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6b4e9815e0
commit
566870de79
17 files changed
+67
-70
No files matched your search
@@ -15,8 +15,8 @@ import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.AbstractGameObject;
|
||||
import engine.objects.Item;
|
||||
import engine.objects.ItemTemplate;
|
||||
import engine.objects.PlayerCharacter;
|
||||
import engine.parsers.objects.CObjectTemplate;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
/**
|
||||
@@ -38,7 +38,7 @@ public class CreateItemCmd extends AbstractDevCmd {
|
||||
}
|
||||
|
||||
int templateID = Integer.parseInt(words[0]);
|
||||
ItemTemplate template = ItemTemplate.templates.get(templateID);
|
||||
CObjectTemplate template = CObjectTemplate.lookup(templateID);
|
||||
|
||||
if (template == null) {
|
||||
ChatManager.chatSystemInfo(playerCharacter, "No such template found.");
|
||||
@@ -51,7 +51,7 @@ public class CreateItemCmd extends AbstractDevCmd {
|
||||
|
||||
for (int i = 0; i < size; i++) {
|
||||
|
||||
if (!playerCharacter.charItemManager.hasRoomInventory(template.cacheTemplate.getItemWt())) {
|
||||
if (!playerCharacter.charItemManager.hasRoomInventory(template.getItemWt())) {
|
||||
ChatManager.chatSystemInfo(playerCharacter, "You are encumbered!.");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import engine.mbEnums.BuildingGroup;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.mbEnums.TargetColor;
|
||||
import engine.objects.*;
|
||||
import engine.parsers.objects.CObjectTemplate;
|
||||
import engine.util.StringUtils;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
@@ -507,9 +508,9 @@ public class InfoCmd extends AbstractDevCmd {
|
||||
case Item: //intentional passthrough
|
||||
case MobLoot:
|
||||
Item item = (Item) target;
|
||||
ItemTemplate template = ItemTemplate.templates.get(item.templateID);
|
||||
output += StringUtils.addWS("Template: " + template.template_id, 20);
|
||||
output += "Weight: " + template.cacheTemplate.getItemWt();
|
||||
CObjectTemplate template = CObjectTemplate.lookup(item.templateID);
|
||||
output += StringUtils.addWS("Template: " + template.getTemplateId(), 20);
|
||||
output += "Weight: " + template.getItemWt();
|
||||
output += newline;
|
||||
DecimalFormat df = new DecimalFormat("###,###,###,###,##0");
|
||||
output += StringUtils.addWS("Qty: "
|
||||
@@ -517,7 +518,7 @@ public class InfoCmd extends AbstractDevCmd {
|
||||
output += "Charges: " + (byte) item.chargesRemaining
|
||||
+ '/' + item.template.getItemInitialCharges();
|
||||
output += newline;
|
||||
output += "Name: " + template.cacheTemplate.getItemBaseName();
|
||||
output += "Name: " + template.getItemBaseName();
|
||||
output += newline;
|
||||
output += item.getContainerInfo();
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import engine.gameManager.DbManager;
|
||||
import engine.mbEnums.ItemType;
|
||||
import engine.mbEnums.OwnerType;
|
||||
import engine.objects.*;
|
||||
import engine.parsers.objects.CObjectTemplate;
|
||||
import engine.powers.EffectsBase;
|
||||
|
||||
/**
|
||||
@@ -59,17 +60,17 @@ public class MakeItemCmd extends AbstractDevCmd {
|
||||
}
|
||||
|
||||
int templateID;
|
||||
ItemTemplate template;
|
||||
CObjectTemplate template;
|
||||
try {
|
||||
templateID = Integer.parseInt(words[0]);
|
||||
template = ItemTemplate.templates.get(templateID);
|
||||
template = CObjectTemplate.lookup(templateID);
|
||||
|
||||
if (template == null) {
|
||||
throwbackError(pc, "No item template with id " + words[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (template.cacheTemplate.getItemType() == ItemType.GOLD) {
|
||||
if (template.getItemType() == ItemType.GOLD) {
|
||||
this.throwbackInfo(pc, "use /addgold to add gold.");
|
||||
return;
|
||||
}
|
||||
@@ -131,7 +132,7 @@ public class MakeItemCmd extends AbstractDevCmd {
|
||||
return;
|
||||
}
|
||||
}
|
||||
template = ItemTemplate.templates.get(templateID);
|
||||
template = CObjectTemplate.lookup(templateID);
|
||||
|
||||
if (template == null) {
|
||||
throwbackError(pc, "Unable to find template " + templateID);
|
||||
@@ -139,8 +140,8 @@ public class MakeItemCmd extends AbstractDevCmd {
|
||||
}
|
||||
|
||||
if ((numItems > 1)
|
||||
&& (template.cacheTemplate.getItemType().equals(ItemType.RESOURCE) == false)
|
||||
&& (template.cacheTemplate.getItemType().equals(ItemType.OFFERING)) == false)
|
||||
&& (template.getItemType().equals(ItemType.RESOURCE) == false)
|
||||
&& (template.getItemType().equals(ItemType.OFFERING)) == false)
|
||||
numItems = 1;
|
||||
|
||||
CharacterItemManager cim = pc.charItemManager;
|
||||
@@ -154,7 +155,7 @@ public class MakeItemCmd extends AbstractDevCmd {
|
||||
|
||||
for (int i = 0; i < quantity; i++) {
|
||||
|
||||
int weight = template.cacheTemplate.getItemWt();
|
||||
int weight = template.getItemWt();
|
||||
|
||||
if (!cim.hasRoomInventory(weight)) {
|
||||
throwbackError(pc, "Not enough room in inventory for any more of this item. " + i + " produced.");
|
||||
|
||||
@@ -11,6 +11,7 @@ package engine.devcmd.cmds;
|
||||
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.objects.*;
|
||||
import engine.parsers.objects.CObjectTemplate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -52,8 +53,8 @@ public class PrintBankCmd extends AbstractDevCmd {
|
||||
throwbackInfo(pc, "Bank for " + type + ' ' + name + " (" + tar.getObjectUUID() + ')');
|
||||
|
||||
for (Item item : list) {
|
||||
ItemTemplate template = ItemTemplate.templates.get(item.templateID);
|
||||
throwbackInfo(pc, " " + template.cacheTemplate.getItemBaseName() + ", count: " + item.getNumOfItems());
|
||||
CObjectTemplate template = CObjectTemplate.lookup(item.templateID);
|
||||
throwbackInfo(pc, " " + template.getItemBaseName() + ", count: " + item.getNumOfItems());
|
||||
}
|
||||
|
||||
Item gold = cim.getGoldBank();
|
||||
|
||||
@@ -13,6 +13,7 @@ import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.objects.*;
|
||||
import engine.parsers.objects.CObjectTemplate;
|
||||
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
||||
|
||||
public class PrintBonusesCmd extends AbstractDevCmd {
|
||||
@@ -33,8 +34,8 @@ public class PrintBonusesCmd extends AbstractDevCmd {
|
||||
if (target instanceof Item) {
|
||||
type = "Item";
|
||||
tar = (Item) target;
|
||||
ItemTemplate template = ItemTemplate.templates.get(((Item) tar).templateID);
|
||||
name = template.cacheTemplate.getItemBaseName();
|
||||
CObjectTemplate template = CObjectTemplate.lookup(((Item) tar).templateID);
|
||||
name = template.getItemBaseName();
|
||||
} else if (target instanceof AbstractCharacter) {
|
||||
tar = (AbstractCharacter) target;
|
||||
name = ((AbstractCharacter) tar).getFirstName();
|
||||
|
||||
@@ -12,6 +12,7 @@ package engine.devcmd.cmds;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.mbEnums.ItemType;
|
||||
import engine.objects.*;
|
||||
import engine.parsers.objects.CObjectTemplate;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
@@ -75,18 +76,18 @@ public class PrintInventoryCmd extends AbstractDevCmd {
|
||||
int goldCount = 0;
|
||||
|
||||
for (Item item : inventory) {
|
||||
ItemTemplate template = ItemTemplate.templates.get(item.templateID);
|
||||
CObjectTemplate template = CObjectTemplate.lookup(item.templateID);
|
||||
|
||||
if (item.template.getItemType().equals(ItemType.GOLD) == false) {
|
||||
|
||||
String chargeInfo = "";
|
||||
int chargeMax = template.cacheTemplate.getItemInitialCharges();
|
||||
int chargeMax = template.getItemInitialCharges();
|
||||
|
||||
if (chargeMax > 0) {
|
||||
int charges = item.chargesRemaining;
|
||||
chargeInfo = " charges: " + charges + '/' + chargeMax;
|
||||
}
|
||||
throwbackInfo(pc, " " + template.cacheTemplate.getItemBaseName() + ", count: " + item.getNumOfItems() + chargeInfo);
|
||||
throwbackInfo(pc, " " + template.getItemBaseName() + ", count: " + item.getNumOfItems() + chargeInfo);
|
||||
} else
|
||||
goldCount += item.getNumOfItems();
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ package engine.devcmd.cmds;
|
||||
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.objects.*;
|
||||
import engine.parsers.objects.CObjectTemplate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -50,8 +51,8 @@ public class PrintVaultCmd extends AbstractDevCmd {
|
||||
ArrayList<Item> list = cim.getVault();
|
||||
throwbackInfo(pc, "Vault for " + type + ' ' + name + " (" + tar.getObjectUUID() + ')');
|
||||
for (Item item : list) {
|
||||
ItemTemplate template = ItemTemplate.templates.get(item.templateID);
|
||||
throwbackInfo(pc, " " + template.cacheTemplate.getItemBaseName() + ", count: " + item.getNumOfItems());
|
||||
CObjectTemplate template = CObjectTemplate.lookup(item.templateID);
|
||||
throwbackInfo(pc, " " + template.getItemBaseName() + ", count: " + item.getNumOfItems());
|
||||
}
|
||||
Item gold = cim.getGoldVault();
|
||||
if (gold != null)
|
||||
|
||||
@@ -5,6 +5,7 @@ import engine.gameManager.LootManager;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.loot.BootySetEntry;
|
||||
import engine.objects.*;
|
||||
import engine.parsers.objects.CObjectTemplate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
@@ -34,10 +35,10 @@ public class SimulateBootyCmd extends AbstractDevCmd {
|
||||
if (mob.bootySet != 0) {
|
||||
for (BootySetEntry entry : LootManager._bootySetMap.get(mob.bootySet)) {
|
||||
|
||||
ItemTemplate template = ItemTemplate.templates.get(entry.templateID);
|
||||
CObjectTemplate template = CObjectTemplate.lookup(entry.templateID);
|
||||
|
||||
if (template != null)
|
||||
output += "[" + entry.bootyType + "] " + template.cacheTemplate.getItemBaseName() + " [Chance] " + entry.dropChance + newline;
|
||||
output += "[" + entry.bootyType + "] " + template.getItemBaseName() + " [Chance] " + entry.dropChance + newline;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import engine.mbEnums.BuildingGroup;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.net.client.msg.ErrorPopupMsg;
|
||||
import engine.objects.*;
|
||||
import engine.parsers.objects.CObjectTemplate;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
@@ -199,12 +200,12 @@ public enum BuildingManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemTemplate template = ItemTemplate.templates.get(1705032); // Elan Stone
|
||||
CObjectTemplate template = CObjectTemplate.lookup(1705032); // Elan Stone
|
||||
|
||||
if (!player.charItemManager.hasRoomInventory(template.cacheTemplate.getItemWt()))
|
||||
if (!player.charItemManager.hasRoomInventory(template.getItemWt()))
|
||||
return false;
|
||||
|
||||
if (!ItemManager.MakeItemForPlayer(template.template_id, player, amount))
|
||||
if (!ItemManager.MakeItemForPlayer(template.getTemplateId(), player, amount))
|
||||
return false;
|
||||
|
||||
shrine.setFavors(0);
|
||||
@@ -218,12 +219,12 @@ public enum BuildingManager {
|
||||
|
||||
for (mbEnums.ResourceType resourceType : EnumSet.allOf(mbEnums.ResourceType.class)) {
|
||||
|
||||
ItemTemplate resourceTemplate = ItemTemplate.templates.get(resourceType.templateID);
|
||||
CObjectTemplate resourceTemplate = CObjectTemplate.lookup(resourceType.templateID);
|
||||
|
||||
if (resourceTemplate == null)
|
||||
continue;
|
||||
|
||||
if (!player.charItemManager.hasRoomInventory(resourceTemplate.cacheTemplate.getItemWt())) {
|
||||
if (!player.charItemManager.hasRoomInventory(resourceTemplate.getItemWt())) {
|
||||
ChatManager.chatSystemInfo(player, "You can not carry any more of that item.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import engine.net.client.ClientConnection;
|
||||
import engine.net.client.handlers.ClientAdminCommandMsgHandler;
|
||||
import engine.net.client.msg.chat.*;
|
||||
import engine.objects.*;
|
||||
import engine.parsers.objects.CObjectTemplate;
|
||||
import engine.server.MBServerStatics;
|
||||
import engine.server.world.WorldServer;
|
||||
import org.pmw.tinylog.Logger;
|
||||
@@ -539,8 +540,8 @@ public enum ChatManager {
|
||||
name = amount + " gold ";
|
||||
else {
|
||||
String vowels = "aeiou";
|
||||
ItemTemplate template = ItemTemplate.templates.get(item.templateID);
|
||||
String iName = template.cacheTemplate.getItemBaseName();
|
||||
CObjectTemplate template = CObjectTemplate.lookup(item.templateID);
|
||||
String iName = template.getItemBaseName();
|
||||
if (iName.length() > 0)
|
||||
if (vowels.indexOf(iName.substring(0, 1).toLowerCase()) >= 0)
|
||||
name = "an " + iName + ' ';
|
||||
|
||||
@@ -15,8 +15,8 @@ import engine.mbEnums;
|
||||
import engine.net.client.msg.ItemProductionMsg;
|
||||
import engine.objects.City;
|
||||
import engine.objects.Item;
|
||||
import engine.objects.ItemTemplate;
|
||||
import engine.objects.NPC;
|
||||
import engine.parsers.objects.CObjectTemplate;
|
||||
import engine.powers.EffectsBase;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
@@ -225,12 +225,12 @@ public enum ForgeManager implements Runnable {
|
||||
// Calculate production cost for a single run of the workOrder
|
||||
|
||||
HashMap<mbEnums.ResourceType, Integer> production_cost = new HashMap<>();
|
||||
ItemTemplate template = ItemTemplate.templates.get(workOrder.templateID);
|
||||
CObjectTemplate template = CObjectTemplate.lookup(workOrder.templateID);
|
||||
|
||||
// Add gold and resource costs from template
|
||||
|
||||
production_cost.put(mbEnums.ResourceType.GOLD, template.cacheTemplate.getItemValue());
|
||||
production_cost.putAll(template.item_resource_cost);
|
||||
production_cost.put(mbEnums.ResourceType.GOLD, template.getItemValue());
|
||||
production_cost.putAll(template.getItemResourceCosts());
|
||||
|
||||
// Calculate cost of prefix and suffix
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ import engine.net.client.ClientConnection;
|
||||
import engine.net.client.msg.ErrorPopupMsg;
|
||||
import engine.net.client.msg.PetMsg;
|
||||
import engine.objects.*;
|
||||
import engine.parsers.objects.CObjectTemplate;
|
||||
import engine.powers.EffectsBase;
|
||||
import engine.powers.RuneSkillAdjustEntry;
|
||||
import engine.server.MBServerStatics;
|
||||
@@ -545,14 +546,14 @@ public enum NPCManager {
|
||||
|
||||
public static long calcRollingDuration(NPC vendor, int templateID) {
|
||||
|
||||
ItemTemplate template = ItemTemplate.templates.get(templateID);
|
||||
CObjectTemplate template = CObjectTemplate.lookup(templateID);
|
||||
float rollingDuration;
|
||||
|
||||
if (template == null)
|
||||
return 0;
|
||||
|
||||
if (template.cacheTemplate.getItemBaneRank() > 0)
|
||||
return (long) (template.cacheTemplate.getItemBaneRank() * 60 * 60 * 3 * 1000 * Float.parseFloat(ConfigManager.MB_PRODUCTION_RATE.getValue()));
|
||||
if (template.getItemBaneRank() > 0)
|
||||
return (long) (template.getItemBaneRank() * 60 * 60 * 3 * 1000 * Float.parseFloat(ConfigManager.MB_PRODUCTION_RATE.getValue()));
|
||||
|
||||
if (vendor.building == null)
|
||||
return 600;
|
||||
|
||||
@@ -12,9 +12,9 @@ import engine.gameManager.DbManager;
|
||||
import engine.gameManager.ForgeManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.Item;
|
||||
import engine.objects.ItemTemplate;
|
||||
import engine.objects.NPC;
|
||||
import engine.objects.Warehouse;
|
||||
import engine.parsers.objects.CObjectTemplate;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
@@ -127,12 +127,12 @@ public class WorkOrder implements Delayed {
|
||||
|
||||
int validation_result = 0;
|
||||
|
||||
ItemTemplate template = ItemTemplate.templates.get(workOrder.templateID);
|
||||
CObjectTemplate template = CObjectTemplate.lookup(workOrder.templateID);
|
||||
|
||||
if (workOrder.vendor.getBuilding() == null)
|
||||
return 58; //58: The formula is beyond the means of this facility
|
||||
|
||||
if (!workOrder.vendor.charItemManager.hasRoomInventory(template.cacheTemplate.getItemWt()))
|
||||
if (!workOrder.vendor.charItemManager.hasRoomInventory(template.getItemWt()))
|
||||
return 30; //30: That person cannot carry that item
|
||||
|
||||
if ((workOrder.prefixToken != 0 || workOrder.suffixToken != 0) &&
|
||||
|
||||
@@ -19,6 +19,7 @@ import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.Protocol;
|
||||
import engine.objects.*;
|
||||
import engine.parsers.objects.CObjectTemplate;
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.Period;
|
||||
import org.joda.time.Seconds;
|
||||
@@ -420,12 +421,12 @@ public class ManageNPCMsg extends ClientNetMsg {
|
||||
writer.putInt(rollableSet.size());
|
||||
|
||||
for (int templateID : rollableSet) {
|
||||
ItemTemplate template = ItemTemplate.templates.get(templateID);
|
||||
CObjectTemplate template = CObjectTemplate.lookup(templateID);
|
||||
int modTable = ForgeManager.getVendorModTable(templateID);
|
||||
writer.put((byte) 1);
|
||||
writer.putInt(0);
|
||||
writer.putInt(templateID); //itemID
|
||||
writer.putInt(template.cacheTemplate.getItemValue());
|
||||
writer.putInt(template.getItemValue());
|
||||
writer.putInt(600);
|
||||
writer.put((byte) 1);
|
||||
writer.put((byte) modTable);
|
||||
|
||||
@@ -23,6 +23,7 @@ import engine.net.ByteBufferWriter;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.client.msg.PetMsg;
|
||||
import engine.net.client.msg.PlaceAssetMsg;
|
||||
import engine.parsers.objects.CObjectTemplate;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.joda.time.DateTime;
|
||||
import org.pmw.tinylog.Logger;
|
||||
@@ -961,15 +962,15 @@ public class NPC extends AbstractCharacter {
|
||||
maxSkill = 110;
|
||||
break;
|
||||
}
|
||||
ItemTemplate itemTemplate;
|
||||
CObjectTemplate itemTemplate;
|
||||
int skillRequired = 0;
|
||||
for (Integer itemID : fullItemList) {
|
||||
itemTemplate = ItemTemplate.templates.get(itemID);
|
||||
itemTemplate = CObjectTemplate.lookup(itemID);
|
||||
|
||||
if (itemTemplate.cacheTemplate.getItemSkillReq().values().iterator().hasNext())
|
||||
skillRequired = itemTemplate.cacheTemplate.getItemSkillReq().values().iterator().next();
|
||||
if (itemTemplate.getItemSkillReq().values().iterator().hasNext())
|
||||
skillRequired = itemTemplate.getItemSkillReq().values().iterator().next();
|
||||
|
||||
boolean exclude = skillRequired == 0 && ItemTemplate.templates.get(itemID).cacheTemplate.getItemType().equals(ItemType.WEAPON);
|
||||
boolean exclude = skillRequired == 0 && CObjectTemplate.lookup(itemID).getItemType().equals(ItemType.WEAPON);
|
||||
if (skillRequired <= maxSkill && !exclude)
|
||||
filteredItemList.add(itemID);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import engine.mbEnums;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.client.ClientConnection;
|
||||
import engine.net.client.msg.*;
|
||||
import engine.parsers.objects.CObjectTemplate;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.joda.time.DateTime;
|
||||
import org.json.JSONArray;
|
||||
@@ -307,7 +308,7 @@ public class Warehouse {
|
||||
if (resource.template.getItemType().equals(mbEnums.ItemType.GOLD))
|
||||
resourceType = mbEnums.ResourceType.GOLD;
|
||||
else
|
||||
resourceType = mbEnums.ResourceType.valueOf(ItemTemplate.templates.get(resource.templateID).cacheTemplate.getItemBaseName().toUpperCase());
|
||||
resourceType = mbEnums.ResourceType.valueOf(CObjectTemplate.lookup(resource.templateID).getItemBaseName().toUpperCase());
|
||||
|
||||
if (transaction)
|
||||
AddTransactionToWarehouse(warehouse, playerCharacter.getObjectType(), playerCharacter.getObjectUUID(), mbEnums.TransactionType.DEPOSIT, resourceType, amount);
|
||||
@@ -418,7 +419,7 @@ public class Warehouse {
|
||||
if (playerCharacter == null)
|
||||
return false;
|
||||
|
||||
ItemTemplate template = ItemTemplate.templates.get(resourceType.templateID);
|
||||
CObjectTemplate template = CObjectTemplate.lookup(resourceType.templateID);
|
||||
|
||||
if (warehouse.resources.get(resourceType) == null)
|
||||
return false;
|
||||
@@ -432,7 +433,7 @@ public class Warehouse {
|
||||
return false;
|
||||
|
||||
if (addToInventory)
|
||||
if (!itemMan.hasRoomInventory(template.cacheTemplate.getItemWt())) {
|
||||
if (!itemMan.hasRoomInventory(template.getItemWt())) {
|
||||
ChatManager.chatSystemInfo(playerCharacter, "You can not carry any more of that item.");
|
||||
return false;
|
||||
}
|
||||
@@ -501,7 +502,7 @@ public class Warehouse {
|
||||
if (playerCharacter == null)
|
||||
return false;
|
||||
|
||||
ItemTemplate template = ItemTemplate.templates.get(resourceType.templateID);
|
||||
CObjectTemplate template = CObjectTemplate.lookup(resourceType.templateID);
|
||||
|
||||
if (template == null)
|
||||
return false;
|
||||
@@ -517,7 +518,7 @@ public class Warehouse {
|
||||
if (itemMan == null)
|
||||
return false;
|
||||
|
||||
if (!itemMan.hasRoomInventory(template.cacheTemplate.getItemWt())) {
|
||||
if (!itemMan.hasRoomInventory(template.getItemWt())) {
|
||||
ChatManager.chatSystemInfo(playerCharacter, "You can not carry any more of that item.");
|
||||
return false;
|
||||
}
|
||||
|
||||
-16
@@ -13,7 +13,6 @@ import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.AbstractGameObject;
|
||||
import engine.objects.BaseClass;
|
||||
import engine.objects.ItemTemplate;
|
||||
import engine.parsers.objects.RuneTemplate;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
@@ -37,7 +36,6 @@ public class ParityCheck {
|
||||
|
||||
static {
|
||||
register("static_rune_baseclass", ParityCheck::compareBaseClasses);
|
||||
register("static_item_templates", ParityCheck::compareItemTemplates);
|
||||
}
|
||||
|
||||
private ParityCheck(String table) {
|
||||
@@ -117,18 +115,4 @@ public class ParityCheck {
|
||||
check.compareField(baseClass.getObjectUUID(), "name", baseClass.getName(), rune.obj_name);
|
||||
}
|
||||
}
|
||||
|
||||
// A wrong item_type means the bridge picked the wrong folder for an id found in more than one.
|
||||
|
||||
private static void compareItemTemplates(ParityCheck check) {
|
||||
|
||||
for (ItemTemplate template : ItemTemplate.templates.values()) {
|
||||
|
||||
if (!check.compareRow(template.template_id, template.cacheTemplate))
|
||||
continue;
|
||||
|
||||
check.compareField(template.template_id, "obj_name", template.obj_name, template.cacheTemplate.getObjName());
|
||||
check.compareField(template.template_id, "item_type", template.item_type, template.cacheTemplate.getItemType());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user