Examples of AxisAlignedBB


Examples of net.minecraft.server.AxisAlignedBB

    }

    // Handle block collisions
    BlockFace hitFace;
    Iterator<AxisAlignedBB> iter = collisionBuffer.iterator();
    AxisAlignedBB blockBounds;
    double dx, dz;
    while (iter.hasNext()) {
      blockBounds = iter.next();
      // Convert to block and block coordinates
      org.bukkit.block.Block block = entity.getWorld().getBlockAt(MathUtil.floor(blockBounds.a), MathUtil.floor(blockBounds.b), MathUtil.floor(blockBounds.c));

      // Find out what direction the block is hit
      if (bounds.e > blockBounds.e) {
        hitFace = BlockFace.UP;
      } else if (bounds.b < blockBounds.b) {
        hitFace = BlockFace.DOWN;
      } else {
        dx = entity.loc.getX() - block.getX() - 0.5;
        dz = entity.loc.getZ() - block.getZ() - 0.5;
        hitFace = FaceUtil.getDirection(dx, dz, false);
      }
      // Block collision event
      if (!controller.onBlockCollision(block, hitFace)) {
        iter.remove();
      }
    }

    // Handle and add entities
    AxisAlignedBB entityBounds;
    for (Entity collider : CommonNMS.getEntitiesIn(handle.world, handle, bounds.grow(0.25, 0.25, 0.25))) {
      /*
       * This part is completely pointless as E() always returns null May
       * this ever change, make sure E() is handled correctly.
       *
       * entityBounds = entity.E(); if (entityBounds != null &&
       * entityBounds.a(bounds)) { collisionBuffer.add(entityBounds); }
       */

      entityBounds = collider.boundingBox;
      // Entity collision event after the null/inBounds check
      if (entityBounds != null && entityBounds.b(bounds) && controller.onEntityCollision(Conversion.toEntity.convert(collider))) {
        collisionBuffer.add(entityBounds);
      }
    }

    // Done
View Full Code Here

Examples of net.minecraft.server.v1_4_5.AxisAlignedBB

    try{
      // TODO: Probably check other ids too before doing this ?
     
      final net.minecraft.server.v1_4_5.Entity mcEntity  = ((CraftEntity) entity).getHandle();
     
      final AxisAlignedBB box = useBox.b(minX, minY, minZ, maxX, maxY, maxZ);
      @SuppressWarnings("rawtypes")
      final List list = world.getEntities(mcEntity, box);
      @SuppressWarnings("rawtypes")
      Iterator iterator = list.iterator();
      while (iterator.hasNext()) {
        final net.minecraft.server.v1_4_5.Entity other = (net.minecraft.server.v1_4_5.Entity) iterator.next();
        final EntityType type = other.getBukkitEntity().getType();
        if (type != EntityType.BOAT && type != EntityType.MINECART) continue;
        final AxisAlignedBB otherBox = other.boundingBox;
        if (box.a > otherBox.d || box.d < otherBox.a || box.b > otherBox.e || box.e < otherBox.b || box.c > otherBox.f || box.f < otherBox.c) continue;
        else {
          return true;
        }
      }
View Full Code Here

Examples of net.minecraft.server.v1_4_5.AxisAlignedBB

  @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;
View Full Code Here

Examples of net.minecraft.server.v1_4_6.AxisAlignedBB

    try{
      // TODO: Probably check other ids too before doing this ?
     
      final net.minecraft.server.v1_4_6.Entity mcEntity  = ((CraftEntity) entity).getHandle();
     
      final AxisAlignedBB box = useBox.b(minX, minY, minZ, maxX, maxY, maxZ);
      @SuppressWarnings("rawtypes")
      final List list = world.getEntities(mcEntity, box);
      @SuppressWarnings("rawtypes")
      Iterator iterator = list.iterator();
      while (iterator.hasNext()) {
        final net.minecraft.server.v1_4_6.Entity other = (net.minecraft.server.v1_4_6.Entity) iterator.next();
        final EntityType type = other.getBukkitEntity().getType();
        if (type != EntityType.BOAT && type != EntityType.MINECART) continue;
        final AxisAlignedBB otherBox = other.boundingBox;
        if (box.a > otherBox.d || box.d < otherBox.a || box.b > otherBox.e || box.e < otherBox.b || box.c > otherBox.f || box.f < otherBox.c) continue;
        else {
          return true;
        }
      }
View Full Code Here

Examples of net.minecraft.server.v1_4_6.AxisAlignedBB

  @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;
View Full Code Here

Examples of net.minecraft.server.v1_4_R1.AxisAlignedBB

    try{
      // TODO: Probably check other ids too before doing this ?
     
      final net.minecraft.server.v1_4_R1.Entity mcEntity  = ((CraftEntity) entity).getHandle();
     
      final AxisAlignedBB box = useBox.b(minX, minY, minZ, maxX, maxY, maxZ);
      @SuppressWarnings("rawtypes")
      final List list = world.getEntities(mcEntity, box);
      @SuppressWarnings("rawtypes")
      Iterator iterator = list.iterator();
      while (iterator.hasNext()) {
        final net.minecraft.server.v1_4_R1.Entity other = (net.minecraft.server.v1_4_R1.Entity) iterator.next();
        if (!(other instanceof EntityBoat)){ // && !(other instanceof EntityMinecart)) continue;
          continue;
        }
        final AxisAlignedBB otherBox = other.boundingBox;
        if (box.a > otherBox.d || box.d < otherBox.a || box.b > otherBox.e || box.e < otherBox.b || box.c > otherBox.f || box.f < otherBox.c) continue;
        else {
          return true;
        }
      }
View Full Code Here

Examples of net.minecraft.server.v1_4_R1.AxisAlignedBB

  @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;
View Full Code Here

Examples of net.minecraft.server.v1_5_R1.AxisAlignedBB

  @Override
  public AlmostBoolean isIllegalBounds(final Player player) {
    final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
    if (entityPlayer.dead) return AlmostBoolean.NO;
    // TODO: Does this need a method call for the "real" box? Might be no problem during moving events, though.
    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;
View Full Code Here

Examples of net.minecraft.server.v1_5_R1.AxisAlignedBB

    try{
      // TODO: Probably check other ids too before doing this ?
     
      final net.minecraft.server.v1_5_R1.Entity mcEntity  = ((CraftEntity) entity).getHandle();
     
      final AxisAlignedBB box = useBox.b(minX, minY, minZ, maxX, maxY, maxZ);
      @SuppressWarnings("rawtypes")
      final List list = world.getEntities(mcEntity, box);
      @SuppressWarnings("rawtypes")
      final Iterator iterator = list.iterator();
      while (iterator.hasNext()) {
        final net.minecraft.server.v1_5_R1.Entity other = (net.minecraft.server.v1_5_R1.Entity) iterator.next();
        if (!(other instanceof EntityBoat)){ // && !(other instanceof EntityMinecart)) continue;
          continue;
        }
        if (minY >= other.locY && minY - other.locY <= 0.7){
          return true;
        }
        // Still check this for some reason.
        final AxisAlignedBB otherBox = other.boundingBox;
        if (box.a > otherBox.d || box.d < otherBox.a || box.b > otherBox.e || box.e < otherBox.b || box.c > otherBox.f || box.f < otherBox.c) continue;
        else {
          return true;
        }
      }
View Full Code Here

Examples of net.minecraft.server.v1_5_R2.AxisAlignedBB

    try{
      // TODO: Probably check other ids too before doing this ?
     
      final net.minecraft.server.v1_5_R2.Entity mcEntity  = ((CraftEntity) entity).getHandle();
     
      final AxisAlignedBB box = useBox.b(minX, minY, minZ, maxX, maxY, maxZ);
      @SuppressWarnings("rawtypes")
      final List list = world.getEntities(mcEntity, box);
      @SuppressWarnings("rawtypes")
      final Iterator iterator = list.iterator();
      while (iterator.hasNext()) {
        final net.minecraft.server.v1_5_R2.Entity other = (net.minecraft.server.v1_5_R2.Entity) iterator.next();
        if (!(other instanceof EntityBoat)){ // && !(other instanceof EntityMinecart)) continue;
          continue;
        }
        if (minY >= other.locY && minY - other.locY <= 0.7){
          return true;
        }
        // Still check this for some reason.
        final AxisAlignedBB otherBox = other.boundingBox;
        if (box.a > otherBox.d || box.d < otherBox.a || box.b > otherBox.e || box.e < otherBox.b || box.c > otherBox.f || box.f < otherBox.c) continue;
        else {
          return true;
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.