Package net.minecraft.block

Examples of net.minecraft.block.Block


    TileEntity tile = ba.getTileEntity(x, y, z);
    if(!(tile instanceof TileEntityPaintedBlock)) {
      return false;
    }
    TileEntityPaintedBlock te = (TileEntityPaintedBlock) tile;
    Block srcBlk = te.getSourceBlock();
    if(srcBlk == null) {
      srcBlk = Blocks.glowstone;
    }

    IBlockAccess origBa = rb.blockAccess;
View Full Code Here


    } else if(par1ItemStack.stackSize == 0) {
      return false;
    } else if(!player.canPlayerEdit(x, y, z, side, par1ItemStack)) {
      return false;
    } else {
      Block i1 = world.getBlock(x, y, z);
      int j1 = world.getBlockMetadata(x, y, z);
      int k1 = j1 & 7;
      boolean flag = (j1 & 8) != 0;

      if((side == 1 && !flag || side == 0 && flag) && i1 == EnderIO.blockPaintedSlab && k1 == par1ItemStack.getItemDamage()) {

        if(world.checkNoEntityCollision(EnderIO.blockPaintedDoubleSlab.getCollisionBoundingBoxFromPool(world, x, y, z))) {

          TileEntity te = world.getTileEntity(x, y, z);
          if(te instanceof TileEntityPaintedSlab) {
            ((TileEntityPaintedSlab) te).isConvertingToFullBlock = true;
          }

          if(world.setBlock(x, y, z, EnderIO.blockPaintedDoubleSlab, k1, 3)) {

            te = world.getTileEntity(x, y, z);
            if(te instanceof TileEntityPaintedBlock) {

              Block b = PainterUtil.getSourceBlock(par1ItemStack);
              TileEntityPaintedBlock tef = (TileEntityPaintedBlock) te;
              tef.setSourceBlock(b);
              tef.setSourceBlockMetadata(PainterUtil.getSourceBlockMetadata(par1ItemStack));
              world.markBlockForUpdate(x, y, z);
            }
View Full Code Here

      --x;
    } else if(side == 5) {
      ++x;
    }

    Block i1 = world.getBlock(x, y, z);
    int j1 = world.getBlockMetadata(x, y, z);
    int k1 = j1 & 7;

    if(i1 == EnderIO.blockPaintedSlab && k1 == par1ItemStack.getItemDamage()) {

      TileEntity te = world.getTileEntity(x, y, z);
      if(te instanceof TileEntityPaintedSlab) {
        ((TileEntityPaintedSlab) te).isConvertingToFullBlock = true;
      }

      if(world.checkNoEntityCollision(EnderIO.blockPaintedDoubleSlab.getCollisionBoundingBoxFromPool(world, x, y, z))
          && world.setBlock(x, y, z, EnderIO.blockPaintedDoubleSlab, k1, 3)) {

        te = world.getTileEntity(x, y, z);
        if(te instanceof TileEntityPaintedBlock) {

          Block b = PainterUtil.getSourceBlock(par1ItemStack);
          TileEntityPaintedBlock tef = (TileEntityPaintedBlock) te;
          tef.setSourceBlock(b);
          tef.setSourceBlockMetadata(PainterUtil.getSourceBlockMetadata(par1ItemStack));
          world.markBlockForUpdate(x, y, z);
        }
View Full Code Here

        EffectRenderer effectRenderer) {
      IIcon tex = null;

      TileEntityPaintedBlock cb = (TileEntityPaintedBlock)
          world.getTileEntity(target.blockX, target.blockY, target.blockZ);
      Block b = cb.getSourceBlock();
      if(b != null) {
        tex = b.getIcon(ForgeDirection.NORTH.ordinal(), cb.getSourceBlockMetadata());
      }
      if(tex == null) {
        tex = blockIcon;
      }
      lastRemovedComponetIcon = tex;
View Full Code Here

      return new TileEntityPaintedBlock();
    }

    @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 TileEntityPaintedBlock) {
        TileEntityPaintedBlock tef = (TileEntityPaintedBlock) te;
        tef.setSourceBlock(b);
        tef.setSourceBlockMetadata(PainterUtil.getSourceBlockMetadata(stack));
View Full Code Here

    WorldServer worldserver = minecraftserver.worldServerForDimension(world.provider.dimensionId);
    for (int i = 0; i < 4; i++) {
      int x = transciever.xCoord + randOffset(2);
      int y = transciever.yCoord + 1;
      int z = transciever.zCoord + randOffset(2);
      Block b = world.getBlock(x, y, z);
      entity.setPosition(x + 0.5, entity.posY, z + 0.5);
      if(world.canPlaceEntityOnSide(b, x, y, z, false, ForgeDirection.UP.ordinal(), entity, null)) {
        resetForRandomRandomSpawn(entity);
        if(worldserver.spawnEntityInWorld(entity)) {
          //entity.onUpdate();
View Full Code Here

      return false;
    }
    if(!reciever.hasPower()) {
      return false;
    }
    Block blk = reciever.getWorldObj().getBlock(reciever.xCoord, reciever.yCoord + 1, reciever.zCoord);
    if(blk != EnderIO.blockEnderRail) {
      return false;
    }
    return reciever.getRailController().isClear();
  }
View Full Code Here

  @Override
  public boolean prepareBlock(TileFarmStation farm, BlockCoord bc, Block block, int meta) {
    for(int x=-1;x<2;x++) {
      for(int z=-1;z<2;z++) {
       Block blk = farm.getBlock(bc.x + x, bc.y, bc.z + z);
       if(isWood(blk) || sapling == blk) {
         return false;
       }
      }     
    }
View Full Code Here

      EffectRenderer effectRenderer) {
    IIcon tex = null;

    TileEntityPaintedBlock cb = (TileEntityPaintedBlock)
        world.getTileEntity(target.blockX, target.blockY, target.blockZ);
    Block b = cb.getSourceBlock();
    if(b != null) {
      tex = b.getIcon(ForgeDirection.NORTH.ordinal(), cb.getSourceBlockMetadata());
    }
    if(tex == null) {
      tex = blockIcon;
    }
    lastRemovedComponetIcon = tex;
View Full Code Here

  }

  @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 TileEntityPaintedBlock) {
      TileEntityPaintedBlock tef = (TileEntityPaintedBlock) te;
      tef.setSourceBlock(b);
      tef.setSourceBlockMetadata(PainterUtil.getSourceBlockMetadata(stack));
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.