Lythom / capsule

A minecraft mod : Bring your base! Capsules can capture a region containing any blocks or machines, then deploy and undeploy at will. Inspired by Dragon Ball capsules.
MIT License
16 stars 13 forks source link

Server Recoverable Crash #23

Closed Rsslone closed 4 years ago

Rsslone commented 4 years ago

The mod reports a crash and when I redeploy the capsule the door does not get placed down, instead its on the ground. Don't know if they are related. (the door issue was from a built in starter capsule)

https://gist.github.com/Rsslone/9f2058d44ae680ec6ed5452c0cbf6249

Lythom commented 4 years ago

Thanks for reporting! Capsule is telling you that one of the blocks could not be captured because of a crash. The expected behaviour is that the "crashing" block remains in place and the rest of the structure is in captured. So when undeploying it's expected the crashing block is no longer part of the structure.

Can this expection be reproduced in a specific modpack I could run to experience it myself ? If yes, where can I download this pack ?

Is the starter capsule one of the default provided with the mod or is there a specific configuration with alternative starters ?

Rsslone commented 4 years ago

The capsule is from the vanilla mod, nothing has been changed. The door does not get placed back down correctly so I am guessing this could be Malisis Doors.

Here is my pack. https://www.technicpack.net/modpack/tommytek-1122.1228216

Lythom commented 4 years ago

Capsule only comes with vanilla blocks (and Immersive engineering blueprints if present in the pack) so this is a standard door. In the stack I see "spongepowered" lines which puzzles me because

Are you running the pack on a sponge server ? Do you know how sponge and forge interacts ?

If using SpongeForge (https://github.com/SpongePowered/SpongeForge) it's currently specified the mod is currently in development and unstable, so I would recommand against using it until it has reached some stable state.

Rsslone commented 4 years ago

The pack does not come with it, but the pack is designed for a particular server in mind and the server runs sponge. I'm not a developer so take this with a grain of salt but I believe Spongeforge hooks into forge in order to do its optimizations, there is rarely ever a mod issue but i've run into it once or twice in the past. If you believe this to be a Sponge related problem I can report the bug to them.

Lythom commented 4 years ago

Thanks for the details. I might not be able to fix the issue from the capsule side directly (not sure), but i'll give you some insight to help everyone understand what's going on and give the Spongeforge dev enough information so they can fix. They might also evaluate the issue as being a misuse of the Forge event system (but in this cas I'll need an example of correct use so that I can fix).

How capsule work :
When removing or placing a block, capsule force the trigger of a BlockEvent.PlaceEvent to forge, to simulate the player placing a dirt block with main hand.

What I understand from reading the crash log :

  1. When recalling the capsule, the PlaceEventis triggered for each block to check if the player is allowed to recall the block. This event is captured by spongforge, I can't tell if the event is modified or altered by spongeforge.
  2. spongeforge uses in the process the snapshotFor method of avanilla minecraft BlockStateContainer class, which triggers the IllegalStateException for reason I can't tell from the log.

Also, I'd like to point your attention to the fact that I don't have any vanilla mincraft BlockStateContainer.snapshotFor in the version of minecraft I'm developping capsule for (1.12.2). This indicates you might be trying to run capsule on another version of minecraft OR the minecraft vanilla class or modified by sponge or forge, which likely can't work. Can you confirm the version of minecraft and the version forge that are running on the server ?

Rsslone commented 4 years ago

Thanks for the detailed explanation, I'll link this ticket to SpongeForge and see if anything can be seen wrong. The versions are forge-1.12.2-14.23.5.2847-universal and spongeforge-1.12.2-2838-7.1.7.jar so yeah this might be sponge.

Rsslone commented 4 years ago

Additional information from this issue. I've come to the conclusion this has something to do with the door, and probably from Malisis Doors. I've deployed a fresh capsule that works fine, but if I seal it up, it errors. My theory is whatever NBT that is being attached to the door is causing a issue. Here is the NBT tags that are being saved.

.withTag({item: 430, redstoneBehavior: 0, proximityDetection: 0 as byte, sound: "vanilla_door", openingTime: 6, autoCloseTime: 0, block: 196, doubleDoor: 1 as byte, movement: "rotating_door"}) Again since the door deploys correct the first time a fresh capsule is used, and if I seal it without a door inside it, everything is fine. As soon as I place the door that fell on the ground back inside, it throws the error. By placing a Rusic door down in place, everything works fine also. The Rustic door is untouched by Malisis Doors. I'm pretty confident this is Malisis doors and not at all related to sponge.
Lythom commented 4 years ago

The nbt tells this is a vanilla door (id minecraft:acacia_door). Also Malisis doors mod does not appear in the crash log. You might want to try replacing the door by another vanilla door to convince yourself.

The forge version is a bit more recent that the one capsule is built against but it should not be a problem, I'll try to update forge version the ensure that.

Rsslone commented 4 years ago

My apologies, everything works fine in single player (Without spongeforge), its only on the server that's running sponge.

I'll have to wait for sponge to reply or find a workaround. Thanks for the help, great mod dragon ball themed mod!