From 77675c7ece35eccd7a97c5e374d3a4ebaa8e8984 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Wed, 11 May 2022 10:26:54 -0400 Subject: [PATCH] more big fixes --- .../net/tylermurphy/hideAndSeek/database/PlayerInfoTable.java | 4 ++-- .../java/net/tylermurphy/hideAndSeek/game/EventListener.java | 2 +- src/main/java/net/tylermurphy/hideAndSeek/game/Game.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/tylermurphy/hideAndSeek/database/PlayerInfoTable.java b/src/main/java/net/tylermurphy/hideAndSeek/database/PlayerInfoTable.java index 2bf5ed5..bcd5516 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/database/PlayerInfoTable.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/database/PlayerInfoTable.java @@ -211,8 +211,8 @@ public class PlayerInfoTable { statement.setBytes(1, encodeUUID(uuid)); statement.setInt(2, info.hider_wins + (winners.contains(uuid) && type == WinType.HIDER_WIN ? 1 : 0)); statement.setInt(3, info.seeker_wins + (winners.contains(uuid) && type == WinType.SEEKER_WIN ? 1 : 0)); - statement.setInt(4, info.hider_games + (Board.isHider(uuid) ? 1 : 0)); - statement.setInt(5, info.seeker_games + (Board.isSeeker(uuid) ? 1 : 0)); + statement.setInt(4, info.hider_games + (Board.isHider(uuid) || (Board.isSeeker(uuid) && !Board.getFirstSeeker().getUniqueId().equals(uuid)) ? 1 : 0)); + statement.setInt(5, info.seeker_games + (Board.getFirstSeeker().getUniqueId().equals(uuid) ? 1 : 0)); statement.setInt(6, info.hider_kills + (Board.isHider(uuid) ? hider_kills.getOrDefault(uuid.toString(), 0) : 0)); statement.setInt(7, info.seeker_kills + (Board.isSeeker(uuid) ? seeker_kills.getOrDefault(uuid.toString(), 0) : 0)); statement.setInt(8, info.hider_deaths + (Board.isHider(uuid) ? hider_deaths.getOrDefault(uuid.toString(), 0) : 0)); diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/EventListener.java b/src/main/java/net/tylermurphy/hideAndSeek/game/EventListener.java index 1c02685..17bd65a 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/game/EventListener.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/game/EventListener.java @@ -228,7 +228,7 @@ public class EventListener implements Listener { Board.addSeeker(player); } // Add leaderboard kills if attacker - if(attacker != null && ( Board.isHider(player) || Board.getFirstSeeker().getName().equals(player.getName()) ) ) + if(attacker != null && ( Board.isHider(attacker) || Board.getFirstSeeker().getName().equals(attacker.getName()) ) ) Board.addKill(attacker.getUniqueId()); Game.resetPlayer(player); Board.reloadBoardTeams(); diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java b/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java index 69153f2..f30f4d1 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java @@ -189,8 +189,8 @@ public class Game { for(Player player2 : Board.getPlayers()){ player.showPlayer(player2); } - player.setFlying(false); player.setAllowFlight(false); + player.setFlying(false); if(Version.atLeast("1.9")){ for(Player temp : Board.getPlayers()) { Packet.setGlow(player, temp, false); @@ -314,8 +314,8 @@ public class Game { } Board.createGameBoard(player); player.teleport(new Location(Bukkit.getWorld(getGameWorld()), spawnPosition.getX(),spawnPosition.getY(),spawnPosition.getZ())); - player.setFlying(true); player.setAllowFlight(true); + player.setFlying(true); player.setFallDistance(0.0F); Titles.sendTitle(player, 10, 70, 20, ChatColor.GRAY + "" + ChatColor.BOLD + "SPECTATING", ChatColor.WHITE + message("SPECTATOR_SUBTITLE").toString()); }