3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-11-17 13:30:14 +01:00
Dieser Commit ist enthalten in:
KennyTV 2021-04-28 13:08:07 +02:00
Ursprung 4ea5a76337
Commit 687e1f4f43
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
54 geänderte Dateien mit 261 neuen und 261 gelöschten Zeilen

Datei anzeigen

@ -43,7 +43,7 @@ public abstract class EntityRewriter<T extends BackwardsProtocol> extends Entity
}
public void registerSpawnTrackerWithData(ClientboundPacketType packetType, EntityType fallingBlockType) {
protocol.registerOutgoing(packetType, new PacketRemapper() {
protocol.registerClientbound(packetType, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity id
@ -71,7 +71,7 @@ public abstract class EntityRewriter<T extends BackwardsProtocol> extends Entity
}
public void registerSpawnTracker(ClientboundPacketType packetType) {
protocol.registerOutgoing(packetType, new PacketRemapper() {
protocol.registerClientbound(packetType, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID
@ -99,7 +99,7 @@ public abstract class EntityRewriter<T extends BackwardsProtocol> extends Entity
* Helper method to handle a metadata list packet and its full initial meta rewrite.
*/
protected void registerMetadataRewriter(ClientboundPacketType packetType, Type<List<Metadata>> oldMetaType, Type<List<Metadata>> newMetaType) {
getProtocol().registerOutgoing(packetType, new PacketRemapper() {
getProtocol().registerClientbound(packetType, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID

Datei anzeigen

@ -232,7 +232,7 @@ public abstract class EntityRewriterBase<T extends BackwardsProtocol> extends Re
* Helper method to handle player, painting, or xp orb trackers without meta changes.
*/
protected void registerExtraTracker(ClientboundPacketType packetType, EntityType entityType, Type intType) {
getProtocol().registerOutgoing(packetType, new PacketRemapper() {
getProtocol().registerClientbound(packetType, new PacketRemapper() {
@Override
public void registerMap() {
map(intType); // 0 - Entity id
@ -246,7 +246,7 @@ public abstract class EntityRewriterBase<T extends BackwardsProtocol> extends Re
}
protected void registerEntityDestroy(ClientboundPacketType packetType) {
getProtocol().registerOutgoing(packetType, new PacketRemapper() {
getProtocol().registerClientbound(packetType, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT_ARRAY_PRIMITIVE); // 0 - Entity ids

Datei anzeigen

@ -61,7 +61,7 @@ public abstract class LegacyEntityRewriter<T extends BackwardsProtocol> extends
}
protected void registerRespawn(ClientboundPacketType packetType) {
protocol.registerOutgoing(packetType, new PacketRemapper() {
protocol.registerClientbound(packetType, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT);
@ -74,7 +74,7 @@ public abstract class LegacyEntityRewriter<T extends BackwardsProtocol> extends
}
protected void registerJoinGame(ClientboundPacketType packetType, EntityType playerType) {
protocol.registerOutgoing(packetType, new PacketRemapper() {
protocol.registerClientbound(packetType, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // 0 - Entity ID
@ -90,7 +90,7 @@ public abstract class LegacyEntityRewriter<T extends BackwardsProtocol> extends
}
protected void registerMetadataRewriter(ClientboundPacketType packetType, Type<List<Metadata>> oldMetaType, Type<List<Metadata>> newMetaType) {
getProtocol().registerOutgoing(packetType, new PacketRemapper() {
getProtocol().registerClientbound(packetType, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID

Datei anzeigen

@ -33,7 +33,7 @@ public class SoundRewriter extends com.viaversion.viaversion.rewriter.SoundRewri
}
public void registerNamedSound(ClientboundPacketType packetType) {
protocol.registerOutgoing(packetType, new PacketRemapper() {
protocol.registerClientbound(packetType, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.STRING); // Sound identifier
@ -43,7 +43,7 @@ public class SoundRewriter extends com.viaversion.viaversion.rewriter.SoundRewri
}
public void registerStopSound(ClientboundPacketType packetType) {
protocol.registerOutgoing(packetType, new PacketRemapper() {
protocol.registerClientbound(packetType, new PacketRemapper() {
@Override
public void registerMap() {
handler(getStopSoundHandler());

Datei anzeigen

@ -63,7 +63,7 @@ public class TranslatableRewriter extends ComponentRewriter {
}
public void registerPing() {
protocol.registerOutgoing(State.LOGIN, 0x00, 0x00, new PacketRemapper() {
protocol.registerClientbound(State.LOGIN, 0x00, 0x00, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> processText(wrapper.passthrough(Type.COMPONENT)));
@ -72,7 +72,7 @@ public class TranslatableRewriter extends ComponentRewriter {
}
public void registerDisconnect(ClientboundPacketType packetType) {
protocol.registerOutgoing(packetType, new PacketRemapper() {
protocol.registerClientbound(packetType, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> processText(wrapper.passthrough(Type.COMPONENT)));
@ -81,7 +81,7 @@ public class TranslatableRewriter extends ComponentRewriter {
}
public void registerChatMessage(ClientboundPacketType packetType) {
protocol.registerOutgoing(packetType, new PacketRemapper() {
protocol.registerClientbound(packetType, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> processText(wrapper.passthrough(Type.COMPONENT)));
@ -90,7 +90,7 @@ public class TranslatableRewriter extends ComponentRewriter {
}
public void registerLegacyOpenWindow(ClientboundPacketType packetType) {
protocol.registerOutgoing(packetType, new PacketRemapper() {
protocol.registerClientbound(packetType, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.UNSIGNED_BYTE); // Id
@ -101,7 +101,7 @@ public class TranslatableRewriter extends ComponentRewriter {
}
public void registerOpenWindow(ClientboundPacketType packetType) {
protocol.registerOutgoing(packetType, new PacketRemapper() {
protocol.registerClientbound(packetType, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // Id
@ -112,7 +112,7 @@ public class TranslatableRewriter extends ComponentRewriter {
}
public void registerTabList(ClientboundPacketType packetType) {
protocol.registerOutgoing(packetType, new PacketRemapper() {
protocol.registerClientbound(packetType, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {

Datei anzeigen

@ -61,7 +61,7 @@ public class BlockItemPackets1_11 extends LegacyBlockItemRewriter<Protocol1_10To
protected void registerPackets() {
ItemRewriter itemRewriter = new ItemRewriter(protocol, this::handleItemToClient, this::handleItemToServer);
protocol.registerOutgoing(ClientboundPackets1_9_3.SET_SLOT, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.SET_SLOT, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.BYTE); // 0 - Window ID
@ -88,7 +88,7 @@ public class BlockItemPackets1_11 extends LegacyBlockItemRewriter<Protocol1_10To
}
});
protocol.registerOutgoing(ClientboundPackets1_9_3.WINDOW_ITEMS, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.WINDOW_ITEMS, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.UNSIGNED_BYTE); // 0 - Window ID
@ -122,7 +122,7 @@ public class BlockItemPackets1_11 extends LegacyBlockItemRewriter<Protocol1_10To
itemRewriter.registerEntityEquipment(ClientboundPackets1_9_3.ENTITY_EQUIPMENT, Type.ITEM);
// Plugin message Packet -> Trading
protocol.registerOutgoing(ClientboundPackets1_9_3.PLUGIN_MESSAGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.PLUGIN_MESSAGE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.STRING); // 0 - Channel
@ -153,7 +153,7 @@ public class BlockItemPackets1_11 extends LegacyBlockItemRewriter<Protocol1_10To
}
});
protocol.registerIncoming(ServerboundPackets1_9_3.CLICK_WINDOW, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_9_3.CLICK_WINDOW, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.UNSIGNED_BYTE); // 0 - Window ID
@ -186,7 +186,7 @@ public class BlockItemPackets1_11 extends LegacyBlockItemRewriter<Protocol1_10To
itemRewriter.registerCreativeInvAction(ServerboundPackets1_9_3.CREATIVE_INVENTORY_ACTION, Type.ITEM);
protocol.registerOutgoing(ClientboundPackets1_9_3.CHUNK_DATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.CHUNK_DATA, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -214,7 +214,7 @@ public class BlockItemPackets1_11 extends LegacyBlockItemRewriter<Protocol1_10To
}
});
protocol.registerOutgoing(ClientboundPackets1_9_3.BLOCK_CHANGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.BLOCK_CHANGE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION); // 0 - Block Position
@ -230,7 +230,7 @@ public class BlockItemPackets1_11 extends LegacyBlockItemRewriter<Protocol1_10To
}
});
protocol.registerOutgoing(ClientboundPackets1_9_3.MULTI_BLOCK_CHANGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.MULTI_BLOCK_CHANGE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // 0 - Chunk X
@ -248,7 +248,7 @@ public class BlockItemPackets1_11 extends LegacyBlockItemRewriter<Protocol1_10To
}
});
protocol.registerOutgoing(ClientboundPackets1_9_3.BLOCK_ENTITY_DATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.BLOCK_ENTITY_DATA, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION); // 0 - Position
@ -272,7 +272,7 @@ public class BlockItemPackets1_11 extends LegacyBlockItemRewriter<Protocol1_10To
}
});
protocol.registerOutgoing(ClientboundPackets1_9_3.OPEN_WINDOW, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.OPEN_WINDOW, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.UNSIGNED_BYTE); // 0 - Window ID
@ -304,7 +304,7 @@ public class BlockItemPackets1_11 extends LegacyBlockItemRewriter<Protocol1_10To
}
});
protocol.registerOutgoing(ClientboundPackets1_9_3.CLOSE_WINDOW, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.CLOSE_WINDOW, new PacketRemapper() {
@Override
public void registerMap() {
// Inventory tracking
@ -320,7 +320,7 @@ public class BlockItemPackets1_11 extends LegacyBlockItemRewriter<Protocol1_10To
});
protocol.registerIncoming(ServerboundPackets1_9_3.CLOSE_WINDOW, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_9_3.CLOSE_WINDOW, new PacketRemapper() {
@Override
public void registerMap() {
// Inventory tracking

Datei anzeigen

@ -48,7 +48,7 @@ public class EntityPackets1_11 extends LegacyEntityRewriter<Protocol1_10To1_11>
@Override
protected void registerPackets() {
protocol.registerOutgoing(ClientboundPackets1_9_3.EFFECT, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.EFFECT, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT);
@ -71,7 +71,7 @@ public class EntityPackets1_11 extends LegacyEntityRewriter<Protocol1_10To1_11>
}
});
protocol.registerOutgoing(ClientboundPackets1_9_3.SPAWN_ENTITY, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.SPAWN_ENTITY, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity id
@ -112,7 +112,7 @@ public class EntityPackets1_11 extends LegacyEntityRewriter<Protocol1_10To1_11>
registerExtraTracker(ClientboundPackets1_9_3.SPAWN_EXPERIENCE_ORB, Entity1_11Types.EntityType.EXPERIENCE_ORB);
registerExtraTracker(ClientboundPackets1_9_3.SPAWN_GLOBAL_ENTITY, Entity1_11Types.EntityType.WEATHER);
protocol.registerOutgoing(ClientboundPackets1_9_3.SPAWN_MOB, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.SPAWN_MOB, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity id
@ -169,7 +169,7 @@ public class EntityPackets1_11 extends LegacyEntityRewriter<Protocol1_10To1_11>
registerJoinGame(ClientboundPackets1_9_3.JOIN_GAME, Entity1_11Types.EntityType.PLAYER);
registerRespawn(ClientboundPackets1_9_3.RESPAWN);
protocol.registerOutgoing(ClientboundPackets1_9_3.SPAWN_PLAYER, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.SPAWN_PLAYER, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID
@ -188,7 +188,7 @@ public class EntityPackets1_11 extends LegacyEntityRewriter<Protocol1_10To1_11>
registerEntityDestroy(ClientboundPackets1_9_3.DESTROY_ENTITIES);
registerMetadataRewriter(ClientboundPackets1_9_3.ENTITY_METADATA, Types1_9.METADATA_LIST);
protocol.registerOutgoing(ClientboundPackets1_9_3.ENTITY_STATUS, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.ENTITY_STATUS, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // 0 - Entity ID

Datei anzeigen

@ -39,7 +39,7 @@ public class PlayerPackets1_11 {
};
public void register(Protocol1_10To1_11 protocol) {
protocol.registerOutgoing(ClientboundPackets1_9_3.TITLE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.TITLE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Action
@ -67,7 +67,7 @@ public class PlayerPackets1_11 {
}
});
protocol.registerOutgoing(ClientboundPackets1_9_3.COLLECT_ITEM, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.COLLECT_ITEM, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Collected entity id
@ -78,7 +78,7 @@ public class PlayerPackets1_11 {
});
protocol.registerIncoming(ServerboundPackets1_9_3.PLAYER_BLOCK_PLACEMENT, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_9_3.PLAYER_BLOCK_PLACEMENT, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION); // 0 - Location

Datei anzeigen

@ -51,7 +51,7 @@ public class Protocol1_11_1To1_12 extends BackwardsProtocol<ClientboundPackets1_
new SoundPackets1_12(this).register();
new ChatPackets1_12(this).register();
registerOutgoing(ClientboundPackets1_12.TITLE, new PacketRemapper() {
registerClientbound(ClientboundPackets1_12.TITLE, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -64,9 +64,9 @@ public class Protocol1_11_1To1_12 extends BackwardsProtocol<ClientboundPackets1_
}
});
cancelOutgoing(ClientboundPackets1_12.ADVANCEMENTS);
cancelOutgoing(ClientboundPackets1_12.UNLOCK_RECIPES);
cancelOutgoing(ClientboundPackets1_12.SELECT_ADVANCEMENTS_TAB);
cancelClientbound(ClientboundPackets1_12.ADVANCEMENTS);
cancelClientbound(ClientboundPackets1_12.UNLOCK_RECIPES);
cancelClientbound(ClientboundPackets1_12.SELECT_ADVANCEMENTS_TAB);
}
@Override

Datei anzeigen

@ -51,7 +51,7 @@ public class BlockItemPackets1_12 extends LegacyBlockItemRewriter<Protocol1_11_1
@Override
protected void registerPackets() {
protocol.registerOutgoing(ClientboundPackets1_12.MAP_DATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_12.MAP_DATA, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
@ -96,7 +96,7 @@ public class BlockItemPackets1_12 extends LegacyBlockItemRewriter<Protocol1_11_1
itemRewriter.registerEntityEquipment(ClientboundPackets1_12.ENTITY_EQUIPMENT, Type.ITEM);
// Plugin message Packet -> Trading
protocol.registerOutgoing(ClientboundPackets1_12.PLUGIN_MESSAGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_12.PLUGIN_MESSAGE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.STRING); // 0 - Channel
@ -126,7 +126,7 @@ public class BlockItemPackets1_12 extends LegacyBlockItemRewriter<Protocol1_11_1
}
});
protocol.registerIncoming(ServerboundPackets1_9_3.CLICK_WINDOW, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_9_3.CLICK_WINDOW, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.UNSIGNED_BYTE); // 0 - Window ID
@ -167,7 +167,7 @@ public class BlockItemPackets1_12 extends LegacyBlockItemRewriter<Protocol1_11_1
itemRewriter.registerCreativeInvAction(ServerboundPackets1_9_3.CREATIVE_INVENTORY_ACTION, Type.ITEM);
protocol.registerOutgoing(ClientboundPackets1_12.CHUNK_DATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_12.CHUNK_DATA, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -184,7 +184,7 @@ public class BlockItemPackets1_12 extends LegacyBlockItemRewriter<Protocol1_11_1
}
});
protocol.registerOutgoing(ClientboundPackets1_12.BLOCK_CHANGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_12.BLOCK_CHANGE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION); // 0 - Block Position
@ -200,7 +200,7 @@ public class BlockItemPackets1_12 extends LegacyBlockItemRewriter<Protocol1_11_1
}
});
protocol.registerOutgoing(ClientboundPackets1_12.MULTI_BLOCK_CHANGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_12.MULTI_BLOCK_CHANGE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // 0 - Chunk X
@ -218,7 +218,7 @@ public class BlockItemPackets1_12 extends LegacyBlockItemRewriter<Protocol1_11_1
}
});
protocol.registerOutgoing(ClientboundPackets1_12.BLOCK_ENTITY_DATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_12.BLOCK_ENTITY_DATA, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION); // 0 - Position
@ -245,7 +245,7 @@ public class BlockItemPackets1_12 extends LegacyBlockItemRewriter<Protocol1_11_1
return data;
});
protocol.registerIncoming(ServerboundPackets1_9_3.CLIENT_STATUS, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_9_3.CLIENT_STATUS, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // Action ID

Datei anzeigen

@ -46,7 +46,7 @@ public class ChatPackets1_12 extends Rewriter<Protocol1_11_1To1_12> {
@Override
protected void registerPackets() {
protocol.registerOutgoing(ClientboundPackets1_12.CHAT_MESSAGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_12.CHAT_MESSAGE, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {

Datei anzeigen

@ -46,7 +46,7 @@ public class EntityPackets1_12 extends LegacyEntityRewriter<Protocol1_11_1To1_12
@Override
protected void registerPackets() {
protocol.registerOutgoing(ClientboundPackets1_12.SPAWN_ENTITY, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_12.SPAWN_ENTITY, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity id
@ -88,7 +88,7 @@ public class EntityPackets1_12 extends LegacyEntityRewriter<Protocol1_11_1To1_12
registerExtraTracker(ClientboundPackets1_12.SPAWN_EXPERIENCE_ORB, Entity1_12Types.EntityType.EXPERIENCE_ORB);
registerExtraTracker(ClientboundPackets1_12.SPAWN_GLOBAL_ENTITY, Entity1_12Types.EntityType.WEATHER);
protocol.registerOutgoing(ClientboundPackets1_12.SPAWN_MOB, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_12.SPAWN_MOB, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity id
@ -115,7 +115,7 @@ public class EntityPackets1_12 extends LegacyEntityRewriter<Protocol1_11_1To1_12
registerExtraTracker(ClientboundPackets1_12.SPAWN_PAINTING, Entity1_12Types.EntityType.PAINTING);
protocol.registerOutgoing(ClientboundPackets1_12.SPAWN_PLAYER, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_12.SPAWN_PLAYER, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID
@ -131,7 +131,7 @@ public class EntityPackets1_12 extends LegacyEntityRewriter<Protocol1_11_1To1_12
}
});
protocol.registerOutgoing(ClientboundPackets1_12.JOIN_GAME, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_12.JOIN_GAME, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // 0 - Entity ID
@ -170,7 +170,7 @@ public class EntityPackets1_12 extends LegacyEntityRewriter<Protocol1_11_1To1_12
registerEntityDestroy(ClientboundPackets1_12.DESTROY_ENTITIES);
registerMetadataRewriter(ClientboundPackets1_12.ENTITY_METADATA, Types1_12.METADATA_LIST);
protocol.registerOutgoing(ClientboundPackets1_12.ENTITY_PROPERTIES, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_12.ENTITY_PROPERTIES, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);

Datei anzeigen

@ -34,7 +34,7 @@ public class SoundPackets1_12 extends LegacySoundRewriter<Protocol1_11_1To1_12>
@Override
protected void registerPackets() {
protocol.registerOutgoing(ClientboundPackets1_12.NAMED_SOUND, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_12.NAMED_SOUND, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.STRING); // 0 - Sound name
@ -47,7 +47,7 @@ public class SoundPackets1_12 extends LegacySoundRewriter<Protocol1_11_1To1_12>
}
});
protocol.registerOutgoing(ClientboundPackets1_12.SOUND, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_12.SOUND, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Sound name

Datei anzeigen

@ -35,7 +35,7 @@ public class EntityPackets1_11_1 extends LegacyEntityRewriter<Protocol1_11To1_11
@Override
protected void registerPackets() {
protocol.registerOutgoing(ClientboundPackets1_9_3.SPAWN_ENTITY, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.SPAWN_ENTITY, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity id
@ -57,7 +57,7 @@ public class EntityPackets1_11_1 extends LegacyEntityRewriter<Protocol1_11To1_11
registerExtraTracker(ClientboundPackets1_9_3.SPAWN_EXPERIENCE_ORB, Entity1_11Types.EntityType.EXPERIENCE_ORB);
registerExtraTracker(ClientboundPackets1_9_3.SPAWN_GLOBAL_ENTITY, Entity1_11Types.EntityType.WEATHER);
protocol.registerOutgoing(ClientboundPackets1_9_3.SPAWN_MOB, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.SPAWN_MOB, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity id
@ -86,7 +86,7 @@ public class EntityPackets1_11_1 extends LegacyEntityRewriter<Protocol1_11To1_11
registerJoinGame(ClientboundPackets1_9_3.JOIN_GAME, Entity1_11Types.EntityType.PLAYER);
registerRespawn(ClientboundPackets1_9_3.RESPAWN);
protocol.registerOutgoing(ClientboundPackets1_9_3.SPAWN_PLAYER, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.SPAWN_PLAYER, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID

Datei anzeigen

@ -50,7 +50,7 @@ public class ItemPackets1_11_1 extends LegacyBlockItemRewriter<Protocol1_11To1_1
itemRewriter.registerEntityEquipment(ClientboundPackets1_9_3.ENTITY_EQUIPMENT, Type.ITEM);
// Plugin message Packet -> Trading
protocol.registerOutgoing(ClientboundPackets1_9_3.PLUGIN_MESSAGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.PLUGIN_MESSAGE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.STRING); // 0 - Channel

Datei anzeigen

@ -35,7 +35,7 @@ public class Protocol1_12_1To1_12_2 extends BackwardsProtocol<ClientboundPackets
@Override
protected void registerPackets() {
registerOutgoing(ClientboundPackets1_12_1.KEEP_ALIVE, new PacketRemapper() {
registerClientbound(ClientboundPackets1_12_1.KEEP_ALIVE, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -49,7 +49,7 @@ public class Protocol1_12_1To1_12_2 extends BackwardsProtocol<ClientboundPackets
}
});
registerIncoming(ServerboundPackets1_12_1.KEEP_ALIVE, new PacketRemapper() {
registerServerbound(ServerboundPackets1_12_1.KEEP_ALIVE, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {

Datei anzeigen

@ -81,15 +81,15 @@ public class Protocol1_12_2To1_13 extends BackwardsProtocol<ClientboundPackets1_
new PlayerPacket1_13(this).register();
new SoundPackets1_13(this).register();
cancelOutgoing(ClientboundPackets1_13.NBT_QUERY);
cancelOutgoing(ClientboundPackets1_13.CRAFT_RECIPE_RESPONSE);
cancelOutgoing(ClientboundPackets1_13.UNLOCK_RECIPES);
cancelOutgoing(ClientboundPackets1_13.ADVANCEMENTS);
cancelOutgoing(ClientboundPackets1_13.DECLARE_RECIPES);
cancelOutgoing(ClientboundPackets1_13.TAGS);
cancelClientbound(ClientboundPackets1_13.NBT_QUERY);
cancelClientbound(ClientboundPackets1_13.CRAFT_RECIPE_RESPONSE);
cancelClientbound(ClientboundPackets1_13.UNLOCK_RECIPES);
cancelClientbound(ClientboundPackets1_13.ADVANCEMENTS);
cancelClientbound(ClientboundPackets1_13.DECLARE_RECIPES);
cancelClientbound(ClientboundPackets1_13.TAGS);
cancelIncoming(ServerboundPackets1_12_1.CRAFT_RECIPE_REQUEST);
cancelIncoming(ServerboundPackets1_12_1.RECIPE_BOOK_DATA);
cancelServerbound(ServerboundPackets1_12_1.CRAFT_RECIPE_REQUEST);
cancelServerbound(ServerboundPackets1_12_1.RECIPE_BOOK_DATA);
}
@Override

Datei anzeigen

@ -89,7 +89,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
@Override
protected void registerPackets() {
protocol.registerOutgoing(ClientboundPackets1_13.COOLDOWN, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.COOLDOWN, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -111,7 +111,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_13.BLOCK_ACTION, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.BLOCK_ACTION, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION); // Location
@ -150,7 +150,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_13.BLOCK_ENTITY_DATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.BLOCK_ENTITY_DATA, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION); // 0 - Position
@ -178,7 +178,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_13.UNLOAD_CHUNK, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.UNLOAD_CHUNK, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -200,7 +200,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
});
// Block Change
protocol.registerOutgoing(ClientboundPackets1_13.BLOCK_CHANGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.BLOCK_CHANGE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION); // 0 - Position
@ -225,7 +225,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
});
// Multi Block Change
protocol.registerOutgoing(ClientboundPackets1_13.MULTI_BLOCK_CHANGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.MULTI_BLOCK_CHANGE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // 0 - Chunk X
@ -261,7 +261,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
ItemRewriter itemRewriter = new ItemRewriter(protocol, this::handleItemToClient, this::handleItemToServer);
protocol.registerOutgoing(ClientboundPackets1_13.WINDOW_ITEMS, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.WINDOW_ITEMS, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.UNSIGNED_BYTE);
@ -271,7 +271,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_13.SET_SLOT, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.SET_SLOT, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.BYTE);
@ -282,7 +282,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_13.CHUNK_DATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.CHUNK_DATA, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -396,7 +396,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_13.EFFECT, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.EFFECT, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // Effect Id
@ -420,7 +420,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_13.MAP_DATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.MAP_DATA, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
@ -451,7 +451,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_13.ENTITY_EQUIPMENT, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.ENTITY_EQUIPMENT, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
@ -462,7 +462,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_13.WINDOW_PROPERTY, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.WINDOW_PROPERTY, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.UNSIGNED_BYTE); // Window Id
@ -480,7 +480,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
});
protocol.registerIncoming(ServerboundPackets1_12_1.CREATIVE_INVENTORY_ACTION, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_12_1.CREATIVE_INVENTORY_ACTION, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.SHORT);
@ -490,7 +490,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerIncoming(ServerboundPackets1_12_1.CLICK_WINDOW, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_12_1.CLICK_WINDOW, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.UNSIGNED_BYTE);

Datei anzeigen

@ -53,7 +53,7 @@ public class EntityPackets1_13 extends LegacyEntityRewriter<Protocol1_12_2To1_13
@Override
protected void registerPackets() {
protocol.registerOutgoing(ClientboundPackets1_13.PLAYER_POSITION, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.PLAYER_POSITION, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.DOUBLE);
@ -82,7 +82,7 @@ public class EntityPackets1_13 extends LegacyEntityRewriter<Protocol1_12_2To1_13
}
});
protocol.registerOutgoing(ClientboundPackets1_13.SPAWN_ENTITY, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.SPAWN_ENTITY, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
@ -134,7 +134,7 @@ public class EntityPackets1_13 extends LegacyEntityRewriter<Protocol1_12_2To1_13
registerExtraTracker(ClientboundPackets1_13.SPAWN_EXPERIENCE_ORB, Entity1_13Types.EntityType.EXPERIENCE_ORB);
registerExtraTracker(ClientboundPackets1_13.SPAWN_GLOBAL_ENTITY, Entity1_13Types.EntityType.LIGHTNING_BOLT);
protocol.registerOutgoing(ClientboundPackets1_13.SPAWN_MOB, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.SPAWN_MOB, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
@ -174,7 +174,7 @@ public class EntityPackets1_13 extends LegacyEntityRewriter<Protocol1_12_2To1_13
}
});
protocol.registerOutgoing(ClientboundPackets1_13.SPAWN_PLAYER, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.SPAWN_PLAYER, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
@ -190,7 +190,7 @@ public class EntityPackets1_13 extends LegacyEntityRewriter<Protocol1_12_2To1_13
}
});
protocol.registerOutgoing(ClientboundPackets1_13.SPAWN_PAINTING, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.SPAWN_PAINTING, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
@ -210,7 +210,7 @@ public class EntityPackets1_13 extends LegacyEntityRewriter<Protocol1_12_2To1_13
registerJoinGame(ClientboundPackets1_13.JOIN_GAME, Entity1_13Types.EntityType.PLAYER);
protocol.registerOutgoing(ClientboundPackets1_13.RESPAWN, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.RESPAWN, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // 0 - Dimension ID
@ -224,7 +224,7 @@ public class EntityPackets1_13 extends LegacyEntityRewriter<Protocol1_12_2To1_13
registerMetadataRewriter(ClientboundPackets1_13.ENTITY_METADATA, Types1_13.METADATA_LIST, Types1_12.METADATA_LIST);
// Face Player (new packet)
protocol.registerOutgoing(ClientboundPackets1_13.FACE_PLAYER, null, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.FACE_PLAYER, null, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -272,9 +272,9 @@ public class EntityPackets1_13 extends LegacyEntityRewriter<Protocol1_12_2To1_13
handler(wrapper -> wrapper.user().get(PlayerPositionStorage1_13.class).setCoordinates(wrapper, false));
}
};
protocol.registerIncoming(ServerboundPackets1_12_1.PLAYER_POSITION, movementRemapper); // Player Position
protocol.registerIncoming(ServerboundPackets1_12_1.PLAYER_POSITION_AND_ROTATION, movementRemapper); // Player Position And Look (serverbound)
protocol.registerIncoming(ServerboundPackets1_12_1.VEHICLE_MOVE, movementRemapper); // Vehicle Move (serverbound)
protocol.registerServerbound(ServerboundPackets1_12_1.PLAYER_POSITION, movementRemapper); // Player Position
protocol.registerServerbound(ServerboundPackets1_12_1.PLAYER_POSITION_AND_ROTATION, movementRemapper); // Player Position And Look (serverbound)
protocol.registerServerbound(ServerboundPackets1_12_1.VEHICLE_MOVE, movementRemapper); // Vehicle Move (serverbound)
}
}

Datei anzeigen

@ -59,7 +59,7 @@ public class PlayerPacket1_13 extends Rewriter<Protocol1_12_2To1_13> {
@Override
protected void registerPackets() {
// Login Plugin Request
protocol.registerOutgoing(State.LOGIN, 0x04, -1, new PacketRemapper() {
protocol.registerClientbound(State.LOGIN, 0x04, -1, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -78,7 +78,7 @@ public class PlayerPacket1_13 extends Rewriter<Protocol1_12_2To1_13> {
}
});
protocol.registerOutgoing(ClientboundPackets1_13.PLUGIN_MESSAGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.PLUGIN_MESSAGE, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -139,7 +139,7 @@ public class PlayerPacket1_13 extends Rewriter<Protocol1_12_2To1_13> {
}
});
protocol.registerOutgoing(ClientboundPackets1_13.SPAWN_PARTICLE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.SPAWN_PARTICLE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // 0 - Particle ID
@ -175,7 +175,7 @@ public class PlayerPacket1_13 extends Rewriter<Protocol1_12_2To1_13> {
}
});
protocol.registerOutgoing(ClientboundPackets1_13.PLAYER_INFO, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.PLAYER_INFO, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -219,7 +219,7 @@ public class PlayerPacket1_13 extends Rewriter<Protocol1_12_2To1_13> {
}
});
protocol.registerOutgoing(ClientboundPackets1_13.SCOREBOARD_OBJECTIVE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.SCOREBOARD_OBJECTIVE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.STRING);
@ -244,7 +244,7 @@ public class PlayerPacket1_13 extends Rewriter<Protocol1_12_2To1_13> {
}
});
protocol.registerOutgoing(ClientboundPackets1_13.TEAMS, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.TEAMS, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.STRING);
@ -306,7 +306,7 @@ public class PlayerPacket1_13 extends Rewriter<Protocol1_12_2To1_13> {
}
});
protocol.registerOutgoing(ClientboundPackets1_13.DECLARE_COMMANDS, null, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.DECLARE_COMMANDS, null, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -347,7 +347,7 @@ public class PlayerPacket1_13 extends Rewriter<Protocol1_12_2To1_13> {
}
});
protocol.registerOutgoing(ClientboundPackets1_13.TAB_COMPLETE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.TAB_COMPLETE, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -383,7 +383,7 @@ public class PlayerPacket1_13 extends Rewriter<Protocol1_12_2To1_13> {
}
});
protocol.registerIncoming(ServerboundPackets1_12_1.TAB_COMPLETE, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_12_1.TAB_COMPLETE, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -438,7 +438,7 @@ public class PlayerPacket1_13 extends Rewriter<Protocol1_12_2To1_13> {
}
});
protocol.registerIncoming(ServerboundPackets1_12_1.PLUGIN_MESSAGE, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_12_1.PLUGIN_MESSAGE, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -590,7 +590,7 @@ public class PlayerPacket1_13 extends Rewriter<Protocol1_12_2To1_13> {
}
});
protocol.registerOutgoing(ClientboundPackets1_13.STATISTICS, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.STATISTICS, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);

Datei anzeigen

@ -36,7 +36,7 @@ public class SoundPackets1_13 extends Rewriter<Protocol1_12_2To1_13> {
@Override
protected void registerPackets() {
protocol.registerOutgoing(ClientboundPackets1_13.NAMED_SOUND, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.NAMED_SOUND, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.STRING);
@ -53,7 +53,7 @@ public class SoundPackets1_13 extends Rewriter<Protocol1_12_2To1_13> {
});
// Stop Sound -> Plugin Message
protocol.registerOutgoing(ClientboundPackets1_13.STOP_SOUND, ClientboundPackets1_12_1.PLUGIN_MESSAGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.STOP_SOUND, ClientboundPackets1_12_1.PLUGIN_MESSAGE, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -83,7 +83,7 @@ public class SoundPackets1_13 extends Rewriter<Protocol1_12_2To1_13> {
}
});
protocol.registerOutgoing(ClientboundPackets1_13.SOUND, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.SOUND, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);

Datei anzeigen

@ -31,7 +31,7 @@ public class Protocol1_12To1_12_1 extends BackwardsProtocol<ClientboundPackets1_
@Override
protected void registerPackets() {
cancelOutgoing(ClientboundPackets1_12_1.CRAFT_RECIPE_RESPONSE);
cancelIncoming(ServerboundPackets1_12.PREPARE_CRAFTING_GRID);
cancelClientbound(ClientboundPackets1_12_1.CRAFT_RECIPE_RESPONSE);
cancelServerbound(ServerboundPackets1_12.PREPARE_CRAFTING_GRID);
}
}

Datei anzeigen

@ -41,14 +41,14 @@ public class Protocol1_13_1To1_13_2 extends BackwardsProtocol<ClientboundPackets
WorldPackets1_13_2.register(this);
EntityPackets1_13_2.register(this);
registerIncoming(ServerboundPackets1_13.EDIT_BOOK, new PacketRemapper() {
registerServerbound(ServerboundPackets1_13.EDIT_BOOK, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.FLAT_ITEM, Type.FLAT_VAR_INT_ITEM);
}
});
registerOutgoing(ClientboundPackets1_13.ADVANCEMENTS, new PacketRemapper() {
registerClientbound(ClientboundPackets1_13.ADVANCEMENTS, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {

Datei anzeigen

@ -33,7 +33,7 @@ public class EntityPackets1_13_2 {
public static void register(Protocol1_13_1To1_13_2 protocol) {
protocol.registerOutgoing(ClientboundPackets1_13.SPAWN_MOB, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.SPAWN_MOB, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID
@ -63,7 +63,7 @@ public class EntityPackets1_13_2 {
}
});
protocol.registerOutgoing(ClientboundPackets1_13.SPAWN_PLAYER, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.SPAWN_PLAYER, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID
@ -88,7 +88,7 @@ public class EntityPackets1_13_2 {
}
});
protocol.registerOutgoing(ClientboundPackets1_13.ENTITY_METADATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.ENTITY_METADATA, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID

Datei anzeigen

@ -28,7 +28,7 @@ import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.ServerboundPacke
public class InventoryPackets1_13_2 {
public static void register(Protocol1_13_1To1_13_2 protocol) {
protocol.registerOutgoing(ClientboundPackets1_13.SET_SLOT, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.SET_SLOT, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.BYTE); // 0 - Window ID
@ -37,7 +37,7 @@ public class InventoryPackets1_13_2 {
}
});
protocol.registerOutgoing(ClientboundPackets1_13.WINDOW_ITEMS, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.WINDOW_ITEMS, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.UNSIGNED_BYTE); // 0 - Window ID
@ -45,7 +45,7 @@ public class InventoryPackets1_13_2 {
}
});
protocol.registerOutgoing(ClientboundPackets1_13.PLUGIN_MESSAGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.PLUGIN_MESSAGE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.STRING); // Channel
@ -78,7 +78,7 @@ public class InventoryPackets1_13_2 {
}
});
protocol.registerOutgoing(ClientboundPackets1_13.ENTITY_EQUIPMENT, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.ENTITY_EQUIPMENT, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID
@ -87,7 +87,7 @@ public class InventoryPackets1_13_2 {
}
});
protocol.registerOutgoing(ClientboundPackets1_13.DECLARE_RECIPES, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.DECLARE_RECIPES, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -126,7 +126,7 @@ public class InventoryPackets1_13_2 {
}
});
protocol.registerIncoming(ServerboundPackets1_13.CLICK_WINDOW, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_13.CLICK_WINDOW, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.UNSIGNED_BYTE); // 0 - Window ID
@ -138,7 +138,7 @@ public class InventoryPackets1_13_2 {
}
});
protocol.registerIncoming(ServerboundPackets1_13.CREATIVE_INVENTORY_ACTION, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_13.CREATIVE_INVENTORY_ACTION, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.SHORT); // 0 - Slot

Datei anzeigen

@ -27,7 +27,7 @@ import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.ClientboundPacke
public class WorldPackets1_13_2 {
public static void register(Protocol1_13_1To1_13_2 protocol) {
protocol.registerOutgoing(ClientboundPackets1_13.SPAWN_PARTICLE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.SPAWN_PARTICLE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // 0 - Particle ID

Datei anzeigen

@ -73,11 +73,11 @@ public class Protocol1_13_2To1_14 extends BackwardsProtocol<ClientboundPackets1_
new StatisticsRewriter(this, entityPackets::getOldEntityId).register(ClientboundPackets1_14.STATISTICS);
cancelOutgoing(ClientboundPackets1_14.UPDATE_VIEW_POSITION);
cancelOutgoing(ClientboundPackets1_14.UPDATE_VIEW_DISTANCE);
cancelOutgoing(ClientboundPackets1_14.ACKNOWLEDGE_PLAYER_DIGGING);
cancelClientbound(ClientboundPackets1_14.UPDATE_VIEW_POSITION);
cancelClientbound(ClientboundPackets1_14.UPDATE_VIEW_DISTANCE);
cancelClientbound(ClientboundPackets1_14.ACKNOWLEDGE_PLAYER_DIGGING);
registerOutgoing(ClientboundPackets1_14.TAGS, new PacketRemapper() {
registerClientbound(ClientboundPackets1_14.TAGS, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -124,7 +124,7 @@ public class Protocol1_13_2To1_14 extends BackwardsProtocol<ClientboundPackets1_
}
});
registerOutgoing(ClientboundPackets1_14.UPDATE_LIGHT, null, new PacketRemapper() {
registerClientbound(ClientboundPackets1_14.UPDATE_LIGHT, null, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {

Datei anzeigen

@ -71,14 +71,14 @@ public class BlockItemPackets1_14 extends com.viaversion.viabackwards.api.rewrit
@Override
protected void registerPackets() {
protocol.registerIncoming(ServerboundPackets1_13.EDIT_BOOK, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_13.EDIT_BOOK, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> handleItemToServer(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM)));
}
});
protocol.registerOutgoing(ClientboundPackets1_14.OPEN_WINDOW, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.OPEN_WINDOW, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -172,7 +172,7 @@ public class BlockItemPackets1_14 extends com.viaversion.viabackwards.api.rewrit
});
// Horse window -> Open Window
protocol.registerOutgoing(ClientboundPackets1_14.OPEN_HORSE_WINDOW, ClientboundPackets1_13.OPEN_WINDOW, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.OPEN_HORSE_WINDOW, ClientboundPackets1_13.OPEN_WINDOW, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -199,7 +199,7 @@ public class BlockItemPackets1_14 extends com.viaversion.viabackwards.api.rewrit
itemRewriter.registerAdvancements(ClientboundPackets1_14.ADVANCEMENTS, Type.FLAT_VAR_INT_ITEM);
// Trade List -> Plugin Message
protocol.registerOutgoing(ClientboundPackets1_14.TRADE_LIST, ClientboundPackets1_13.PLUGIN_MESSAGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.TRADE_LIST, ClientboundPackets1_13.PLUGIN_MESSAGE, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -248,7 +248,7 @@ public class BlockItemPackets1_14 extends com.viaversion.viabackwards.api.rewrit
});
// Open Book -> Plugin Message
protocol.registerOutgoing(ClientboundPackets1_14.OPEN_BOOK, ClientboundPackets1_13.PLUGIN_MESSAGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.OPEN_BOOK, ClientboundPackets1_13.PLUGIN_MESSAGE, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -261,7 +261,7 @@ public class BlockItemPackets1_14 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_14.ENTITY_EQUIPMENT, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.ENTITY_EQUIPMENT, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID
@ -299,7 +299,7 @@ public class BlockItemPackets1_14 extends com.viaversion.viabackwards.api.rewrit
});
RecipeRewriter recipeHandler = new RecipeRewriter1_13_2(protocol, this::handleItemToClient);
protocol.registerOutgoing(ClientboundPackets1_14.DECLARE_RECIPES, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.DECLARE_RECIPES, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -349,7 +349,7 @@ public class BlockItemPackets1_14 extends com.viaversion.viabackwards.api.rewrit
itemRewriter.registerClickWindow(ServerboundPackets1_13.CLICK_WINDOW, Type.FLAT_VAR_INT_ITEM);
itemRewriter.registerCreativeInvAction(ServerboundPackets1_13.CREATIVE_INVENTORY_ACTION, Type.FLAT_VAR_INT_ITEM);
protocol.registerOutgoing(ClientboundPackets1_14.BLOCK_BREAK_ANIMATION, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.BLOCK_BREAK_ANIMATION, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
@ -358,14 +358,14 @@ public class BlockItemPackets1_14 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_14.BLOCK_ENTITY_DATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.BLOCK_ENTITY_DATA, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION1_14, Type.POSITION);
}
});
protocol.registerOutgoing(ClientboundPackets1_14.BLOCK_ACTION, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.BLOCK_ACTION, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION1_14, Type.POSITION); // Location
@ -383,7 +383,7 @@ public class BlockItemPackets1_14 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_14.BLOCK_CHANGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.BLOCK_CHANGE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION1_14, Type.POSITION);
@ -401,7 +401,7 @@ public class BlockItemPackets1_14 extends com.viaversion.viabackwards.api.rewrit
blockRewriter.registerMultiBlockChange(ClientboundPackets1_14.MULTI_BLOCK_CHANGE);
protocol.registerOutgoing(ClientboundPackets1_14.EXPLOSION, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.EXPLOSION, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.FLOAT); // X
@ -424,7 +424,7 @@ public class BlockItemPackets1_14 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_14.CHUNK_DATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.CHUNK_DATA, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -477,7 +477,7 @@ public class BlockItemPackets1_14 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_14.UNLOAD_CHUNK, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.UNLOAD_CHUNK, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -491,7 +491,7 @@ public class BlockItemPackets1_14 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_14.EFFECT, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.EFFECT, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // Effect Id
@ -514,7 +514,7 @@ public class BlockItemPackets1_14 extends com.viaversion.viabackwards.api.rewrit
itemRewriter.registerSpawnParticle(ClientboundPackets1_14.SPAWN_PARTICLE, Type.FLAT_VAR_INT_ITEM, Type.FLOAT);
protocol.registerOutgoing(ClientboundPackets1_14.MAP_DATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.MAP_DATA, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
@ -524,7 +524,7 @@ public class BlockItemPackets1_14 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_14.SPAWN_POSITION, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.SPAWN_POSITION, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION1_14, Type.POSITION);

Datei anzeigen

@ -71,7 +71,7 @@ public class EntityPackets1_14 extends LegacyEntityRewriter<Protocol1_13_2To1_14
protected void registerPackets() {
positionHandler = new EntityPositionHandler(this, EntityPositionStorage1_14.class, EntityPositionStorage1_14::new);
protocol.registerOutgoing(ClientboundPackets1_14.ENTITY_STATUS, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.ENTITY_STATUS, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -96,7 +96,7 @@ public class EntityPackets1_14 extends LegacyEntityRewriter<Protocol1_13_2To1_14
}
});
protocol.registerOutgoing(ClientboundPackets1_14.ENTITY_TELEPORT, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.ENTITY_TELEPORT, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
@ -125,10 +125,10 @@ public class EntityPackets1_14 extends LegacyEntityRewriter<Protocol1_13_2To1_14
});
}
};
protocol.registerOutgoing(ClientboundPackets1_14.ENTITY_POSITION, relativeMoveHandler);
protocol.registerOutgoing(ClientboundPackets1_14.ENTITY_POSITION_AND_ROTATION, relativeMoveHandler);
protocol.registerClientbound(ClientboundPackets1_14.ENTITY_POSITION, relativeMoveHandler);
protocol.registerClientbound(ClientboundPackets1_14.ENTITY_POSITION_AND_ROTATION, relativeMoveHandler);
protocol.registerOutgoing(ClientboundPackets1_14.SPAWN_ENTITY, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.SPAWN_ENTITY, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity id
@ -199,7 +199,7 @@ public class EntityPackets1_14 extends LegacyEntityRewriter<Protocol1_13_2To1_14
}
});
protocol.registerOutgoing(ClientboundPackets1_14.SPAWN_MOB, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.SPAWN_MOB, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID
@ -243,7 +243,7 @@ public class EntityPackets1_14 extends LegacyEntityRewriter<Protocol1_13_2To1_14
}
});
getProtocol().registerOutgoing(ClientboundPackets1_14.SPAWN_EXPERIENCE_ORB, new PacketRemapper() {
getProtocol().registerClientbound(ClientboundPackets1_14.SPAWN_EXPERIENCE_ORB, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity id
@ -254,7 +254,7 @@ public class EntityPackets1_14 extends LegacyEntityRewriter<Protocol1_13_2To1_14
}
});
getProtocol().registerOutgoing(ClientboundPackets1_14.SPAWN_GLOBAL_ENTITY, new PacketRemapper() {
getProtocol().registerClientbound(ClientboundPackets1_14.SPAWN_GLOBAL_ENTITY, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity id
@ -266,7 +266,7 @@ public class EntityPackets1_14 extends LegacyEntityRewriter<Protocol1_13_2To1_14
}
});
protocol.registerOutgoing(ClientboundPackets1_14.SPAWN_PAINTING, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.SPAWN_PAINTING, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
@ -280,7 +280,7 @@ public class EntityPackets1_14 extends LegacyEntityRewriter<Protocol1_13_2To1_14
}
});
protocol.registerOutgoing(ClientboundPackets1_14.SPAWN_PLAYER, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.SPAWN_PLAYER, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID
@ -300,7 +300,7 @@ public class EntityPackets1_14 extends LegacyEntityRewriter<Protocol1_13_2To1_14
registerEntityDestroy(ClientboundPackets1_14.DESTROY_ENTITIES);
registerMetadataRewriter(ClientboundPackets1_14.ENTITY_METADATA, Types1_14.METADATA_LIST, Types1_13_2.METADATA_LIST);
protocol.registerOutgoing(ClientboundPackets1_14.JOIN_GAME, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.JOIN_GAME, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // 0 - Entity ID
@ -322,7 +322,7 @@ public class EntityPackets1_14 extends LegacyEntityRewriter<Protocol1_13_2To1_14
}
});
protocol.registerOutgoing(ClientboundPackets1_14.RESPAWN, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.RESPAWN, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // 0 - Dimension ID

Datei anzeigen

@ -35,7 +35,7 @@ public class PlayerPackets1_14 extends Rewriter<Protocol1_13_2To1_14> {
@Override
protected void registerPackets() {
protocol.registerOutgoing(ClientboundPackets1_14.SERVER_DIFFICULTY, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.SERVER_DIFFICULTY, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.UNSIGNED_BYTE);
@ -43,20 +43,20 @@ public class PlayerPackets1_14 extends Rewriter<Protocol1_13_2To1_14> {
}
});
protocol.registerOutgoing(ClientboundPackets1_14.OPEN_SIGN_EDITOR, new PacketRemapper() { // c
protocol.registerClientbound(ClientboundPackets1_14.OPEN_SIGN_EDITOR, new PacketRemapper() { // c
@Override
public void registerMap() {
map(Type.POSITION1_14, Type.POSITION);
}
});
protocol.registerIncoming(ServerboundPackets1_13.QUERY_BLOCK_NBT, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_13.QUERY_BLOCK_NBT, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
map(Type.POSITION, Type.POSITION1_14);
}
});
protocol.registerIncoming(ServerboundPackets1_13.PLAYER_DIGGING, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_13.PLAYER_DIGGING, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
@ -65,7 +65,7 @@ public class PlayerPackets1_14 extends Rewriter<Protocol1_13_2To1_14> {
}
});
protocol.registerIncoming(ServerboundPackets1_13.RECIPE_BOOK_DATA, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_13.RECIPE_BOOK_DATA, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
@ -92,26 +92,26 @@ public class PlayerPackets1_14 extends Rewriter<Protocol1_13_2To1_14> {
}
});
protocol.registerIncoming(ServerboundPackets1_13.UPDATE_COMMAND_BLOCK, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_13.UPDATE_COMMAND_BLOCK, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION, Type.POSITION1_14);
}
});
protocol.registerIncoming(ServerboundPackets1_13.UPDATE_STRUCTURE_BLOCK, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_13.UPDATE_STRUCTURE_BLOCK, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION, Type.POSITION1_14);
}
});
protocol.registerIncoming(ServerboundPackets1_13.UPDATE_SIGN, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_13.UPDATE_SIGN, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION, Type.POSITION1_14);
}
});
protocol.registerIncoming(ServerboundPackets1_13.PLAYER_BLOCK_PLACEMENT, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_13.PLAYER_BLOCK_PLACEMENT, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {

Datei anzeigen

@ -42,7 +42,7 @@ public class SoundPackets1_14 extends Rewriter<Protocol1_13_2To1_14> {
soundRewriter.registerStopSound(ClientboundPackets1_14.STOP_SOUND);
// Entity Sound Effect
protocol.registerOutgoing(ClientboundPackets1_14.ENTITY_SOUND, null, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.ENTITY_SOUND, null, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {

Datei anzeigen

@ -69,7 +69,7 @@ public class Protocol1_13To1_13_1 extends BackwardsProtocol<ClientboundPackets1_
new CommandRewriter1_13_1(this).registerDeclareCommands(ClientboundPackets1_13.DECLARE_COMMANDS);
registerIncoming(ServerboundPackets1_13.TAB_COMPLETE, new PacketRemapper() {
registerServerbound(ServerboundPackets1_13.TAB_COMPLETE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
@ -83,7 +83,7 @@ public class Protocol1_13To1_13_1 extends BackwardsProtocol<ClientboundPackets1_
}
});
registerIncoming(ServerboundPackets1_13.EDIT_BOOK, new PacketRemapper() {
registerServerbound(ServerboundPackets1_13.EDIT_BOOK, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.FLAT_ITEM);
@ -98,7 +98,7 @@ public class Protocol1_13To1_13_1 extends BackwardsProtocol<ClientboundPackets1_
}
});
registerOutgoing(ClientboundPackets1_13.OPEN_WINDOW, new PacketRemapper() {
registerClientbound(ClientboundPackets1_13.OPEN_WINDOW, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.UNSIGNED_BYTE); // Id
@ -116,7 +116,7 @@ public class Protocol1_13To1_13_1 extends BackwardsProtocol<ClientboundPackets1_
}
});
registerOutgoing(ClientboundPackets1_13.TAB_COMPLETE, new PacketRemapper() {
registerClientbound(ClientboundPackets1_13.TAB_COMPLETE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // Transaction id
@ -142,7 +142,7 @@ public class Protocol1_13To1_13_1 extends BackwardsProtocol<ClientboundPackets1_
}
});
registerOutgoing(ClientboundPackets1_13.BOSSBAR, new PacketRemapper() {
registerClientbound(ClientboundPackets1_13.BOSSBAR, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.UUID);
@ -167,7 +167,7 @@ public class Protocol1_13To1_13_1 extends BackwardsProtocol<ClientboundPackets1_
}
});
registerOutgoing(ClientboundPackets1_13.ADVANCEMENTS, new PacketRemapper() {
registerClientbound(ClientboundPackets1_13.ADVANCEMENTS, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {

Datei anzeigen

@ -42,7 +42,7 @@ public class EntityPackets1_13_1 extends LegacyEntityRewriter<Protocol1_13To1_13
@Override
protected void registerPackets() {
protocol.registerOutgoing(ClientboundPackets1_13.SPAWN_ENTITY, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.SPAWN_ENTITY, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity id
@ -82,7 +82,7 @@ public class EntityPackets1_13_1 extends LegacyEntityRewriter<Protocol1_13To1_13
registerExtraTracker(ClientboundPackets1_13.SPAWN_EXPERIENCE_ORB, Entity1_13Types.EntityType.EXPERIENCE_ORB);
registerExtraTracker(ClientboundPackets1_13.SPAWN_GLOBAL_ENTITY, Entity1_13Types.EntityType.LIGHTNING_BOLT);
protocol.registerOutgoing(ClientboundPackets1_13.SPAWN_MOB, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.SPAWN_MOB, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID
@ -118,7 +118,7 @@ public class EntityPackets1_13_1 extends LegacyEntityRewriter<Protocol1_13To1_13
}
});
protocol.registerOutgoing(ClientboundPackets1_13.SPAWN_PLAYER, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.SPAWN_PLAYER, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID

Datei anzeigen

@ -37,7 +37,7 @@ public class InventoryPackets1_13_1 {
itemRewriter.registerWindowItems(ClientboundPackets1_13.WINDOW_ITEMS, Type.FLAT_ITEM_ARRAY);
itemRewriter.registerSetSlot(ClientboundPackets1_13.SET_SLOT, Type.FLAT_ITEM);
protocol.registerOutgoing(ClientboundPackets1_13.PLUGIN_MESSAGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.PLUGIN_MESSAGE, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {

Datei anzeigen

@ -34,7 +34,7 @@ public class WorldPackets1_13_1 {
public static void register(Protocol protocol) {
BlockRewriter blockRewriter = new BlockRewriter(protocol, Type.POSITION);
protocol.registerOutgoing(ClientboundPackets1_13.CHUNK_DATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_13.CHUNK_DATA, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {

Datei anzeigen

@ -35,7 +35,7 @@ public class Protocol1_14_2To1_14_3 extends BackwardsProtocol<ClientboundPackets
@Override
protected void registerPackets() {
registerOutgoing(ClientboundPackets1_14.TRADE_LIST, new PacketRemapper() {
registerClientbound(ClientboundPackets1_14.TRADE_LIST, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -68,7 +68,7 @@ public class Protocol1_14_2To1_14_3 extends BackwardsProtocol<ClientboundPackets
RecipeRewriter recipeHandler = new RecipeRewriter1_14(this, item -> {
});
registerOutgoing(ClientboundPackets1_14.DECLARE_RECIPES, new PacketRemapper() {
registerClientbound(ClientboundPackets1_14.DECLARE_RECIPES, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {

Datei anzeigen

@ -34,7 +34,7 @@ public class Protocol1_14_3To1_14_4 extends BackwardsProtocol<ClientboundPackets
@Override
protected void registerPackets() {
// Acknowledge Player Digging - added in pre4
registerOutgoing(ClientboundPackets1_14.ACKNOWLEDGE_PLAYER_DIGGING, ClientboundPackets1_14.BLOCK_CHANGE, new PacketRemapper() {
registerClientbound(ClientboundPackets1_14.ACKNOWLEDGE_PLAYER_DIGGING, ClientboundPackets1_14.BLOCK_CHANGE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION1_14);
@ -49,7 +49,7 @@ public class Protocol1_14_3To1_14_4 extends BackwardsProtocol<ClientboundPackets
}
});
registerOutgoing(ClientboundPackets1_14.TRADE_LIST, new PacketRemapper() {
registerClientbound(ClientboundPackets1_14.TRADE_LIST, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {

Datei anzeigen

@ -71,7 +71,7 @@ public class Protocol1_14_4To1_15 extends BackwardsProtocol<ClientboundPackets1_
soundRewriter.registerStopSound(ClientboundPackets1_15.STOP_SOUND);
// Explosion - manually send an explosion sound
registerOutgoing(ClientboundPackets1_15.EXPLOSION, new PacketRemapper() {
registerClientbound(ClientboundPackets1_15.EXPLOSION, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.FLOAT); // x

Datei anzeigen

@ -47,7 +47,7 @@ public class BlockItemPackets1_15 extends com.viaversion.viabackwards.api.rewrit
new RecipeRewriter1_14(protocol, this::handleItemToClient).registerDefaultHandler(ClientboundPackets1_15.DECLARE_RECIPES);
protocol.registerIncoming(ServerboundPackets1_14.EDIT_BOOK, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_14.EDIT_BOOK, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> handleItemToServer(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM)));
@ -68,7 +68,7 @@ public class BlockItemPackets1_15 extends com.viaversion.viabackwards.api.rewrit
blockRewriter.registerBlockChange(ClientboundPackets1_15.BLOCK_CHANGE);
blockRewriter.registerMultiBlockChange(ClientboundPackets1_15.MULTI_BLOCK_CHANGE);
protocol.registerOutgoing(ClientboundPackets1_15.CHUNK_DATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_15.CHUNK_DATA, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -116,7 +116,7 @@ public class BlockItemPackets1_15 extends com.viaversion.viabackwards.api.rewrit
blockRewriter.registerEffect(ClientboundPackets1_15.EFFECT, 1010, 2001);
protocol.registerOutgoing(ClientboundPackets1_15.SPAWN_PARTICLE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_15.SPAWN_PARTICLE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // 0 - Particle ID

Datei anzeigen

@ -45,7 +45,7 @@ public class EntityPackets1_15 extends EntityRewriter<Protocol1_14_4To1_15> {
@Override
protected void registerPackets() {
protocol.registerOutgoing(ClientboundPackets1_15.UPDATE_HEALTH, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_15.UPDATE_HEALTH, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -61,7 +61,7 @@ public class EntityPackets1_15 extends EntityRewriter<Protocol1_14_4To1_15> {
}
});
protocol.registerOutgoing(ClientboundPackets1_15.GAME_EVENT, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_15.GAME_EVENT, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.UNSIGNED_BYTE);
@ -76,7 +76,7 @@ public class EntityPackets1_15 extends EntityRewriter<Protocol1_14_4To1_15> {
registerSpawnTrackerWithData(ClientboundPackets1_15.SPAWN_ENTITY, Entity1_15Types.FALLING_BLOCK);
protocol.registerOutgoing(ClientboundPackets1_15.SPAWN_MOB, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_15.SPAWN_MOB, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID
@ -102,7 +102,7 @@ public class EntityPackets1_15 extends EntityRewriter<Protocol1_14_4To1_15> {
}
});
protocol.registerOutgoing(ClientboundPackets1_15.RESPAWN, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_15.RESPAWN, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT);
@ -110,7 +110,7 @@ public class EntityPackets1_15 extends EntityRewriter<Protocol1_14_4To1_15> {
}
});
protocol.registerOutgoing(ClientboundPackets1_15.JOIN_GAME, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_15.JOIN_GAME, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // 0 - Entity ID
@ -134,7 +134,7 @@ public class EntityPackets1_15 extends EntityRewriter<Protocol1_14_4To1_15> {
registerExtraTracker(ClientboundPackets1_15.SPAWN_GLOBAL_ENTITY, Entity1_15Types.LIGHTNING_BOLT);
registerExtraTracker(ClientboundPackets1_15.SPAWN_PAINTING, Entity1_15Types.PAINTING);
protocol.registerOutgoing(ClientboundPackets1_15.SPAWN_PLAYER, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_15.SPAWN_PLAYER, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID
@ -154,7 +154,7 @@ public class EntityPackets1_15 extends EntityRewriter<Protocol1_14_4To1_15> {
registerMetadataRewriter(ClientboundPackets1_15.ENTITY_METADATA, Types1_14.METADATA_LIST);
// Attributes (get rid of generic.flyingSpeed for the Bee remap)
protocol.registerOutgoing(ClientboundPackets1_15.ENTITY_PROPERTIES, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_15.ENTITY_PROPERTIES, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);

Datei anzeigen

@ -44,7 +44,7 @@ public class EntityPackets1_14_1 extends LegacyEntityRewriter<Protocol1_14To1_14
registerExtraTracker(ClientboundPackets1_14.JOIN_GAME, Entity1_14Types.PLAYER, Type.INT);
registerEntityDestroy(ClientboundPackets1_14.DESTROY_ENTITIES);
protocol.registerOutgoing(ClientboundPackets1_14.SPAWN_ENTITY, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.SPAWN_ENTITY, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity id
@ -55,7 +55,7 @@ public class EntityPackets1_14_1 extends LegacyEntityRewriter<Protocol1_14To1_14
}
});
protocol.registerOutgoing(ClientboundPackets1_14.SPAWN_MOB, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_14.SPAWN_MOB, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID

Datei anzeigen

@ -74,7 +74,7 @@ public class Protocol1_15_2To1_16 extends BackwardsProtocol<ClientboundPackets1_
EntityPackets1_16 entityPackets = new EntityPackets1_16(this);
entityPackets.register();
registerOutgoing(State.STATUS, 0x00, 0x00, new PacketRemapper() {
registerClientbound(State.STATUS, 0x00, 0x00, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -89,7 +89,7 @@ public class Protocol1_15_2To1_16 extends BackwardsProtocol<ClientboundPackets1_
}
});
registerOutgoing(ClientboundPackets1_16.CHAT_MESSAGE, new PacketRemapper() {
registerClientbound(ClientboundPackets1_16.CHAT_MESSAGE, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> translatableRewriter.processText(wrapper.passthrough(Type.COMPONENT)));
@ -98,7 +98,7 @@ public class Protocol1_15_2To1_16 extends BackwardsProtocol<ClientboundPackets1_
}
});
registerOutgoing(ClientboundPackets1_16.OPEN_WINDOW, new PacketRemapper() {
registerClientbound(ClientboundPackets1_16.OPEN_WINDOW, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // Window Id
@ -122,7 +122,7 @@ public class Protocol1_15_2To1_16 extends BackwardsProtocol<ClientboundPackets1_
soundRewriter.registerStopSound(ClientboundPackets1_16.STOP_SOUND);
// Login success
registerOutgoing(State.LOGIN, 0x02, 0x02, new PacketRemapper() {
registerClientbound(State.LOGIN, 0x02, 0x02, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -137,7 +137,7 @@ public class Protocol1_15_2To1_16 extends BackwardsProtocol<ClientboundPackets1_
new StatisticsRewriter(this, entityPackets::getOldEntityId).register(ClientboundPackets1_16.STATISTICS);
registerIncoming(ServerboundPackets1_14.ENTITY_ACTION, new PacketRemapper() {
registerServerbound(ServerboundPackets1_14.ENTITY_ACTION, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -152,7 +152,7 @@ public class Protocol1_15_2To1_16 extends BackwardsProtocol<ClientboundPackets1_
}
});
registerIncoming(ServerboundPackets1_14.INTERACT_ENTITY, new PacketRemapper() {
registerServerbound(ServerboundPackets1_14.INTERACT_ENTITY, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -175,7 +175,7 @@ public class Protocol1_15_2To1_16 extends BackwardsProtocol<ClientboundPackets1_
}
});
registerIncoming(ServerboundPackets1_14.PLAYER_ABILITIES, new PacketRemapper() {
registerServerbound(ServerboundPackets1_14.PLAYER_ABILITIES, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -189,7 +189,7 @@ public class Protocol1_15_2To1_16 extends BackwardsProtocol<ClientboundPackets1_
}
});
cancelIncoming(ServerboundPackets1_14.UPDATE_JIGSAW_BLOCK);
cancelServerbound(ServerboundPackets1_14.UPDATE_JIGSAW_BLOCK);
}
@Override

Datei anzeigen

@ -65,7 +65,7 @@ public class BlockItemPackets1_16 extends com.viaversion.viabackwards.api.rewrit
RecipeRewriter1_14 recipeRewriter = new RecipeRewriter1_14(protocol, this::handleItemToClient);
// Remove new smithing type, only in this handler
protocol.registerOutgoing(ClientboundPackets1_16.DECLARE_RECIPES, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_16.DECLARE_RECIPES, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -105,7 +105,7 @@ public class BlockItemPackets1_16 extends com.viaversion.viabackwards.api.rewrit
blockRewriter.registerBlockChange(ClientboundPackets1_16.BLOCK_CHANGE);
blockRewriter.registerMultiBlockChange(ClientboundPackets1_16.MULTI_BLOCK_CHANGE);
protocol.registerOutgoing(ClientboundPackets1_16.ENTITY_EQUIPMENT, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_16.ENTITY_EQUIPMENT, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -138,7 +138,7 @@ public class BlockItemPackets1_16 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_16.UPDATE_LIGHT, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_16.UPDATE_LIGHT, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // x
@ -147,7 +147,7 @@ public class BlockItemPackets1_16 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_16.CHUNK_DATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_16.CHUNK_DATA, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -197,7 +197,7 @@ public class BlockItemPackets1_16 extends com.viaversion.viabackwards.api.rewrit
itemRewriter.registerSpawnParticle(ClientboundPackets1_16.SPAWN_PARTICLE, Type.FLAT_VAR_INT_ITEM, Type.DOUBLE);
protocol.registerOutgoing(ClientboundPackets1_16.WINDOW_PROPERTY, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_16.WINDOW_PROPERTY, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.UNSIGNED_BYTE); // Window id
@ -217,7 +217,7 @@ public class BlockItemPackets1_16 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_16.MAP_DATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_16.MAP_DATA, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // Map ID
@ -254,7 +254,7 @@ public class BlockItemPackets1_16 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_16.BLOCK_ENTITY_DATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_16.BLOCK_ENTITY_DATA, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -269,7 +269,7 @@ public class BlockItemPackets1_16 extends com.viaversion.viabackwards.api.rewrit
itemRewriter.registerClickWindow(ServerboundPackets1_14.CLICK_WINDOW, Type.FLAT_VAR_INT_ITEM);
itemRewriter.registerCreativeInvAction(ServerboundPackets1_14.CREATIVE_INVENTORY_ACTION, Type.FLAT_VAR_INT_ITEM);
protocol.registerIncoming(ServerboundPackets1_14.EDIT_BOOK, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_14.EDIT_BOOK, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> handleItemToServer(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM)));

Datei anzeigen

@ -62,7 +62,7 @@ public class EntityPackets1_16 extends EntityRewriter<Protocol1_15_2To1_16> {
@Override
protected void registerPackets() {
protocol.registerOutgoing(ClientboundPackets1_16.SPAWN_ENTITY, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_16.SPAWN_ENTITY, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity id
@ -95,7 +95,7 @@ public class EntityPackets1_16 extends EntityRewriter<Protocol1_15_2To1_16> {
registerSpawnTracker(ClientboundPackets1_16.SPAWN_MOB);
protocol.registerOutgoing(ClientboundPackets1_16.RESPAWN, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_16.RESPAWN, new PacketRemapper() {
@Override
public void registerMap() {
map(dimensionTransformer); // Dimension Type
@ -138,7 +138,7 @@ public class EntityPackets1_16 extends EntityRewriter<Protocol1_15_2To1_16> {
}
});
protocol.registerOutgoing(ClientboundPackets1_16.JOIN_GAME, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_16.JOIN_GAME, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // Entity ID
@ -179,7 +179,7 @@ public class EntityPackets1_16 extends EntityRewriter<Protocol1_15_2To1_16> {
registerEntityDestroy(ClientboundPackets1_16.DESTROY_ENTITIES);
registerMetadataRewriter(ClientboundPackets1_16.ENTITY_METADATA, Types1_14.METADATA_LIST);
protocol.registerOutgoing(ClientboundPackets1_16.ENTITY_PROPERTIES, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_16.ENTITY_PROPERTIES, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -202,7 +202,7 @@ public class EntityPackets1_16 extends EntityRewriter<Protocol1_15_2To1_16> {
}
});
protocol.registerOutgoing(ClientboundPackets1_16.PLAYER_INFO, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_16.PLAYER_INFO, new PacketRemapper() {
@Override
public void registerMap() {
handler(packetWrapper -> {

Datei anzeigen

@ -74,7 +74,7 @@ public class Protocol1_16_1To1_16_2 extends BackwardsProtocol<ClientboundPackets
soundRewriter.registerNamedSound(ClientboundPackets1_16_2.NAMED_SOUND);
soundRewriter.registerStopSound(ClientboundPackets1_16_2.STOP_SOUND);
registerOutgoing(ClientboundPackets1_16_2.CHAT_MESSAGE, new PacketRemapper() {
registerClientbound(ClientboundPackets1_16_2.CHAT_MESSAGE, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -92,7 +92,7 @@ public class Protocol1_16_1To1_16_2 extends BackwardsProtocol<ClientboundPackets
});
// Recipe book data has been split into 2 separate packets
registerIncoming(ServerboundPackets1_16.RECIPE_BOOK_DATA, new PacketRemapper() {
registerServerbound(ServerboundPackets1_16.RECIPE_BOOK_DATA, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {

Datei anzeigen

@ -60,7 +60,7 @@ public class BlockItemPackets1_16_2 extends com.viaversion.viabackwards.api.rewr
itemRewriter.registerTradeList(ClientboundPackets1_16_2.TRADE_LIST, Type.FLAT_VAR_INT_ITEM);
itemRewriter.registerAdvancements(ClientboundPackets1_16_2.ADVANCEMENTS, Type.FLAT_VAR_INT_ITEM);
protocol.registerOutgoing(ClientboundPackets1_16_2.UNLOCK_RECIPES, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_16_2.UNLOCK_RECIPES, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -82,7 +82,7 @@ public class BlockItemPackets1_16_2 extends com.viaversion.viabackwards.api.rewr
blockRewriter.registerBlockAction(ClientboundPackets1_16_2.BLOCK_ACTION);
blockRewriter.registerBlockChange(ClientboundPackets1_16_2.BLOCK_CHANGE);
protocol.registerOutgoing(ClientboundPackets1_16_2.CHUNK_DATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_16_2.CHUNK_DATA, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -113,7 +113,7 @@ public class BlockItemPackets1_16_2 extends com.viaversion.viabackwards.api.rewr
}
});
protocol.registerOutgoing(ClientboundPackets1_16_2.BLOCK_ENTITY_DATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_16_2.BLOCK_ENTITY_DATA, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -124,7 +124,7 @@ public class BlockItemPackets1_16_2 extends com.viaversion.viabackwards.api.rewr
}
});
protocol.registerOutgoing(ClientboundPackets1_16_2.MULTI_BLOCK_CHANGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_16_2.MULTI_BLOCK_CHANGE, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -155,7 +155,7 @@ public class BlockItemPackets1_16_2 extends com.viaversion.viabackwards.api.rewr
itemRewriter.registerClickWindow(ServerboundPackets1_16.CLICK_WINDOW, Type.FLAT_VAR_INT_ITEM);
itemRewriter.registerCreativeInvAction(ServerboundPackets1_16.CREATIVE_INVENTORY_ACTION, Type.FLAT_VAR_INT_ITEM);
protocol.registerIncoming(ServerboundPackets1_16.EDIT_BOOK, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_16.EDIT_BOOK, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> handleItemToServer(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM)));

Datei anzeigen

@ -57,7 +57,7 @@ public class EntityPackets1_16_2 extends EntityRewriter<Protocol1_16_1To1_16_2>
registerEntityDestroy(ClientboundPackets1_16_2.DESTROY_ENTITIES);
registerMetadataRewriter(ClientboundPackets1_16_2.ENTITY_METADATA, Types1_14.METADATA_LIST);
protocol.registerOutgoing(ClientboundPackets1_16_2.JOIN_GAME, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_16_2.JOIN_GAME, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // Entity ID
@ -90,7 +90,7 @@ public class EntityPackets1_16_2 extends EntityRewriter<Protocol1_16_1To1_16_2>
}
});
protocol.registerOutgoing(ClientboundPackets1_16_2.RESPAWN, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_16_2.RESPAWN, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {

Datei anzeigen

@ -33,7 +33,7 @@ public class Protocol1_16_3To1_16_4 extends BackwardsProtocol<ClientboundPackets
@Override
protected void registerPackets() {
registerIncoming(ServerboundPackets1_16_2.EDIT_BOOK, new PacketRemapper() {
registerServerbound(ServerboundPackets1_16_2.EDIT_BOOK, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.FLAT_VAR_INT_ITEM);
@ -49,7 +49,7 @@ public class Protocol1_16_3To1_16_4 extends BackwardsProtocol<ClientboundPackets
}
});
registerIncoming(ServerboundPackets1_16_2.HELD_ITEM_CHANGE, new PacketRemapper() {
registerServerbound(ServerboundPackets1_16_2.HELD_ITEM_CHANGE, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {

Datei anzeigen

@ -78,7 +78,7 @@ public class Protocol1_16_4To1_17 extends BackwardsProtocol<ClientboundPackets1_
soundRewriter.registerStopSound(ClientboundPackets1_17.STOP_SOUND);
TagRewriter tagRewriter = new TagRewriter(this, null);
registerOutgoing(ClientboundPackets1_17.TAGS, new PacketRemapper() {
registerClientbound(ClientboundPackets1_17.TAGS, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -137,7 +137,7 @@ public class Protocol1_16_4To1_17 extends BackwardsProtocol<ClientboundPackets1_
new StatisticsRewriter(this, null).register(ClientboundPackets1_17.STATISTICS);
registerOutgoing(ClientboundPackets1_17.RESOURCE_PACK, new PacketRemapper() {
registerClientbound(ClientboundPackets1_17.RESOURCE_PACK, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -149,7 +149,7 @@ public class Protocol1_16_4To1_17 extends BackwardsProtocol<ClientboundPackets1_
}
});
registerOutgoing(ClientboundPackets1_17.MAP_DATA, new PacketRemapper() {
registerClientbound(ClientboundPackets1_17.MAP_DATA, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -166,7 +166,7 @@ public class Protocol1_16_4To1_17 extends BackwardsProtocol<ClientboundPackets1_
}
});
registerOutgoing(ClientboundPackets1_17.EXPLOSION, new PacketRemapper() {
registerClientbound(ClientboundPackets1_17.EXPLOSION, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.FLOAT); // X
@ -179,7 +179,7 @@ public class Protocol1_16_4To1_17 extends BackwardsProtocol<ClientboundPackets1_
}
});
registerOutgoing(ClientboundPackets1_17.SPAWN_POSITION, new PacketRemapper() {
registerClientbound(ClientboundPackets1_17.SPAWN_POSITION, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION1_14);
@ -190,7 +190,7 @@ public class Protocol1_16_4To1_17 extends BackwardsProtocol<ClientboundPackets1_
}
});
registerIncoming(ServerboundPackets1_16_2.CLIENT_SETTINGS, new PacketRemapper() {
registerServerbound(ServerboundPackets1_16_2.CLIENT_SETTINGS, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.STRING); // Locale
@ -209,7 +209,7 @@ public class Protocol1_16_4To1_17 extends BackwardsProtocol<ClientboundPackets1_
mergePacket(ClientboundPackets1_17.TITLE_SUBTITLE, ClientboundPackets1_16_2.TITLE, 1);
mergePacket(ClientboundPackets1_17.ACTIONBAR, ClientboundPackets1_16_2.TITLE, 2);
mergePacket(ClientboundPackets1_17.TITLE_TIMES, ClientboundPackets1_16_2.TITLE, 3);
registerOutgoing(ClientboundPackets1_17.CLEAR_TITLES, ClientboundPackets1_16_2.TITLE, new PacketRemapper() {
registerClientbound(ClientboundPackets1_17.CLEAR_TITLES, ClientboundPackets1_16_2.TITLE, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -222,7 +222,7 @@ public class Protocol1_16_4To1_17 extends BackwardsProtocol<ClientboundPackets1_
}
});
cancelOutgoing(ClientboundPackets1_17.ADD_VIBRATION_SIGNAL);
cancelClientbound(ClientboundPackets1_17.ADD_VIBRATION_SIGNAL);
}
@Override
@ -245,7 +245,7 @@ public class Protocol1_16_4To1_17 extends BackwardsProtocol<ClientboundPackets1_
public void mergePacket(ClientboundPackets1_17 newPacketType, ClientboundPackets1_16_2 oldPacketType, int type) {
// A few packets that had different handling based on an initially read enum type were split into different ones
registerOutgoing(newPacketType, oldPacketType, new PacketRemapper() {
registerClientbound(newPacketType, oldPacketType, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {

Datei anzeigen

@ -66,7 +66,7 @@ public class BlockItemPackets1_17 extends com.viaversion.viabackwards.api.rewrit
itemRewriter.registerCreativeInvAction(ServerboundPackets1_16_2.CREATIVE_INVENTORY_ACTION, Type.FLAT_VAR_INT_ITEM);
protocol.registerIncoming(ServerboundPackets1_16_2.EDIT_BOOK, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_16_2.EDIT_BOOK, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> handleItemToServer(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM)));
@ -74,7 +74,7 @@ public class BlockItemPackets1_17 extends com.viaversion.viabackwards.api.rewrit
});
// This will cause desync issues for players with a high latency, but works:tm:
protocol.registerIncoming(ServerboundPackets1_16_2.CLICK_WINDOW, new PacketRemapper() {
protocol.registerServerbound(ServerboundPackets1_16_2.CLICK_WINDOW, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.UNSIGNED_BYTE); // Window Id
@ -89,9 +89,9 @@ public class BlockItemPackets1_17 extends com.viaversion.viabackwards.api.rewrit
});
}
});
protocol.cancelIncoming(ServerboundPackets1_16_2.WINDOW_CONFIRMATION);
protocol.cancelServerbound(ServerboundPackets1_16_2.WINDOW_CONFIRMATION);
protocol.registerOutgoing(ClientboundPackets1_17.SPAWN_PARTICLE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_17.SPAWN_PARTICLE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // Particle id
@ -134,7 +134,7 @@ public class BlockItemPackets1_17 extends com.viaversion.viabackwards.api.rewrit
// The Great Shrunkening
// Chunk sections *will* be lost ¯\_()_/¯
protocol.registerOutgoing(ClientboundPackets1_17.UPDATE_LIGHT, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_17.UPDATE_LIGHT, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // X
@ -199,7 +199,7 @@ public class BlockItemPackets1_17 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_17.MULTI_BLOCK_CHANGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_17.MULTI_BLOCK_CHANGE, new PacketRemapper() {
public void registerMap() {
map(Type.LONG); // Chunk pos
map(Type.BOOLEAN); // Suppress light updates
@ -220,7 +220,7 @@ public class BlockItemPackets1_17 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_17.BLOCK_CHANGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_17.BLOCK_CHANGE, new PacketRemapper() {
public void registerMap() {
map(Type.POSITION1_14);
map(Type.VAR_INT);
@ -236,7 +236,7 @@ public class BlockItemPackets1_17 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_17.CHUNK_DATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_17.CHUNK_DATA, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -268,7 +268,7 @@ public class BlockItemPackets1_17 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_17.BLOCK_ENTITY_DATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_17.BLOCK_ENTITY_DATA, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
@ -280,7 +280,7 @@ public class BlockItemPackets1_17 extends com.viaversion.viabackwards.api.rewrit
}
});
protocol.registerOutgoing(ClientboundPackets1_17.BLOCK_BREAK_ANIMATION, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_17.BLOCK_BREAK_ANIMATION, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);

Datei anzeigen

@ -56,7 +56,7 @@ public class EntityPackets1_17 extends EntityRewriter<Protocol1_16_4To1_17> {
registerExtraTracker(ClientboundPackets1_17.SPAWN_PLAYER, Entity1_16_2Types.PLAYER);
registerEntityDestroy(ClientboundPackets1_17.DESTROY_ENTITIES);
registerMetadataRewriter(ClientboundPackets1_17.ENTITY_METADATA, Types1_17.METADATA_LIST, Types1_14.METADATA_LIST);
protocol.registerOutgoing(ClientboundPackets1_17.JOIN_GAME, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_17.JOIN_GAME, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // Entity ID
@ -97,7 +97,7 @@ public class EntityPackets1_17 extends EntityRewriter<Protocol1_16_4To1_17> {
});
}
});
protocol.registerOutgoing(ClientboundPackets1_17.RESPAWN, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_17.RESPAWN, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.NBT); // Dimension data
@ -108,7 +108,7 @@ public class EntityPackets1_17 extends EntityRewriter<Protocol1_16_4To1_17> {
}
});
protocol.registerOutgoing(ClientboundPackets1_17.PLAYER_POSITION, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_17.PLAYER_POSITION, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.DOUBLE);
@ -125,7 +125,7 @@ public class EntityPackets1_17 extends EntityRewriter<Protocol1_16_4To1_17> {
}
});
protocol.registerOutgoing(ClientboundPackets1_17.ENTITY_PROPERTIES, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_17.ENTITY_PROPERTIES, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // Entity id

Datei anzeigen

@ -52,7 +52,7 @@ public class Protocol1_9_4To1_10 extends BackwardsProtocol<ClientboundPackets1_9
(blockItemPackets = new BlockItemPackets1_10(this)).register();
SoundRewriter soundRewriter = new SoundRewriter(this);
registerOutgoing(ClientboundPackets1_9_3.NAMED_SOUND, new PacketRemapper() {
registerClientbound(ClientboundPackets1_9_3.NAMED_SOUND, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.STRING); // 0 - Sound name
@ -65,7 +65,7 @@ public class Protocol1_9_4To1_10 extends BackwardsProtocol<ClientboundPackets1_9
handler(soundRewriter.getNamedSoundHandler());
}
});
registerOutgoing(ClientboundPackets1_9_3.SOUND, new PacketRemapper() {
registerClientbound(ClientboundPackets1_9_3.SOUND, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Sound name
@ -79,7 +79,7 @@ public class Protocol1_9_4To1_10 extends BackwardsProtocol<ClientboundPackets1_9
}
});
registerIncoming(ServerboundPackets1_9_3.RESOURCE_PACK_STATUS, new PacketRemapper() {
registerServerbound(ServerboundPackets1_9_3.RESOURCE_PACK_STATUS, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.STRING, Type.NOTHING); // 0 - Hash

Datei anzeigen

@ -50,7 +50,7 @@ public class BlockItemPackets1_10 extends LegacyBlockItemRewriter<Protocol1_9_4T
// Entity Equipment Packet
itemRewriter.registerEntityEquipment(ClientboundPackets1_9_3.ENTITY_EQUIPMENT, Type.ITEM);
protocol.registerOutgoing(ClientboundPackets1_9_3.PLUGIN_MESSAGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.PLUGIN_MESSAGE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.STRING); // 0 - Channel
@ -84,7 +84,7 @@ public class BlockItemPackets1_10 extends LegacyBlockItemRewriter<Protocol1_9_4T
itemRewriter.registerClickWindow(ServerboundPackets1_9_3.CLICK_WINDOW, Type.ITEM);
itemRewriter.registerCreativeInvAction(ServerboundPackets1_9_3.CREATIVE_INVENTORY_ACTION, Type.ITEM);
protocol.registerOutgoing(ClientboundPackets1_9_3.CHUNK_DATA, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.CHUNK_DATA, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -102,7 +102,7 @@ public class BlockItemPackets1_10 extends LegacyBlockItemRewriter<Protocol1_9_4T
});
// Block Change Packet
protocol.registerOutgoing(ClientboundPackets1_9_3.BLOCK_CHANGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.BLOCK_CHANGE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION); // 0 - Block Position
@ -119,7 +119,7 @@ public class BlockItemPackets1_10 extends LegacyBlockItemRewriter<Protocol1_9_4T
});
// Multi Block Change Packet
protocol.registerOutgoing(ClientboundPackets1_9_3.MULTI_BLOCK_CHANGE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.MULTI_BLOCK_CHANGE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // 0 - Chunk X
@ -148,7 +148,7 @@ public class BlockItemPackets1_10 extends LegacyBlockItemRewriter<Protocol1_9_4T
});
// Particle
protocol.registerOutgoing(ClientboundPackets1_9_3.SPAWN_PARTICLE, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.SPAWN_PARTICLE, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT);

Datei anzeigen

@ -47,7 +47,7 @@ public class EntityPackets1_10 extends LegacyEntityRewriter<Protocol1_9_4To1_10>
@Override
protected void registerPackets() {
protocol.registerOutgoing(ClientboundPackets1_9_3.SPAWN_ENTITY, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.SPAWN_ENTITY, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity id
@ -88,7 +88,7 @@ public class EntityPackets1_10 extends LegacyEntityRewriter<Protocol1_9_4To1_10>
registerExtraTracker(ClientboundPackets1_9_3.SPAWN_EXPERIENCE_ORB, Entity1_10Types.EntityType.EXPERIENCE_ORB);
registerExtraTracker(ClientboundPackets1_9_3.SPAWN_GLOBAL_ENTITY, Entity1_10Types.EntityType.WEATHER);
protocol.registerOutgoing(ClientboundPackets1_9_3.SPAWN_MOB, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.SPAWN_MOB, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity id
@ -145,7 +145,7 @@ public class EntityPackets1_10 extends LegacyEntityRewriter<Protocol1_9_4To1_10>
registerJoinGame(ClientboundPackets1_9_3.JOIN_GAME, Entity1_10Types.EntityType.PLAYER);
registerRespawn(ClientboundPackets1_9_3.RESPAWN);
protocol.registerOutgoing(ClientboundPackets1_9_3.SPAWN_PLAYER, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_9_3.SPAWN_PLAYER, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID