forked from MagicBane/Server
items PERSIST work.
This commit is contained in:
@@ -52,7 +52,6 @@ public class Item extends AbstractWorldObject {
|
||||
public int chargesRemaining;
|
||||
private byte equipSlot;
|
||||
private boolean canDestroy;
|
||||
private boolean rentable;
|
||||
private boolean isRandom = false;
|
||||
private int value;
|
||||
public OwnerType ownerType;
|
||||
@@ -101,7 +100,6 @@ public class Item extends AbstractWorldObject {
|
||||
this.durabilityCurrent = (short) itemBase.getDurability();
|
||||
this.containerType = containerType;
|
||||
this.canDestroy = canDestroy;
|
||||
this.rentable = rentable;
|
||||
this.equipSlot = equipSlot;
|
||||
this.enchants = enchants;
|
||||
this.flags = 1;
|
||||
@@ -134,7 +132,6 @@ public class Item extends AbstractWorldObject {
|
||||
this.durabilityMax = (short) itemBase.getDurability();
|
||||
this.durabilityCurrent = (short) itemBase.getDurability();
|
||||
this.canDestroy = canDestroy;
|
||||
this.rentable = rentable;
|
||||
this.equipSlot = equipSlot;
|
||||
this.enchants = enchants;
|
||||
this.flags = 1;
|
||||
@@ -433,7 +430,7 @@ public class Item extends AbstractWorldObject {
|
||||
item.containerType = Enum.ItemContainerType.INVENTORY;
|
||||
|
||||
try {
|
||||
item = DbManager.ItemQueries.ADD_ITEM(item);
|
||||
item = DbManager.ItemQueries.PERSIST(item);
|
||||
itemWorked = true;
|
||||
} catch (Exception e) {
|
||||
Logger.error(e);
|
||||
@@ -604,7 +601,7 @@ public class Item extends AbstractWorldObject {
|
||||
true, false, Enum.ItemContainerType.INVENTORY, (byte) 0,
|
||||
new ArrayList<>(), "");
|
||||
try {
|
||||
item = DbManager.ItemQueries.ADD_ITEM(temp);
|
||||
item = DbManager.ItemQueries.PERSIST(temp);
|
||||
} catch (Exception e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
@@ -624,7 +621,7 @@ public class Item extends AbstractWorldObject {
|
||||
true, false, Enum.ItemContainerType.BANK, (byte) 0,
|
||||
new ArrayList<>(), "");
|
||||
try {
|
||||
item = DbManager.ItemQueries.ADD_ITEM(temp);
|
||||
item = DbManager.ItemQueries.PERSIST(temp);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return item;
|
||||
@@ -642,7 +639,7 @@ public class Item extends AbstractWorldObject {
|
||||
true, false, Enum.ItemContainerType.INVENTORY, (byte) 0,
|
||||
new ArrayList<>(), "");
|
||||
try {
|
||||
item = DbManager.ItemQueries.ADD_ITEM(temp);
|
||||
item = DbManager.ItemQueries.PERSIST(temp);
|
||||
} catch (Exception e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
@@ -681,7 +678,7 @@ public class Item extends AbstractWorldObject {
|
||||
|
||||
if (persist) {
|
||||
try {
|
||||
newGold = DbManager.ItemQueries.ADD_ITEM(newGold);
|
||||
newGold = DbManager.ItemQueries.PERSIST(newGold);
|
||||
if (newGold != null) {
|
||||
synchronized (newGold) {
|
||||
newGold.numberOfItems = 0;
|
||||
@@ -742,7 +739,7 @@ public class Item extends AbstractWorldObject {
|
||||
|
||||
if (persist) {
|
||||
try {
|
||||
newGold = DbManager.ItemQueries.ADD_ITEM(newGold);
|
||||
newGold = DbManager.ItemQueries.PERSIST(newGold);
|
||||
if (newGold != null) {
|
||||
synchronized (newGold) {
|
||||
newGold.numberOfItems = 0;
|
||||
@@ -834,18 +831,6 @@ public class Item extends AbstractWorldObject {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isOwnerNPC() {
|
||||
return (ownerType == OwnerType.Npc);
|
||||
}
|
||||
|
||||
public boolean isOwnerCharacter() {
|
||||
return (ownerType == OwnerType.PlayerCharacter);
|
||||
}
|
||||
|
||||
public boolean isOwnerAccount() {
|
||||
return (ownerType == OwnerType.Account);
|
||||
}
|
||||
|
||||
public byte getChargesMax() {
|
||||
return chargesMax;
|
||||
}
|
||||
@@ -862,17 +847,10 @@ public class Item extends AbstractWorldObject {
|
||||
return canDestroy;
|
||||
}
|
||||
|
||||
public boolean isRentable() {
|
||||
return rentable;
|
||||
}
|
||||
|
||||
public byte getEquipSlot() {
|
||||
return equipSlot;
|
||||
}
|
||||
|
||||
public ArrayList<EnchantmentBase> getEnchants() {
|
||||
return enchants;
|
||||
}
|
||||
|
||||
public int getNumOfItems() {
|
||||
return this.numberOfItems;
|
||||
|
||||
Reference in New Issue
Block a user