Immersive Weathering [FORGE]

Immersive Weathering [FORGE]

6M Downloads

[Forge 1.19.2] "Snow Off"/"Sand Off" Advancements not working

Lurrae opened this issue ยท 0 comments

commented

Describe the bug:
When applying snow or sand to a block, such as Cobblestone, the "Snow On" and "Sand On" advancements are granted as expected. However, using a shovel to remove the snow/sand layer from that same Cobblestone block does not grant "Snow Off" or "Sand Off". However, Sand Off is granted if a shovel is used on a Sandy Cobblestone block with two layers of sand on it.

Versions:
Minecraft version: 1.19.2
Immersive Weathering version: 1.2.9
Moonlight Lib version: 2.2.40
Forge version: 43.2.10

Other mods:
None, just IW and Moonlight Lib

To Reproduce:

  1. Use a Snowball on a Cobblestone block and observe that the "Snow On" advancement is granted.
  2. Use a shovel on the Snowy Cobblestone block, and observe that "Snow Off" is not granted as it should be.
  3. Use a singular Sand Pile on a Cobblestone block. "Sand On" is granted.
  4. Use a shovel on the single-layer Sandy Cobblestone block. "Sand Off" is not granted.
  5. Use two Sand Piles on the Cobblestone block, then use a shovel on the Sandy Cobblestone block. Because the block had two layers of sand, the advancement is granted.

Expected behavior:
I would expect "Snow Off" and "Sand Off" to both be granted when removing their respective materials from a block, regardless of the amount of sand on the block in the latter case.

Additional info:
I played around with a datapack to see if I could get either advancement to work, and I believe I may know the underlying cause. Currently, "Snow Off" checks for "tag": "immersive_weathering:snowy" and "Sand Off" checks for "tag": "immersive_weathering:sandy". To test what would happen, I set them to check for "tag": "immersive_weathering:snowable" and "tag": "immersive_weathering:sandable", respectively. This almost worked, but it led to removing snow or sand triggering both advancements at once, which obviously isn't ideal, but I couldn't figure out anything that made both advancements work without also causing false positives. I believe what's happening is that there is some sort of issue with the order of operations:

  1. The first action in a given tick is to register that the player used a shovel on the Snowy/Sandy Cobblestone block
  2. Next, the game determines what to do with that block- in this case, strip it of one layer of snow/sand.
  3. NOW the advancement checks for its block tag. Because this happens after a layer is stripped, the game sees either a Cobblestone block or a Sandy Cobblestone block with one layer of sand. This is why "Sand Off" is granted only on two layers of sand; the first layer is stripped, but since there's still a layer left the block is still in the "immersive_weathering:sandy" tag, so the advancement goes through.

Because I'm entirely unfamiliar with Minecraft mod development (I only know how to make datapacks at the moment), I have no idea how possible it would be to even modify the order of operations here, assuming that's even actually what's causing the problem here. I hope my datapack testing at least makes this bug easier to squash!