diff --git a/CHANGELOG.md b/CHANGELOG.md index 5811da295..dbf73e1ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,8 @@ * General performance improvements for Talismans * General performance improvements for GPS Emergency Transmitters * General performance improvements for Infused Magnets +* Ancient Altars now support for protection plugins +* Ancient Pedestals now support for protection plugins #### Fixes * Fixed Slimefun Armor sometimes not applying its effects @@ -68,6 +70,7 @@ * Fixed old GPS Emergency Transmitters not working * Fixed #2156 * Fixed #2165 +* Fixed #2162 ## Release Candidate 14 (12 Jul 2020) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/AncientAltarListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/AncientAltarListener.java index 825859459..518ae597d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/AncientAltarListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/AncientAltarListener.java @@ -29,6 +29,7 @@ import org.bukkit.util.Vector; import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; +import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; import io.github.thebusybiscuit.slimefun4.api.events.PlayerRightClickEvent; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; @@ -128,6 +129,11 @@ public class AncientAltarListener implements Listener { return; } + if (!SlimefunPlugin.getProtectionManager().hasPermission(p, pedestal, ProtectableAction.ACCESS_INVENTORIES)) { + SlimefunPlugin.getLocalization().sendMessage(p, "inventory.no-access", true); + return; + } + // getting the currently placed item Item stack = findItem(pedestal); @@ -157,6 +163,11 @@ public class AncientAltarListener implements Listener { } private void useAltar(Block altar, Player p) { + if (!SlimefunPlugin.getProtectionManager().hasPermission(p, altar, ProtectableAction.ACCESS_INVENTORIES)) { + SlimefunPlugin.getLocalization().sendMessage(p, "inventory.no-access", true); + return; + } + ItemStack catalyst = new CustomItem(p.getInventory().getItemInMainHand(), 1); List pedestals = getPedestals(altar);