本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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_;
}
示例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;
}
示例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;
}
示例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_;
}