下面列出了org.bukkit.NamespacedKey#minecraft ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@SuppressWarnings("deprecation")
public static NamespacedKey fromString(String s) {
if ((s == null) || s.isEmpty()) {
return null;
}
String[] split = s.split(SEPARATOR, 2);
if (split.length == 1) {
return NamespacedKey.minecraft(split[0]);
} else {
return new NamespacedKey(split[0], split[1]);
}
}
public RecipeType(MinecraftRecipe<?> recipe) {
this.item = new ItemStack(recipe.getMachine());
this.machine = "";
this.key = NamespacedKey.minecraft(recipe.getRecipeClass().getSimpleName().toLowerCase(Locale.ROOT).replace("recipe", ""));
}
/**
* Glow enchantment constructor
* Registers it as 'ngglow'
*/
public EnchantmentGlow() {
super(NamespacedKey.minecraft("ngglow"));
}