Skip to content

Commit

Permalink
fix(head): Fixed the issues #50
Browse files Browse the repository at this point in the history
  • Loading branch information
CarmJos committed Sep 17, 2024
1 parent 35278ae commit f749375
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.artformgames.plugin.residencelist.conf.PluginMessages;
import com.artformgames.plugin.residencelist.listener.EditHandler;
import com.artformgames.plugin.residencelist.utils.GUIUtils;
import com.artformgames.plugin.residencelist.utils.ResidenceUtils;
import com.bekvon.bukkit.residence.protection.ClaimedResidence;
import org.bukkit.Location;
import org.bukkit.Material;
Expand Down Expand Up @@ -101,7 +102,7 @@ public void onClick(Player clicker, ClickType type) {
setItem(13, new GUIItem(CONFIG.ITEMS.TELEPORT_DISABLED.prepare().get(getViewer())));
}

if (getData().getOwner() == null) {
if (ResidenceUtils.isServerLand(getData().getResidence())) {
setItem(14, new GUIItem(CONFIG.ITEMS.SERVER.prepare().get(getViewer())));
} else {
setItem(14, new GUIItem(CONFIG.ITEMS.OWNER.prepare(getData().getOwner())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.artformgames.plugin.residencelist.utils;

import com.bekvon.bukkit.residence.Residence;
import com.bekvon.bukkit.residence.protection.ClaimedResidence;

public class ResidenceUtils {


public static boolean isServerLand(ClaimedResidence residence) {
return Residence.getInstance().getServerUUID().equals(residence.getOwnerUUID())
|| Residence.getInstance().getEmptyUserUUID().equals(residence.getOwnerUUID());
}
}

0 comments on commit f749375

Please sign in to comment.