@EventHandler
public void onPlayerInteractAtEntity(PlayerInteractAtEntityEvent event) {
Player player = event.getPlayer();
Entity entity = event.getRightClicked();
if (entity.getCustomName() != null && entity.getCustomName().toLowerCase().contains("join deathswap")) {
if (GameState.isGameState(GameState.LOBBY)) {
if (DeathSwap.getInstance().isInQueue(player)) {
player.sendMessage(ChatUtil.formatWithPrefix("You're already in the DeathSwap queue!"));
return;
}
player.sendMessage(ChatUtil.formatWithPrefix("You're in the DeathSwap queue."));
DeathSwap.getInstance().joinQueue(player);
player.closeInventory();
event.setCancelled(true);
}
}
}
PlayerInteract.java 文件源码
java
阅读 19
收藏 0
点赞 0
评论 0
项目:MCDeathSwap
作者:
评论列表
文章目录