MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / isOnLiquid

Method isOnLiquid

src/main/java/cc/slack/utils/player/PlayerUtil.java:127–145  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

125 }
126
127 public static boolean isOnLiquid() {
128 boolean onLiquid = false;
129 AxisAlignedBB playerBB = mc.thePlayer.getEntityBoundingBox();
130 double y = (int) playerBB.offset(0.0, -0.01, 0.0).minY;
131
132 for (double x = MathHelper.floor_double(playerBB.minX); x < MathHelper.floor_double(playerBB.maxX) + 1; ++x) {
133 for (double z = MathHelper.floor_double(playerBB.minZ); z < MathHelper.floor_double(playerBB.maxZ) + 1; ++z) {
134 final Block block = mc.theWorld.getBlockState(new BlockPos(x, y, z)).getBlock();
135
136 if (block != null && !(block instanceof BlockAir)) {
137 if (!(block instanceof BlockLiquid)) return false;
138
139 onLiquid = true;
140 }
141 }
142 }
143
144 return onLiquid;
145 }
146
147 public static boolean isOverVoid(double x, double y, double z) {
148 for (double posY = y; posY > 0.0; posY--) {

Callers

nothing calls this directly

Calls 5

offsetMethod · 0.95
floor_doubleMethod · 0.95
getEntityBoundingBoxMethod · 0.80
getBlockMethod · 0.65
getBlockStateMethod · 0.65

Tested by

no test coverage detected