TerraFirmaCraft

TerraFirmaCraft

2M Downloads

Configurable custom rock type collapse-ability. (Cave-ins)

UnlimatedStone9 opened this issue ยท 1 comments

commented

Describe the request
Make sure to include:

  1. What problem or issue would this enhancement solve?
    Custom mod integration for configuring what blocks get treated by TFC's cave in mechanics and what rock they crumble into. (i.e TFC raw basalt can break into TFC basalt cobblestone)
  2. Describe the feature itself - what would change, what would happen. In general more detail is good!
    You would be able to configure a block and what block it can collapse into so that when a player is mining said block they need to use supports to prevent cave-ins, I could for example configure Betweenlands Cragrock to collapse into cobblestone when unsupported while mining.

Meta Info

  • TFC Version: 1.12.2-0.27.3.103 (at time of request)
  • Is this a compatibility feature for other mods? Or a enhancement for TFC alone?
    Likely both, allows mod integration or allowing vanilla blocks to collapse in cave-ins.
commented

I've done some investigation into this, in the context of 1.15, because this is a really nuanced issue with a lot of things here:

  1. The ability to trigger a collapse:
    • Player mined blocks have quite well defined triggers for making this happen. This is within the realm of possibility, although it does mean moving block-specific behavior to an event handler (a performance cost, but one I'm willing to take).
    • Explosions (see #892) do not have any such event handlers. They do have specific block methods, (and so the linked issue is well within our capability to be fixed), but this is functionally impossible to do with arbitrary blocks.
    • Chiseling is completely possible as it's handled by our own logic. This is not a problem either way.
  2. The ability to start a collapse:
    • This can almost certainly be handled by something as simple as a tag since it's already within our code paths.
  3. The ability to fall, and what block it should fall as:
    • The ability to fall can also be quite easily be handled by a tag, for the same reason as above, however this method does not handle transformation of blocks.
    • We potentially could use loot tables for this, but that would be doing some really hacky shit with how loot tables are expected to work.
    • The standard (and work-heavy) method for doing this would be creating a custom recipe class, json recipe definition, etc.
  4. And in a related issues, this is also a good time to look at the ability to fall sideways:
    • There is actually something there exists an event for, in some cases. However, it's not as consistent as the current mechanics and as with 1), it's a potential performance downside.

For further reference this will be recorded here.