Merge pull request #81 from tylermurphy534/1.6.2

1.6.2
This commit is contained in:
Tyler Murphy 2022-08-18 14:59:26 -04:00 committed by GitHub
commit 87a859a5db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 43 additions and 12 deletions

View file

@ -1,7 +1,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion>
<groupId>net.tylermurphy</groupId>
<artifactId>KenshinsHideAndSeek</artifactId>
<version>1.6.1</version>
<version>1.6.2</version>
<name>Hide and Seek Plugin</name>
<build>
@ -123,7 +123,7 @@
<dependency>
<groupId>com.github.cryptomorin</groupId>
<artifactId>XSeries</artifactId>
<version>8.7.1</version>
<version>9.0.0</version>
</dependency>
<dependency>
<groupId>me.clip</groupId>

View file

@ -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)
);

View file

@ -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()));
}
}
}

View file

@ -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);
}
}

View file

@ -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);

View file

@ -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][];
}

View file

@ -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!"

View file

@ -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!"

View file

@ -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