mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2026-01-06 15:52:03 +00:00
Update RecipeEventListener.java
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package net.momirealms.craftengine.bukkit.item.recipe;
|
||||
|
||||
import com.destroystokyo.paper.event.inventory.PrepareResultEvent;
|
||||
import net.momirealms.craftengine.bukkit.plugin.BukkitCraftEngine;
|
||||
import net.momirealms.craftengine.bukkit.plugin.user.BukkitServerPlayer;
|
||||
import net.momirealms.craftengine.bukkit.util.ItemUtils;
|
||||
@@ -51,6 +52,21 @@ public class RecipeEventListener implements Listener {
|
||||
});
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onSpecialRecipe(PrepareItemCraftEvent event) {
|
||||
org.bukkit.inventory.Recipe recipe = event.getRecipe();
|
||||
if (recipe == null)
|
||||
return;
|
||||
|
||||
if (!(recipe instanceof ComplexRecipe complexRecipe)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ItemUtils.hasCustomItem(event.getInventory().getMatrix())) {
|
||||
event.getInventory().setResult(null);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onCrafting(PrepareItemCraftEvent event) {
|
||||
org.bukkit.inventory.Recipe recipe = event.getRecipe();
|
||||
|
||||
Reference in New Issue
Block a user