Ad Astra

Ad Astra

23M Downloads

[Bug]: Interactable blocks are unusable in no-oxygen environments when holding things that die

Linguardium opened this issue ยท 2 comments

commented

Bug Description

https://github.com/terrarium-earth/Ad-Astra/blame/9d1b4a9b81b870bd4dc3faa2e3968f040a190a62/fabric/src/main/java/earth/terrarium/adastra/fabric/AdAstraFabric.java#L37-L43

Hard failing here causes interactions with blocks to fail depending on whats in your hand. for example, opening chests no longer works.

How to Reproduce?

go to a planet without oxygen
hold plant or other things that die in non-oxygen environments
try to open chest

Expected Behavior

chest opens, but plant cannot be planted

Version

1.20.x (linked to source above)

Mod Loader Version

N/A

Mod Loader

Fabric

Logs or additional context

https://github.com/terrarium-earth/Ad-Astra/blame/9d1b4a9b81b870bd4dc3faa2e3968f040a190a62/fabric/src/main/java/earth/terrarium/adastra/fabric/AdAstraFabric.java#L37-L43

extra link just in case

Code of Conduct

  • I have searched the issue tracker and confirmed that the issue has not been reported
  • I have checked the FAQ (if one is present) and my issue is not listed
  • I have verified that I am using the latest version of the mod
  • I have verified that I have installed all the required dependencies for the mod
  • I have verified that I do not have Optifine installed. We will close issues if we detect Optifine is in your pack. We cannot fix Optifine issues. Please do not report issues with Optifine present.
commented

I am not sure how it will cause more problems than it will solve, A mixin into ItemPlacementContext to add an oxygen check for the blockstate should handle every BlockItem placed by players, by default. additionally, adding it to AutomaticItemPlacementContext covers blocks placed by dispensers as well as Spectrum block placers too.

Sure, custom mod BlockItems that bypass all of vanilla's logic and force set blockstate may still work, but I feel like that issue is significantly more niche

commented

This is because fabric does not have a block place event and trying to mixin will cause more compatibility issues than replacing this will solve, I will leave this open as a reminder to keep checking if fabric adds a block place event