Package net.minecraft.src

Examples of net.minecraft.src.World


    int e = (int)(powerProvider.getEnergyStored());
    if (e<MjPerItem) return;
    int count = e/MjPerItem;
    if (count>efficiency) count = efficiency;
    powerProvider.useEnergy(count*MjPerItem, count*MjPerItem, true);
    World world = worldObj;
    ItemStack stack = new ItemStack(Block.cobblestone, count);
    ItemStack added = Utils.addToRandomInventory(stack, worldObj, xCoord, yCoord, zCoord, Orientations.Unknown);
    stack.stackSize -= added.stackSize;
    this.worldObj.spawnParticle("smoke", xCoord, yCoord+1, zCoord, 0.0D, 0.1D, 0.0D);
        this.worldObj.spawnParticle("flame", xCoord, yCoord+1, zCoord, 0.0D, 0.1D, 0.0D);
    if (stack.stackSize <= 0) return;
    if (Utils.addToRandomPipeEntry(this, Orientations.Unknown, stack) && stack.stackSize <= 0) return;
    float f = world.rand.nextFloat() * 0.8F + 0.1F;
    float f1 = world.rand.nextFloat() * 0.8F + 0.1F;
    float f2 = world.rand.nextFloat() * 0.8F + 0.1F;

    EntityItem entityitem = new EntityItem(world, xCoord + f, yCoord + f1 + 0.5F, zCoord + f2, stack);
    float f3 = 0.05F;
    entityitem.motionX = (float) world.rand.nextGaussian() * f3;
    entityitem.motionY = (float) world.rand.nextGaussian() * f3 + 0.2F;
    entityitem.motionZ = (float) world.rand.nextGaussian() * f3;
    world.spawnEntityInWorld(entityitem);
  }
 
View Full Code Here


    public void doWork() {
        if (powerProvider.energyStored <= 0) {
            return;
        }

        World w = worldObj;

        int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);

        if (meta > 5) {
            return;
        }

        Position pos = new Position(xCoord, yCoord, zCoord,
                                    Orientations.values()[meta]);
        pos.moveForwards(1);
        int blockId = w.getBlockId((int) pos.x, (int) pos.y, (int) pos.z);
        TileEntity tile = w.getBlockTileEntity((int) pos.x, (int) pos.y,
                                               (int) pos.z);

        if (tile == null
                || !(tile instanceof IInventory || tile instanceof ILiquidContainer)
                || PipeLogicWood
View Full Code Here

TOP

Related Classes of net.minecraft.src.World

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.