Spectrum

Spectrum

2M Downloads

[BUG] Custome craft with kubejs, world conditions

Kisuny opened this issue · 5 comments

commented

Describe the bug
When trying to craft in the nether with the nether condition, item is not crafted

To Reproduce
Make fusion shrine and place items for craft with custome scripts.

Expected behavior
Crafting an item in the nether

Mod version
spectrum-1.7.3-deeper-down (mc 1.19.2)

video
https://youtu.be/A0F3jc3kqUs

Script kubejs
function for make json:

const customeFusionShrineCraft = (event, args) => {
  event.custom({
    "type": "spectrum:fusion_shrine",
    "time": args.time,
    "experience": args.experience,
    "fluid": args.fluid,
    "ingredients": args.ingredients,
    "result": args.result,
    "required_advancement": args.advancement,
    "world_conditions": args.worldConditions || [],
    "start_crafting_effect": args.startEffect || "nothing",
    "during_crafting_effects": args.duringEffect || [],
    "finish_crafting_effect": args.finishEffect || "single_visual_explosion_on_shrine",
    "description": args.description
  });
};

Make craft with function:

ServerEvents.recipes(event => {
customeFusionShrineCraft(event, {
        time: 600, experience: 2.0,
        fluid: "modern_industrialization:liquid_mana",
        ingredients: [
            { "item": "artifacts:obsidian_skull", "count": 1 },
            { "item": "spectrum:fiery_powder", "count": 4 },
            { "item": "botania:mana_string", "count": 4 },
            { "item": "botania:rune_summer", "count": 1 },
            { "item": "botania:rune_fire", "count": 1 },
        ],
        worldConditions: [
            {
              "type": "dimension",
              "worlds": ["minecraft:the_nether"]
            }
          ],
        startEffect: "weather_thunder_short",
        result: { "item": "botania:lava_pendant" },
        advancement: "spectrum:midgame/build_spirit_instiller_structure",
        description: "Тест попы"
    });
}

When commented worldConditions items anyway dropped around of fusion shrine

commented

Interesting find!
The Fusion Shrine does not recognise the end as having clear view to the sky, since it does not have any skylight. That definitely needs an improvement

commented

I changed the Fusion Shrine to use the same logic Beacons do to recognise clear sky. That will make them work in the End dimensions (and other dimensions with no natural skylight)

commented

are there any blocks above the shrine?

commented

are there any blocks above the shrine?

Yes, this is nether :D

BTW in the end same problem

commented

crafting via a datapack also doesn't work in other dimension

Info for craft from wiki

Example for test:

{
    "type": "spectrum:fusion_shrine",
    "time": 480,
    "experience": 2.0,
    "fluid": "minecraft:lava",
    "ingredients": [
      {
        "item": "spectrum:topaz_shard"
      },
      {
        "item": "minecraft:amethyst_shard"
      },
      {
        "item": "spectrum:citrine_shard"
      }
    ],
    "world_conditions": [
      {
        "type": "dimension",
        "worlds": ["minecraft:the_end"]
      }
    ],
    "result": {
      "item": "spectrum:guidebook"
    }
  }