mirror of
https://github.com/GTNewHorizons/ModTweaker.git
synced 2026-11-28 07:55:58 +00:00
Prevent execution of commands with missing parameters
This commit is contained in:
1 parent
1e879fc711
commit
0929891f38
2 files changed
+20
No files matched your search
@@ -31,6 +31,11 @@ public class Grind {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack input, IItemStack output, int energy, @Optional IItemStack output2, @Optional float chance2, @Optional IItemStack output3, @Optional float chance3) {
|
||||
if(input == null || output == null) {
|
||||
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", Grind.name));
|
||||
return;
|
||||
}
|
||||
|
||||
// Create recipe
|
||||
IGrinderEntry recipe;
|
||||
|
||||
@@ -75,6 +80,11 @@ public class Grind {
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient output) {
|
||||
if(output == null) {
|
||||
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", Grind.name));
|
||||
return;
|
||||
}
|
||||
|
||||
// Get list of existing recipes, matching with parameter
|
||||
LinkedList<IGrinderEntry> result = new LinkedList<IGrinderEntry>();
|
||||
|
||||
|
||||
Reference in new issue
Block a user