本文整理汇总了Java中cn.nukkit.entity.projectile.EntityArrow类的典型用法代码示例。如果您正苦于以下问题:Java EntityArrow类的具体用法?Java EntityArrow怎么用?Java EntityArrow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EntityArrow类属于cn.nukkit.entity.projectile包,在下文中一共展示了EntityArrow类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onEntityCollide
import cn.nukkit.entity.projectile.EntityArrow; //导入依赖的package包/类
@Override
public void onEntityCollide(Entity entity) {
if (!entity.hasEffect(Effect.FIRE_RESISTANCE)) {
entity.attack(new EntityDamageByBlockEvent(this, entity, DamageCause.FIRE, 1));
}
EntityCombustByBlockEvent ev = new EntityCombustByBlockEvent(this, entity, 8);
if (entity instanceof EntityArrow) {
ev.setCancelled();
}
Server.getInstance().getPluginManager().callEvent(ev);
if (!ev.isCancelled() && entity instanceof Player && !((Player) entity).isCreative()) {
entity.setOnFire(ev.getDuration());
}
}
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:16,代码来源:BlockFire.java
示例2: registerEntities
import cn.nukkit.entity.projectile.EntityArrow; //导入依赖的package包/类
private void registerEntities() {
Entity.registerEntity("Arrow", EntityArrow.class);
Entity.registerEntity("Item", EntityItem.class);
Entity.registerEntity("FallingSand", EntityFallingBlock.class);
Entity.registerEntity("PrimedTnt", EntityPrimedTNT.class);
Entity.registerEntity("Snowball", EntitySnowball.class);
Entity.registerEntity("EnderPearl", EntityEnderPearl.class);
Entity.registerEntity("Painting", EntityPainting.class);
//todo mobs
Entity.registerEntity("Creeper", EntityCreeper.class);
Entity.registerEntity("Zombie", EntityZombie.class);
//TODO: more mobs
Entity.registerEntity("Chicken", EntityChicken.class);
Entity.registerEntity("Cow", EntityCow.class);
Entity.registerEntity("Pig", EntityPig.class);
Entity.registerEntity("Rabbit", EntityRabbit.class);
Entity.registerEntity("Sheep", EntitySheep.class);
Entity.registerEntity("Wolf", EntityWolf.class);
Entity.registerEntity("Ocelot", EntityOcelot.class);
Entity.registerEntity("Villager", EntityVillager.class);
Entity.registerEntity("ThrownExpBottle", EntityExpBottle.class);
Entity.registerEntity("XpOrb", EntityXPOrb.class);
Entity.registerEntity("ThrownPotion", EntityPotion.class);
Entity.registerEntity("Human", EntityHuman.class, true);
Entity.registerEntity("MinecartRideable", EntityMinecartEmpty.class);
// TODO: 2016/1/30 all finds of minecart
Entity.registerEntity("Boat", EntityBoat.class);
Entity.registerEntity("Lightning", EntityLightning.class);
}
开发者ID:FrontierDevs,项目名称:Jenisys3,代码行数:34,代码来源:Server.java
示例3: registerEntities
import cn.nukkit.entity.projectile.EntityArrow; //导入依赖的package包/类
private void registerEntities() {
Entity.registerEntity("Arrow", EntityArrow.class);
Entity.registerEntity("Item", EntityItem.class);
Entity.registerEntity("FallingSand", EntityFallingBlock.class);
Entity.registerEntity("PrimedTnt", EntityPrimedTNT.class);
Entity.registerEntity("Snowball", EntitySnowball.class);
Entity.registerEntity("Painting", EntityPainting.class);
//todo mobs
Entity.registerEntity("Creeper", EntityCreeper.class);
//TODO: more mobs
Entity.registerEntity("Chicken", EntityChicken.class);
Entity.registerEntity("Cow", EntityCow.class);
Entity.registerEntity("Pig", EntityPig.class);
Entity.registerEntity("Rabbit", EntityRabbit.class);
Entity.registerEntity("Sheep", EntitySheep.class);
Entity.registerEntity("Wolf", EntityWolf.class);
Entity.registerEntity("Ocelot", EntityOcelot.class);
Entity.registerEntity("Villager", EntityVillager.class);
Entity.registerEntity("ThrownExpBottle", EntityExpBottle.class);
Entity.registerEntity("XpOrb", EntityXPOrb.class);
Entity.registerEntity("ThrownPotion", EntityPotion.class);
Entity.registerEntity("Human", EntityHuman.class, true);
Entity.registerEntity("MinecartRideable", EntityMinecartEmpty.class);
// TODO: 2016/1/30 all finds of minecart
Entity.registerEntity("Boat", EntityBoat.class);
Entity.registerEntity("Lightning", EntityLightning.class);
}
开发者ID:Creeperface01,项目名称:NukkitGT,代码行数:32,代码来源:Server.java
示例4: registerEntities
import cn.nukkit.entity.projectile.EntityArrow; //导入依赖的package包/类
private void registerEntities() {
Entity.registerEntity("Arrow", EntityArrow.class);
Entity.registerEntity("Item", EntityItem.class);
Entity.registerEntity("FallingSand", EntityFallingBlock.class);
Entity.registerEntity("PrimedTnt", EntityPrimedTNT.class);
Entity.registerEntity("Snowball", EntitySnowball.class);
Entity.registerEntity("EnderPearl", EntityEnderPearl.class);
Entity.registerEntity("Painting", EntityPainting.class);
//todo mobs
Entity.registerEntity("Creeper", EntityCreeper.class);
//TODO: more mobs
Entity.registerEntity("Chicken", EntityChicken.class);
Entity.registerEntity("Cow", EntityCow.class);
Entity.registerEntity("Pig", EntityPig.class);
Entity.registerEntity("Rabbit", EntityRabbit.class);
Entity.registerEntity("Sheep", EntitySheep.class);
Entity.registerEntity("Wolf", EntityWolf.class);
Entity.registerEntity("Ocelot", EntityOcelot.class);
Entity.registerEntity("Villager", EntityVillager.class);
Entity.registerEntity("ThrownExpBottle", EntityExpBottle.class);
Entity.registerEntity("XpOrb", EntityXPOrb.class);
Entity.registerEntity("ThrownPotion", EntityPotion.class);
Entity.registerEntity("Human", EntityHuman.class, true);
Entity.registerEntity("MinecartRideable", EntityMinecartEmpty.class);
// TODO: 2016/1/30 all finds of minecart
Entity.registerEntity("Boat", EntityBoat.class);
Entity.registerEntity("Lightning", EntityLightning.class);
}
开发者ID:NycuRO,项目名称:Apollo-OLD,代码行数:33,代码来源:Server.java
示例5: registerEntities
import cn.nukkit.entity.projectile.EntityArrow; //导入依赖的package包/类
private void registerEntities() {
Entity.registerEntity("Arrow", EntityArrow.class);
Entity.registerEntity("Item", EntityItem.class);
Entity.registerEntity("FallingSand", EntityFallingBlock.class);
Entity.registerEntity("PrimedTnt", EntityPrimedTNT.class);
Entity.registerEntity("Snowball", EntitySnowball.class);
Entity.registerEntity("EnderPearl", EntityEnderPearl.class);
Entity.registerEntity("Painting", EntityPainting.class);
//todo mobs
Entity.registerEntity("Creeper", EntityCreeper.class);
Entity.registerEntity("Zombie", EntityZombie.class);
Entity.registerEntity("Blaze", EntityBlaze.class);
Entity.registerEntity("CaveSpider", EntityCaveSpider.class);
Entity.registerEntity("ElderGuardian", EntityElderGuardian.class);
Entity.registerEntity("EnderDragon", EntityEnderDragon.class);
Entity.registerEntity("Enderman", EntityEnderman.class);
Entity.registerEntity("Endermite", EntityEndermite.class);
Entity.registerEntity("Ghast", EntityGhast.class);
Entity.registerEntity("Guardian", EntityGuardian.class);
Entity.registerEntity("Husk", EntityHusk.class);
Entity.registerEntity("MagmaCube", EntityMagmaCube.class);
Entity.registerEntity("Shulker", EntityShulker.class);
Entity.registerEntity("Silferfish", EntitySilverfish.class);
Entity.registerEntity("Skeleton", EntitySkeleton.class);
Entity.registerEntity("SkeletonHorse", EntitySkeletonHorse.class);
Entity.registerEntity("Slime", EntitySlime.class);
Entity.registerEntity("Spider", EntitySpider.class);
Entity.registerEntity("Stray", EntityStray.class);
Entity.registerEntity("Witch", EntityWitch.class);
//TODO: more mobs
Entity.registerEntity("Bat", EntityBat.class);
Entity.registerEntity("Chicken", EntityChicken.class);
Entity.registerEntity("Cow", EntityCow.class);
Entity.registerEntity("Donkey", EntityDonkey.class);
Entity.registerEntity("Horse", EntityHorse.class);
Entity.registerEntity("Llama", EntityLlama.class);
Entity.registerEntity("Mooshroom", EntityMooshroom.class);
Entity.registerEntity("Mule", EntityMule.class);
Entity.registerEntity("PolarBear", EntityPolarBear.class);
Entity.registerEntity("Pig", EntityPig.class);
Entity.registerEntity("Rabbit", EntityRabbit.class);
Entity.registerEntity("Sheep", EntitySheep.class);
Entity.registerEntity("Squid", EntitySquid.class);
Entity.registerEntity("Wolf", EntityWolf.class);
Entity.registerEntity("Ocelot", EntityOcelot.class);
Entity.registerEntity("Villager", EntityVillager.class);
Entity.registerEntity("ThrownExpBottle", EntityExpBottle.class);
Entity.registerEntity("XpOrb", EntityXPOrb.class);
Entity.registerEntity("ThrownPotion", EntityPotion.class);
Entity.registerEntity("Egg", EntityEgg.class);
Entity.registerEntity("Human", EntityHuman.class, true);
Entity.registerEntity("MinecartRideable", EntityMinecartEmpty.class);
// TODO: 2016/1/30 all finds of minecart
Entity.registerEntity("Boat", EntityBoat.class);
//Entity.registerEntity("Lightning", EntityLightning.class); lightning shouldn't be saved as entity
}
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:61,代码来源:Server.java
示例6: InventoryPickupArrowEvent
import cn.nukkit.entity.projectile.EntityArrow; //导入依赖的package包/类
public InventoryPickupArrowEvent(Inventory inventory, EntityArrow arrow) {
super(inventory);
this.arrow = arrow;
}
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:5,代码来源:InventoryPickupArrowEvent.java
示例7: getArrow
import cn.nukkit.entity.projectile.EntityArrow; //导入依赖的package包/类
public EntityArrow getArrow() {
return arrow;
}
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:4,代码来源:InventoryPickupArrowEvent.java
注:本文中的cn.nukkit.entity.projectile.EntityArrow类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论