Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean isOverLiquid()
- {
- boolean foundLiquid = false;
- boolean foundSolid = false;
- // check collision boxes below player
- for(AxisAlignedBB bb : WMinecraft.getWorld().getCollisionBoxes(
- WMinecraft.getPlayer(),
- WMinecraft.getPlayer().boundingBox.offset(0, -0.5, 0)))
- {
- BlockPos pos = new BlockPos(bb.getCenter());
- Material material = WBlock.getMaterial(pos);
- if(material == Material.WATER || material == Material.LAVA)
- foundLiquid = true;
- else if(material != Material.AIR)
- foundSolid = true;
- }
- return foundLiquid && !foundSolid;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement