1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-01-09 08:50:29 +00:00

Log current block entity in TickScheduler

This check should be impossible (the BE has not been removed, but is no
longer present in the world), but we've had one instance where it has
happened (#1925). I don't have a good solution here, so at least let's
print both BEs for now.
This commit is contained in:
Jonathan Coates 2024-08-11 12:03:48 +01:00
parent 216f0adb3c
commit bfb28b4710
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06

View File

@ -109,8 +109,9 @@ public final class TickScheduler {
return State.UNLOADED;
} else {
// This should be impossible: either the block entity is at the above position, or it has been removed.
if (level.getBlockEntity(pos) != blockEntity) {
throw new IllegalStateException("Expected " + blockEntity + " at " + pos);
var currentBlockEntity = level.getBlockEntity(pos);
if (currentBlockEntity != blockEntity) {
throw new IllegalStateException("Expected " + blockEntity + " at " + pos + ", got " + currentBlockEntity);
}
// Otherwise schedule a tick and remove it from the queue.