Rebase pom.xml
This commit is contained in:
parent
35d9e912d5
commit
d8da188f02
6 changed files with 43 additions and 18 deletions
6
pom.xml
6
pom.xml
|
@ -1,6 +1,10 @@
|
|||
<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>
|
||||
<project xmlns="http://maven.apache.org/POM/3.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>
|
||||
<<<<<<< HEAD
|
||||
<artifactId>KenshinsHideAndSeek</artifactId>
|
||||
=======
|
||||
<artifactId>HideAndSeek</artifactId>
|
||||
>>>>>>> 06b31297d3d83a0c7b76230be1b089bdfd8e4afa
|
||||
<version>1.3.3</version>
|
||||
<name>Hide and Seek Plugin</name>
|
||||
<build>
|
||||
|
|
|
@ -7,7 +7,7 @@ public class About implements ICommand {
|
|||
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
sender.sendMessage(
|
||||
String.format("%s%sHide and Seek %s(1.3.2%s)\n", ChatColor.AQUA, ChatColor.BOLD, ChatColor.GRAY,ChatColor.WHITE,ChatColor.GRAY) +
|
||||
String.format("%s%sHide and Seek %s(1.3.3%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)
|
||||
);
|
||||
|
|
|
@ -78,6 +78,7 @@ public class Items {
|
|||
if(material == Material.POTION || material == Material.SPLASH_POTION || material == Material.LINGERING_POTION){
|
||||
PotionMeta meta = getPotionMeta(stack, item);
|
||||
stack.setItemMeta(meta);
|
||||
|
||||
} else {
|
||||
ConfigurationSection enchantments = item.getConfigurationSection("enchantments");
|
||||
if (enchantments != null)
|
||||
|
|
|
@ -3,11 +3,7 @@ package net.tylermurphy.hideAndSeek.game;
|
|||
import static net.tylermurphy.hideAndSeek.configuration.Config.*;
|
||||
|
||||
import net.tylermurphy.hideAndSeek.command.Join;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -21,9 +17,7 @@ import org.bukkit.event.entity.EntityRegainHealthEvent;
|
|||
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
|
||||
import org.bukkit.event.entity.FoodLevelChangeEvent;
|
||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerKickEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.event.player.*;
|
||||
|
||||
import net.tylermurphy.hideAndSeek.util.Packet;
|
||||
import net.tylermurphy.hideAndSeek.util.Util;
|
||||
|
@ -36,8 +30,8 @@ public class EventListener implements Listener {
|
|||
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
event.getPlayer().setLevel(0);
|
||||
Main.plugin.board.remove(event.getPlayer());
|
||||
Util.removeItems(event.getPlayer());
|
||||
if(!Util.isSetup()) return;
|
||||
if(autoJoin){
|
||||
Join.join(event.getPlayer());
|
||||
|
@ -65,6 +59,7 @@ public class EventListener implements Listener {
|
|||
for(PotionEffect effect : event.getPlayer().getActivePotionEffects()){
|
||||
event.getPlayer().removePotionEffect(effect.getType());
|
||||
}
|
||||
Util.removeItems(event.getPlayer());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -78,6 +73,25 @@ public class EventListener implements Listener {
|
|||
for(PotionEffect effect : event.getPlayer().getActivePotionEffects()){
|
||||
event.getPlayer().removePotionEffect(effect.getType());
|
||||
}
|
||||
Util.removeItems(event.getPlayer());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onChat(AsyncPlayerChatEvent event){
|
||||
if(Main.plugin.board.isSeeker(event.getPlayer())){
|
||||
event.setCancelled(true);
|
||||
Main.plugin.board.getSpectators().forEach(spectator -> spectator.sendMessage(ChatColor.GRAY + "[SPECTATOR] " + event.getPlayer().getName() + ": " + event.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onMove(PlayerMoveEvent event){
|
||||
if(!event.getPlayer().getWorld().equals("hideandseek_" + spawnWorld)) return;
|
||||
if(event.getPlayer().hasPermission("hideandseek.leavebounds")) return;
|
||||
if(!event.getTo().getWorld().getName().equals("hideandseek_" + spawnWorld)) return;
|
||||
if(event.getTo().getBlockX() < saveMinX || event.getTo().getBlockX() > saveMinX || event.getTo().getBlockZ() < saveMinZ || event.getTo().getBlockZ() > saveMaxZ){
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
|
|
|
@ -41,7 +41,7 @@ public class CommandHandler {
|
|||
}
|
||||
|
||||
public static boolean handleCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
||||
if(sender instanceof Player == false) {
|
||||
if(!(sender instanceof Player)) {
|
||||
sender.sendMessage(errorPrefix + message("COMMAND_PLAYER_ONLY"));
|
||||
} else if(args.length < 1 || !COMMAND_REGISTER.containsKey(args[0].toLowerCase()) ) {
|
||||
if(permissionsRequired && !sender.hasPermission("hideandseek.about")) {
|
||||
|
@ -50,7 +50,7 @@ public class CommandHandler {
|
|||
COMMAND_REGISTER.get("about").execute(sender, null);
|
||||
}
|
||||
} else {
|
||||
if(!args[0].toLowerCase().equals("about") && !args[0].toLowerCase().equals("help") && SaveMap.runningBackup) {
|
||||
if(!args[0].equalsIgnoreCase("about") && !args[0].equalsIgnoreCase("help") && SaveMap.runningBackup) {
|
||||
sender.sendMessage(errorPrefix + message("MAPSAVE_INPROGRESS"));
|
||||
} else if(permissionsRequired && !sender.hasPermission("hideandseek."+args[0].toLowerCase())) {
|
||||
sender.sendMessage(errorPrefix + message("COMMAND_NOT_ALLOWED"));
|
||||
|
@ -66,8 +66,4 @@ public class CommandHandler {
|
|||
return true;
|
||||
}
|
||||
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
return CommandHandler.handleCommand(sender, command, label, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import static net.tylermurphy.hideAndSeek.configuration.Config.*;
|
|||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
|
@ -82,4 +83,13 @@ public class Util {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void removeItems(Player player){
|
||||
for(ItemStack si : Items.SEEKER_ITEMS)
|
||||
for(ItemStack i : player.getInventory().getContents())
|
||||
if(si.isSimilar(i)) player.getInventory().remove(i);
|
||||
for(ItemStack hi : Items.HIDER_ITEMS)
|
||||
for(ItemStack i : player.getInventory().getContents())
|
||||
if(hi.isSimilar(i)) player.getInventory().remove(i);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue