use of com.bekvon.bukkit.residence.protection.ClaimedResidence in project Bookshelf by LOOHP.
the class ResidenceEvents method onResidenceCheck.
@EventHandler(priority = EventPriority.LOWEST)
public void onResidenceCheck(PlayerOpenBookshelfEvent event) {
if (!Bookshelf.residenceHook) {
return;
}
Player player = event.getPlayer();
ClaimedResidence area = ResidenceApi.getResidenceManager().getByLoc(event.getLocation());
if (area == null) {
return;
}
if (!area.getPermissions().playerHas(player, Flags.container, true)) {
event.setCancelled(true);
String message = Residence.getInstance().getLM().getMessage("Language.Flag.Deny").replace("%1", Flags.container.name());
player.sendMessage(message);
}
}
use of com.bekvon.bukkit.residence.protection.ClaimedResidence in project Depenizen by DenizenScript.
the class ResidenceTag method valueOf.
@Fetchable("residence")
public static ResidenceTag valueOf(String string, TagContext context) {
if (string == null) {
return null;
}
// //////
// Match residence name
string = string.replace("residence@", "");
ClaimedResidence residence = Residence.getInstance().getResidenceManagerAPI().getByName(string);
if (residence == null) {
return null;
}
return new ResidenceTag(residence);
}
Aggregations