mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Ancient altar no longer able to craft items that are not unlocked
This commit is contained in:
parent
9442fa65ca
commit
c13ec9903c
@ -110,14 +110,24 @@ public class AncientAltarListener implements Listener {
|
||||
|
||||
ItemStack result = Pedestals.getRecipeOutput(catalyst, input);
|
||||
if (result != null) {
|
||||
List<ItemStack> consumed = new ArrayList<>();
|
||||
consumed.add(catalyst);
|
||||
if (Slimefun.hasUnlocked(e.getPlayer(), result, true)) {
|
||||
List<ItemStack> consumed = new ArrayList<>();
|
||||
consumed.add(catalyst);
|
||||
|
||||
if (e.getPlayer().getGameMode() != GameMode.CREATIVE) {
|
||||
ItemUtils.consumeItem(e.getPlayer().getInventory().getItemInMainHand(), false);
|
||||
if (e.getPlayer().getGameMode() != GameMode.CREATIVE) {
|
||||
ItemUtils.consumeItem(e.getPlayer().getInventory().getItemInMainHand(), false);
|
||||
}
|
||||
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunPlugin.instance, new RitualAnimation(altars, b, b.getLocation().add(0.5, 1.3, 0.5), result, pedestals, consumed), 10L);
|
||||
}
|
||||
else {
|
||||
altars.remove(e.getClickedBlock());
|
||||
|
||||
pedestals.forEach(block -> utilities.altarinuse.remove(block.getLocation()));
|
||||
|
||||
// Item not unlocked, no longer in use.
|
||||
utilities.altarinuse.remove(b.getLocation());
|
||||
}
|
||||
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunPlugin.instance, new RitualAnimation(altars, b, b.getLocation().add(0.5, 1.3, 0.5), result, pedestals, consumed), 10L);
|
||||
}
|
||||
else {
|
||||
altars.remove(e.getClickedBlock());
|
||||
|
Loading…
Reference in New Issue
Block a user