Java Code Examples for org.bukkit.entity.Player#equals()

The following examples show how to use org.bukkit.entity.Player#equals() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PlayerComponent.java    From PGM with GNU Affero General Public License v3.0 6 votes vote down vote up
static TextComponent.Builder formatTab(Player player, @Nullable Player viewer) {
  TextComponent.Builder prefix = getPrefixComponent(player);
  TextComponent.Builder colorName = formatColor(player);

  if (isDead(player)) {
    colorName.color(TextColor.DARK_GRAY);
  }

  if (isVanished(player)) {
    colorName = formatVanished(colorName);
  }

  if (viewer != null && player.equals(viewer)) {
    colorName.decoration(TextDecoration.BOLD, true);
  }

  return prefix.append(colorName);
}
 
Example 2
Source File: ArmorListener.java    From MineTinker with GNU General Public License v3.0 6 votes vote down vote up
private void expCalculation(boolean isBlocking, ItemStack tool, EntityDamageEvent event, Player player) {
	//Armor should not get Exp when successfully blocking
	if(isBlocking && !ToolType.SHIELD.contains(tool.getType()) && ToolType.ARMOR.contains(tool.getType())) return;
	//Shield should not get Exp when not successfully blocking when getting attacked
	if(!isBlocking && player.equals(event.getEntity()) && ToolType.SHIELD.contains(tool.getType())) return;
	FileConfiguration config = MineTinker.getPlugin().getConfig();
	int amount = config.getInt("ExpPerEntityHit");

	if (config.getBoolean("EnableDamageExp")) {
		amount = (int) Math.round(event.getDamage());
	}

	if (config.getBoolean("DisableExpFromFalldamage", false)
			&& event.getCause() == EntityDamageEvent.DamageCause.FALL) {
		return;
	}

	modManager.addExp(player, tool, amount);
}
 
Example 3
Source File: TabView.java    From CardinalPGM with MIT License 6 votes vote down vote up
private void renderObs(int row) {
    TeamModule team = Teams.getTeamById("observers").get();
    boolean hasPlayer = team.contains(viewer);
    int col = hasPlayer ? 1 : 0;
    if (hasPlayer) updateTabListSlot(TabList.getPlayer(viewer), row > 19 ? 80 : row, 0);
    for (Player render : getSortedPlayerList(team)) {
        if (render.equals(viewer)) continue;
        if (row > 19) {
            updateTabListSlot(TabList.getPlayer(render), 80, 0);
        } else {
            updateTabListSlot(TabList.getPlayer(render), row, col);
            if (col++ >= 3) {
                col = 0;
                row++;
            }
        }
    }
}
 
Example 4
Source File: ShadowDive.java    From MineTinker with GNU General Public License v3.0 6 votes vote down vote up
private void hidePlayer(Player p) {
	activePlayers.add(p);

	//Clear all mob targets
	Collection<Entity> nearbyEntities = p.getWorld().getNearbyEntities(p.getLocation(), 64, 64, 64);
	for (Entity ent : nearbyEntities) {
		if (ent instanceof Creature) {
			if (p.equals(((Creature) ent).getTarget())) {
				((Creature) ent).setTarget(null);
			}
		}
	}

	//Hide from all players
	for (Player player : Bukkit.getServer().getOnlinePlayers()) {
		if (!p.equals(player)) {
			if (!player.hasPotionEffect(PotionEffectType.NIGHT_VISION)) player.hidePlayer(MineTinker.getPlugin(), p);
		}
	}
}
 
Example 5
Source File: Visibility.java    From CardinalPGM with MIT License 6 votes vote down vote up
private void resetVisibility(Player viewer, Player toSee, Optional<TeamModule> newTeam) {
    if (viewer.equals(toSee)) return;
    try {
        boolean showObs = Settings.getSettingByName("Observers") == null || !Settings.getSettingByName("Observers").getValueByPlayer(viewer).getValue().equalsIgnoreCase("none");
        if (match.isRunning()) {
            if (ObserverModule.testDead(toSee)) {
                setVisibility(viewer, toSee, false);
            } else if (ObserverModule.testObserver(viewer)) {
                setVisibility(viewer, toSee, !(newTeam.isPresent() && newTeam.get().isObserver() && !showObs));
            } else {
                setVisibility(viewer, toSee, !(newTeam.isPresent() && newTeam.get().isObserver()));
            }
        } else {
            setVisibility(viewer, toSee, showObs);
        }
    } catch (NullPointerException e) {
        viewer.showPlayer(toSee);
    }
}
 
Example 6
Source File: TabView.java    From CardinalPGM with MIT License 6 votes vote down vote up
private void renderTeam(TeamModule team, int startRow, int col, int maxRows) {
    boolean hasPlayer = team.contains(viewer);
    updateTabListSlot(TabList.getTeam(team), startRow, col);
    if (hasPlayer) updateTabListSlot(TabList.getPlayer(viewer), startRow + 1, col);
    int row = hasPlayer ? startRow + 2 : startRow + 1;
    int colOffset = 0;
    for (Player render : getSortedPlayerList(team)) {
        if (render.equals(viewer)) continue;
        if (colOffset > TabList.columnsPerTeam) {
            updateTabListSlot(TabList.getPlayer(render), 80, 0);
        } else {
            if (render.equals(viewer)) continue;
            updateTabListSlot(TabList.getPlayer(render), row, col + colOffset);
            if (row++ >= maxRows && maxRows != -1) {
                row = startRow + 1;
                colOffset++;
            }
        }
    }
}
 
Example 7
Source File: PlayerChat.java    From FunnyGuilds with Apache License 2.0 6 votes vote down vote up
private void sendMessageToGuild(Guild guild, Player player, String message) {
    if (guild == null || player == null || !player.isOnline()) {
        return;
    }

    for (User user : guild.getOnlineMembers()) {
        Player p = user.getPlayer();
        
        if (p == null) {
            continue;
        }
        
        if (!p.equals(player) || !user.getCache().isSpy()) {
            p.sendMessage(message);
        }
    }
}
 
Example 8
Source File: ModerationCommand.java    From PGM with GNU Affero General Public License v3.0 5 votes vote down vote up
private List<MatchPlayer> getAltAccounts(Player target, MatchManager manager) {
  List<MatchPlayer> sameIPs = Lists.newArrayList();
  String address = target.getAddress().getAddress().getHostAddress();

  for (Player other : Bukkit.getOnlinePlayers()) {
    if (other.getAddress().getAddress().getHostAddress().equals(address)
        && !other.equals(target)) {
      sameIPs.add(manager.getPlayer(other));
    }
  }

  return sameIPs;
}
 
Example 9
Source File: MatchManager.java    From SkyWarsReloaded with GNU General Public License v3.0 5 votes vote down vote up
public GameMap getPlayerMap(final Player v0) {
	if (v0 != null) {
        for (final GameMap gameMap : GameMap.getMaps()) {
        	for (final Player player : gameMap.getAlivePlayers()) {
        		if (v0.equals(player)) {
        			return gameMap;	
        		}
        	}
        }
	}
    return null;
}
 
Example 10
Source File: Trade.java    From TradePlus with GNU General Public License v3.0 5 votes vote down vote up
@EventHandler
public void onDrag(InventoryDragEvent event) {
  if (!(event.getWhoClicked() instanceof Player)) {
    return;
  }
  Player player = (Player) event.getWhoClicked();
  Inventory inv = event.getInventory();
  if (inv1.getViewers().contains(player) || inv2.getViewers().contains(player)) {
    if (accept1 && accept2) {
      event.setCancelled(true);
      return;
    }

    for (int slot : event.getInventorySlots()) {
      if (!InvUtils.leftSlots.contains(slot)) {
        event.setCancelled(true);
        return;
      }
    }
    if (event.getInventorySlots().size() > 0) {
      if (pl.getConfig().getBoolean("antiscam.preventchangeonaccept")
          && ((player.equals(player1) && accept1) || (player.equals(player2) && accept2))) {
        event.setCancelled(true);
        return;
      }
      Bukkit.getScheduler().runTaskLater(pl, this::updateInventories, 1L);
      click();
    }
  } else if (inv.equals(spectatorInv)) {
    event.setCancelled(true);
  }
}
 
Example 11
Source File: ExtraBackpackGUI.java    From NyaaUtils with MIT License 5 votes vote down vote up
void onInventoryClick(InventoryClickEvent event) {
        Player player = (Player) event.getWhoClicked();
        if (!player.equals(opener)) {
            player.closeInventory();
            event.setCancelled(true);
            tainted.set(false);
            return;
        }
        if (!player.equals(opened.get(owner))) {
            player.closeInventory();
            event.setCancelled(true);
            tainted.set(false);
            new Message(I18n.format("user.backpack.error_closed")).send(player);
            return;
        }
        Inventory inventory = event.getInventory();
        if (event.getAction() == InventoryAction.NOTHING && event.getSlotType() == InventoryType.SlotType.OUTSIDE) {
            if (event.isLeftClick()) {
                if (maxLine <= 6) return;
                event.setCancelled(true);
                saveScheduled.set(1);
//                saveAll(inventory);
                saveAll(extraBackpack);
                Bukkit.getScheduler().runTask(plugin, () -> this.open(prevPage()));
                return;
            } else if (event.isRightClick()) {
                if (maxLine <= 6) return;
                event.setCancelled(true);
                saveScheduled.set(1);
//                saveAll(inventory);
                saveAll(extraBackpack);
                Bukkit.getScheduler().runTask(plugin, () -> this.open(nextPage()));
                return;
            }
        }
        scheduleSaveAll(inventory);
    }
 
Example 12
Source File: UCJedisLoader.java    From UltimateChat with GNU General Public License v3.0 5 votes vote down vote up
public void sendTellMessage(CommandSender sender, String tellReceiver, String msg) {
    UltimateFancy fancy = new UltimateFancy();
    fancy.textAtStart(ChatColor.translateAlternateColorCodes('&', this.thisId));

    //spy
    if (!UCPerms.hasPerm(sender, "uchat.chat-spy.bypass")) {
        for (Player receiver : UChat.get().getServer().getOnlinePlayers()) {
            if (!receiver.getName().equals(tellReceiver) && !receiver.equals(sender) &&
                    UChat.get().isSpy.contains(receiver.getName()) && UCPerms.hasSpyPerm(receiver, "private")) {
                String spyformat = UChat.get().getUCConfig().getString("general.spy-format");

                spyformat = spyformat.replace("{output}", ChatColor.stripColor(UCMessages.sendMessage(sender, tellReceiver, msg, new UCChannel("tell")).toOldFormat()));
                receiver.sendMessage(ChatColor.translateAlternateColorCodes('&', spyformat));
            }
        }
    }

    fancy.appendString(UCMessages.sendMessage(sender, tellReceiver, msg, new UCChannel("tell")).toString());
    tellPlayers.put(tellReceiver, sender.getName());

    if (Arrays.asList(channels).contains("tellsend")) {
        Bukkit.getScheduler().runTaskAsynchronously(UChat.get(), () -> {
            Jedis jedis = pool.getResource();
            try {
                jedis.publish("tellsend", thisId + "$" + tellReceiver + "$" + fancy.toString());
            } catch (JedisConnectionException e) {
                e.printStackTrace();
            }
        });
    }
}
 
Example 13
Source File: SwitcherooListener.java    From UhcCore with GNU General Public License v3.0 5 votes vote down vote up
@EventHandler
public void onPlayerDamage(EntityDamageByEntityEvent e){
    if (!(e.getEntity() instanceof Player)){
        return;
    }

    Player player = ((Player) e.getEntity()).getPlayer();

    if (!(e.getDamager() instanceof Arrow)){
        return;
    }

    Arrow arrow = (Arrow) e.getDamager();

    if (!(arrow.getShooter() instanceof  Player)){
        return;
    }

    Player shooter = ((Player) arrow.getShooter()).getPlayer();

    if (player.equals(shooter)){
        return;
    }

    arrow.remove();

    Location playerLoc = player.getLocation();
    Location shooterLoc = shooter.getLocation();

    player.teleport(shooterLoc);
    shooter.teleport(playerLoc);

    player.sendMessage(Lang.SCENARIO_SWITCHEROO_SWITCH.replace("%player%", shooter.getName()));
    shooter.sendMessage(Lang.SCENARIO_SWITCHEROO_SWITCH.replace("%player%", player.getName()));
}
 
Example 14
Source File: NameTagChanger.java    From NameTagChanger with MIT License 5 votes vote down vote up
private void updatePlayer(Player player, String oldName) {
    Validate.isTrue(enabled, "NameTagChanger is disabled");
    GameProfileWrapper newProfile = gameProfiles.get(player.getUniqueId());
    if (newProfile == null) {
        newProfile = packetHandler.getDefaultPlayerProfile(player);
    }
    List<Team> scoreboardTeamsToUpdate = Lists.newArrayList();
    sendingPackets = true;
    for (Player otherPlayer : Bukkit.getOnlinePlayers()) {
        if (otherPlayer.equals(player)) {
            if (otherPlayer.getScoreboard().getEntryTeam(player.getName()) != null) {
                scoreboardTeamsToUpdate.add(otherPlayer.getScoreboard().getEntryTeam(player.getName()));
            }
            continue;
        }
        if (otherPlayer.canSee(player)) {
            packetHandler.sendTabListRemovePacket(player, otherPlayer);
            packetHandler.sendTabListAddPacket(player, newProfile, otherPlayer);
            if (otherPlayer.getWorld().equals(player.getWorld())) {
                packetHandler.sendEntityDestroyPacket(player, otherPlayer);
                packetHandler.sendNamedEntitySpawnPacket(player, otherPlayer);
                packetHandler.sendEntityEquipmentPacket(player, otherPlayer);
            }
        }
        // The player we want to rename is in a scoreboard team.
        if (otherPlayer.getScoreboard().getEntryTeam(player.getName()) != null) {
            scoreboardTeamsToUpdate.add(otherPlayer.getScoreboard().getEntryTeam(player.getName()));
        }
    }
    if (oldName != null) {
        String newName = newProfile.getName();
        for (Team team : scoreboardTeamsToUpdate) {
            Bukkit.getOnlinePlayers().stream().filter(p -> p.getScoreboard() == team.getScoreboard()).forEach(p -> {
                packetHandler.sendScoreboardRemovePacket(oldName, p, team.getName());
                packetHandler.sendScoreboardAddPacket(newName, p, team.getName());
            });
        }
    }
    sendingPackets = false;
}
 
Example 15
Source File: ShadowDive.java    From MineTinker with GNU General Public License v3.0 5 votes vote down vote up
private void showPlayer(Player p) {
	if (activePlayers.remove(p)) {
		for (Player player : Bukkit.getServer().getOnlinePlayers()) {
			if (!p.equals(player)) player.showPlayer(MineTinker.getPlugin(), p);
		}
	}
}
 
Example 16
Source File: TeamManagerModule.java    From CardinalPGM with MIT License 5 votes vote down vote up
@EventHandler(priority = EventPriority.LOW)
public void onPlayerJoin(PlayerJoinEvent event) {
    Player player = event.getPlayer();
    Players.resetPlayer(player);
    Teams.getTeamById("observers").get().add(player, true, false);
    event.setJoinMessage(null);
    for (Player player1 : Bukkit.getOnlinePlayers()) {
        if (!player1.equals(player)) {
            player1.sendMessage(new UnlocalizedChatMessage(ChatColor.YELLOW + "{0}", new LocalizedChatMessage(ChatConstant.UI_PLAYER_JOIN, Teams.getTeamColorByPlayer(player) + player.getDisplayName() + ChatColor.YELLOW)).getMessage(player1.getLocale()));
        }
    }
    Bukkit.getConsoleSender().sendMessage(new UnlocalizedChatMessage(ChatColor.YELLOW + "{0}", new LocalizedChatMessage(ChatConstant.UI_PLAYER_JOIN, Teams.getTeamColorByPlayer(player) + player.getDisplayName() + ChatColor.YELLOW)).getMessage(Locale.getDefault().toString()));

    sendMapMessage(player);
}
 
Example 17
Source File: BukkitFightListener.java    From Parties with GNU Affero General Public License v3.0 4 votes vote down vote up
@EventHandler (ignoreCancelled = true)
public void onPotionSplash(PotionSplashEvent event) {
	if (BukkitConfigParties.FRIENDLYFIRE_ENABLE
			&& event.getEntity() instanceof Player
			&& event.getPotion().getShooter() instanceof Player) {
		Player attacker = (Player) event.getPotion().getShooter();
		PartyPlayerImpl ppAttacker = plugin.getPlayerManager().getPlayer(attacker.getUniqueId());
		BukkitPartyImpl party = (BukkitPartyImpl) plugin.getPartyManager().getParty(ppAttacker.getPartyName());
		
		if (party != null && party.isFriendlyFireProtected() && !attacker.hasPermission(PartiesPermission.ADMIN_PROTECTION_BYPASS.toString())) {
			boolean cancel = false;
			for (PotionEffect pe : event.getEntity().getEffects()) {
				switch (pe.getType().getName().toLowerCase(Locale.ENGLISH)) {
				case "harm":
				case "blindness":
				case "confusion":
				case "poison":
				case "slow":
				case "slow_digging":
				case "weakness":
				case "unluck":
					cancel = true;
					break;
				default:
					// Do not cancel
					break;
				}
				if (cancel)
					break;
			}
			if (cancel) {
				// Friendly fire not allowed here
				for (LivingEntity e : event.getAffectedEntities()) {
					if (e instanceof Player) {
						Player victim = (Player) e;
						if (!attacker.equals(victim)) {
							PartyPlayerImpl ppVictim = plugin.getPlayerManager().getPlayer(victim.getUniqueId());
							if (ppVictim.getPartyName().equalsIgnoreCase(ppAttacker.getPartyName())) {
								// Calling API event
								BukkitPartiesPotionsFriendlyFireBlockedEvent partiesFriendlyFireEvent = ((BukkitEventManager) plugin.getEventManager()).preparePartiesPotionsFriendlyFireBlockedEvent(ppVictim, ppAttacker, event);
								plugin.getEventManager().callEvent(partiesFriendlyFireEvent);
								
								if (!partiesFriendlyFireEvent.isCancelled()) {
									// Friendly fire confirmed
									User userAttacker = plugin.getPlayer(attacker.getUniqueId());
									userAttacker.sendMessage(
											plugin.getMessageUtils().convertAllPlaceholders(BukkitMessages.ADDCMD_PROTECTION_PROTECTED, party, ppAttacker)
											, true);
									party.warnFriendlyFire(ppVictim, ppAttacker);
									
									event.setIntensity(e, 0);
									plugin.getLoggerManager().logDebug(PartiesConstants.DEBUG_FRIENDLYFIRE_DENIED
											.replace("{type}", "potion splash")
											.replace("{player}", attacker.getName())
											.replace("{victim}", victim.getName()), true);
								} else
									plugin.getLoggerManager().logDebug(PartiesConstants.DEBUG_API_FRIENDLYFIREEVENT_DENY
											.replace("{type}", "potion splash")
											.replace("{player}", attacker.getName())
											.replace("{victim}", victim.getName()), true);
							}
						}
					}
				}
			}
		}
	}
}
 
Example 18
Source File: ExtraBackpackGUI.java    From NyaaUtils with MIT License 4 votes vote down vote up
void open(int page) {
        if (tainted.get()) {
            close();
            throw new IllegalStateException();
        }
        Player currentOpener;
        //如果有玩家已经打开背包
        if ((currentOpener = opened.putIfAbsent(owner, opener)) != null) {
            if (!currentOpener.equals(opener) && opener.getOpenInventory().getTopInventory().getHolder() instanceof ExtraBackpackGUI) {
                //如果是管理员打开普通玩家背包
                if (opener.hasPermission("nu.bp.admin") && !currentOpener.hasPermission("nu.bp.admin")) {
                    Inventory inventory = currentOpener.getOpenInventory().getTopInventory();
                    if (inventory.getHolder() instanceof ExtraBackpackGUI) {
//                        ((ExtraBackpackGUI) inventory.getHolder()).saveAll(inventory);
                        ((ExtraBackpackGUI) inventory.getHolder()).saveAll(extraBackpack);
                        ((ExtraBackpackGUI) inventory.getHolder()).close();
                    }
                    new Message(I18n.format("user.backpack.force_opened")).send(currentOpener);
                } else {
                    //如果不是管理员打开普通玩家背包,通知已经打开
                    new Message(I18n.format("user.backpack.already_opened")).send(opener);
                    return;
                }
            }
        }
        currentPage = page;
        maxLine = plugin.cfg.bp_default_lines;
        extraBackpack = getInventory(owner);
        if (extraBackpack == null) {
            new Message(I18n.format("user.backpack.disabled")).send(opener);
            opened.remove(owner);
            return;
        }
//        int pageCount = (int) Math.ceil(maxLine / 6.0);
//        List<ExtraBackpackLine> view = lines.stream().skip(page * 6).limit(6).collect(Collectors.toList());
//        int viewSize = view.size();
//        if (viewSize == 0) {
//            new Message(I18n.format("user.backpack.invalid_page", page, pageCount)).send(opener);
//            opened.remove(owner);
//            return;
//        }
//        int size = viewSize * 9;
//        ItemStack[] itemStacks = view.stream().flatMap(l -> l.getItemStacks().stream()).toArray(ItemStack[]::new);
//        inventory.setContents(itemStacks);
        saveScheduled.set(-1);
//        opener.openInventory(inventory);
        opener.openInventory(extraBackpack.inventories.get(currentPage));
        saveScheduled.set(0);
        if (daemonTask == null) {
            daemonTask = new BukkitRunnable() {
                @Override
                public void run() {
                    if (!opener.isOnline() || opener.getOpenInventory().getTopInventory().getHolder() != ExtraBackpackGUI.this) {
                        this.cancel();
                        new IllegalAccessException().printStackTrace();
                        saveScheduled.set(1);
                        saveAll(extraBackpack);
                        close();
                    }
                }
            }.runTaskTimer(plugin, 0, 0);
        }
    }
 
Example 19
Source File: FlagObjective.java    From CardinalPGM with MIT License 4 votes vote down vote up
private void spawnFlag() {
    if (!isOnPost()) {
        setLastValidBlock();
        if (currentFlagBlock == null) {
            armorStand.remove();
            currentFlagBlock = nextSpawn();
            state = FlagState.WAITING_TO_RESPAWN;
            respawnTime = getPost().getRespawnTime(picker.getLocation(), currentFlagBlock.getLocation());
            resetPlayer();
            updateFlags();
            return;
        }
    }
    currentFlagBlock.setType(banner.getMaterial());
    currentFlagBlock = currentFlagBlock.getLocation().getBlock();
    Banner newBanner = (Banner)currentFlagBlock.getState();
    newBanner.setPatterns(banner.getPatterns());
    newBanner.setBaseColor(banner.getBaseColor());
    armorStand = createArmorStand();
    if (!isOnPost()) {
        if (currentFlagBlock.getRelative(BlockFace.DOWN).getType().equals(Material.STATIONARY_WATER)) {
            currentFlagBlock.getRelative(BlockFace.DOWN).setType(Material.ICE);
            state = FlagState.DROPPED_ON_WATER;
        } else {
            state = FlagState.DROPPED;
        }
        Flags.setBannerFacing(Flags.yawToFace(picker.getLocation().getYaw()), newBanner);
        FlagDropEvent event = new FlagDropEvent(getPicker(), this);
        Bukkit.getPluginManager().callEvent(event);
    } else {
        Flags.setBannerFacing(getPost().getYaw(), newBanner);
    }
    Player oldPicker = picker;
    this.lastNet = null;
    resetPlayer();
    for (Player player : Bukkit.getOnlinePlayers()) {
        if (oldPicker != null && player.equals(oldPicker)) continue;
        getPost().tryPickupFlag(player, player.getLocation(), null, this);
        if (picker != null) break;
    }
}
 
Example 20
Source File: Freeze.java    From ProjectAres with GNU Affero General Public License v3.0 4 votes vote down vote up
public void setFrozen(@Nullable CommandSender freezer, Player freezee, boolean frozen) throws CommandException {
    if(!freezee.equals(freezer) && freezee.hasPermission("projectares.freeze.exempt")) {
        throw new ComponentCommandException(new TranslatableComponent(
            "command.freeze.exempt",
            new PlayerComponent(identityProvider.currentIdentity(freezee), NameStyle.VERBOSE)
        ));
    }

    final Identity freezerIdentity = identityProvider.createIdentity(freezer);
    final Audience freezeeAudience = audiences.get(freezee);

    final FrozenPlayer frozenPlayer = frozenPlayers.get(freezee);
    if(frozen && frozenPlayer == null) {
        frozenPlayers.put(freezee, playerFreezer.freeze(freezee));

        final BaseComponent freezeeMessage = new Component(
            new TranslatableComponent(
                "freeze.frozen",
                new PlayerComponent(freezerIdentity, NameStyle.FANCY)
            ),
            ChatColor.RED
        );

        freezeeAudience.playSound(FREEZE_SOUND);
        freezeeAudience.sendWarning(freezeeMessage, false);
        freezeeAudience.showTitle(Components.blank(), freezeeMessage, 5, 9999, 5);

        removeEntities(freezee.getLocation(), config.tntVictimRadius());

        if(freezer instanceof Player) {
            removeEntities(((Player) freezer).getLocation(), config.tntSenderRadius());
        }

        adminChannel.broadcast(CommandUtils.getDisplayName(freezer) +
                               ChatColor.RED + " froze " +
                               CommandUtils.getDisplayName(freezee));
    } else if(!frozen && frozenPlayer != null) {
        frozenPlayer.thaw();
        frozenPlayers.remove(freezee);

        freezeeAudience.hideTitle();
        freezeeAudience.playSound(THAW_SOUND);
        freezeeAudience.sendMessage(new Component(
            new TranslatableComponent(
                "freeze.unfrozen",
                new PlayerComponent(freezerIdentity, NameStyle.FANCY)
            ),
            ChatColor.GREEN
        ));

        adminChannel.broadcast(CommandUtils.getDisplayName(freezer) +
                               ChatColor.RED + " unfroze " +
                               CommandUtils.getDisplayName(freezee));
    }
}