當前位置: 首頁>>代碼示例>>Java>>正文


Java BlockDispenser.getIPositionFromBlockSource方法代碼示例

本文整理匯總了Java中net.minecraft.block.BlockDispenser.getIPositionFromBlockSource方法的典型用法代碼示例。如果您正苦於以下問題:Java BlockDispenser.getIPositionFromBlockSource方法的具體用法?Java BlockDispenser.getIPositionFromBlockSource怎麽用?Java BlockDispenser.getIPositionFromBlockSource使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.block.BlockDispenser的用法示例。


在下文中一共展示了BlockDispenser.getIPositionFromBlockSource方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: dispenseStack

import net.minecraft.block.BlockDispenser; //導入方法依賴的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

示例2: dispenseStack

import net.minecraft.block.BlockDispenser; //導入方法依賴的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

示例3: dispenseStack

import net.minecraft.block.BlockDispenser; //導入方法依賴的package包/類
/**
 * Dispense the specified stack, play the dispense sound and spawn particles.
 */
public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack)
{
    EnumFacing enumfacing = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata());
    IPosition iposition = BlockDispenser.getIPositionFromBlockSource(par1IBlockSource);
    double d0 = iposition.getX() + (double)((float)enumfacing.getFrontOffsetX() * 0.3F);
    double d1 = iposition.getY() + (double)((float)enumfacing.getFrontOffsetX() * 0.3F);
    double d2 = iposition.getZ() + (double)((float)enumfacing.getFrontOffsetZ() * 0.3F);
    World world = par1IBlockSource.getWorld();
    Random random = world.rand;
    double d3 = random.nextGaussian() * 0.05D + (double)enumfacing.getFrontOffsetX();
    double d4 = random.nextGaussian() * 0.05D + (double)enumfacing.getFrontOffsetY();
    double d5 = random.nextGaussian() * 0.05D + (double)enumfacing.getFrontOffsetZ();
    world.spawnEntityInWorld(new EntitySmallFireball(world, d0, d1, d2, d3, d4, d5));
    par2ItemStack.splitStack(1);
    return par2ItemStack;
}
 
開發者ID:HATB0T,項目名稱:RuneCraftery,代碼行數:20,代碼來源:DispenserBehaviorFireball.java

示例4: dispenseStack

import net.minecraft.block.BlockDispenser; //導入方法依賴的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

示例5: dispenseStack

import net.minecraft.block.BlockDispenser; //導入方法依賴的package包/類
/**
 * Dispense the specified stack, play the dispense sound and spawn particles.
 */
protected ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack)
{
    EnumFacing enumfacing = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata());
    IPosition iposition = BlockDispenser.getIPositionFromBlockSource(par1IBlockSource);
    ItemStack itemstack1 = par2ItemStack.splitStack(1);
    doDispense(par1IBlockSource.getWorld(), itemstack1, 6, enumfacing, iposition);
    return par2ItemStack;
}
 
開發者ID:HATB0T,項目名稱:RuneCraftery,代碼行數:12,代碼來源:BehaviorDefaultDispenseItem.java


注:本文中的net.minecraft.block.BlockDispenser.getIPositionFromBlockSource方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。