Botany Pots

Botany Pots

33M Downloads

Unable to create different custom crops with the same seedInput but different soilCategories using Crafttweaker

Sprunkegarian opened this issue ยท 1 comments

commented

I'm trying to use Botany Pots in a somewhat unintended way by using an item to act as a "crop" in them that provides different outputs based on the "soil" they're planted on. I've done this by creating two custom soils, which both work fine together, as well as two custom crops, which work fine on their own, but when they're both put into the script together only one allows me to plant it. It's also always the same one regardless of things like which is placed first in the script or which one's ID is first alphabetically. Both crops appear in JEI which leads me to believe I may be doing something wrong as opposed to what I want not being possible (although that definitely may be the case). Here is the code I'm using

val stone = soils.create("nutrient_stone", <item:minecraft:stone>, <blockstate:minecraft:stone>, 0, "ext_stone");
val organic = soils.create("nutrient_organic", <item:kubejs:organic_plank>, <blockstate:kubejs:organic_plank>, 0, "ext_organic");

val extStone = crops.create("ext_stone", <item:kubejs:material_extractor>, <blockstate:minecraft:brewing_stand>, 100, "ext_stone");
extStone.addDrop(<item:kubejs:stone_chunk>, 0.9);
extStone.addDrop(<item:kubejs:stone_chunk>, 0.5);
val extOrganic = crops.create("ext_organic", <item:kubejs:material_extractor>, <blockstate:minecraft:brewing_stand>, 100, "ext_organic");
extOrganic.addDrop(<item:kubejs:organic_chunk>, 0.9);
extOrganic.addDrop(<item:kubejs:organic_chunk>, 0.5);
extOrganic.addDrop(<item:kubejs:organic_plank>, 0.05);
commented

Hello, thanks for the issue report and sorry for taking so long to write a proper reply.

I would love for this to be possible on 1.16.5 however there are some limitations in the lookup code that limits a seed item to the first crop that matches. The soil data is not available at this step of the process so it's not possible to fix without making some API changes and potentially breaking 3rd party addons.

This issue is still present in 1.18.2+ versions of the mod, however the API is significantly more flexible and soil context is available. I have already corrected this issue on 1.19.2 and will be releasing an alpha build to CurseForge to make sure things go as expected.

If you're still interested, this is the test JSON files I used to ensure this works.

test_one.json

{
  "type": "botanypots:crop",
  "seed": {
    "item": "minecraft:stick"
  },
  "categories": [
    "water"
  ],
  "growthTicks": 1200,
  "display": {
    "block": "minecraft:stone",
    "renderFluid": false
  },
  "drops": [
    {
      "chance": 1.00,
      "output": {
        "item": "minecraft:stone"
      }
    }
  ]
}

test_two.json

{
  "type": "botanypots:crop",
  "seed": {
    "item": "minecraft:stick"
  },
  "categories": [
    "stone"
  ],
  "growthTicks": 1200,
  "display": {
    "block": "minecraft:glass",
    "renderFluid": false
  },
  "drops": [
    {
      "chance": 1.00,
      "output": {
        "item": "minecraft:glass"
      }
    }
  ]
}