Add Profiler To isTouching
EnergonRelics/pipeline/head This commit looks good Details

This commit is contained in:
TheBrokenRail 2020-08-06 22:29:44 -04:00
parent db0620b3e2
commit 5669ee35b6
1 changed files with 5 additions and 0 deletions

View File

@ -39,6 +39,8 @@ public abstract class MixinEntity implements PortalCooldownEntity {
@Unique
private boolean isTouching(Predicate<Block> test) {
if (getServer() == null || getServer().getThread() == Thread.currentThread()) {
getEntityWorld().getProfiler().push("energonrelics:isTouching");
Box box = getBoundingBox();
int i = MathHelper.floor(box.minX);
int j = MathHelper.ceil(box.maxX);
@ -52,12 +54,15 @@ public abstract class MixinEntity implements PortalCooldownEntity {
for (int r = m; r < n; ++r) {
pos.set(p, q, r);
if (test.test(getEntityWorld().getBlockState(pos).getBlock())) {
getEntityWorld().getProfiler().pop();
return true;
}
}
}
}
}
getEntityWorld().getProfiler().pop();
return false;
}