mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-09-02 13:58:22 +00:00
35 lines
1.8 KiB
Java
35 lines
1.8 KiB
Java
|
package com.sk89q.worldedit.bukkit.adapter.impl.fawe.v1_19_R3;
|
||
|
|
||
|
import com.fastasyncworldedit.bukkit.adapter.MapChunkUtil;
|
||
|
import com.sk89q.worldedit.bukkit.adapter.Refraction;
|
||
|
import net.minecraft.network.protocol.game.ClientboundLevelChunkPacketData;
|
||
|
import net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket;
|
||
|
|
||
|
//TODO un-very-break-this
|
||
|
public class PaperweightMapChunkUtil extends MapChunkUtil<ClientboundLevelChunkWithLightPacket> {
|
||
|
|
||
|
public PaperweightMapChunkUtil() throws NoSuchFieldException {
|
||
|
fieldX = ClientboundLevelChunkPacketData.class.getDeclaredField(Refraction.pickName("TWO_MEGABYTES", "a"));
|
||
|
fieldZ = ClientboundLevelChunkWithLightPacket.class.getDeclaredField(Refraction.pickName("x", "a"));
|
||
|
fieldBitMask = ClientboundLevelChunkWithLightPacket.class.getDeclaredField(Refraction.pickName("z", "b"));
|
||
|
fieldHeightMap = ClientboundLevelChunkPacketData.class.getDeclaredField(Refraction.pickName("heightmaps", "b"));
|
||
|
fieldChunkData = ClientboundLevelChunkWithLightPacket.class.getDeclaredField(Refraction.pickName("chunkData", "c"));
|
||
|
fieldBlockEntities = ClientboundLevelChunkPacketData.class.getDeclaredField(Refraction.pickName("buffer", "c"));
|
||
|
fieldFull = ClientboundLevelChunkPacketData.class.getDeclaredField(Refraction.pickName("blockEntitiesData", "d"));
|
||
|
fieldX.setAccessible(true);
|
||
|
fieldZ.setAccessible(true);
|
||
|
fieldBitMask.setAccessible(true);
|
||
|
fieldHeightMap.setAccessible(true);
|
||
|
fieldChunkData.setAccessible(true);
|
||
|
fieldBlockEntities.setAccessible(true);
|
||
|
fieldFull.setAccessible(true);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public ClientboundLevelChunkWithLightPacket createPacket() {
|
||
|
// TODO ??? return new ClientboundLevelChunkPacket();
|
||
|
throw new UnsupportedOperationException();
|
||
|
}
|
||
|
|
||
|
}
|