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


Java BlockDispenser.getDispensePosition方法代码示例

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


在下文中一共展示了BlockDispenser.getDispensePosition方法的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 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

示例2: dispenseStack

import net.minecraft.block.BlockDispenser; //导入方法依赖的package包/类
/**
 * Dispense the specified stack, play the dispense sound and spawn particles.
 */
protected ItemStack dispenseStack(IBlockSource source, ItemStack stack)
{
    EnumFacing enumfacing = BlockDispenser.getFacing(source.getBlockMetadata());
    IPosition iposition = BlockDispenser.getDispensePosition(source);
    ItemStack itemstack = stack.splitStack(1);
    doDispense(source.getWorld(), itemstack, 6, enumfacing, iposition);
    return stack;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:BehaviorDefaultDispenseItem.java

示例3: dispenseStack

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

示例4: dispenseStack

import net.minecraft.block.BlockDispenser; //导入方法依赖的package包/类
/**
 * Dispense the specified stack, play the dispense sound and spawn particles.
 */
protected ItemStack dispenseStack(IBlockSource source, ItemStack stack)
{
    EnumFacing enumfacing = (EnumFacing)source.getBlockState().getValue(BlockDispenser.FACING);
    IPosition iposition = BlockDispenser.getDispensePosition(source);
    ItemStack itemstack = stack.splitStack(1);
    doDispense(source.getWorld(), itemstack, 6, enumfacing, iposition);
    return stack;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:12,代码来源:BehaviorDefaultDispenseItem.java

示例5: dispenseStack

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

示例6: dispense

import net.minecraft.block.BlockDispenser; //导入方法依赖的package包/类
protected void dispense(World worldIn, BlockPos pos)
{
    BlockSourceImpl blocksourceimpl = new BlockSourceImpl(worldIn, pos);
    TileEntityDispenser tileentitydispenser = (TileEntityDispenser)blocksourceimpl.getBlockTileEntity();

    if (tileentitydispenser != null)
    {
        int i = tileentitydispenser.getDispenseSlot();
        	
        if (i < 0)
        {
            worldIn.playAuxSFX(1001, pos, 0);
        }
        else
        {
            ItemStack itemstack = tileentitydispenser.getStackInSlot(i);
            IBehaviorDispenseItem ibehaviordispenseitem = this.getBehavior(itemstack);

            if (ibehaviordispenseitem != IBehaviorDispenseItem.itemDispenseBehaviorProvider)
            {
            	try{
            	    IPosition iposition = BlockDispenser.getDispensePosition(blocksourceimpl);
            	    BlockPos pos1 = new BlockPos(iposition.getX(), iposition.getY(), iposition.getZ());
            		Block block = Block.getBlockFromItem(itemstack.getItem());
            		if (worldIn.canBlockBePlaced(block,pos1,true,BlockPistonBase.getFacing(1),en,itemstack)){
            	ItemStack itemstack1 = this.dispenseStack(blocksourceimpl, itemstack, worldIn);
            	worldIn.playSoundEffect(iposition.getX(), iposition.getY(), iposition.getZ(), block.stepSound.getPlaceSound(), 1.0f, 1.0f);
                if (block.getStateFromMeta(itemstack1.getMetadata())==worldIn.getBlockState(pos1))tileentitydispenser.setInventorySlotContents(i, itemstack1.stackSize == 0 ? null : itemstack1);
            	    }}
            	    catch (Exception e) {}
            }
        }
    }
}
 
开发者ID:ORCHARD-Minecraft-Mod-Class,项目名称:RandomMine,代码行数:35,代码来源:BlockPlacer.java

示例7: dispenseStack

import net.minecraft.block.BlockDispenser; //导入方法依赖的package包/类
protected ItemStack dispenseStack(IBlockSource source, ItemStack stack,World worldIn)
{ 
	try{
    IPosition iposition = BlockDispenser.getDispensePosition(source);
    ItemStack itemstack1 = stack.splitStack(1);
    BlockPos pos = new BlockPos(iposition.getX(), iposition.getY(), iposition.getZ());
	Block block;
	block = Block.getBlockFromItem(itemstack1.getItem());
    if( worldIn.canBlockBePlaced(block,pos,true,BlockPistonBase.getFacing(1),en,itemstack1)){
    worldIn.setBlockState(pos, block.getStateFromMeta(itemstack1.getMetadata()));
    }}
	catch (Exception e) {return stack;}

    return stack;
}
 
开发者ID:ORCHARD-Minecraft-Mod-Class,项目名称:RandomMine,代码行数:16,代码来源:BlockPlacer.java

示例8: spawnDispenseParticles

import net.minecraft.block.BlockDispenser; //导入方法依赖的package包/类
@Override
protected void spawnDispenseParticles(IBlockSource blocksource, EnumFacing face)
{
	super.spawnDispenseParticles(blocksource, face);
	IPosition pos = BlockDispenser.getDispensePosition(blocksource);
	blocksource.getWorld().spawnParticle(EnumParticleTypes.FLAME,
			pos.getX() + face.getFrontOffsetX(), pos.getY() + face.getFrontOffsetY(),
			pos.getZ() + face.getFrontOffsetZ(), 0.0D, 0.2D, 0.0D);
}
 
开发者ID:Archiving,项目名称:ARKCraft-Code,代码行数:10,代码来源:DispenseRocketPropelledGrenade.java

示例9: spawnDispenseParticles

import net.minecraft.block.BlockDispenser; //导入方法依赖的package包/类
@Override
protected void spawnDispenseParticles(IBlockSource blocksource, EnumFacing face)
{
    super.spawnDispenseParticles(blocksource, face);
    IPosition pos = BlockDispenser.getDispensePosition(blocksource);
    blocksource.getWorld().spawnParticle(EnumParticleTypes.FLAME, pos.getX() + face.getFrontOffsetX(), pos.getY() + face.getFrontOffsetY(), pos.getZ() + face.getFrontOffsetZ(), 0.0D, 0.2D, 0.0D);
}
 
开发者ID:Archiving,项目名称:ARKCraft-Code,代码行数:8,代码来源:DispenseSimpleRifleAmmo.java

示例10: dispenseStack

import net.minecraft.block.BlockDispenser; //导入方法依赖的package包/类
@Override
public ItemStack dispenseStack(IBlockSource blocksource, ItemStack itemstack)
{
    EnumFacing face = EnumFacing.getFront(blocksource.getBlockMetadata());

    IPosition pos = BlockDispenser.getDispensePosition(blocksource);
    EntitySimpleShotgunAmmo.fireFromDispenser(blocksource.getWorld(), pos.getX() + face.getFrontOffsetX(), pos.getY() + face.getFrontOffsetY(), pos.getZ() + face.getFrontOffsetZ(), face.getFrontOffsetX(), face.getFrontOffsetY(), face.getFrontOffsetZ());
    itemstack.splitStack(1);
    return itemstack;
}
 
开发者ID:Archiving,项目名称:ARKCraft-Code,代码行数:11,代码来源:DispenseSimpleShotgunAmmo.java

示例11: spawnDispenseParticles

import net.minecraft.block.BlockDispenser; //导入方法依赖的package包/类
@Override
protected void spawnDispenseParticles(IBlockSource blocksource, EnumFacing face)
{
    super.spawnDispenseParticles(blocksource, face);
    IPosition pos = BlockDispenser.getDispensePosition(blocksource);
    blocksource.getWorld().spawnParticle(EnumParticleTypes.FLAME, pos.getX() + face.getFrontOffsetX(), pos.getY() + face.getFrontOffsetY(), pos.getZ() + face.getFrontOffsetZ(), 0.0D, 0.0D, 0.0D);
}
 
开发者ID:Archiving,项目名称:ARKCraft-Code,代码行数:8,代码来源:DispenseSimpleShotgunAmmo.java

示例12: dispenseStack

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

示例13: spawnDispenseParticles

import net.minecraft.block.BlockDispenser; //导入方法依赖的package包/类
@Override
protected void spawnDispenseParticles(IBlockSource blocksource, EnumFacing face)
{
	super.spawnDispenseParticles(blocksource, face);
	if (!normalDispense)
	{
		IPosition pos = BlockDispenser.getDispensePosition(blocksource);
		blocksource.getWorld().spawnParticle(EnumParticleTypes.FLAME,
				pos.getX() + face.getFrontOffsetX(), pos.getY(),
				pos.getZ() + face.getFrontOffsetZ(), 0.0D, 0.0D, 0.0D);
	}
}
 
开发者ID:Archiving,项目名称:ARKCraft-Code,代码行数:13,代码来源:DispenseBallistaBolt.java

示例14: dispenseStack

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

示例15: dispenseStack

import net.minecraft.block.BlockDispenser; //导入方法依赖的package包/类
/**
 * Dispense the specified stack, play the dispense sound and spawn particles.
 */
protected ItemStack dispenseStack(IBlockSource source, ItemStack stack)
{
    EnumFacing enumfacing = (EnumFacing)source.func_189992_e().getValue(BlockDispenser.FACING);
    IPosition iposition = BlockDispenser.getDispensePosition(source);
    ItemStack itemstack = stack.splitStack(1);
    doDispense(source.getWorld(), itemstack, 6, enumfacing, iposition);
    return stack;
}
 
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:12,代码来源:BehaviorDefaultDispenseItem.java


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