Java Code Examples for net.minecraft.entity.projectile.EntityArrow.PickupStatus

The following are top voted examples for showing how to use net.minecraft.entity.projectile.EntityArrow.PickupStatus. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: runesofwizardry-classics   File: RuneEntityHellstorm.java   Source Code and License 6 votes vote down vote up
@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);
		}
	}
}
 
Example 2
Project: Levels   File: EventBarrage.java   Source Code and License 6 votes vote down vote up
@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);
			}
		}
	}
}
 
Example 3
Project: geomastery   File: EntitySpearWood.java   Source Code and License 5 votes vote down vote up
@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);
   }
}
 
Example 4
Project: geomastery   File: EntitySpearFlint.java   Source Code and License 5 votes vote down vote up
@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);
   }
}