Skip to content

Commit

Permalink
Hopeful fix
Browse files Browse the repository at this point in the history
  • Loading branch information
WillFP committed Feb 17, 2021
1 parent b4d5907 commit bb42505
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.willfp.eco.util.recipe.parts.SimpleRecipePart;
import com.willfp.eco.util.recipe.recipes.EcoShapedRecipe;
import org.bukkit.Material;
import org.bukkit.event.Event;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.CraftItemEvent;
Expand Down Expand Up @@ -71,6 +72,7 @@ public void complexRecipeListener(@NotNull final CraftItemEvent event) {

if (matched == null) {
event.getInventory().setResult(new ItemStack(Material.AIR));
event.setResult(Event.Result.DENY);
event.setCancelled(true);
return;
}
Expand All @@ -79,6 +81,7 @@ public void complexRecipeListener(@NotNull final CraftItemEvent event) {
event.getInventory().setResult(matched.getOutput());
} else {
event.getInventory().setResult(new ItemStack(Material.AIR));
event.setResult(Event.Result.DENY);
event.setCancelled(true);
}
}
Expand Down Expand Up @@ -139,6 +142,7 @@ public void preventUsingComplexPartInEcoRecipe(@NotNull final CraftItemEvent eve
if (part instanceof SimpleRecipePart) {
if (RecipeParts.isRecipePart(itemStack)) {
event.getInventory().setResult(new ItemStack(Material.AIR));
event.setResult(Event.Result.DENY);
event.setCancelled(true);
return;
}
Expand Down Expand Up @@ -191,6 +195,7 @@ public void preventUsingComplexPartInVanillaRecipe(@NotNull final CraftItemEvent
for (ItemStack itemStack : event.getInventory().getMatrix()) {
if (RecipeParts.isRecipePart(itemStack)) {
event.getInventory().setResult(new ItemStack(Material.AIR));
event.setResult(Event.Result.DENY);
event.setCancelled(true);
return;
}
Expand Down

0 comments on commit bb42505

Please sign in to comment.