|
|
@ -776,8 +776,6 @@ public class CharacterItemManager { |
|
|
|
this.commitTrade(); |
|
|
|
this.commitTrade(); |
|
|
|
this.closeTradeWindow(ctwm1, false); |
|
|
|
this.closeTradeWindow(ctwm1, false); |
|
|
|
other.getCharItemManager().closeTradeWindow(ctwm2, false); |
|
|
|
other.getCharItemManager().closeTradeWindow(ctwm2, false); |
|
|
|
other.getCharItemManager().StackResources(); |
|
|
|
|
|
|
|
this.StackResources(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
@ -1257,9 +1255,6 @@ public class CharacterItemManager { |
|
|
|
} |
|
|
|
} |
|
|
|
this.inventory.add(i); |
|
|
|
this.inventory.add(i); |
|
|
|
this.itemIDtoType.put(i.getObjectUUID(), i.getObjectType().ordinal()); |
|
|
|
this.itemIDtoType.put(i.getObjectUUID(), i.getObjectType().ordinal()); |
|
|
|
if(i.getItemBase().getType().equals(ItemType.RESOURCE)){ |
|
|
|
|
|
|
|
this.StackResources(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -2317,6 +2312,7 @@ public class CharacterItemManager { |
|
|
|
* Update the player's inventory window by resending the entire contents. |
|
|
|
* Update the player's inventory window by resending the entire contents. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void updateInventory() { |
|
|
|
public void updateInventory() { |
|
|
|
|
|
|
|
this.StackResources(); |
|
|
|
this.updateInventory(this.getInventory(), true); |
|
|
|
this.updateInventory(this.getInventory(), true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -2628,7 +2624,7 @@ public class CharacterItemManager { |
|
|
|
//populate resources hashmap with items currently in inventory
|
|
|
|
//populate resources hashmap with items currently in inventory
|
|
|
|
for(Item item : this.getInventory()){ |
|
|
|
for(Item item : this.getInventory()){ |
|
|
|
if(Warehouse.getMaxResources().get(item.getItemBaseID()) != null && Warehouse.getMaxResources().get(item.getItemBaseID()) != 0){ |
|
|
|
if(Warehouse.getMaxResources().get(item.getItemBaseID()) != null && Warehouse.getMaxResources().get(item.getItemBaseID()) != 0){ |
|
|
|
if(resources.containsKey(item.getItemBaseID())){ |
|
|
|
if(resources.containsKey(item.getItemBase())){ |
|
|
|
resources.get(item.getItemBase()).add(item); |
|
|
|
resources.get(item.getItemBase()).add(item); |
|
|
|
} else{ |
|
|
|
} else{ |
|
|
|
resources.put(item.getItemBase(),new ArrayList<>()); |
|
|
|
resources.put(item.getItemBase(),new ArrayList<>()); |
|
|
@ -2670,7 +2666,7 @@ public class CharacterItemManager { |
|
|
|
this.delete(purged); |
|
|
|
this.delete(purged); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.updateInventory(); |
|
|
|
//this.updateInventory();
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|