Jump to content

Recommended Posts

Posted

Hi

 

I got help with making an ore that can have different density. But as it is right now they all look the same..

Spoiler

2019-07-02_21_24_35.png.193b743e7d7f3cf7c5a772377d1ba1a9.png

 

 

.. with the vanilla Stone texture and then this applied on top of it:

Spoiler

ore_3_red.png.d5f05f51ccdb8c109d7ca29211eb269b.png

 

 

ore_3.json

Spoiler

{
    "textures": {
        "base": "minecraft:block/stone",
        "ore": "intercraftcore:block/ore_faces/ore_3",
        "particle": "minecraft:block/stone"
    },
    "elements": [
        {   "from": [0,0,0],
            "to": [16,16,16],
            "faces": {
                "down": { "texture": "#base" },
                "up": { "texture": "#base" },
                "north": { "texture": "#base" },
                "south": { "texture": "#base" },
                "west": { "texture": "#base" },
                "east": { "texture": "#base" }
            }
        },
        {   "from": [0,0,0],
            "to": [16,16,16],
            "faces": {
                "down": { "texture": "#ore" },
                "up": { "texture": "#ore" },
                "north": { "texture": "#ore" },
                "south": { "texture": "#ore" },
                "west": { "texture": "#ore" },
                "east": { "texture": "#ore" }
            }
        }
    ]
}

 

 

 

 

Posted

Ok...so what's the problem?

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.

Posted

Do what, exactly?

 

You've said that you have X working and that you don't know how to do Y, but haven't said what Y is

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.

Posted
8 hours ago, Draco18s said:

Do what, exactly?

 

You've said that you have X working and that you don't know how to do Y, but haven't said what Y is

I want to colour the second texture (the metal pieces) to my desired colour and not the base Stone texture:

copper.png.04e1195f7cfa27209affef7cf881b81b.png

Posted (edited)

Here is a bit of my code I would suggest would do it but running this changes the particle's colour and not the actual block:

Spoiler

    public static void ColorBlockHandlerEvent(ColorHandlerEvent.Block blockColorEvent) {
        blockColorEvent.getBlockColors().register((a,b,c,d) -> {
            return ((BlockHardOre)a.getBlock()).getTint();
        }, IntercraftBlocks.COPPERORE);
    }

 

 

 

(Note, in my example the colour is orange, but the actual colour should be green)

copper_colour.gif

Edited by Simon_kungen
Posted

I believe you're looking for the IBlockColor interface.

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.

Posted
1 hour ago, Draco18s said:

I believe you're looking for the IBlockColor interface.

How would I use it?

Spoiler

public class BlockHardOre extends Block implements IBlockColor {

    private Item drop;
    private int tint;
  
  
    public int getColor(IBlockState p_getColor_1, IWorldReaderBase p_getColor_2, BlockPos p_getColor_3_, int p_getColor_4_) {
        return this.tint;
    }
}

 

 

 

This doesn't do anything. Do I have to register it somewhere?

Posted
18 minutes ago, Simon_kungen said:

How would I use it?

  Reveal hidden contents


public class BlockHardOre extends Block implements IBlockColor {

    private Item drop;
    private int tint;
  
  
    public int getColor(IBlockState p_getColor_1, IWorldReaderBase p_getColor_2, BlockPos p_getColor_3_, int p_getColor_4_) {
        return this.tint;
    }
}

 

 

 

This doesn't do anything. Do I have to register it somewhere?

Nevermind, I figured it out. Had to add the tintindex to my model file:

"down": { "tintindex": 1, "texture": "#ore" },
"up": { "tintindex": 1, "texture": "#ore" },
"north": { "tintindex": 1, "texture": "#ore" },
"south": { "tintindex": 1, "texture": "#ore" },
"west": { "tintindex": 1, "texture": "#ore" },
"east": { "tintindex": 1, "texture": "#ore" }

 

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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