use of com.viaversion.viaversion.protocols.protocol1_16to1_15_2.ClientboundPackets1_16 in project ViaBackwards by ViaVersion.
the class BlockItemPackets1_16 method registerPackets.
@Override
protected void registerPackets() {
BlockRewriter blockRewriter = new BlockRewriter(protocol, Type.POSITION1_14);
RecipeRewriter1_14 recipeRewriter = new RecipeRewriter1_14(protocol);
// Remove new smithing type, only in this handler
protocol.registerClientbound(ClientboundPackets1_16.DECLARE_RECIPES, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
int size = wrapper.passthrough(Type.VAR_INT);
int newSize = size;
for (int i = 0; i < size; i++) {
String originalType = wrapper.read(Type.STRING);
String type = originalType.replace("minecraft:", "");
if (type.equals("smithing")) {
newSize--;
wrapper.read(Type.STRING);
wrapper.read(Type.FLAT_VAR_INT_ITEM_ARRAY_VAR_INT);
wrapper.read(Type.FLAT_VAR_INT_ITEM_ARRAY_VAR_INT);
wrapper.read(Type.FLAT_VAR_INT_ITEM);
continue;
}
wrapper.write(Type.STRING, originalType);
// Recipe Identifier
String id = wrapper.passthrough(Type.STRING);
recipeRewriter.handle(wrapper, type);
}
wrapper.set(Type.VAR_INT, 0, newSize);
});
}
});
registerSetCooldown(ClientboundPackets1_16.COOLDOWN);
registerWindowItems(ClientboundPackets1_16.WINDOW_ITEMS, Type.FLAT_VAR_INT_ITEM_ARRAY);
registerSetSlot(ClientboundPackets1_16.SET_SLOT, Type.FLAT_VAR_INT_ITEM);
registerTradeList(ClientboundPackets1_16.TRADE_LIST, Type.FLAT_VAR_INT_ITEM);
registerAdvancements(ClientboundPackets1_16.ADVANCEMENTS, Type.FLAT_VAR_INT_ITEM);
blockRewriter.registerAcknowledgePlayerDigging(ClientboundPackets1_16.ACKNOWLEDGE_PLAYER_DIGGING);
blockRewriter.registerBlockAction(ClientboundPackets1_16.BLOCK_ACTION);
blockRewriter.registerBlockChange(ClientboundPackets1_16.BLOCK_CHANGE);
blockRewriter.registerMultiBlockChange(ClientboundPackets1_16.MULTI_BLOCK_CHANGE);
protocol.registerClientbound(ClientboundPackets1_16.ENTITY_EQUIPMENT, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
int entityId = wrapper.passthrough(Type.VAR_INT);
List<EquipmentData> equipmentData = new ArrayList<>();
byte slot;
do {
slot = wrapper.read(Type.BYTE);
Item item = handleItemToClient(wrapper.read(Type.FLAT_VAR_INT_ITEM));
int rawSlot = slot & 0x7F;
equipmentData.add(new EquipmentData(rawSlot, item));
} while ((slot & 0xFFFFFF80) != 0);
// Send first data in the current packet
EquipmentData firstData = equipmentData.get(0);
wrapper.write(Type.VAR_INT, firstData.slot);
wrapper.write(Type.FLAT_VAR_INT_ITEM, firstData.item);
// If there are more items, send new packets for them
for (int i = 1; i < equipmentData.size(); i++) {
PacketWrapper equipmentPacket = wrapper.create(ClientboundPackets1_15.ENTITY_EQUIPMENT);
EquipmentData data = equipmentData.get(i);
equipmentPacket.write(Type.VAR_INT, entityId);
equipmentPacket.write(Type.VAR_INT, data.slot);
equipmentPacket.write(Type.FLAT_VAR_INT_ITEM, data.item);
equipmentPacket.send(Protocol1_15_2To1_16.class);
}
});
}
});
protocol.registerClientbound(ClientboundPackets1_16.UPDATE_LIGHT, new PacketRemapper() {
@Override
public void registerMap() {
// x
map(Type.VAR_INT);
// y
map(Type.VAR_INT);
map(Type.BOOLEAN, Type.NOTHING);
}
});
protocol.registerClientbound(ClientboundPackets1_16.CHUNK_DATA, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
Chunk chunk = wrapper.read(new Chunk1_16Type());
wrapper.write(new Chunk1_15Type(), chunk);
for (int i = 0; i < chunk.getSections().length; i++) {
ChunkSection section = chunk.getSections()[i];
if (section == null)
continue;
for (int j = 0; j < section.getPaletteSize(); j++) {
int old = section.getPaletteEntry(j);
section.setPaletteEntry(j, protocol.getMappingData().getNewBlockStateId(old));
}
}
CompoundTag heightMaps = chunk.getHeightMap();
for (Tag heightMapTag : heightMaps.values()) {
LongArrayTag heightMap = (LongArrayTag) heightMapTag;
int[] heightMapData = new int[256];
CompactArrayUtil.iterateCompactArrayWithPadding(9, heightMapData.length, heightMap.getValue(), (i, v) -> heightMapData[i] = v);
heightMap.setValue(CompactArrayUtil.createCompactArray(9, heightMapData.length, i -> heightMapData[i]));
}
if (chunk.isBiomeData()) {
for (int i = 0; i < 1024; i++) {
int biome = chunk.getBiomeData()[i];
switch(biome) {
// new nether biomes
case 170:
case 171:
case 172:
case 173:
chunk.getBiomeData()[i] = 8;
break;
}
}
}
if (chunk.getBlockEntities() == null)
return;
for (CompoundTag blockEntity : chunk.getBlockEntities()) {
handleBlockEntity(blockEntity);
}
});
}
});
blockRewriter.registerEffect(ClientboundPackets1_16.EFFECT, 1010, 2001);
registerSpawnParticle(ClientboundPackets1_16.SPAWN_PARTICLE, Type.FLAT_VAR_INT_ITEM, Type.DOUBLE);
protocol.registerClientbound(ClientboundPackets1_16.WINDOW_PROPERTY, new PacketRemapper() {
@Override
public void registerMap() {
// Window id
map(Type.UNSIGNED_BYTE);
// Property
map(Type.SHORT);
// Value
map(Type.SHORT);
handler(wrapper -> {
short property = wrapper.get(Type.SHORT, 0);
if (property >= 4 && property <= 6) {
// Enchantment id
short enchantmentId = wrapper.get(Type.SHORT, 1);
if (enchantmentId > 11) {
// soul_speed
wrapper.set(Type.SHORT, 1, --enchantmentId);
} else if (enchantmentId == 11) {
wrapper.set(Type.SHORT, 1, (short) 9);
}
}
});
}
});
protocol.registerClientbound(ClientboundPackets1_16.MAP_DATA, new PacketRemapper() {
@Override
public void registerMap() {
// Map ID
map(Type.VAR_INT);
// Scale
map(Type.BYTE);
// Tracking Position
map(Type.BOOLEAN);
// Locked
map(Type.BOOLEAN);
handler(MapColorRewriter.getRewriteHandler(MapColorRewrites::getMappedColor));
}
});
protocol.registerClientbound(ClientboundPackets1_16.BLOCK_ENTITY_DATA, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
Position position = wrapper.passthrough(Type.POSITION1_14);
short action = wrapper.passthrough(Type.UNSIGNED_BYTE);
CompoundTag tag = wrapper.passthrough(Type.NBT);
handleBlockEntity(tag);
});
}
});
registerClickWindow(ServerboundPackets1_14.CLICK_WINDOW, Type.FLAT_VAR_INT_ITEM);
registerCreativeInvAction(ServerboundPackets1_14.CREATIVE_INVENTORY_ACTION, Type.FLAT_VAR_INT_ITEM);
protocol.registerServerbound(ServerboundPackets1_14.EDIT_BOOK, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> handleItemToServer(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM)));
}
});
}
use of com.viaversion.viaversion.protocols.protocol1_16to1_15_2.ClientboundPackets1_16 in project ViaBackwards by ViaVersion.
the class EntityPackets1_16 method registerPackets.
@Override
protected void registerPackets() {
protocol.registerClientbound(ClientboundPackets1_16.SPAWN_ENTITY, new PacketRemapper() {
@Override
public void registerMap() {
// 0 - Entity id
map(Type.VAR_INT);
// 1 - Entity UUID
map(Type.UUID);
// 2 - Entity Type
map(Type.VAR_INT);
// 3 - X
map(Type.DOUBLE);
// 4 - Y
map(Type.DOUBLE);
// 5 - Z
map(Type.DOUBLE);
// 6 - Pitch
map(Type.BYTE);
// 7 - Yaw
map(Type.BYTE);
// 8 - Data
map(Type.INT);
handler(wrapper -> {
EntityType entityType = typeFromId(wrapper.get(Type.VAR_INT, 1));
if (entityType == Entity1_16Types.LIGHTNING_BOLT) {
// Map to old weather entity packet
wrapper.cancel();
PacketWrapper spawnLightningPacket = wrapper.create(ClientboundPackets1_15.SPAWN_GLOBAL_ENTITY);
// Entity id
spawnLightningPacket.write(Type.VAR_INT, wrapper.get(Type.VAR_INT, 0));
// Lightning type
spawnLightningPacket.write(Type.BYTE, (byte) 1);
// X
spawnLightningPacket.write(Type.DOUBLE, wrapper.get(Type.DOUBLE, 0));
// Y
spawnLightningPacket.write(Type.DOUBLE, wrapper.get(Type.DOUBLE, 1));
// Z
spawnLightningPacket.write(Type.DOUBLE, wrapper.get(Type.DOUBLE, 2));
spawnLightningPacket.send(Protocol1_15_2To1_16.class);
}
});
handler(getSpawnTrackerWithDataHandler(Entity1_16Types.FALLING_BLOCK));
}
});
registerSpawnTracker(ClientboundPackets1_16.SPAWN_MOB);
protocol.registerClientbound(ClientboundPackets1_16.RESPAWN, new PacketRemapper() {
@Override
public void registerMap() {
// Dimension Type
map(dimensionTransformer);
handler(wrapper -> {
// Grab the tracker for world names
WorldNameTracker worldNameTracker = wrapper.user().get(WorldNameTracker.class);
// World Name
String nextWorldName = wrapper.read(Type.STRING);
// Seed
wrapper.passthrough(Type.LONG);
// Gamemode
wrapper.passthrough(Type.UNSIGNED_BYTE);
// Previous gamemode
wrapper.read(Type.BYTE);
// Grab client world
ClientWorld clientWorld = wrapper.user().get(ClientWorld.class);
int dimension = wrapper.get(Type.INT, 0);
// Send a dummy respawn with a different dimension if the world name was different and the same dimension was used
if (clientWorld.getEnvironment() != null && dimension == clientWorld.getEnvironment().getId() && (wrapper.user().isClientSide() || Via.getPlatform().isProxy() || // Hotfix for https://github.com/ViaVersion/ViaBackwards/issues/381
wrapper.user().getProtocolInfo().getProtocolVersion() <= ProtocolVersion.v1_12_2.getVersion() || !nextWorldName.equals(worldNameTracker.getWorldName()))) {
PacketWrapper packet = wrapper.create(ClientboundPackets1_15.RESPAWN);
packet.write(Type.INT, dimension == 0 ? -1 : 0);
packet.write(Type.LONG, 0L);
packet.write(Type.UNSIGNED_BYTE, (short) 0);
packet.write(Type.STRING, "default");
packet.send(Protocol1_15_2To1_16.class);
}
clientWorld.setEnvironment(dimension);
// Level type
wrapper.write(Type.STRING, "default");
// Debug
wrapper.read(Type.BOOLEAN);
if (wrapper.read(Type.BOOLEAN)) {
wrapper.set(Type.STRING, 0, "flat");
}
// Keep all playerdata
wrapper.read(Type.BOOLEAN);
// Finally update the world name
worldNameTracker.setWorldName(nextWorldName);
});
}
});
protocol.registerClientbound(ClientboundPackets1_16.JOIN_GAME, new PacketRemapper() {
@Override
public void registerMap() {
// Entity ID
map(Type.INT);
// Gamemode
map(Type.UNSIGNED_BYTE);
// Previous gamemode
map(Type.BYTE, Type.NOTHING);
// World list
map(Type.STRING_ARRAY, Type.NOTHING);
// whatever this is
map(Type.NBT, Type.NOTHING);
// Dimension Type
map(dimensionTransformer);
handler(wrapper -> {
WorldNameTracker worldNameTracker = wrapper.user().get(WorldNameTracker.class);
// Save the world name
worldNameTracker.setWorldName(wrapper.read(Type.STRING));
});
// Seed
map(Type.LONG);
// Max players
map(Type.UNSIGNED_BYTE);
handler(wrapper -> {
ClientWorld clientChunks = wrapper.user().get(ClientWorld.class);
clientChunks.setEnvironment(wrapper.get(Type.INT, 1));
tracker(wrapper.user()).addEntity(wrapper.get(Type.INT, 0), Entity1_16Types.PLAYER);
// Level type
wrapper.write(Type.STRING, "default");
// View distance
wrapper.passthrough(Type.VAR_INT);
// Reduced debug info
wrapper.passthrough(Type.BOOLEAN);
// Show death screen
wrapper.passthrough(Type.BOOLEAN);
// Debug
wrapper.read(Type.BOOLEAN);
if (wrapper.read(Type.BOOLEAN)) {
wrapper.set(Type.STRING, 0, "flat");
}
});
}
});
registerTracker(ClientboundPackets1_16.SPAWN_EXPERIENCE_ORB, Entity1_16Types.EXPERIENCE_ORB);
// F Spawn Global Object, it is no longer with us :(
registerTracker(ClientboundPackets1_16.SPAWN_PAINTING, Entity1_16Types.PAINTING);
registerTracker(ClientboundPackets1_16.SPAWN_PLAYER, Entity1_16Types.PLAYER);
registerRemoveEntities(ClientboundPackets1_16.DESTROY_ENTITIES);
registerMetadataRewriter(ClientboundPackets1_16.ENTITY_METADATA, Types1_16.METADATA_LIST, Types1_14.METADATA_LIST);
protocol.registerClientbound(ClientboundPackets1_16.ENTITY_PROPERTIES, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
wrapper.passthrough(Type.VAR_INT);
int size = wrapper.passthrough(Type.INT);
for (int i = 0; i < size; i++) {
String attributeIdentifier = wrapper.read(Type.STRING);
String oldKey = protocol.getMappingData().getAttributeMappings().get(attributeIdentifier);
wrapper.write(Type.STRING, oldKey != null ? oldKey : attributeIdentifier.replace("minecraft:", ""));
wrapper.passthrough(Type.DOUBLE);
int modifierSize = wrapper.passthrough(Type.VAR_INT);
for (int j = 0; j < modifierSize; j++) {
wrapper.passthrough(Type.UUID);
wrapper.passthrough(Type.DOUBLE);
wrapper.passthrough(Type.BYTE);
}
}
});
}
});
protocol.registerClientbound(ClientboundPackets1_16.PLAYER_INFO, new PacketRemapper() {
@Override
public void registerMap() {
handler(packetWrapper -> {
int action = packetWrapper.passthrough(Type.VAR_INT);
int playerCount = packetWrapper.passthrough(Type.VAR_INT);
for (int i = 0; i < playerCount; i++) {
packetWrapper.passthrough(Type.UUID);
if (action == 0) {
// Add
packetWrapper.passthrough(Type.STRING);
int properties = packetWrapper.passthrough(Type.VAR_INT);
for (int j = 0; j < properties; j++) {
packetWrapper.passthrough(Type.STRING);
packetWrapper.passthrough(Type.STRING);
if (packetWrapper.passthrough(Type.BOOLEAN)) {
packetWrapper.passthrough(Type.STRING);
}
}
packetWrapper.passthrough(Type.VAR_INT);
packetWrapper.passthrough(Type.VAR_INT);
if (packetWrapper.passthrough(Type.BOOLEAN)) {
// Display Name
protocol.getTranslatableRewriter().processText(packetWrapper.passthrough(Type.COMPONENT));
}
} else if (action == 1) {
// Update Game Mode
packetWrapper.passthrough(Type.VAR_INT);
} else if (action == 2) {
// Update Ping
packetWrapper.passthrough(Type.VAR_INT);
} else if (action == 3) {
// Update Display Name
if (packetWrapper.passthrough(Type.BOOLEAN)) {
// Display name
protocol.getTranslatableRewriter().processText(packetWrapper.passthrough(Type.COMPONENT));
}
}
// 4 = Remove Player
}
});
}
});
}
use of com.viaversion.viaversion.protocols.protocol1_16to1_15_2.ClientboundPackets1_16 in project ViaBackwards by ViaVersion.
the class Protocol1_16_1To1_16_2 method registerPackets.
@Override
protected void registerPackets() {
executeAsyncAfterLoaded(Protocol1_16_2To1_16_1.class, MAPPINGS::load);
translatableRewriter.registerBossBar(ClientboundPackets1_16_2.BOSSBAR);
translatableRewriter.registerCombatEvent(ClientboundPackets1_16_2.COMBAT_EVENT);
translatableRewriter.registerDisconnect(ClientboundPackets1_16_2.DISCONNECT);
translatableRewriter.registerTabList(ClientboundPackets1_16_2.TAB_LIST);
translatableRewriter.registerTitle(ClientboundPackets1_16_2.TITLE);
translatableRewriter.registerOpenWindow(ClientboundPackets1_16_2.OPEN_WINDOW);
translatableRewriter.registerPing();
new CommandRewriter1_16_2(this).registerDeclareCommands(ClientboundPackets1_16_2.DECLARE_COMMANDS);
(blockItemPackets = new BlockItemPackets1_16_2(this)).register();
entityRewriter.register();
SoundRewriter soundRewriter = new SoundRewriter(this);
soundRewriter.registerSound(ClientboundPackets1_16_2.SOUND);
soundRewriter.registerSound(ClientboundPackets1_16_2.ENTITY_SOUND);
soundRewriter.registerNamedSound(ClientboundPackets1_16_2.NAMED_SOUND);
soundRewriter.registerStopSound(ClientboundPackets1_16_2.STOP_SOUND);
registerClientbound(ClientboundPackets1_16_2.CHAT_MESSAGE, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
JsonElement message = wrapper.passthrough(Type.COMPONENT);
translatableRewriter.processText(message);
byte position = wrapper.passthrough(Type.BYTE);
if (position == 2) {
// https://bugs.mojang.com/browse/MC-119145
wrapper.clearPacket();
wrapper.setId(ClientboundPackets1_16.TITLE.ordinal());
wrapper.write(Type.VAR_INT, 2);
wrapper.write(Type.COMPONENT, message);
}
});
}
});
// Recipe book data has been split into 2 separate packets
registerServerbound(ServerboundPackets1_16.RECIPE_BOOK_DATA, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
int type = wrapper.read(Type.VAR_INT);
if (type == 0) {
// Shown, change to its own packet
// Recipe
wrapper.passthrough(Type.STRING);
wrapper.setId(ServerboundPackets1_16_2.SEEN_RECIPE.ordinal());
} else {
wrapper.cancel();
// Settings
for (int i = 0; i < 3; i++) {
sendSeenRecipePacket(i, wrapper);
}
}
}
private void sendSeenRecipePacket(int recipeType, PacketWrapper wrapper) throws Exception {
boolean open = wrapper.read(Type.BOOLEAN);
boolean filter = wrapper.read(Type.BOOLEAN);
PacketWrapper newPacket = wrapper.create(ServerboundPackets1_16_2.RECIPE_BOOK_DATA);
newPacket.write(Type.VAR_INT, recipeType);
newPacket.write(Type.BOOLEAN, open);
newPacket.write(Type.BOOLEAN, filter);
newPacket.sendToServer(Protocol1_16_1To1_16_2.class);
}
});
}
});
new TagRewriter(this).register(ClientboundPackets1_16_2.TAGS, RegistryType.ENTITY);
new StatisticsRewriter(this).register(ClientboundPackets1_16_2.STATISTICS);
}
use of com.viaversion.viaversion.protocols.protocol1_16to1_15_2.ClientboundPackets1_16 in project ViaVersion by ViaVersion.
the class Protocol1_16_2To1_16_1 method registerPackets.
@Override
protected void registerPackets() {
metadataRewriter.register();
itemRewriter.register();
EntityPackets.register(this);
WorldPackets.register(this);
tagRewriter = new TagRewriter(this);
tagRewriter.register(ClientboundPackets1_16.TAGS, RegistryType.ENTITY);
new StatisticsRewriter(this).register(ClientboundPackets1_16.STATISTICS);
SoundRewriter soundRewriter = new SoundRewriter(this);
soundRewriter.registerSound(ClientboundPackets1_16.SOUND);
soundRewriter.registerSound(ClientboundPackets1_16.ENTITY_SOUND);
// Recipe book data has been split into 2 separate packets
registerServerbound(ServerboundPackets1_16_2.RECIPE_BOOK_DATA, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
int recipeType = wrapper.read(Type.VAR_INT);
boolean open = wrapper.read(Type.BOOLEAN);
boolean filter = wrapper.read(Type.BOOLEAN);
// Settings
wrapper.write(Type.VAR_INT, 1);
// Crafting
wrapper.write(Type.BOOLEAN, recipeType == 0 && open);
wrapper.write(Type.BOOLEAN, filter);
// Furnace
wrapper.write(Type.BOOLEAN, recipeType == 1 && open);
wrapper.write(Type.BOOLEAN, filter);
// Blast Furnace
wrapper.write(Type.BOOLEAN, recipeType == 2 && open);
wrapper.write(Type.BOOLEAN, filter);
// Smoker
wrapper.write(Type.BOOLEAN, recipeType == 3 && open);
wrapper.write(Type.BOOLEAN, filter);
});
}
});
registerServerbound(ServerboundPackets1_16_2.SEEN_RECIPE, ServerboundPackets1_16.RECIPE_BOOK_DATA, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
String recipe = wrapper.read(Type.STRING);
// Shown
wrapper.write(Type.VAR_INT, 0);
wrapper.write(Type.STRING, recipe);
});
}
});
}
use of com.viaversion.viaversion.protocols.protocol1_16to1_15_2.ClientboundPackets1_16 in project ViaVersion by ViaVersion.
the class InventoryPackets method registerPackets.
@Override
public void registerPackets() {
registerSetCooldown(ClientboundPackets1_16.COOLDOWN);
registerWindowItems(ClientboundPackets1_16.WINDOW_ITEMS, Type.FLAT_VAR_INT_ITEM_ARRAY);
registerTradeList(ClientboundPackets1_16.TRADE_LIST, Type.FLAT_VAR_INT_ITEM);
registerSetSlot(ClientboundPackets1_16.SET_SLOT, Type.FLAT_VAR_INT_ITEM);
registerEntityEquipmentArray(ClientboundPackets1_16.ENTITY_EQUIPMENT, Type.FLAT_VAR_INT_ITEM);
registerAdvancements(ClientboundPackets1_16.ADVANCEMENTS, Type.FLAT_VAR_INT_ITEM);
protocol.registerClientbound(ClientboundPackets1_16.UNLOCK_RECIPES, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
wrapper.passthrough(Type.VAR_INT);
// Open
wrapper.passthrough(Type.BOOLEAN);
// Filter
wrapper.passthrough(Type.BOOLEAN);
// Furnace
wrapper.passthrough(Type.BOOLEAN);
// Filter furnace
wrapper.passthrough(Type.BOOLEAN);
// Blast furnace / smoker
wrapper.write(Type.BOOLEAN, false);
wrapper.write(Type.BOOLEAN, false);
wrapper.write(Type.BOOLEAN, false);
wrapper.write(Type.BOOLEAN, false);
});
}
});
new RecipeRewriter1_16(protocol).registerDefaultHandler(ClientboundPackets1_16.DECLARE_RECIPES);
registerClickWindow(ServerboundPackets1_16_2.CLICK_WINDOW, Type.FLAT_VAR_INT_ITEM);
registerCreativeInvAction(ServerboundPackets1_16_2.CREATIVE_INVENTORY_ACTION, Type.FLAT_VAR_INT_ITEM);
protocol.registerServerbound(ServerboundPackets1_16_2.EDIT_BOOK, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> handleItemToServer(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM)));
}
});
registerSpawnParticle(ClientboundPackets1_16.SPAWN_PARTICLE, Type.FLAT_VAR_INT_ITEM, Type.DOUBLE);
}
Aggregations