• 0

    posted a message on Metadata-directional block missing face in inventory bar
    Hey guys,

    I've got a couple of blocks I'm working on, in two seperate mods, and both are demonstrating the same thing; if, when I get the icons, I set them to a side in particular, the face shows in the inventory bar correctly.

    However, if it gets decided via metadata (like the furnace, along with other tutorials I've found online), the face is missing completely from the inventory bar. I've tried all variations I can think of, to no avail.

    Here's my code:
    @SideOnly(Side.CLIENT)
    private Icon blockFront;
    @SideOnly(Side.CLIENT)
    private Icon blockSide;
    @SideOnly(Side.CLIENT)
    private Icon blockTop;
    
    ......
    
    @SideOnly(Side.CLIENT)
    public void registerIcons(IconRegister icon) {
    this.blockFront = icon.registerIcon(Names.TextureRoot + ":front_" + (this.isActive ? "on" : "off"));
    this.blockSide = icon.registerIcon(Names.TextureRoot + ":side");
    this.blockTop = icon.registerIcon(Names.TextureRoot + ":top");
    this.blockIcon = this.blockSide;
    }
    
    @SideOnly(Side.CLIENT)
    public Icon getIcon(int side, int meta) {
    	 return side == 1 ? this.blockTop : (side == 0 ? this.blockTop : (side != meta ? this.blockIcon : this.blockFront));
    }


    I don't want to hard-code the sides in, because I want it to be directional, like most other blocks. How can I set it to show the face of my block in my inventory, without giving up the metadata? I've googled all the terms I could think of, to no avail. Thanks :)
    Posted in: Modification Development
  • 0

    posted a message on Metadata-directional block missing face in inventory bar
    Hey guys,

    I've got a couple of blocks I'm working on, in two seperate mods, and both are demonstrating the same thing; if, when I get the icons, I set them to a side in particular, the face shows in the inventory bar correctly.

    However, if it gets decided via metadata (like the furnace, along with other tutorials I've found online), the face is missing completely from the inventory bar. I've tried all variations I can think of, to no avail.

    Here's my code:
    @SideOnly(Side.CLIENT)
    private Icon blockFront;
    @SideOnly(Side.CLIENT)
    private Icon blockSide;
    @SideOnly(Side.CLIENT)
    private Icon blockTop;
    
    ......
    
    @SideOnly(Side.CLIENT)
    public void registerIcons(IconRegister icon) {
    this.blockFront = icon.registerIcon(Names.TextureRoot + ":front_" + (this.isActive ? "on" : "off"));
    this.blockSide = icon.registerIcon(Names.TextureRoot + ":side");
    this.blockTop = icon.registerIcon(Names.TextureRoot + ":top");
    this.blockIcon = this.blockSide;
    }
    
    @SideOnly(Side.CLIENT)
    public Icon getIcon(int side, int meta) {
    	 return side == 1 ? this.blockTop : (side == 0 ? this.blockTop : (side != meta ? this.blockIcon : this.blockFront));
    }


    I don't want to hard-code the sides in, because I want it to be directional, like most other blocks. How can I set it to show the face of my block in my inventory, without giving up the metadata.
    Posted in: Modification Development
  • 0

    posted a message on Food item/Potion function running twice? [FORGE]
    Hate to dredge a 6 month old topic back up, but I'm experiencing exactly the same issue. In my
    onEaten
    method, I'm finding that it's being run twice. Did you find any way to fix it, or what was causing it? I'm completely lost too!
    Posted in: Modification Development
  • To post a comment, please .