36 lines
		
	
	
	
		
			1.7 KiB
		
	
	
	
		
			Java
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
	
		
			1.7 KiB
		
	
	
	
		
			Java
		
	
	
	
	
	
| package net.minecraft.client.gui.screens.inventory;
 | |
| 
 | |
| import net.fabricmc.api.EnvType;
 | |
| import net.fabricmc.api.Environment;
 | |
| import net.minecraft.client.gui.GuiGraphics;
 | |
| import net.minecraft.client.renderer.RenderPipelines;
 | |
| import net.minecraft.network.chat.Component;
 | |
| import net.minecraft.resources.ResourceLocation;
 | |
| import net.minecraft.world.entity.player.Inventory;
 | |
| import net.minecraft.world.inventory.GrindstoneMenu;
 | |
| 
 | |
| @Environment(EnvType.CLIENT)
 | |
| public class GrindstoneScreen extends AbstractContainerScreen<GrindstoneMenu> {
 | |
| 	private static final ResourceLocation ERROR_SPRITE = ResourceLocation.withDefaultNamespace("container/grindstone/error");
 | |
| 	private static final ResourceLocation GRINDSTONE_LOCATION = ResourceLocation.withDefaultNamespace("textures/gui/container/grindstone.png");
 | |
| 
 | |
| 	public GrindstoneScreen(GrindstoneMenu menu, Inventory playerInventory, Component title) {
 | |
| 		super(menu, playerInventory, title);
 | |
| 	}
 | |
| 
 | |
| 	@Override
 | |
| 	public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) {
 | |
| 		super.render(guiGraphics, mouseX, mouseY, partialTick);
 | |
| 		this.renderTooltip(guiGraphics, mouseX, mouseY);
 | |
| 	}
 | |
| 
 | |
| 	@Override
 | |
| 	protected void renderBg(GuiGraphics guiGraphics, float partialTick, int mouseX, int mouseY) {
 | |
| 		int i = (this.width - this.imageWidth) / 2;
 | |
| 		int j = (this.height - this.imageHeight) / 2;
 | |
| 		guiGraphics.blit(RenderPipelines.GUI_TEXTURED, GRINDSTONE_LOCATION, i, j, 0.0F, 0.0F, this.imageWidth, this.imageHeight, 256, 256);
 | |
| 		if ((this.menu.getSlot(0).hasItem() || this.menu.getSlot(1).hasItem()) && !this.menu.getSlot(2).hasItem()) {
 | |
| 			guiGraphics.blitSprite(RenderPipelines.GUI_TEXTURED, ERROR_SPRITE, i + 92, j + 31, 28, 21);
 | |
| 		}
 | |
| 	}
 | |
| }
 |