Worked on the Alchemy Table - final push for -35

This commit is contained in:
WayofTime 2016-05-02 08:27:38 -04:00
parent bc7760b11b
commit 7116e3775e
9 changed files with 268 additions and 43 deletions

View file

@ -0,0 +1,54 @@
package WayofTime.bloodmagic.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.tile.container.ContainerAlchemyTable;
import WayofTime.bloodmagic.util.helper.TextHelper;
@SideOnly(Side.CLIENT)
public class GuiAlchemyTable extends GuiContainer
{
public IInventory tileTable;
public GuiAlchemyTable(InventoryPlayer playerInventory, IInventory tileTable)
{
super(new ContainerAlchemyTable(playerInventory, tileTable));
this.tileTable = tileTable;
this.xSize = 176;
this.ySize = 205;
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
{
this.fontRendererObj.drawString(TextHelper.localize("tile.BloodMagic.alchemyTable.name"), 8, 5, 4210752);
this.fontRendererObj.drawString(TextHelper.localize("container.inventory"), 8, 111, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
ResourceLocation soulForgeGuiTextures = new ResourceLocation(Constants.Mod.MODID + ":textures/gui/alchemyTable.png");
this.mc.getTextureManager().bindTexture(soulForgeGuiTextures);
int i = (this.width - this.xSize) / 2;
int j = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize);
int l = this.getCookProgressScaled(90);
this.drawTexturedModalRect(i + 115, j + 14 + 90 - l, 176, 90 - l, 18, l);
}
public int getCookProgressScaled(int scale)
{
// double progress = ((TileAlchemyTable) tileTable).getProgressForGui();
// return (int) (progress * scale);
return scale / 2;
}
}

View file

@ -1,19 +1,21 @@
package WayofTime.bloodmagic.client.gui;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.tile.TileAlchemyTable;
import WayofTime.bloodmagic.tile.TileSoulForge;
import WayofTime.bloodmagic.tile.TileTeleposer;
import WayofTime.bloodmagic.tile.container.ContainerAlchemyTable;
import WayofTime.bloodmagic.tile.container.ContainerItemRoutingNode;
import WayofTime.bloodmagic.tile.container.ContainerMasterRoutingNode;
import WayofTime.bloodmagic.tile.container.ContainerSoulForge;
import WayofTime.bloodmagic.tile.container.ContainerTeleposer;
import WayofTime.bloodmagic.tile.routing.TileFilteredRoutingNode;
import WayofTime.bloodmagic.tile.routing.TileMasterRoutingNode;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;
public class GuiHandler implements IGuiHandler
{
@ -32,6 +34,8 @@ public class GuiHandler implements IGuiHandler
return new ContainerItemRoutingNode(player.inventory, (TileFilteredRoutingNode) world.getTileEntity(pos));
case Constants.Gui.MASTER_ROUTING_NODE_GUI:
return new ContainerMasterRoutingNode(player.inventory, (TileMasterRoutingNode) world.getTileEntity(pos));
case Constants.Gui.ALCHEMY_TABLE_GUI:
return new ContainerAlchemyTable(player.inventory, (TileAlchemyTable) world.getTileEntity(pos));
}
return null;
@ -54,6 +58,8 @@ public class GuiHandler implements IGuiHandler
return new GuiItemRoutingNode(player.inventory, (TileFilteredRoutingNode) world.getTileEntity(pos));
case Constants.Gui.MASTER_ROUTING_NODE_GUI:
return new GuiMasterRoutingNode(player.inventory, (TileMasterRoutingNode) world.getTileEntity(pos));
case Constants.Gui.ALCHEMY_TABLE_GUI:
return new GuiAlchemyTable(player.inventory, (TileAlchemyTable) world.getTileEntity(pos));
}
}