Examples of EnumFacing


Examples of net.minecraft.util.EnumFacing

    return (IBehaviorDispenseItem) dispenseBehaviorRegistry.getObject(itemstack.getItem());
  }

  public static IPosition getIPositionFromBlockSource(IBlockSource par0IBlockSource)
  {
    EnumFacing enumfacing = getFacing(par0IBlockSource.getBlockMetadata());
    double d0 = par0IBlockSource.getX() + 0.7D * enumfacing.getFrontOffsetX();
    double d1 = par0IBlockSource.getY() + 0.7D * enumfacing.getFrontOffsetY();
    double d2 = par0IBlockSource.getZ() + 0.7D * enumfacing.getFrontOffsetZ();
    return new PositionImpl(d0, d1, d2);
  }
View Full Code Here

Examples of net.minecraft.util.EnumFacing

     * Dispense the specified stack, play the dispense sound and spawn particles.
     */
    @Override
    public ItemStack dispenseStack (IBlockSource par1IBlockSource, ItemStack par2ItemStack)
    {
        EnumFacing enumfacing = BlockDispenser.func_149937_b(par1IBlockSource.getBlockMetadata());
        double d0 = par1IBlockSource.getX() + enumfacing.getFrontOffsetX();
        double d1 = par1IBlockSource.getYInt() + 0.2F;
        double d2 = par1IBlockSource.getZ() + enumfacing.getFrontOffsetZ();
        EntityLiving entity = SpawnEgg.activateSpawnEgg(par2ItemStack, par1IBlockSource.getWorld(), d0, d1, d2, 0);

        if (par2ItemStack.hasDisplayName())
        {
            entity.setCustomNameTag(par2ItemStack.getDisplayName());
View Full Code Here

Examples of net.minecraft.util.EnumFacing

  @Override
  public ItemStack dispenseStack(IBlockSource dispenser, ItemStack stack)
  {
    World world = dispenser.getWorld();
    IPosition dispenserPos = BlockDispenser.getIPositionFromBlockSource(dispenser);
    EnumFacing dispenserFacing = BlockDispenser.getFacing(dispenser.getBlockMetadata());
    EntitySafariNet proj = new EntitySafariNet(world, dispenserPos.getX(), dispenserPos.getY(), dispenserPos.getZ(), stack.copy());
    proj.setThrowableHeading(dispenserFacing.getFrontOffsetX(), dispenserFacing.getFrontOffsetY() + 0.1, dispenserFacing.getFrontOffsetZ(), 1.1F, 6.0F);
    world.spawnEntityInWorld(proj);
    stack.splitStack(1);
    return stack;
  }
View Full Code Here

Examples of net.minecraft.util.EnumFacing

    this.block = block;
  }

  @Override
  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--;
View Full Code Here

Examples of net.minecraft.util.EnumFacing

  private final BehaviorDefaultDispenseItem defaultDispenserItemBehavior = new BehaviorDefaultDispenseItem();

  @Override
  public ItemStack dispenseStack(IBlockSource blockSource, ItemStack stackBucket) {

    EnumFacing facing = BlockDispenser.func_149937_b(blockSource.getBlockMetadata());
    World world = blockSource.getWorld();

    int x = blockSource.getXInt() + facing.getFrontOffsetX();
    int y = blockSource.getYInt() + facing.getFrontOffsetY();
    int z = blockSource.getZInt() + facing.getFrontOffsetZ();

    ItemStack filledBucket = BucketHandler.fillBucket(world, x, y, z);
    if (filledBucket == null) {
      return defaultDispenserItemBehavior.dispense(blockSource, stackBucket);
    }
View Full Code Here

Examples of net.minecraft.util.EnumFacing

   * Dispense the specified stack, play the dispense sound and spawn particles.
   */
  @Override
  public ItemStack dispenseStack(IBlockSource blockSource, ItemStack stackBucket) {

    EnumFacing facing = BlockDispenser.func_149937_b(blockSource.getBlockMetadata());
    World world = blockSource.getWorld();

    int x = blockSource.getXInt() + facing.getFrontOffsetX();
    int y = blockSource.getYInt() + facing.getFrontOffsetY();
    int z = blockSource.getZInt() + facing.getFrontOffsetZ();

    if (!world.isAirBlock(x, y, z) && world.getBlock(x, y, z).getMaterial().isSolid()) {
      return stackBucket;
    }
    if (BucketHandler.emptyBucket(blockSource.getWorld(), x, y, z, stackBucket)) {
View Full Code Here

Examples of net.minecraft.util.EnumFacing

  protected ItemStack dispenseStack(IBlockSource dispenser, ItemStack dispensedItem)
  {
    Item i = dispensedItem.getItem();
    if ( i instanceof IBlockTool )
    {
      EnumFacing enumfacing = BlockDispenser.func_149937_b( dispenser.getBlockMetadata() );
      IBlockTool tm = (IBlockTool) i;

      World w = dispenser.getWorld();
      if ( w instanceof WorldServer )
      {
        int x = dispenser.getXInt() + enumfacing.getFrontOffsetX();
        int y = dispenser.getYInt() + enumfacing.getFrontOffsetY();
        int z = dispenser.getZInt() + enumfacing.getFrontOffsetZ();

        tm.onItemUse( dispensedItem, Platform.getPlayer( (WorldServer) w ), w, x, y, z, enumfacing.ordinal(), 0.5f, 0.5f, 0.5f );
      }
    }
    return dispensedItem;
  }
View Full Code Here

Examples of net.minecraft.util.EnumFacing

{

  @Override
  protected ItemStack dispenseStack(IBlockSource dispenser, ItemStack dispensedItem)
  {
    EnumFacing enumfacing = BlockDispenser.func_149937_b( dispenser.getBlockMetadata() );
    World world = dispenser.getWorld();
    int i = dispenser.getXInt() + enumfacing.getFrontOffsetX();
    int j = dispenser.getYInt() + enumfacing.getFrontOffsetY();
    int k = dispenser.getZInt() + enumfacing.getFrontOffsetZ();
    EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( world, i + 0.5F, j + 0.5F,
        k + 0.5F, null );
    world.spawnEntityInWorld( primedTinyTNTEntity );
    --dispensedItem.stackSize;
    return dispensedItem;
View Full Code Here

Examples of net.minecraft.util.EnumFacing

  protected ItemStack dispenseStack(IBlockSource dispenser, ItemStack dispensedItem)
  {
    Item i = dispensedItem.getItem();
    if ( i instanceof ToolMassCannon )
    {
      EnumFacing enumfacing = BlockDispenser.func_149937_b( dispenser.getBlockMetadata() );
      ForgeDirection dir = ForgeDirection.UNKNOWN;
      for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS)
      {
        if ( enumfacing.getFrontOffsetX() == d.offsetX && enumfacing.getFrontOffsetY() == d.offsetY && enumfacing.getFrontOffsetZ() == d.offsetZ )
          dir = d;
      }

      ToolMassCannon tm = (ToolMassCannon) i;
View Full Code Here

Examples of net.minecraft.util.EnumFacing

{

    @Override
    public void executeLogic (World par1World, int par2, int par3, int par4, ItemStack par5ItemStack, Entity triggerer, boolean willBlockBeRemoved)
    {
        EnumFacing enumfacing = getFacing(par1World, par2, par3, par4);
        double d0 = par2 + Math.random() + (double) enumfacing.getFrontOffsetX();
        double d1 = (double) ((float) par3 + 0.2F);
        double d2 = par4 + Math.random() + (double) enumfacing.getFrontOffsetZ();
        Entity entity = ItemMonsterPlacer.spawnCreature(par1World, par5ItemStack.getItemDamage(), d0, d1, d2);

        if (entity instanceof EntityLivingBase && par5ItemStack.hasDisplayName())
        {
            ((EntityLiving) entity).setCustomNameTag(par5ItemStack.getDisplayName());
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.