Started on TechManuel

This commit is contained in:
Gig 2015-04-18 12:13:22 +01:00
parent a42c707470
commit 787df47cfa
4 changed files with 58 additions and 2 deletions

View file

@ -16,6 +16,7 @@ public class GuiHandler implements IGuiHandler {
public static final int centrifugeID = 3;
public static final int rollingMachineID = 4;
public static final int blastFurnaceID = 5;
public static final int manuelID = 6;
@Override
@ -32,7 +33,10 @@ public class GuiHandler implements IGuiHandler {
return new ContainerRollingMachine((TileRollingMachine) world.getTileEntity(x, y, z), player);
} else if (ID == blastFurnaceID) {
return new ContainerBlastFurnace((TileBlastFurnace) world.getTileEntity(x, y, z), player);
} else if (ID == manuelID) {
return null;
}
return null;
}
@ -50,6 +54,8 @@ public class GuiHandler implements IGuiHandler {
return new GuiRollingMachine(player, (TileRollingMachine) world.getTileEntity(x, y, z));
} else if (ID == blastFurnaceID) {
return new GuiBlastFurnace(player, (TileBlastFurnace) world.getTileEntity(x, y, z));
} else if (ID == manuelID) {
return new GuiManuel(player);
}
return null;
}

View file

@ -0,0 +1,39 @@
package techreborn.client.gui;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
public class GuiManuel extends GuiScreen{
public final int guiWidth = 256;
public final int guiHeight = 180;
private int guiLeft, guiTop;
private static final ResourceLocation tomeGuipages = new ResourceLocation("techreborn:" + "textures/gui/manuel.png");
public GuiManuel(EntityPlayer player) {}
@Override
public void initGui()
{
this.guiLeft = this.width / 2 - this.guiWidth / 2;
this.guiTop = this.height / 2 - this.guiHeight / 2;
}
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
// this.fontRendererObj.setUnicodeFlag(true);
this.mc.getTextureManager().bindTexture(tomeGuipages);
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.guiWidth, this.guiHeight);
super.drawScreen(mouseX, mouseY, partialTicks);
}
@Override
public boolean doesGuiPauseGame()
{
return false;
}
}

View file

@ -1,9 +1,13 @@
package techreborn.items;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import techreborn.Core;
import techreborn.client.GuiHandler;
import techreborn.client.TechRebornCreativeTab;
public class ItemTechManuel extends Item{
@ -20,4 +24,11 @@ public class ItemTechManuel extends Item{
itemIcon = iconRegister.registerIcon("techreborn:" + "tool/manuel");
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
{
player.openGui(Core.INSTANCE, GuiHandler.manuelID, world, (int)player.posX, (int)player.posY, (int)player.posY);
return itemStack;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB