Search in sources :

Example 71 with ResourceLocation

use of net.minecraft.util.ResourceLocation in project Pearcel-Mod by MiningMark48.

the class GuiPearcelStorageCrate method drawGuiContainerBackgroundLayer.

@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
    GL11.glColor4f(1F, 1F, 1F, 1F);
    this.mc.getTextureManager().bindTexture(new ResourceLocation(texture));
    this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation)

Example 72 with ResourceLocation

use of net.minecraft.util.ResourceLocation in project ArsMagica2 by Mithion.

the class GuiKeystone method drawGuiContainerForegroundLayer.

@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
    int l = (width - xSize) / 2;
    int i1 = (height - ySize) / 2;
    mc.renderEngine.bindTexture(new ResourceLocation("textures/atlas/items.png"));
    int numCombos = Math.min(ItemsCommonProxy.keystone.numCombinations(((ContainerKeystone) this.inventorySlots).getKeystoneStack()), comboScrollOffset + 9);
    int cx = xSize;
    int cy = 13;
    Tessellator t = Tessellator.instance;
    KeystoneCombination matchedCombo = ((ContainerKeystone) this.inventorySlots).getCurrentMatchedCombination();
    for (int i = comboScrollOffset; i < numCombos; ++i) {
        KeystoneCombination combo = ItemsCommonProxy.keystone.getCombinationAt(((ContainerKeystone) this.inventorySlots).getKeystoneStack(), i);
        if (matchedCombo != null && combo.equals(matchedCombo)) {
            currentCombination = i;
            for (int n = 0; n < combo.metas.length; ++n) {
                if (combo.metas[n] > -1) {
                    IIcon icon = AMGuiIcons.selectedRunes;
                    AMGuiHelper.DrawIconAtXY(icon, cx, cy, this.zLevel, 16, 16, true);
                }
                cx += 18;
            }
            mc.renderEngine.bindTexture(new ResourceLocation("textures/atlas/items.png"));
            cx = xSize;
        }
        for (int n = 0; n < combo.metas.length; ++n) {
            if (combo.metas[n] > -1) {
                IIcon icon = ItemsCommonProxy.rune.getIconFromDamage(combo.metas[n]);
                AMGuiHelper.DrawIconAtXY(icon, cx, cy, this.zLevel, 16, 16, true);
            }
            cx += 18;
        }
        cy += 18;
        cx = xSize;
    }
    mc.renderEngine.bindTexture(extras);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5F);
    //special slot(s)
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
    int index = ((ContainerKeystone) this.inventorySlots).specialSlotIndex - 32;
    int x = 8 + 18 * index;
    int y = (((ContainerKeystone) this.inventorySlots).runebagSlot > -1) ? 216 : 179;
    drawTexturedModalRect(x, y, 0, 20, 16, 16);
    if (((ContainerKeystone) this.inventorySlots).runebagSlot > -1) {
        index = ((ContainerKeystone) this.inventorySlots).runebagSlot;
        x = 8 + 18 * (index % 9);
        y = index < 9 ? 216 : 140 + 18 * (int) Math.floor(index / 9f);
        drawTexturedModalRect(x, y, 0, 20, 16, 16);
    }
    GL11.glDisable(GL11.GL_BLEND);
    combinationName.drawTextBox();
    if (AMGuiHelper.instance.getSlowTicker() < displayTime) {
        fontRendererObj.drawSplitString(displayMessage, -90, 0, 90, displayColor);
    } else {
        displayTime = 0;
    }
    if (matchedCombo != null) {
        combinationName.setText(matchedCombo.name);
    }
    if (hoveredCombo > -1) {
        KeystoneCombination combo = ItemsCommonProxy.keystone.getCombinationAt(((ContainerKeystone) this.inventorySlots).getKeystoneStack(), hoveredCombo);
        ArrayList<String> lines = new ArrayList<String>();
        lines.add(combo.name);
        lines.add("\2477\247o" + StatCollector.translateToLocal("am2.gui.keystoneComboClick"));
        lines.add("\2477\247o" + StatCollector.translateToLocal("am2.gui.keystoneComboClick2") + "\247r");
        AMGuiHelper.drawHoveringText(lines, par1 - 25, par2 + 18, Minecraft.getMinecraft().fontRenderer, this.xSize, this.ySize);
    }
}
Also used : Tessellator(net.minecraft.client.renderer.Tessellator) KeystoneCombination(am2.items.ItemKeystone.KeystoneCombination) IIcon(net.minecraft.util.IIcon) ResourceLocation(net.minecraft.util.ResourceLocation) ArrayList(java.util.ArrayList) ContainerKeystone(am2.items.ContainerKeystone)

Example 73 with ResourceLocation

use of net.minecraft.util.ResourceLocation in project ArsMagica2 by Mithion.

the class AM2FontRenderer method readGlyphSizes.

private void readGlyphSizes() {
    try {
        InputStream inputstream = Minecraft.getMinecraft().getResourceManager().getResource(new ResourceLocation("font/glyph_sizes.bin")).getInputStream();
        inputstream.read(this.glyphWidth);
    } catch (IOException ioexception) {
        throw new RuntimeException(ioexception);
    }
}
Also used : InputStream(java.io.InputStream) ResourceLocation(net.minecraft.util.ResourceLocation) IOException(java.io.IOException)

Example 74 with ResourceLocation

use of net.minecraft.util.ResourceLocation in project ConvenientAdditions by Necr0.

the class ModLoot method onLootTableLoad.

@SubscribeEvent
public void onLootTableLoad(LootTableLoadEvent event) {
    ResourceLocation n = event.getName();
    if (n.equals(LootTableList.CHESTS_END_CITY_TREASURE)) {
        if (ModConfigTools.mobCatcher_loot)
            event.getTable().getPool("main").addEntry(new LootEntryItem(ModItems.itemMobCatcherMega, 1, 3, new LootFunction[0], new LootCondition[0], ModConstants.Mod.MODID + ":megaMCD"));
    } else if (n.equals(LootTableList.CHESTS_STRONGHOLD_CORRIDOR)) {
        if (ModConfigTools.mobCatcher_loot)
            event.getTable().getPool("main").addEntry(new LootEntryItem(ModItems.itemMobCatcherHyper, 1, 3, new LootFunction[0], new LootCondition[0], ModConstants.Mod.MODID + ":hyperMCD"));
    } else if (n.equals(LootTableList.CHESTS_SIMPLE_DUNGEON)) {
        if (ModConfigTools.mobCatcher_loot) {
            event.getTable().getPool("main").addEntry(new LootEntryItem(ModItems.itemMobCatcherSuper, 1, 3, new LootFunction[0], new LootCondition[0], ModConstants.Mod.MODID + ":superMCD"));
            event.getTable().getPool("main").addEntry(new LootEntryItem(ModItems.itemMobCatcherRegular, 3, -2, new LootFunction[0], new LootCondition[0], ModConstants.Mod.MODID + ":regularMCD"));
        }
    }
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) LootEntryItem(net.minecraft.world.storage.loot.LootEntryItem) LootFunction(net.minecraft.world.storage.loot.functions.LootFunction) LootCondition(net.minecraft.world.storage.loot.conditions.LootCondition) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 75 with ResourceLocation

use of net.minecraft.util.ResourceLocation in project ConvenientAdditions by Necr0.

the class ModEntities method init.

public static void init() {
    EntityRegistry.registerModEntity(new ResourceLocation(ModConstants.Mod.MODID, ModConstants.Entities.launchingArrowEntityName), EntityLaunchingArrow.class, ModConstants.Entities.launchingArrowEntityName, ModConstants.Entities.lauchingArrowEntityId, ConvenientAdditions.INSTANCE, 128, 5, true);
    EntityRegistry.registerModEntity(new ResourceLocation(ModConstants.Mod.MODID, ModConstants.Entities.specialItemEntityName), EntitySpecialItem.class, ModConstants.Entities.specialItemEntityName, ModConstants.Entities.specialItemEntityId, ConvenientAdditions.INSTANCE, 128, 5, true);
    EntityRegistry.registerModEntity(new ResourceLocation(ModConstants.Mod.MODID, ModConstants.Entities.mobCatcherEntityName), EntityMobCatcher.class, ModConstants.Entities.mobCatcherEntityName, ModConstants.Entities.mobCatcherEntityId, ConvenientAdditions.INSTANCE, 128, 5, true);
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation)

Aggregations

ResourceLocation (net.minecraft.util.ResourceLocation)272 ItemStack (net.minecraft.item.ItemStack)51 Block (net.minecraft.block.Block)47 Item (net.minecraft.item.Item)32 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)31 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)30 IBlockState (net.minecraft.block.state.IBlockState)17 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)15 ArrayList (java.util.ArrayList)14 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)14 Map (java.util.Map)11 EntityPlayer (net.minecraft.entity.player.EntityPlayer)11 ShaderLayer (blusunrize.immersiveengineering.api.shader.ShaderCase.ShaderLayer)10 IOException (java.io.IOException)10 TileEntity (net.minecraft.tileentity.TileEntity)9 IBakedModel (net.minecraft.client.renderer.block.model.IBakedModel)8 EnumFacing (net.minecraft.util.EnumFacing)8 BlockPos (net.minecraft.util.math.BlockPos)8 Random (java.util.Random)7 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)7