mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-11-28 21:56:33 +01:00
*forgot to commit all
This commit is contained in:
parent
fd83406e29
commit
3d2f939377
@ -97,6 +97,7 @@ public class BukkitQueue_1_12 extends BukkitQueue_0<net.minecraft.server.v1_12_R
|
||||
protected static Field fieldPalette;
|
||||
protected static Field fieldSize;
|
||||
protected static Method getEntitySlices;
|
||||
protected static Method methodTileEntityLoad;
|
||||
protected static Field fieldTickingBlockCount;
|
||||
protected static Field fieldNonEmptyBlockCount;
|
||||
protected static Field fieldSection;
|
||||
@ -150,6 +151,11 @@ public class BukkitQueue_1_12 extends BukkitQueue_0<net.minecraft.server.v1_12_R
|
||||
fieldSize = DataPaletteBlock.class.getDeclaredField("e");
|
||||
fieldSize.setAccessible(true);
|
||||
|
||||
try {
|
||||
methodTileEntityLoad = TileEntity.class.getDeclaredMethod("a", NBTTagCompound.class);
|
||||
methodTileEntityLoad.setAccessible(true);
|
||||
} catch (Throwable ignore) {}
|
||||
|
||||
Field fieldAir = DataPaletteBlock.class.getDeclaredField("a");
|
||||
fieldAir.setAccessible(true);
|
||||
air = (IBlockData) fieldAir.get(null);
|
||||
|
@ -64,6 +64,7 @@ public final class FaweAdapter_1_12 implements BukkitImplAdapter
|
||||
private final Logger logger = Logger.getLogger(getClass().getCanonicalName());
|
||||
private final Field nbtListTagListField;
|
||||
private final Method nbtCreateTagMethod;
|
||||
protected static Method methodTileEntityLoad;
|
||||
|
||||
public FaweAdapter_1_12() throws NoSuchFieldException, NoSuchMethodException {
|
||||
this.nbtListTagListField = NBTTagList.class.getDeclaredField("list");
|
||||
@ -71,11 +72,23 @@ public final class FaweAdapter_1_12 implements BukkitImplAdapter
|
||||
|
||||
this.nbtCreateTagMethod = NBTBase.class.getDeclaredMethod("createTag", new Class[] { Byte.TYPE });
|
||||
this.nbtCreateTagMethod.setAccessible(true);
|
||||
try {
|
||||
methodTileEntityLoad = TileEntity.class.getDeclaredMethod("a", NBTTagCompound.class);
|
||||
methodTileEntityLoad.setAccessible(true);
|
||||
} catch (Throwable ignore) {}
|
||||
}
|
||||
|
||||
private static void readTagIntoTileEntity(NBTTagCompound tag, TileEntity tileEntity)
|
||||
{
|
||||
tileEntity.a(tag);
|
||||
if (methodTileEntityLoad != null) {
|
||||
try {
|
||||
methodTileEntityLoad.invoke(tileEntity, tag); // ReadTagIntoTile
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
tileEntity.load(tag);
|
||||
}
|
||||
}
|
||||
|
||||
private static void readTileEntityIntoTag(TileEntity tileEntity, NBTTagCompound tag)
|
||||
|
Loading…
Reference in New Issue
Block a user