PneumaticCraft: Repressurized

PneumaticCraft: Repressurized

50M Downloads

Drone teleportation accepts invalid world coordinates while carrying player

aevns opened this issue ยท 2 comments

commented

Describe the bug

Programmable drones can be used to teleport themselves and entities they carry to arbitrary world coordinates, including coordinates beyond the world boundary. Attempting to do so while a drone is carrying a player can lead to unexpected behavior, and possibly crashes.

How to reproduce the bug

While in the overworld, create a drone which imports a @player entity, then teleports to position 32000000, 200, 32000000.

Expected behavior

As is always the case when a drone teleports vast distances, the game will hang for a number of seconds. In single-player instances, the drone will teleport and the player will be left behind, with the chunk seemingly unloaded, sending them plummeting into the void. Attempting this on a multiplayer server led to a server crash, though I have not attempted to reproduce this crash.

Additional details

The way drone teleportation to unloaded chunks is handled seems problematic. The ability to teleport millions of blocks is a bit questionable, but the main issue is that the game hangs for all players in the process (unlike, for example, teleporting to new chunks via nether portal), and edge cases lead to strange behavior.

Which Minecraft version are you using?

1.19

Which version of PneumaticCraft: Repressurized are you using?

1.19.2-4.2.0-16

Crash log

No response

commented

Just to note that drone max teleport range is already a server-configurable - see max_drone_teleport_range. So you can limit that on your server.

I think the issue is ungenerated rather than unloaded chunks. Although I don't believe it's possible to query an arbitrary chunk to distinguish "not loaded" vs. "not generated yet". I can add another config setting to disallow drones teleporting into unloaded chunks, probably true by default.

commented

Fixed in latest 1.18/1.19 releases