Examples of onBlockPlaced()


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

    else if(!player.canPlayerEdit(x, y, z, side, itemstack))
      return false;
    else if(y == 255 && block.getMaterial().isSolid())
      return false;
    else if(world.canPlaceEntityOnSide(Blocks.mob_spawner, x, y, z, false, side, player, itemstack)) {
      int meta = block.onBlockPlaced(world, x, y, z, side, xOffset, yOffset, zOffset, 0);

      if(placeBlockAt(itemstack, player, world, x, y, z, side, xOffset, yOffset, zOffset, meta)) {
        world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, block.stepSound.func_150496_b(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
        player.renderBrokenItemStack(itemstack);
        for(int i = 0; i < 100; i++)
View Full Code Here

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

                ItemStack droneStack = drone.getInventory().getStackInSlot(i);
                if(droneStack != null && droneStack.getItem() instanceof ItemBlock && ((ItemBlock)droneStack.getItem()).field_150939_a.canPlaceBlockOnSide(drone.worldObj, pos.chunkPosX, pos.chunkPosY, pos.chunkPosZ, ProgWidgetPlace.getDirForSides(((ISidedWidget)widget).getSides()).ordinal())) {
                    if(widget.isItemValidForFilters(droneStack)) {
                        Block block = Block.getBlockFromItem(droneStack.getItem());
                        int meta = droneStack.getItem().getMetadata(droneStack.getItemDamage());
                        int newMeta = block.onBlockPlaced(drone.worldObj, pos.chunkPosX, pos.chunkPosY, pos.chunkPosZ, side.ordinal(), side.offsetX, side.offsetY, side.offsetZ, meta);
                        setFakePlayerAccordingToDir();
                        if(placeBlockAt(droneStack, drone.getFakePlayer(), drone.worldObj, pos.chunkPosX, pos.chunkPosY, pos.chunkPosZ, side.ordinal(), 0, 0, 0, newMeta)) {
                            drone.addAir(null, -PneumaticValues.DRONE_USAGE_PLACE);
                            drone.worldObj.playSoundEffect(pos.chunkPosX + 0.5F, pos.chunkPosY + 0.5F, pos.chunkPosZ + 0.5F, block.stepSound.func_150496_b(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
                            if(--droneStack.stackSize <= 0) {
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.