-
-
Save JayZX535/3561ee7b94baae1fa38d19286e124924 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.wildcraft.wildcraft.client.gui; | |
import com.wildcraft.wildcraft.WildCraft; | |
import com.wildcraft.wildcraft.container.ContainerFoodDish; | |
import com.wildcraft.wildcraft.tileentity.TileEntityFoodDish; | |
import net.minecraft.client.gui.inventory.GuiContainer; | |
import net.minecraft.client.renderer.GlStateManager; | |
import net.minecraft.client.resources.I18n; | |
import net.minecraft.inventory.Container; | |
import net.minecraft.inventory.IInventory; | |
import net.minecraft.util.ResourceLocation; | |
public class GUIFoodDish extends GuiContainer{ | |
private TileEntityFoodDish fooddish; | |
private IInventory playerInv; | |
public GUIFoodDish(IInventory playerInv, TileEntityFoodDish fooddish) { | |
super(new ContainerFoodDish(playerInv, fooddish)); | |
this.xSize = 175; | |
this.ySize = 179; | |
this.fooddish = fooddish; | |
this.playerInv = playerInv; | |
// TODO Auto-generated constructor stub | |
} | |
@Override | |
protected void drawGuiContainerBackgroundLayer(float partialTicks,int mouseX, int mouseY) { | |
GlStateManager.color(1.0F, 1.0F, 1.0F); | |
this.mc.getTextureManager().bindTexture(new ResourceLocation(WildCraft.MODID, "textures/gui/food_dish_gui.png")); | |
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize); | |
} | |
@Override | |
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { | |
String s = I18n.format("container.food_dish"); //Gets the formatted name for the block breaker from the language file - NOTE ADD "container.block_breaker=Block Breaker" to the language file (without quotes) and then delete this note | |
this.mc.fontRendererObj.drawString(s, this.xSize / 2 - this.mc.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); //Draws the block breaker name in the center on the top of the gui | |
this.mc.fontRendererObj.drawString(this.playerInv.getDisplayName().getFormattedText(), 8, 72, 4210752); //The player's inventory name | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment