本文整理汇总了Java中org.bukkit.entity.EntityType.values方法的典型用法代码示例。如果您正苦于以下问题:Java EntityType.values方法的具体用法?Java EntityType.values怎么用?Java EntityType.values使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.entity.EntityType
的用法示例。
在下文中一共展示了EntityType.values方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MatchEntityState
import org.bukkit.entity.EntityType; //导入方法依赖的package包/类
protected MatchEntityState(Match match, Class<? extends Entity> entityClass, UUID uuid, EntityLocation location, @Nullable String customName) {
this.uuid = checkNotNull(uuid);
this.match = checkNotNull(match);
this.entityClass = checkNotNull(entityClass);
this.location = checkNotNull(location);
this.customName = customName;
EntityType type = null;
for(EntityType t : EntityType.values()) {
if(t.getEntityClass().isAssignableFrom(entityClass)) {
type = t;
break;
}
}
checkArgument(type != null, "Unknown entity class " + entityClass);
this.entityType = type;
}
示例2: getEntity
import org.bukkit.entity.EntityType; //导入方法依赖的package包/类
private EntityType getEntity(String lore) {
String lores = lore.toUpperCase();
if (lores.contains("[SPAWNER: "))
lores = lores.replace("[SPAWNER: ", "");
if (lores.contains("]"))
lores = lores.replace("]", "");
Logger.DEBUG.log("LORE: " + lores);
for (EntityType type : EntityType.values()) {
String name = type + "";
if (lores.equalsIgnoreCase(name)) {
return type;
}
}
return EntityType.AREA_EFFECT_CLOUD;
}
示例3: load
import org.bukkit.entity.EntityType; //导入方法依赖的package包/类
/**
* Load the plugin's settings.
*
* @author HomieDion
* @since 1.1.0
*/
public void load() {
// Variables
final Sunscreen plugin = Sunscreen.getInstance();
final CustomConfig config = new CustomConfig("config.yml", plugin);
final Logger log = plugin.getLogger();
// Add the disabled worlds
for (final String world : config.getStringList("disabled_worlds")) {
worlds.add(world);
log.info(String.format("%s will not use this plugin.", world));
}
// Loop all entities
for (final EntityType type : EntityType.values()) {
// Loop all values of the list
for (final String line : config.getStringList("mobs")) {
// If the names match
if (type.name().equalsIgnoreCase(line)) {
mobs.add(type);
log.info(String.format("%s will not burn in the sun.", type.name()));
break;
}
}
}
}