• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IBlockSource类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.minecraft.dispenser.IBlockSource的典型用法代码示例。如果您正苦于以下问题:Java IBlockSource类的具体用法?Java IBlockSource怎么用?Java IBlockSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IBlockSource类属于net.minecraft.dispenser包,在下文中一共展示了IBlockSource类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: dispense

import net.minecraft.dispenser.IBlockSource; //导入依赖的package包/类
@Override
public ItemStack dispense(IBlockSource block, final ItemStack stack) {
	return new BehaviorProjectileDispense() {

		@Override
		protected IProjectile getProjectileEntity(World world, IPosition pos) {
			return new EntityLingeringPotion(world, pos.getX(), pos.getY(), pos.getZ(), stack.copy());
		}

		@Override
		protected float func_82498_a() {
			return super.func_82498_a() * 0.5F;
		}

		@Override
		protected float func_82500_b() {
			return super.func_82500_b() * 1.25F;
		}
	}.dispense(block, stack);
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:21,代码来源:DispenserBehaviourLingeringPotion.java


示例2: dispenseArmor

import net.minecraft.dispenser.IBlockSource; //导入依赖的package包/类
public static ItemStack dispenseArmor(IBlockSource blockSource, ItemStack stack)
{
    BlockPos blockpos = blockSource.getBlockPos().offset((EnumFacing)blockSource.getBlockState().getValue(BlockDispenser.FACING));
    List<EntityLivingBase> list = blockSource.getWorld().<EntityLivingBase>getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(blockpos), Predicates.<EntityLivingBase> and (EntitySelectors.NOT_SPECTATING, new EntitySelectors.ArmoredMob(stack)));

    if (list.isEmpty())
    {
        return ItemStack.field_190927_a;
    }
    else
    {
        EntityLivingBase entitylivingbase = (EntityLivingBase)list.get(0);
        EntityEquipmentSlot entityequipmentslot = EntityLiving.getSlotForItemStack(stack);
        ItemStack itemstack = stack.splitStack(1);
        entitylivingbase.setItemStackToSlot(entityequipmentslot, itemstack);

        if (entitylivingbase instanceof EntityLiving)
        {
            ((EntityLiving)entitylivingbase).setDropChance(entityequipmentslot, 2.0F);
        }

        return stack;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:ItemArmor.java


示例3: fillContainer

import net.minecraft.dispenser.IBlockSource; //导入依赖的package包/类
/**
 * Picks up fluid in front of a Dispenser and fills a container with it.
 */
private ItemStack fillContainer(IBlockSource source, ItemStack stack)
{
    World world = source.getWorld();
    EnumFacing dispenserFacing = source.getBlockState().getValue(BlockDispenser.FACING);
    BlockPos blockpos = source.getBlockPos().offset(dispenserFacing);

    ItemStack result = FluidUtil.tryPickUpFluid(stack, null, world, blockpos, dispenserFacing.getOpposite());
    if (result == null)
    {
        return super.dispenseStack(source, stack);
    }

    if (--stack.stackSize == 0)
    {
        stack.deserializeNBT(result.serializeNBT());
    }
    else if (((TileEntityDispenser)source.getBlockTileEntity()).addItemStack(result) < 0)
    {
        this.dispenseBehavior.dispense(source, result);
    }

    return stack;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:27,代码来源:DispenseFluidContainer.java


示例4: dispenseArmor

import net.minecraft.dispenser.IBlockSource; //导入依赖的package包/类
public static ItemStack dispenseArmor(IBlockSource blockSource, ItemStack stack)
{
    BlockPos blockpos = blockSource.getBlockPos().offset((EnumFacing)blockSource.getBlockState().getValue(BlockDispenser.FACING));
    List<EntityLivingBase> list = blockSource.getWorld().<EntityLivingBase>getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(blockpos), Predicates.<EntityLivingBase>and(EntitySelectors.NOT_SPECTATING, new EntitySelectors.ArmoredMob(stack)));

    if (list.isEmpty())
    {
        return null;
    }
    else
    {
        EntityLivingBase entitylivingbase = (EntityLivingBase)list.get(0);
        EntityEquipmentSlot entityequipmentslot = EntityLiving.getSlotForItemStack(stack);
        ItemStack itemstack = stack.copy();
        itemstack.stackSize = 1;
        entitylivingbase.setItemStackToSlot(entityequipmentslot, itemstack);

        if (entitylivingbase instanceof EntityLiving)
        {
            ((EntityLiving)entitylivingbase).setDropChance(entityequipmentslot, 2.0F);
        }

        --stack.stackSize;
        return stack;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:27,代码来源:ItemArmor.java


示例5: dispenseStack

import net.minecraft.dispenser.IBlockSource; //导入依赖的package包/类
@Override
public ItemStack dispenseStack(IBlockSource source, ItemStack stack) {
       World world = source.getWorld();
       BlockPos pos = source.getBlockPos();
       Vec3d pos2 = new Vec3d(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
       Vec3d dir = this.getNearestTargetDirection(world, pos);
       if(dir == null) return null;
       IPosition ipos = new PositionImpl(pos2.x + dir.x * .75, pos2.y + dir.y * .75, pos2.z + dir.z * .75);
          double d0 = ipos.getX();
          double d1 = ipos.getY();
          double d2 = ipos.getZ();
          Random random = world.rand;
          double d3 = random.nextGaussian() * 0.05D + dir.x;
          double d4 = random.nextGaussian() * 0.05D + dir.y;
          double d5 = random.nextGaussian() * 0.05D + dir.z;
          world.spawnEntity(new EntitySmallFireball(world, d0, d1, d2, d3, d4, d5));
          stack.splitStack(1);
          return stack;
}
 
开发者ID:sblectric,项目名称:AdvancedCombat,代码行数:20,代码来源:TrackingDispenserBehavior.java


示例6: dispenseStack

import net.minecraft.dispenser.IBlockSource; //导入依赖的package包/类
public ItemStack dispenseStack(IBlockSource dispenser, ItemStack cartItemStack)
{
	EntityMinecartBase entityMinecartBase;
	World world = dispenser.getWorld();
	boolean cartSpawned = false;
	if(ItemStackUtils.isItemInstanceOf(cartItemStack, ItemMinecartBase.class))
	{
		ItemMinecartBase itemMinecartBase = (ItemMinecartBase)cartItemStack.getItem();
		entityMinecartBase = itemMinecartBase.getEntityFromItem(world, cartItemStack);

		if(entityMinecartBase != null)
		{
			EnumFacing enumfacing = BlockDispenser.getFacing(dispenser.getBlockMetadata());
			BlockPos blockpos = dispenser.getBlockPos().offset(enumfacing);
			cartSpawned = itemMinecartBase.placeCart(cartItemStack, world, blockpos, entityMinecartBase);
		}
	}

	if(!cartSpawned)
	{
		cartItemStack = super.dispenseStack(dispenser, cartItemStack);
	}

	return cartItemStack;
}
 
开发者ID:BrassGoggledCoders,项目名称:MoarCarts,代码行数:26,代码来源:CartDispenserBehavior.java


示例7: dispenseStack

import net.minecraft.dispenser.IBlockSource; //导入依赖的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


示例8: dispenseStack

import net.minecraft.dispenser.IBlockSource; //导入依赖的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


示例9: dispenseStack

import net.minecraft.dispenser.IBlockSource; //导入依赖的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


示例10: dispenseStack

import net.minecraft.dispenser.IBlockSource; //导入依赖的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;
}
 
开发者ID:MagiciansArtificeTeam,项目名称:Magicians-Artifice,代码行数:20,代码来源:DispenserSoulBehavior.java


示例11: dispenseStack

import net.minecraft.dispenser.IBlockSource; //导入依赖的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;
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:18,代码来源:ItemNanoSwarm.java


示例12: dispenseArmor

import net.minecraft.dispenser.IBlockSource; //导入依赖的package包/类
public static ItemStack dispenseArmor(IBlockSource blockSource, ItemStack stack)
{
    BlockPos blockpos = blockSource.getBlockPos().offset((EnumFacing)blockSource.func_189992_e().getValue(BlockDispenser.FACING));
    List<EntityLivingBase> list = blockSource.getWorld().<EntityLivingBase>getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(blockpos), Predicates.<EntityLivingBase>and(EntitySelectors.NOT_SPECTATING, new EntitySelectors.ArmoredMob(stack)));

    if (list.isEmpty())
    {
        return null;
    }
    else
    {
        EntityLivingBase entitylivingbase = (EntityLivingBase)list.get(0);
        EntityEquipmentSlot entityequipmentslot = EntityLiving.getSlotForItemStack(stack);
        ItemStack itemstack = stack.copy();
        itemstack.stackSize = 1;
        entitylivingbase.setItemStackToSlot(entityequipmentslot, itemstack);

        if (entitylivingbase instanceof EntityLiving)
        {
            ((EntityLiving)entitylivingbase).setDropChance(entityequipmentslot, 2.0F);
        }

        --stack.stackSize;
        return stack;
    }
}
 
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:27,代码来源:ItemArmor.java


示例13: func_82487_b

import net.minecraft.dispenser.IBlockSource; //导入依赖的package包/类
protected ItemStack func_82487_b(IBlockSource p_82487_1_, ItemStack p_82487_2_) {
   EnumFacing var3 = BlockDispenser.func_100009_j_(p_82487_1_.func_82620_h());
   int var4 = p_82487_1_.func_82623_d() + var3.func_82601_c();
   int var5 = p_82487_1_.func_82622_e() + var3.func_96559_d();
   int var6 = p_82487_1_.func_82621_f() + var3.func_82599_e();
   AxisAlignedBB var7 = AxisAlignedBB.func_72332_a().func_72299_a((double)var4, (double)var5, (double)var6, (double)(var4 + 1), (double)(var5 + 1), (double)(var6 + 1));
   List var8 = p_82487_1_.func_82618_k().func_82733_a(EntityLivingBase.class, var7, new EntitySelectorArmoredMob(p_82487_2_));
   if(var8.size() > 0) {
      EntityLivingBase var9 = (EntityLivingBase)var8.get(0);
      int var10 = var9 instanceof EntityPlayer?1:0;
      int var11 = EntityLiving.func_82159_b(p_82487_2_);
      ItemStack var12 = p_82487_2_.func_77946_l();
      var12.field_77994_a = 1;
      var9.func_70062_b(var11 - var10, var12);
      if(var9 instanceof EntityLiving) {
         ((EntityLiving)var9).func_96120_a(var11, 2.0F);
      }

      --p_82487_2_.field_77994_a;
      return p_82487_2_;
   } else {
      return super.func_82487_b(p_82487_1_, p_82487_2_);
   }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:25,代码来源:BehaviorDispenseArmor.java


示例14: func_82487_b

import net.minecraft.dispenser.IBlockSource; //导入依赖的package包/类
protected ItemStack func_82487_b(IBlockSource p_82487_1_, ItemStack p_82487_2_) {
   if(p_82487_2_.func_77960_j() == 15) {
      EnumFacing var3 = BlockDispenser.func_100009_j_(p_82487_1_.func_82620_h());
      World var4 = p_82487_1_.func_82618_k();
      int var5 = p_82487_1_.func_82623_d() + var3.func_82601_c();
      int var6 = p_82487_1_.func_82622_e() + var3.func_96559_d();
      int var7 = p_82487_1_.func_82621_f() + var3.func_82599_e();
      if(ItemDye.func_96604_a(p_82487_2_, var4, var5, var6, var7)) {
         if(!var4.field_72995_K) {
            var4.func_72926_e(2005, var5, var6, var7, 0);
         }
      } else {
         this.field_96461_b = false;
      }

      return p_82487_2_;
   } else {
      return super.func_82487_b(p_82487_1_, p_82487_2_);
   }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:21,代码来源:DispenserBehaviorDye.java


示例15: func_82487_b

import net.minecraft.dispenser.IBlockSource; //导入依赖的package包/类
public ItemStack func_82487_b(IBlockSource p_82487_1_, ItemStack p_82487_2_) {
   EnumFacing var3 = BlockDispenser.func_100009_j_(p_82487_1_.func_82620_h());
   World var4 = p_82487_1_.func_82618_k();
   double var5 = p_82487_1_.func_82615_a() + (double)((float)var3.func_82601_c() * 1.125F);
   double var7 = p_82487_1_.func_82617_b() + (double)((float)var3.func_96559_d() * 1.125F);
   double var9 = p_82487_1_.func_82616_c() + (double)((float)var3.func_82599_e() * 1.125F);
   int var11 = p_82487_1_.func_82623_d() + var3.func_82601_c();
   int var12 = p_82487_1_.func_82622_e() + var3.func_96559_d();
   int var13 = p_82487_1_.func_82621_f() + var3.func_82599_e();
   Material var14 = var4.func_72803_f(var11, var12, var13);
   double var15;
   if(Material.field_76244_g.equals(var14)) {
      var15 = 1.0D;
   } else {
      if(!Material.field_76249_a.equals(var14) || !Material.field_76244_g.equals(var4.func_72803_f(var11, var12 - 1, var13))) {
         return this.field_96464_b.func_82482_a(p_82487_1_, p_82487_2_);
      }

      var15 = 0.0D;
   }

   EntityBoat var17 = new EntityBoat(var4, var5, var7 + var15, var9);
   var4.func_72838_d(var17);
   p_82487_2_.func_77979_a(1);
   return p_82487_2_;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:27,代码来源:DispenserBehaviorBoat.java


示例16: func_82487_b

import net.minecraft.dispenser.IBlockSource; //导入依赖的package包/类
protected ItemStack func_82487_b(IBlockSource p_82487_1_, ItemStack p_82487_2_) {
   EnumFacing var3 = BlockDispenser.func_100009_j_(p_82487_1_.func_82620_h());
   World var4 = p_82487_1_.func_82618_k();
   int var5 = p_82487_1_.func_82623_d() + var3.func_82601_c();
   int var6 = p_82487_1_.func_82622_e() + var3.func_96559_d();
   int var7 = p_82487_1_.func_82621_f() + var3.func_82599_e();
   if(var4.func_72799_c(var5, var6, var7)) {
      var4.func_94575_c(var5, var6, var7, Block.field_72067_ar.field_71990_ca);
      if(p_82487_2_.func_96631_a(1, var4.field_73012_v)) {
         p_82487_2_.field_77994_a = 0;
      }
   } else if(var4.func_72798_a(var5, var6, var7) == Block.field_72091_am.field_71990_ca) {
      Block.field_72091_am.func_71898_d(var4, var5, var6, var7, 1);
      var4.func_94571_i(var5, var6, var7);
   } else {
      this.field_96466_b = false;
   }

   return p_82487_2_;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:21,代码来源:DispenserBehaviorFire.java


示例17: ItemSpellPage

import net.minecraft.dispenser.IBlockSource; //导入依赖的package包/类
public ItemSpellPage(String id) {
	super(id);
	this.setMaxStackSize(1);
	this.setHasSubtypes(true);

	BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(this, new IBehaviorDispenseItem() {

		@Override
		public ItemStack dispense(IBlockSource source, ItemStack stack) {
			Spell s = ItemSpellPage.getSpellFromItemStack(stack);
			if (s != null) {
				EnumFacing enumfacing = source.getBlockState().getValue(BlockDispenser.FACING);
				Vec3d lookVect = new Vec3d(enumfacing.getDirectionVec());
				if (s.canBeUsed(source.getWorld(), source.getBlockPos().offset(enumfacing), null)) {
					if (s.getType() == EnumSpellType.INSTANT)
						s.performEffect(new RayTraceResult(Type.MISS, lookVect, EnumFacing.UP, source.getBlockPos()), null, source.getWorld());
					else {
						EntitySpellCarrier car = new EntitySpellCarrier(source.getWorld(), source.getBlockPos().getX() + 1.5 * lookVect.x + 0.5, source.getBlockPos().getY() + 0.5d + lookVect.y, source.getBlockPos().getZ() + 1.5 * lookVect.z + 0.5);
						car.setSpell(s);
						car.setCaster(null);
						car.shoot(car, 0, enumfacing.getHorizontalAngle(), 0, 1f, 0);
						source.getWorld().spawnEntity(car);
					}
					return ItemStack.EMPTY;
				}
			}
			return stack;
		}
	});

}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:32,代码来源:ItemSpellPage.java


示例18: getDispensePosition

import net.minecraft.dispenser.IBlockSource; //导入依赖的package包/类
/**
 * Get the position where the dispenser at the given Coordinates should dispense to.
 */
public static IPosition getDispensePosition(IBlockSource coords)
{
    EnumFacing enumfacing = getFacing(coords.getBlockMetadata());
    double d0 = coords.getX() + 0.7D * (double)enumfacing.getFrontOffsetX();
    double d1 = coords.getY() + 0.7D * (double)enumfacing.getFrontOffsetY();
    double d2 = coords.getZ() + 0.7D * (double)enumfacing.getFrontOffsetZ();
    return new PositionImpl(d0, d1, d2);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:BlockDispenser.java


示例19: dispenseStack

import net.minecraft.dispenser.IBlockSource; //导入依赖的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;
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:15,代码来源:DispenserBehaviourSpawnEgg.java


示例20: dispenseStack

import net.minecraft.dispenser.IBlockSource; //导入依赖的package包/类
@Override
public ItemStack dispenseStack(IBlockSource block, final ItemStack stack) {
	return new BehaviorProjectileDispense() {

		@Override
		protected IProjectile getProjectileEntity(World world, IPosition pos) {
			EntityTippedArrow entity = new EntityTippedArrow(world, pos.getX(), pos.getY(), pos.getZ());
			entity.canBePickedUp = 1;
			entity.setEffect(TippedArrow.getEffect(stack));
			return entity;
		}
	}.dispense(block, stack);
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:14,代码来源:DispenserBehaviourTippedArrow.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MongodProcess类代码示例发布时间:2022-05-21
下一篇:
Java ClassPath类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap