Compatibility of "GTOres" and "Astrominer" from "Galacticraft 3". Need help with NBT

That’s exactly what I did :slightly_smiling_face:
OreDict allows you to not set up recipes for processing, it assigns recipes to GT.

Maybe there is a list or table where the parameters of items falling out during the extraction of small ores are indicated?
Or something else that will make it easier to set up small ores?
If I remember correctly, for example, different elements can fall out of small diamond ore …

1 Like

Yeah there is a somewhere in my Code, cant properly look it up atm, but it starts with the word “Drops” so it should be easy to find.

1 Like

I found: “gregapi.block.behaviors”.
Not what I expected, but I think even better :slightly_smiling_face:

It remains to understand how it is correct and whether I can use something like this:

Blocks_GCAOE.smallores2 = new Drops_SmallOre(MT.Diamond);

Since my knowledge of the Java language is rather poor and I am guided by IDE hints, logic, intuition and articles on the Internet, I need a lot of time to figure out how it should work.

1 Like

I think you dont wanna pass Diamond as parameter there, unless you want the background stone to be Diamond. XD

I’m trying to figure out how it works by trial and error.
It’s hard to figure out how your code works.

1 Like

I think I will already dream of small ores… I just don’t understand in which direction to move :pensive:
I would be very grateful if you tell me in which direction to move. Link to my code on GitHub if anyone wants to help:

1 Like

Look up where there is a getDrops or so Function that returns a “List” inside the of vanilla Minecraft, you will need that to drop the ItemStacks there.

1 Like

I had to postpone work…
I think I found what you were talking about:
     * This returns a complete list of items dropped from this block.
     * @param world The current world
     * @param x X Position
     * @param y Y Position
     * @param z Z Position
     * @param metadata Current metadata
     * @param fortune Breakers fortune level
     * @return A ArrayList containing all items this block drops
    public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
        ArrayList<ItemStack> ret = new ArrayList<ItemStack>();

        int count = quantityDropped(metadata, fortune, world.rand);
        for (int i = 0; i < count; i++) {
            Item item = getItemDropped(metadata, world.rand, fortune);
            if (item != null) {
                ret.add(new ItemStack(item, 1, damageDropped(metadata)));
        return ret;

Unfortunately, without examples (even approximate ones), it is still difficult for me to figure out how to apply this.

While trying to find examples with explanations or manuals))

1 Like

Correct Function, remove everything but the ArrayList<ItemStack> ret = new ArrayList<> and the return ret;

Then just call ret.add(YOUR_DROPPED_ITEMSTACKS_HERE); and it will just work. :wink:


I took a closer look at your “Drops_SmallOre” code…
I also found the standard ore drop code:
    public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
        return this == Blocks.coal_ore ? Items.coal : (this == Blocks.diamond_ore ? Items.diamond : (this == Blocks.lapis_ore ? Items.dye : (this == Blocks.emerald_ore ? Items.emerald : (this == Blocks.quartz_ore ? Items.quartz : Item.getItemFromBlock(this)))));

I also haven’t found how you’ve built in experience drops on mining (maybe I shouldn’t bother with that).
I also think the question will arise how can I assign the dropout of a certain material for each block using metadata.

P.S.: I should probably make my code more correct…

1 Like

ItemStacks, literally ItemStacks. You should use them. The original Code in vanilla is very stupid, dont try to use that garbage. Please use “getDrops” to drop your ItemStacks and NOTHING ELSE.

Also there is a function in the that returns a “Number” of Experience Orbs, which is independent of the Drops.

1 Like

Thank you!
I seem to understand how it should be.
I’m not sure yet how to properly register materials for each ore, but I hope I’ll figure it out in the process.

1 Like