Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-05 11:00:05 +01:00
Fixed getting and setting of blocks in unloaded chunks
Dieser Commit ist enthalten in:
Ursprung
02d8acfa81
Commit
bc6315fb24
@ -162,6 +162,8 @@ public class EditSession {
|
||||
return false;
|
||||
}
|
||||
|
||||
world.checkLoadedChuck(pt);
|
||||
|
||||
// No invalid blocks
|
||||
if (!world.isValidBlockType(type)) {
|
||||
return false;
|
||||
@ -414,6 +416,8 @@ public class EditSession {
|
||||
* @return BaseBlock
|
||||
*/
|
||||
public BaseBlock rawGetBlock(Vector pt) {
|
||||
world.checkLoadedChuck(pt);
|
||||
|
||||
int type = world.getBlockType(pt);
|
||||
int data = world.getBlockData(pt);
|
||||
|
||||
|
@ -349,6 +349,13 @@ public abstract class LocalWorld {
|
||||
return type >= 0 && type < 96;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the chunk pt is in is loaded. if not, loads the chunk
|
||||
*
|
||||
* @param pt Position to check
|
||||
*/
|
||||
public abstract void checkLoadedChuck(Vector pt);
|
||||
|
||||
/**
|
||||
* Compare if the other world is equal.
|
||||
*
|
||||
|
@ -673,6 +673,13 @@ public class BukkitWorld extends LocalWorld {
|
||||
return type <= 255 && Material.getMaterial(type) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkLoadedChuck(Vector pt) {
|
||||
if (!world.isChunkLoaded(pt.getBlockX() >> 4, pt.getBlockZ() >> 4)) {
|
||||
world.loadChunk(pt.getBlockX() >> 4, pt.getBlockZ() >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (!(other instanceof BukkitWorld)) {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren