Add Profiler To isTouching
All checks were successful
EnergonRelics/pipeline/head This commit looks good
All checks were successful
EnergonRelics/pipeline/head This commit looks good
This commit is contained in:
parent
db0620b3e2
commit
5669ee35b6
@ -39,6 +39,8 @@ public abstract class MixinEntity implements PortalCooldownEntity {
|
|||||||
@Unique
|
@Unique
|
||||||
private boolean isTouching(Predicate<Block> test) {
|
private boolean isTouching(Predicate<Block> test) {
|
||||||
if (getServer() == null || getServer().getThread() == Thread.currentThread()) {
|
if (getServer() == null || getServer().getThread() == Thread.currentThread()) {
|
||||||
|
getEntityWorld().getProfiler().push("energonrelics:isTouching");
|
||||||
|
|
||||||
Box box = getBoundingBox();
|
Box box = getBoundingBox();
|
||||||
int i = MathHelper.floor(box.minX);
|
int i = MathHelper.floor(box.minX);
|
||||||
int j = MathHelper.ceil(box.maxX);
|
int j = MathHelper.ceil(box.maxX);
|
||||||
@ -52,12 +54,15 @@ public abstract class MixinEntity implements PortalCooldownEntity {
|
|||||||
for (int r = m; r < n; ++r) {
|
for (int r = m; r < n; ++r) {
|
||||||
pos.set(p, q, r);
|
pos.set(p, q, r);
|
||||||
if (test.test(getEntityWorld().getBlockState(pos).getBlock())) {
|
if (test.test(getEntityWorld().getBlockState(pos).getBlock())) {
|
||||||
|
getEntityWorld().getProfiler().pop();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getEntityWorld().getProfiler().pop();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user