File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/main/java/at/helpch/placeholderapi/expansion/player Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 1010import me .clip .placeholderapi .expansion .PlaceholderExpansion ;
1111import org .bukkit .Bukkit ;
1212import org .bukkit .Location ;
13+ import org .bukkit .NamespacedKey ;
1314import org .bukkit .OfflinePlayer ;
1415import org .bukkit .World ;
1516import org .bukkit .block .BlockFace ;
@@ -507,6 +508,18 @@ public boolean canRegister() {
507508 }
508509 }
509510
511+ // has_unlocked_recipe_<recipe-key>
512+ if (params .startsWith ("has_unlocked_recipe_" ) && VersionHelper .HAS_KEYED_API ) {
513+ final String recipeName = params .substring ("has_unlocked_recipe_" .length ());
514+ final NamespacedKey recipeKey = (recipeName .contains (":" )) ? NamespacedKey .fromString (recipeName ) : NamespacedKey .minecraft (recipeName );
515+
516+ if (recipeKey == null ) {
517+ return "Unknown recipe " + recipeName ;
518+ }
519+
520+ return bool (player .hasDiscoveredRecipe (recipeKey ));
521+ }
522+
510523 return null ;
511524 }
512525
You can’t perform that action at this time.
0 commit comments