mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-11-28 05:35:37 +01:00
isDirty
This commit is contained in:
parent
c0228054ef
commit
727c1d2e8b
@ -15,6 +15,7 @@ import com.sk89q.jnbt.CompoundTag;
|
|||||||
import com.sk89q.jnbt.ListTag;
|
import com.sk89q.jnbt.ListTag;
|
||||||
import com.sk89q.jnbt.StringTag;
|
import com.sk89q.jnbt.StringTag;
|
||||||
import com.sk89q.jnbt.Tag;
|
import com.sk89q.jnbt.Tag;
|
||||||
|
import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter;
|
||||||
import com.sk89q.worldedit.internal.Constants;
|
import com.sk89q.worldedit.internal.Constants;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
@ -65,11 +66,25 @@ import org.bukkit.generator.ChunkGenerator;
|
|||||||
|
|
||||||
public class BukkitQueue18R3 extends BukkitQueue_0<Chunk, ChunkSection[], ChunkSection> {
|
public class BukkitQueue18R3 extends BukkitQueue_0<Chunk, ChunkSection[], ChunkSection> {
|
||||||
|
|
||||||
|
public static Field isDirty;
|
||||||
|
|
||||||
public BukkitQueue18R3(final String world) {
|
public BukkitQueue18R3(final String world) {
|
||||||
super(world);
|
super(world);
|
||||||
checkVersion("v1_8_R3");
|
checkVersion("v1_8_R3");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setupAdapter(BukkitImplAdapter adapter) {
|
||||||
|
if (this.adapter == null) {
|
||||||
|
try {
|
||||||
|
isDirty = ChunkSection.class.getDeclaredField("isDirty");
|
||||||
|
isDirty.setAccessible(true);
|
||||||
|
Fawe.debug("isDirty found");
|
||||||
|
} catch (Throwable e) {}
|
||||||
|
}
|
||||||
|
super.setupAdapter(adapter);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isChunkLoaded(int x, int z) {
|
public boolean isChunkLoaded(int x, int z) {
|
||||||
return getWorld().isChunkLoaded(x, z);
|
return getWorld().isChunkLoaded(x, z);
|
||||||
@ -351,6 +366,9 @@ public class BukkitQueue18R3 extends BukkitQueue_0<Chunk, ChunkSection[], ChunkS
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ChunkSection section = sections[j];
|
ChunkSection section = sections[j];
|
||||||
|
if (section != null && isDirty != null) {
|
||||||
|
isDirty.set(section, true);
|
||||||
|
}
|
||||||
if ((section == null) || (fs.getCount(j) >= 4096)) {
|
if ((section == null) || (fs.getCount(j) >= 4096)) {
|
||||||
section = new ChunkSection(j << 4, flag, newArray);
|
section = new ChunkSection(j << 4, flag, newArray);
|
||||||
sections[j] = section;
|
sections[j] = section;
|
||||||
|
Loading…
Reference in New Issue
Block a user