Improved Bukkit performance drastically.

This commit is contained in:
sk89q 2011-01-31 01:16:49 -08:00
parent f69184f9ab
commit faf03079d6
2 changed files with 12 additions and 5 deletions

View File

@ -772,10 +772,17 @@ public class EditSession {
int affected = 0;
BaseBlock air = new BaseBlock(0);
for (int x = -size; x <= size; x++) {
for (int y = -size; y <= size; y++) {
for (int z = -size; z <= size; z++) {
Vector p = pos.add(x, y, z);
int minX = pos.getBlockX() - size;
int maxX = pos.getBlockX() + size;
int minY = Math.max(0, pos.getBlockY() - size);
int maxY = Math.min(127, pos.getBlockY() + size);
int minZ = pos.getBlockZ() - size;
int maxZ = pos.getBlockZ() + size;
for (int x = minX; x <= maxX; x++) {
for (int y = minY; y <= maxY; y++) {
for (int z = minZ; z <= maxZ; z++) {
Vector p = new Vector(x, y, z);
if (getBlockType(p) == blockType) {
if (setBlock(p, air)) {

View File

@ -76,7 +76,7 @@ public class BukkitWorld extends LocalWorld {
*/
@Override
public int getBlockType(Vector pt) {
return world.getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()).getTypeId();
return world.getBlockTypeIdAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ());
}
/**