Chests are now empty when removed (so they longer drop their items). Profile debugging mode added that prints how long an operation took.
This commit is contained in:
@@ -184,6 +184,32 @@ public class ServerInterface {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear a chest's contents.
|
||||
*
|
||||
* @param pt
|
||||
*/
|
||||
public static boolean clearChest(Vector pt) {
|
||||
ComplexBlock cblock = etc.getServer().getComplexBlock(
|
||||
pt.getBlockX(), pt.getBlockY(), pt.getBlockZ());
|
||||
|
||||
if (!(cblock instanceof Chest)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Chest chest = (Chest)cblock;
|
||||
hj[] itemArray = chest.getArray();
|
||||
|
||||
// Find an existing slot to put it into
|
||||
for (int i = 0; itemArray.length > i; i++) {
|
||||
itemArray[i] = null;
|
||||
}
|
||||
|
||||
chest.update();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a tree at a location.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user