Search in sources :

Example 1 with SoundPackets1_13

use of com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.packets.SoundPackets1_13 in project ViaBackwards by ViaVersion.

the class Protocol1_12_2To1_13 method registerPackets.

@Override
protected void registerPackets() {
    executeAsyncAfterLoaded(Protocol1_13To1_12_2.class, () -> {
        MAPPINGS.load();
        PaintingMapping.init();
        Via.getManager().getProviders().register(BackwardsBlockEntityProvider.class, new BackwardsBlockEntityProvider());
    });
    TranslatableRewriter translatableRewriter = new TranslatableRewriter(this) {

        @Override
        protected void handleTranslate(JsonObject root, String translate) {
            String newTranslate = newTranslatables.get(translate);
            if (newTranslate != null || (newTranslate = getMappingData().getTranslateMappings().get(translate)) != null) {
                root.addProperty("translate", newTranslate);
            }
        }
    };
    translatableRewriter.registerPing();
    translatableRewriter.registerBossBar(ClientboundPackets1_13.BOSSBAR);
    translatableRewriter.registerChatMessage(ClientboundPackets1_13.CHAT_MESSAGE);
    translatableRewriter.registerLegacyOpenWindow(ClientboundPackets1_13.OPEN_WINDOW);
    translatableRewriter.registerDisconnect(ClientboundPackets1_13.DISCONNECT);
    translatableRewriter.registerCombatEvent(ClientboundPackets1_13.COMBAT_EVENT);
    translatableRewriter.registerTitle(ClientboundPackets1_13.TITLE);
    translatableRewriter.registerTabList(ClientboundPackets1_13.TAB_LIST);
    blockItemPackets.register();
    entityRewriter.register();
    new PlayerPacket1_13(this).register();
    new SoundPackets1_13(this).register();
    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);
    cancelServerbound(ServerboundPackets1_12_1.CRAFT_RECIPE_REQUEST);
    cancelServerbound(ServerboundPackets1_12_1.RECIPE_BOOK_DATA);
}
Also used : TranslatableRewriter(com.viaversion.viabackwards.api.rewriters.TranslatableRewriter) BackwardsBlockEntityProvider(com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.providers.BackwardsBlockEntityProvider) PlayerPacket1_13(com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.packets.PlayerPacket1_13) JsonObject(com.viaversion.viaversion.libs.gson.JsonObject) SoundPackets1_13(com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.packets.SoundPackets1_13)

Aggregations

TranslatableRewriter (com.viaversion.viabackwards.api.rewriters.TranslatableRewriter)1 PlayerPacket1_13 (com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.packets.PlayerPacket1_13)1 SoundPackets1_13 (com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.packets.SoundPackets1_13)1 BackwardsBlockEntityProvider (com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.providers.BackwardsBlockEntityProvider)1 JsonObject (com.viaversion.viaversion.libs.gson.JsonObject)1