use of com.massivecraft.factions.FPlayer in project WildLoaders by BG-Software-LLC.
the class ClaimsProvider_FactionsUUID method hasClaimAccess.
@Override
public boolean hasClaimAccess(UUID player, Chunk chunk) {
FPlayer fPlayer = FPlayers.getInstance().getById(player.toString());
FLocation fLocation = new FLocation(chunk.getWorld().getName(), chunk.getX(), chunk.getZ());
Faction faction = Board.getInstance().getFactionAt(fLocation);
return !faction.isWilderness() && faction.getFPlayers().contains(fPlayer);
}
use of com.massivecraft.factions.FPlayer in project SilkSpawners by timbru31.
the class SilkSpawnersPlayerListener method checkIfFactionsPermitsBlockInteractions.
public boolean checkIfFactionsPermitsBlockInteractions(final Player player, final Block block) {
if (plugin.config.getBoolean("factionsSupport", false) && su.isPluginEnabled("Factions")) {
try {
final MPlayer mp = MPlayer.get(player);
final Faction blockFaction = BoardColl.get().getFactionAt(PS.valueOf(block.getLocation()));
if (!blockFaction.isNone() && !mp.isInOwnTerritory()) {
su.sendMessage(player, ChatColor.translateAlternateColorCodes('\u0026', plugin.localization.getString("changingDeniedFactions")));
return false;
}
} catch (@SuppressWarnings("unused") final NoClassDefFoundError e) {
// Try for legacy 1.6 factions, e.g. FactionsUUID
final FPlayers fPlayers = FPlayers.getInstance();
final FPlayer fPlayer = fPlayers.getByPlayer(player);
final Board board = Board.getInstance();
final com.massivecraft.factions.Faction blockFaction = board.getFactionAt(new FLocation(block.getLocation()));
if (!blockFaction.isWilderness() && !fPlayer.isInOwnTerritory()) {
su.sendMessage(player, ChatColor.translateAlternateColorCodes('\u0026', plugin.localization.getString("changingDeniedFactions")));
return false;
}
}
}
return true;
}
use of com.massivecraft.factions.FPlayer in project UltimateChat by FabioZumbi12.
the class UCSFactionsHook method formatFac.
@Override
public String formatFac(String text, Player sender, Object receiver) {
FPlayer fp = FPlayers.getInstance().getByPlayer(sender);
if (!fp.getFaction().isWilderness()) {
Faction fac = fp.getFaction();
text = text.replace("{fac-id}", fac.getId()).replace("{fac-name}", fac.getTag()).replace("{fac-description}", fac.getDescription());
// Saber doesn't have MOTD support
if (receiver instanceof Player) {
FPlayer recmp = FPlayers.getInstance().getByPlayer((Player) receiver);
text = text.replace("{fac-relation-name}", fac.getTag(recmp)).replace("{fac-relation-color}", fac.getColorTo(recmp).toString());
}
}
return text;
}
use of com.massivecraft.factions.FPlayer in project Histeria by zelytra.
the class ChatListener method onPlayerChat.
@EventHandler
public void onPlayerChat(AsyncChatEvent e) {
e.setCancelled(true);
if (CustomPlayer.getCustomPlayer(e.getPlayer().getName()).isMute()) {
Mute mute = CustomPlayer.getCustomPlayer(e.getPlayer().getName()).getMute();
LangMessage.sendMessage(e.getPlayer(), Message.HISTBAN.getMsg() + "§c", "command.playerMute", "§c " + mute.getReason());
return;
}
if (PlainComponentSerializer.plain().serialize(e.message()).startsWith("!") && Utils.canByPass(e.getPlayer())) {
for (Player player : Bukkit.getOnlinePlayers()) if (Utils.canByPass(player))
player.sendMessage("§6[§eSTAFF§6] §e" + e.getPlayer().getName() + "§6 > §f" + PlainComponentSerializer.plain().serialize(e.message()).substring(1));
Histeria.log("§6[§eSTAFF§6] §e" + e.getPlayer().getName() + "§6 > §f" + PlainComponentSerializer.plain().serialize(e.message()).substring(1), LogType.INFO);
return;
}
if (Histeria.isSaberFaction()) {
FPlayer fplayer = FPlayers.getInstance().getByPlayer(e.getPlayer());
if (fplayer.getChatMode() == ChatMode.ALLIANCE || fplayer.getChatMode() == ChatMode.FACTION) {
new DiscordLog(WebHookType.CHAT, fplayer.getChatMode().name() + " " + e.getPlayer().getName() + " > " + PlainComponentSerializer.plain().serialize(e.message()));
return;
}
}
ChatManager chatManager = new ChatManager(e.getPlayer(), PlainComponentSerializer.plain().serialize(e.message()));
Bukkit.broadcast(chatManager.getProcessMessage());
new DiscordLog(WebHookType.CHAT, e.getPlayer().getName() + " > " + PlainComponentSerializer.plain().serialize(e.message()));
}
use of com.massivecraft.factions.FPlayer in project Histeria by zelytra.
the class ChatManager method getProcessMessage.
public TextComponent getProcessMessage() {
GroupFX groupFX = GroupFX.getByName(this.group);
TextComponent.Builder processMessage;
processMessage = Component.text().content(groupFX.getBadge().toString() + " ").color(NamedTextColor.WHITE);
if (Histeria.isSaberFaction()) {
FPlayer fplayer = FPlayers.getInstance().getByPlayer(player);
processMessage.append(Component.text().content("§7[" + (fplayer.getFaction().getTag().equalsIgnoreCase("§2wilderness") ? "" : fplayer.getFaction().getTag()) + "] "));
}
processMessage.append(Component.text().content(player.getName()).color(groupFX.getNameColor())).append(Component.text().content(groupFX.getSplitter()).color(groupFX.getSplittercolor()));
if (canUseEmote)
processMessage = processEmote(processMessage);
else
for (String word : message.split(" ")) processMessage.append(Component.text().content(word + " ").color(groupFX.getMessageColor()));
return processMessage.build();
}
Aggregations