mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-11-28 13:45:36 +01:00
Fix tiles for BukkitQueue_All
This commit is contained in:
parent
eb62377c0f
commit
efcb7b90e8
@ -5,8 +5,10 @@ import com.boydti.fawe.config.Settings;
|
|||||||
import com.boydti.fawe.example.CharFaweChunk;
|
import com.boydti.fawe.example.CharFaweChunk;
|
||||||
import com.boydti.fawe.object.FaweQueue;
|
import com.boydti.fawe.object.FaweQueue;
|
||||||
import com.boydti.fawe.util.MainUtil;
|
import com.boydti.fawe.util.MainUtil;
|
||||||
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.worldedit.LocalWorld;
|
import com.sk89q.worldedit.LocalWorld;
|
||||||
import com.sk89q.worldedit.Vector2D;
|
import com.sk89q.worldedit.Vector2D;
|
||||||
|
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||||
import com.sk89q.worldedit.bukkit.BukkitUtil;
|
import com.sk89q.worldedit.bukkit.BukkitUtil;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BaseBiome;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -186,6 +188,14 @@ public class BukkitChunk_All extends CharFaweChunk<Chunk> {
|
|||||||
int z = cacheZ[j];
|
int z = cacheZ[j];
|
||||||
int y = cacheY[j];
|
int y = cacheY[j];
|
||||||
Block block = chunk.getBlock(x, y, z);
|
Block block = chunk.getBlock(x, y, z);
|
||||||
|
if (FaweCache.hasNBT(id) && parent.adapter != null) {
|
||||||
|
CompoundTag tile = getTile(x, y, z);
|
||||||
|
if (tile != null) {
|
||||||
|
BaseBlock baseBlock = new BaseBlock(id, data, tile);
|
||||||
|
parent.adapter.setBlock(block.getLocation(), baseBlock, false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
setBlock(block, id, (byte) data);
|
setBlock(block, id, (byte) data);
|
||||||
if (light) {
|
if (light) {
|
||||||
parent.disableLighting(disableResult);
|
parent.disableLighting(disableResult);
|
||||||
|
@ -29,7 +29,7 @@ import org.bukkit.event.world.WorldInitEvent;
|
|||||||
|
|
||||||
public abstract class BukkitQueue_0<CHUNK, CHUNKSECTIONS, SECTION> extends NMSMappedFaweQueue<World, CHUNK, CHUNKSECTIONS, SECTION> implements Listener {
|
public abstract class BukkitQueue_0<CHUNK, CHUNKSECTIONS, SECTION> extends NMSMappedFaweQueue<World, CHUNK, CHUNKSECTIONS, SECTION> implements Listener {
|
||||||
|
|
||||||
public static Object adapter;
|
public static BukkitImplAdapter adapter;
|
||||||
public static Method methodToNative;
|
public static Method methodToNative;
|
||||||
public static Method methodFromNative;
|
public static Method methodFromNative;
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ public abstract class BukkitQueue_0<CHUNK, CHUNKSECTIONS, SECTION> extends NMSMa
|
|||||||
if ((this.adapter = adapter) != null) {
|
if ((this.adapter = adapter) != null) {
|
||||||
fieldAdapter.set(instance, adapter);
|
fieldAdapter.set(instance, adapter);
|
||||||
} else {
|
} else {
|
||||||
this.adapter = fieldAdapter.get(instance);
|
this.adapter = (BukkitImplAdapter) fieldAdapter.get(instance);
|
||||||
}
|
}
|
||||||
for (Method method : this.adapter.getClass().getDeclaredMethods()) {
|
for (Method method : this.adapter.getClass().getDeclaredMethods()) {
|
||||||
switch (method.getName()) {
|
switch (method.getName()) {
|
||||||
|
@ -7,9 +7,11 @@ import com.boydti.fawe.object.FaweChunk;
|
|||||||
import com.boydti.fawe.object.RunnableVal;
|
import com.boydti.fawe.object.RunnableVal;
|
||||||
import com.boydti.fawe.util.TaskManager;
|
import com.boydti.fawe.util.TaskManager;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
|
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
|
||||||
@ -92,8 +94,13 @@ public class BukkitQueue_All extends BukkitQueue_0<Chunk, Chunk, Chunk> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CompoundTag getTileEntity(Chunk chunk, int x, int y, int z) {
|
public CompoundTag getTileEntity(Chunk chunk, int x, int y, int z) {
|
||||||
|
if (adapter == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Location loc = new Location(getWorld(), x, y, z);
|
||||||
|
BaseBlock block = adapter.getBlock(loc);
|
||||||
|
return block != null ? block.getNbtData() : null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Chunk getChunk(World world, int x, int z) {
|
public Chunk getChunk(World world, int x, int z) {
|
||||||
|
Loading…
Reference in New Issue
Block a user