Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.troglodytegames.mods.legendofartisans.guis;
- import java.util.List;
- import net.minecraft.client.gui.GuiButton;
- import net.minecraft.client.gui.GuiLabel;
- import net.minecraft.client.gui.GuiScreen;
- import net.minecraft.init.Items;
- import net.minecraft.item.ItemStack;
- import net.minecraft.util.ResourceLocation;
- import org.lwjgl.opengl.GL11;
- import com.troglodytegames.mods.legendofartisans.LegendOfArtisansMod;
- public class LegendaryRumourGui extends GuiScreen {
- public static final int GUI_ID = 20;
- private static final int CLOSE_BUTTON_ID = 0;
- private ResourceLocation backgroundTexture;
- public LegendaryRumourGui() {
- backgroundTexture = new ResourceLocation(LegendOfArtisansMod.MODID,"textures/gui/legendaryrumourgui.png");
- }
- @Override
- public void initGui() {
- super.initGui();
- GuiButton closeButton = new GuiButton(CLOSE_BUTTON_ID,
- (width / 2) - 25 - 10, height - 27, 50, 20, "Close");
- buttonList.add(closeButton);
- }
- @Override
- public boolean doesGuiPauseGame() {
- return false;
- }
- @Override
- protected void actionPerformed(GuiButton button) {
- if (button.id == CLOSE_BUTTON_ID) {
- this.mc.displayGuiScreen((GuiScreen)null);
- return;
- }
- }
- /**
- * Draws the screen and all the components in it.
- */
- public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
- {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(backgroundTexture);
- this.drawTexturedModalRect( (this.width - 256) / 2, 0, 0, 0, 256, 256);
- drawShapelessCrafting((this.width - 100) / 2, 180, LegendOfArtisansMod.legendarybookShapeless);
- for (int k = 0; k < this.buttonList.size(); ++k)
- {
- ((GuiButton)this.buttonList.get(k)).drawButton(this.mc, p_73863_1_, p_73863_2_);
- }
- for (int k = 0; k < this.labelList.size(); ++k)
- {
- ((GuiLabel)this.labelList.get(k)).func_146159_a(this.mc, p_73863_1_, p_73863_2_);
- }
- }
- protected void drawShapelessCrafting(int x, int y, List<ItemStack> stacks) {
- int offset = 0;
- for (ItemStack stack : stacks) {
- itemRender.renderItemIntoGUI(fontRendererObj, this.mc.getTextureManager(), stack, x + offset, y);
- offset = offset + 30;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment