Merge branch 'pull/54'
# Conflicts: # pom.xml
This commit is contained in:
commit
f1647babf8
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,6 @@
|
|||||||
target/
|
target/
|
||||||
lib/
|
lib/
|
||||||
/bin/
|
/bin/
|
||||||
|
|
||||||
|
.idea/
|
||||||
|
*.iml
|
||||||
|
4
pom.xml
4
pom.xml
@ -2,13 +2,13 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>nl.Steffion</groupId>
|
<groupId>nl.Steffion</groupId>
|
||||||
<artifactId>BlockHunt</artifactId>
|
<artifactId>BlockHunt</artifactId>
|
||||||
<version>0.4.0-SNAPSHOT</version>
|
<version>0.5.0-SNAPSHOT</version>
|
||||||
<name>BlockHunt</name>
|
<name>BlockHunt</name>
|
||||||
<properties>
|
<properties>
|
||||||
<plugin.version>${project.version}-${buildnumber}</plugin.version>
|
<plugin.version>${project.version}-${buildnumber}</plugin.version>
|
||||||
<buildnumber />
|
<buildnumber />
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<spigot.api.version>1.13</spigot.api.version>
|
<spigot.api.version>1.15</spigot.api.version>
|
||||||
<spigot.version>${spigot.api.version}.2-R0.1-SNAPSHOT</spigot.version>
|
<spigot.version>${spigot.api.version}.2-R0.1-SNAPSHOT</spigot.version>
|
||||||
</properties>
|
</properties>
|
||||||
<scm>
|
<scm>
|
||||||
|
@ -5,9 +5,8 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import nl.Steffion.BlockHunt.Serializables.LocationSerializable;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Location;
|
||||||
import org.bukkit.configuration.serialization.ConfigurationSerializable;
|
import org.bukkit.configuration.serialization.ConfigurationSerializable;
|
||||||
import org.bukkit.configuration.serialization.SerializableAs;
|
import org.bukkit.configuration.serialization.SerializableAs;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -17,8 +16,8 @@ import org.bukkit.scoreboard.Scoreboard;
|
|||||||
@SerializableAs("BlockHuntArena")
|
@SerializableAs("BlockHuntArena")
|
||||||
public class Arena implements ConfigurationSerializable {
|
public class Arena implements ConfigurationSerializable {
|
||||||
public String arenaName;
|
public String arenaName;
|
||||||
public LocationSerializable pos1;
|
public Location pos1;
|
||||||
public LocationSerializable pos2;
|
public Location pos2;
|
||||||
public int maxPlayers;
|
public int maxPlayers;
|
||||||
public int minPlayers;
|
public int minPlayers;
|
||||||
public int amountSeekersOnStart;
|
public int amountSeekersOnStart;
|
||||||
@ -33,10 +32,10 @@ public class Arena implements ConfigurationSerializable {
|
|||||||
public boolean seekersTakeFallDamage;
|
public boolean seekersTakeFallDamage;
|
||||||
public boolean hidersTakeFallDamage;
|
public boolean hidersTakeFallDamage;
|
||||||
public ArrayList<ItemStack> disguiseBlocks;
|
public ArrayList<ItemStack> disguiseBlocks;
|
||||||
public LocationSerializable lobbyWarp;
|
public Location lobbyWarp;
|
||||||
public LocationSerializable hidersWarp;
|
public Location hidersWarp;
|
||||||
public LocationSerializable seekersWarp;
|
public Location seekersWarp;
|
||||||
public LocationSerializable spawnWarp;
|
public Location spawnWarp;
|
||||||
public List<String> seekersWinCommands;
|
public List<String> seekersWinCommands;
|
||||||
public List<String> hidersWinCommands;
|
public List<String> hidersWinCommands;
|
||||||
public List<String> allowedCommands;
|
public List<String> allowedCommands;
|
||||||
@ -50,10 +49,10 @@ public class Arena implements ConfigurationSerializable {
|
|||||||
public List<Player> seekers;
|
public List<Player> seekers;
|
||||||
public Scoreboard scoreboard;
|
public Scoreboard scoreboard;
|
||||||
|
|
||||||
public Arena(String arenaName, LocationSerializable pos1, LocationSerializable pos2, int maxPlayers, int minPlayers, int amountSeekersOnStart,
|
public Arena(String arenaName, Location pos1, Location pos2, int maxPlayers, int minPlayers, int amountSeekersOnStart,
|
||||||
int timeInLobbyUntilStart, int waitingTimeSeeker, int gameTime, int timeUntilHidersSword, int blockAnnouncerTime,
|
int timeInLobbyUntilStart, int waitingTimeSeeker, int gameTime, int timeUntilHidersSword, int blockAnnouncerTime,
|
||||||
boolean seekersCanHurtSeekers, boolean hidersCanHurtSeekers, boolean hidersCanHurtHiders, boolean seekersTakeFallDamage, boolean hidersTakeFallDamage,
|
boolean seekersCanHurtSeekers, boolean hidersCanHurtSeekers, boolean hidersCanHurtHiders, boolean seekersTakeFallDamage, boolean hidersTakeFallDamage,
|
||||||
ArrayList<ItemStack> disguiseBlocks, LocationSerializable lobbyWarp, LocationSerializable hidersWarp, LocationSerializable seekersWarp, LocationSerializable spawnWarp,
|
ArrayList<ItemStack> disguiseBlocks, Location lobbyWarp, Location hidersWarp, Location seekersWarp, Location spawnWarp,
|
||||||
List<String> seekersWinCommands, List<String> hidersWinCommands, List<String> allowedCommands, int seekersTokenWin, int hidersTokenWin, int killTokens,
|
List<String> seekersWinCommands, List<String> hidersWinCommands, List<String> allowedCommands, int seekersTokenWin, int hidersTokenWin, int killTokens,
|
||||||
List<Player> playersInArena, ArenaState gameState, int timer, List<Player> seekers, Scoreboard scoreboard) {
|
List<Player> playersInArena, ArenaState gameState, int timer, List<Player> seekers, Scoreboard scoreboard) {
|
||||||
this.arenaName = arenaName;
|
this.arenaName = arenaName;
|
||||||
@ -83,7 +82,6 @@ public class Arena implements ConfigurationSerializable {
|
|||||||
this.seekersTokenWin = seekersTokenWin;
|
this.seekersTokenWin = seekersTokenWin;
|
||||||
this.hidersTokenWin = hidersTokenWin;
|
this.hidersTokenWin = hidersTokenWin;
|
||||||
this.killTokens = killTokens;
|
this.killTokens = killTokens;
|
||||||
|
|
||||||
this.playersInArena = playersInArena;
|
this.playersInArena = playersInArena;
|
||||||
this.gameState = gameState;
|
this.gameState = gameState;
|
||||||
this.timer = timer;
|
this.timer = timer;
|
||||||
@ -124,9 +122,14 @@ public class Arena implements ConfigurationSerializable {
|
|||||||
map.put("amountSeekersOnStart", amountSeekersOnStart);
|
map.put("amountSeekersOnStart", amountSeekersOnStart);
|
||||||
map.put("timeInLobbyUntilStart", timeInLobbyUntilStart);
|
map.put("timeInLobbyUntilStart", timeInLobbyUntilStart);
|
||||||
map.put("waitingTimeSeeker", waitingTimeSeeker);
|
map.put("waitingTimeSeeker", waitingTimeSeeker);
|
||||||
map.put("blockAnnouncerTime", blockAnnouncerTime);
|
|
||||||
map.put("gameTime", gameTime);
|
map.put("gameTime", gameTime);
|
||||||
map.put("timeUntilHidersSword", timeUntilHidersSword);
|
map.put("timeUntilHidersSword", timeUntilHidersSword);
|
||||||
|
map.put("blockAnnouncerTime", blockAnnouncerTime);
|
||||||
|
map.put("seekersCanHurtSeekers", seekersCanHurtSeekers);
|
||||||
|
map.put("hidersCanHurtSeekers", hidersCanHurtSeekers);
|
||||||
|
map.put("hidersCanHurtHiders", hidersCanHurtHiders);
|
||||||
|
map.put("seekersTakeFallDamage", seekersTakeFallDamage);
|
||||||
|
map.put("hidersTakeFallDamage", hidersTakeFallDamage);
|
||||||
map.put("disguiseBlocks", disguiseBlocks);
|
map.put("disguiseBlocks", disguiseBlocks);
|
||||||
map.put("lobbyWarp", lobbyWarp);
|
map.put("lobbyWarp", lobbyWarp);
|
||||||
map.put("hidersWarp", hidersWarp);
|
map.put("hidersWarp", hidersWarp);
|
||||||
@ -143,15 +146,36 @@ public class Arena implements ConfigurationSerializable {
|
|||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static Arena deserialize(Map<String, Object> map) {
|
public static Arena deserialize(Map<String, Object> map) {
|
||||||
LocationSerializable loc = new LocationSerializable(Bukkit.getWorld("world"), 0, 0, 0, 0, 0);
|
Location loc = new Location(Bukkit.getWorld("world"), 0, 0, 0, 0, 0);
|
||||||
return new Arena((String) map.getOrDefault("arenaName", "UNKNOWN_NAME"), (LocationSerializable) map.getOrDefault("pos1", loc), (LocationSerializable) map.getOrDefault( "pos2", loc),
|
return new Arena(
|
||||||
(Integer) map.getOrDefault( "maxPlayers", 12), (Integer) map.getOrDefault( "minPlayers", 3), (Integer) map.getOrDefault( "amountSeekersOnStart", 1), (Integer) map.getOrDefault( "timeInLobbyUntilStart", 90),
|
(String) map.getOrDefault("arenaName", "UNKNOWN_NAME"),
|
||||||
(Integer) map.getOrDefault( "waitingTimeSeeker", 20), (Integer) map.getOrDefault( "gameTime", 200), (Integer) map.getOrDefault( "timeUntilHidersSword", 30),(Integer) map.getOrDefault( "blockAnnouncerTime", 45),
|
(Location) map.getOrDefault("pos1", loc),
|
||||||
(Boolean) map.getOrDefault( "seekersCanHurtSeekers", false),(Boolean) map.getOrDefault( "hidersCanHurtSeekers", false),(Boolean) map.getOrDefault( "hidersCanHurtHiders", false),(Boolean) map.getOrDefault( "seekersTakeFallDamage", false),(Boolean) map.getOrDefault( "hidersTakeFallDamage", false),
|
(Location) map.getOrDefault("pos2", loc),
|
||||||
(ArrayList<ItemStack>) map.getOrDefault( "disguiseBlocks", new ArrayList<ItemStack>()),(LocationSerializable) map.getOrDefault( "lobbyWarp", loc), (LocationSerializable) map.getOrDefault( "hidersWarp", loc), (LocationSerializable) map.getOrDefault( "seekersWarp", loc),
|
(Integer) map.getOrDefault("maxPlayers", 12),
|
||||||
(LocationSerializable) map.getOrDefault( "spawnWarp", loc), (ArrayList<String>) map.getOrDefault( "seekersWinCommands", new ArrayList<String>()),
|
(Integer) map.getOrDefault("minPlayers", 3),
|
||||||
(ArrayList<String>) map.getOrDefault("hidersWinCommands", new ArrayList<String>()), (ArrayList<String>) map.getOrDefault( "allowedCommands", new ArrayList<String>()),
|
(Integer) map.getOrDefault("amountSeekersOnStart", 1),
|
||||||
(Integer) map.getOrDefault( "seekersTokenWin", 10), (Integer) map.getOrDefault( "hidersTokenWin", 50), (Integer) map.getOrDefault( "killTokens", 8), new ArrayList<>(),
|
(Integer) map.getOrDefault("timeInLobbyUntilStart", 90),
|
||||||
ArenaState.WAITING, 0, new ArrayList<>(), Bukkit.getScoreboardManager().getNewScoreboard());
|
(Integer) map.getOrDefault("waitingTimeSeeker", 20),
|
||||||
|
(Integer) map.getOrDefault("gameTime", 200),
|
||||||
|
(Integer) map.getOrDefault("timeUntilHidersSword", 30),
|
||||||
|
(Integer) map.getOrDefault("blockAnnouncerTime", 45),
|
||||||
|
(Boolean) map.getOrDefault("seekersCanHurtSeekers", false),
|
||||||
|
(Boolean) map.getOrDefault("hidersCanHurtSeekers", true),
|
||||||
|
(Boolean) map.getOrDefault("hidersCanHurtHiders", false),
|
||||||
|
(Boolean) map.getOrDefault("seekersTakeFallDamage", false),
|
||||||
|
(Boolean) map.getOrDefault("hidersTakeFallDamage", false),
|
||||||
|
(ArrayList<ItemStack>) map.getOrDefault("disguiseBlocks", new ArrayList<ItemStack>()),
|
||||||
|
(Location) map.getOrDefault("lobbyWarp", loc),
|
||||||
|
(Location) map.getOrDefault("hidersWarp", loc),
|
||||||
|
(Location) map.getOrDefault("seekersWarp", loc),
|
||||||
|
(Location) map.getOrDefault("spawnWarp", loc),
|
||||||
|
(ArrayList<String>) map.getOrDefault("seekersWinCommands", new ArrayList<String>()),
|
||||||
|
(ArrayList<String>) map.getOrDefault("hidersWinCommands", new ArrayList<String>()),
|
||||||
|
(ArrayList<String>) map.getOrDefault("allowedCommands", new ArrayList<String>()),
|
||||||
|
(Integer) map.getOrDefault("seekersTokenWin", 10),
|
||||||
|
(Integer) map.getOrDefault("hidersTokenWin", 50),
|
||||||
|
(Integer) map.getOrDefault("killTokens", 8),
|
||||||
|
new ArrayList<>(), ArenaState.WAITING, 0, new ArrayList<>(), Bukkit.getScoreboardManager().getNewScoreboard()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -96,6 +96,13 @@ public class ArenaHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean canWarp = PlayerHandler.teleport(player, arena.lobbyWarp);
|
||||||
|
if (!canWarp) {
|
||||||
|
MessageManager.sendFMessage(player, ConfigC.error_teleportFailed);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
System.out.println("[BlockHunt] " + player.getName() + " has joined " + arenaname);
|
System.out.println("[BlockHunt] " + player.getName() + " has joined " + arenaname);
|
||||||
arena.playersInArena.add(player);
|
arena.playersInArena.add(player);
|
||||||
JoinArenaEvent event = new JoinArenaEvent(player, arena);
|
JoinArenaEvent event = new JoinArenaEvent(player, arena);
|
||||||
@ -107,7 +114,6 @@ public class ArenaHandler {
|
|||||||
|
|
||||||
MemoryStorage.pData.put(player, pad);
|
MemoryStorage.pData.put(player, pad);
|
||||||
|
|
||||||
player.teleport(arena.lobbyWarp);
|
|
||||||
player.setGameMode(GameMode.SURVIVAL);
|
player.setGameMode(GameMode.SURVIVAL);
|
||||||
for (PotionEffect pe : player.getActivePotionEffects()) {
|
for (PotionEffect pe : player.getActivePotionEffects()) {
|
||||||
player.removePotionEffect(pe.getType());
|
player.removePotionEffect(pe.getType());
|
||||||
@ -130,14 +136,14 @@ public class ArenaHandler {
|
|||||||
// they join
|
// they join
|
||||||
for (Player otherplayer : arena.playersInArena) {
|
for (Player otherplayer : arena.playersInArena) {
|
||||||
if (otherplayer.canSee(player))
|
if (otherplayer.canSee(player))
|
||||||
otherplayer.showPlayer(player); // Make
|
otherplayer.showPlayer(BlockHunt.plugin, player); // Make
|
||||||
// new
|
// new
|
||||||
// player
|
// player
|
||||||
// visible
|
// visible
|
||||||
// to
|
// to
|
||||||
// others
|
// others
|
||||||
if (player.canSee(otherplayer))
|
if (player.canSee(otherplayer))
|
||||||
player.showPlayer(otherplayer); // Make
|
player.showPlayer(BlockHunt.plugin, otherplayer); // Make
|
||||||
// other
|
// other
|
||||||
// players
|
// players
|
||||||
// visible
|
// visible
|
||||||
@ -263,21 +269,21 @@ public class ArenaHandler {
|
|||||||
ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameSeekerChoosen, "seeker-" + seeker.getName());
|
ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameSeekerChoosen, "seeker-" + seeker.getName());
|
||||||
DisguiseAPI.undisguiseToAll(seeker);
|
DisguiseAPI.undisguiseToAll(seeker);
|
||||||
for (Player pl : Bukkit.getOnlinePlayers()) {
|
for (Player pl : Bukkit.getOnlinePlayers()) {
|
||||||
pl.showPlayer(seeker);
|
pl.showPlayer(BlockHunt.plugin, seeker);
|
||||||
}
|
}
|
||||||
seeker.getInventory().clear();
|
seeker.getInventory().clear();
|
||||||
arena.seekers.add(seeker);
|
arena.seekers.add(seeker);
|
||||||
seeker.teleport(arena.seekersWarp);
|
PlayerHandler.teleport(seeker, arena.seekersWarp);
|
||||||
MemoryStorage.seekertime.put(seeker, arena.waitingTimeSeeker);
|
MemoryStorage.seekertime.put(seeker, arena.waitingTimeSeeker);
|
||||||
seeker.setWalkSpeed(0.3F);
|
seeker.setWalkSpeed(0.3F);
|
||||||
|
|
||||||
// Fix for client not showing players after they join
|
// Fix for client not showing players after they join
|
||||||
for (Player otherplayer : arena.playersInArena) {
|
for (Player otherplayer : arena.playersInArena) {
|
||||||
if (otherplayer.canSee(player))
|
if (otherplayer.canSee(player))
|
||||||
otherplayer.showPlayer(player); // Make new player
|
otherplayer.showPlayer(BlockHunt.plugin, player); // Make new player
|
||||||
// visible to others
|
// visible to others
|
||||||
if (player.canSee(otherplayer))
|
if (player.canSee(otherplayer))
|
||||||
player.showPlayer(otherplayer); // Make other
|
player.showPlayer(BlockHunt.plugin, otherplayer); // Make other
|
||||||
// players visible
|
// players visible
|
||||||
// to new player
|
// to new player
|
||||||
}
|
}
|
||||||
@ -300,7 +306,7 @@ public class ArenaHandler {
|
|||||||
player.setHealth(pad.pHealth);
|
player.setHealth(pad.pHealth);
|
||||||
player.setFoodLevel(pad.pFood);
|
player.setFoodLevel(pad.pFood);
|
||||||
player.addPotionEffects(pad.pPotionEffects);
|
player.addPotionEffects(pad.pPotionEffects);
|
||||||
player.teleport(arena.spawnWarp);
|
PlayerHandler.teleport(player, arena.spawnWarp);
|
||||||
player.setGameMode(pad.pGameMode);
|
player.setGameMode(pad.pGameMode);
|
||||||
player.setAllowFlight(pad.pFlying);
|
player.setAllowFlight(pad.pFlying);
|
||||||
if (player.getAllowFlight()) {
|
if (player.getAllowFlight()) {
|
||||||
@ -309,9 +315,10 @@ public class ArenaHandler {
|
|||||||
player.setWalkSpeed(0.2F);
|
player.setWalkSpeed(0.2F);
|
||||||
|
|
||||||
MemoryStorage.pData.remove(player);
|
MemoryStorage.pData.remove(player);
|
||||||
|
MemoryStorage.choosenBlock.remove(player);
|
||||||
|
|
||||||
for (Player pl : Bukkit.getOnlinePlayers()) {
|
for (Player pl : Bukkit.getOnlinePlayers()) {
|
||||||
pl.showPlayer(player);
|
pl.showPlayer(BlockHunt.plugin, player);
|
||||||
if (MemoryStorage.hiddenLoc.get(player) != null) {
|
if (MemoryStorage.hiddenLoc.get(player) != null) {
|
||||||
if (MemoryStorage.hiddenLocWater.get(player) != null) {
|
if (MemoryStorage.hiddenLocWater.get(player) != null) {
|
||||||
Block pBlock = MemoryStorage.hiddenLoc.get(player).getBlock();
|
Block pBlock = MemoryStorage.hiddenLoc.get(player).getBlock();
|
||||||
|
@ -7,6 +7,7 @@ import me.libraryaddict.disguise.DisguiseAPI;
|
|||||||
import me.libraryaddict.disguise.disguisetypes.DisguiseType;
|
import me.libraryaddict.disguise.disguisetypes.DisguiseType;
|
||||||
import me.libraryaddict.disguise.disguisetypes.MiscDisguise;
|
import me.libraryaddict.disguise.disguisetypes.MiscDisguise;
|
||||||
import nl.Steffion.BlockHunt.Arena.ArenaState;
|
import nl.Steffion.BlockHunt.Arena.ArenaState;
|
||||||
|
import nl.Steffion.BlockHunt.Listeners.*;
|
||||||
import nl.Steffion.BlockHunt.PermissionsC.Permissions;
|
import nl.Steffion.BlockHunt.PermissionsC.Permissions;
|
||||||
import nl.Steffion.BlockHunt.Commands.CMDcreate;
|
import nl.Steffion.BlockHunt.Commands.CMDcreate;
|
||||||
import nl.Steffion.BlockHunt.Commands.CMDhelp;
|
import nl.Steffion.BlockHunt.Commands.CMDhelp;
|
||||||
@ -23,23 +24,10 @@ import nl.Steffion.BlockHunt.Commands.CMDshop;
|
|||||||
import nl.Steffion.BlockHunt.Commands.CMDstart;
|
import nl.Steffion.BlockHunt.Commands.CMDstart;
|
||||||
import nl.Steffion.BlockHunt.Commands.CMDtokens;
|
import nl.Steffion.BlockHunt.Commands.CMDtokens;
|
||||||
import nl.Steffion.BlockHunt.Commands.CMDwand;
|
import nl.Steffion.BlockHunt.Commands.CMDwand;
|
||||||
import nl.Steffion.BlockHunt.Listeners.OnBlockBreakEvent;
|
|
||||||
import nl.Steffion.BlockHunt.Listeners.OnBlockPlaceEvent;
|
|
||||||
import nl.Steffion.BlockHunt.Listeners.OnEntityDamageByEntityEvent;
|
|
||||||
import nl.Steffion.BlockHunt.Listeners.OnEntityDamageEvent;
|
|
||||||
import nl.Steffion.BlockHunt.Listeners.OnFoodLevelChangeEvent;
|
|
||||||
import nl.Steffion.BlockHunt.Listeners.OnInventoryClickEvent;
|
|
||||||
import nl.Steffion.BlockHunt.Listeners.OnInventoryCloseEvent;
|
|
||||||
import nl.Steffion.BlockHunt.Listeners.OnPlayerDropItemEvent;
|
|
||||||
import nl.Steffion.BlockHunt.Listeners.OnPlayerInteractEvent;
|
|
||||||
import nl.Steffion.BlockHunt.Listeners.OnPlayerMoveEvent;
|
|
||||||
import nl.Steffion.BlockHunt.Listeners.OnPlayerQuitEvent;
|
|
||||||
import nl.Steffion.BlockHunt.Listeners.OnSignChangeEvent;
|
|
||||||
import nl.Steffion.BlockHunt.Managers.CommandManager;
|
import nl.Steffion.BlockHunt.Managers.CommandManager;
|
||||||
import nl.Steffion.BlockHunt.Managers.ConfigManager;
|
import nl.Steffion.BlockHunt.Managers.ConfigManager;
|
||||||
import nl.Steffion.BlockHunt.Managers.MessageManager;
|
import nl.Steffion.BlockHunt.Managers.MessageManager;
|
||||||
import nl.Steffion.BlockHunt.Managers.PermissionsManager;
|
import nl.Steffion.BlockHunt.Managers.PermissionsManager;
|
||||||
import nl.Steffion.BlockHunt.Serializables.LocationSerializable;
|
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.commons.lang.WordUtils;
|
import org.apache.commons.lang.WordUtils;
|
||||||
@ -49,6 +37,7 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.block.data.BlockData;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.configuration.serialization.ConfigurationSerialization;
|
import org.bukkit.configuration.serialization.ConfigurationSerialization;
|
||||||
@ -121,6 +110,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
|
|||||||
getServer().getPluginManager().registerEvents(new OnFoodLevelChangeEvent(), this);
|
getServer().getPluginManager().registerEvents(new OnFoodLevelChangeEvent(), this);
|
||||||
getServer().getPluginManager().registerEvents(new OnInventoryClickEvent(), this);
|
getServer().getPluginManager().registerEvents(new OnInventoryClickEvent(), this);
|
||||||
getServer().getPluginManager().registerEvents(new OnInventoryCloseEvent(), this);
|
getServer().getPluginManager().registerEvents(new OnInventoryCloseEvent(), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new OnPlayerSwapHandItemsEvent(), this);
|
||||||
|
|
||||||
// Removed - This is handled by WorldGuard now.
|
// Removed - This is handled by WorldGuard now.
|
||||||
// getServer().getPluginManager().registerEvents(
|
// getServer().getPluginManager().registerEvents(
|
||||||
@ -129,10 +119,10 @@ public class BlockHunt extends JavaPlugin implements Listener {
|
|||||||
getServer().getPluginManager().registerEvents(new OnPlayerDropItemEvent(), this);
|
getServer().getPluginManager().registerEvents(new OnPlayerDropItemEvent(), this);
|
||||||
getServer().getPluginManager().registerEvents(new OnPlayerInteractEvent(), this);
|
getServer().getPluginManager().registerEvents(new OnPlayerInteractEvent(), this);
|
||||||
getServer().getPluginManager().registerEvents(new OnPlayerMoveEvent(), this);
|
getServer().getPluginManager().registerEvents(new OnPlayerMoveEvent(), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new OnPlayerTeleportEvent(), this);
|
||||||
getServer().getPluginManager().registerEvents(new OnPlayerQuitEvent(), this);
|
getServer().getPluginManager().registerEvents(new OnPlayerQuitEvent(), this);
|
||||||
getServer().getPluginManager().registerEvents(new OnSignChangeEvent(), this);
|
getServer().getPluginManager().registerEvents(new OnSignChangeEvent(), this);
|
||||||
|
|
||||||
ConfigurationSerialization.registerClass(LocationSerializable.class, "BlockHuntLocation");
|
|
||||||
ConfigurationSerialization.registerClass(Arena.class, "BlockHuntArena");
|
ConfigurationSerialization.registerClass(Arena.class, "BlockHuntArena");
|
||||||
|
|
||||||
pdfFile = getDescription();
|
pdfFile = getDescription();
|
||||||
@ -186,7 +176,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
ArenaHandler.loadArenas();
|
ArenaHandler.loadArenas();
|
||||||
|
|
||||||
MessageManager.sendFMessage(null, ConfigC.log_enabledPlugin, "name-" + BlockHunt.pdfFile.getName(), "version-" + BlockHunt.pdfFile.getVersion(), "autors-"
|
MessageManager.sendFMessage(null, ConfigC.log_enabledPlugin, "name-" + BlockHunt.pdfFile.getName(), "version-" + BlockHunt.pdfFile.getVersion(), "authors-"
|
||||||
+ BlockHunt.pdfFile.getAuthors().get(0));
|
+ BlockHunt.pdfFile.getAuthors().get(0));
|
||||||
|
|
||||||
// Welcome to the massive game loop!!
|
// Welcome to the massive game loop!!
|
||||||
@ -250,7 +240,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
|
|||||||
if (!arena.seekers.contains(seeker)) {
|
if (!arena.seekers.contains(seeker)) {
|
||||||
ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameSeekerChoosen, "seeker-" + seeker.getName());
|
ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameSeekerChoosen, "seeker-" + seeker.getName());
|
||||||
arena.seekers.add(seeker);
|
arena.seekers.add(seeker);
|
||||||
seeker.teleport(arena.seekersWarp);
|
PlayerHandler.teleport(seeker, arena.seekersWarp);
|
||||||
seeker.getInventory().clear();
|
seeker.getInventory().clear();
|
||||||
seeker.updateInventory();
|
seeker.updateInventory();
|
||||||
seeker.setWalkSpeed(0.3F);
|
seeker.setWalkSpeed(0.3F);
|
||||||
@ -272,24 +262,17 @@ public class BlockHunt extends JavaPlugin implements Listener {
|
|||||||
MemoryStorage.choosenBlock.remove(arenaPlayer);
|
MemoryStorage.choosenBlock.remove(arenaPlayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
MiscDisguise disguise = new MiscDisguise(DisguiseType.FALLING_BLOCK, block.getType(),0);
|
MiscDisguise disguise = new MiscDisguise(DisguiseType.FALLING_BLOCK, block.getType());
|
||||||
DisguiseAPI.disguiseToAll(arenaPlayer, disguise);
|
DisguiseAPI.disguiseToAll(arenaPlayer, disguise);
|
||||||
|
PlayerHandler.teleport(arenaPlayer, arena.hidersWarp);
|
||||||
arenaPlayer.teleport(arena.hidersWarp);
|
|
||||||
|
|
||||||
ItemStack blockCount = new ItemStack(block.getType(), 5);
|
ItemStack blockCount = new ItemStack(block.getType(), 5);
|
||||||
blockCount.setDurability(block.getDurability());
|
|
||||||
arenaPlayer.getInventory().setItem(8, blockCount);
|
arenaPlayer.getInventory().setItem(8, blockCount);
|
||||||
arenaPlayer.getInventory().setHelmet(new ItemStack(block));
|
arenaPlayer.getInventory().setHelmet(new ItemStack(block));
|
||||||
MemoryStorage.pBlock.put(arenaPlayer, block);
|
MemoryStorage.pBlock.put(arenaPlayer, block);
|
||||||
|
String blockName = block.getType().name();
|
||||||
if (block.getDurability() != 0) {
|
blockName = WordUtils.capitalizeFully(blockName.replace("_", " "));
|
||||||
MessageManager.sendFMessage(arenaPlayer, ConfigC.normal_ingameBlock,
|
MessageManager.sendFMessage(arenaPlayer, ConfigC.normal_ingameBlock,
|
||||||
"block-" + block.getType().name().replaceAll("_", "").replaceAll("BLOCK", "").toLowerCase() + ":" + block.getDurability());
|
"block-" + blockName);
|
||||||
} else {
|
|
||||||
MessageManager.sendFMessage(arenaPlayer, ConfigC.normal_ingameBlock,
|
|
||||||
"block-" + block.getType().name().replaceAll("_", "").replaceAll("BLOCK", "").toLowerCase());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -297,6 +280,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
for (Player player : arena.seekers) {
|
for (Player player : arena.seekers) {
|
||||||
if (player.getInventory().getItem(0) == null || player.getInventory().getItem(0).getType() != Material.DIAMOND_SWORD) {
|
if (player.getInventory().getItem(0) == null || player.getInventory().getItem(0).getType() != Material.DIAMOND_SWORD) {
|
||||||
|
player.getInventory().clear(); // semi prevent duping infinite swords. TODO: Fix this properly
|
||||||
ItemStack i = new ItemStack(Material.DIAMOND_SWORD, 1);
|
ItemStack i = new ItemStack(Material.DIAMOND_SWORD, 1);
|
||||||
i.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 10);
|
i.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 10);
|
||||||
player.getInventory().setItem(0, i);
|
player.getInventory().setItem(0, i);
|
||||||
@ -314,7 +298,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
|
|||||||
if (MemoryStorage.seekertime.get(player) != null) {
|
if (MemoryStorage.seekertime.get(player) != null) {
|
||||||
MemoryStorage.seekertime.put(player, MemoryStorage.seekertime.get(player) - 1);
|
MemoryStorage.seekertime.put(player, MemoryStorage.seekertime.get(player) - 1);
|
||||||
if (MemoryStorage.seekertime.get(player) <= 0) {
|
if (MemoryStorage.seekertime.get(player) <= 0) {
|
||||||
player.teleport(arena.hidersWarp);
|
PlayerHandler.teleport(player, arena.hidersWarp);
|
||||||
MemoryStorage.seekertime.remove(player);
|
MemoryStorage.seekertime.remove(player);
|
||||||
ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameSeekerSpawned, "playername-" + player.getName());
|
ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameSeekerSpawned, "playername-" + player.getName());
|
||||||
}
|
}
|
||||||
@ -326,7 +310,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
|
|||||||
if (arena.timer > 0) {
|
if (arena.timer > 0) {
|
||||||
if (arena.timer == arena.gameTime - arena.timeUntilHidersSword) {
|
if (arena.timer == arena.gameTime - arena.timeUntilHidersSword) {
|
||||||
ItemStack sword = new ItemStack(Material.WOODEN_SWORD, 1);
|
ItemStack sword = new ItemStack(Material.WOODEN_SWORD, 1);
|
||||||
sword.addUnsafeEnchantment(Enchantment.KNOCKBACK, 1);
|
sword.addUnsafeEnchantment(Enchantment.KNOCKBACK, 2);
|
||||||
for (Player arenaPlayer : arena.playersInArena) {
|
for (Player arenaPlayer : arena.playersInArena) {
|
||||||
if (!arena.seekers.contains(arenaPlayer)) {
|
if (!arena.seekers.contains(arenaPlayer)) {
|
||||||
arenaPlayer.getInventory().addItem(sword);
|
arenaPlayer.getInventory().addItem(sword);
|
||||||
@ -400,9 +384,10 @@ public class BlockHunt extends JavaPlugin implements Listener {
|
|||||||
block.setAmount(block.getAmount() - 1);
|
block.setAmount(block.getAmount() - 1);
|
||||||
} else {
|
} else {
|
||||||
Block pBlock = player.getLocation().getBlock();
|
Block pBlock = player.getLocation().getBlock();
|
||||||
if (pBlock.getType().equals(Material.AIR) || pBlock.getType().equals(Material.WATER)
|
BlockData pBlockData = pBlock.getBlockData();
|
||||||
|| pBlock.getType().equals(Material.WATER)) {
|
if (pBlockData.getMaterial().equals(Material.AIR) || pBlockData.getMaterial().equals(Material.WATER)
|
||||||
if (pBlock.getType().equals(Material.WATER) || pBlock.getType().equals(Material.WATER)) {
|
|| pBlockData.getMaterial().equals(Material.WATER)) {
|
||||||
|
if (pBlockData.getMaterial().equals(Material.WATER) || pBlockData.getMaterial().equals(Material.WATER)) {
|
||||||
MemoryStorage.hiddenLocWater.put(player, true);
|
MemoryStorage.hiddenLocWater.put(player, true);
|
||||||
} else {
|
} else {
|
||||||
MemoryStorage.hiddenLocWater.put(player, false);
|
MemoryStorage.hiddenLocWater.put(player, false);
|
||||||
@ -411,29 +396,23 @@ public class BlockHunt extends JavaPlugin implements Listener {
|
|||||||
DisguiseAPI.undisguiseToAll(player);
|
DisguiseAPI.undisguiseToAll(player);
|
||||||
for (Player pl : Bukkit.getOnlinePlayers()) {
|
for (Player pl : Bukkit.getOnlinePlayers()) {
|
||||||
if (!pl.equals(player)) {
|
if (!pl.equals(player)) {
|
||||||
pl.hidePlayer(player);
|
pl.hidePlayer(this, player);
|
||||||
pl.sendBlockChange(pBlock.getLocation(), block.getType(), (byte) block.getDurability());
|
pl.sendBlockChange(pBlock.getLocation(), block.getType().createBlockData());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
block.addUnsafeEnchantment(Enchantment.DURABILITY, 10);
|
block.addUnsafeEnchantment(Enchantment.DURABILITY, 10);
|
||||||
player.playSound(pLoc, Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1, 1);
|
player.playSound(pLoc, Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1, 1);
|
||||||
MemoryStorage.hiddenLoc.put(player, moveLoc);
|
MemoryStorage.hiddenLoc.put(player, moveLoc);
|
||||||
if (block.getDurability() != 0) {
|
String blockName = block.getType().name();
|
||||||
MessageManager.sendFMessage(
|
blockName = WordUtils.capitalizeFully(blockName.replace("_", " "));
|
||||||
player,
|
|
||||||
ConfigC.normal_ingameNowSolid,
|
|
||||||
"block-" + block.getType().name().replaceAll("_", "").replaceAll("BLOCK", "").toLowerCase() + ":"
|
|
||||||
+ block.getDurability());
|
|
||||||
} else {
|
|
||||||
MessageManager.sendFMessage(player, ConfigC.normal_ingameNowSolid, "block-"
|
MessageManager.sendFMessage(player, ConfigC.normal_ingameNowSolid, "block-"
|
||||||
+ block.getType().name().replaceAll("_", "").replaceAll("BLOCK", "").toLowerCase());
|
+ blockName);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for (Player pl : Bukkit.getOnlinePlayers()) {
|
for (Player pl : Bukkit.getOnlinePlayers()) {
|
||||||
if (!pl.equals(player)) {
|
if (!pl.equals(player)) {
|
||||||
pl.hidePlayer(player);
|
pl.hidePlayer(this, player);
|
||||||
pl.sendBlockChange(pBlock.getLocation(), block.getType(), (byte) block.getDurability());
|
pl.sendBlockChange(pBlock.getLocation(), block.getType().createBlockData());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -454,7 +433,11 @@ public class BlockHunt extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
for (Player pl : arena.playersInArena) {
|
for (Player pl : arena.playersInArena) {
|
||||||
pl.setLevel(arena.timer);
|
pl.setLevel(arena.timer);
|
||||||
|
if (arena.seekers.contains(pl)) {
|
||||||
pl.setGameMode(GameMode.SURVIVAL);
|
pl.setGameMode(GameMode.SURVIVAL);
|
||||||
|
} else {
|
||||||
|
pl.setGameMode(GameMode.ADVENTURE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SignsHandler.updateSigns(); //TODO Only do this when needed (gamestate change or player count change)
|
SignsHandler.updateSigns(); //TODO Only do this when needed (gamestate change or player count change)
|
||||||
@ -467,7 +450,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
|
|||||||
ArenaHandler.stopArena(arena, cause, ConfigC.warning_arenaStopped);
|
ArenaHandler.stopArena(arena, cause, ConfigC.warning_arenaStopped);
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageManager.sendFMessage(null, ConfigC.log_disabledPlugin, "name-" + BlockHunt.pdfFile.getName(), "version-" + BlockHunt.pdfFile.getVersion(), "autors-"
|
MessageManager.sendFMessage(null, ConfigC.log_disabledPlugin, "name-" + BlockHunt.pdfFile.getName(), "version-" + BlockHunt.pdfFile.getVersion(), "authors-"
|
||||||
+ BlockHunt.pdfFile.getAuthors().get(0));
|
+ BlockHunt.pdfFile.getAuthors().get(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -539,7 +522,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
new CMDnotfound().execute(player,cmd,label, args);;
|
new CMDnotfound().execute(player,cmd,label, args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@ import nl.Steffion.BlockHunt.Arena.ArenaState;
|
|||||||
import nl.Steffion.BlockHunt.MemoryStorage;
|
import nl.Steffion.BlockHunt.MemoryStorage;
|
||||||
import nl.Steffion.BlockHunt.Managers.MessageManager;
|
import nl.Steffion.BlockHunt.Managers.MessageManager;
|
||||||
|
|
||||||
import nl.Steffion.BlockHunt.Serializables.LocationSerializable;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -22,7 +21,7 @@ public class CMDcreate extends DefaultCMD {
|
|||||||
} else {
|
} else {
|
||||||
if (MemoryStorage.pos1.get(player) != null && MemoryStorage.pos2.get(player) != null) {
|
if (MemoryStorage.pos1.get(player) != null && MemoryStorage.pos2.get(player) != null) {
|
||||||
if (MemoryStorage.pos1.get(player).getWorld().equals(MemoryStorage.pos2.get(player).getWorld())) {
|
if (MemoryStorage.pos1.get(player).getWorld().equals(MemoryStorage.pos2.get(player).getWorld())) {
|
||||||
Arena arena = new Arena(args[1], new LocationSerializable(MemoryStorage.pos1.get(player)), new LocationSerializable(MemoryStorage.pos2.get(player)), 12, 3, 1, 50, 20, 300, 30, 45, false, false, false, false, false, new ArrayList<>(), null, null, null,
|
Arena arena = new Arena(args[1], MemoryStorage.pos1.get(player), MemoryStorage.pos2.get(player), 12, 3, 1, 50, 20, 300, 30, 45, false, false, false, false, false, new ArrayList<>(), null, null, null,
|
||||||
null, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), 10, 50, 8, new ArrayList<>(), ArenaState.WAITING,
|
null, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), 10, 50, 8, new ArrayList<>(), ArenaState.WAITING,
|
||||||
0, new ArrayList<>(), Bukkit.getScoreboardManager().getNewScoreboard());
|
0, new ArrayList<>(), Bukkit.getScoreboardManager().getNewScoreboard());
|
||||||
MemoryStorage.arenas.getFile().set(args[1], arena);
|
MemoryStorage.arenas.getFile().set(args[1], arena);
|
||||||
|
@ -23,7 +23,7 @@ public class CMDinfo extends DefaultCMD {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(Player player, Command cmd, String label, String[] args) {
|
public boolean execute(Player player, Command cmd, String label, String[] args) {
|
||||||
MessageManager.sendFMessage(player, ConfigC.chat_headerhigh, "header-" + BlockHunt.pdfFile.getName());
|
MessageManager.sendFMessage(player, ConfigC.chat_headerhigh, "header-" + BlockHunt.pdfFile.getName());
|
||||||
MessageManager.sendMessage(player, "%A%name%%N made by %A%autors%%N.", "name-" + BlockHunt.pdfFile.getName(), "autors-" + BlockHunt.pdfFile.getAuthors().get(0));
|
MessageManager.sendMessage(player, "%A%name%%N made by %A%authors%%N.", "name-" + BlockHunt.pdfFile.getName(), "authors-" + BlockHunt.pdfFile.getAuthors().get(0));
|
||||||
MessageManager.sendMessage(player, "%NVersion: %A%version%%N.", "version-" + BlockHunt.pdfFile.getVersion());
|
MessageManager.sendMessage(player, "%NVersion: %A%version%%N.", "version-" + BlockHunt.pdfFile.getVersion());
|
||||||
MessageManager.sendMessage(player, "%NType %A%helpusage% %Nfor help.", "helpusage-" + BlockHunt.CMDhelp.usage);
|
MessageManager.sendMessage(player, "%NType %A%helpusage% %Nfor help.", "helpusage-" + BlockHunt.CMDhelp.usage);
|
||||||
MessageManager.sendMessage(player, "%NDev-Page: %Ahttp://dev.bukkit.org/bukkit-plugins/blockhunt/");
|
MessageManager.sendMessage(player, "%NDev-Page: %Ahttp://dev.bukkit.org/bukkit-plugins/blockhunt/");
|
||||||
|
@ -4,7 +4,6 @@ import nl.Steffion.BlockHunt.*;
|
|||||||
import nl.Steffion.BlockHunt.MemoryStorage;
|
import nl.Steffion.BlockHunt.MemoryStorage;
|
||||||
import nl.Steffion.BlockHunt.Managers.MessageManager;
|
import nl.Steffion.BlockHunt.Managers.MessageManager;
|
||||||
|
|
||||||
import nl.Steffion.BlockHunt.Serializables.LocationSerializable;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -29,19 +28,19 @@ public class CMDsetwarp extends DefaultCMD {
|
|||||||
if (arena != null) {
|
if (arena != null) {
|
||||||
Location loc = player.getLocation();
|
Location loc = player.getLocation();
|
||||||
if (warpname.equalsIgnoreCase("lobby")) {
|
if (warpname.equalsIgnoreCase("lobby")) {
|
||||||
arena.lobbyWarp = new LocationSerializable(loc);
|
arena.lobbyWarp = loc;
|
||||||
save(arena);
|
save(arena);
|
||||||
MessageManager.sendFMessage(player, ConfigC.normal_setwarpWarpSet, "warp-" + warpname);
|
MessageManager.sendFMessage(player, ConfigC.normal_setwarpWarpSet, "warp-" + warpname);
|
||||||
} else if (warpname.equalsIgnoreCase("hiders")) {
|
} else if (warpname.equalsIgnoreCase("hiders")) {
|
||||||
arena.hidersWarp = new LocationSerializable(loc);
|
arena.hidersWarp = loc;
|
||||||
save(arena);
|
save(arena);
|
||||||
MessageManager.sendFMessage(player, ConfigC.normal_setwarpWarpSet, "warp-" + warpname);
|
MessageManager.sendFMessage(player, ConfigC.normal_setwarpWarpSet, "warp-" + warpname);
|
||||||
} else if (warpname.equalsIgnoreCase("seekers")) {
|
} else if (warpname.equalsIgnoreCase("seekers")) {
|
||||||
arena.seekersWarp = new LocationSerializable(loc);
|
arena.seekersWarp = loc;
|
||||||
save(arena);
|
save(arena);
|
||||||
MessageManager.sendFMessage(player, ConfigC.normal_setwarpWarpSet, "warp-" + warpname);
|
MessageManager.sendFMessage(player, ConfigC.normal_setwarpWarpSet, "warp-" + warpname);
|
||||||
} else if (warpname.equalsIgnoreCase("spawn")) {
|
} else if (warpname.equalsIgnoreCase("spawn")) {
|
||||||
arena.spawnWarp = new LocationSerializable(loc);
|
arena.spawnWarp = loc;
|
||||||
save(arena);
|
save(arena);
|
||||||
MessageManager.sendFMessage(player, ConfigC.normal_setwarpWarpSet, "warp-" + warpname);
|
MessageManager.sendFMessage(player, ConfigC.normal_setwarpWarpSet, "warp-" + warpname);
|
||||||
} else {
|
} else {
|
||||||
|
@ -50,8 +50,8 @@ public enum ConfigC {
|
|||||||
|
|
||||||
requireInventoryClearOnJoin(false, MemoryStorage.config),
|
requireInventoryClearOnJoin(false, MemoryStorage.config),
|
||||||
|
|
||||||
log_enabledPlugin("%TAG%N%name%&a&k + %N%version% is now Enabled. Made by %A%autors%%N.", MemoryStorage.messages), log_disabledPlugin(
|
log_enabledPlugin("%TAG%N%name%&a&k + %N%version% is now Enabled. Made by %A%authors%%N.", MemoryStorage.messages), log_disabledPlugin(
|
||||||
"%TAG%N%name%&c&k - %N%version% is now Disabled. Made by %A%autors%%N.", MemoryStorage.messages),
|
"%TAG%N%name%&c&k - %N%version% is now Disabled. Made by %A%authors%%N.", MemoryStorage.messages),
|
||||||
|
|
||||||
help_info("%NDisplays the plugin's info.", MemoryStorage.messages), help_help("%NShows a list of commands.", MemoryStorage.messages), help_reload("%NReloads all configs.", MemoryStorage.messages), help_join(
|
help_info("%NDisplays the plugin's info.", MemoryStorage.messages), help_help("%NShows a list of commands.", MemoryStorage.messages), help_reload("%NReloads all configs.", MemoryStorage.messages), help_join(
|
||||||
"%NJoins a " + BlockHunt.pdfFile.getName() + " game.", MemoryStorage.messages), help_leave("%NLeave a " + BlockHunt.pdfFile.getName() + " game.", MemoryStorage.messages), help_list(
|
"%NJoins a " + BlockHunt.pdfFile.getName() + " game.", MemoryStorage.messages), help_leave("%NLeave a " + BlockHunt.pdfFile.getName() + " game.", MemoryStorage.messages), help_list(
|
||||||
@ -81,7 +81,7 @@ public enum ConfigC {
|
|||||||
"%TAG%NYou've bought the '%A%itemname%%N' item!", MemoryStorage.messages), normal_shopChoosenBlock("%TAG%NYou've choosen to be a(n) '%A%block%%N' block!", MemoryStorage.messages), normal_shopChoosenSeeker(
|
"%TAG%NYou've bought the '%A%itemname%%N' item!", MemoryStorage.messages), normal_shopChoosenBlock("%TAG%NYou've choosen to be a(n) '%A%block%%N' block!", MemoryStorage.messages), normal_shopChoosenSeeker(
|
||||||
"%TAG%NYou've choosen to be a %Aseeker%N!", MemoryStorage.messages), normal_shopChoosenHiders("%TAG%NYou've choosen to be a %Ahider%N!", MemoryStorage.messages), normal_ingameBlocksLeft("%TAG%NRemaining blocks: %A%1%%N", MemoryStorage.messages),
|
"%TAG%NYou've choosen to be a %Aseeker%N!", MemoryStorage.messages), normal_shopChoosenHiders("%TAG%NYou've choosen to be a %Ahider%N!", MemoryStorage.messages), normal_ingameBlocksLeft("%TAG%NRemaining blocks: %A%1%%N", MemoryStorage.messages),
|
||||||
|
|
||||||
warning_lobbyNeedAtleast("%TAG%WYou need atleast %A%1%%MemoryStorage player(s) to start the game!", MemoryStorage.messages), warning_ingameNEWSeekerChoosen(
|
warning_lobbyNeedAtleast("%TAG%WYou need atleast %A%1% player(s) to start the game!", MemoryStorage.messages), warning_ingameNEWSeekerChoosen(
|
||||||
"%TAG%WThe last seeker left and a new seeker has been choosen!", MemoryStorage.messages), warning_unableToCommand(
|
"%TAG%WThe last seeker left and a new seeker has been choosen!", MemoryStorage.messages), warning_unableToCommand(
|
||||||
"%TAG%WSorry but that command is disabled in the arena.", MemoryStorage.messages), warning_ingameNoSolidPlace("%TAG%WThat's not a valid place to become solid!",
|
"%TAG%WSorry but that command is disabled in the arena.", MemoryStorage.messages), warning_ingameNoSolidPlace("%TAG%WThat's not a valid place to become solid!",
|
||||||
MemoryStorage.messages), warning_arenaStopped("%TAG%WThe arena has been forced to stop!", MemoryStorage.messages),
|
MemoryStorage.messages), warning_arenaStopped("%TAG%WThe arena has been forced to stop!", MemoryStorage.messages),
|
||||||
@ -103,7 +103,9 @@ public enum ConfigC {
|
|||||||
"%TAG%ENo player found with the name '%A%playername%%E'!", MemoryStorage.messages), error_tokensUnknownsetting("%TAG%E'%A%option%%E' is not a known option!", MemoryStorage.messages), error_shopNeedMoreTokens(
|
"%TAG%ENo player found with the name '%A%playername%%E'!", MemoryStorage.messages), error_tokensUnknownsetting("%TAG%E'%A%option%%E' is not a known option!", MemoryStorage.messages), error_shopNeedMoreTokens(
|
||||||
"%TAG%EYou need more tokens before you can buy this item.", MemoryStorage.messages), error_shopMaxSeekersReached(
|
"%TAG%EYou need more tokens before you can buy this item.", MemoryStorage.messages), error_shopMaxSeekersReached(
|
||||||
"%TAG%ESorry, the maximum amount of seekers has been reached!", MemoryStorage.messages), error_shopMaxHidersReached(
|
"%TAG%ESorry, the maximum amount of seekers has been reached!", MemoryStorage.messages), error_shopMaxHidersReached(
|
||||||
"%TAG%ESorry, the maximum amount of hiders has been reached!", MemoryStorage.messages);
|
"%TAG%ESorry, the maximum amount of hiders has been reached!", MemoryStorage.messages),
|
||||||
|
error_teleportFailed("%TAG%EUnable to teleport you into the arena.", MemoryStorage.messages),
|
||||||
|
error_teleportBlocked("%TAG%EYou cannot teleport while playing!", MemoryStorage.messages);
|
||||||
|
|
||||||
public Object value;
|
public Object value;
|
||||||
public ConfigManager config;
|
public ConfigManager config;
|
||||||
|
@ -5,11 +5,8 @@ import java.util.Collections;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import me.libraryaddict.disguise.DisguiseAPI;
|
import me.libraryaddict.disguise.DisguiseAPI;
|
||||||
import nl.Steffion.BlockHunt.Arena;
|
import nl.Steffion.BlockHunt.*;
|
||||||
import nl.Steffion.BlockHunt.Arena.ArenaState;
|
import nl.Steffion.BlockHunt.Arena.ArenaState;
|
||||||
import nl.Steffion.BlockHunt.ArenaHandler;
|
|
||||||
import nl.Steffion.BlockHunt.ConfigC;
|
|
||||||
import nl.Steffion.BlockHunt.MemoryStorage;
|
|
||||||
import nl.Steffion.BlockHunt.Managers.MessageManager;
|
import nl.Steffion.BlockHunt.Managers.MessageManager;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
@ -94,19 +91,22 @@ public class OnEntityDamageByEntityEvent implements Listener {
|
|||||||
player.setHealth(20);
|
player.setHealth(20);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
||||||
|
// try moving everything to the next tick to prevent "Removing entity while ticking" errors
|
||||||
|
Player finalDamager = damager;
|
||||||
|
player.getServer().getScheduler().runTask(BlockHunt.plugin, () -> {
|
||||||
DisguiseAPI.undisguiseToAll(player);
|
DisguiseAPI.undisguiseToAll(player);
|
||||||
MemoryStorage.pBlock.remove(player);
|
MemoryStorage.pBlock.remove(player);
|
||||||
|
|
||||||
if (!arena.seekers.contains(player)) {
|
if (!arena.seekers.contains(player)) {
|
||||||
if (MemoryStorage.shop.getFile().get(damager.getName() + ".tokens") == null) {
|
if (MemoryStorage.shop.getFile().get(finalDamager.getName() + ".tokens") == null) {
|
||||||
MemoryStorage.shop.getFile().set(damager.getName() + ".tokens", 0);
|
MemoryStorage.shop.getFile().set(finalDamager.getName() + ".tokens", 0);
|
||||||
MemoryStorage.shop.save();
|
MemoryStorage.shop.save();
|
||||||
}
|
}
|
||||||
int damagerTokens = MemoryStorage.shop.getFile().getInt(damager.getName() + ".tokens");
|
int damagerTokens = MemoryStorage.shop.getFile().getInt(finalDamager.getName() + ".tokens");
|
||||||
MemoryStorage.shop.getFile().set(damager.getName() + ".tokens", damagerTokens + arena.killTokens);
|
MemoryStorage.shop.getFile().set(finalDamager.getName() + ".tokens", damagerTokens + arena.killTokens);
|
||||||
MemoryStorage.shop.save();
|
MemoryStorage.shop.save();
|
||||||
|
|
||||||
MessageManager.sendFMessage(damager, ConfigC.normal_addedToken, "amount-" + arena.killTokens);
|
MessageManager.sendFMessage(finalDamager, ConfigC.normal_addedToken, "amount-" + arena.killTokens);
|
||||||
|
|
||||||
if (MemoryStorage.shop.getFile().get(player.getName() + ".tokens") == null) {
|
if (MemoryStorage.shop.getFile().get(player.getName() + ".tokens") == null) {
|
||||||
MemoryStorage.shop.getFile().set(player.getName() + ".tokens", 0);
|
MemoryStorage.shop.getFile().set(player.getName() + ".tokens", 0);
|
||||||
@ -121,7 +121,7 @@ public class OnEntityDamageByEntityEvent implements Listener {
|
|||||||
|
|
||||||
arena.seekers.add(player);
|
arena.seekers.add(player);
|
||||||
player.setWalkSpeed(0.3F);
|
player.setWalkSpeed(0.3F);
|
||||||
ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameHiderDied, "playername-" + player.getDisplayName(), "killer-" + damager.getDisplayName());
|
ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameHiderDied, "playername-" + player.getDisplayName(), "killer-" + finalDamager.getDisplayName());
|
||||||
|
|
||||||
int hidercount = (arena.playersInArena.size() - arena.seekers.size());
|
int hidercount = (arena.playersInArena.size() - arena.seekers.size());
|
||||||
if ((hidercount <= 3) && (hidercount > 0)) {
|
if ((hidercount <= 3) && (hidercount > 0)) {
|
||||||
@ -147,18 +147,19 @@ public class OnEntityDamageByEntityEvent implements Listener {
|
|||||||
} else {
|
} else {
|
||||||
DisguiseAPI.undisguiseToAll(player);
|
DisguiseAPI.undisguiseToAll(player);
|
||||||
MemoryStorage.seekertime.put(player, arena.waitingTimeSeeker);
|
MemoryStorage.seekertime.put(player, arena.waitingTimeSeeker);
|
||||||
player.teleport(arena.seekersWarp);
|
PlayerHandler.teleport(player, arena.seekersWarp);
|
||||||
player.setGameMode(GameMode.SURVIVAL);
|
player.setGameMode(GameMode.SURVIVAL);
|
||||||
player.setWalkSpeed(0.3F);
|
player.setWalkSpeed(0.3F);
|
||||||
|
|
||||||
// Fix for client not showing players after they join
|
// Fix for client not showing players after they join
|
||||||
for (Player otherplayer : arena.playersInArena) {
|
for (Player otherplayer : arena.playersInArena) {
|
||||||
if (otherplayer.canSee(player))
|
if (otherplayer.canSee(player))
|
||||||
otherplayer.showPlayer(player); // Make new player visible to others
|
otherplayer.showPlayer(BlockHunt.plugin, player); // Make new player visible to others
|
||||||
if (player.canSee(otherplayer))
|
if (player.canSee(otherplayer))
|
||||||
player.showPlayer(otherplayer); // Make other players visible to new player
|
player.showPlayer(BlockHunt.plugin, otherplayer); // Make other players visible to new player
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import nl.Steffion.BlockHunt.Arena.ArenaType;
|
|||||||
import nl.Steffion.BlockHunt.MemoryStorage;
|
import nl.Steffion.BlockHunt.MemoryStorage;
|
||||||
import nl.Steffion.BlockHunt.Managers.MessageManager;
|
import nl.Steffion.BlockHunt.Managers.MessageManager;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.WordUtils;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -14,6 +15,7 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
|
import org.bukkit.inventory.InventoryView;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class OnInventoryClickEvent implements Listener {
|
public class OnInventoryClickEvent implements Listener {
|
||||||
@ -23,16 +25,15 @@ public class OnInventoryClickEvent implements Listener {
|
|||||||
Player player = (Player) event.getWhoClicked();
|
Player player = (Player) event.getWhoClicked();
|
||||||
|
|
||||||
for (Arena arena : MemoryStorage.arenaList) {
|
for (Arena arena : MemoryStorage.arenaList) {
|
||||||
if (arena.playersInArena.contains(player) && !arena.seekers.contains(player)) {
|
if (arena.playersInArena.contains(player)) {
|
||||||
if (event.getSlot() == 8 || event.getSlot() == 39) {
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Inventory inv = event.getInventory();
|
Inventory inv = event.getInventory();
|
||||||
|
InventoryView invView = event.getView();
|
||||||
if (inv.getType().equals(InventoryType.CHEST)) {
|
if (inv.getType().equals(InventoryType.CHEST)) {
|
||||||
if (inv.getName().contains("DisguiseBlocks")) {
|
if (invView.getTitle().contains("DisguiseBlocks")) {
|
||||||
if (event.getCurrentItem() != null) {
|
if (event.getCurrentItem() != null) {
|
||||||
if (!event.getCurrentItem().getType().isBlock()) {
|
if (!event.getCurrentItem().getType().isBlock()) {
|
||||||
if (!event.getCurrentItem().getType().equals(Material.FLOWER_POT)) {
|
if (!event.getCurrentItem().getType().equals(Material.FLOWER_POT)) {
|
||||||
@ -46,11 +47,11 @@ public class OnInventoryClickEvent implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Early exit if this isnt a blockhunt inventory
|
// Early exit if this isnt a blockhunt inventory
|
||||||
if (!inv.getName().contains("BlockHunt"))
|
if (!invView.getTitle().contains("BlockHunt"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (inv.getName().startsWith("\u00A7r")) {
|
if (invView.getTitle().startsWith("\u00A7r")) {
|
||||||
if (inv.getName().equals(MessageManager.replaceAll("\u00A7r" + MemoryStorage.config.get(ConfigC.shop_title)))) {
|
if (invView.getTitle().equals(MessageManager.replaceAll("\u00A7r" + MemoryStorage.config.get(ConfigC.shop_title)))) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
ItemStack item = event.getCurrentItem();
|
ItemStack item = event.getCurrentItem();
|
||||||
if (MemoryStorage.shop.getFile().get(player.getName() + ".tokens") == null) {
|
if (MemoryStorage.shop.getFile().get(player.getName() + ".tokens") == null) {
|
||||||
@ -90,20 +91,22 @@ public class OnInventoryClickEvent implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
InventoryHandler.openShop(player);
|
InventoryHandler.openShop(player);
|
||||||
} else if (inv.getName().contains(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.shop_blockChooserv1Name)))) {
|
} else if (invView.getTitle().contains(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.shop_blockChooserv1Name)))) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
if (event.getCurrentItem().getType() != Material.AIR) {
|
if (event.getCurrentItem() != null) {
|
||||||
if (event.getCurrentItem().getType().isBlock()) {
|
if (event.getCurrentItem().getType().isBlock()) {
|
||||||
MemoryStorage.choosenBlock.put(player, event.getCurrentItem());
|
MemoryStorage.choosenBlock.put(player, event.getCurrentItem());
|
||||||
|
String blockName = event.getCurrentItem().getType().name();
|
||||||
|
blockName = WordUtils.capitalizeFully(blockName.replace("_", " "));
|
||||||
MessageManager.sendFMessage(player, ConfigC.normal_shopChoosenBlock, "block-"
|
MessageManager.sendFMessage(player, ConfigC.normal_shopChoosenBlock, "block-"
|
||||||
+ event.getCurrentItem().getType().toString().replaceAll("_", "").replaceAll("BLOCK", "").toLowerCase());
|
+ blockName);
|
||||||
} else {
|
} else {
|
||||||
MessageManager.sendFMessage(player, ConfigC.error_setNotABlock);
|
MessageManager.sendFMessage(player, ConfigC.error_setNotABlock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (inv.getName().contains(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.shop_BlockHuntPassv2Name)))) {
|
} else if (invView.getTitle().contains(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.shop_BlockHuntPassv2Name)))) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
if (event.getCurrentItem().getType() != Material.AIR) {
|
if (event.getCurrentItem() != null) {
|
||||||
if (event.getCurrentItem().getType().equals(Material.BLUE_WOOL)) {
|
if (event.getCurrentItem().getType().equals(Material.BLUE_WOOL)) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (Arena arena : MemoryStorage.arenaList) {
|
for (Arena arena : MemoryStorage.arenaList) {
|
||||||
@ -121,7 +124,7 @@ public class OnInventoryClickEvent implements Listener {
|
|||||||
MessageManager.sendFMessage(player, ConfigC.error_shopMaxSeekersReached);
|
MessageManager.sendFMessage(player, ConfigC.error_shopMaxSeekersReached);
|
||||||
} else {
|
} else {
|
||||||
MemoryStorage.choosenSeeker.put(player, true);
|
MemoryStorage.choosenSeeker.put(player, true);
|
||||||
player.getInventory().setItemInHand(new ItemStack(Material.AIR));
|
player.getInventory().setItemInMainHand(new ItemStack(Material.AIR));
|
||||||
player.updateInventory();
|
player.updateInventory();
|
||||||
MessageManager.sendFMessage(player, ConfigC.normal_shopChoosenSeeker);
|
MessageManager.sendFMessage(player, ConfigC.normal_shopChoosenSeeker);
|
||||||
inv.clear();
|
inv.clear();
|
||||||
@ -152,7 +155,7 @@ public class OnInventoryClickEvent implements Listener {
|
|||||||
MessageManager.sendFMessage(player, ConfigC.error_shopMaxHidersReached);
|
MessageManager.sendFMessage(player, ConfigC.error_shopMaxHidersReached);
|
||||||
} else {
|
} else {
|
||||||
MemoryStorage.choosenSeeker.put(player, false);
|
MemoryStorage.choosenSeeker.put(player, false);
|
||||||
player.getInventory().setItemInHand(new ItemStack(Material.AIR));
|
player.getInventory().setItemInMainHand(new ItemStack(Material.AIR));
|
||||||
player.updateInventory();
|
player.updateInventory();
|
||||||
MessageManager.sendFMessage(player, ConfigC.normal_shopChoosenHiders);
|
MessageManager.sendFMessage(player, ConfigC.normal_shopChoosenHiders);
|
||||||
inv.clear();
|
inv.clear();
|
||||||
|
@ -14,6 +14,7 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
|
import org.bukkit.inventory.InventoryView;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class OnInventoryCloseEvent implements Listener {
|
public class OnInventoryCloseEvent implements Listener {
|
||||||
@ -21,8 +22,9 @@ public class OnInventoryCloseEvent implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
public void onInventoryCloseEvent(InventoryCloseEvent event) {
|
public void onInventoryCloseEvent(InventoryCloseEvent event) {
|
||||||
Inventory inv = event.getInventory();
|
Inventory inv = event.getInventory();
|
||||||
|
InventoryView invView = event.getView();
|
||||||
if (inv.getType().equals(InventoryType.CHEST)) {
|
if (inv.getType().equals(InventoryType.CHEST)) {
|
||||||
if (inv.getName().contains("DisguiseBlocks")) {
|
if (invView.getTitle().contains("DisguiseBlocks")) {
|
||||||
String arenaname = inv.getItem(0).getItemMeta().getDisplayName().replaceAll(MessageManager.replaceAll("%NDisguiseBlocks of arena: %A"), "");
|
String arenaname = inv.getItem(0).getItemMeta().getDisplayName().replaceAll(MessageManager.replaceAll("%NDisguiseBlocks of arena: %A"), "");
|
||||||
|
|
||||||
Arena arena = null;
|
Arena arena = null;
|
||||||
|
@ -63,7 +63,7 @@ public class OnPlayerInteractEvent implements Listener {
|
|||||||
|
|
||||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||||
if (event.getClickedBlock() != null) {
|
if (event.getClickedBlock() != null) {
|
||||||
if (event.getClickedBlock().getType().equals(Material.SIGN) || event.getClickedBlock().getType().equals(Material.WALL_SIGN)) {
|
if (event.getClickedBlock().getState() instanceof Sign) {
|
||||||
if (SignsHandler.isSign(event.getClickedBlock().getLocation())) {
|
if (SignsHandler.isSign(event.getClickedBlock().getLocation())) {
|
||||||
Sign sign = (Sign) event.getClickedBlock().getState();
|
Sign sign = (Sign) event.getClickedBlock().getState();
|
||||||
if (sign.getLine(1) != null) {
|
if (sign.getLine(1) != null) {
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
package nl.Steffion.BlockHunt.Listeners;
|
package nl.Steffion.BlockHunt.Listeners;
|
||||||
|
|
||||||
import nl.Steffion.BlockHunt.Arena;
|
import nl.Steffion.BlockHunt.*;
|
||||||
import nl.Steffion.BlockHunt.ArenaHandler;
|
|
||||||
import nl.Steffion.BlockHunt.Arena.ArenaState;
|
import nl.Steffion.BlockHunt.Arena.ArenaState;
|
||||||
import nl.Steffion.BlockHunt.BlockHunt;
|
|
||||||
import nl.Steffion.BlockHunt.MemoryStorage;
|
|
||||||
|
|
||||||
import org.bukkit.Effect;
|
import org.bukkit.Effect;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -32,11 +29,11 @@ public class OnPlayerMoveEvent implements Listener {
|
|||||||
((arena.pos1 != null)?arena.pos1.toString():" NULL")+ " Pos2:" +
|
((arena.pos1 != null)?arena.pos1.toString():" NULL")+ " Pos2:" +
|
||||||
((arena.pos2 != null)?arena.pos2.toString():" NULL"));
|
((arena.pos2 != null)?arena.pos2.toString():" NULL"));
|
||||||
BlockHunt.plugin.getLogger().info("Player has been returned to hiderswarp due to bad arena state");
|
BlockHunt.plugin.getLogger().info("Player has been returned to hiderswarp due to bad arena state");
|
||||||
event.setCancelled(true);
|
//event.setCancelled(true);
|
||||||
Location loc = player.getLocation();
|
Location loc = player.getLocation();
|
||||||
player.playEffect(loc, Effect.ENDER_SIGNAL, null);
|
player.playEffect(loc, Effect.ENDER_SIGNAL, null);
|
||||||
player.playSound(loc, Sound.ENTITY_GHAST_SHOOT, 1, 1);
|
player.playSound(loc, Sound.ENTITY_GHAST_SHOOT, 1, 1);
|
||||||
player.teleport(arena.hidersWarp);
|
PlayerHandler.teleport(player, arena.hidersWarp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
double maxX = Math.max(arena.pos1.getX(), arena.pos2.getX());
|
double maxX = Math.max(arena.pos1.getX(), arena.pos2.getX());
|
||||||
@ -48,35 +45,35 @@ public class OnPlayerMoveEvent implements Listener {
|
|||||||
|
|
||||||
Location loc = player.getLocation();
|
Location loc = player.getLocation();
|
||||||
if (loc.getBlockX() > maxX) {
|
if (loc.getBlockX() > maxX) {
|
||||||
event.setCancelled(true);
|
//event.setCancelled(true);
|
||||||
player.playEffect(loc, Effect.ENDER_SIGNAL, null);
|
player.playEffect(loc, Effect.ENDER_SIGNAL, null);
|
||||||
player.playSound(loc, Sound.ENTITY_GHAST_SHOOT, 1, 1);
|
player.playSound(loc, Sound.ENTITY_GHAST_SHOOT, 1, 1);
|
||||||
player.teleport(arena.hidersWarp);
|
PlayerHandler.teleport(player, arena.hidersWarp);
|
||||||
} else if (loc.getBlockX() < minX) {
|
} else if (loc.getBlockX() < minX) {
|
||||||
event.setCancelled(true);
|
//event.setCancelled(true);
|
||||||
player.playEffect(loc, Effect.ENDER_SIGNAL, null);
|
player.playEffect(loc, Effect.ENDER_SIGNAL, null);
|
||||||
player.playSound(loc, Sound.ENTITY_GHAST_SHOOT, 1, 1);
|
player.playSound(loc, Sound.ENTITY_GHAST_SHOOT, 1, 1);
|
||||||
player.teleport(arena.hidersWarp);
|
PlayerHandler.teleport(player, arena.hidersWarp);
|
||||||
} else if (loc.getBlockZ() > maxZ) {
|
} else if (loc.getBlockZ() > maxZ) {
|
||||||
event.setCancelled(true);
|
//event.setCancelled(true);
|
||||||
player.playEffect(loc, Effect.ENDER_SIGNAL, null);
|
player.playEffect(loc, Effect.ENDER_SIGNAL, null);
|
||||||
player.playSound(loc, Sound.ENTITY_GHAST_SHOOT, 1, 1);
|
player.playSound(loc, Sound.ENTITY_GHAST_SHOOT, 1, 1);
|
||||||
player.teleport(arena.hidersWarp);
|
PlayerHandler.teleport(player, arena.hidersWarp);
|
||||||
} else if (loc.getBlockZ() < minZ) {
|
} else if (loc.getBlockZ() < minZ) {
|
||||||
event.setCancelled(true);
|
//event.setCancelled(true);
|
||||||
player.playEffect(loc, Effect.ENDER_SIGNAL, null);
|
player.playEffect(loc, Effect.ENDER_SIGNAL, null);
|
||||||
player.playSound(loc, Sound.ENTITY_GHAST_SHOOT, 1, 1);
|
player.playSound(loc, Sound.ENTITY_GHAST_SHOOT, 1, 1);
|
||||||
player.teleport(arena.hidersWarp);
|
PlayerHandler.teleport(player, arena.hidersWarp);
|
||||||
} else if (loc.getBlockY() > maxY) {
|
} else if (loc.getBlockY() > maxY) {
|
||||||
event.setCancelled(true);
|
//event.setCancelled(true);
|
||||||
player.playEffect(loc, Effect.ENDER_SIGNAL, null);
|
player.playEffect(loc, Effect.ENDER_SIGNAL, null);
|
||||||
player.playSound(loc, Sound.ENTITY_GHAST_SHOOT, 1, 1);
|
player.playSound(loc, Sound.ENTITY_GHAST_SHOOT, 1, 1);
|
||||||
player.teleport(arena.hidersWarp);
|
PlayerHandler.teleport(player, arena.hidersWarp);
|
||||||
} else if (loc.getBlockY() < minY) {
|
} else if (loc.getBlockY() < minY) {
|
||||||
event.setCancelled(true);
|
//event.setCancelled(true);
|
||||||
player.playEffect(loc, Effect.ENDER_SIGNAL, null);
|
player.playEffect(loc, Effect.ENDER_SIGNAL, null);
|
||||||
player.playSound(loc, Sound.ENTITY_GHAST_SHOOT, 1, 1);
|
player.playSound(loc, Sound.ENTITY_GHAST_SHOOT, 1, 1);
|
||||||
player.teleport(arena.hidersWarp);
|
PlayerHandler.teleport(player, arena.hidersWarp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,9 @@ public class OnPlayerQuitEvent implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
// @EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onPlayerJoinEvent(PlayerJoinEvent event) {
|
// public void onPlayerJoinEvent(PlayerJoinEvent event) {
|
||||||
Player playerJoining = event.getPlayer();
|
// Player playerJoining = event.getPlayer();
|
||||||
playerJoining.teleport(playerJoining.getWorld().getSpawnLocation());
|
// playerJoining.teleport(playerJoining.getWorld().getSpawnLocation());
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
package nl.Steffion.BlockHunt.Listeners;
|
||||||
|
|
||||||
|
import nl.Steffion.BlockHunt.Arena;
|
||||||
|
import nl.Steffion.BlockHunt.ArenaHandler;
|
||||||
|
import nl.Steffion.BlockHunt.MemoryStorage;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerSwapHandItemsEvent;
|
||||||
|
|
||||||
|
public class OnPlayerSwapHandItemsEvent implements Listener {
|
||||||
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
|
public void onPlayerSwapHandItemsEvent(PlayerSwapHandItemsEvent event) {
|
||||||
|
// Early exit if no one is in any arena
|
||||||
|
if (ArenaHandler.noPlayersInArenas()) return;
|
||||||
|
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
for (Arena arena : MemoryStorage.arenaList) {
|
||||||
|
if (arena.playersInArena.contains(player)) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package nl.Steffion.BlockHunt.Listeners;
|
||||||
|
|
||||||
|
import nl.Steffion.BlockHunt.ConfigC;
|
||||||
|
import nl.Steffion.BlockHunt.Managers.MessageManager;
|
||||||
|
import nl.Steffion.BlockHunt.MemoryStorage;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||||
|
|
||||||
|
public class OnPlayerTeleportEvent implements Listener {
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
|
public void onPlayerTeleportEvent(PlayerTeleportEvent event) {
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
if (MemoryStorage.pData.get(player) != null) {
|
||||||
|
handlePlayer(event, player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle a player that is in an arena
|
||||||
|
* @param event PlayerTeleportEvent
|
||||||
|
* @param player Player
|
||||||
|
*/
|
||||||
|
private void handlePlayer(PlayerTeleportEvent event, Player player) {
|
||||||
|
Location storedLoc = MemoryStorage.teleportLoc.remove(player);
|
||||||
|
Location to = event.getTo();
|
||||||
|
if (storedLoc == null || storedLoc.getWorld() != to.getWorld() || to.distanceSquared(storedLoc) > 1) {
|
||||||
|
MessageManager.sendFMessage(player, ConfigC.error_teleportBlocked);
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -71,7 +71,7 @@ public class ConfigManager {
|
|||||||
public static void newFiles() {
|
public static void newFiles() {
|
||||||
ConfigManager.setDefaults();
|
ConfigManager.setDefaults();
|
||||||
for (String fileName : MemoryStorage.newFiles) {
|
for (String fileName : MemoryStorage.newFiles) {
|
||||||
MessageManager.sendMessage(null, "%TAG%WCouldn't find '%A%fileName%.yml%MemoryStorage' creating new one.", "fileName-" + fileName);
|
MessageManager.sendMessage(null, "%TAG%WCouldn't find '%A%fileName%.yml%W'%A creating new one.", "fileName-" + fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
MemoryStorage.newFiles.clear();
|
MemoryStorage.newFiles.clear();
|
||||||
|
@ -14,6 +14,7 @@ package nl.Steffion.BlockHunt;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import nl.Steffion.BlockHunt.Managers.CommandManager;
|
import nl.Steffion.BlockHunt.Managers.CommandManager;
|
||||||
@ -59,4 +60,6 @@ public class MemoryStorage {
|
|||||||
public static HashMap<Player, Location> moveLoc = new HashMap<>();
|
public static HashMap<Player, Location> moveLoc = new HashMap<>();
|
||||||
public static HashMap<Player, Location> hiddenLoc = new HashMap<>();
|
public static HashMap<Player, Location> hiddenLoc = new HashMap<>();
|
||||||
public static HashMap<Player, Boolean> hiddenLocWater = new HashMap<>();
|
public static HashMap<Player, Boolean> hiddenLocWater = new HashMap<>();
|
||||||
|
|
||||||
|
public static Map<Player, Location> teleportLoc = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
11
src/main/java/nl/Steffion/BlockHunt/PlayerHandler.java
Normal file
11
src/main/java/nl/Steffion/BlockHunt/PlayerHandler.java
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package nl.Steffion.BlockHunt;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class PlayerHandler {
|
||||||
|
public static boolean teleport(Player player, Location location) {
|
||||||
|
MemoryStorage.teleportLoc.put(player, location);
|
||||||
|
return player.teleport(location);
|
||||||
|
}
|
||||||
|
}
|
@ -19,10 +19,10 @@ public class ScoreboardHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Objective object = board.registerNewObjective(BlockHunt.cutString(arena.arenaName, 32), "dummy");
|
String displayName = BlockHunt.cutString(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.scoreboard_title)), 32);
|
||||||
|
Objective object = board.registerNewObjective(BlockHunt.cutString(arena.arenaName, 32), "dummy", displayName);
|
||||||
|
|
||||||
object.setDisplaySlot(DisplaySlot.SIDEBAR);
|
object.setDisplaySlot(DisplaySlot.SIDEBAR);
|
||||||
object.setDisplayName(BlockHunt.cutString(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.scoreboard_title)), 32));
|
|
||||||
|
|
||||||
String temp = BlockHunt.cutString(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.scoreboard_timeleft)), 32);
|
String temp = BlockHunt.cutString(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.scoreboard_timeleft)), 32);
|
||||||
Score timeleft = object.getScore(temp);
|
Score timeleft = object.getScore(temp);
|
||||||
|
@ -1,66 +0,0 @@
|
|||||||
package nl.Steffion.BlockHunt.Serializables;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import nl.Steffion.BlockHunt.Managers.MessageManager;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.World;
|
|
||||||
import org.bukkit.configuration.serialization.ConfigurationSerializable;
|
|
||||||
import org.bukkit.configuration.serialization.SerializableAs;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* No longer required as a location is already serializable
|
|
||||||
*/
|
|
||||||
|
|
||||||
@SerializableAs("BlockHuntLocation")
|
|
||||||
@Deprecated
|
|
||||||
public class LocationSerializable extends Location {
|
|
||||||
public LocationSerializable(World world, double x, double y, double z, float yaw, float pitch) {
|
|
||||||
super(world, x, y, z, yaw, pitch);
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocationSerializable(Location loc) {
|
|
||||||
super(loc.getWorld(), loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object o) {
|
|
||||||
if (o instanceof LocationSerializable || o instanceof Location) {
|
|
||||||
Location loc = (Location) o;
|
|
||||||
return loc.getWorld().getName().equals(getWorld().getName()) && loc.getX() == getX() && loc.getY() == getY() && loc.getZ() == getZ()
|
|
||||||
&& loc.getYaw() == getYaw() && loc.getPitch() == getPitch();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> serialize() {
|
|
||||||
Map<String, Object> map = new HashMap<>();
|
|
||||||
map.put("world", getWorld().getName());
|
|
||||||
map.put("x", getX());
|
|
||||||
map.put("y", getY());
|
|
||||||
map.put("z", getZ());
|
|
||||||
if (getYaw() != 0D)
|
|
||||||
map.put("yaw", getYaw());
|
|
||||||
if (getPitch() != 0D)
|
|
||||||
map.put("pitch", getPitch());
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static LocationSerializable deserialize(Map<String, Object> map) {
|
|
||||||
World w = Bukkit.getWorld((String)map.getOrDefault( "w", ""));
|
|
||||||
if (w == null) {
|
|
||||||
MessageManager.sendMessage(null, "%EError deserializing Location - world not found! (%A%w%%E)", "w-" + w);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return new LocationSerializable(w, (Double) map.getOrDefault( "x", 0D), (Double) map.getOrDefault( "y", 0D), (Double) map.getOrDefault( "z", 0D), ((Double) map.getOrDefault( "a", 0D)).floatValue(),
|
|
||||||
((Double) map.getOrDefault( "p", 0D)).floatValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Location getLocation(LocationSerializable ser){
|
|
||||||
return new Location(ser.getWorld(),ser.getX(),ser.getY(),ser.getZ(),ser.getYaw(),ser.getPitch());
|
|
||||||
}
|
|
||||||
}
|
|
@ -92,7 +92,10 @@ public class SignsHandler {
|
|||||||
MemoryStorage.signs.load();
|
MemoryStorage.signs.load();
|
||||||
for (String sign : MemoryStorage.signs.getFile().getKeys(false)) {
|
for (String sign : MemoryStorage.signs.getFile().getKeys(false)) {
|
||||||
Location loc = (Location) MemoryStorage.signs.getFile().get(sign + ".location");
|
Location loc = (Location) MemoryStorage.signs.getFile().get(sign + ".location");
|
||||||
if (loc.getBlock().getType().equals(Material.SIGN) || loc.getBlock().getType().equals(Material.WALL_SIGN)) {
|
|
||||||
|
// check if that area is actually loaded. If not move on.
|
||||||
|
if (loc.getWorld().isChunkLoaded(loc.getBlockX() >> 4, loc.getBlockZ() >> 4)) {
|
||||||
|
if (loc.getBlock().getState() instanceof Sign) {
|
||||||
Sign signblock = (Sign) loc.getBlock().getState();
|
Sign signblock = (Sign) loc.getBlock().getState();
|
||||||
String[] lines = signblock.getLines();
|
String[] lines = signblock.getLines();
|
||||||
if (sign.contains("leave")) {
|
if (sign.contains("leave")) {
|
||||||
@ -178,4 +181,5 @@ public class SignsHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,10 +51,10 @@ public class SolidBlockHandler {
|
|||||||
block.removeEnchantment(Enchantment.DURABILITY);
|
block.removeEnchantment(Enchantment.DURABILITY);
|
||||||
|
|
||||||
for (Player playerShow : Bukkit.getOnlinePlayers()) {
|
for (Player playerShow : Bukkit.getOnlinePlayers()) {
|
||||||
playerShow.showPlayer(player);
|
playerShow.showPlayer(BlockHunt.plugin, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
MiscDisguise disguise = new MiscDisguise(DisguiseType.FALLING_BLOCK, block.getType(), 0);
|
MiscDisguise disguise = new MiscDisguise(DisguiseType.FALLING_BLOCK, block.getType());
|
||||||
DisguiseAPI.disguiseToAll(player, disguise);
|
DisguiseAPI.disguiseToAll(player, disguise);
|
||||||
|
|
||||||
MessageManager.sendFMessage(player, ConfigC.normal_ingameNoMoreSolid);
|
MessageManager.sendFMessage(player, ConfigC.normal_ingameNoMoreSolid);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
log-enabledPlugin: '%TAG%N%name%&a&k + %N%version% is now Enabled. Made by %A%autors%%N.'
|
log-enabledPlugin: '%TAG%N%name%&a&k + %N%version% is now Enabled. Made by %A%authors%%N.'
|
||||||
log-disabledPlugin: '%TAG%N%name%&c&k - %N%version% is now Disabled. Made by %A%autors%%N.'
|
log-disabledPlugin: '%TAG%N%name%&c&k - %N%version% is now Disabled. Made by %A%authors%%N.'
|
||||||
info: '%NDisplays the plugin''s info.'
|
info: '%NDisplays the plugin''s info.'
|
||||||
help: '%NShows a list of commands.'
|
help: '%NShows a list of commands.'
|
||||||
reload: '%NReloads all configs.'
|
reload: '%NReloads all configs.'
|
||||||
@ -88,3 +88,5 @@ error-tokensUnknownsetting: '%TAG%E''%A%option%%E'' is not a known option!'
|
|||||||
error-shopNeedMoreTokens: '%TAG%EYou need more tokens before you can buy this item.'
|
error-shopNeedMoreTokens: '%TAG%EYou need more tokens before you can buy this item.'
|
||||||
error-shopMaxSeekersReached: '%TAG%ESorry, the maximum amount of seekers has been reached!'
|
error-shopMaxSeekersReached: '%TAG%ESorry, the maximum amount of seekers has been reached!'
|
||||||
error-shopMaxHidersReached: '%TAG%ESorry, the maximum amount of hiders has been reached!'
|
error-shopMaxHidersReached: '%TAG%ESorry, the maximum amount of hiders has been reached!'
|
||||||
|
error-teleportFailed: '%TAG%EUnable to teleport you into the arena.'
|
||||||
|
error-teleportBlocked: '%TAG%EYou cannot teleport while playing!'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
log-enabledPlugin: '%TAG%N%name%&a&k + %N%version% is now Enabled. Made by %A%autors%%N.'
|
log-enabledPlugin: '%TAG%N%name%&a&k + %N%version% is now Enabled. Made by %A%authors%%N.'
|
||||||
log-disabledPlugin: '%TAG%N%name%&c&k - %N%version% is now Disabled. Made by %A%autors%%N.'
|
log-disabledPlugin: '%TAG%N%name%&c&k - %N%version% is now Disabled. Made by %A%authors%%N.'
|
||||||
info: '%NDisplays the plugin''s info.'
|
info: '%NDisplays the plugin''s info.'
|
||||||
help: '%NShows a list of commands.'
|
help: '%NShows a list of commands.'
|
||||||
reload: '%NReloads all configs.'
|
reload: '%NReloads all configs.'
|
||||||
@ -88,3 +88,5 @@ error-tokensUnknownsetting: '%TAG%E''%A%option%%E'' is not a known option!'
|
|||||||
error-shopNeedMoreTokens: '%TAG%EYou need more tokens before you can buy this item.'
|
error-shopNeedMoreTokens: '%TAG%EYou need more tokens before you can buy this item.'
|
||||||
error-shopMaxSeekersReached: '%TAG%ESorry, the maximum amount of seekers has been reached!'
|
error-shopMaxSeekersReached: '%TAG%ESorry, the maximum amount of seekers has been reached!'
|
||||||
error-shopMaxHidersReached: '%TAG%ESorry, the maximum amount of hiders has been reached!'
|
error-shopMaxHidersReached: '%TAG%ESorry, the maximum amount of hiders has been reached!'
|
||||||
|
error-teleportFailed: '%TAG%EUnable to teleport you into the arena.'
|
||||||
|
error-teleportBlocked: '%TAG%EYou cannot teleport while playing!'
|
||||||
|
@ -1,82 +1,92 @@
|
|||||||
TestArena:
|
TestArena:
|
||||||
==: BlockHuntArena
|
==: BlockHuntArena
|
||||||
maxPlayers: 40
|
hidersCanHurtSeekers: true
|
||||||
hidersWinCommands: []
|
|
||||||
timeInLobbyUntilStart: 30
|
|
||||||
minPlayers: 5
|
|
||||||
timeUntilHidersSword: 0
|
|
||||||
spawnWarp:
|
|
||||||
==: BlockHuntLocation
|
|
||||||
p: 4.200027
|
|
||||||
a: 41.700073
|
|
||||||
w: games
|
|
||||||
x: -178.5
|
|
||||||
y: 33.0
|
|
||||||
z: -130.5
|
|
||||||
allowedCommands: []
|
|
||||||
arenaName: TestArena
|
arenaName: TestArena
|
||||||
amountSeekersOnStart: 3
|
seekersCanHurtSeekers: false
|
||||||
pos1:
|
seekersTokenWin: 10
|
||||||
==: BlockHuntLocation
|
|
||||||
w: games
|
|
||||||
x: 576.0
|
|
||||||
y: 2.0
|
|
||||||
z: 503.0
|
|
||||||
pos2:
|
|
||||||
==: BlockHuntLocation
|
|
||||||
w: games
|
|
||||||
x: 428.0
|
|
||||||
y: 66.0
|
|
||||||
z: 342.0
|
|
||||||
waitingTimeSeeker: 20
|
|
||||||
seekersTokenWin: 0
|
|
||||||
lobbyWarp:
|
lobbyWarp:
|
||||||
==: BlockHuntLocation
|
==: org.bukkit.Location
|
||||||
p: 4.19999
|
world: games
|
||||||
a: -182.09694
|
|
||||||
w: games
|
|
||||||
x: 500.66289894368725
|
x: 500.66289894368725
|
||||||
y: 4.0
|
y: 4.0
|
||||||
z: 497.83982348350094
|
z: 497.83982348350094
|
||||||
|
pitch: 4.19999
|
||||||
|
yaw: -182.09694
|
||||||
|
hidersTakeFallDamage: false
|
||||||
seekersWinCommands: []
|
seekersWinCommands: []
|
||||||
killTokens: 0
|
killTokens: 0
|
||||||
gameTime: 660
|
gameTime: 660
|
||||||
disguiseBlocks:
|
|
||||||
- ==: org.bukkit.inventory.ItemStack
|
|
||||||
type: BOOKSHELF
|
|
||||||
- ==: org.bukkit.inventory.ItemStack
|
|
||||||
type: GLOWSTONE
|
|
||||||
meta:
|
|
||||||
==: ItemMeta
|
|
||||||
meta-type: UNSPECIFIC
|
|
||||||
enchants:
|
|
||||||
DURABILITY: 10
|
|
||||||
- ==: org.bukkit.inventory.ItemStack
|
|
||||||
type: EMERALD_BLOCK
|
|
||||||
- ==: org.bukkit.inventory.ItemStack
|
|
||||||
type: WOOL
|
|
||||||
damage: 5
|
|
||||||
- ==: org.bukkit.inventory.ItemStack
|
|
||||||
type: ICE
|
|
||||||
- ==: org.bukkit.inventory.ItemStack
|
|
||||||
type: MYCEL
|
|
||||||
- ==: org.bukkit.inventory.ItemStack
|
|
||||||
type: SAND
|
|
||||||
hidersWarp:
|
hidersWarp:
|
||||||
==: BlockHuntLocation
|
==: org.bukkit.Location
|
||||||
p: -1.9500121
|
world: games
|
||||||
a: 179.85266
|
|
||||||
w: games
|
|
||||||
x: 500.52591580497256
|
x: 500.52591580497256
|
||||||
y: 4.0
|
y: 4.0
|
||||||
z: 482.31326505008246
|
z: 482.31326505008246
|
||||||
|
pitch: -1.9500121
|
||||||
|
yaw: 179.85266
|
||||||
blockAnnouncerTime: 45
|
blockAnnouncerTime: 45
|
||||||
|
seekersTakeFallDamage: false
|
||||||
|
hidersCanHurtHiders: false
|
||||||
|
maxPlayers: 40
|
||||||
|
hidersWinCommands: []
|
||||||
|
timeInLobbyUntilStart: 50
|
||||||
|
minPlayers: 5
|
||||||
|
timeUntilHidersSword: 0
|
||||||
|
spawnWarp:
|
||||||
|
==: org.bukkit.Location
|
||||||
|
world: games
|
||||||
|
x: -178.5
|
||||||
|
y: 33.0
|
||||||
|
z: -130.5
|
||||||
|
pitch: 4.200027
|
||||||
|
yaw: 41.700073
|
||||||
|
allowedCommands: []
|
||||||
|
amountSeekersOnStart: 1
|
||||||
|
pos1:
|
||||||
|
==: org.bukkit.Location
|
||||||
|
world: games
|
||||||
|
x: 576.0
|
||||||
|
y: 2.0
|
||||||
|
z: 503.0
|
||||||
|
pitch: 0.0
|
||||||
|
yaw: 0.0
|
||||||
|
pos2:
|
||||||
|
==: org.bukkit.Location
|
||||||
|
world: games
|
||||||
|
x: 428.0
|
||||||
|
y: 66.0
|
||||||
|
z: 342.0
|
||||||
|
pitch: 0.0
|
||||||
|
yaw: 0.0
|
||||||
|
waitingTimeSeeker: 20
|
||||||
|
disguiseBlocks:
|
||||||
|
- ==: org.bukkit.inventory.ItemStack
|
||||||
|
v: 2230
|
||||||
|
type: BOOKSHELF
|
||||||
|
- ==: org.bukkit.inventory.ItemStack
|
||||||
|
v: 2230
|
||||||
|
type: GLOWSTONE
|
||||||
|
- ==: org.bukkit.inventory.ItemStack
|
||||||
|
v: 2230
|
||||||
|
type: EMERALD_BLOCK
|
||||||
|
- ==: org.bukkit.inventory.ItemStack
|
||||||
|
v: 2230
|
||||||
|
type: LIME_WOOL
|
||||||
|
- ==: org.bukkit.inventory.ItemStack
|
||||||
|
v: 2230
|
||||||
|
type: ICE
|
||||||
|
- ==: org.bukkit.inventory.ItemStack
|
||||||
|
v: 2230
|
||||||
|
type: MYCELIUM
|
||||||
|
- ==: org.bukkit.inventory.ItemStack
|
||||||
|
v: 2230
|
||||||
|
type: SAND
|
||||||
seekersWarp:
|
seekersWarp:
|
||||||
==: BlockHuntLocation
|
==: org.bukkit.Location
|
||||||
p: 17.69996
|
world: games
|
||||||
a: 90.15417
|
|
||||||
w: games
|
|
||||||
x: 519.6272528902401
|
x: 519.6272528902401
|
||||||
y: 42.0
|
y: 42.0
|
||||||
z: 453.4140380016035
|
z: 453.4140380016035
|
||||||
|
pitch: 17.69996
|
||||||
|
yaw: 90.15417
|
||||||
hidersTokenWin: 0
|
hidersTokenWin: 0
|
@ -21,16 +21,16 @@ commandEnabled:
|
|||||||
setwarp: true
|
setwarp: true
|
||||||
remove: true
|
remove: true
|
||||||
tokens: true
|
tokens: true
|
||||||
autoUpdateCheck: false
|
autoUpdateCheck: true
|
||||||
autoDownloadUpdate: false
|
autoDownloadUpdate: false
|
||||||
wandIDname: STICK
|
wandIDname: STICK
|
||||||
wandName: '%A&lBlockHunt%N''s selection wand'
|
wandName: '%A&lBlockHunt%N''s selection wand'
|
||||||
wandDescription:
|
wandDescription:
|
||||||
- '%NUse this item to select an arena for your arena.'
|
- '%NUse this item to select an arena for your arena.'
|
||||||
- '%ALeft-Click%N to select point #1.'
|
- '%ALeft-Click%N to select point #1.'
|
||||||
- '%ARight-Click%N to select point #2.'
|
- '%ARight-Click%N to select point #2.'
|
||||||
- '%NUse the create command to define your arena.'
|
- '%NUse the create command to define your arena.'
|
||||||
- '%A/BlockHunt <help|h>'
|
- '%A/BlockHunt <help|h>'
|
||||||
shop:
|
shop:
|
||||||
title: '%H&lBlockHunt %NShop'
|
title: '%H&lBlockHunt %NShop'
|
||||||
price: '%NPrice: %A%amount% %Ntokens.'
|
price: '%NPrice: %A%amount% %Ntokens.'
|
||||||
@ -65,18 +65,18 @@ sign:
|
|||||||
- '&8To shop.'
|
- '&8To shop.'
|
||||||
WAITING:
|
WAITING:
|
||||||
- '%H[BlockHunt%H]'
|
- '%H[BlockHunt%H]'
|
||||||
- '&5%arenaname%'
|
- '%A%arenaname%'
|
||||||
- '&5%players%&6/&5%maxplayers%'
|
- '%A%players%%N/%A%maxplayers%'
|
||||||
- '&8Waiting...'
|
- '&8Waiting...'
|
||||||
STARTING:
|
STARTING:
|
||||||
- '%H[BlockHunt%H]'
|
- '%H[BlockHunt%H]'
|
||||||
- '&5%arenaname%'
|
- '%A%arenaname%'
|
||||||
- '&5%players%&6/&5%maxplayers%'
|
- '%A%players%%N/%A%maxplayers%'
|
||||||
- '&2Start: %A%timeleft%'
|
- '&2Start: %A%timeleft%'
|
||||||
INGAME:
|
INGAME:
|
||||||
- '%H[BlockHunt%H]'
|
- '%H[BlockHunt%H]'
|
||||||
- '&5%arenaname%'
|
- '%A%arenaname%'
|
||||||
- '&5%players%&6/&5%maxplayers%'
|
- '%A%players%%N/%A%maxplayers%'
|
||||||
- '%EIngame: %A%timeleft%'
|
- '%EIngame: %A%timeleft%'
|
||||||
scoreboard:
|
scoreboard:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
log:
|
log:
|
||||||
enabledPlugin: '%TAG%N%name%&a&k + %N%version% is now Enabled. Made by %A%autors%%N.'
|
enabledPlugin: '%TAG%N%name%&a&k + %N%version% is now Enabled. Made by %A%authors%%N.'
|
||||||
disabledPlugin: '%TAG%N%name%&c&k - %N%version% is now Disabled. Made by %A%autors%%N.'
|
disabledPlugin: '%TAG%N%name%&c&k - %N%version% is now Disabled. Made by %A%authors%%N.'
|
||||||
help:
|
help:
|
||||||
info: '%NDisplays the plugin''s info.'
|
info: '%NDisplays the plugin''s info.'
|
||||||
help: '%NShows a list of commands.'
|
help: '%NShows a list of commands.'
|
||||||
@ -60,7 +60,7 @@ normal:
|
|||||||
shopChoosenHiders: '%TAG%NYou''ve choosen to be a %Ahider%N!'
|
shopChoosenHiders: '%TAG%NYou''ve choosen to be a %Ahider%N!'
|
||||||
ingameBlocksLeft: '%TAG%NRemaining blocks: %A%1%%N'
|
ingameBlocksLeft: '%TAG%NRemaining blocks: %A%1%%N'
|
||||||
warning:
|
warning:
|
||||||
lobbyNeedAtleast: '%TAG%WYou need atleast %A%1%%MemoryStorage player(s) to start the game!'
|
lobbyNeedAtleast: '%TAG%WYou need atleast %A%1% player(s) to start the game!'
|
||||||
ingameNEWSeekerChoosen: '%TAG%WThe last seeker left and a new seeker has been choosen!'
|
ingameNEWSeekerChoosen: '%TAG%WThe last seeker left and a new seeker has been choosen!'
|
||||||
unableToCommand: '%TAG%WSorry but that command is disabled in the arena.'
|
unableToCommand: '%TAG%WSorry but that command is disabled in the arena.'
|
||||||
ingameNoSolidPlace: '%TAG%WThat''s not a valid place to become solid!'
|
ingameNoSolidPlace: '%TAG%WThat''s not a valid place to become solid!'
|
||||||
@ -97,3 +97,5 @@ error:
|
|||||||
shopNeedMoreTokens: '%TAG%EYou need more tokens before you can buy this item.'
|
shopNeedMoreTokens: '%TAG%EYou need more tokens before you can buy this item.'
|
||||||
shopMaxSeekersReached: '%TAG%ESorry, the maximum amount of seekers has been reached!'
|
shopMaxSeekersReached: '%TAG%ESorry, the maximum amount of seekers has been reached!'
|
||||||
shopMaxHidersReached: '%TAG%ESorry, the maximum amount of hiders has been reached!'
|
shopMaxHidersReached: '%TAG%ESorry, the maximum amount of hiders has been reached!'
|
||||||
|
teleportFailed: '%TAG%EUnable to teleport you into the arena.'
|
||||||
|
teleportBlocked: '%TAG%EYou cannot teleport while playing!'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user