Java Code Examples for org.bukkit.NamespacedKey#minecraft()

The following examples show how to use org.bukkit.NamespacedKey#minecraft() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NamespacedKeyUtils.java    From ProtocolSupport with GNU Affero General Public License v3.0 5 votes vote down vote up
@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]);
	}
}
 
Example 2
Source File: RecipeType.java    From Slimefun4 with GNU General Public License v3.0 4 votes vote down vote up
public RecipeType(MinecraftRecipe<?> recipe) {
    this.item = new ItemStack(recipe.getMachine());
    this.machine = "";
    this.key = NamespacedKey.minecraft(recipe.getRecipeClass().getSimpleName().toLowerCase(Locale.ROOT).replace("recipe", ""));
}
 
Example 3
Source File: EnchantmentGlow.java    From NovaGuilds with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Glow enchantment constructor
 * Registers it as 'ngglow'
 */
public EnchantmentGlow() {
	super(NamespacedKey.minecraft("ngglow"));
}