Implemented ghost items for the inventory - will be adjusted.

This commit is contained in:
WayofTime 2016-01-14 08:27:09 -05:00
parent ec7676a69c
commit ac919c7882
12 changed files with 424 additions and 66 deletions

View file

@ -8,8 +8,10 @@ import net.minecraftforge.fml.common.network.IGuiHandler;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.tile.TileSoulForge;
import WayofTime.bloodmagic.tile.TileTeleposer;
import WayofTime.bloodmagic.tile.container.ContainerItemRoutingNode;
import WayofTime.bloodmagic.tile.container.ContainerSoulForge;
import WayofTime.bloodmagic.tile.container.ContainerTeleposer;
import WayofTime.bloodmagic.tile.routing.TileOutputRoutingNode;
public class GuiHandler implements IGuiHandler
{
@ -24,6 +26,8 @@ public class GuiHandler implements IGuiHandler
return new ContainerTeleposer(player.inventory, (TileTeleposer) world.getTileEntity(pos));
case Constants.Gui.SOUL_FORGE_GUI:
return new ContainerSoulForge(player.inventory, (TileSoulForge) world.getTileEntity(pos));
case Constants.Gui.ROUTING_NODE_GUI:
return new ContainerItemRoutingNode(player.inventory, (TileOutputRoutingNode) world.getTileEntity(pos));
}
return null;
@ -42,6 +46,8 @@ public class GuiHandler implements IGuiHandler
return new GuiTeleposer(player.inventory, (TileTeleposer) world.getTileEntity(pos));
case Constants.Gui.SOUL_FORGE_GUI:
return new GuiSoulForge(player.inventory, (TileSoulForge) world.getTileEntity(pos));
case Constants.Gui.ROUTING_NODE_GUI:
return new GuiItemRoutingNode(player.inventory, (TileOutputRoutingNode) world.getTileEntity(pos));
}
}

View file

@ -0,0 +1,40 @@
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.ContainerItemRoutingNode;
@SideOnly(Side.CLIENT)
public class GuiItemRoutingNode extends GuiContainer
{
public GuiItemRoutingNode(InventoryPlayer playerInventory, IInventory tileRoutingNode)
{
super(new ContainerItemRoutingNode(playerInventory, tileRoutingNode));
this.xSize = 176;
this.ySize = 169;
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
{
// this.fontRendererObj.drawString(TextHelper.localize("tile.BloodMagic.soulForge.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/routingNode.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);
}
}