本文整理汇总了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);
}
}
}
示例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);
}
}
}
}
示例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);
}
}
示例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);
}
}