1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 19:55:48 +00:00

Reduce to local scoop

This commit is contained in:
svr333 2020-10-09 16:49:06 +02:00
parent b042fbd3a4
commit 64684d86c3

View File

@ -46,9 +46,11 @@ public class ResurrectedTalisman extends Talisman {
return e -> {
Location currentLoc = e.getPlayer().getLocation();
JsonObject json = createJsonFromLocation(currentLoc);
ItemMeta itemMeta = e.getItem().getItemMeta();
if (SlimefunPlugin.getProtectionManager().hasPermission(e.getPlayer(), currentLoc, ProtectableAction.PLACE_BLOCK)) {
if (SlimefunPlugin.getProtectionManager().hasPermission(e.getPlayer(), currentLoc, ProtectableAction.PLACE_BLOCK)
&& e.getItem().hasItemMeta()) {
ItemMeta itemMeta = e.getItem().getItemMeta();
itemMeta.getPersistentDataContainer().set(locationKey, PersistentJsonDataType.JSON_OBJECT, json);
e.getItem().setItemMeta(itemMeta);