Integrated Dynamics

Integrated Dynamics

88M Downloads

Agricraft seeds don't get the correct block state

Minerofmillions opened this issue ยท 6 comments

commented

Issue type:

  • ๐Ÿ› Bug

Short description:

Agricraft's seeds all place agricraft:crops but change the properties to match the seed planted. Right now, though, when viewed through the Item Block operator or exported using the World Block Exporter, it displays/exports as the default agricraft:crops block (wooden crop sticks).

Steps to reproduce the problem:

  1. Make an item variable card for Diamahlia seeds
  2. Make a card for the block of that item
  3. Make and display the properties of the resulting block

Expected behaviour:

Image
The left is blockProps(itemBlock(diamahliaSeeds)) (incorrectly showing as crop: "single_sticks"), the right is what I'd expect (blockProps(plantedDiamahliaSeeds))


Versions:

  • This mod: ID-1.20.1-1.25.2
  • Minecraft: 1.20.1
  • Mod loader version: Forge 47.3.29
  • Agricraft: 1.20.1-4.0.5

Log file:

commented

Could you clarify the problem you are experiencing with the World Block Exporter?

commented

The seeds are being consumed, but crop sticks (the default blockstate of the crop block) is being placed - effectively turning seeds into crop sticks.

commented

Thanks for reporting!

commented

From your description it sounds like Agricraft uses non-standard block placement, which our world block exporter isn't prepared for natively. Would it work correctly, if you'd setup a player simulator to right-click the seeds onto the farmland, instead of exporting the blocks directly?

commented

The Item Block operator will try to determine the default block (state) from an item.
This does not always result in the same block state when placing the block, since blocks can apply additional changes to the block state upon placement by a player.
Since these changes depend on context (the player, the world, surrounding blocks, ...), it is not possible to capture this in the Item Block operator, so that is why you are getting differences.

For the World Block Exporter issue, this could be related, but I'll need some more details to better understand this.

commented

Using the player simulator does properly place the seeds (see this discord message). I was looking into the base ID implementation but couldn't come up with a way to get the correct blockstate because of the context required.

I could take a look into tunnels to see if there's a fix that I could implement (since the context should be available at that point).