AllenSeitz / DimDungeons

A Minecraft mod which adds proceedurally generated dungeons.
14 stars 11 forks source link

[1.16.5] Server Crash when attempting to use an alternate portal to exit a dungeon #18

Closed NJL5390 closed 2 years ago

NJL5390 commented 3 years ago

Minecraft Version: 1.16.5 Forge Version: 36.0.9 Dimensional Dungeons version: 1.09

Hello! When testing the latest version on my modded server I noticed that when I try to leave the dungeon through a particular portal room (not the one I entered from) the server freezes then eventually crashes. This does not happen when I leave through the same portal that I entered from. This particular portal is the one I'm talking about: 2021-01-28_15 18 48 2021-01-28_15 55 19

Like I said if I leave through the entrance instead of through this portal, then everything works fine. It should also be noted that this only seems to happen on a server and not in a singleplayer world.

This is the crash report that is generated after a minute or two of the server being frozen: crash-2021-01-28_15.20.33-server.txt

Here is the latest server log if you need that as well: latest.log

Thanks!

AllenSeitz commented 3 years ago

Oh no. I might need to push a quick update. Thank you for the Waila image showing that this a LocalTeleporter and not a BlockGoldPortal. I introduced this new block to fix another bug but I seem to have introduced a new one.

AllenSeitz commented 3 years ago

I've tried to replicate this on a Forge 36.0.1 server with just DimDungeons installed on the client and the server, and I can't replicate it. Do you think Forge 36.0.9 is important?

Can you try something for me please. Walk up to the block and run the command /data get block [auto complete the coordinates]. What does that say?

NJL5390 commented 3 years ago

Is this what you asked for? 2021-01-28_19 58 21

NJL5390 commented 3 years ago

I've tried to replicate this on a Forge 36.0.1 server with just DimDungeons installed on the client and the server, and I can't replicate it. Do you think Forge 36.0.9 is important?

I'm not sure on the forge version really, I just update Forge whenever there's an update, however I'd be happy to downgrade the forge version if you think that'll help?

NJL5390 commented 3 years ago

I'm Sorry, I meant to get back to you about this issue much earlier but I've been very busy lately.

A lot of my mods as well as forge itself have had a few updates since I last tested for this issue. As a result the severity of this issue seems to have decreased substantially in that it no longer crashes the server when I try going through these local teleporter blocks, instead it takes about 5-10 seconds to teleport me and then everything is fine.

So, maybe one of the other mod updates or an update to forge fixed the issue? I'm unsure, but either way it no longer seems to be occurring (or at least nowhere near as severe as before).

I will of course let you know if it gets more severe but for now at least, it seems manageable.

The only annoying thing about it is it spams the portal teleport sound, while the server tries to teleport me. But it only lasts a few seconds.

AllenSeitz commented 3 years ago

I'm glad to hear it's working now. I'm sorry you've got such a severe lag spike though. If you can think of a potential cause, let me know.

Flameancer commented 3 years ago

I hate to to be the bearer of bad new but it appears that this is still an issue. A buddy of mine was testing out TNP Limitless 3 that has this mod. We are running the version 1.092 of this mod with forge 36.0.25 and while although we don't get a server crash, we fully exit the portal. My friend should be posting the server logs soon, but for me when it appeared that minecraft was stuck in a portal loop of me entering and exiting the portal and after a minute I was back in the portal room while my buddy had to completely restart his machine because it locked up when he tried to leave the portal.

AllenSeitz commented 3 years ago

Hm. The portal is supposed to place you one tile away from the portal on the other side. (Both directions.) That is a little bit dangerous. If the player's hitbox changes size or if any of a number of other assumptions fail, then yeah I could see you constantly triggering both portals and being stuck. I'll reimplement the portal cooldown for the next version. Do you think that would solve it?

saiyantwan commented 3 years ago

So I'm the friend mentioned by Flameancer. I attached the log. the problem starts around [10Mar2021 00:24:12.916] [Netty Epoll Server IO #18/ERROR] [net.minecraft.command.arguments.ArgumentTypes/]: Could not serialize com.ma.commands.SpellPartArgument@47f8034d (class com.ma.commands.SpellPartArgument) - will not be sent to client! latest.log

Flameancer commented 3 years ago

Hm. The portal is supposed to place you one tile away from the portal on the other side. (Both directions.) That is a little bit dangerous. If the player's hitbox changes size or if any of a number of other assumptions fail, then yeah I could see you constantly triggering both portals and being stuck. I'll reimplement the portal cooldown for the next version. Do you think that would solve it?

I am unsure. I am unfamiliar with how coding for portals work in MC. Here's a two minute clip of it's most recent behavior. I was unfortunately unable to exit this time. My game didn't crash but quitting the server and joining again produce the same issue. https://www.youtube.com/watch?v=XO19q9lcmUs

AllenSeitz commented 3 years ago

Thank you for the video! This kind of confirms it for me. So yeah, you're being teleported directly into the portal, both ways. And before you can move, the next teleport is triggered. And this forms a softlock.

In vanilla I think there is logic to avoid this from happening with the nether portal. (Even in creative mode where the cooldown is ignored.) And the End Portal 'fixes' the problem by just not having a portal anywhere close to the place where you enter the end. So even if you're silly and you put your bed directly below the end portal (heh heh I like this idea) you won't loop forever.

Still, I wish I knew why this was happening. But regardless I do need to fix it.

Flameancer commented 3 years ago

Anything that can be done to help. I have some Java experience but little Minecraft coding experience.

AllenSeitz commented 3 years ago

I just uploaded a beta of 1.093 which contains a new portal cooldown feature.

AllenSeitz commented 3 years ago

Oh I think I really fixed it now! Previously I was teleporting the player just after changing their dimension, but within the same frame. But this was done with a separate command. (A literal teleport.) Now I'm changing the player's position at the same time as I change their dimension, and just like how the vanilla portals do it with a custom Teleporter class. I'm very sure 1.093 will solve this!

NJL5390 commented 3 years ago

This issue seems to be mostly fixed for me now, the only thing that really still happens on my end is the spamming of the portal teleport sound whenever I go through a local teleporter block. If it helps at all, these entries are spammed in my server log whenever I go through these local teleporters. Screenshot 2021-03-17 19 55 55 Maybe it's just poorer performance on my end? I don't know.

AllenSeitz commented 3 years ago

I'm not sure what that log means to be honest. It would help to know from which functions the statements were being spammed from, not just the classes.

I'd show that log to the Endertech team to see what they think. DimDungeons is a fairly innocent mod. I use zero core mods, no mixins, and I use the Forge API only as intended. I don't change or override any vanilla logic. I only make content additions. (At least in 1.16.4.)