desht / ModularRouters

A Forge Mod for item routers with pluggable modules
16 stars 20 forks source link

activating dank storage dock causes crash #107

Closed boneskull closed 3 years ago

boneskull commented 3 years ago

Minecraft Version

1.16.4

Forge Version

35.1.13

Mod Version

7.2.0-39

Describe your problem, including steps to reproduce it

  1. Create a dank storage dock and a dank storage container (I used "Dank 7")
  2. Place the dock
  3. Insert the dank container into the dock
  4. Create a router and place it adjacent to the dock
  5. Create an Activator module, insert into router
  6. Configure module to sneak and activate block in the direction of the dock
  7. The storage container is dropped, but then...
  8. Crash

Any other comments?

When placed into a dock, the dock becomes an inventory--but it's not an inventory (afaict) until it contains a dank storage container. Activating it with empty hands (sneak-right-click) removes the container, but maybe this breaks some assumptions about how such a block should behave.

FWIW, using a router + Activator module to place the container into the dock (activate block, no sneak) doesn't seem to cause any immediate issues.

I have one router on either side of the dock; I wanted to automate placing the container in the dock and removing it again.

Unclear if this is a dank storage issue or a modular router issue.

https://gist.github.com/boneskull/b12bb158765d6c739304b23c00207863

boneskull commented 3 years ago

hmm, it seems to crash my save on load now, too. ugh

desht commented 3 years ago

Looks very much like a bug in Dank Storage to me. Don't think I can do much about this, sorry...

desht commented 3 years ago

Looking at Dank Storage's code, these lines here may well be related: https://github.com/Tfarcenim/Dank-Storage/blob/1.16.x/src/main/java/tfar/dankstorage/block/DockBlock.java#L97-L100

The code directly above verifies that the tier is > 0 before trying to remove the tank. But the highlighted code doesn't, and that would cause exactly the reported crash (router's fake player is trying to sneak-right-click with an empty hand). I'd suggest reporting this to the Dank Storage author.

Update: tested myself with the Dock, confirmed it happens with the router & activator module, but not when I sneak-right-click the empty dock myself. I'm not sure why the discrepancy is, but I would still contact the Dank Storage author re: the highlighted code above.

Update 2: Hah, never mind. Looking at my server log, it's definitely throwing an error when I sneak-right click as a player; just that the error doesn't kill the server when thrown by a player. So Dank needs to fix this, but I'm going to add some code to Modular Routers too to catch such crashes (and not attempt to click the same block again before the next server restart).

desht commented 3 years ago

Build 46 from https://jenkins.k-4u.nl/job/Modular%20Routers%201.14+/ should get you going again (though it won't activate the dock block until it's fixed in Dank Storage).

You might also notice some quite different textures for Modular Routers, so don't be too surprised at that. These will be in the imminent 7.3.0 release. (16x16 textures done by someone with some texturing skills, i.e. not me :D )

desht commented 3 years ago

Fixed in 7.3.0 release