From 34719320505ff8137767428064db3c3fc57216da Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Fri, 30 Oct 2020 23:05:55 +0100 Subject: [PATCH] Update Talisman.java --- .../items/magical/talismans/Talisman.java | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/Talisman.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/Talisman.java index ce53aef99..c86c4e821 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/Talisman.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/Talisman.java @@ -182,19 +182,27 @@ public class Talisman extends SlimefunItem { ItemStack possibleTalisman = retrieveTalismanFromInventory(p.getInventory(), talisman.getItem()); - if (possibleTalisman != null && Slimefun.hasUnlocked(p, talisman, true)) { - activateTalisman(e, p, p.getInventory(), talisman, possibleTalisman); - return possibleTalisman; + if (possibleTalisman != null) { + if (Slimefun.hasUnlocked(p, talisman, true)) { + activateTalisman(e, p, p.getInventory(), talisman, possibleTalisman); + return possibleTalisman; + } else { + return null; + } } possibleTalisman = retrieveTalismanFromInventory(p.getEnderChest(), talisman.getEnderVariant()); - if (possibleTalisman != null && Slimefun.hasUnlocked(p, talisman, true)) { - activateTalisman(e, p, p.getEnderChest(), talisman, possibleTalisman); - return possibleTalisman; + if (possibleTalisman != null) { + if (Slimefun.hasUnlocked(p, talisman, true)) { + activateTalisman(e, p, p.getEnderChest(), talisman, possibleTalisman); + return possibleTalisman; + } else { + return null; + } } - return possibleTalisman; + return null; } @Nullable