Search in sources :

Example 1 with TileMaterialGrader

use of net.silentchaos512.gems.tile.TileMaterialGrader in project SilentGems by SilentChaos512.

the class GuiHandlerSilentGems method getClientGuiElement.

@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
    TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
    if (ID != ID_QUIVER && tile == null) {
        SilentGems.logHelper.warning(String.format("Missing TileEntity at %d %d %d!", x, y, z));
        return null;
    }
    switch(ID) {
        case ID_ALTAR:
            if (tile instanceof TileChaosAltar) {
                TileChaosAltar tileAltar = (TileChaosAltar) tile;
                return new GuiChaosAltar(player.inventory, tileAltar);
            }
            return null;
        case ID_BURNER_PYLON:
            if (tile instanceof TileChaosPylon) {
                return new GuiBurnerPylon(player.inventory, (TileChaosPylon) tile);
            }
            return null;
        case ID_MATERIAL_GRADER:
            if (tile instanceof TileMaterialGrader) {
                return new GuiMaterialGrader(player.inventory, (TileMaterialGrader) tile);
            }
            return null;
        case ID_QUIVER:
            EnumHand hand = x == 1 ? EnumHand.OFF_HAND : EnumHand.MAIN_HAND;
            ItemStack stack = player.getHeldItem(hand);
            return new GuiQuiver(new ContainerQuiver(stack, player.inventory, hand));
        default:
            SilentGems.logHelper.warning("No GUI with ID " + ID + "!");
            return null;
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) ContainerQuiver(net.silentchaos512.gems.inventory.ContainerQuiver) TileChaosAltar(net.silentchaos512.gems.tile.TileChaosAltar) EnumHand(net.minecraft.util.EnumHand) TileChaosPylon(net.silentchaos512.gems.tile.TileChaosPylon) BlockPos(net.minecraft.util.math.BlockPos) ItemStack(net.minecraft.item.ItemStack) TileMaterialGrader(net.silentchaos512.gems.tile.TileMaterialGrader)

Example 2 with TileMaterialGrader

use of net.silentchaos512.gems.tile.TileMaterialGrader in project SilentGems by SilentChaos512.

the class GuiHandlerSilentGems method getServerGuiElement.

@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
    TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
    if (ID != ID_QUIVER && tile == null) {
        SilentGems.logHelper.warning(String.format("Missing TileEntity at %d %d %d!", x, y, z));
        return null;
    }
    switch(ID) {
        case ID_ALTAR:
            if (tile instanceof TileChaosAltar) {
                TileChaosAltar tileAltar = (TileChaosAltar) tile;
                return new ContainerChaosAltar(player.inventory, tileAltar);
            }
            return null;
        case ID_BURNER_PYLON:
            if (tile instanceof TileChaosPylon) {
                return new ContainerBurnerPylon(player.inventory, (TileChaosPylon) tile);
            }
            return null;
        case ID_MATERIAL_GRADER:
            if (tile instanceof TileMaterialGrader) {
                return new ContainerMaterialGrader(player.inventory, (TileMaterialGrader) tile);
            }
            return null;
        case ID_QUIVER:
            EnumHand hand = x == 1 ? EnumHand.OFF_HAND : EnumHand.MAIN_HAND;
            ItemStack stack = player.getHeldItem(hand);
            return new ContainerQuiver(stack, player.inventory, hand);
        default:
            SilentGems.logHelper.warning("No GUI with ID " + ID + "!");
            return null;
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) ContainerMaterialGrader(net.silentchaos512.gems.inventory.ContainerMaterialGrader) ContainerBurnerPylon(net.silentchaos512.gems.inventory.ContainerBurnerPylon) ContainerQuiver(net.silentchaos512.gems.inventory.ContainerQuiver) TileChaosAltar(net.silentchaos512.gems.tile.TileChaosAltar) EnumHand(net.minecraft.util.EnumHand) ContainerChaosAltar(net.silentchaos512.gems.inventory.ContainerChaosAltar) TileChaosPylon(net.silentchaos512.gems.tile.TileChaosPylon) BlockPos(net.minecraft.util.math.BlockPos) ItemStack(net.minecraft.item.ItemStack) TileMaterialGrader(net.silentchaos512.gems.tile.TileMaterialGrader)

Example 3 with TileMaterialGrader

use of net.silentchaos512.gems.tile.TileMaterialGrader in project SilentGems by SilentChaos512.

the class GuiMaterialGrader method drawDebugInfo.

private void drawDebugInfo() {
    if (!(tileInventory instanceof TileMaterialGrader)) {
        return;
    }
    TileMaterialGrader tile = (TileMaterialGrader) tileInventory;
    FontRenderer fontRender = mc.fontRendererObj;
    int x = 5;
    int y = 5;
    int yIncrement = 10;
    int color = 0xFFFFFF;
    GlStateManager.pushMatrix();
    float scale = 1f;
    GlStateManager.scale(scale, scale, 1f);
    for (String str : tile.getDebugLines()) {
        fontRender.drawStringWithShadow(str, x, y, color);
        y += yIncrement;
    }
    GlStateManager.popMatrix();
}
Also used : FontRenderer(net.minecraft.client.gui.FontRenderer) TileMaterialGrader(net.silentchaos512.gems.tile.TileMaterialGrader)

Aggregations

TileMaterialGrader (net.silentchaos512.gems.tile.TileMaterialGrader)3 ItemStack (net.minecraft.item.ItemStack)2 TileEntity (net.minecraft.tileentity.TileEntity)2 EnumHand (net.minecraft.util.EnumHand)2 BlockPos (net.minecraft.util.math.BlockPos)2 ContainerQuiver (net.silentchaos512.gems.inventory.ContainerQuiver)2 TileChaosAltar (net.silentchaos512.gems.tile.TileChaosAltar)2 TileChaosPylon (net.silentchaos512.gems.tile.TileChaosPylon)2 FontRenderer (net.minecraft.client.gui.FontRenderer)1 ContainerBurnerPylon (net.silentchaos512.gems.inventory.ContainerBurnerPylon)1 ContainerChaosAltar (net.silentchaos512.gems.inventory.ContainerChaosAltar)1 ContainerMaterialGrader (net.silentchaos512.gems.inventory.ContainerMaterialGrader)1