geforkt von Mirrors/FastAsyncWorldEdit
Chests are now empty when removed (so they longer drop their items). Profile debugging mode added that prints how long an operation took.
Dieser Commit ist enthalten in:
Ursprung
6b368a38a2
Commit
c6033a7e1c
@ -93,6 +93,11 @@ public class EditSession {
|
||||
if (y < 0 || y > 127) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Clear the chest so that it doesn't drop items
|
||||
if (ServerInterface.getBlockType(pt) == 54) {
|
||||
ServerInterface.clearChest(pt);
|
||||
}
|
||||
|
||||
boolean result = ServerInterface.setBlockType(pt, block.getID());
|
||||
if (block.getID() != 0) {
|
||||
|
@ -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.
|
||||
*
|
||||
|
@ -79,6 +79,10 @@ public class WorldEditListener extends PluginListener {
|
||||
*/
|
||||
private GroupRestrictionsManager restrictions = new GroupRestrictionsManager();
|
||||
|
||||
/**
|
||||
* True to time operations.
|
||||
*/
|
||||
private boolean profile;
|
||||
/**
|
||||
* List of allowed blocks.
|
||||
*/
|
||||
@ -1702,11 +1706,18 @@ public class WorldEditListener extends PluginListener {
|
||||
new EditSession(session.getBlockChangeLimit());
|
||||
editSession.enableQueue();
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
try {
|
||||
return performCommand(player, session, editSession, split);
|
||||
} finally {
|
||||
session.remember(editSession);
|
||||
editSession.flushQueue();
|
||||
|
||||
if (profile) {
|
||||
long time = System.currentTimeMillis() - start;
|
||||
ply.sendMessage(Colors.Yellow + (time / 1000.0) + "s elapsed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1774,6 +1785,8 @@ public class WorldEditListener extends PluginListener {
|
||||
properties.load();
|
||||
}
|
||||
|
||||
profile = properties.getBoolean("debug-profile", false);
|
||||
|
||||
// Get allowed blocks
|
||||
allowedBlocks = new HashSet<Integer>();
|
||||
for (String b : properties.getString("allowed-blocks",
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren