1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00
This commit is contained in:
TheBusyBiscuit 2020-07-31 20:24:58 +02:00
parent e380f8b972
commit 2fc18aed0a
2 changed files with 14 additions and 0 deletions

View File

@ -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)

View File

@ -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<Block> pedestals = getPedestals(altar);