Grief Prevention

Grief Prevention

1M Downloads

Server crash when TnT goes through end portal

GregorSomething opened this issue ยท 10 comments

commented

Observed Behavior

When primed TNT goes through end portal server crashed.

Expected Behavior

It shouldn't crash.

Reproduction steps

  1. Create end portal
  2. Send a primed TNT through it.
  3. Server crashed.

Stack trace or error log

Description: Exception in server tick loop

java.lang.IllegalStateException: Ticking retired scheduler
	at io.papermc.paper.threadedregions.EntityScheduler.executeTick(EntityScheduler.java:147)
	at net.minecraft.server.MinecraftServer.lambda$tickChildren$14(MinecraftServer.java:1491)
	at java.base/java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:655)
	at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1092)
	at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1484)
	at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:447)
	at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1394)
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1171)
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318)
	at java.base/java.lang.Thread.run(Thread.java:1589)

Server version

This server is running Paper version git-Paper-100 (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT) (Git: f402f89)

GriefPrevention version

GriefPrevention version 16.18.1-7-g64b348a

Configuration

Default config

Plugin list

[10:28:14 INFO]: Server Plugins (1):
[10:28:14 INFO]: Bukkit Plugins:
[10:28:14 INFO]:  - GriefPrevention

Running without GriefPrevention

  • I attempted running the server without GriefPrevention installed.
  • The problem does not occur when GriefPrevention is removed from the server.

Running with only GriefPrevention

  • I attempted running only GriefPrevention on the server.
  • The issue still occurs when GriefPrevention is the only plugin running.

Running on a fresh, clean server installation

  • I attempted testing for the issue on a new server.
  • The issue still occurs on a new server.

Using unmodified client

  • I attempted testing for the issue with the vanilla client.
  • The issue still occurs when using the vanilla client.

We appreciate you taking the time to fill out a bug report!

  • I searched for similar issues before submitting this bug report.
commented

Tested it in Spigot server and server did not crash.

commented

Honestly, sounds like something you should report to Paper. GP could probably do better here (i.e. what if instead of allowing the TNT to teleport, then removing it, we just removed it before it teleported?) but the code itself is pretty innocuous.

https://github.com/TechFortress/GriefPrevention/blob/76a53576ddd98985897198056f6a28d81c9fb21a/src/main/java/me/ryanhamshire/GriefPrevention/EntityEventHandler.java#L338-L345

My best guess is that Paper is still trying to tick their new Folia-esque scheduler on dead entities, possibly because they aren't expecting the entity to be dead at this point in the tick. I know end portals are handled mid-entity-tick.

commented

Linking the issue on Paper:
PaperMC/Paper#9551

commented

Honestly, sounds like something you should report to Paper. GP could probably do better here (i.e. what if instead of allowing the TNT to teleport, then removing it, we just removed it before it teleported?) but the code itself is pretty innocuous.

https://github.com/TechFortress/GriefPrevention/blob/76a53576ddd98985897198056f6a28d81c9fb21a/src/main/java/me/ryanhamshire/GriefPrevention/EntityEventHandler.java#L338-L345

My best guess is that Paper is still trying to tick their new Folia-esque scheduler on dead entities, possibly because they aren't expecting the entity to be dead at this point in the tick. I know end portals are handled mid-entity-tick.

Can confirm that removing the entity on the EntityPortalEnterEvent does not crash the server in Paper.

commented

I'm pretty sure that calling remove in the exit event puts the entity into a half baked, bad state, only that on Paper it'll actually throw an exception. I would suggest cancelling the enter event and removing the entity

Paper has pushed a patch anyways, so this should no longer happen, but will still result in the bad state on Spigot

commented

@GregorSomething btw, I'm curious - is there a use case on your server for dropping tnt through an end portal? Or was this discovered as the result of someone trying to cause grief?

commented

They were trying to see if they can kill players who entered the end.

commented

Hmm ok. I'm curious on your thoughts on this. Should this be blocked (justification likely being "spawn" grief for the end dimension), or should this be allowed (justification being legitimate pvp tactic)?

commented

You can send zombies and stuff like that, tnt would not be so different.
Also Paper fixed the crash issue.

commented

I agree with Gregor, you can send every other entity, even creepers for that matter so I don't see why TNT should be cancelled.