Preserve EbonReach changes after Windows recovery
This commit is contained in:
@@ -674,46 +674,6 @@ public class Item extends AbstractWorldObject {
|
||||
public static Item newGoldItem(AbstractWorldObject awo, ItemBase ib, Enum.ItemContainerType containerType) {
|
||||
return newGoldItem(awo, ib, containerType, true);
|
||||
}
|
||||
|
||||
//used for vault!
|
||||
public static Item newGoldItem(int accountID, ItemBase ib, Enum.ItemContainerType containerType) {
|
||||
return newGoldItem(accountID, ib, containerType, true);
|
||||
}
|
||||
|
||||
private static Item newGoldItem(int accountID, ItemBase ib, Enum.ItemContainerType containerType, boolean persist) {
|
||||
|
||||
int ownerID;
|
||||
OwnerType ownerType;
|
||||
|
||||
ownerID = accountID;
|
||||
ownerType = OwnerType.Account;
|
||||
|
||||
|
||||
Item newGold = new Item(ib, ownerID, ownerType,
|
||||
(byte) 0, (byte) 0, (short) 0, (short) 0, true, false, containerType, (byte) 0,
|
||||
new ArrayList<>(), "");
|
||||
|
||||
synchronized (newGold) {
|
||||
newGold.numberOfItems = 0;
|
||||
}
|
||||
|
||||
if (persist) {
|
||||
try {
|
||||
newGold = DbManager.ItemQueries.ADD_ITEM(newGold);
|
||||
if (newGold != null) {
|
||||
synchronized (newGold) {
|
||||
newGold.numberOfItems = 0;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
DbManager.ItemQueries.ZERO_ITEM_STACK(newGold);
|
||||
}
|
||||
|
||||
return newGold;
|
||||
}
|
||||
|
||||
private static Item newGoldItem(AbstractWorldObject awo, ItemBase ib, Enum.ItemContainerType containerType, boolean persist) {
|
||||
|
||||
int ownerID;
|
||||
@@ -771,10 +731,49 @@ public class Item extends AbstractWorldObject {
|
||||
}
|
||||
DbManager.ItemQueries.ZERO_ITEM_STACK(newGold);
|
||||
}
|
||||
|
||||
newGold.containerType = containerType;
|
||||
|
||||
return newGold;
|
||||
}
|
||||
//used for vault!
|
||||
public static Item newGoldItem(int accountID, ItemBase ib, Enum.ItemContainerType containerType) {
|
||||
return newGoldItem(accountID, ib, containerType, true);
|
||||
}
|
||||
|
||||
private static Item newGoldItem(int accountID, ItemBase ib, Enum.ItemContainerType containerType, boolean persist) {
|
||||
|
||||
int ownerID;
|
||||
OwnerType ownerType;
|
||||
|
||||
ownerID = accountID;
|
||||
ownerType = OwnerType.Account;
|
||||
|
||||
|
||||
Item newGold = new Item(ib, ownerID, ownerType,
|
||||
(byte) 0, (byte) 0, (short) 0, (short) 0, true, false, containerType, (byte) 0,
|
||||
new ArrayList<>(), "");
|
||||
|
||||
synchronized (newGold) {
|
||||
newGold.numberOfItems = 0;
|
||||
}
|
||||
|
||||
if (persist) {
|
||||
try {
|
||||
newGold = DbManager.ItemQueries.ADD_ITEM(newGold);
|
||||
if (newGold != null) {
|
||||
synchronized (newGold) {
|
||||
newGold.numberOfItems = 0;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
DbManager.ItemQueries.ZERO_ITEM_STACK(newGold);
|
||||
}
|
||||
|
||||
return newGold;
|
||||
}
|
||||
|
||||
// This is to be used for trades - the new item is not stored in the database
|
||||
public static Item newGoldItemTemp(AbstractWorldObject awo, ItemBase ib) {
|
||||
|
||||
Reference in New Issue
Block a user