diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/ResurrectedTalisman.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/ResurrectedTalisman.java index 6bca2e972..3a2933604 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/ResurrectedTalisman.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/ResurrectedTalisman.java @@ -3,6 +3,8 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.magical.talisman import com.google.gson.JsonObject; import com.google.gson.JsonParser; import io.github.thebusybiscuit.cscorelib2.data.PersistentJsonDataType; +import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; + import org.bukkit.potion.PotionEffectType; import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; import org.bukkit.persistence.PersistentDataContainer; @@ -46,11 +48,14 @@ public class ResurrectedTalisman extends Talisman { JsonObject json = createJsonFromLocation(currentLoc); ItemMeta itemMeta = e.getItem().getItemMeta(); - itemMeta.getPersistentDataContainer().set(locationKey, PersistentJsonDataType.JSON_OBJECT, json); + if (SlimefunPlugin.getProtectionManager().hasPermission(e.getPlayer(), currentLoc, ProtectableAction.PLACE_BLOCK)) { + itemMeta.getPersistentDataContainer().set(locationKey, PersistentJsonDataType.JSON_OBJECT, json); + e.getItem().setItemMeta(itemMeta); + + SlimefunPlugin.getLocalization().sendMessage(e.getPlayer(), "messages.talisman.resurrected-location", true); + } - e.getItem().setItemMeta(itemMeta); - - SlimefunPlugin.getLocalization().sendMessage(e.getPlayer(), "messages.talisman.resurrected-location", true); + SlimefunPlugin.getLocalization().sendMessage(e.getPlayer(), "messages.talisman.resurrected-location-failed", true); }; } diff --git a/src/main/resources/languages/messages_en.yml b/src/main/resources/languages/messages_en.yml index c3a63712b..99df15b23 100644 --- a/src/main/resources/languages/messages_en.yml +++ b/src/main/resources/languages/messages_en.yml @@ -155,6 +155,7 @@ messages: wise: '&a&oYour Talisman doubled your experience drops' resurrected: '&a&oYour Talisman a-voided your death, but sacrificed itself in the process' resurrected-location: 'Successfully saved your current location. You will teleport here when you fall into the void.' + resurrected-location-failed: 'Failed to set location here, you dont have enough permissions.' soulbound-rune: fail: '&cYou can only bind one item to your soul at a time.'