Package net.minecraft.world

Examples of net.minecraft.world.World


    protected abstract World getWorld(MessageContext ctxt);
   
    protected abstract IMessage handleMessage(M message, MessageContext ctx, TileEntity te);
   
    public IMessage onMessage(WorldMessage message, MessageContext ctx) {
      World world = getWorld(ctx);
      if(world == null) {
        BRLog.fatal("Unable to resolve world from messagecontext for WorldMessage");
        return null;
      }
     
      TileEntity te = world.getTileEntity(message.x, message.y, message.z);
      if(te == null) {
        BRLog.error("Unable to find tile entity for WorldMessage at %d, %d, %d", message.x, message.y, message.z);
        return null;
      }
View Full Code Here


    }

    @Override
    public boolean activate(EntityPlayer player, MovingObjectPosition part, ItemStack item)
    {
        World world = world();
        if(world.isRemote)
            return true;

        world.playSoundEffect(x() + 0.5, y() + 0.5, z() + 0.5, "random.click", 0.3F, !active() ? 0.6F : 0.5F);
        meta ^= 8;
        sendDescUpdate();
        tile().notifyPartChange(this);
        tile().notifyNeighborChange(metaSideMap[meta&7]);
        tile().markDirty();
View Full Code Here

        double d1 = y() + 0.7 + (random.nextFloat() - 0.5) * 0.2;
        double d2 = z() + 0.5 + (random.nextFloat() - 0.5) * 0.2;
        double d3 = 0.22D;
        double d4 = 0.27D;
       
        World world = world();
        int m = meta&7;
        if (m == 1)
            world.spawnParticle("reddust", d0 - d4, d1 + d3, d2, 0, 0, 0);
        else if (m == 2)
            world.spawnParticle("reddust", d0 + d4, d1 + d3, d2, 0, 0, 0);
        else if (m == 3)
            world.spawnParticle("reddust", d0, d1 + d3, d2 - d4, 0, 0, 0);
        else if (m == 4)
            world.spawnParticle("reddust", d0, d1 + d3, d2 + d4, 0, 0, 0);
        else
            world.spawnParticle("reddust", d0, d1, d2, 0, 0, 0);
    }
View Full Code Here

    {
        if(active())//deactivating
        {
            if(burnedOut(true))
            {
                World world = world();
                Random rand = world.rand;
                world.playSoundEffect(x()+0.5, y()+0.5, z()+0.5, "random.fizz", 0.5F, 2.6F + (rand.nextFloat() - rand.nextFloat()) * 0.8F);
                McMultipartSPH.spawnBurnoutSmoke(world, x(), y(), z());
            }
        }
        else if(burnedOut(false))
        {
View Full Code Here

        double d1 = y() + 0.7;
        double d2 = z() + 0.5;
        double d3 = 0.22D;
        double d4 = 0.27D;
       
        World world = world();
        if (meta == 1)
        {
            world.spawnParticle("smoke", d0 - d4, d1 + d3, d2, 0, 0, 0);
            world.spawnParticle("flame", d0 - d4, d1 + d3, d2, 0, 0, 0);
        }
        else if (meta == 2)
        {
            world.spawnParticle("smoke", d0 + d4, d1 + d3, d2, 0, 0, 0);
            world.spawnParticle("flame", d0 + d4, d1 + d3, d2, 0, 0, 0);
        }
        else if (meta == 3)
        {
            world.spawnParticle("smoke", d0, d1 + d3, d2 - d4, 0, 0, 0);
            world.spawnParticle("flame", d0, d1 + d3, d2 - d4, 0, 0, 0);
        }
        else if (meta == 4)
        {
            world.spawnParticle("smoke", d0, d1 + d3, d2 + d4, 0, 0, 0);
            world.spawnParticle("flame", d0, d1 + d3, d2 + d4, 0, 0, 0);
        }
        else
        {
            world.spawnParticle("smoke", d0, d1, d2, 0, 0, 0);
            world.spawnParticle("flame", d0, d1, d2, 0, 0, 0);
        }
    }
View Full Code Here

        public Object[] trigger(final Context context, final Arguments args) {
            if (args.count() > 0 && args.checkAny(0) != null) {
                setPitch(args.checkInteger(0));
            }

            final World world = tileEntity.getWorldObj();
            final int x = tileEntity.xCoord;
            final int y = tileEntity.yCoord;
            final int z = tileEntity.zCoord;
            final Material material = world.getBlock(x, y + 1, z).getMaterial();
            final boolean canTrigger = material == Material.air;

            tileEntity.triggerNote(world, x, y, z);
            return new Object[]{canTrigger};
        }
View Full Code Here

    return closestTile;
  }

  private synchronized void remove(Map<World, List<TileSignature>> map, TileEntity tile) {
    World world = tile.getWorldObj();

    if(!map.containsKey(world))
      return;

    List<TileSignature> sigs = map.get(world);
View Full Code Here

        break;
      }
  }

  private synchronized void add(Map<World, List<TileSignature>> map, TileEntity tile) {
    World world = tile.getWorldObj();

    List<TileSignature> tiles;
    if(!map.containsKey(world))
      map.put(world, new ArrayList());
View Full Code Here

  @SideOnly(Side.CLIENT)
  @SubscribeEvent
  public void onTick(ClientTickEvent event) {
    if(event.phase == Phase.END) {
      World world = Minecraft.getMinecraft().theWorld;
      if(world != null) {
        List<Entity> entities = new ArrayList(world.loadedEntityList);
        for(Entity entity : entities)
          if(entity instanceof EntityItem)
            TerrasteelCraftingHandler.onEntityUpdate((EntityItem) entity);
View Full Code Here

  public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) {
    EnumFacing facing = BlockDispenser.func_149937_b(par1IBlockSource.getBlockMetadata());
    int x = par1IBlockSource.getXInt() + facing.getFrontOffsetX();
    int y = par1IBlockSource.getYInt() + facing.getFrontOffsetY();
    int z = par1IBlockSource.getZInt() + facing.getFrontOffsetZ();
    World world = par1IBlockSource.getWorld();

    if(world.getBlock(x, y, z).isAir(world, x, y, z) && block.canBlockStay(world, x, y, z)) {
      world.setBlock(x, y, z, block);
      par2ItemStack.stackSize--;
      return par2ItemStack;
    }

    return super.dispenseStack(par1IBlockSource, par2ItemStack);
View Full Code Here

TOP

Related Classes of net.minecraft.world.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.