content: package com.accbdd.complicated_bees.screen;
  
  import com.accbdd.complicated_bees.screen.widget.AnalyzerScrollWidget;
  import net.minecraft.client.gui.GuiGraphics;
  import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
  import net.minecraft.network.chat.Component;
  import net.minecraft.resources.ResourceLocation;
  import net.minecraft.world.entity.player.Inventory;
  import net.minecraft.world.item.ItemStack;
  
  import static com.accbdd.complicated_bees.ComplicatedBees.MODID;
  
  public class AnalyzerScreen extends AbstractContainerScreen<AbstractAnalyzerMenu> {
      private final ResourceLocation GUI = ResourceLocation.tryBuild(MODID, "textures/gui/analyzer.png");
      private AnalyzerScrollWidget widget;
  
      public AnalyzerScreen(AbstractAnalyzerMenu container, Inventory inventory, Component title) {
          super(container, inventory, title);
          this.imageWidth = 249;
          this.imageHeight = 216;
      }
  
      @Override
      protected void init() {
          super.init();
          this.widget = addRenderableWidget(new AnalyzerScrollWidget(leftPos + 8, topPos + 8, 207, 120, getMenu()));
      }
  
      @Override
      protected void renderLabels(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY) {
      }
  
      @Override
      protected void renderBg(GuiGraphics graphics, float partialTicks, int mouseX, int mouseY) {
          renderBackground(graphics);
          graphics.blit(GUI, leftPos, topPos, 0, 0, this.imageWidth, this.imageHeight);
      }
  
      @Override
      public void render(GuiGraphics graphics, int mousex, int mousey, float partialTick) {
          super.render(graphics, mousex, mousey, partialTick);
          renderTooltip(graphics, mousex, mousey);
      }
  
      @Override
      protected void renderTooltip(GuiGraphics graphics, int mousex, int mousey) {
          if (this.menu.getCarried().isEmpty()) {
              if (this.hoveredSlot != null && this.hoveredSlot.hasItem()) {
                  ItemStack itemstack = this.hoveredSlot.getItem();
                  graphics.renderTooltip(this.font, this.getTooltipFromContainerItem(itemstack), itemstack.getTooltipImage(), itemstack, mousex, mousey);
              } else if (widget.hoveredStack != null) {
                  graphics.renderTooltip(this.font, this.getTooltipFromContainerItem(widget.hoveredStack), widget.hoveredStack.getTooltipImage(), widget.hoveredStack, mousex, mousey);
              } else if (widget.geneTooltip != null) {
                  graphics.renderTooltip(this.font, widget.geneTooltip, mousex, mousey);
              }
          }
      }
  }
  