From 8c364fce2b24cfb43a41c934d7172aa65adf4e9c Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Tue, 16 Aug 2022 20:39:19 -0400 Subject: [PATCH 1/6] Shorten Collision Group Team Name --- .../java/net/tylermurphy/hideAndSeek/game/util/Disguise.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/util/Disguise.java b/src/main/java/net/tylermurphy/hideAndSeek/game/util/Disguise.java index e29350b..b9ea09b 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/game/util/Disguise.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/game/util/Disguise.java @@ -26,9 +26,9 @@ public class Disguise { static { if(Main.getInstance().supports(9)) { Scoreboard board = Bukkit.getScoreboardManager().getMainScoreboard(); - hidden = board.getTeam("KenshinHideAndSeek_CollisionGroup"); + hidden = board.getTeam("KHS_Collision"); if (hidden == null) { - hidden = board.registerNewTeam("KenshinHideAndSeek_CollisionGroup"); + hidden = board.registerNewTeam("KHS_Collision"); } hidden.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER); hidden.setCanSeeFriendlyInvisibles(false); From e6edb8eb3d2ed384bac4f352ffc32c3436ce9e9b Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Wed, 17 Aug 2022 14:37:05 -0400 Subject: [PATCH 2/6] update dependencides, fixed respawn timer not showing, fixed SEEKER_SPAWN is not in localization --- pom.xml | 6 +++--- .../java/net/tylermurphy/hideAndSeek/command/About.java | 2 +- src/main/resources/lang/localization_de-DE.yml | 1 + src/main/resources/lang/localization_en-US.yml | 1 + src/main/resources/plugin.yml | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 02d3a81..4e2a728 100644 --- a/pom.xml +++ b/pom.xml @@ -1,7 +1,7 @@ 4.0.0 net.tylermurphy KenshinsHideAndSeek - 1.6.1 + 1.6.2 Hide and Seek Plugin @@ -123,7 +123,7 @@ com.github.cryptomorin XSeries - 8.7.1 + 9.0.0 me.clip @@ -134,7 +134,7 @@ com.zaxxer HikariCP - 4.0.3 + 5.0.1 org.mariadb.jdbc diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/About.java b/src/main/java/net/tylermurphy/hideAndSeek/command/About.java index 7c39be2..54af32b 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/About.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/About.java @@ -26,7 +26,7 @@ public class About implements ICommand { public void execute(Player sender, String[] args) { sender.sendMessage( - String.format("%s%sHide and Seek %s(%s1.6.1%s)\n", ChatColor.AQUA, ChatColor.BOLD, ChatColor.GRAY,ChatColor.WHITE,ChatColor.GRAY) + + String.format("%s%sHide and Seek %s(%s1.6.2%s)\n", ChatColor.AQUA, ChatColor.BOLD, ChatColor.GRAY,ChatColor.WHITE,ChatColor.GRAY) + String.format("%sAuthor: %s[KenshinEto]\n", ChatColor.GRAY, ChatColor.WHITE) + String.format("%sHelp Command: %s/hs %shelp", ChatColor.GRAY, ChatColor.AQUA, ChatColor.WHITE) ); diff --git a/src/main/resources/lang/localization_de-DE.yml b/src/main/resources/lang/localization_de-DE.yml index 75523b2..9789a75 100644 --- a/src/main/resources/lang/localization_de-DE.yml +++ b/src/main/resources/lang/localization_de-DE.yml @@ -54,6 +54,7 @@ Localization: GAME_SPAWN: "Teleport-Position für Spielbeginn festgelegt" LOBBY_SPAWN: "Teleport-Position für Lobby festgelegt" EXIT_SPAWN: "Teleport-Position für Spielende festgelegt" + SEEKER_SPAWN: "Teleport-Position für Seeker Lobby festgelegt" START_MIN_PLAYERS: "Um das Spiel zu starten benötigst du mindestens {AMOUNT} Spieler." START_INVALID_NAME: "Ungültiger Spieler: {PLAYER}." START_COUNTDOWN: "Die Hider haben {AMOUNT} Sekunden Zeit sich zu verstecken!" diff --git a/src/main/resources/lang/localization_en-US.yml b/src/main/resources/lang/localization_en-US.yml index 02bc942..f03d188 100644 --- a/src/main/resources/lang/localization_en-US.yml +++ b/src/main/resources/lang/localization_en-US.yml @@ -55,6 +55,7 @@ Localization: GAME_SPAWN: "Set game spawn position to current location" LOBBY_SPAWN: "Set lobby position to current location" EXIT_SPAWN: "Set exit position to current location" + SEEKER_SPAWN: "Set seeker lobby position to current location" START_MIN_PLAYERS: "You must have at least {AMOUNT} players to start." START_INVALID_NAME: "Invalid player: {PLAYER}." START_COUNTDOWN: "Hiders have {AMOUNT} seconds to hide!" diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 1f61282..f0d8fe5 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: KenshinsHideAndSeek main: net.tylermurphy.hideAndSeek.Main -version: 1.6.1 +version: 1.6.2 author: KenshinEto load: STARTUP api-version: 1.13 From c84db28f9c190746cb890357a6e23a0791b31010 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Wed, 17 Aug 2022 14:42:32 -0400 Subject: [PATCH 3/6] undo HikariCP version change --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 4e2a728..45b173b 100644 --- a/pom.xml +++ b/pom.xml @@ -1,7 +1,7 @@ 4.0.0 net.tylermurphy KenshinsHideAndSeek - 1.6.2 + 1.6.1 Hide and Seek Plugin @@ -134,7 +134,7 @@ com.zaxxer HikariCP - 5.0.1 + 4.0.3 org.mariadb.jdbc From de83b7b26e6e0e16de6c388efba92bffc6385fb8 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Wed, 17 Aug 2022 14:57:13 -0400 Subject: [PATCH 4/6] fix 1.8 generation --- .../net/tylermurphy/hideAndSeek/world/VoidGenerator.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/tylermurphy/hideAndSeek/world/VoidGenerator.java b/src/main/java/net/tylermurphy/hideAndSeek/world/VoidGenerator.java index eadd0a9..b0ce824 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/world/VoidGenerator.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/world/VoidGenerator.java @@ -75,15 +75,11 @@ public class VoidGenerator extends ChunkGenerator { // 1.8 public byte[] generate(World world, Random random, int x, int z) { - return null; - } - - public short[][] generateExtBlockSections(World world, Random random, int x, int z, ChunkGenerator.BiomeGrid biomes) { - return null; + return new byte[world.getMaxHeight() / 16]; } public byte[][] generateBlockSections(World world, Random random, int x, int z, ChunkGenerator.BiomeGrid biomes) { - return null; + return new byte[world.getMaxHeight() / 16][]; } From ed294714ac7c83666e1cc29bf0977f4767ae592c Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Thu, 18 Aug 2022 13:43:57 -0400 Subject: [PATCH 5/6] Stop Game Items From Dropping --- pom.xml | 4 ++-- .../hideAndSeek/configuration/Items.java | 20 +++++++++++++++++++ .../game/listener/PlayerHandler.java | 13 ++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 45b173b..4c3ea75 100644 --- a/pom.xml +++ b/pom.xml @@ -1,7 +1,7 @@ 4.0.0 net.tylermurphy KenshinsHideAndSeek - 1.6.1 + 1.6.2 Hide and Seek Plugin @@ -95,7 +95,7 @@ org.spigotmc spigot-api - 1.13-R0.1-SNAPSHOT + 1.8-R0.1-SNAPSHOT provided diff --git a/src/main/java/net/tylermurphy/hideAndSeek/configuration/Items.java b/src/main/java/net/tylermurphy/hideAndSeek/configuration/Items.java index dfdb197..06dbb99 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/configuration/Items.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/configuration/Items.java @@ -21,6 +21,7 @@ package net.tylermurphy.hideAndSeek.configuration; import com.cryptomorin.xseries.XItemStack; import net.tylermurphy.hideAndSeek.Main; +import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; @@ -129,4 +130,23 @@ public class Items { item.getBoolean("particles") ); } + + public static boolean matchItem(ItemStack stack){ + for(ItemStack check : HIDER_ITEMS) + if(equals(stack,check)) return true; + for(ItemStack check : SEEKER_ITEMS) + if(equals(stack,check)) return true; + return false; + } + + private static boolean equals(ItemStack a, ItemStack b) { + if (a == null) { + return false; + } else if (a == b) { + return true; + } else { + return a.getType() == b.getType() && a.hasItemMeta() == b.hasItemMeta() && (!a.hasItemMeta() || Bukkit.getItemFactory().equals(a.getItemMeta(), b.getItemMeta())); + } + } + } diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/listener/PlayerHandler.java b/src/main/java/net/tylermurphy/hideAndSeek/game/listener/PlayerHandler.java index d8790fd..1e7ba69 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/game/listener/PlayerHandler.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/game/listener/PlayerHandler.java @@ -1,13 +1,18 @@ package net.tylermurphy.hideAndSeek.game.listener; import net.tylermurphy.hideAndSeek.Main; +import net.tylermurphy.hideAndSeek.configuration.Items; +import net.tylermurphy.hideAndSeek.game.Game; +import net.tylermurphy.hideAndSeek.game.util.Status; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityRegainHealthEvent; import org.bukkit.event.entity.FoodLevelChangeEvent; +import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.player.PlayerDropItemEvent; +import org.bukkit.inventory.ItemStack; public class PlayerHandler implements Listener { @@ -36,4 +41,12 @@ public class PlayerHandler implements Listener { } } + @EventHandler(priority = EventPriority.HIGHEST) + public void onItemSpawn(ItemSpawnEvent event){ + if(Main.getInstance().getGame().getStatus() == Status.STANDBY) return; + ItemStack item = event.getEntity().getItemStack(); + if(!Items.matchItem(item)) return; + event.setCancelled(true); + } + } From 9cb6bfe8d7e2fb8d43c93d34e4f765e42553ee21 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Thu, 18 Aug 2022 13:45:30 -0400 Subject: [PATCH 6/6] fix pom --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4c3ea75..dfd99ff 100644 --- a/pom.xml +++ b/pom.xml @@ -95,7 +95,7 @@ org.spigotmc spigot-api - 1.8-R0.1-SNAPSHOT + 1.13-R0.1-SNAPSHOT provided