From 3bb16cfcd8efa5130e15f6b130f472a819989e1d Mon Sep 17 00:00:00 2001 From: Ryan <7389646+ryanbarlow97@users.noreply.github.com> Date: Thu, 24 Sep 2026 20:18:13 +0000 Subject: [PATCH] fix: refuse branding a station without a recipe Left-clicking a station with the branding tool before choosing a recipe called craft() with a null recipe and threw a NullPointerException. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../advancedcrafting/managers/CraftingManager.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/net/tfminecraft/advancedcrafting/managers/CraftingManager.java b/src/main/java/net/tfminecraft/advancedcrafting/managers/CraftingManager.java index 5cf4fc0..4e077be 100644 --- a/src/main/java/net/tfminecraft/advancedcrafting/managers/CraftingManager.java +++ b/src/main/java/net/tfminecraft/advancedcrafting/managers/CraftingManager.java @@ -336,6 +336,11 @@ public void applyHit(PlayerInteractEvent e) { ); return; } else { + if (!station.hasRecipe()) { + p.sendMessage("§cNo recipe on this station. Select a recipe first."); + p.playSound(p.getLocation(), Sound.ENTITY_VILLAGER_NO, 1f, 1f); + return; + } StationFeedback f = station.craft(p); if (f.equals(StationFeedback.SUCCESS)) { p.getWorld().playSound(station.getLoc(), Sound.ENTITY_PLAYER_LEVELUP, 1f, 1f);