Botania

Botania

133M Downloads

[1.16.5] Orechid recipe system can only add, not change or remove

NielsPilgaard opened this issue · 11 comments

commented

Forge version: 1.16.5-36.1.4
Botania version: 1.16.5-415

Further Information

Link to crash log: (please use a paste site such as gist, do not attach the .txt or paste the log inline)
Steps to reproduce:

  1. Add a datapack with a botania:orechid_ore_weights/orechid.json file setting orechid recipes to something else.
  2. Observe that it does not remove old values

What I expected to happen:
Orechid recipe system to allow removing existing values by not including them in new file

What happened instead:
Old values persist

commented

Crafttweaker bindings have removal, I'll add json soon.

commented

Thanks!

commented

Could you explain how to use Crafttweaker to remove ores? I was looking at it's wiki and the information there seems to be outdated when applied to 1.16.4. I still tried it even though they were talking about ore dictionary rather than tags but it returned an error.

I'd really like to make sure the orechid isn't going to generate prosperity ore from mystical agriculture but opening up the mod jar with 7zip I didn't even see the botania:orechid_ore_weights/orechid.json file you are talking about. I still don't see it even though I know it has to be there. lol

commented

Everything is in this class, I will write some docs for CT soonish.

The gist of it:

var orechid = mods.botania.Orechid.main;
var nether = mods.botania.Orechid.nether; // this one for the Orechid Ignem

orechid.clear(); // clears the list
orechid.removeOreWeight(<blockstate:minecraft:diamond_ore>);
orechid.registerOreWeight(<tag:blocks:minecraft:stone_bricks>, 250);
orechid.registerOreWeight(<block:minecraft:dirt>, 250);
orechid.registerOreWeight(<blockstate:minecraft:red_sand>, 250);

There are some improvements to add (like a dump of all the values), but this is the basics.

The weight files are in here: resources/data/botania/orechid_ore_weights. They work similarly to vanilla sounds.json (namespace doesn't matter, just the location). Also needs some improvements like removal :P

commented

Thanks I'll fiddle with this and see if I can get it to work, and I'm going to look forward to that documentation.

commented

Mt Hand gave me the block state, and I kept the dirt and red sand for fun but . . . Nope. This is what I got.

nope

That's with Botania 1.16.4-414. Perhaps I have to import the function? If so I need to find the name . . .

commented

Post your script and exact versions. (Also if you wouldn't mind, let's continue this on Vazkii's discord because I kinda don't want to flood this place with support)

commented

Good idea. I'll head over there now. I'm put this into "help" under modding since that looks like the most appropriate spot but if not let me know. lol

commented

@NillerMedDild Finally got around to this. The Javadoc comment should give you an idea of how it will work once we release the build, and here is a sample, which removes the default coal ore and adds some redunant gold ore spawns (though I imagine you will "replace": true instead).

{
  "replace": false,
  "remove": [
    {
      "type": "block",
      "block": "minecraft:coal_ore"
    }
  ],
  "values": [
    {
      "type": "block",
      "block": "minecraft:gold_ore",
      "weight": 50000
    }
  ]
}
commented

Perfect, just what we need :D thanks!

commented

Worked like a charm through a datapack, but KubeJS still can't change it for some reason, no big deal though. Thanks again!