forked from MagicBane/Server
Refactor item_type
This commit is contained in:
@@ -30,8 +30,6 @@ public class ItemBase {
|
||||
private static final ArrayList<ItemBase> _resourceList = new ArrayList<>();
|
||||
public final int uuid;
|
||||
|
||||
//requirements/restrictions
|
||||
private final ItemType type;
|
||||
private final int modTable;
|
||||
private final int useID;
|
||||
private int hashID;
|
||||
@@ -61,8 +59,6 @@ public class ItemBase {
|
||||
public ItemBase(ResultSet rs) throws SQLException {
|
||||
|
||||
this.uuid = rs.getInt("ID");
|
||||
|
||||
this.type = ItemType.valueOf(rs.getString("Type"));
|
||||
this.useID = rs.getInt("useID");
|
||||
this.useAmount = rs.getByte("useAmount");
|
||||
this.modTable = rs.getInt("modTable");
|
||||
@@ -84,18 +80,17 @@ public class ItemBase {
|
||||
|
||||
this.twoHanded = (rs.getInt("twoHanded") == 1);
|
||||
|
||||
switch (this.type) {
|
||||
switch (ItemTemplate.itemTemplates.get(this.getUUID()).item_type) {
|
||||
case RUNE:
|
||||
case SCROLL:
|
||||
case COMMANDROD:
|
||||
case WAND:
|
||||
case POTION:
|
||||
case TEARS:
|
||||
case GUILDCHARTER:
|
||||
case CHARTER:
|
||||
case DEED:
|
||||
case CONTRACT:
|
||||
case WATERBUCKET:
|
||||
case EMPLOYMENTCONTRACT:
|
||||
case BUCKET:
|
||||
case REALMCHARTER:
|
||||
case GIFT:
|
||||
case TREASURE:
|
||||
this.isConsumable = true;
|
||||
break;
|
||||
case OFFERING:
|
||||
@@ -118,7 +113,7 @@ public class ItemBase {
|
||||
|
||||
_itemBaseByUUID.put(itemBase.uuid, itemBase);
|
||||
|
||||
if (itemBase.type.equals(ItemType.RESOURCE))
|
||||
if (ItemTemplate.itemTemplates.get(itemBase.uuid).item_type.equals(ItemType.RESOURCE))
|
||||
_resourceList.add(itemBase);
|
||||
|
||||
ItemTemplate template = ItemTemplate.itemTemplates.get(itemBase.uuid);
|
||||
@@ -225,10 +220,6 @@ public class ItemBase {
|
||||
|
||||
}
|
||||
|
||||
public ItemType getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public int getUseID() {
|
||||
return this.useID;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user