Package net.minecraft.block

Examples of net.minecraft.block.Block.onBlockActivated()


        done = entity != null && entity instanceof EntityLiving && (item.itemInteractionForEntity(stack, player, (EntityLivingBase) entity) || (!(entity instanceof EntityAnimal) || ((EntityAnimal) entity).interact(player)));

        if (!done)
          item.onItemUseFirst(stack, player, worldObj, coords.posX, coords.posY, coords.posZ, side, 0F, 0F, 0F);
        if (!done)
          done = block != null && block.onBlockActivated(worldObj, coords.posX, coords.posY, coords.posZ, player, side, 0F, 0F, 0F);
        if (!done)
          done = item.onItemUse(stack, player, worldObj, coords.posX, coords.posY, coords.posZ, side, 0F, 0F, 0F);
        if (!done) {
          item.onItemRightClick(stack, worldObj, player);
          done = true;
View Full Code Here


    }
    MovingObjectPosition hit = getClosestHit(Vec3.createVectorHelper(start.x, start.y, start.z), hits);
    if(hit != null) {
      Block block = world.getBlock(hit.blockX, hit.blockY, hit.blockZ);
      if(block == EnderIO.blockHyperCube || block == EnderIO.blockCapacitorBank) {
        block.onBlockActivated(world, hit.blockX, hit.blockY, hit.blockZ, player, 0, 0, 0, 0);
      } else {
        openInterface(hit.blockX, hit.blockY, hit.blockZ);
      }
    }
View Full Code Here

        if(world.isRemote && !player.isSneaking())//attempt to use block activated like normal and tell the server the right stuff
        {
            Vector3 f = new Vector3(hit.hitVec).add(-hit.blockX, -hit.blockY, -hit.blockZ);
            Block block = world.getBlock(hit.blockX, hit.blockY, hit.blockZ);
            if(!ignoreActivate(block) && block.onBlockActivated(world, hit.blockX, hit.blockY, hit.blockZ, player, hit.sideHit, (float)f.x, (float)f.y, (float)f.z))
            {
                player.swingItem();
                PacketCustom.sendToServer(new C08PacketPlayerBlockPlacement(
                        hit.blockX, hit.blockY, hit.blockZ, hit.sideHit,
                        player.inventory.getCurrentItem(),
View Full Code Here

      if(!found) found = (tile.tile instanceof IInventory);
     
      if(found) {
        Block block = getWorld().getBlock(tile.tile.xCoord, tile.tile.yCoord, tile.tile.zCoord);
        if(block != null) {
          if(block.onBlockActivated(getWorld(), tile.tile.xCoord, tile.tile.yCoord, tile.tile.zCoord, player, 0, 0, 0, 0)) {
            break;
          }
        }
      }
    }
View Full Code Here

        if(SimpleServiceLocator.enderStorageProxy.isEnderChestBlock(block)) {
          SimpleServiceLocator.enderStorageProxy.openEnderChest(player.worldObj, tile.tile.xCoord, tile.tile.yCoord, tile.tile.zCoord, player);
          MainProxy.sendPacketToPlayer(PacketHandler.getPacket(SlotFinderActivatePacket.class).setTagetPosX(tile.tile.xCoord).setTagetPosY(tile.tile.yCoord).setTagetPosZ(tile.tile.zCoord).setSlot(getSlot()).setPacketPos(this), player);
        }
        if(block != null) {
          if(block.onBlockActivated(player.worldObj, tile.tile.xCoord, tile.tile.yCoord, tile.tile.zCoord, player, 0, 0, 0, 0)) {
            MainProxy.sendPacketToPlayer(PacketHandler.getPacket(SlotFinderActivatePacket.class).setTagetPosX(tile.tile.xCoord).setTagetPosY(tile.tile.yCoord).setTagetPosZ(tile.tile.zCoord).setSlot(getSlot()).setPacketPos(this), player);
            break;
          }
        }
      }
View Full Code Here

                            // the right stuff
    {
      Vector3 f = new Vector3( hit.hitVec ).add( -hit.blockX, -hit.blockY, -hit.blockZ );
      Block block = world.getBlock( hit.blockX, hit.blockY, hit.blockZ );
      if ( block != null && !ignoreActivate( block )
          && block.onBlockActivated( world, hit.blockX, hit.blockY, hit.blockZ, player, hit.sideHit, (float) f.x, (float) f.y, (float) f.z ) )
      {
        player.swingItem();
        PacketCustom.sendToServer( new C08PacketPlayerBlockPlacement( hit.blockX, hit.blockY, hit.blockZ, hit.sideHit, player.inventory
            .getCurrentItem(), (float) f.x, (float) f.y, (float) f.z ) );
        return true;
View Full Code Here

          Platform.openGUI( p, null, ForgeDirection.UNKNOWN, GuiBridge.GUI_NETWORK_TOOL );

        return true;
      }
      else
        b.onBlockActivated( w, x, y, z, p, side, hitX, hitY, hitZ );
    }
    else
      Platform.openGUI( p, null, ForgeDirection.UNKNOWN, GuiBridge.GUI_NETWORK_TOOL );

    return false;
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.