From 9332aeb17d8310f186211d26c3ef3e343d7d2a56 Mon Sep 17 00:00:00 2001 From: Ethan Date: Thu, 30 Jul 2020 01:50:46 -0400 Subject: [PATCH] Fixed dupe bug Fixed null pointer error Pray to build bot this builds... --- .../Indyuce/mmoitems/api/crafting/recipe/CraftingRecipe.java | 4 ++-- .../Indyuce/mmoitems/api/crafting/trigger/CommandTrigger.java | 2 +- .../java/net/Indyuce/mmoitems/gui/CraftingStationView.java | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/Indyuce/mmoitems/api/crafting/recipe/CraftingRecipe.java b/src/main/java/net/Indyuce/mmoitems/api/crafting/recipe/CraftingRecipe.java index 539e0634..1cc8ee80 100644 --- a/src/main/java/net/Indyuce/mmoitems/api/crafting/recipe/CraftingRecipe.java +++ b/src/main/java/net/Indyuce/mmoitems/api/crafting/recipe/CraftingRecipe.java @@ -50,11 +50,11 @@ public class CraftingRecipe extends Recipe { * yaml format is 'output-item: false' under options */ public boolean isItemRecipe() { - return config.getConfigurationSection("options").getBoolean("output-item", true); + return config.getBoolean("options.output-item", true); } public boolean isSilent() { - return config.getConfigurationSection("options").getBoolean("silent-craft", false); + return config.getBoolean("options.silent-craft", false); } public ConfigMMOItem getOutput() { diff --git a/src/main/java/net/Indyuce/mmoitems/api/crafting/trigger/CommandTrigger.java b/src/main/java/net/Indyuce/mmoitems/api/crafting/trigger/CommandTrigger.java index c62845c5..9e3ebd3d 100644 --- a/src/main/java/net/Indyuce/mmoitems/api/crafting/trigger/CommandTrigger.java +++ b/src/main/java/net/Indyuce/mmoitems/api/crafting/trigger/CommandTrigger.java @@ -12,7 +12,7 @@ public class CommandTrigger extends Trigger { super("command"); config.validate("format"); - player = config.getBoolean("player"); + player = config.getBoolean("player", false); command = config.getString("format"); } diff --git a/src/main/java/net/Indyuce/mmoitems/gui/CraftingStationView.java b/src/main/java/net/Indyuce/mmoitems/gui/CraftingStationView.java index 261e4c43..04158235 100644 --- a/src/main/java/net/Indyuce/mmoitems/gui/CraftingStationView.java +++ b/src/main/java/net/Indyuce/mmoitems/gui/CraftingStationView.java @@ -189,10 +189,12 @@ public class CraftingStationView extends PluginInventory { data.getPlayer().playSound(data.getPlayer().getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1, 1); if (recipe.isItemRecipe()) new SmartGive(data.getPlayer()).give(craftedItem); - } else + } + else { data.getPlayer().playSound(data.getPlayer().getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1, 1); for (Ingredient ingredient : craft.getRecipe().getIngredients()) new SmartGive(data.getPlayer()).give(ingredient.generateItemStack()); + } updateData(); open();