本文整理汇总了Java中org.spongepowered.api.entity.EntityTypes.TIPPED_ARROW属性的典型用法代码示例。如果您正苦于以下问题:Java EntityTypes.TIPPED_ARROW属性的具体用法?Java EntityTypes.TIPPED_ARROW怎么用?Java EntityTypes.TIPPED_ARROW使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.spongepowered.api.entity.EntityTypes
的用法示例。
在下文中一共展示了EntityTypes.TIPPED_ARROW属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCharacterProjectileDamage
public double getCharacterProjectileDamage(IActiveCharacter character, EntityType type) {
if (character.isStub() || type == null)
return 1;
double base = character.getBaseProjectileDamage(type) + characterService.getCharacterProperty(character, DefaultProperties.projectile_damage_bonus);
if (type == EntityTypes.SPECTRAL_ARROW || type == EntityTypes.TIPPED_ARROW) {
base *= characterService.getCharacterProperty(character, DefaultProperties.arrow_damage_mult);
} else {
base *= characterService.getCharacterProperty(character, DefaultProperties.other_projectile_damage_mult);
}
return base;
}
示例2: updateType
private void updateType(@Nullable Entity entity, EntityType type) {
if(type == EntityTypes.BOAT) {
this.type = 1;
} else if(type == EntityTypes.ITEM) {
this.type = 2;
} else if(type == EntityTypes.AREA_EFFECT_CLOUD) {
this.type = 3;
} else if(type == EntityTypes.RIDEABLE_MINECART) {
this.type = 10;
this.data = Type.RIDEABLE.getId();
} else if(type == EntityTypes.CHESTED_MINECART) {
this.type = 10;
this.data = Type.CHEST.getId();
} else if(type == EntityTypes.FURNACE_MINECART) {
this.type = 10;
this.data = Type.FURNACE.getId();
} else if(type == EntityTypes.TNT_MINECART) {
this.type = 10;
this.data = Type.TNT.getId();
} else if(type == EntityTypes.MOB_SPAWNER_MINECART) {
this.type = 10;
this.data = Type.SPAWNER.getId();
} else if(type == EntityTypes.HOPPER_MINECART) {
this.type = 10;
this.data = Type.HOPPER.getId();
} else if(type == EntityTypes.COMMANDBLOCK_MINECART) {
this.type = 10;
this.data = Type.COMMAND_BLOCK.getId();
} else if(type == EntityTypes.PRIMED_TNT) {
this.type = 50;
} else if(type == EntityTypes.ENDER_CRYSTAL) {
this.type = 51;
} else if(type == EntityTypes.TIPPED_ARROW) {
this.type = 60;
} else if(type == EntityTypes.SNOWBALL) {
this.type = 61;
} else if(type == EntityTypes.EGG) {
this.type = 62;
} else if(type == EntityTypes.FIREBALL) {
this.type = 63;
} else if(type == EntityTypes.SMALL_FIREBALL) {
this.type = 64;
} else if(type == EntityTypes.ENDER_PEARL) {
this.type = 65;
} else if(type == EntityTypes.WITHER_SKULL) {
this.type = 66;
} else if(type == EntityTypes.SHULKER_BULLET) {
this.type = 67;
} else if(type == EntityTypes.LLAMA_SPIT) {
this.type = 68;
} else if(type == EntityTypes.FALLING_BLOCK) {
this.type = 70;
} else if(type == EntityTypes.ITEM_FRAME) {
this.type = 71;
} else if(type == EntityTypes.EYE_OF_ENDER) {
this.type = 72;
} else if(type == EntityTypes.SPLASH_POTION) {
this.type = 73;
} else if(type == EntityTypes.THROWN_EXP_BOTTLE) {
this.type = 75;
} else if(type == EntityTypes.FIREWORK) {
this.type = 76;
} else if(type == EntityTypes.LEASH_HITCH) {
this.type = 77;
} else if(type == EntityTypes.ARMOR_STAND) {
this.type = 78;
} else if(type == EntityTypes.EVOCATION_FANGS) {
this.type = 79;
} else if(type == EntityTypes.FISHING_HOOK) {
this.type = 90;
} else if(type == EntityTypes.SPECTRAL_ARROW) {
this.type = 91;
} else if(type == EntityTypes.DRAGON_FIREBALL) {
this.type = 93;
}
}
示例3: onProjectileHit
@Listener
public void onProjectileHit(CollideEvent.Impact event, @First Entity entity) {
Optional<JungleRaidInstance> optInst = manager.getApplicableZone(entity);
if (!optInst.isPresent()) {
return;
}
JungleRaidInstance inst = optInst.get();
if (inst.getState() != JungleRaidState.IN_PROGRESS) {
return;
}
int explosionSize = 2;
if (entity.getType() == EntityTypes.TIPPED_ARROW) {
if (inst.isFlagEnabled(JungleRaidFlag.TORMENT_ARROWS)) {
ProjectileSource shooter = ((Arrow) entity).getShooter();
CuboidContainmentPredicate predicate = new CuboidContainmentPredicate(entity.getLocation().getPosition(), 4, 4, 4);
for (Entity e : entity.getNearbyEntities(en -> predicate.test(en.getLocation().getPosition()))) {
if (e.equals(shooter)) {
continue;
}
if (e instanceof Living && shooter instanceof Living) {
e.damage(1, IndirectEntityDamageSource.builder().type(
DamageTypes.PROJECTILE
).entity(entity).proxySource((Living) shooter).build());
if (Probability.getChance(5)) {
EntityHealthUtil.heal((Living) shooter, 1);
}
}
}
}
if (inst.isFlagEnabled(JungleRaidFlag.EXPLOSIVE_ARROWS)) {
if (inst.isFlagEnabled(JungleRaidFlag.SUPER)) {
explosionSize = 4;
}
} else {
return;
}
}
if (entity instanceof Snowball) {
if (inst.isFlagEnabled(JungleRaidFlag.GRENADES)) {
if (inst.isFlagEnabled(JungleRaidFlag.SUPER)) {
explosionSize = 10;
} else {
explosionSize = 6;
}
} else {
return;
}
}
if (entity instanceof ThrownPotion) {
return;
}
entity.getLocation().getExtent().triggerExplosion(
Explosion.builder()
.radius(explosionSize)
.location(entity.getLocation())
.shouldDamageEntities(true)
.shouldBreakBlocks(true)
.build(),
Cause.source(SkreePlugin.container()).build()
);
}