package net.mattias.blockarmor.core.armor;

import net.mattias.blockarmor.BlockArmor;
import net.mattias.blockarmor.core.ModArmorMaterials;
import net.mattias.blockarmor.item.ModItems;
import net.minecraft.client.Minecraft;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.network.chat.Component;
import net.minecraft.world.SimpleMenuProvider;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.CraftingMenu;
import net.minecraft.world.item.ArmorItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.level.Level;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.event.TickEvent;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import org.lwjgl.glfw.GLFW;

import javax.annotation.Nullable;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

@Mod.EventBusSubscriber(modid = BlockArmor.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT)
public class CraftingTableArmor extends ArmorItem {

    private static final ConcurrentHashMap<UUID, Boolean> lastRPressed = new ConcurrentHashMap<>();

    public CraftingTableArmor(ModArmorMaterials material, Type type, Properties properties) {
        super(material, type, properties);
    }

    @Override
    @OnlyIn(Dist.CLIENT)
    public void appendHoverText(ItemStack stack, @Nullable Level level, List<Component> tooltip, TooltipFlag flag) {
        tooltip.add(Component.translatable("item.blockarmor.crafting_table_armor.tooltip"));
    }

    @SubscribeEvent
    public static void onPlayerTick(TickEvent.PlayerTickEvent event) {
        if (event.phase != TickEvent.Phase.END || !event.player.level().isClientSide()) return;

        LocalPlayer player = (LocalPlayer) event.player;
        long window = Minecraft.getInstance().getWindow().getWindow();
        int rKeyState = GLFW.glfwGetKey(window, GLFW.GLFW_KEY_R);

        boolean isRPressed = rKeyState == GLFW.GLFW_PRESS || rKeyState == GLFW.GLFW_REPEAT;
        boolean wasRPressed = lastRPressed.getOrDefault(player.getUUID(), false);

        if (player.isShiftKeyDown() && isRPressed && !wasRPressed) {
            if (isWearingFullSet(player)) {
                player.openMenu(new SimpleMenuProvider((id, inv, p) -> new CraftingMenu(id, inv, null), Component.translatable("container.crafting")));
            }
        }

        lastRPressed.put(player.getUUID(), isRPressed);
    }

    private static boolean isWearingFullSet(Player player) {
        return player.getItemBySlot(EquipmentSlot.HEAD).getItem() == ModItems.CRAFTING_TABLE_HELMET.get() &&
                player.getItemBySlot(EquipmentSlot.CHEST).getItem() == ModItems.CRAFTING_TABLE_CHESTPLATE.get() &&
                player.getItemBySlot(EquipmentSlot.LEGS).getItem() == ModItems.CRAFTING_TABLE_LEGGINGS.get() &&
                player.getItemBySlot(EquipmentSlot.FEET).getItem() == ModItems.CRAFTING_TABLE_BOOTS.get();
    }
}
package net.mattias.blockarmor.core.armor;

import net.mattias.blockarmor.BlockArmor;
import net.mattias.blockarmor.core.ModArmorMaterials;
import net.mattias.blockarmor.item.ModItems;
import net.minecraft.client.Minecraft;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.network.chat.Component;
import net.minecraft.world.SimpleContainer;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ArmorItem;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.item.crafting.RecipeType;
import net.minecraft.world.level.Level;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.event.TickEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import org.lwjgl.glfw.GLFW;

import javax.annotation.Nullable;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

@Mod.EventBusSubscriber(modid = BlockArmor.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT)
public class FurnaceArmor extends ArmorItem {

    private static final ConcurrentHashMap<UUID, Boolean> lastRPressed = new ConcurrentHashMap<>();

    public FurnaceArmor(ModArmorMaterials material, Type type, Properties properties) {
        super(material, type, properties);
    }

    @Override
    @OnlyIn(Dist.CLIENT)
    public void appendHoverText(ItemStack stack, @Nullable Level level, List<Component> tooltip, TooltipFlag flag) {
        tooltip.add(Component.translatable("item.blockarmor.furnace_armor.tooltip"));
    }

    @SubscribeEvent
    public static void onPlayerTick(TickEvent.PlayerTickEvent event) {
        if (event.phase != TickEvent.Phase.END || !event.player.level().isClientSide()) return;

        LocalPlayer player = (LocalPlayer) event.player;
        long window = Minecraft.getInstance().getWindow().getWindow();
        int rKeyState = GLFW.glfwGetKey(window, GLFW.GLFW_KEY_R);

        boolean isRPressed = rKeyState == GLFW.GLFW_PRESS || rKeyState == GLFW.GLFW_REPEAT;
        boolean wasRPressed = lastRPressed.getOrDefault(player.getUUID(), false);

        if (player.isShiftKeyDown() && isRPressed && !wasRPressed) {
            if (isWearingFullSet(player)) {
                smeltInventory(player);
            }
        }

        lastRPressed.put(player.getUUID(), isRPressed);
    }

    private static boolean isWearingFullSet(Player player) {
        return player.getItemBySlot(EquipmentSlot.HEAD).getItem() == ModItems.FURNACE_HELMET.get() &&
                player.getItemBySlot(EquipmentSlot.CHEST).getItem() == ModItems.FURNACE_CHESTPLATE.get() &&
                player.getItemBySlot(EquipmentSlot.LEGS).getItem() == ModItems.FURNACE_LEGGINGS.get() &&
                player.getItemBySlot(EquipmentSlot.FEET).getItem() == ModItems.FURNACE_BOOTS.get();
    }

    private static void smeltInventory(Player player) {
        net.minecraft.world.entity.player.Inventory inventory = player.getInventory();
        Level level = player.level();

        for (int i = 0; i < inventory.getContainerSize(); i++) {
            ItemStack stack = inventory.getItem(i);
            if (!stack.isEmpty()) {
                SimpleContainer container = new SimpleContainer(1);
                container.setItem(0, stack);
                int finalI = i;
                level.getRecipeManager().getRecipeFor(RecipeType.SMELTING, container, level)
                        .ifPresent(recipe -> {
                            ItemStack result = recipe.getResultItem(level.registryAccess()).copy();
                            result.setCount(stack.getCount());
                            inventory.setItem(finalI, result);
                        });
            }
        }
    }
}
When pressing R nothing happens but the tooltip is added

There is no keybind for R in the settings maybe the keybind for R never got set and that's why when pressing R nothing happens?