use of org.spongepowered.api.statistic.EntityStatistic in project SpongeCommon by SpongePowered.
the class SpongeGameRegistry method getEntityStatistic.
@Override
public Optional<EntityStatistic> getEntityStatistic(StatisticType statType, EntityType entityType) {
checkNotNull(statType, "null stat type");
checkNotNull(entityType, "null entity type");
EntityList.EntityEggInfo eggInfo = EntityList.ENTITY_EGGS.get(new ResourceLocation(entityType.getId()));
if (statType.equals(StatisticTypes.ENTITIES_KILLED)) {
return Optional.of((EntityStatistic) eggInfo.killEntityStat);
} else if (statType.equals(StatisticTypes.KILLED_BY_ENTITY)) {
return Optional.of((EntityStatistic) eggInfo.entityKilledByStat);
}
throw new IllegalArgumentException("invalid entity stat type");
}
Aggregations