本文整理汇总了Java中net.minecraft.block.BlockDispenser.func_149937_b方法的典型用法代码示例。如果您正苦于以下问题:Java BlockDispenser.func_149937_b方法的具体用法?Java BlockDispenser.func_149937_b怎么用?Java BlockDispenser.func_149937_b使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.block.BlockDispenser
的用法示例。
在下文中一共展示了BlockDispenser.func_149937_b方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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.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.block.BlockDispenser; //导入方法依赖的package包/类
protected ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack)
{
EnumFacing enumfacing = BlockDispenser.func_149937_b(par1IBlockSource.getBlockMetadata());
World world = par1IBlockSource.getWorld();
int i = par1IBlockSource.getXInt() + enumfacing.getFrontOffsetX();
int j = par1IBlockSource.getYInt() + enumfacing.getFrontOffsetY();
int k = par1IBlockSource.getZInt() + enumfacing.getFrontOffsetZ();
if (par2ItemStack.hasTagCompound() && par2ItemStack.stackTagCompound.hasKey("ownerName")) {
EntitySoulFragment soul = new EntitySoulFragment(world);
soul.setPlayerName(par2ItemStack.stackTagCompound.getString("ownerName"));
soul.setLocationAndAngles(i,j,k,0,0);
world.spawnEntityInWorld(soul);
System.err.println(soul);
System.err.println(soul.playerName);
}
return par2ItemStack;
}
示例3: dispenseStack
import net.minecraft.block.BlockDispenser; //导入方法依赖的package包/类
public ItemStack dispenseStack(IBlockSource blockSource, ItemStack stack) {
if (NBTHelper.hasTag(stack, "identifier")) {
World world = blockSource.getWorld();
IPosition iposition = BlockDispenser.func_149939_a(blockSource);
EnumFacing enumfacing = BlockDispenser.func_149937_b(blockSource.getBlockMetadata());
EntityNanoBotSwarm iprojectile = new EntityNanoBotSwarm(world, iposition.getX(), iposition.getY(), iposition.getZ());
iprojectile.antennaIdentifier = UUID.fromString(NBTHelper.getString(stack, "identifier"));
if (NBTHelper.hasTag(stack, "label"))
iprojectile.label = NBTHelper.getString(stack, "label");
iprojectile.setThrowableHeading((double) enumfacing.getFrontOffsetX(), (double) ((float) enumfacing.getFrontOffsetY()+0.1F), (double) enumfacing.getFrontOffsetZ(), this.func_82500_b(), this.func_82498_a());
world.spawnEntityInWorld(iprojectile);
stack.splitStack(1);
} else {
return super.dispenseStack(blockSource, stack);
}
return stack;
}
示例4: dispenseStack
import net.minecraft.block.BlockDispenser; //导入方法依赖的package包/类
@Override
public ItemStack dispenseStack(IBlockSource block, ItemStack stack) {
EnumFacing enumfacing = BlockDispenser.func_149937_b(block.getBlockMetadata());
double d0 = block.getX() + enumfacing.getFrontOffsetX();
double d1 = block.getYInt() + 0.2F;
double d2 = block.getZ() + enumfacing.getFrontOffsetZ();
Entity entity = ItemEntityEgg.spawnEntity(block.getWorld(), stack.getItemDamage(), d0, d1, d2);
if (entity instanceof EntityLivingBase && stack.hasDisplayName())
((EntityLiving) entity).setCustomNameTag(stack.getDisplayName());
stack.splitStack(1);
return stack;
}
示例5: dispenseStack
import net.minecraft.block.BlockDispenser; //导入方法依赖的package包/类
public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack)
{
EnumFacing var3 = BlockDispenser.func_149937_b(par1IBlockSource.getBlockMetadata());
World var4 = par1IBlockSource.getWorld();
double var5 = par1IBlockSource.getX() + (double)((float)var3.getFrontOffsetX() * 1.125F);
double var7 = par1IBlockSource.getY() + (double)((float)var3.getFrontOffsetY() * 1.125F);
double var9 = par1IBlockSource.getZ() + (double)((float)var3.getFrontOffsetZ() * 1.125F);
int var11 = par1IBlockSource.getXInt() + var3.getFrontOffsetX();
int var12 = par1IBlockSource.getYInt() + var3.getFrontOffsetY();
int var13 = par1IBlockSource.getZInt() + var3.getFrontOffsetZ();
Block var14 = var4.getBlock(var11, var12, var13);
double var15;
if (BlockRailBase.func_150051_a(var14))
{
var15 = 0.0D;
}
else
{
if (var14.getMaterial() != Material.air || !BlockRailBase.func_150051_a(var4.getBlock(var11, var12 - 1, var13)))
{
return this.behaviourDefaultDispenseItem.dispense(par1IBlockSource, par2ItemStack);
}
var15 = -1.0D;
}
EntityMinecart var17 = EntityMinecart.createMinecart(var4, var5, var7 + var15, var9, ((ItemMinecart)par2ItemStack.getItem()).minecartType);
if (par2ItemStack.hasDisplayName())
{
var17.setMinecartName(par2ItemStack.getDisplayName());
}
var4.spawnEntityInWorld(var17);
par2ItemStack.splitStack(1);
return par2ItemStack;
}
示例6: 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 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
示例7: 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 var3 = BlockDispenser.func_149937_b(par1IBlockSource.getBlockMetadata());
IPosition var4 = BlockDispenser.func_149939_a(par1IBlockSource);
ItemStack var5 = par2ItemStack.splitStack(1);
doDispense(par1IBlockSource.getWorld(), var5, 6, var3, var4);
return par2ItemStack;
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:12,代码来源:BehaviorDefaultDispenseItem.java
示例8: dispenseStack
import net.minecraft.block.BlockDispenser; //导入方法依赖的package包/类
@Override
public ItemStack dispenseStack(IBlockSource blockSource, ItemStack itemStack) {
if (itemStack.getItemDamage() > GelsPlus.proxy.getRegistry().getRegistry().size())
return this.defaultBehavior.dispense(blockSource, itemStack);
World worldObj = blockSource.getWorld();
EnumFacing face = BlockDispenser.func_149937_b(blockSource.getBlockMetadata());
int xCoord = blockSource.getXInt(), yCoord = blockSource.getYInt(), zCoord = blockSource.getZInt(), gelType = itemStack.getItemDamage();
if (itemStack.getItem() instanceof ItemGelBlob) {
if (TileDispenser.fireGel(worldObj, xCoord, yCoord, zCoord, face.ordinal(), gelType, false))
itemStack.stackSize--;
}
return itemStack;
}
示例9: dispenseStack
import net.minecraft.block.BlockDispenser; //导入方法依赖的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;
}
示例10: dispenseStack
import net.minecraft.block.BlockDispenser; //导入方法依赖的package包/类
public ItemStack dispenseStack(IBlockSource p_82487_1_, ItemStack p_82487_2_)
{
EnumFacing enumfacing = BlockDispenser.func_149937_b(p_82487_1_.getBlockMetadata());
World world = p_82487_1_.getWorld();
double d0 = p_82487_1_.getX() + (double)((float)enumfacing.getFrontOffsetX() * 1.125F);
double d1 = p_82487_1_.getY() + (double)((float)enumfacing.getFrontOffsetY() * 1.125F);
double d2 = p_82487_1_.getZ() + (double)((float)enumfacing.getFrontOffsetZ() * 1.125F);
int i = p_82487_1_.getXInt() + enumfacing.getFrontOffsetX();
int j = p_82487_1_.getYInt() + enumfacing.getFrontOffsetY();
int k = p_82487_1_.getZInt() + enumfacing.getFrontOffsetZ();
Block block = world.getBlock(i, j, k);
double d3;
if (BlockRailBase.func_150051_a(block))
{
d3 = 0.0D;
}
else
{
if (block.getMaterial() != Material.air || !BlockRailBase.func_150051_a(world.getBlock(i, j - 1, k)))
{
return this.behaviourDefaultDispenseItem.dispense(p_82487_1_, p_82487_2_);
}
d3 = -1.0D;
}
EntityMinecart entityminecart = EntityMinecart.createMinecart(world, d0, d1 + d3, d2, ((ItemMinecart)p_82487_2_.getItem()).minecartType);
if (p_82487_2_.hasDisplayName())
{
entityminecart.setMinecartName(p_82487_2_.getDisplayName());
}
world.spawnEntityInWorld(entityminecart);
p_82487_2_.splitStack(1);
return p_82487_2_;
}
示例11: dispenseStack
import net.minecraft.block.BlockDispenser; //导入方法依赖的package包/类
protected ItemStack dispenseStack(IBlockSource p_82487_1_, ItemStack p_82487_2_)
{
EnumFacing enumfacing = BlockDispenser.func_149937_b(p_82487_1_.getBlockMetadata());
IPosition iposition = BlockDispenser.func_149939_a(p_82487_1_);
ItemStack itemstack1 = p_82487_2_.splitStack(1);
// CraftBukkit start
if (!doDispense(p_82487_1_.getWorld(), itemstack1, 6, enumfacing, p_82487_1_))
{
p_82487_2_.stackSize++;
}
// CraftBukkit end
return p_82487_2_;
}
示例12: dispenseStack
import net.minecraft.block.BlockDispenser; //导入方法依赖的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_;
}
示例13: dispenseStack
import net.minecraft.block.BlockDispenser; //导入方法依赖的package包/类
protected ItemStack dispenseStack(IBlockSource p_82487_1_, ItemStack p_82487_2_)
{
EnumFacing enumfacing = BlockDispenser.func_149937_b(p_82487_1_.getBlockMetadata());
IPosition iposition = BlockDispenser.func_149939_a(p_82487_1_);
ItemStack itemstack1 = p_82487_2_.splitStack(1);
doDispense(p_82487_1_.getWorld(), itemstack1, 6, enumfacing, iposition);
return p_82487_2_;
}
示例14: 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.func_149937_b(par1IBlockSource.getBlockMetadata());
World world = par1IBlockSource.getWorld();
double d0 = par1IBlockSource.getX() + (double)((float)enumfacing.getFrontOffsetX() * 1.125F);
double d1 = par1IBlockSource.getY() + (double)((float)enumfacing.getFrontOffsetY() * 1.125F);
double d2 = par1IBlockSource.getZ() + (double)((float)enumfacing.getFrontOffsetZ() * 1.125F);
int i = par1IBlockSource.getXInt() + enumfacing.getFrontOffsetX();
int j = par1IBlockSource.getYInt() + enumfacing.getFrontOffsetY();
int k = par1IBlockSource.getZInt() + enumfacing.getFrontOffsetZ();
Block block = world.getBlock(i, j, k);
double d3;
if (BlockRailBase.func_150051_a(block))
{
d3 = 0.0D;
}
else
{
if (block.getMaterial() != Material.air || !BlockRailBase.func_150051_a(world.getBlock(i, j - 1, k)))
{
return this.behaviourDefaultDispenseItem.dispense(par1IBlockSource, par2ItemStack);
}
d3 = -1.0D;
}
EntitySpeedyChestcart entityminecart = (EntitySpeedyChestcart) EntitySpeedyChestcart.createMinecart(world, d0, d1 + d3, d2, ((ItemSpeedyChestcart)par2ItemStack.getItem()).minecartType);
if (par2ItemStack.hasDisplayName())
{
entityminecart.setMinecartName(par2ItemStack.getDisplayName());
}
world.spawnEntityInWorld(entityminecart);
par2ItemStack.splitStack(1);
return par2ItemStack;
}
示例15: 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.func_149937_b(par1IBlockSource.getBlockMetadata());
World world = par1IBlockSource.getWorld();
double d0 = par1IBlockSource.getX() + (double)((float)enumfacing.getFrontOffsetX() * 1.125F);
double d1 = par1IBlockSource.getY() + (double)((float)enumfacing.getFrontOffsetY() * 1.125F);
double d2 = par1IBlockSource.getZ() + (double)((float)enumfacing.getFrontOffsetZ() * 1.125F);
int i = par1IBlockSource.getXInt() + enumfacing.getFrontOffsetX();
int j = par1IBlockSource.getYInt() + enumfacing.getFrontOffsetY();
int k = par1IBlockSource.getZInt() + enumfacing.getFrontOffsetZ();
Block block = world.getBlock(i, j, k);
double d3;
if (BlockRailBase.func_150051_a(block))
{
d3 = 0.0D;
}
else
{
if (block.getMaterial() != Material.air || !BlockRailBase.func_150051_a(world.getBlock(i, j - 1, k)))
{
return this.behaviourDefaultDispenseItem.dispense(par1IBlockSource, par2ItemStack);
}
d3 = -1.0D;
}
EntitySpeedyMinecart entityminecart = (EntitySpeedyMinecart) EntitySpeedyMinecart.createMinecart(world, d0, d1 + d3, d2, ((ItemSpeedyTankCart)par2ItemStack.getItem()).minecartType);
if (par2ItemStack.hasDisplayName())
{
entityminecart.setMinecartName(par2ItemStack.getDisplayName());
}
world.spawnEntityInWorld(entityminecart);
par2ItemStack.splitStack(1);
return par2ItemStack;
}