Skip to content

Commit 74191b4

Browse files
committed
Add stack trace to entity aab log
1 parent 2165fba commit 74191b4

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

common/src/main/java/dev/ryanhcode/sable/util/SubLevelInclusiveLevelEntityGetter.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ public SubLevelInclusiveLevelEntityGetter(final Level level, final LevelEntityGe
3333
this.delegate = delegate;
3434
}
3535

36+
private static void logError(final AABB aabb) {
37+
Sable.LOGGER.error("Aborting entity get for abnormally large AABB: {}", aabb, new Throwable("Stack Trace"));
38+
}
39+
3640
@Override
3741
public @Nullable T get(final int i) {
3842
return this.delegate.get(i);
@@ -56,7 +60,7 @@ public <U extends T> void get(final EntityTypeTest<T, U> entityTypeTest, final A
5660
@Override
5761
public void get(AABB aABB, final Consumer<T> consumer) {
5862
if (aABB.getSize() > MAX_GET_SIDE_LENGTH) {
59-
Sable.LOGGER.error("Aborting entity get for abnormally large AABB: {}", aABB);
63+
logError(aABB);
6064
return;
6165
}
6266

@@ -88,7 +92,7 @@ public void get(AABB aABB, final Consumer<T> consumer) {
8892
@Override
8993
public <U extends T> void get(final EntityTypeTest<T, U> entityTypeTest, AABB aABB, final AbortableIterationConsumer<U> abortableIterationConsumer) {
9094
if (aABB.getSize() > MAX_GET_SIDE_LENGTH) {
91-
Sable.LOGGER.error("Aborting entity get for abnormally large AABB: {}", aABB);
95+
logError(aABB);
9296
return;
9397
}
9498

0 commit comments

Comments
 (0)