当前位置: 首页>>代码示例>>Java>>正文


Java IProjectile.setThrowableHeading方法代码示例

本文整理汇总了Java中net.minecraft.entity.IProjectile.setThrowableHeading方法的典型用法代码示例。如果您正苦于以下问题:Java IProjectile.setThrowableHeading方法的具体用法?Java IProjectile.setThrowableHeading怎么用?Java IProjectile.setThrowableHeading使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.entity.IProjectile的用法示例。


在下文中一共展示了IProjectile.setThrowableHeading方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: dispenseStack

import net.minecraft.entity.IProjectile; //导入方法依赖的package包/类
/**
 * Dispense the specified stack, play the dispense sound and spawn particles.
 */
public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) {
    World world = par1IBlockSource.getWorld();
    IPosition iposition = BlockDispenser.func_149939_a(par1IBlockSource);
    EnumFacing enumfacing = BlockDispenser.func_149937_b(par1IBlockSource.getBlockMetadata());
    ItemStack stack = par2ItemStack.splitStack(1);
    if (matchesItem(par2ItemStack)) {
        // dispense item as projectile because the item matches
        IProjectile iprojectile = this.getProjectileEntity(world, iposition, par2ItemStack);
        iprojectile.setThrowableHeading((double) enumfacing.getFrontOffsetX(), (double) ((float) enumfacing.getFrontOffsetY() + 0.1F), (double) enumfacing.getFrontOffsetZ(), this.func_82500_b(), this.func_82498_a());
        world.spawnEntityInWorld((Entity) iprojectile);
    } else {
        // dispense item as item because it doesn't match
        BehaviorDefaultDispenseItem.doDispense(world, stack, 6, enumfacing, iposition);
    }
    return par2ItemStack;
}
 
开发者ID:meew0,项目名称:AdvancedPotions,代码行数:20,代码来源:BehaviorAdvancedProjectileDispense.java

示例2: dispenseStack

import net.minecraft.entity.IProjectile; //导入方法依赖的package包/类
public ItemStack dispenseStack(IBlockSource source, ItemStack stack)
  {
float y = 1.1F;
      World var3 = source.getWorld();
      IPosition var4 = BlockDispenser.getIPositionFromBlockSource(source);
      EnumFacing var5 = BlockDispenser.getFacing(source.getBlockMetadata());
      
      IProjectile var6 = this.getProjectileEntity(var3, var4, stack.getItemDamage());
      if(var6 != null)
      {
      	var6.setThrowableHeading((double)var5.getFrontOffsetX(), 0.10000000149011612D*y, (double)var5.getFrontOffsetY(), this.func_82500_b(), this.func_82498_a());
      	var3.spawnEntityInWorld((Entity)var6);
      	stack.splitStack(1);
      }
      return stack;
  }
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:17,代码来源:DispenseBombMF.java

示例3: dispenseStack

import net.minecraft.entity.IProjectile; //导入方法依赖的package包/类
public ItemStack dispenseStack(IBlockSource source, ItemStack stack)
  {
float y = 1.1F;
      World var3 = source.getWorld();
      IPosition var4 = BlockDispenser.getIPositionFromBlockSource(source);
      EnumFacing enumfacing = BlockDispenser.getFacing(source.getBlockMetadata());
      
      IProjectile iprojectile = this.getProjectileEntity(var3, var4, stack.getItemDamage());
      if(iprojectile != null)
      {
      	iprojectile.setThrowableHeading((double)enumfacing.getFrontOffsetX(), (double)((float)enumfacing.getFrontOffsetY() + 0.1F), (double)enumfacing.getFrontOffsetZ(), this.func_82500_b(), this.func_82498_a());
      	var3.spawnEntityInWorld((Entity)iprojectile);
      	stack.splitStack(1);
      }
      return stack;
  }
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:17,代码来源:DispenseArrowMF.java

示例4: dispenseStack

import net.minecraft.entity.IProjectile; //导入方法依赖的package包/类
/**
 * Dispense the specified stack, play the dispense sound and spawn particles.
 */
public ItemStack dispenseStack(IBlockSource source, ItemStack stack)
{
    World world = source.getWorld();
    IPosition iposition = BlockDispenser.getDispensePosition(source);
    EnumFacing enumfacing = BlockDispenser.getFacing(source.getBlockMetadata());
    IProjectile iprojectile = this.getProjectileEntity(world, iposition);
    iprojectile.setThrowableHeading((double)enumfacing.getFrontOffsetX(), (double)((float)enumfacing.getFrontOffsetY() + 0.1F), (double)enumfacing.getFrontOffsetZ(), this.func_82500_b(), this.func_82498_a());
    world.spawnEntityInWorld((Entity)iprojectile);
    stack.splitStack(1);
    return stack;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:15,代码来源:BehaviorProjectileDispense.java

示例5: dispenseStack

import net.minecraft.entity.IProjectile; //导入方法依赖的package包/类
/**
 * Dispense the specified stack, play the dispense sound and spawn particles.
 */
public ItemStack dispenseStack(IBlockSource source, ItemStack stack)
{
    World world = source.getWorld();
    IPosition iposition = BlockDispenser.getDispensePosition(source);
    EnumFacing enumfacing = (EnumFacing)source.getBlockState().getValue(BlockDispenser.FACING);
    IProjectile iprojectile = this.getProjectileEntity(world, iposition, stack);
    iprojectile.setThrowableHeading((double)enumfacing.getFrontOffsetX(), (double)((float)enumfacing.getFrontOffsetY() + 0.1F), (double)enumfacing.getFrontOffsetZ(), this.getProjectileVelocity(), this.getProjectileInaccuracy());
    world.spawnEntityInWorld((Entity)iprojectile);
    stack.func_190918_g(1);
    return stack;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:15,代码来源:BehaviorProjectileDispense.java

示例6: dispenseStack

import net.minecraft.entity.IProjectile; //导入方法依赖的package包/类
/**
 * Dispense the specified stack, play the dispense sound and spawn particles.
 */
public ItemStack dispenseStack(IBlockSource source, ItemStack stack)
{
    World world = source.getWorld();
    IPosition iposition = BlockDispenser.getDispensePosition(source);
    EnumFacing enumfacing = (EnumFacing)source.getBlockState().getValue(BlockDispenser.FACING);
    IProjectile iprojectile = this.getProjectileEntity(world, iposition, stack);
    iprojectile.setThrowableHeading((double)enumfacing.getFrontOffsetX(), (double)((float)enumfacing.getFrontOffsetY() + 0.1F), (double)enumfacing.getFrontOffsetZ(), this.getProjectileVelocity(), this.getProjectileInaccuracy());
    world.spawnEntityInWorld((Entity)iprojectile);
    stack.splitStack(1);
    return stack;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:15,代码来源:BehaviorProjectileDispense.java

示例7: dispenseStack

import net.minecraft.entity.IProjectile; //导入方法依赖的package包/类
@Override
public ItemStack dispenseStack(IBlockSource blocksource, ItemStack itemstack)
{
    World world = blocksource.getWorld();
    IPosition pos = BlockDispenser.getDispensePosition(blocksource);
    EnumFacing face = BlockDispenser.getFacing(blocksource.getBlockMetadata());
    IProjectile projectile = getProjectileEntity(world, pos, itemstack);
    projectile.setThrowableHeading(face.getFrontOffsetX(), face.getFrontOffsetY() + getYVel(), face.getFrontOffsetZ(), getVelocity(), getDeviation());
    world.spawnEntityInWorld((Entity) projectile);
    itemstack.splitStack(1);
    return itemstack;
}
 
开发者ID:Archiving,项目名称:ARKCraft-Code,代码行数:13,代码来源:DispenseWeaponProjectile.java

示例8: dispenseStack

import net.minecraft.entity.IProjectile; //导入方法依赖的package包/类
/**
 * Dispense the specified stack, play the dispense sound and spawn particles.
 */
public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack)
{
    World var3 = par1IBlockSource.getWorld();
    IPosition var4 = BlockDispenser.func_149939_a(par1IBlockSource);
    EnumFacing var5 = BlockDispenser.func_149937_b(par1IBlockSource.getBlockMetadata());
    IProjectile var6 = this.getProjectileEntity(var3, var4);
    var6.setThrowableHeading((double)var5.getFrontOffsetX(), (double)((float)var5.getFrontOffsetY() + 0.1F), (double)var5.getFrontOffsetZ(), this.func_82500_b(), this.func_82498_a());
    var3.spawnEntityInWorld((Entity)var6);
    par2ItemStack.splitStack(1);
    return par2ItemStack;
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:15,代码来源:BehaviorProjectileDispense.java

示例9: dispenseStack

import net.minecraft.entity.IProjectile; //导入方法依赖的package包/类
/**
 * Dispense the specified stack, play the dispense sound and spawn particles.
 */
public ItemStack dispenseStack(IBlockSource source, ItemStack stack)
{
    World world = source.getWorld();
    IPosition iposition = BlockDispenser.getDispensePosition(source);
    EnumFacing enumfacing = (EnumFacing)source.func_189992_e().getValue(BlockDispenser.FACING);
    IProjectile iprojectile = this.getProjectileEntity(world, iposition, stack);
    iprojectile.setThrowableHeading((double)enumfacing.getFrontOffsetX(), (double)((float)enumfacing.getFrontOffsetY() + 0.1F), (double)enumfacing.getFrontOffsetZ(), this.getProjectileVelocity(), this.getProjectileInaccuracy());
    world.spawnEntityInWorld((Entity)iprojectile);
    stack.splitStack(1);
    return stack;
}
 
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:15,代码来源:BehaviorProjectileDispense.java

示例10: dispenseStack

import net.minecraft.entity.IProjectile; //导入方法依赖的package包/类
@Override
public ItemStack dispenseStack(IBlockSource blocksource, ItemStack itemstack)
{
	World world = blocksource.getWorld();
	IPosition pos = BlockDispenser.func_149939_a(blocksource);
	EnumFacing face = BlockDispenser.func_149937_b(blocksource.getBlockMetadata());
	IProjectile projectile = getProjectileEntity(world, pos, itemstack);
	projectile.setThrowableHeading(face.getFrontOffsetX(), face.getFrontOffsetY() + getYVel(), face.getFrontOffsetZ(), getVelocity(), getDeviation());
	world.spawnEntityInWorld((Entity) projectile);
	itemstack.splitStack(1);
	return itemstack;
}
 
开发者ID:Ckathode,项目名称:balkons-weaponmod,代码行数:13,代码来源:DispenseWeaponProjectile.java

示例11: dispenseStack

import net.minecraft.entity.IProjectile; //导入方法依赖的package包/类
public ItemStack dispenseStack(IBlockSource p_82487_1_, ItemStack p_82487_2_)
{
    World world = p_82487_1_.getWorld();
    IPosition iposition = BlockDispenser.func_149939_a(p_82487_1_);
    EnumFacing enumfacing = BlockDispenser.func_149937_b(p_82487_1_.getBlockMetadata());
    IProjectile iprojectile = this.getProjectileEntity(world, iposition);
    iprojectile.setThrowableHeading((double)enumfacing.getFrontOffsetX(), (double)((float)enumfacing.getFrontOffsetY() + 0.1F), (double)enumfacing.getFrontOffsetZ(), this.func_82500_b(), this.func_82498_a());
    world.spawnEntityInWorld((Entity)iprojectile);
    p_82487_2_.splitStack(1);
    return p_82487_2_;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:12,代码来源:BehaviorProjectileDispense.java

示例12: dispenseStack

import net.minecraft.entity.IProjectile; //导入方法依赖的package包/类
/**
 * Dispense the specified stack, play the dispense sound and spawn particles.
 */
public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack)
{
    World world = par1IBlockSource.getWorld();
    IPosition iposition = BlockDispenser.getIPositionFromBlockSource(par1IBlockSource);
    EnumFacing enumfacing = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata());
    IProjectile iprojectile = this.getProjectileEntity(world, iposition);
    iprojectile.setThrowableHeading((double)enumfacing.getFrontOffsetX(), (double)((float)enumfacing.getFrontOffsetY() + 0.1F), (double)enumfacing.getFrontOffsetZ(), this.func_82500_b(), this.func_82498_a());
    world.spawnEntityInWorld((Entity)iprojectile);
    par2ItemStack.splitStack(1);
    return par2ItemStack;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:15,代码来源:BehaviorProjectileDispense.java

示例13: dispenseStack

import net.minecraft.entity.IProjectile; //导入方法依赖的package包/类
/**
 * Dispense the specified stack, play the dispense sound and spawn particles.
 */
public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack)
{
    World world = par1IBlockSource.getWorld();
    IPosition iposition = BlockTrap.getIPositionFromBlockSource(par1IBlockSource);
    EnumFacing enumfacing = BlockTrap.getFacing(par1IBlockSource.getBlockMetadata());
    IProjectile iprojectile = this.getProjectileEntity(world, iposition);
    iprojectile.setThrowableHeading((double)enumfacing.getFrontOffsetX(), (double)((float)enumfacing.getFrontOffsetY() + 0.1F), (double)enumfacing.getFrontOffsetZ(), this.func_82500_b(), this.func_82498_a());
    world.spawnEntityInWorld((Entity)iprojectile);
    //playDispenseSound(par1IBlockSource);
    par2ItemStack.splitStack(1);
    return par2ItemStack;
}
 
开发者ID:Draco18s,项目名称:Artifacts,代码行数:16,代码来源:BehaviorProjectileDispense.java

示例14: dispenseStack

import net.minecraft.entity.IProjectile; //导入方法依赖的package包/类
public ItemStack dispenseStack(IBlockSource p_82487_1_, ItemStack p_82487_2_)
{
    World world = p_82487_1_.getWorld();
    IPosition iposition = BlockDispenser.func_149939_a(p_82487_1_);
    EnumFacing enumfacing = BlockDispenser.func_149937_b(p_82487_1_.getBlockMetadata());
    IProjectile iprojectile = this.getProjectileEntity(world, iposition);
    // CraftBukkit start
    ItemStack itemstack1 = p_82487_2_.splitStack(1);
    org.bukkit.block.Block block = world.getWorld().getBlockAt(p_82487_1_.getXInt(), p_82487_1_.getYInt(), p_82487_1_.getZInt());
    CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1);
    BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector((double) enumfacing.getFrontOffsetX(), (double)((float) enumfacing.getFrontOffsetY() + 0.1F), (double) enumfacing.getFrontOffsetZ()));

    if (!BlockDispenser.eventFired)
    {
        world.getServer().getPluginManager().callEvent(event);
    }

    if (event.isCancelled())
    {
        p_82487_2_.stackSize++;
        return p_82487_2_;
    }

    if (!event.getItem().equals(craftItem))
    {
        p_82487_2_.stackSize++;
        // Chain to handler for new item
        ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
        IBehaviorDispenseItem ibehaviordispenseitem = (IBehaviorDispenseItem) BlockDispenser.dispenseBehaviorRegistry.getObject(eventStack.getItem());

        if (ibehaviordispenseitem != IBehaviorDispenseItem.itemDispenseBehaviorProvider && ibehaviordispenseitem != this)
        {
            ibehaviordispenseitem.dispense(p_82487_1_, eventStack);
            return p_82487_2_;
        }
    }

    iprojectile.setThrowableHeading((double)enumfacing.getFrontOffsetX(), (double)((float)enumfacing.getFrontOffsetY() + 0.1F), (double)enumfacing.getFrontOffsetZ(), this.func_82500_b(), this.func_82498_a());
    ((Entity) iprojectile).projectileSource = new org.bukkit.craftbukkit.projectiles.CraftBlockProjectileSource((TileEntityDispenser) p_82487_1_.getBlockTileEntity());
    // CraftBukkit end
    world.spawnEntityInWorld((Entity)iprojectile);
    // p_82487_2_.splitStack(1); // CraftBukkit - Handled during event processing
    return p_82487_2_;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:45,代码来源:BehaviorProjectileDispense.java


注:本文中的net.minecraft.entity.IProjectile.setThrowableHeading方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。