Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I've been trying to make a simple ore block. I only really want to have another texture overlay the default texture of the block I provide. I.e. stone texture as the background and some partial texture as the overlay. I'm stuck at the moment though, as you can probably see in the image below. I've provided the model and blockstate json as well as the class code and texture file.

 

How can I fix it so that the overlay renders on top of the background texture?

 

  Hide contents

{
  "parent": "block/cube_all",
  "textures": {
    "background": "crycore:blocks/ores/material_stone",
    "overlay": "crycore:blocks/ores/normal/overlay_aluminum",
    "particle": "blocks/stone"
  },
  "elements": [
    {
      "from": [ 0, 0, 0 ],
      "to": [ 16, 16, 16 ],
      "faces": {
        "up": {
          "uv": [ 0, 0, 16, 16 ],
          "texture": "#background",
          "cullface": "up"
        },
        "down": {
          "uv": [ 0, 0, 16, 16 ],
          "texture": "#background",
          "cullface": "down"
        },
        "north": {
          "uv": [ 0, 0, 16, 16 ],
          "texture": "#background",
          "cullface": "north"
        },
        "south": {
          "uv": [ 0, 0, 16, 16 ],
          "texture": "#background",
          "cullface": "south"
        },
        "west": {
          "uv": [ 0, 0, 16, 16 ],
          "texture": "#background",
          "cullface": "west"
        },
        "east": {
          "uv": [ 0, 0, 16, 16 ],
          "texture": "#background",
          "cullface": "east"
        }
      }
    },
    {
      "from": [ 0, 0, 0 ],
      "to": [ 16, 16, 16 ],
      "faces": {
        "up": {
          "uv": [ 0, 0, 16, 16 ],
          "texture": "#overlay",
          "cullface": "up"
        },
        "down": {
          "uv": [ 0, 0, 16, 16 ],
          "texture": "#overlay",
          "cullface": "down"
        },
        "north": {
          "uv": [ 0, 0, 16, 16 ],
          "texture": "#overlay",
          "cullface": "north"
        },
        "south": {
          "uv": [ 0, 0, 16, 16 ],
          "texture": "#overlay",
          "cullface": "south"
        },
        "west": {
          "uv": [ 0, 0, 16, 16 ],
          "texture": "#overlay",
          "cullface": "west"
        },
        "east": {
          "uv": [ 0, 0, 16, 16 ],
          "texture": "#overlay",
          "cullface": "east"
        }
      }
    }
  ]
}

 

  Hide contents

{
  "forge_marker": 1,
  "defaults": {
    "model": "crycore:stone_ore_aluminum"
  },
  "variants": {
    "normal": [{}],
    "inventory": [{}]
  }
}

 

  Hide contents

public class StoneOreAluminum extends Block {

    public StoneOreAluminum() {
        super(Material.IRON);
        setTranslationKey(CryCore.MODID + ".stone_ore_aluminum");
        setRegistryName("stone_ore_aluminum");
        setCreativeTab(CryCore.tabCryCore);
    }

    @SideOnly(Side.CLIENT)
    public void initModel() {
        ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName(), "inventory"));
    }
}

 

 

2019-11-19_15.17.09.png

overlay_aluminum.png

Edited by GiantSafariMegladons
Problem is a fixo

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

That fixed it! Apparently I was just missing this code in my block class.

 

@Override
    public BlockRenderLayer getRenderLayer() {
        return BlockRenderLayer.CUTOUT_MIPPED;
    }

 

Makes sense in retrospect, I just didn't remember it for some (probably) inane reason. Thanks a lot for the help, I greatly appreciate it!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.