Ejemplo n.º 1
0
 public boolean isInLiquid() {
   BlockType below =
       BlockType.getById(
           world.getBlockIdAt((int) Math.floor(x), (int) Math.floor(y), (int) Math.floor(z)));
   BlockType above =
       BlockType.getById(
           world.getBlockIdAt((int) Math.floor(x), (int) Math.floor(y + 1), (int) Math.floor(z)));
   return below == BlockType.WATER
       || below == BlockType.LAVA
       || below == BlockType.STATIONARY_WATER
       || below == BlockType.STATIONARY_LAVA
       || above == BlockType.WATER
       || above == BlockType.LAVA
       || above == BlockType.STATIONARY_WATER
       || above == BlockType.STATIONARY_LAVA;
 }
Ejemplo n.º 2
0
 public boolean isOnGround() {
   int id = world.getBlockIdAt((int) Math.floor(x), (int) Math.floor(y - 1), (int) Math.floor(z));
   return y % 1 < 0.2 && BlockType.getById(id).isSolid();
 }