Search in sources :

Example 11 with JsonElement

use of com.viaversion.viaversion.libs.gson.JsonElement in project ViaBackwards by ViaVersion.

the class Protocol1_13To1_13_1 method registerPackets.

@Override
protected void registerPackets() {
    executeAsyncAfterLoaded(Protocol1_13_1To1_13.class, MAPPINGS::load);
    entityRewriter.register();
    itemRewriter.register();
    WorldPackets1_13_1.register(this);
    TranslatableRewriter translatableRewriter = new TranslatableRewriter(this);
    translatableRewriter.registerChatMessage(ClientboundPackets1_13.CHAT_MESSAGE);
    translatableRewriter.registerCombatEvent(ClientboundPackets1_13.COMBAT_EVENT);
    translatableRewriter.registerDisconnect(ClientboundPackets1_13.DISCONNECT);
    translatableRewriter.registerTabList(ClientboundPackets1_13.TAB_LIST);
    translatableRewriter.registerTitle(ClientboundPackets1_13.TITLE);
    translatableRewriter.registerPing();
    new CommandRewriter1_13_1(this).registerDeclareCommands(ClientboundPackets1_13.DECLARE_COMMANDS);
    registerServerbound(ServerboundPackets1_13.TAB_COMPLETE, new PacketRemapper() {

        @Override
        public void registerMap() {
            map(Type.VAR_INT);
            map(Type.STRING, new ValueTransformer<String, String>(Type.STRING) {

                @Override
                public String transform(PacketWrapper wrapper, String inputValue) {
                    // 1.13 starts sending slash at start, so we remove it for compatibility
                    return !inputValue.startsWith("/") ? "/" + inputValue : inputValue;
                }
            });
        }
    });
    registerServerbound(ServerboundPackets1_13.EDIT_BOOK, new PacketRemapper() {

        @Override
        public void registerMap() {
            map(Type.FLAT_ITEM);
            map(Type.BOOLEAN);
            handler(new PacketHandler() {

                @Override
                public void handle(PacketWrapper wrapper) throws Exception {
                    itemRewriter.handleItemToServer(wrapper.get(Type.FLAT_ITEM, 0));
                    wrapper.write(Type.VAR_INT, 0);
                }
            });
        }
    });
    registerClientbound(ClientboundPackets1_13.OPEN_WINDOW, new PacketRemapper() {

        @Override
        public void registerMap() {
            // Id
            map(Type.UNSIGNED_BYTE);
            // Window Type
            map(Type.STRING);
            handler(wrapper -> {
                JsonElement title = wrapper.passthrough(Type.COMPONENT);
                translatableRewriter.processText(title);
                if (ViaBackwards.getConfig().fix1_13FormattedInventoryTitle()) {
                    if (title.isJsonObject() && title.getAsJsonObject().size() == 1 && title.getAsJsonObject().has("translate")) {
                        // Hotfix simple translatable components from being converted to legacy text
                        return;
                    }
                    // https://bugs.mojang.com/browse/MC-124543
                    JsonObject legacyComponent = new JsonObject();
                    legacyComponent.addProperty("text", ChatRewriter.jsonToLegacyText(title.toString()));
                    wrapper.set(Type.COMPONENT, 0, legacyComponent);
                }
            });
        }
    });
    registerClientbound(ClientboundPackets1_13.TAB_COMPLETE, new PacketRemapper() {

        @Override
        public void registerMap() {
            // Transaction id
            map(Type.VAR_INT);
            // Start
            map(Type.VAR_INT);
            // Length
            map(Type.VAR_INT);
            // Count
            map(Type.VAR_INT);
            handler(new PacketHandler() {

                @Override
                public void handle(PacketWrapper wrapper) throws Exception {
                    int start = wrapper.get(Type.VAR_INT, 1);
                    // Offset by +1 to take into account / at beginning
                    wrapper.set(Type.VAR_INT, 1, start - 1);
                    // Passthrough suggestions
                    int count = wrapper.get(Type.VAR_INT, 3);
                    for (int i = 0; i < count; i++) {
                        wrapper.passthrough(Type.STRING);
                        boolean hasTooltip = wrapper.passthrough(Type.BOOLEAN);
                        if (hasTooltip) {
                            // JSON Tooltip
                            wrapper.passthrough(Type.STRING);
                        }
                    }
                }
            });
        }
    });
    registerClientbound(ClientboundPackets1_13.BOSSBAR, new PacketRemapper() {

        @Override
        public void registerMap() {
            map(Type.UUID);
            map(Type.VAR_INT);
            handler(new PacketHandler() {

                @Override
                public void handle(PacketWrapper wrapper) throws Exception {
                    int action = wrapper.get(Type.VAR_INT, 0);
                    if (action == 0 || action == 3) {
                        translatableRewriter.processText(wrapper.passthrough(Type.COMPONENT));
                        if (action == 0) {
                            wrapper.passthrough(Type.FLOAT);
                            wrapper.passthrough(Type.VAR_INT);
                            wrapper.passthrough(Type.VAR_INT);
                            short flags = wrapper.read(Type.UNSIGNED_BYTE);
                            if ((flags & 0x04) != 0)
                                flags |= 0x02;
                            wrapper.write(Type.UNSIGNED_BYTE, flags);
                        }
                    }
                }
            });
        }
    });
    registerClientbound(ClientboundPackets1_13.ADVANCEMENTS, new PacketRemapper() {

        @Override
        public void registerMap() {
            handler(new PacketHandler() {

                @Override
                public void handle(PacketWrapper wrapper) throws Exception {
                    // Reset/clear
                    wrapper.passthrough(Type.BOOLEAN);
                    // Mapping size
                    int size = wrapper.passthrough(Type.VAR_INT);
                    for (int i = 0; i < size; i++) {
                        // Identifier
                        wrapper.passthrough(Type.STRING);
                        // Parent
                        if (wrapper.passthrough(Type.BOOLEAN))
                            wrapper.passthrough(Type.STRING);
                        // Display data
                        if (wrapper.passthrough(Type.BOOLEAN)) {
                            // Title
                            wrapper.passthrough(Type.COMPONENT);
                            // Description
                            wrapper.passthrough(Type.COMPONENT);
                            Item icon = wrapper.passthrough(Type.FLAT_ITEM);
                            itemRewriter.handleItemToClient(icon);
                            // Frame type
                            wrapper.passthrough(Type.VAR_INT);
                            // Flags
                            int flags = wrapper.passthrough(Type.INT);
                            if ((flags & 1) != 0)
                                // Background texture
                                wrapper.passthrough(Type.STRING);
                            // X
                            wrapper.passthrough(Type.FLOAT);
                            // Y
                            wrapper.passthrough(Type.FLOAT);
                        }
                        // Criteria
                        wrapper.passthrough(Type.STRING_ARRAY);
                        int arrayLength = wrapper.passthrough(Type.VAR_INT);
                        for (int array = 0; array < arrayLength; array++) {
                            // String array
                            wrapper.passthrough(Type.STRING_ARRAY);
                        }
                    }
                }
            });
        }
    });
    new TagRewriter(this).register(ClientboundPackets1_13.TAGS, RegistryType.ITEM);
    new StatisticsRewriter(this).register(ClientboundPackets1_13.STATISTICS);
}
Also used : ValueTransformer(com.viaversion.viaversion.api.protocol.remapper.ValueTransformer) PacketHandler(com.viaversion.viaversion.api.protocol.remapper.PacketHandler) TranslatableRewriter(com.viaversion.viabackwards.api.rewriters.TranslatableRewriter) PacketWrapper(com.viaversion.viaversion.api.protocol.packet.PacketWrapper) Entity1_13Types(com.viaversion.viaversion.api.minecraft.entities.Entity1_13Types) Item(com.viaversion.viaversion.api.minecraft.item.Item) BackwardsProtocol(com.viaversion.viabackwards.api.BackwardsProtocol) RegistryType(com.viaversion.viaversion.api.minecraft.RegistryType) PacketRemapper(com.viaversion.viaversion.api.protocol.remapper.PacketRemapper) Type(com.viaversion.viaversion.api.type.Type) ServerboundPackets1_13(com.viaversion.viaversion.protocols.protocol1_13to1_12_2.ServerboundPackets1_13) EntityTrackerBase(com.viaversion.viaversion.data.entity.EntityTrackerBase) UserConnection(com.viaversion.viaversion.api.connection.UserConnection) ValueTransformer(com.viaversion.viaversion.api.protocol.remapper.ValueTransformer) ItemRewriter(com.viaversion.viaversion.api.rewriter.ItemRewriter) CommandRewriter1_13_1(com.viaversion.viabackwards.protocol.protocol1_13to1_13_1.data.CommandRewriter1_13_1) JsonElement(com.viaversion.viaversion.libs.gson.JsonElement) InventoryPackets1_13_1(com.viaversion.viabackwards.protocol.protocol1_13to1_13_1.packets.InventoryPackets1_13_1) ClientWorld(com.viaversion.viaversion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld) WorldPackets1_13_1(com.viaversion.viabackwards.protocol.protocol1_13to1_13_1.packets.WorldPackets1_13_1) EntityPackets1_13_1(com.viaversion.viabackwards.protocol.protocol1_13to1_13_1.packets.EntityPackets1_13_1) ClientboundPackets1_13(com.viaversion.viaversion.protocols.protocol1_13to1_12_2.ClientboundPackets1_13) JsonObject(com.viaversion.viaversion.libs.gson.JsonObject) TagRewriter(com.viaversion.viaversion.rewriter.TagRewriter) StatisticsRewriter(com.viaversion.viaversion.rewriter.StatisticsRewriter) BackwardsMappings(com.viaversion.viabackwards.api.data.BackwardsMappings) ChatRewriter(com.viaversion.viaversion.protocols.protocol1_13to1_12_2.ChatRewriter) ViaBackwards(com.viaversion.viabackwards.ViaBackwards) EntityRewriter(com.viaversion.viaversion.api.rewriter.EntityRewriter) Protocol1_13_1To1_13(com.viaversion.viaversion.protocols.protocol1_13_1to1_13.Protocol1_13_1To1_13) CommandRewriter1_13_1(com.viaversion.viabackwards.protocol.protocol1_13to1_13_1.data.CommandRewriter1_13_1) TranslatableRewriter(com.viaversion.viabackwards.api.rewriters.TranslatableRewriter) TagRewriter(com.viaversion.viaversion.rewriter.TagRewriter) PacketRemapper(com.viaversion.viaversion.api.protocol.remapper.PacketRemapper) JsonObject(com.viaversion.viaversion.libs.gson.JsonObject) Item(com.viaversion.viaversion.api.minecraft.item.Item) StatisticsRewriter(com.viaversion.viaversion.rewriter.StatisticsRewriter) PacketHandler(com.viaversion.viaversion.api.protocol.remapper.PacketHandler) PacketWrapper(com.viaversion.viaversion.api.protocol.packet.PacketWrapper) JsonElement(com.viaversion.viaversion.libs.gson.JsonElement)

Example 12 with JsonElement

use of com.viaversion.viaversion.libs.gson.JsonElement in project ViaBackwards by ViaVersion.

the class Protocol1_15_2To1_16 method registerPackets.

@Override
protected void registerPackets() {
    executeAsyncAfterLoaded(Protocol1_16To1_15_2.class, MAPPINGS::load);
    translatableRewriter.registerBossBar(ClientboundPackets1_16.BOSSBAR);
    translatableRewriter.registerCombatEvent(ClientboundPackets1_16.COMBAT_EVENT);
    translatableRewriter.registerDisconnect(ClientboundPackets1_16.DISCONNECT);
    translatableRewriter.registerTabList(ClientboundPackets1_16.TAB_LIST);
    translatableRewriter.registerTitle(ClientboundPackets1_16.TITLE);
    translatableRewriter.registerPing();
    new CommandRewriter1_16(this).registerDeclareCommands(ClientboundPackets1_16.DECLARE_COMMANDS);
    (blockItemPackets = new BlockItemPackets1_16(this)).register();
    entityRewriter.register();
    registerClientbound(State.STATUS, 0x00, 0x00, new PacketRemapper() {

        @Override
        public void registerMap() {
            handler(wrapper -> {
                String original = wrapper.passthrough(Type.STRING);
                JsonObject object = GsonUtil.getGson().fromJson(original, JsonObject.class);
                JsonElement description = object.get("description");
                if (description == null)
                    return;
                translatableRewriter.processText(description);
                wrapper.set(Type.STRING, 0, object.toString());
            });
        }
    });
    registerClientbound(ClientboundPackets1_16.CHAT_MESSAGE, new PacketRemapper() {

        @Override
        public void registerMap() {
            handler(wrapper -> translatableRewriter.processText(wrapper.passthrough(Type.COMPONENT)));
            map(Type.BYTE);
            // Sender
            map(Type.UUID, Type.NOTHING);
        }
    });
    registerClientbound(ClientboundPackets1_16.OPEN_WINDOW, new PacketRemapper() {

        @Override
        public void registerMap() {
            // Window Id
            map(Type.VAR_INT);
            // Window Type
            map(Type.VAR_INT);
            handler(wrapper -> translatableRewriter.processText(wrapper.passthrough(Type.COMPONENT)));
            handler(wrapper -> {
                int windowType = wrapper.get(Type.VAR_INT, 1);
                if (windowType == 20) {
                    // Smithing table
                    // Open anvil inventory
                    wrapper.set(Type.VAR_INT, 1, 7);
                } else if (windowType > 20) {
                    wrapper.set(Type.VAR_INT, 1, --windowType);
                }
            });
        }
    });
    SoundRewriter soundRewriter = new SoundRewriter(this);
    soundRewriter.registerSound(ClientboundPackets1_16.SOUND);
    soundRewriter.registerSound(ClientboundPackets1_16.ENTITY_SOUND);
    soundRewriter.registerNamedSound(ClientboundPackets1_16.NAMED_SOUND);
    soundRewriter.registerStopSound(ClientboundPackets1_16.STOP_SOUND);
    // Login success
    registerClientbound(State.LOGIN, 0x02, 0x02, new PacketRemapper() {

        @Override
        public void registerMap() {
            handler(wrapper -> {
                // Transform int array to plain string
                UUID uuid = wrapper.read(Type.UUID_INT_ARRAY);
                wrapper.write(Type.STRING, uuid.toString());
            });
        }
    });
    new TagRewriter(this).register(ClientboundPackets1_16.TAGS, RegistryType.ENTITY);
    new StatisticsRewriter(this).register(ClientboundPackets1_16.STATISTICS);
    registerServerbound(ServerboundPackets1_14.ENTITY_ACTION, new PacketRemapper() {

        @Override
        public void registerMap() {
            handler(wrapper -> {
                // player id
                wrapper.passthrough(Type.VAR_INT);
                int action = wrapper.passthrough(Type.VAR_INT);
                if (action == 0) {
                    wrapper.user().get(PlayerSneakStorage.class).setSneaking(true);
                } else if (action == 1) {
                    wrapper.user().get(PlayerSneakStorage.class).setSneaking(false);
                }
            });
        }
    });
    registerServerbound(ServerboundPackets1_14.INTERACT_ENTITY, new PacketRemapper() {

        @Override
        public void registerMap() {
            handler(wrapper -> {
                // Entity Id
                wrapper.passthrough(Type.VAR_INT);
                int action = wrapper.passthrough(Type.VAR_INT);
                if (action == 0 || action == 2) {
                    if (action == 2) {
                        // Location
                        wrapper.passthrough(Type.FLOAT);
                        wrapper.passthrough(Type.FLOAT);
                        wrapper.passthrough(Type.FLOAT);
                    }
                    // Hand
                    wrapper.passthrough(Type.VAR_INT);
                }
                // New boolean: Whether the client is sneaking
                wrapper.write(Type.BOOLEAN, wrapper.user().get(PlayerSneakStorage.class).isSneaking());
            });
        }
    });
    registerServerbound(ServerboundPackets1_14.PLAYER_ABILITIES, new PacketRemapper() {

        @Override
        public void registerMap() {
            handler(wrapper -> {
                byte flags = wrapper.read(Type.BYTE);
                // Only take the isFlying value (everything else has been removed and wasn't used anyways)
                flags &= 2;
                wrapper.write(Type.BYTE, flags);
                wrapper.read(Type.FLOAT);
                wrapper.read(Type.FLOAT);
            });
        }
    });
    cancelServerbound(ServerboundPackets1_14.UPDATE_JIGSAW_BLOCK);
}
Also used : TranslatableRewriter(com.viaversion.viabackwards.api.rewriters.TranslatableRewriter) WorldNameTracker(com.viaversion.viabackwards.protocol.protocol1_15_2to1_16.data.WorldNameTracker) TranslatableRewriter1_16(com.viaversion.viabackwards.protocol.protocol1_15_2to1_16.chat.TranslatableRewriter1_16) GsonUtil(com.viaversion.viaversion.util.GsonUtil) BackwardsProtocol(com.viaversion.viabackwards.api.BackwardsProtocol) Protocol1_16To1_15_2(com.viaversion.viaversion.protocols.protocol1_16to1_15_2.Protocol1_16To1_15_2) RegistryType(com.viaversion.viaversion.api.minecraft.RegistryType) PacketRemapper(com.viaversion.viaversion.api.protocol.remapper.PacketRemapper) Type(com.viaversion.viaversion.api.type.Type) Entity1_16Types(com.viaversion.viaversion.api.minecraft.entities.Entity1_16Types) EntityTrackerBase(com.viaversion.viaversion.data.entity.EntityTrackerBase) UserConnection(com.viaversion.viaversion.api.connection.UserConnection) BackwardsMappings(com.viaversion.viabackwards.protocol.protocol1_15_2to1_16.data.BackwardsMappings) PlayerSneakStorage(com.viaversion.viabackwards.protocol.protocol1_15_2to1_16.storage.PlayerSneakStorage) SoundRewriter(com.viaversion.viabackwards.api.rewriters.SoundRewriter) JsonElement(com.viaversion.viaversion.libs.gson.JsonElement) CommandRewriter1_16(com.viaversion.viabackwards.protocol.protocol1_15_2to1_16.data.CommandRewriter1_16) State(com.viaversion.viaversion.api.protocol.packet.State) ClientWorld(com.viaversion.viaversion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld) UUID(java.util.UUID) ServerboundPackets1_14(com.viaversion.viaversion.protocols.protocol1_14to1_13_2.ServerboundPackets1_14) ClientboundPackets1_16(com.viaversion.viaversion.protocols.protocol1_16to1_15_2.ClientboundPackets1_16) JsonObject(com.viaversion.viaversion.libs.gson.JsonObject) ServerboundPackets1_16(com.viaversion.viaversion.protocols.protocol1_16to1_15_2.ServerboundPackets1_16) TagRewriter(com.viaversion.viaversion.rewriter.TagRewriter) EntityPackets1_16(com.viaversion.viabackwards.protocol.protocol1_15_2to1_16.packets.EntityPackets1_16) StatisticsRewriter(com.viaversion.viaversion.rewriter.StatisticsRewriter) BlockItemPackets1_16(com.viaversion.viabackwards.protocol.protocol1_15_2to1_16.packets.BlockItemPackets1_16) ClientboundPackets1_15(com.viaversion.viaversion.protocols.protocol1_15to1_14_4.ClientboundPackets1_15) EntityRewriter(com.viaversion.viaversion.api.rewriter.EntityRewriter) BlockItemPackets1_16(com.viaversion.viabackwards.protocol.protocol1_15_2to1_16.packets.BlockItemPackets1_16) TagRewriter(com.viaversion.viaversion.rewriter.TagRewriter) PacketRemapper(com.viaversion.viaversion.api.protocol.remapper.PacketRemapper) JsonObject(com.viaversion.viaversion.libs.gson.JsonObject) CommandRewriter1_16(com.viaversion.viabackwards.protocol.protocol1_15_2to1_16.data.CommandRewriter1_16) StatisticsRewriter(com.viaversion.viaversion.rewriter.StatisticsRewriter) JsonElement(com.viaversion.viaversion.libs.gson.JsonElement) PlayerSneakStorage(com.viaversion.viabackwards.protocol.protocol1_15_2to1_16.storage.PlayerSneakStorage) SoundRewriter(com.viaversion.viabackwards.api.rewriters.SoundRewriter) UUID(java.util.UUID)

Example 13 with JsonElement

use of com.viaversion.viaversion.libs.gson.JsonElement in project ViaBackwards by ViaVersion.

the class EntityPackets1_16 method registerRewrites.

@Override
protected void registerRewrites() {
    filter().handler((event, meta) -> {
        meta.setMetaType(Types1_14.META_TYPES.byId(meta.metaType().typeId()));
        MetaType type = meta.metaType();
        if (type == Types1_14.META_TYPES.itemType) {
            meta.setValue(protocol.getItemRewriter().handleItemToClient((Item) meta.getValue()));
        } else if (type == Types1_14.META_TYPES.blockStateType) {
            meta.setValue(protocol.getMappingData().getNewBlockStateId((int) meta.getValue()));
        } else if (type == Types1_14.META_TYPES.particleType) {
            rewriteParticle((Particle) meta.getValue());
        } else if (type == Types1_14.META_TYPES.optionalComponentType) {
            JsonElement text = meta.value();
            if (text != null) {
                protocol.getTranslatableRewriter().processText(text);
            }
        }
    });
    mapEntityType(Entity1_16Types.ZOMBIFIED_PIGLIN, Entity1_15Types.ZOMBIE_PIGMAN);
    mapTypes(Entity1_16Types.values(), Entity1_15Types.class);
    mapEntityTypeWithData(Entity1_16Types.HOGLIN, Entity1_16Types.COW).jsonName();
    mapEntityTypeWithData(Entity1_16Types.ZOGLIN, Entity1_16Types.COW).jsonName();
    mapEntityTypeWithData(Entity1_16Types.PIGLIN, Entity1_16Types.ZOMBIFIED_PIGLIN).jsonName();
    mapEntityTypeWithData(Entity1_16Types.STRIDER, Entity1_16Types.MAGMA_CUBE).jsonName();
    filter().type(Entity1_16Types.ZOGLIN).cancel(16);
    filter().type(Entity1_16Types.HOGLIN).cancel(15);
    filter().type(Entity1_16Types.PIGLIN).cancel(16);
    filter().type(Entity1_16Types.PIGLIN).cancel(17);
    filter().type(Entity1_16Types.PIGLIN).cancel(18);
    filter().type(Entity1_16Types.STRIDER).index(15).handler((event, meta) -> {
        boolean baby = meta.value();
        meta.setTypeAndValue(Types1_14.META_TYPES.varIntType, baby ? 1 : 3);
    });
    filter().type(Entity1_16Types.STRIDER).cancel(16);
    filter().type(Entity1_16Types.STRIDER).cancel(17);
    filter().type(Entity1_16Types.STRIDER).cancel(18);
    filter().type(Entity1_16Types.FISHING_BOBBER).cancel(8);
    filter().filterFamily(Entity1_16Types.ABSTRACT_ARROW).cancel(8);
    filter().filterFamily(Entity1_16Types.ABSTRACT_ARROW).handler((event, meta) -> {
        if (event.index() >= 8) {
            event.setIndex(event.index() + 1);
        }
    });
    filter().type(Entity1_16Types.WOLF).index(16).handler((event, meta) -> {
        byte mask = meta.value();
        StoredEntityData data = tracker(event.user()).entityData(event.entityId());
        data.put(new WolfDataMaskStorage(mask));
    });
    filter().type(Entity1_16Types.WOLF).index(20).handler((event, meta) -> {
        StoredEntityData data = tracker(event.user()).entityDataIfPresent(event.entityId());
        byte previousMask = 0;
        if (data != null) {
            WolfDataMaskStorage wolfData = data.get(WolfDataMaskStorage.class);
            if (wolfData != null) {
                previousMask = wolfData.tameableMask();
            }
        }
        int angerTime = meta.value();
        byte tameableMask = (byte) (angerTime > 0 ? previousMask | 2 : previousMask & -3);
        event.createExtraMeta(new Metadata(16, Types1_14.META_TYPES.byteType, tameableMask));
        event.cancel();
    });
}
Also used : Item(com.viaversion.viaversion.api.minecraft.item.Item) WolfDataMaskStorage(com.viaversion.viabackwards.protocol.protocol1_15_2to1_16.storage.WolfDataMaskStorage) JsonElement(com.viaversion.viaversion.libs.gson.JsonElement) Metadata(com.viaversion.viaversion.api.minecraft.metadata.Metadata) StoredEntityData(com.viaversion.viaversion.api.data.entity.StoredEntityData) MetaType(com.viaversion.viaversion.api.minecraft.metadata.MetaType)

Aggregations

JsonElement (com.viaversion.viaversion.libs.gson.JsonElement)13 PacketRemapper (com.viaversion.viaversion.api.protocol.remapper.PacketRemapper)7 Type (com.viaversion.viaversion.api.type.Type)7 JsonObject (com.viaversion.viaversion.libs.gson.JsonObject)7 PacketWrapper (com.viaversion.viaversion.api.protocol.packet.PacketWrapper)5 BackwardsProtocol (com.viaversion.viabackwards.api.BackwardsProtocol)4 UserConnection (com.viaversion.viaversion.api.connection.UserConnection)4 Item (com.viaversion.viaversion.api.minecraft.item.Item)4 EntityTrackerBase (com.viaversion.viaversion.data.entity.EntityTrackerBase)4 ClientWorld (com.viaversion.viaversion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld)4 HashMap (java.util.HashMap)4 Map (java.util.Map)4 ViaBackwards (com.viaversion.viabackwards.ViaBackwards)3 BackwardsMappings (com.viaversion.viabackwards.api.data.BackwardsMappings)3 TranslatableRewriter (com.viaversion.viabackwards.api.rewriters.TranslatableRewriter)3 PacketHandler (com.viaversion.viaversion.api.protocol.remapper.PacketHandler)3 SoundRewriter (com.viaversion.viabackwards.api.rewriters.SoundRewriter)2 Via (com.viaversion.viaversion.api.Via)2 RegistryType (com.viaversion.viaversion.api.minecraft.RegistryType)2 ValueTransformer (com.viaversion.viaversion.api.protocol.remapper.ValueTransformer)2