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


Java PickupStatus类代码示例

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


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

示例1: update

import net.minecraft.entity.projectile.EntityArrow.PickupStatus; //导入依赖的package包/类
@Override
public void update() {
	super.update();
	World world = entity.getWorld();
	if(!world.isRemote && entity.ticksExisted()%TICKRATE==0){
		BlockPos pos = getPos();
		for(int i=0;i<AMOUNT;i++){
			double x = pos.getX()+Math.random() * RAD * 2 - RAD,
				   z = pos.getZ()+Math.random() * RAD * 2 - RAD;
			BlockPos spawn = new BlockPos(x,pos.getY()+94,z);
			while(!world.isAirBlock(spawn)&&spawn.getY()>pos.getY()+1)spawn=spawn.down();
			//Original spawned arrows at a fixed height of 158
			EntityArrow arrow = new EntityTippedArrow(world, x, spawn.getY(), z);
			arrow.motionX=0;
			arrow.motionZ=0;
			arrow.motionY=-2D;
			arrow.setFire(30);
			arrow.pickupStatus=PickupStatus.DISALLOWED;//why is this an int...
			//arrow.setThrowableHeading(0, -1, 0, 2F, 0);
			world.spawnEntity(arrow);
		}
	}
}
 
开发者ID:Xilef11,项目名称:runesofwizardry-classics,代码行数:24,代码来源:RuneEntityHellstorm.java

示例2: onBowFire

import net.minecraft.entity.projectile.EntityArrow.PickupStatus; //导入依赖的package包/类
@SuppressWarnings("static-access")
@SubscribeEvent
public void onBowFire(ArrowLooseEvent event)
{
	EntityPlayer player = event.getEntityPlayer();
	ItemStack stack = event.getBow();
	NBTTagCompound nbt = NBTHelper.loadStackNBT(stack);
	
	if (player != null && stack != null && nbt != null && !player.getEntityWorld().isRemote)
	{
		if (BowAttribute.BARRAGE.hasAttribute(nbt))
		{
			for (int i = 0; i < (int) BowAttribute.BARRAGE.getCalculatedValue(nbt, 3, 1.5); i++)
			{
				EntityArrow entityarrow = new EntityTippedArrow(player.getEntityWorld(), player);
				entityarrow.setAim(player, player.rotationPitch, player.rotationYaw, 0, ((ItemBow) event.getBow().getItem()).getArrowVelocity(event.getCharge()) * 3, 20F);
				entityarrow.pickupStatus = PickupStatus.DISALLOWED;
				player.getEntityWorld().spawnEntity(entityarrow);
			}
		}
	}
}
 
开发者ID:TheXFactor117,项目名称:Levels,代码行数:23,代码来源:EventBarrage.java

示例3: onHit

import net.minecraft.entity.projectile.EntityArrow.PickupStatus; //导入依赖的package包/类
@Override
public void onHit(RayTraceResult raytraceResultIn) {
    
   super.onHit(raytraceResultIn);
   
   if (!this.world.isRemote && this.isDead) {

       EntitySpearWood replace = new EntitySpearWood(this.world,
               this.posX, this.posY, this.posZ);
       replace.durability = this.durability;
       replace.pickupStatus = PickupStatus.ALLOWED;
       this.world.spawnEntity(replace);
   }
}
 
开发者ID:JayAvery,项目名称:geomastery,代码行数:15,代码来源:EntitySpearWood.java

示例4: onHit

import net.minecraft.entity.projectile.EntityArrow.PickupStatus; //导入依赖的package包/类
@Override
public void onHit(RayTraceResult raytraceResultIn) {
    
   super.onHit(raytraceResultIn);
   
   if (!this.world.isRemote && this.isDead) {

       EntitySpearFlint replace = new EntitySpearFlint(this.world,
               this.posX, this.posY, this.posZ);
       replace.durability = this.durability;
       replace.pickupStatus = PickupStatus.ALLOWED;
       this.world.spawnEntity(replace);
   }
}
 
开发者ID:JayAvery,项目名称:geomastery,代码行数:15,代码来源:EntitySpearFlint.java


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