3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-26 02:50:06 +01:00

Improved Bukkit performance drastically.

Dieser Commit ist enthalten in:
sk89q 2011-01-31 01:16:49 -08:00
Ursprung f69184f9ab
Commit faf03079d6
2 geänderte Dateien mit 12 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -772,10 +772,17 @@ public class EditSession {
int affected = 0; int affected = 0;
BaseBlock air = new BaseBlock(0); BaseBlock air = new BaseBlock(0);
for (int x = -size; x <= size; x++) { int minX = pos.getBlockX() - size;
for (int y = -size; y <= size; y++) { int maxX = pos.getBlockX() + size;
for (int z = -size; z <= size; z++) { int minY = Math.max(0, pos.getBlockY() - size);
Vector p = pos.add(x, y, z); 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 (getBlockType(p) == blockType) {
if (setBlock(p, air)) { if (setBlock(p, air)) {

Datei anzeigen

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