Beispiel #1
0
 @Override
 public AlmostBoolean isIllegalBounds(final Player player) {
   final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
   if (entityPlayer.dead) return AlmostBoolean.NO;
   final AxisAlignedBB box = entityPlayer.boundingBox;
   if (!entityPlayer.isSleeping()) {
     // This can not really test stance but height of bounding box.
     final double dY = Math.abs(box.e - box.b);
     if (dY > 1.8) return AlmostBoolean.YES; // dY > 1.65D ||
     if (dY < 0.1D && entityPlayer.length >= 0.1) return AlmostBoolean.YES;
   }
   return AlmostBoolean.MAYBE;
 }
 /**
  * Attempt to check for some exploits (!).
  *
  * @return
  */
 public boolean isIllegal() {
   if (entityPlayer.dead) return false;
   if (!entityPlayer.isSleeping()) {
     // This can not really test stance but height of bounding box.
     final double dY = Math.abs(maxY - minY);
     if (dY > 1.8) return true; // dY > 1.65D ||
     if (dY < 0.1D) return true;
   }
   if (Math.abs(minX) > 3.2E7D
       || Math.abs(maxX) > 3.2E7D
       || Math.abs(minZ) > 3.2E7D
       || Math.abs(maxZ) > 3.2E7D) return true;
   return false;
 }