當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。