当前位置: 首页>>代码示例>>Java>>正文


Java EntityTypes.TIPPED_ARROW属性代码示例

本文整理汇总了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;
}
 
开发者ID:NeumimTo,项目名称:NT-RPG,代码行数:11,代码来源:DamageService.java

示例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;
    }
}
 
开发者ID:Guichaguri,项目名称:PacketControl,代码行数:76,代码来源:MixinPacketSpawnObject.java

示例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()
  );
}
 
开发者ID:Skelril,项目名称:Skree,代码行数:69,代码来源:JungleRaidEffectListener.java


注:本文中的org.spongepowered.api.entity.EntityTypes.TIPPED_ARROW属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。