Package net.minecraft.block

Examples of net.minecraft.block.Block


        int j = MathHelper.floor_double(endVec.yCoord);
        int k = MathHelper.floor_double(endVec.zCoord);
        int l = MathHelper.floor_double(startVec.xCoord);
        int i1 = MathHelper.floor_double(startVec.yCoord);
        int j1 = MathHelper.floor_double(startVec.zCoord);
        Block block = world.getBlock(l, i1, j1);
        int k1 = world.getBlockMetadata(l, i1, j1);

        if((!p_147447_4_ || block.getCollisionBoundingBoxFromPool(world, l, i1, j1) != null) && block.canCollideCheck(k1, includeLiquids)) {
          MovingObjectPosition movingobjectposition = block.collisionRayTrace(world, l, i1, j1, startVec, endVec);
          if(movingobjectposition != null) {
            result.add(movingobjectposition);
          }
        }

        MovingObjectPosition movingobjectposition2 = null;
        k1 = 200;

        while (k1-- >= 0) {
          if(Double.isNaN(startVec.xCoord) || Double.isNaN(startVec.yCoord) || Double.isNaN(startVec.zCoord)) {
            return null;
          }

          if(l == i && i1 == j && j1 == k) {
            if(p_147447_5_) {
              result.add(movingobjectposition2);
            } else {
              return result;
            }
          }

          boolean flag6 = true;
          boolean flag3 = true;
          boolean flag4 = true;
          double d0 = 999.0D;
          double d1 = 999.0D;
          double d2 = 999.0D;

          if(i > l) {
            d0 = (double) l + 1.0D;
          } else if(i < l) {
            d0 = (double) l + 0.0D;
          } else {
            flag6 = false;
          }

          if(j > i1) {
            d1 = (double) i1 + 1.0D;
          } else if(j < i1) {
            d1 = (double) i1 + 0.0D;
          } else {
            flag3 = false;
          }

          if(k > j1) {
            d2 = (double) j1 + 1.0D;
          } else if(k < j1) {
            d2 = (double) j1 + 0.0D;
          } else {
            flag4 = false;
          }

          double d3 = 999.0D;
          double d4 = 999.0D;
          double d5 = 999.0D;
          double d6 = endVec.xCoord - startVec.xCoord;
          double d7 = endVec.yCoord - startVec.yCoord;
          double d8 = endVec.zCoord - startVec.zCoord;

          if(flag6) {
            d3 = (d0 - startVec.xCoord) / d6;
          }
          if(flag3) {
            d4 = (d1 - startVec.yCoord) / d7;
          }
          if(flag4) {
            d5 = (d2 - startVec.zCoord) / d8;
          }

          boolean flag5 = false;
          byte b0;

          if(d3 < d4 && d3 < d5) {
            if(i > l) {
              b0 = 4;
            } else {
              b0 = 5;
            }

            startVec.xCoord = d0;
            startVec.yCoord += d7 * d3;
            startVec.zCoord += d8 * d3;
          } else if(d4 < d5) {
            if(j > i1) {
              b0 = 0;
            } else {
              b0 = 1;
            }

            startVec.xCoord += d6 * d4;
            startVec.yCoord = d1;
            startVec.zCoord += d8 * d4;
          } else {
            if(k > j1) {
              b0 = 2;
            } else {
              b0 = 3;
            }

            startVec.xCoord += d6 * d5;
            startVec.yCoord += d7 * d5;
            startVec.zCoord = d2;
          }

          Vec3 vec32 = Vec3.createVectorHelper(startVec.xCoord, startVec.yCoord, startVec.zCoord);
          l = (int) (vec32.xCoord = (double) MathHelper.floor_double(startVec.xCoord));
          if(b0 == 5) {
            --l;
            ++vec32.xCoord;
          }

          i1 = (int) (vec32.yCoord = (double) MathHelper.floor_double(startVec.yCoord));

          if(b0 == 1) {
            --i1;
            ++vec32.yCoord;
          }

          j1 = (int) (vec32.zCoord = (double) MathHelper.floor_double(startVec.zCoord));

          if(b0 == 3) {
            --j1;
            ++vec32.zCoord;
          }

          Block block1 = world.getBlock(l, i1, j1);
          int l1 = world.getBlockMetadata(l, i1, j1);

          if(!p_147447_4_ || block1.getCollisionBoundingBoxFromPool(world, l, i1, j1) != null) {
            if(block1.canCollideCheck(l1, includeLiquids)) {
              MovingObjectPosition movingobjectposition1 = block1.collisionRayTrace(world, l, i1, j1, startVec, endVec);
              if(movingobjectposition1 != null) {
                result.add(movingobjectposition1);
              }
            } else {
              movingobjectposition2 = new MovingObjectPosition(l, i1, j1, b0, startVec, false);
View Full Code Here


    int maxY = MathHelper.floor_double(entityBounds.maxY + 1.0D);   
    int maxZ = MathHelper.floor_double(entityBounds.maxZ + 1.0D);
    for (int x = minX; x < maxX; x++) {
      for (int z = minZ; z < maxZ; z++) {
        for (int y = minY; y < maxY; y++) {
          Block block = world.getBlock(x, y, z);
          if(block != null) {
            block.addCollisionBoxesToList(world, x, y, z, entityBounds, collidingBoundingBoxes, entity);
          }
        }
      }
    }
    return collidingBoundingBoxes;
View Full Code Here

    }
    return icons;
  }
 
  public static IIcon[] getBlockTextures(IBlockAccess world, int x, int y, int z) {
    Block block = world.getBlock(x, y, z);
    IIcon[] icons = new IIcon[6];
    int i = 0;
    for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
      icons[i] = block.getIcon(world,x,y,z,dir.ordinal());
      i++;
    }
    return icons;
  }
View Full Code Here

    }
    return 0.8f; // z
  }

  public static int setTesselatorBrightness(IBlockAccess world, int x, int y, int z) {
    Block block = world.getBlock(x, y, z);
    int res = block == null ? world.getLightBrightnessForSkyBlocks(x, y, z, 0) : block.getMixedBrightnessForBlock(world, x, y, z);
    Tessellator.instance.setBrightness(res);
    Tessellator.instance.setColorRGBA_F(1, 1, 1, 1);
    return res;
  }
View Full Code Here

    if((blockAccess == null && !forceAllEdges) || face == null || texture == null) {
      return;
    }

    if(!forceAllEdges) {
      Block block = blockAccess.getBlock(x, y, z);
      if(block == null) {
        return;
      }
      if(!block.shouldSideBeRendered(blockAccess, x + face.offsetX, y + face.offsetY, z + face.offsetZ, face.ordinal())) {
        return;
      }
    }

    BlockCoord bc = new BlockCoord(x, y, z);
View Full Code Here

    return getNonConectedEdgesForFace(blockAccess, x, y, z, face, false);
  }

  public static List<ForgeDirection> getNonConectedEdgesForFace(IBlockAccess blockAccess, int x, int y, int z, ForgeDirection face, boolean matchMetaData) {

    Block block = blockAccess.getBlock(x, y, z);
    if(block == null) {
      return Collections.emptyList();
    }
    if(!block.shouldSideBeRendered(blockAccess, x + face.offsetX, y + face.offsetY, z + face.offsetZ, face.ordinal())) {
      return Collections.emptyList();
    }
    BlockCoord bc = new BlockCoord(x, y, z);

    List<EdgeNeighbour> edges = new ArrayList<EdgeNeighbour>(4);
View Full Code Here

    return 0; // for custom drops
  }

  @Override
  public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
    Block b = PainterUtil.getSourceBlock(stack);
    TileEntity te = world.getTileEntity(x, y, z);
    if(te instanceof TileEntityDarkSteelPressurePlate) {
      TileEntityDarkSteelPressurePlate tef = (TileEntityDarkSteelPressurePlate) te;
      tef.setSourceBlock(b);
      tef.setSourceBlockMetadata(PainterUtil.getSourceBlockMetadata(stack));
View Full Code Here

  private static final String ENERGY_CONDUIT = Lang.localize("itemPowerConduit");
  private static final String REQUEST_RANGE = " " + Lang.localize("gui.mjReader.requestRange") + ": ";;
  private static final String CUR_REQUEST = " " + Lang.localize("gui.mjReader.currentRequest") + ": ";;

  public static boolean canCreatePacket(World world, int x, int y, int z) {
    Block block = world.getBlock(x, y, z);
    if(block == null) {
      return false;
    }
    TileEntity te = world.getTileEntity(x, y, z);
    if(te instanceof TileConduitBundle) {
View Full Code Here

    World world = player.worldObj;
    if(world == null) {
      Log.warn("MJReaderPacketHandler.sendInfoMessage: Could not handle packet as player world was null.");
      return null;
    }
    Block block = world.getBlock(message.x, message.y, message.z);
    if(block == null) {
      return null;
    }

    TileEntity te = world.getTileEntity(message.x, message.y, message.z);
View Full Code Here

        return true;
      }
      if(paintSource == null) {
        return false;
      }
      Block block = Util.getBlockFromItemId(paintSource);
      if(block == null) {
        return false;
      }
      return Block.getBlockFromItem(paintSource.getItem()) == EnderIO.blockFusedQuartz;
    }
View Full Code Here

TOP

Related Classes of net.minecraft.block.Block

Copyright © 2018 www.massapicom. 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.