@ -1257,15 +1257,22 @@ public class CharacterItemManager {
@@ -1257,15 +1257,22 @@ public class CharacterItemManager {
}
if ( ItemBase . getItemBase ( i . getItemBaseID ( ) ) . getType ( ) . ordinal ( ) = = Enum . ItemType . RESOURCE . ordinal ( ) ) {
int count = i . getNumOfItems ( ) ;
ArrayList < Item > purge = new ArrayList < > ( ) ;
for ( Item item : this . inventory ) {
if ( item . getItemBaseID ( ) = = i . getItemBaseID ( ) ) {
if ( item . getNumOfItems ( ) + count < = Warehouse . getMaxResources ( ) . get ( i . getItemBaseID ( ) ) ) {
this . junk ( item ) ;
purge . add ( item ) ;
count + = item . getNumOfItems ( ) ;
}
}
}
i = new MobLoot ( this . getOwner ( ) , i . getItemBase ( ) , count , false ) . promoteToItem ( ( PlayerCharacter ) this . getOwner ( ) ) ;
for ( Item item : purge ) {
this . removeItemFromInventory ( item ) ;
}
Item resource = new MobLoot ( this . getOwner ( ) , i . getItemBase ( ) , count , false ) . promoteToItem ( ( PlayerCharacter ) this . getOwner ( ) ) ;
this . inventory . add ( resource ) ;
this . itemIDtoType . put ( resource . getObjectUUID ( ) , resource . getObjectType ( ) . ordinal ( ) ) ;
return true ;
}
this . inventory . add ( i ) ;
this . itemIDtoType . put ( i . getObjectUUID ( ) , i . getObjectType ( ) . ordinal ( ) ) ;