Extra checks for ItemContainer deleteMe method.
This commit is contained in:
parent
a08a71c145
commit
c95be5ef68
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -111,18 +111,6 @@ public class World
|
||||
_allObjects.remove(object.getObjectId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the objects.
|
||||
* @param list the list
|
||||
*/
|
||||
public void removeObjects(List<WorldObject> list)
|
||||
{
|
||||
for (int i = 0; i < list.size(); i++)
|
||||
{
|
||||
_allObjects.remove(list.get(i).getObjectId());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the WorldObject object that belongs to an ID or null if no object found.<br>
|
||||
* <br>
|
||||
|
@ -20,9 +20,7 @@ import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Logger;
|
||||
@ -557,19 +555,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
try
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
updateDatabase();
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase();
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
LOGGER.warning("deletedMe() " + t);
|
||||
}
|
||||
|
||||
final List<WorldObject> items = new ArrayList<>(_items);
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
|
||||
World.getInstance().removeObjects(items);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -577,7 +576,7 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void updateDatabase()
|
||||
{
|
||||
if ((getOwner() != null) && (_items != null))
|
||||
if (getOwner() != null)
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
|
@ -111,18 +111,6 @@ public class World
|
||||
_allObjects.remove(object.getObjectId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the objects.
|
||||
* @param list the list
|
||||
*/
|
||||
public void removeObjects(List<WorldObject> list)
|
||||
{
|
||||
for (int i = 0; i < list.size(); i++)
|
||||
{
|
||||
_allObjects.remove(list.get(i).getObjectId());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the WorldObject object that belongs to an ID or null if no object found.<br>
|
||||
* <br>
|
||||
|
@ -20,9 +20,7 @@ import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Logger;
|
||||
@ -560,19 +558,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
try
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
updateDatabase();
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase();
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
LOGGER.warning("deletedMe() " + t);
|
||||
}
|
||||
|
||||
final List<WorldObject> items = new ArrayList<>(_items);
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
|
||||
World.getInstance().removeObjects(items);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -580,7 +579,7 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void updateDatabase()
|
||||
{
|
||||
if ((getOwner() != null) && (_items != null))
|
||||
if (getOwner() != null)
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
|
@ -534,15 +534,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -534,15 +534,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -534,15 +534,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
@ -601,15 +601,20 @@ public abstract class ItemContainer
|
||||
*/
|
||||
public void deleteMe()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null))
|
||||
{
|
||||
for (Item item : _items)
|
||||
{
|
||||
item.updateDatabase(true);
|
||||
item.stopAllTasks();
|
||||
}
|
||||
}
|
||||
|
||||
for (Item item : _items)
|
||||
{
|
||||
World.getInstance().removeObject(item);
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user