diff --git a/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml b/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml
index 3f5cae6e4..2fb39df09 100644
--- a/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml
+++ b/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml
@@ -18,6 +18,8 @@
+
+
\ No newline at end of file
diff --git a/Plugins/.idea/codeStyleSettings.xml b/Plugins/.idea/codeStyleSettings.xml
index 8e890f86b..44295e3d8 100644
--- a/Plugins/.idea/codeStyleSettings.xml
+++ b/Plugins/.idea/codeStyleSettings.xml
@@ -37,6 +37,7 @@
+
\ No newline at end of file
diff --git a/Plugins/.idea/compiler.xml b/Plugins/.idea/compiler.xml
index 2e4d3e99b..b2c160566 100644
--- a/Plugins/.idea/compiler.xml
+++ b/Plugins/.idea/compiler.xml
@@ -21,8 +21,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
diff --git a/Plugins/.idea/encodings.xml b/Plugins/.idea/encodings.xml
index e206d70d8..d4f862411 100644
--- a/Plugins/.idea/encodings.xml
+++ b/Plugins/.idea/encodings.xml
@@ -1,5 +1,9 @@
-
-
-
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Plugins/.idea/misc.xml b/Plugins/.idea/misc.xml
index 76fba6e9f..5a73d09c7 100644
--- a/Plugins/.idea/misc.xml
+++ b/Plugins/.idea/misc.xml
@@ -7,6 +7,13 @@
+
+
+
diff --git a/Plugins/.idea/modules.xml b/Plugins/.idea/modules.xml
index bf0ac4bae..1b0feef52 100644
--- a/Plugins/.idea/modules.xml
+++ b/Plugins/.idea/modules.xml
@@ -18,6 +18,10 @@
+
+
+
+
\ No newline at end of file
diff --git a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java
index 49e6f6ae1..05284beeb 100644
--- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java
+++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java
@@ -39,7 +39,7 @@ public class MotdManager implements Listener, Runnable
if (new File("updateMOTD.dat").exists())
{
List lines = new ArrayList();
- lines.add(" §b§l◄§f§lNEW§b§l► §f§l◄§b§lSKYWARS§f§l► §b§l◄§f§lNEW§b§l►");
+ lines.add(" §f§l◄ §6§lNEW ARCADE GAME §f§l▬ §c§lBOMB LOBBERS §f§l►");
//lines.add(" §d§lRank Sale §a§l40% Off");
//lines.add(" §f§l◄§c§lMAINTENANCE§f§l►");
diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java
index 1c769e523..f0a1f16fc 100644
--- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java
+++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java
@@ -1,20 +1,20 @@
package mineplex.core.common;
-import mineplex.core.common.util.C;
-import mineplex.core.common.util.UtilPlayer;
-
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
+import mineplex.core.common.util.C;
+import mineplex.core.common.util.UtilPlayer;
+
public enum Rank
{
LT("LT", ChatColor.DARK_RED),
OWNER("Owner", ChatColor.DARK_RED),
DEVELOPER("Dev", ChatColor.RED),
ADMIN("Admin", ChatColor.RED),
+ JNR_DEV("Jr.Dev", ChatColor.RED),
SNR_MODERATOR("Sr.Mod", ChatColor.GOLD),
MODERATOR("Mod", ChatColor.GOLD),
- JNR_DEV("Jr.Dev", ChatColor.RED),
HELPER("Trainee", ChatColor.DARK_AQUA),
MAPLEAD("MapLead", ChatColor.DARK_PURPLE),
MAPDEV("Builder", ChatColor.BLUE),
diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilAction.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilAction.java
index 1b870ada9..9f3ba3614 100644
--- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilAction.java
+++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilAction.java
@@ -1,11 +1,23 @@
package mineplex.core.common.util;
-
import org.bukkit.entity.Entity;
+import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public class UtilAction
{
+ private static VelocityReceiver _velocityFix;
+
+ public static void velocity(Entity ent, Vector vec)
+ {
+ velocity(ent, vec, 1, false, 0, 0, vec.length(), false);
+ }
+
+ public static void registerVelocityFix(VelocityReceiver velocityFix)
+ {
+ _velocityFix = velocityFix;
+ }
+
public static void velocity(Entity ent, double str, double yAdd, double yMax, boolean groundBoost)
{
velocity(ent, ent.getLocation().getDirection(), str, false, 0, yAdd, yMax, groundBoost);
@@ -14,8 +26,11 @@ public class UtilAction
public static void velocity(Entity ent, Vector vec, double str, boolean ySet, double yBase, double yAdd, double yMax, boolean groundBoost)
{
if (Double.isNaN(vec.getX()) || Double.isNaN(vec.getY()) || Double.isNaN(vec.getZ()) || vec.length() == 0)
+ {
+ zeroVelocity(ent);
return;
-
+ }
+
//YSet
if (ySet)
vec.setY(yBase);
@@ -23,20 +38,43 @@ public class UtilAction
//Modify
vec.normalize();
vec.multiply(str);
-
+
//YAdd
vec.setY(vec.getY() + yAdd);
-
+
//Limit
if (vec.getY() > yMax)
vec.setY(yMax);
-
+
if (groundBoost)
if (UtilEnt.isGrounded(ent))
vec.setY(vec.getY() + 0.2);
-
+
//Velocity
ent.setFallDistance(0);
- ent.setVelocity(vec);
+
+ //Store It!
+ if (ent instanceof Player && _velocityFix != null)
+ {
+ _velocityFix.setPlayerVelocity(((Player)ent), vec);
+ }
+
+ ent.setVelocity(vec);
}
+
+ public static void zeroVelocity(Entity ent)
+ {
+ Vector vec = new Vector(0,0,0);
+ ent.setFallDistance(0);
+
+ //Store It!
+ if (ent instanceof Player && _velocityFix != null)
+ {
+ _velocityFix.setPlayerVelocity(((Player)ent), vec);
+ }
+
+ ent.setVelocity(vec);
+ }
+
+
}
diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilAlg.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilAlg.java
index fad8f1eef..d686faa2d 100644
--- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilAlg.java
+++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilAlg.java
@@ -7,6 +7,7 @@ import java.util.TreeSet;
+
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
@@ -260,4 +261,96 @@ public class UtilAlg
return isInPyramid(player.getLocation().getDirection(), UtilAlg.getTrajectory(player.getEyeLocation(), target.getEyeLocation()), angleLimit) ||
isInPyramid(player.getLocation().getDirection(), UtilAlg.getTrajectory(player.getEyeLocation(), target.getLocation()), angleLimit);
}
+
+ public static Location getLocationAwayFromPlayers(ArrayList locs, ArrayList players)
+ {
+ Location bestLoc = null;
+ double bestDist = 0;
+
+ for (Location loc : locs)
+ {
+ double closest = -1;
+
+ for (Player player : players)
+ {
+ //Different Worlds
+ if (!player.getWorld().equals(loc.getWorld()))
+ continue;
+
+ double dist = UtilMath.offsetSquared(player.getLocation(), loc);
+
+ if (closest == -1 || dist < closest)
+ {
+ closest = dist;
+ }
+ }
+
+ if (closest == -1)
+ continue;
+
+ if (bestLoc == null || closest > bestDist)
+ {
+ bestLoc = loc;
+ bestDist = closest;
+ }
+ }
+
+ return bestLoc;
+ }
+
+ public static Location getLocationNearPlayers(ArrayList locs, ArrayList players, ArrayList dontOverlap)
+ {
+ Location bestLoc = null;
+ double bestDist = 0;
+
+ for (Location loc : locs)
+ {
+ double closest = -1;
+
+ boolean valid = true;
+
+ //Dont spawn on other players
+ for (Player player : dontOverlap)
+ {
+ if (!player.getWorld().equals(loc.getWorld()))
+ continue;
+
+ double dist = UtilMath.offsetSquared(player.getLocation(), loc);
+
+ if (dist < 0.8)
+ {
+ valid = false;
+ break;
+ }
+ }
+
+ if (!valid)
+ continue;
+
+ //Find closest player
+ for (Player player : players)
+ {
+ if (!player.getWorld().equals(loc.getWorld()))
+ continue;
+
+ double dist = UtilMath.offsetSquared(player.getLocation(), loc);
+
+ if (closest == -1 || dist < closest)
+ {
+ closest = dist;
+ }
+ }
+
+ if (closest == -1)
+ continue;
+
+ if (bestLoc == null || closest < bestDist)
+ {
+ bestLoc = loc;
+ bestDist = closest;
+ }
+ }
+
+ return bestLoc;
+ }
}
diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/VelocityReceiver.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/VelocityReceiver.java
new file mode 100644
index 000000000..8d621dab8
--- /dev/null
+++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/VelocityReceiver.java
@@ -0,0 +1,9 @@
+package mineplex.core.common.util;
+
+import org.bukkit.entity.Player;
+import org.bukkit.util.Vector;
+
+public interface VelocityReceiver
+{
+ public void setPlayerVelocity(Player player, Vector velocity);
+}
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java b/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java
index a76be2fcd..9d11610a5 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java
@@ -227,7 +227,7 @@ public class CoreClientManager extends MiniPlugin
Bukkit.getServer().getPluginManager().callEvent(new ClientWebResponseEvent(response, uuid));
if (client.getAccountId() > 0)
- _accountCacheRepository.addElement(new AccountCache(uuid, client.getAccountId()));
+ _accountCacheRepository.addElement(new AccountCache(uuid, client.getAccountId()), 60 * 60 * 6);
}
catch (Exception exception)
{
@@ -301,7 +301,16 @@ public class CoreClientManager extends MiniPlugin
System.out.println(client.GetPlayerName() + "'s account id = " + client.getAccountId());
if (client.getAccountId() > 0)
- _accountCacheRepository.addElement(new AccountCache(uuid, client.getAccountId()));
+ {
+ try
+ {
+ _accountCacheRepository.addElement(new AccountCache(uuid, client.getAccountId()), 60 * 60 * 6);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
return !_clientLoginLock.containsKey(client.GetPlayerName());
}
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/account/command/UpdateRank.java b/Plugins/Mineplex.Core/src/mineplex/core/account/command/UpdateRank.java
index 8a7efe8fe..21f0ee4c9 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/account/command/UpdateRank.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/account/command/UpdateRank.java
@@ -19,12 +19,20 @@ public class UpdateRank extends CommandBase
{
public UpdateRank(CoreClientManager plugin)
{
- super(plugin, Rank.ADMIN, "updateRank");
+ super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV /*On test servers only*/}, "updateRank");
}
@Override
public void Execute(final Player caller, String[] args)
{
+ boolean testServer = Plugin.getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
+
+ if (Plugin.Get(caller).GetRank() == Rank.JNR_DEV && !testServer)
+ {
+ F.main(Plugin.getName(), F.elem(Rank.JNR_DEV.GetTag(true, true)) + "s are only permitted to set ranks on test servers!");
+ return;
+ }
+
if (args == null)
{
UtilPlayer.message(caller, F.main(Plugin.getName(), "/" + AliasUsed + " joeschmo MODERATOR"));
@@ -52,9 +60,9 @@ public class UpdateRank extends CommandBase
final Rank rank = tempRank;
- if (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR)
+ if (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR || rank == Rank.JNR_DEV || rank == Rank.DEVELOPER)
{
- if (rank == Rank.ADMIN && !Plugin.hasRank(caller, Rank.LT))
+ if (!testServer && rank.Has(Rank.ADMIN) && !Plugin.hasRank(caller, Rank.LT))
{
UtilPlayer.message(caller, F.main(Plugin.getName(), ChatColor.RED + "" + ChatColor.BOLD + "Insufficient privileges!"));
return;
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java
index 9d5eee722..64d6215aa 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java
@@ -56,7 +56,7 @@ public enum Achievement
//Survival Games
SURVIVAL_GAMES_WINS("Katniss Everdeen", 600,
new String[]{"Survival Games.Wins"},
- new String[]{"Win 30 games of Survival Games"},
+ new String[]{"Win 20 games of Survival Games"},
new int[]{30},
AchievementCategory.SURVIVAL_GAMES),
@@ -87,8 +87,8 @@ public enum Achievement
//Skywars
SKYWARS_WINS("Sky King",2000,
new String[]{"Skywars.Wins"},
- new String[]{"Win 30 Games of Skywars"},
- new int[]{30},
+ new String[]{"Win 20 Games of Skywars"},
+ new int[]{20},
AchievementCategory.SKYWARS),
SKYWARS_BOMBER("Master Bomber",500,
@@ -643,39 +643,31 @@ public enum Achievement
new String[]{"Throw 2000 TNT"},
new int[]{2000},
AchievementCategory.BOMB_LOBBERS),
-
-// BOMB_LOBBERS_REKT_X3("Rekt x3", 800,
-// new String[]{"Bomb Lobbers.3Kill"},
-// new String[]{"Kill 3 players with one explosion"},
-// new int[]{1},
-// AchievementCategory.BOMB_LOBBERS),
-
+
BOMB_LOBBERS_ULTIMATE_KILLER("Ultimate Killer", 800,
new String[]{"Bomb Lobbers.Killer"},
new String[]{"Kill 6 players in a single game"},
new int[]{1},
AchievementCategory.BOMB_LOBBERS),
- BOMB_LOBBERS_EXPLOSION_PROOF("Jelly Skin", 1000,
+ BOMB_LOBBERS_EXPLOSION_PROOF("Jelly Skin", 1200,
new String[]{"Bomb Lobbers.JellySkin"},
new String[]{"Win a game without taking any damage."},
new int[]{1},
AchievementCategory.BOMB_LOBBERS),
- BOMB_LOBBERS_BEST_TEAM("The Best Team", 800,
- new String[]{"Bomb Lobbers.BestTeam"},
- new String[]{"Win a game without losing a teammate"},
- new int[]{1},
- AchievementCategory.BOMB_LOBBERS),
-
BOMB_LOBBERS_BLAST_PROOF("Blast Proof", 800,
new String[]{"Bomb Lobbers.BlastProof"},
new String[]{"Win 20 games using Armorer"},
new int[]{20},
- AchievementCategory.BOMB_LOBBERS)
-
+ AchievementCategory.BOMB_LOBBERS),
+
+ BOMB_LOBBERS_SNIPER("Sniper", 10000,
+ new String[]{"Bomb Lobbers.Direct Hit"},
+ new String[]{"Get 50 direct hits"},
+ new int[]{50},
+ AchievementCategory.BOMB_LOBBERS)
-// BOMB_LOBBERS_
;
private String _name;
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementManager.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementManager.java
index 4fe166860..485f5a124 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementManager.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementManager.java
@@ -208,18 +208,22 @@ public class AchievementManager extends MiniPlugin
{
int level = get(sender, Achievement.GLOBAL_MINEPLEX_LEVEL).getLevel();
+ if (sender.getName().equalsIgnoreCase("B2_mp"))
+ return 101;
+
+ if (rank.Has(Rank.MODERATOR))
+ level = Math.max(level, 5);
+ if (rank.Has(Rank.SNR_MODERATOR))
+ level = Math.max(level, 15);
+ if (rank.Has(Rank.JNR_DEV))
+ level = Math.max(level, 25);
+ if (rank.Has(Rank.ADMIN))
+ level = Math.max(level, 30 + get(sender, Achievement.GLOBAL_GEM_HUNTER).getLevel());
+ if (rank.Has(Rank.OWNER))
+ level = Math.max(level, 50 + get(sender, Achievement.GLOBAL_GEM_HUNTER).getLevel());
+
if (sender.getName().equalsIgnoreCase("Phinary"))
level = -level;
- else if (sender.getName().equalsIgnoreCase("B2_mp"))
- return 101;
- else if (rank.Has(Rank.OWNER))
- level = Math.max(level, 50 + get(sender, Achievement.GLOBAL_GEM_HUNTER).getLevel());
- else if (rank.Has(Rank.ADMIN))
- level = Math.max(level, 30 + get(sender, Achievement.GLOBAL_GEM_HUNTER).getLevel());
- else if (rank.Has(Rank.SNR_MODERATOR))
- level = Math.max(level, 15);
- else if (rank.Has(Rank.MODERATOR))
- level = Math.max(level, 5);
return level;
}
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java
index d54efdff3..3024ff2f4 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java
@@ -17,6 +17,7 @@ import mineplex.core.cosmetic.ui.button.ActivateGadgetButton;
import mineplex.core.cosmetic.ui.button.DeactivateGadgetButton;
import mineplex.core.cosmetic.ui.button.GadgetButton;
import mineplex.core.donation.DonationManager;
+import mineplex.core.gadget.gadgets.MorphBlock;
import mineplex.core.gadget.gadgets.MorphNotch;
import mineplex.core.gadget.types.Gadget;
import mineplex.core.gadget.types.GadgetType;
@@ -68,6 +69,13 @@ public class GadgetPage extends ShopPageBase
//setItem(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), "Disabled " + gadget.GetName(), new String[] { "Sorry! Currently disabled until fix is made for 1.8 players!" }, 1, false, false));
//return;
}
+ else if (gadget instanceof MorphBlock)
+ {
+ //Prevent stacker bug
+ if (getPlayer().getPassenger() != null)
+ return;
+ }
+
List itemLore = new ArrayList();
if (gadget.GetCost(CurrencyType.Coins) >= 0)
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java
index 775206ffd..bc7f2ac7d 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java
@@ -6,12 +6,14 @@ import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
+import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent;
+import org.bukkit.event.player.PlayerToggleSneakEvent;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.MiniPlugin;
@@ -430,4 +432,16 @@ public class GadgetManager extends MiniPlugin
return true;
}
+
+ @EventHandler
+ public void chissMeow(PlayerToggleSneakEvent event)
+ {
+ if (event.getPlayer().getName().equals("Chiss"))
+ {
+ if (!event.getPlayer().isSneaking())
+ {
+ event.getPlayer().getWorld().playSound(event.getPlayer().getLocation(), Sound.CAT_MEOW, 1f, 1f);
+ }
+ }
+ }
}
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java
index 62ff23a36..14ade61ab 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java
@@ -170,7 +170,7 @@ public class MorphWither extends MorphGadget
player.setFlying(true);
if (UtilEnt.isGrounded(player))
- player.setVelocity(new Vector(0,1,0));
+ UtilAction.velocity(player, new Vector(0,1,0), 1, false, 0, 0, 1, true);
}
}
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java
index 07ffc1ccf..91c3ae291 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java
@@ -51,7 +51,7 @@ public enum GameDisplay
SquidShooter("Squid Shooter", Material.FIREWORK_CHARGE, (byte)0, GameCategory.ARCADE, 43),
Stacker("Super Stacker", Material.BOWL, (byte)0, GameCategory.ARCADE, 42),
SurvivalGames("Survival Games", Material.IRON_SWORD, (byte)0, GameCategory.SURVIVAL, 22),
- SurvivalGamesTeams("Survival Games Teams", Material.IRON_SWORD, (byte)0, GameCategory.TEAM_VARIANT, 23),
+ SurvivalGamesTeams("Survival Games", Material.IRON_SWORD, (byte)0, GameCategory.TEAM_VARIANT, 23),
Tug("Tug of Wool", Material.WHEAT, (byte)0, GameCategory.ARCADE, 44),
TurfWars("Turf Wars", Material.STAINED_CLAY, (byte)14, GameCategory.ARCADE, 45),
UHC("Ultra Hardcore", Material.GOLDEN_APPLE, (byte)0, GameCategory.SURVIVAL, 46),
@@ -61,7 +61,8 @@ public enum GameDisplay
Build("Master Builders", Material.WOOD, (byte)0, GameCategory.CLASSICS, 50),
Cards("Craft Against Humanity", Material.MAP, (byte)0, GameCategory.CLASSICS, 51),
- Skywars("Skywars", Material.FEATHER, (byte) 0, GameCategory.SURVIVAL, 52),
+ Skywars("Skywars", "Skywars", Material.FEATHER, (byte) 0, GameCategory.SURVIVAL, 52),
+ SkywarsTeams("Skywars Teams", "Skywars",Material.FEATHER, (byte)5, GameCategory.TEAM_VARIANT, 53),
Event("Mineplex Event", Material.CAKE, (byte)0, GameCategory.EVENT, 999);
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSheep.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSheep.java
index bcee6ee2a..e2982d6ab 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSheep.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSheep.java
@@ -52,7 +52,6 @@ public class MountSheep extends HorseMount
DisguiseSheep disguise = new DisguiseSheep(horse);
disguise.setName(player.getName(), Manager.getClientManager().Get(player).GetRank());
- disguise.setCustomNameVisible(true);
//disguise.setColor(DyeColor.getByColor(org.bukkit.Color.fromRGB(100, 0, 200)));
Manager.getDisguiseManager().disguise(disguise);
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSlime.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSlime.java
index 5bf9b6da2..1dccbdad5 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSlime.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSlime.java
@@ -48,7 +48,6 @@ public class MountSlime extends Mount
mount.setSize(2);
mount.setCustomName(player.getName() + "'s " + GetName());
- mount.setCustomNameVisible(true);
//Inform
UtilPlayer.message(player, F.main("Mount", "You spawned " + F.elem(GetName()) + "."));
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/notifier/NotificationManager.java b/Plugins/Mineplex.Core/src/mineplex/core/notifier/NotificationManager.java
index 808d3fe33..342d7b840 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/notifier/NotificationManager.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/notifier/NotificationManager.java
@@ -45,8 +45,8 @@ public class NotificationManager extends MiniPlugin
// if (event.getType() == UpdateType.MIN_08)
// hugeSale();
- if (event.getType() == UpdateType.MIN_16)
- sale();
+// if (event.getType() == UpdateType.MIN_16)
+// sale();
}
private void sale()
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java b/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java
index 6b7eb9053..e58b10020 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java
@@ -484,7 +484,7 @@ public class NpcManager extends MiniPlugin
String serverType = getServerName();
try (Connection connection = DBPool.ACCOUNT.getConnection())
- {
+ {
Result result = DSL.using(connection)
.selectFrom(Tables.npcs)
.where(Tables.npcs.server.eq(serverType))
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/npc/command/HomeCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/npc/command/HomeCommand.java
index 957816f12..03382bf95 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/npc/command/HomeCommand.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/npc/command/HomeCommand.java
@@ -12,7 +12,7 @@ public class HomeCommand extends CommandBase
{
public HomeCommand(NpcManager plugin)
{
- super(plugin, Rank.DEVELOPER, "home");
+ super(plugin, Rank.DEVELOPER, new Rank[] {Rank.JNR_DEV}, "home");
}
@Override
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/npc/command/NpcCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/npc/command/NpcCommand.java
index 3e3037964..5e66eee21 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/npc/command/NpcCommand.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/npc/command/NpcCommand.java
@@ -10,7 +10,7 @@ public class NpcCommand extends MultiCommandBase
{
public NpcCommand(NpcManager plugin)
{
- super(plugin, Rank.DEVELOPER, "npc");
+ super(plugin, Rank.DEVELOPER, new Rank[] {Rank.JNR_DEV}, "npc");
AddCommand(new AddCommand(plugin));
AddCommand(new DeleteCommand(plugin));
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/personalServer/PersonalServerManager.java b/Plugins/Mineplex.Core/src/mineplex/core/personalServer/PersonalServerManager.java
index db709fd28..466a26d50 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/personalServer/PersonalServerManager.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/personalServer/PersonalServerManager.java
@@ -157,7 +157,7 @@ public class PersonalServerManager extends MiniPlugin
}
final ServerGroup serverGroup = new ServerGroup(serverName, serverName, host.getName(), ram, cpu, 1, 0, UtilMath.random.nextInt(250) + 19999, true, "arcade.zip", "Arcade.jar", "plugins/Arcade/", minPlayers, maxPlayers,
- true, false, false, games, "Player", true, event, false, true, false, true, true, false, false, false, false, true, true, true, false, false, "", _us ? Region.US : Region.EU);
+ true, false, false, games, "Player", true, event, false, true, false, true, true, false, false, false, false, true, true, true, false, false, "", _us ? Region.US : Region.EU, "", "", "", "");
getPlugin().getServer().getScheduler().runTaskAsynchronously(getPlugin(), new Runnable()
{
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/SendCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/SendCommand.java
index 3e447d5ae..e35d2f15e 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/SendCommand.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/SendCommand.java
@@ -14,7 +14,7 @@ public class SendCommand extends CommandBase
{
public SendCommand(Portal plugin)
{
- super(plugin, Rank.ADMIN, "send");
+ super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "send");
}
@Override
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/PreferencesPage.java b/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/PreferencesPage.java
index f293eaf8d..31e1bb563 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/PreferencesPage.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/PreferencesPage.java
@@ -261,7 +261,7 @@ public class PreferencesPage extends ShopPageBase());
}
+
+ public void Reset(Player player, String stringContains)
+ {
+ NautHashMap data = _recharge.get(player.getName());
+
+ if (data == null)
+ return;
+
+ Iterator rechargeIter = data.keySet().iterator();
+
+ while (rechargeIter.hasNext())
+ {
+ String key = rechargeIter.next();
+
+ if (key.toLowerCase().contains(stringContains.toLowerCase()))
+ {
+ rechargeIter.remove();
+ }
+ }
+ }
public void debug(Player player, String ability)
{
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/shop/ShopBase.java b/Plugins/Mineplex.Core/src/mineplex/core/shop/ShopBase.java
index c63e2c6b3..0452a13cb 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/shop/ShopBase.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/shop/ShopBase.java
@@ -87,23 +87,10 @@ public abstract class ShopBase implements Listene
private boolean attemptShopOpen(Player player, LivingEntity entity)
{
- if (!_openedShop.contains(player.getName()) && entity.isCustomNameVisible() && entity.getCustomName() != null && ChatColor.stripColor(entity.getCustomName()).equalsIgnoreCase(ChatColor.stripColor(_name)))
- {
- if (!canOpenShop(player))
- return false;
-
- _openedShop.add(player.getName());
-
- openShopForPlayer(player);
- if (!_playerPageMap.containsKey(player.getName()))
- {
- _playerPageMap.put(player.getName(), buildPagesFor(player));
- }
-
- openPageForPlayer(player, getOpeningPageForPlayer(player));
-
- return true;
- }
+ if (entity.isCustomNameVisible() && entity.getCustomName() != null && ChatColor.stripColor(entity.getCustomName()).equalsIgnoreCase(ChatColor.stripColor(_name)))
+ {
+ return attemptShopOpen(player);
+ }
return false;
}
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/stats/SecondaryStatHandler.java b/Plugins/Mineplex.Core/src/mineplex/core/stats/SecondaryStatHandler.java
index 5901a17e1..eb13e4940 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/stats/SecondaryStatHandler.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/stats/SecondaryStatHandler.java
@@ -18,6 +18,7 @@ import org.jooq.impl.DSL;
import mineplex.core.account.ILoginProcessor;
import mineplex.core.database.DBPool;
import mineplex.database.Tables;
+import org.jooq.types.ULong;
public class SecondaryStatHandler implements ILoginProcessor
{
@@ -58,7 +59,7 @@ public class SecondaryStatHandler implements ILoginProcessor
.insertInto(Tables.accountStat)
.set(Tables.accountStat.accountId, accountId)
.set(Tables.accountStat.statId, statId)
- .set(Tables.accountStat.value, Math.max(oldPlayerStats.getStat(statName), 0L));
+ .set(Tables.accountStat.value, ULong.valueOf(Math.max(oldPlayerStats.getStat(statName), 0L)));
inserts.add(insert);
}
@@ -99,13 +100,13 @@ public class SecondaryStatHandler implements ILoginProcessor
.insertInto(Tables.accountStat)
.set(Tables.accountStat.accountId, accountId)
.set(Tables.accountStat.statId, statId)
- .set(Tables.accountStat.value, Math.max(oldPlayerStats.getStat(statName), 0L));
+ .set(Tables.accountStat.value, ULong.valueOf(Math.max(oldPlayerStats.getStat(statName), 0L)));
inserts.add(insert);
Update update = context
.update(Tables.accountStat)
- .set(Tables.accountStat.value, Math.max(oldPlayerStats.getStat(statName), 0L))
+ .set(Tables.accountStat.value, ULong.valueOf(Math.max(oldPlayerStats.getStat(statName), 0L)))
.where(Tables.accountStat.accountId.eq(accountId))
.and(Tables.accountStat.statId.eq(statId));
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/stats/StatsRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/stats/StatsRepository.java
index 683cca93d..e1524436d 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/stats/StatsRepository.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/stats/StatsRepository.java
@@ -22,6 +22,7 @@ import org.jooq.Result;
import org.jooq.SQLDialect;
import org.jooq.Update;
import org.jooq.impl.DSL;
+import org.jooq.types.ULong;
public class StatsRepository extends RepositoryBase
{
@@ -102,7 +103,7 @@ public class StatsRepository extends RepositoryBase
.insertInto(Tables.accountStat)
.set(Tables.accountStat.accountId, accountId)
.set(Tables.accountStat.statId, statId)
- .set(Tables.accountStat.value, uploadQueue.get(accountId).get(statId));
+ .set(Tables.accountStat.value, ULong.valueOf(uploadQueue.get(accountId).get(statId)));
inserts.add(insert);
}
@@ -137,7 +138,7 @@ public class StatsRepository extends RepositoryBase
context = DSL.using(getConnectionPool(), SQLDialect.MYSQL);
}
- Result> result = context.select(Tables.stats.name, Tables.accountStat.value).from(Tables.accountStat)
+ Result> result = context.select(Tables.stats.name, Tables.accountStat.value).from(Tables.accountStat)
.join(Tables.stats)
.on(Tables.stats.id.eq(Tables.accountStat.statId))
.where(Tables.accountStat.accountId.eq(DSL.select(Tables.accounts.id)
@@ -149,9 +150,9 @@ public class StatsRepository extends RepositoryBase
if (result.isNotEmpty())
{
playerStats = new PlayerStats();
- for (Record2 record : result)
+ for (Record2 record : result)
{
- playerStats.addStat(record.value1(), record.value2());
+ playerStats.addStat(record.value1(), record.value2().longValue());
}
}
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/stats/command/TimeCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/stats/command/TimeCommand.java
index 2754465d8..42fe8b841 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/stats/command/TimeCommand.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/stats/command/TimeCommand.java
@@ -71,7 +71,7 @@ public class TimeCommand extends CommandBase
else
{
long time = Plugin.Get(target).getStat("Global.TimeInGame");
- UtilPlayer.message(caller, F.main("Time", F.name(target.getName() + " has spent " + F.elem(UtilTime.convertString(time * 1000L, 1, UtilTime.TimeUnit.FIT)) + " in game")));
+ UtilPlayer.message(caller, F.main("Time", F.name(target.getName()) + " has spent " + F.elem(UtilTime.convertString(time * 1000L, 1, UtilTime.TimeUnit.FIT)) + " in game"));
}
}
}
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/status/ServerStatusManager.java b/Plugins/Mineplex.Core/src/mineplex/core/status/ServerStatusManager.java
index 2033584ba..520d2417e 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/status/ServerStatusManager.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/status/ServerStatusManager.java
@@ -116,10 +116,8 @@ public class ServerStatusManager extends MiniPlugin
if (event.getType() != UpdateType.FASTER)
return;
- if (!_enabled)
- return;
-
- saveServerStatus();
+ if (_enabled)
+ saveServerStatus();
}
/**
@@ -139,19 +137,6 @@ public class ServerStatusManager extends MiniPlugin
if (server != null && !server.getPublicAddress().equalsIgnoreCase(serverSnapshot.getPublicAddress()))
{
timeout = -DEFAULT_SERVER_TIMEOUT;
- /*
- ProcessRunner pr = new ProcessRunner(new String[] {"/bin/sh", "/home/mineplex/config/killServer.sh", serverSnapshot.getName()});
- pr.start(new GenericRunnable()
- {
- public void run(Boolean error)
- {
- if (error)
- log("Error Killing myself.");
- else
- log("It worked.");
- }
- });
- */
}
_repository.updataServerStatus(serverSnapshot, timeout);
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/teleport/Teleport.java b/Plugins/Mineplex.Core/src/mineplex/core/teleport/Teleport.java
index 79c342ce9..57e62c7df 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/teleport/Teleport.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/teleport/Teleport.java
@@ -20,6 +20,7 @@ import mineplex.core.common.jsonchat.JsonMessage;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap;
+import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilWorld;
@@ -285,7 +286,7 @@ public class Teleport extends MiniPlugin
}
player.setFallDistance(0);
- player.setVelocity(new Vector(0,0,0));
+ UtilAction.velocity(player, new Vector(0,1,0), 0, false, 0, 0, 0, false);
player.teleport(loc);
}
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/teleport/command/HereCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/teleport/command/HereCommand.java
index a2371ce9a..264695e3a 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/teleport/command/HereCommand.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/teleport/command/HereCommand.java
@@ -10,7 +10,7 @@ public class HereCommand extends CommandBase
{
public HereCommand(Teleport plugin)
{
- super(plugin, Rank.ADMIN, "here", "h");
+ super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "here", "h");
}
@Override
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureLocation.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureLocation.java
index 570eb152c..7f4ef7667 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureLocation.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureLocation.java
@@ -327,6 +327,11 @@ public class TreasureLocation implements Listener
_hologram.start();
}
+ public Treasure getCurrentTreasure()
+ {
+ return _currentTreasure;
+ }
+
public void openShop(Player player)
{
_shop.attemptShopOpen(player);
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureManager.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureManager.java
index 8eb5f02a3..39de66bf0 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureManager.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureManager.java
@@ -125,6 +125,22 @@ public class TreasureManager extends MiniPlugin
return _rewardManager.getRewards(player, rewardType);
}
+ public boolean isOpening(Player player)
+ {
+ for (TreasureLocation treasureLocation : _treasureLocations)
+ {
+ Treasure treasure = treasureLocation.getCurrentTreasure();
+
+ if (treasure == null)
+ continue;
+
+ if (treasure.getPlayer().equals(player))
+ return true;
+ }
+
+ return false;
+ }
+
public BlockRestore getBlockRestore()
{
return _blockRestore;
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/updater/RestartServerCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/updater/RestartServerCommand.java
index ff2a51f08..1067506b0 100644
--- a/Plugins/Mineplex.Core/src/mineplex/core/updater/RestartServerCommand.java
+++ b/Plugins/Mineplex.Core/src/mineplex/core/updater/RestartServerCommand.java
@@ -15,7 +15,7 @@ public class RestartServerCommand extends CommandBase
{
public RestartServerCommand(FileUpdater plugin)
{
- super(plugin, Rank.ADMIN, "restart");
+ super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "restart");
}
@Override
diff --git a/Plugins/Mineplex.Core/src/mineplex/core/velocity/VelocityFix.java b/Plugins/Mineplex.Core/src/mineplex/core/velocity/VelocityFix.java
new file mode 100644
index 000000000..7649f3431
--- /dev/null
+++ b/Plugins/Mineplex.Core/src/mineplex/core/velocity/VelocityFix.java
@@ -0,0 +1,78 @@
+package mineplex.core.velocity;
+
+import java.util.Iterator;
+
+import mineplex.core.MiniPlugin;
+import mineplex.core.common.util.NautHashMap;
+import mineplex.core.common.util.UtilAction;
+import mineplex.core.common.util.VelocityReceiver;
+import mineplex.core.updater.UpdateType;
+import mineplex.core.updater.event.UpdateEvent;
+
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.player.PlayerQuitEvent;
+import org.bukkit.event.player.PlayerVelocityEvent;
+import org.bukkit.plugin.java.JavaPlugin;
+import org.bukkit.util.Vector;
+
+public class VelocityFix extends MiniPlugin implements VelocityReceiver
+{
+ /*
+ * The purpose of this class is to fix a bug inherent in Minecraft,
+ * where player join order will somehow modify the velocity sent to players.
+ *
+ * To fix it, we simply save the velocity that the player should have received,
+ * then we re-set those values in CB the moment its about to actually apply the velocity to a player.
+ *
+ * The problem was caused by the fact that CB does not run a PlayerVelocityEvent the moment we
+ * set a players velocity, instead it waits until the next tick, and the velocity may have been changed.
+ *
+ */
+
+ private NautHashMap _velocityData = new NautHashMap();
+
+ public VelocityFix(JavaPlugin plugin)
+ {
+ super("Velocity Fix", plugin);
+
+ UtilAction.registerVelocityFix(this);
+ }
+
+ @Override
+ public void setPlayerVelocity(Player player, Vector velocity)
+ {
+ _velocityData.put(player, velocity);
+ }
+
+ @EventHandler(priority = EventPriority.LOWEST)
+ public void fixVelocity(PlayerVelocityEvent event)
+ {
+ if (_velocityData.containsKey(event.getPlayer()))
+ event.getPlayer().setVelocity(_velocityData.remove(event.getPlayer()));
+ }
+
+ @EventHandler
+ public void cleanVelocity(PlayerQuitEvent event)
+ {
+ _velocityData.remove(event.getPlayer());
+ }
+
+ @EventHandler
+ public void cleanVelocity(UpdateEvent event)
+ {
+ if (event.getType() != UpdateType.SLOW)
+ return;
+
+ Iterator keyIter = _velocityData.keySet().iterator();
+
+ while (keyIter.hasNext())
+ {
+ Player player = keyIter.next();
+
+ if (player.isOnline())
+ keyIter.remove();
+ }
+ }
+}
diff --git a/Plugins/Mineplex.Database/src/mineplex/database/Account.java b/Plugins/Mineplex.Database/src/mineplex/database/Account.java
index 9e66bafa8..745edad55 100644
--- a/Plugins/Mineplex.Database/src/mineplex/database/Account.java
+++ b/Plugins/Mineplex.Database/src/mineplex/database/Account.java
@@ -16,7 +16,7 @@ package mineplex.database;
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Account extends org.jooq.impl.SchemaImpl implements java.io.Serializable, java.lang.Cloneable {
- private static final long serialVersionUID = 625106486;
+ private static final long serialVersionUID = 2034846771;
/**
* The reference instance of Account
@@ -54,6 +54,7 @@ public class Account extends org.jooq.impl.SchemaImpl implements java.io.Seriali
mineplex.database.tables.AccountTransactions.accountTransactions,
mineplex.database.tables.ActiveTournaments.activeTournaments,
mineplex.database.tables.Bonus.bonus,
+ mineplex.database.tables.Chatsnap.chatsnap,
mineplex.database.tables.ClanAlliances.clanAlliances,
mineplex.database.tables.ClanEnemies.clanEnemies,
mineplex.database.tables.ClanMember.clanMember,
diff --git a/Plugins/Mineplex.Database/src/mineplex/database/Keys.java b/Plugins/Mineplex.Database/src/mineplex/database/Keys.java
index 4eb24c54d..58b66870c 100644
--- a/Plugins/Mineplex.Database/src/mineplex/database/Keys.java
+++ b/Plugins/Mineplex.Database/src/mineplex/database/Keys.java
@@ -34,6 +34,7 @@ public class Keys {
public static final org.jooq.Identity IDENTITY_accountTasks = Identities0.IDENTITY_accountTasks;
public static final org.jooq.Identity IDENTITY_accountTransactions = Identities0.IDENTITY_accountTransactions;
public static final org.jooq.Identity IDENTITY_bonus = Identities0.IDENTITY_bonus;
+ public static final org.jooq.Identity IDENTITY_chatsnap = Identities0.IDENTITY_chatsnap;
public static final org.jooq.Identity IDENTITY_clanAlliances = Identities0.IDENTITY_clanAlliances;
public static final org.jooq.Identity IDENTITY_clanEnemies = Identities0.IDENTITY_clanEnemies;
public static final org.jooq.Identity IDENTITY_clans = Identities0.IDENTITY_clans;
@@ -83,6 +84,7 @@ public class Keys {
public static final org.jooq.UniqueKey KEY_accountTransactions_PRIMARY = UniqueKeys0.KEY_accountTransactions_PRIMARY;
public static final org.jooq.UniqueKey KEY_activeTournaments_PRIMARY = UniqueKeys0.KEY_activeTournaments_PRIMARY;
public static final org.jooq.UniqueKey KEY_bonus_PRIMARY = UniqueKeys0.KEY_bonus_PRIMARY;
+ public static final org.jooq.UniqueKey KEY_chatsnap_PRIMARY = UniqueKeys0.KEY_chatsnap_PRIMARY;
public static final org.jooq.UniqueKey KEY_clanAlliances_PRIMARY = UniqueKeys0.KEY_clanAlliances_PRIMARY;
public static final org.jooq.UniqueKey KEY_clanEnemies_PRIMARY = UniqueKeys0.KEY_clanEnemies_PRIMARY;
public static final org.jooq.UniqueKey KEY_clanEnemies_unique_clanId = UniqueKeys0.KEY_clanEnemies_unique_clanId;
@@ -175,6 +177,7 @@ public class Keys {
public static org.jooq.Identity IDENTITY_accountTasks = createIdentity(mineplex.database.tables.AccountTasks.accountTasks, mineplex.database.tables.AccountTasks.accountTasks.id);
public static org.jooq.Identity IDENTITY_accountTransactions = createIdentity(mineplex.database.tables.AccountTransactions.accountTransactions, mineplex.database.tables.AccountTransactions.accountTransactions.id);
public static org.jooq.Identity IDENTITY_bonus = createIdentity(mineplex.database.tables.Bonus.bonus, mineplex.database.tables.Bonus.bonus.accountId);
+ public static org.jooq.Identity IDENTITY_chatsnap = createIdentity(mineplex.database.tables.Chatsnap.chatsnap, mineplex.database.tables.Chatsnap.chatsnap.id);
public static org.jooq.Identity IDENTITY_clanAlliances = createIdentity(mineplex.database.tables.ClanAlliances.clanAlliances, mineplex.database.tables.ClanAlliances.clanAlliances.id);
public static org.jooq.Identity IDENTITY_clanEnemies = createIdentity(mineplex.database.tables.ClanEnemies.clanEnemies, mineplex.database.tables.ClanEnemies.clanEnemies.id);
public static org.jooq.Identity IDENTITY_clans = createIdentity(mineplex.database.tables.Clans.clans, mineplex.database.tables.Clans.clans.id);
@@ -222,6 +225,7 @@ public class Keys {
public static final org.jooq.UniqueKey KEY_accountTransactions_PRIMARY = createUniqueKey(mineplex.database.tables.AccountTransactions.accountTransactions, mineplex.database.tables.AccountTransactions.accountTransactions.id);
public static final org.jooq.UniqueKey KEY_activeTournaments_PRIMARY = createUniqueKey(mineplex.database.tables.ActiveTournaments.activeTournaments, mineplex.database.tables.ActiveTournaments.activeTournaments.name);
public static final org.jooq.UniqueKey KEY_bonus_PRIMARY = createUniqueKey(mineplex.database.tables.Bonus.bonus, mineplex.database.tables.Bonus.bonus.accountId);
+ public static final org.jooq.UniqueKey KEY_chatsnap_PRIMARY = createUniqueKey(mineplex.database.tables.Chatsnap.chatsnap, mineplex.database.tables.Chatsnap.chatsnap.id);
public static final org.jooq.UniqueKey KEY_clanAlliances_PRIMARY = createUniqueKey(mineplex.database.tables.ClanAlliances.clanAlliances, mineplex.database.tables.ClanAlliances.clanAlliances.id);
public static final org.jooq.UniqueKey KEY_clanEnemies_PRIMARY = createUniqueKey(mineplex.database.tables.ClanEnemies.clanEnemies, mineplex.database.tables.ClanEnemies.clanEnemies.id);
public static final org.jooq.UniqueKey KEY_clanEnemies_unique_clanId = createUniqueKey(mineplex.database.tables.ClanEnemies.clanEnemies, mineplex.database.tables.ClanEnemies.clanEnemies.clanId);
diff --git a/Plugins/Mineplex.Database/src/mineplex/database/Routines.java b/Plugins/Mineplex.Database/src/mineplex/database/Routines.java
index 21ae7415e..9a5c0f4de 100644
--- a/Plugins/Mineplex.Database/src/mineplex/database/Routines.java
+++ b/Plugins/Mineplex.Database/src/mineplex/database/Routines.java
@@ -54,6 +54,19 @@ public class Routines {
return p;
}
+ /**
+ * Call Account.check_vote
+ */
+ public static mineplex.database.routines.Check_vote callCheckVote(org.jooq.Configuration configuration, java.lang.Integer accountId_in, java.lang.Integer coinsChange, java.lang.Integer gemsChange) {
+ mineplex.database.routines.Check_vote p = new mineplex.database.routines.Check_vote();
+ p.setAccountId_in(accountId_in);
+ p.setCoinsChange(coinsChange);
+ p.setGemsChange(gemsChange);
+
+ p.execute(configuration);
+ return p;
+ }
+
/**
* Call Account.createLeaderboard
*/
diff --git a/Plugins/Mineplex.Database/src/mineplex/database/Tables.java b/Plugins/Mineplex.Database/src/mineplex/database/Tables.java
index 36f9b2e67..6036ed719 100644
--- a/Plugins/Mineplex.Database/src/mineplex/database/Tables.java
+++ b/Plugins/Mineplex.Database/src/mineplex/database/Tables.java
@@ -91,6 +91,11 @@ public class Tables {
*/
public static final mineplex.database.tables.Bonus bonus = mineplex.database.tables.Bonus.bonus;
+ /**
+ * The table Account.chatsnap
+ */
+ public static final mineplex.database.tables.Chatsnap chatsnap = mineplex.database.tables.Chatsnap.chatsnap;
+
/**
* The table Account.clanAlliances
*/
diff --git a/Plugins/Mineplex.Database/src/mineplex/database/routines/Check_vote.java b/Plugins/Mineplex.Database/src/mineplex/database/routines/Check_vote.java
new file mode 100644
index 000000000..847580a4c
--- /dev/null
+++ b/Plugins/Mineplex.Database/src/mineplex/database/routines/Check_vote.java
@@ -0,0 +1,93 @@
+/**
+ * This class is generated by jOOQ
+ */
+package mineplex.database.routines;
+
+/**
+ * This class is generated by jOOQ.
+ */
+@javax.annotation.Generated(
+ value = {
+ "http://www.jooq.org",
+ "jOOQ version:3.5.2"
+ },
+ comments = "This class is generated by jOOQ"
+)
+@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class Check_vote extends org.jooq.impl.AbstractRoutine implements java.io.Serializable, java.lang.Cloneable {
+
+ private static final long serialVersionUID = 2035299030;
+
+ /**
+ * The parameter Account.check_vote.accountId_in
.
+ */
+ public static final org.jooq.Parameter accountId_in = createParameter("accountId_in", org.jooq.impl.SQLDataType.INTEGER, false);
+
+ /**
+ * The parameter Account.check_vote.coinsChange
.
+ */
+ public static final org.jooq.Parameter coinsChange = createParameter("coinsChange", org.jooq.impl.SQLDataType.INTEGER, false);
+
+ /**
+ * The parameter Account.check_vote.gemsChange
.
+ */
+ public static final org.jooq.Parameter gemsChange = createParameter("gemsChange", org.jooq.impl.SQLDataType.INTEGER, false);
+
+ /**
+ * The parameter Account.check_vote.pass
.
+ */
+ public static final org.jooq.Parameter pass = createParameter("pass", org.jooq.impl.SQLDataType.TINYINT, false);
+
+ /**
+ * The parameter Account.check_vote.outTime
.
+ */
+ public static final org.jooq.Parameter outTime = createParameter("outTime", org.jooq.impl.SQLDataType.DATE, false);
+
+ /**
+ * Create a new routine call instance
+ */
+ public Check_vote() {
+ super("check_vote", mineplex.database.Account.Account);
+
+ addInParameter(accountId_in);
+ addInParameter(coinsChange);
+ addInParameter(gemsChange);
+ addOutParameter(pass);
+ addOutParameter(outTime);
+ }
+
+ /**
+ * Set the accountId_in
parameter IN value to the routine
+ */
+ public void setAccountId_in(java.lang.Integer value) {
+ setValue(mineplex.database.routines.Check_vote.accountId_in, value);
+ }
+
+ /**
+ * Set the coinsChange
parameter IN value to the routine
+ */
+ public void setCoinsChange(java.lang.Integer value) {
+ setValue(mineplex.database.routines.Check_vote.coinsChange, value);
+ }
+
+ /**
+ * Set the gemsChange
parameter IN value to the routine
+ */
+ public void setGemsChange(java.lang.Integer value) {
+ setValue(mineplex.database.routines.Check_vote.gemsChange, value);
+ }
+
+ /**
+ * Get the pass
parameter OUT value from the routine
+ */
+ public java.lang.Byte getPass() {
+ return getValue(pass);
+ }
+
+ /**
+ * Get the outTime
parameter OUT value from the routine
+ */
+ public java.sql.Date getOutTime() {
+ return getValue(outTime);
+ }
+}
diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountStat.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountStat.java
index fead0616c..a73aa75b4 100644
--- a/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountStat.java
+++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/AccountStat.java
@@ -16,7 +16,7 @@ package mineplex.database.tables;
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class AccountStat extends org.jooq.impl.TableImpl implements java.io.Serializable, java.lang.Cloneable {
- private static final long serialVersionUID = 956897097;
+ private static final long serialVersionUID = 34581219;
/**
* The reference instance of Account.accountStat
@@ -44,7 +44,7 @@ public class AccountStat extends org.jooq.impl.TableImplAccount.accountStat.value.
*/
- public final org.jooq.TableField value = createField("value", org.jooq.impl.SQLDataType.BIGINT.defaulted(true), this, "");
+ public final org.jooq.TableField value = createField("value", org.jooq.impl.SQLDataType.BIGINTUNSIGNED.defaulted(true), this, "");
/**
* Create a Account.accountStat
table reference
diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/Bonus.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/Bonus.java
index a2acbbbb5..93914d875 100644
--- a/Plugins/Mineplex.Database/src/mineplex/database/tables/Bonus.java
+++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/Bonus.java
@@ -16,7 +16,7 @@ package mineplex.database.tables;
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Bonus extends org.jooq.impl.TableImpl implements java.io.Serializable, java.lang.Cloneable {
- private static final long serialVersionUID = -70389593;
+ private static final long serialVersionUID = -524321170;
/**
* The reference instance of Account.bonus
@@ -46,6 +46,36 @@ public class Bonus extends org.jooq.impl.TableImpl ranktime = createField("ranktime", org.jooq.impl.SQLDataType.DATE, this, "");
+ /**
+ * The column Account.bonus.votetime
.
+ */
+ public final org.jooq.TableField votetime = createField("votetime", org.jooq.impl.SQLDataType.DATE, this, "");
+
+ /**
+ * The column Account.bonus.dailyStreak
.
+ */
+ public final org.jooq.TableField dailyStreak = createField("dailyStreak", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.bonus.maxDailyStreak
.
+ */
+ public final org.jooq.TableField maxDailyStreak = createField("maxDailyStreak", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.bonus.voteStreak
.
+ */
+ public final org.jooq.TableField voteStreak = createField("voteStreak", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.bonus.maxVoteStreak
.
+ */
+ public final org.jooq.TableField maxVoteStreak = createField("maxVoteStreak", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.bonus.tickets
.
+ */
+ public final org.jooq.TableField tickets = createField("tickets", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
/**
* Create a Account.bonus
table reference
*/
diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/Chatsnap.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/Chatsnap.java
new file mode 100644
index 000000000..044ee5e36
--- /dev/null
+++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/Chatsnap.java
@@ -0,0 +1,129 @@
+/**
+ * This class is generated by jOOQ
+ */
+package mineplex.database.tables;
+
+/**
+ * This class is generated by jOOQ.
+ */
+@javax.annotation.Generated(
+ value = {
+ "http://www.jooq.org",
+ "jOOQ version:3.5.2"
+ },
+ comments = "This class is generated by jOOQ"
+)
+@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class Chatsnap extends org.jooq.impl.TableImpl implements java.io.Serializable, java.lang.Cloneable {
+
+ private static final long serialVersionUID = -176946707;
+
+ /**
+ * The reference instance of Account.chatsnap
+ */
+ public static final mineplex.database.tables.Chatsnap chatsnap = new mineplex.database.tables.Chatsnap();
+
+ /**
+ * The class holding records for this type
+ */
+ @Override
+ public java.lang.Class getRecordType() {
+ return mineplex.database.tables.records.ChatsnapRecord.class;
+ }
+
+ /**
+ * The column Account.chatsnap.id
.
+ */
+ public final org.jooq.TableField id = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.chatsnap.reporterId
.
+ */
+ public final org.jooq.TableField reporterId = createField("reporterId", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.chatsnap.reporteeId
.
+ */
+ public final org.jooq.TableField reporteeId = createField("reporteeId", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column Account.chatsnap.time
.
+ */
+ public final org.jooq.TableField time = createField("time", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaulted(true), this, "");
+
+ /**
+ * The column Account.chatsnap.status
.
+ */
+ public final org.jooq.TableField status = createField("status", org.jooq.impl.SQLDataType.VARCHAR.length(10).nullable(false).defaulted(true), this, "");
+
+ /**
+ * The column Account.chatsnap.reason
.
+ */
+ public final org.jooq.TableField reason = createField("reason", org.jooq.impl.SQLDataType.CLOB.length(65535).nullable(false), this, "");
+
+ /**
+ * The column Account.chatsnap.data
.
+ */
+ public final org.jooq.TableField data = createField("data", org.jooq.impl.SQLDataType.CLOB.length(16777215).nullable(false), this, "");
+
+ /**
+ * Create a Account.chatsnap
table reference
+ */
+ public Chatsnap() {
+ this("chatsnap", null);
+ }
+
+ /**
+ * Create an aliased Account.chatsnap
table reference
+ */
+ public Chatsnap(java.lang.String alias) {
+ this(alias, mineplex.database.tables.Chatsnap.chatsnap);
+ }
+
+ private Chatsnap(java.lang.String alias, org.jooq.Table aliased) {
+ this(alias, aliased, null);
+ }
+
+ private Chatsnap(java.lang.String alias, org.jooq.Table aliased, org.jooq.Field>[] parameters) {
+ super(alias, mineplex.database.Account.Account, aliased, parameters, "");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Identity getIdentity() {
+ return mineplex.database.Keys.IDENTITY_chatsnap;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.UniqueKey getPrimaryKey() {
+ return mineplex.database.Keys.KEY_chatsnap_PRIMARY;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public java.util.List> getKeys() {
+ return java.util.Arrays.>asList(mineplex.database.Keys.KEY_chatsnap_PRIMARY);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public mineplex.database.tables.Chatsnap as(java.lang.String alias) {
+ return new mineplex.database.tables.Chatsnap(alias, this);
+ }
+
+ /**
+ * Rename this table
+ */
+ public mineplex.database.tables.Chatsnap rename(java.lang.String name) {
+ return new mineplex.database.tables.Chatsnap(name, null);
+ }
+}
diff --git a/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountStatRecord.java b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountStatRecord.java
index 83dc0a684..df8d59c6e 100644
--- a/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountStatRecord.java
+++ b/Plugins/Mineplex.Database/src/mineplex/database/tables/records/AccountStatRecord.java
@@ -14,9 +14,9 @@ package mineplex.database.tables.records;
comments = "This class is generated by jOOQ"
)
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
-public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record3 {
+public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record3 {
- private static final long serialVersionUID = 1109290129;
+ private static final long serialVersionUID = -516667486;
/**
* Setter for Account.accountStat.accountId
.
@@ -49,15 +49,15 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImplAccount.accountStat.value.
*/
- public void setValue(java.lang.Long value) {
+ public void setValue(org.jooq.types.ULong value) {
setValue(2, value);
}
/**
* Getter for Account.accountStat.value
.
*/
- public java.lang.Long getValue() {
- return (java.lang.Long) getValue(2);
+ public org.jooq.types.ULong getValue() {
+ return (org.jooq.types.ULong) getValue(2);
}
// -------------------------------------------------------------------------
@@ -80,7 +80,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl fieldsRow() {
+ public org.jooq.Row3 fieldsRow() {
return (org.jooq.Row3) super.fieldsRow();
}
@@ -88,7 +88,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl valuesRow() {
+ public org.jooq.Row3 valuesRow() {
return (org.jooq.Row3) super.valuesRow();
}
@@ -112,7 +112,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl field3() {
+ public org.jooq.Field field3() {
return mineplex.database.tables.AccountStat.accountStat.value;
}
@@ -136,7 +136,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record3 {
+public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record9 {
- private static final long serialVersionUID = -64019858;
+ private static final long serialVersionUID = -785434679;
/**
* Setter for Account.bonus.accountId
.
@@ -60,6 +60,90 @@ public class BonusRecord extends org.jooq.impl.UpdatableRecordImplAccount.bonus.votetime.
+ */
+ public void setVotetime(java.sql.Date value) {
+ setValue(3, value);
+ }
+
+ /**
+ * Getter for Account.bonus.votetime
.
+ */
+ public java.sql.Date getVotetime() {
+ return (java.sql.Date) getValue(3);
+ }
+
+ /**
+ * Setter for Account.bonus.dailyStreak
.
+ */
+ public void setDailyStreak(java.lang.Integer value) {
+ setValue(4, value);
+ }
+
+ /**
+ * Getter for Account.bonus.dailyStreak
.
+ */
+ public java.lang.Integer getDailyStreak() {
+ return (java.lang.Integer) getValue(4);
+ }
+
+ /**
+ * Setter for Account.bonus.maxDailyStreak
.
+ */
+ public void setMaxDailyStreak(java.lang.Integer value) {
+ setValue(5, value);
+ }
+
+ /**
+ * Getter for Account.bonus.maxDailyStreak
.
+ */
+ public java.lang.Integer getMaxDailyStreak() {
+ return (java.lang.Integer) getValue(5);
+ }
+
+ /**
+ * Setter for Account.bonus.voteStreak
.
+ */
+ public void setVoteStreak(java.lang.Integer value) {
+ setValue(6, value);
+ }
+
+ /**
+ * Getter for Account.bonus.voteStreak
.
+ */
+ public java.lang.Integer getVoteStreak() {
+ return (java.lang.Integer) getValue(6);
+ }
+
+ /**
+ * Setter for Account.bonus.maxVoteStreak
.
+ */
+ public void setMaxVoteStreak(java.lang.Integer value) {
+ setValue(7, value);
+ }
+
+ /**
+ * Getter for Account.bonus.maxVoteStreak
.
+ */
+ public java.lang.Integer getMaxVoteStreak() {
+ return (java.lang.Integer) getValue(7);
+ }
+
+ /**
+ * Setter for Account.bonus.tickets
.
+ */
+ public void setTickets(java.lang.Integer value) {
+ setValue(8, value);
+ }
+
+ /**
+ * Getter for Account.bonus.tickets
.
+ */
+ public java.lang.Integer getTickets() {
+ return (java.lang.Integer) getValue(8);
+ }
+
// -------------------------------------------------------------------------
// Primary key information
// -------------------------------------------------------------------------
@@ -73,23 +157,23 @@ public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl fieldsRow() {
- return (org.jooq.Row3) super.fieldsRow();
+ public org.jooq.Row9 fieldsRow() {
+ return (org.jooq.Row9) super.fieldsRow();
}
/**
* {@inheritDoc}
*/
@Override
- public org.jooq.Row3 valuesRow() {
- return (org.jooq.Row3) super.valuesRow();
+ public org.jooq.Row9 valuesRow() {
+ return (org.jooq.Row9) super.valuesRow();
}
/**
@@ -116,6 +200,54 @@ public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl field4() {
+ return mineplex.database.tables.Bonus.bonus.votetime;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Field field5() {
+ return mineplex.database.tables.Bonus.bonus.dailyStreak;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Field field6() {
+ return mineplex.database.tables.Bonus.bonus.maxDailyStreak;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Field field7() {
+ return mineplex.database.tables.Bonus.bonus.voteStreak;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Field field8() {
+ return mineplex.database.tables.Bonus.bonus.maxVoteStreak;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Field field9() {
+ return mineplex.database.tables.Bonus.bonus.tickets;
+ }
+
/**
* {@inheritDoc}
*/
@@ -140,6 +272,54 @@ public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record7 {
+
+ private static final long serialVersionUID = 2087133341;
+
+ /**
+ * Setter for Account.chatsnap.id
.
+ */
+ public void setId(java.lang.Integer value) {
+ setValue(0, value);
+ }
+
+ /**
+ * Getter for Account.chatsnap.id
.
+ */
+ public java.lang.Integer getId() {
+ return (java.lang.Integer) getValue(0);
+ }
+
+ /**
+ * Setter for Account.chatsnap.reporterId
.
+ */
+ public void setReporterId(java.lang.Integer value) {
+ setValue(1, value);
+ }
+
+ /**
+ * Getter for Account.chatsnap.reporterId
.
+ */
+ public java.lang.Integer getReporterId() {
+ return (java.lang.Integer) getValue(1);
+ }
+
+ /**
+ * Setter for Account.chatsnap.reporteeId
.
+ */
+ public void setReporteeId(java.lang.Integer value) {
+ setValue(2, value);
+ }
+
+ /**
+ * Getter for Account.chatsnap.reporteeId
.
+ */
+ public java.lang.Integer getReporteeId() {
+ return (java.lang.Integer) getValue(2);
+ }
+
+ /**
+ * Setter for Account.chatsnap.time
.
+ */
+ public void setTime(java.sql.Timestamp value) {
+ setValue(3, value);
+ }
+
+ /**
+ * Getter for Account.chatsnap.time
.
+ */
+ public java.sql.Timestamp getTime() {
+ return (java.sql.Timestamp) getValue(3);
+ }
+
+ /**
+ * Setter for Account.chatsnap.status
.
+ */
+ public void setStatus(java.lang.String value) {
+ setValue(4, value);
+ }
+
+ /**
+ * Getter for Account.chatsnap.status
.
+ */
+ public java.lang.String getStatus() {
+ return (java.lang.String) getValue(4);
+ }
+
+ /**
+ * Setter for Account.chatsnap.reason
.
+ */
+ public void setReason(java.lang.String value) {
+ setValue(5, value);
+ }
+
+ /**
+ * Getter for Account.chatsnap.reason
.
+ */
+ public java.lang.String getReason() {
+ return (java.lang.String) getValue(5);
+ }
+
+ /**
+ * Setter for Account.chatsnap.data
.
+ */
+ public void setData(java.lang.String value) {
+ setValue(6, value);
+ }
+
+ /**
+ * Getter for Account.chatsnap.data
.
+ */
+ public java.lang.String getData() {
+ return (java.lang.String) getValue(6);
+ }
+
+ // -------------------------------------------------------------------------
+ // Primary key information
+ // -------------------------------------------------------------------------
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Record1 key() {
+ return (org.jooq.Record1) super.key();
+ }
+
+ // -------------------------------------------------------------------------
+ // Record7 type implementation
+ // -------------------------------------------------------------------------
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Row7 fieldsRow() {
+ return (org.jooq.Row7) super.fieldsRow();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Row7 valuesRow() {
+ return (org.jooq.Row7) super.valuesRow();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Field field1() {
+ return mineplex.database.tables.Chatsnap.chatsnap.id;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Field field2() {
+ return mineplex.database.tables.Chatsnap.chatsnap.reporterId;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Field field3() {
+ return mineplex.database.tables.Chatsnap.chatsnap.reporteeId;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Field field4() {
+ return mineplex.database.tables.Chatsnap.chatsnap.time;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Field field5() {
+ return mineplex.database.tables.Chatsnap.chatsnap.status;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Field field6() {
+ return mineplex.database.tables.Chatsnap.chatsnap.reason;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.jooq.Field field7() {
+ return mineplex.database.tables.Chatsnap.chatsnap.data;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public java.lang.Integer value1() {
+ return getId();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public java.lang.Integer value2() {
+ return getReporterId();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public java.lang.Integer value3() {
+ return getReporteeId();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public java.sql.Timestamp value4() {
+ return getTime();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public java.lang.String value5() {
+ return getStatus();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public java.lang.String value6() {
+ return getReason();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public java.lang.String value7() {
+ return getData();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ChatsnapRecord value1(java.lang.Integer value) {
+ setId(value);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ChatsnapRecord value2(java.lang.Integer value) {
+ setReporterId(value);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ChatsnapRecord value3(java.lang.Integer value) {
+ setReporteeId(value);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ChatsnapRecord value4(java.sql.Timestamp value) {
+ setTime(value);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ChatsnapRecord value5(java.lang.String value) {
+ setStatus(value);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ChatsnapRecord value6(java.lang.String value) {
+ setReason(value);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ChatsnapRecord value7(java.lang.String value) {
+ setData(value);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ChatsnapRecord values(java.lang.Integer value1, java.lang.Integer value2, java.lang.Integer value3, java.sql.Timestamp value4, java.lang.String value5, java.lang.String value6, java.lang.String value7) {
+ return this;
+ }
+
+ // -------------------------------------------------------------------------
+ // Constructors
+ // -------------------------------------------------------------------------
+
+ /**
+ * Create a detached ChatsnapRecord
+ */
+ public ChatsnapRecord() {
+ super(mineplex.database.tables.Chatsnap.chatsnap);
+ }
+
+ /**
+ * Create a detached, initialised ChatsnapRecord
+ */
+ public ChatsnapRecord(java.lang.Integer id, java.lang.Integer reporterId, java.lang.Integer reporteeId, java.sql.Timestamp time, java.lang.String status, java.lang.String reason, java.lang.String data) {
+ super(mineplex.database.tables.Chatsnap.chatsnap);
+
+ setValue(0, id);
+ setValue(1, reporterId);
+ setValue(2, reporteeId);
+ setValue(3, time);
+ setValue(4, status);
+ setValue(5, reason);
+ setValue(6, data);
+ }
+}
diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java b/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java
index 1cf6b3b8f..0873db91b 100644
--- a/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java
+++ b/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java
@@ -46,6 +46,7 @@ import mineplex.core.task.TaskManager;
import mineplex.core.teleport.Teleport;
import mineplex.core.updater.FileUpdater;
import mineplex.core.updater.Updater;
+import mineplex.core.velocity.VelocityFix;
import mineplex.core.visibility.VisibilityManager;
import mineplex.hub.modules.StackerManager;
import mineplex.hub.poll.PollManager;
@@ -78,6 +79,9 @@ public class Hub extends JavaPlugin implements IRelation
//Logger.initialize(this);
+ //Velocity Fix
+ new VelocityFix(this);
+
//Static Modules
CommandCenter.Initialize(this);
CoreClientManager clientManager = new CoreClientManager(this, webServerAddress);
diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java
index 2e1dbc813..2cf2e5b53 100644
--- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java
+++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java
@@ -1,16 +1,13 @@
package mineplex.hub;
import java.util.ArrayList;
-import java.util.Calendar;
import java.util.HashMap;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
-import org.bukkit.Color;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
-import org.bukkit.Sound;
import org.bukkit.craftbukkit.v1_7_R4.CraftWorld;
import org.bukkit.entity.Egg;
import org.bukkit.entity.Entity;
@@ -54,7 +51,6 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
-import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
@@ -91,11 +87,11 @@ import mineplex.hub.commands.GadgetToggle;
import mineplex.hub.commands.GameModeCommand;
import mineplex.hub.commands.NewsCommand;
import mineplex.hub.modules.ForcefieldManager;
+import mineplex.hub.modules.HubVisibilityManager;
import mineplex.hub.modules.JumpManager;
import mineplex.hub.modules.NewsManager;
import mineplex.hub.modules.ParkourManager;
import mineplex.hub.modules.TextManager;
-import mineplex.hub.modules.HubVisibilityManager;
import mineplex.hub.modules.WorldManager;
import mineplex.hub.poll.PollManager;
import mineplex.hub.tutorial.TutorialManager;
@@ -107,7 +103,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent;
public class HubManager extends MiniClientPlugin
{
// ☃❅ Snowman!
- public HubType Type = HubType.Normal;
+ public HubType Type = HubType.Normal;
private BlockRestore _blockRestore;
private CoreClientManager _clientManager;
@@ -499,7 +495,10 @@ public class HubManager extends MiniClientPlugin
@EventHandler(priority = EventPriority.LOW)
public void AdminOP(PlayerJoinEvent event)
{
- if (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.OWNER))
+ // Give developers operator on their servers
+ boolean testServer = _plugin.getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
+
+ if (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.OWNER) || (testServer && (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.DEVELOPER) || _clientManager.Get(event.getPlayer()).GetRank() == Rank.JNR_DEV)))
event.getPlayer().setOp(true);
else
event.getPlayer().setOp(false);
@@ -899,6 +898,11 @@ public class HubManager extends MiniClientPlugin
return _gadgetManager;
}
+ public TreasureManager GetTreasure()
+ {
+ return _treasureManager;
+ }
+
public MountManager GetMount()
{
return _mountManager;
diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/GadgetToggle.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/GadgetToggle.java
index 810e964d8..2d99ce5d7 100644
--- a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/GadgetToggle.java
+++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/GadgetToggle.java
@@ -10,7 +10,7 @@ public class GadgetToggle extends CommandBase
{
public GadgetToggle(HubManager plugin)
{
- super(plugin, Rank.ADMIN, new String[] {"gadget"});
+ super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, new String[] {"gadget"});
}
@Override
diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/GameModeCommand.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/GameModeCommand.java
index 7900e79ee..4416e7b15 100644
--- a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/GameModeCommand.java
+++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/GameModeCommand.java
@@ -13,7 +13,7 @@ public class GameModeCommand extends CommandBase
{
public GameModeCommand(HubManager plugin)
{
- super(plugin, Rank.ADMIN, new String[] {"gm"});
+ super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, new String[] {"gm"});
}
@Override
diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsCommand.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsCommand.java
index dd1e33d77..a9e6cf029 100644
--- a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsCommand.java
+++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsCommand.java
@@ -10,7 +10,7 @@ public class NewsCommand extends MultiCommandBase
{
public NewsCommand(HubManager plugin)
{
- super(plugin, Rank.ADMIN, "news");
+ super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "news");
AddCommand(new NewsAddCommand(plugin));
AddCommand(new NewsDeleteCommand(plugin));
diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsListCommand.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsListCommand.java
index e3ca7c240..fa32eb919 100644
--- a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsListCommand.java
+++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsListCommand.java
@@ -19,7 +19,7 @@ public class NewsListCommand extends CommandBase
{
public NewsListCommand(HubManager plugin)
{
- super(plugin, Rank.ADMIN, "list");
+ super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "list");
}
@Override
diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ForcefieldManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ForcefieldManager.java
index 425ce1a0f..07caf2363 100644
--- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ForcefieldManager.java
+++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ForcefieldManager.java
@@ -42,7 +42,7 @@ public class ForcefieldManager extends MiniPlugin
for (Player player : UtilServer.getPlayers())
{
- if (Manager.getPreferences().Get(player).HubForcefield && Manager.GetClients().Get(player).GetRank().Has(Rank.ADMIN))
+ if (Manager.getPreferences().Get(player).HubForcefield && (Manager.GetClients().Get(player).GetRank().Has(Rank.ADMIN) || Manager.GetClients().Get(player).GetRank() == Rank.JNR_DEV))
{
for (Player other : UtilServer.getPlayers())
{
@@ -56,7 +56,7 @@ public class ForcefieldManager extends MiniPlugin
if (UtilMath.offset(other, player) > range)
continue;
- if (Manager.GetClients().Get(other).GetRank().Has(Rank.ADMIN))
+ if (Manager.GetClients().Get(other).GetRank().Has(Rank.ADMIN) || Manager.GetClients().Get(other).GetRank() == Rank.JNR_DEV)
continue;
if (Recharge.Instance.use(other, "Forcefield Bump", 500, false, false))
diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/StackerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/StackerManager.java
index c7b57d2e4..b1bd4551e 100644
--- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/StackerManager.java
+++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/StackerManager.java
@@ -28,6 +28,8 @@ import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.event.StackerEvent;
+import mineplex.core.gadget.gadgets.MorphBlock;
+import mineplex.core.gadget.types.GadgetType;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileManager;
import mineplex.core.projectile.ProjectileUser;
@@ -105,15 +107,33 @@ public class StackerManager extends MiniPlugin implements IThrown
return;
}
+ if (Manager.GetGadget().getActive(stacker, GadgetType.Morph) instanceof MorphBlock)
+ {
+ UtilPlayer.message(stacker, F.main("Stacker", "You cannot stack while using the Block Morph."));
+ return;
+ }
+
+ if (Manager.GetTreasure().isOpening(stacker))
+ return;
+
stackerEvent = new StackerEvent(stackee);
Bukkit.getServer().getPluginManager().callEvent(stackerEvent);
if (stackerEvent.isCancelled())
return;
- if (stackee instanceof Player && !Manager.CanBump(((Player)stackee)))
+ if (stackee instanceof Player)
{
- UtilPlayer.message(stacker, F.main("Stacker", F.name(UtilEnt.getName(stackee)) + " is not playing stacker."));
- return;
+ if (!Manager.CanBump(((Player)stackee)))
+ {
+ UtilPlayer.message(stacker, F.main("Stacker", F.name(UtilEnt.getName(stackee)) + " is not playing stacker."));
+ return;
+ }
+
+ if (Manager.GetTreasure().isOpening((Player) stackee))
+ {
+ UtilPlayer.message(stacker, F.main("Stacker", F.main("Stacker", F.name(UtilEnt.getName(stackee)) + " is opening a chest!")));
+ return;
+ }
}
if (stackee instanceof LivingEntity)
@@ -235,7 +255,8 @@ public class StackerManager extends MiniPlugin implements IThrown
Manager.SetPortalDelay(rider);
rider.leaveVehicle();
- rider.setVelocity(new Vector(0.25 - Math.random()/2, Math.random()/2, 0.25 - Math.random()/2));
+ UtilAction.velocity(rider, new Vector(0.25 - Math.random()/2, Math.random()/2, 0.25 - Math.random()/2),
+ 1, false, 0, 0, 0, false);
rider = rider.getPassenger();
}
diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerInfo.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerInfo.java
index a9dcdccba..235b7c99b 100644
--- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerInfo.java
+++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerInfo.java
@@ -10,4 +10,9 @@ public class ServerInfo
public String ServerType;
public String Game;
public boolean HostedByStaff;
+
+ public int getAvailableSlots()
+ {
+ return MaxPlayers - CurrentPlayers;
+ }
}
\ No newline at end of file
diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java
index bba026899..c4f89da6f 100644
--- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java
+++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java
@@ -10,8 +10,11 @@ import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
+import java.util.Random;
import java.util.Set;
+import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
@@ -56,7 +59,9 @@ import mineplex.hub.queue.QueueManager;
import mineplex.hub.queue.ui.QueueShop;
import mineplex.hub.server.ui.LobbyShop;
import mineplex.hub.server.ui.QuickShop;
+import mineplex.hub.server.ui.ServerCountSorter;
import mineplex.hub.server.ui.ServerNpcShop;
+import mineplex.serverdata.Region;
import mineplex.serverdata.data.MinecraftServer;
import mineplex.serverdata.data.ServerGroup;
@@ -64,7 +69,12 @@ public class ServerManager extends MiniPlugin
{
private static final Long FREE_PORTAL_TIMER = 20000L;
private static final Long BETA_PORTAL_TIMER = 120000L;
+ private static final Random random = new Random();
+ public final int TOP_SERVERS = 3; // The number of top contending servers for auto-joining games
+ public final int MIN_SLOTS_REQUIRED = 12; // The number of slots the max server must have for auto-join
+
+ public final long QUEUE_COOLDOWN = 2000; // Cooldown (in milliseconds) between queueing again for players
private CoreClientManager _clientManager;
private DonationManager _donationManager;
private Portal _portal;
@@ -73,7 +83,8 @@ public class ServerManager extends MiniPlugin
private HubManager _hubManager;
private StackerManager _stackerManager;
private QueueManager _queueManager;
-
+
+ private NautHashMap _queueCooldowns = new NautHashMap();
private NautHashMap> _serverKeyInfoMap = new NautHashMap>();
private NautHashMap _serverKeyTagMap = new NautHashMap();
private NautHashMap _serverPlayerCounts = new NautHashMap();
@@ -108,7 +119,7 @@ public class ServerManager extends MiniPlugin
plugin.getServer().getMessenger().registerOutgoingPluginChannel(plugin, "BungeeCord");
- LoadServers();
+ loadServers();
_quickShop = new QuickShop(this, clientManager, donationManager, "Quick Menu");
_lobbyShop = new LobbyShop(this, clientManager, donationManager, "Lobby Menu");
@@ -278,18 +289,6 @@ public class ServerManager extends MiniPlugin
timeLeft = 0;
}
-// if (party != null)
-// {
-// if (player.getName().equals(party.GetLeader()))
-// {
-// for (Player partyPlayer : party.GetPlayersOnline())
-// {
-// if (!partyPlayer.equals(player))
-// timeLeft = Math.max(timeLeft, getMillisecondsUntilPortal(partyPlayer));
-// }
-// }
-// }
-
return timeLeft;
}
@@ -303,18 +302,18 @@ public class ServerManager extends MiniPlugin
_serverInfoMap.remove(serverName);
}
- public void addServerGroup(String serverKey, String...serverTag)
+ public void addServerGroup(ServerGroup serverGroup)
{
- _serverKeyInfoMap.put(serverKey, new HashSet());
+ _serverKeyInfoMap.put(serverGroup.getName(), new HashSet());
+ _serverKeyTagMap.put(serverGroup.getPrefix(), serverGroup.getName());
- for (String tag : serverTag)
- _serverKeyTagMap.put(tag, serverKey);
+ if (!serverGroup.getServerNpcName().isEmpty())
+ _serverKeyTagMap.put(serverGroup.getServerNpcName(), serverGroup.getName());
}
- public void AddServerNpc(String serverNpcName, String...serverTag)
+ public void AddServerNpc(ServerGroup serverGroup)
{
- addServerGroup(serverNpcName, serverTag);
- _serverNpcShopMap.put(serverNpcName, new ServerNpcShop(this, _clientManager, _donationManager, serverNpcName));
+ _serverNpcShopMap.put(serverGroup.getServerNpcName(), new ServerNpcShop(this, _clientManager, _donationManager, serverGroup));
}
public void RemoveServerNpc(String serverNpcName)
@@ -396,7 +395,6 @@ public class ServerManager extends MiniPlugin
_retrieving = true;
-
_statusManager.retrieveServerGroups(new Callback>()
{
public void run(final Collection serverGroups)
@@ -482,6 +480,8 @@ public class ServerManager extends MiniPlugin
});
}
});
+
+ updateCooldowns();
}
public void Help(Player caller, String message)
@@ -521,6 +521,113 @@ public class ServerManager extends MiniPlugin
_portal.sendPlayerToServer(player, serverInfo.Name);
}
}
+
+ /**
+ * Select a {@code serverType} for a {@code player} that wishes to automatically join the best server
+ * available for that server type.
+ * @param player - the player hoping to select a server
+ * @param serverType - the name of the type of server to be joined
+ */
+ public void selectServer(Player player, String serverType)
+ {
+ if (isOnCooldown(player))
+ {
+ return;
+ }
+
+ ServerInfo bestServer = getBestServer(player, serverType);
+
+ if (bestServer != null)
+ {
+ SelectServer(player, bestServer);
+ addCooldown(player);
+ }
+ }
+
+ private boolean isOnCooldown(Player player)
+ {
+ if (_queueCooldowns.containsKey(player.getName()))
+ {
+ long elapsed = System.currentTimeMillis() - _queueCooldowns.get(player.getName());
+
+ return elapsed < QUEUE_COOLDOWN;
+ }
+
+ return false;
+ }
+
+ private void addCooldown(Player player)
+ {
+ _queueCooldowns.put(player.getName(), System.currentTimeMillis());
+ }
+
+ private void updateCooldowns()
+ {
+ for (String playerName : _queueCooldowns.keySet())
+ {
+ Player player = Bukkit.getPlayer(playerName);
+
+ if (player == null || !isOnCooldown(player))
+ {
+ _queueCooldowns.remove(playerName);
+ }
+ }
+ }
+
+ /**
+ * @param serverType - the type of server that should be fetched
+ * @return the best server that a new player should join according to a {@code serverType} constraint.
+ */
+ public ServerInfo getBestServer(Player player, String serverKey)
+ {
+ if (_serverKeyTagMap.containsKey(serverKey)) // Update key to full-name if a tag pair exists
+ {
+ serverKey = _serverKeyTagMap.get(serverKey);
+ }
+
+ Collection serverList = GetServerList(serverKey);
+ if (serverList == null) return null;
+
+ List servers = new ArrayList(serverList);
+ Collections.sort(servers, new ServerCountSorter());
+ servers = fetchOpenServers(player, servers, servers.size()); // Removes all full servers from list
+
+ int count = Math.min(servers.size(), TOP_SERVERS);
+
+ if (count > 0)
+ {
+ ServerInfo largestServer = servers.get(0);
+
+ if (largestServer.getAvailableSlots() >= MIN_SLOTS_REQUIRED)
+ {
+ return largestServer;
+ }
+ else
+ {
+ return servers.get(random.nextInt(count));
+ }
+ }
+
+ return null;
+ }
+
+ public List fetchOpenServers(Player player, List servers, int count)
+ {
+ List results = new ArrayList();
+ int requiredSlots = (servers.size() > 0) ? GetRequiredSlots(player, servers.get(0).ServerType) : 0;
+
+ for (ServerInfo server : servers)
+ {
+ if (results.size() >= count) break;
+
+ if (server.getAvailableSlots() > requiredSlots)
+ {
+ results.add(server);
+ }
+ }
+
+ return results;
+ }
public void ListServerNpcs(Player caller)
{
@@ -555,7 +662,7 @@ public class ServerManager extends MiniPlugin
}
}
- public void LoadServers()
+ public void loadServers()
{
_serverInfoMap.clear();
_serverUpdate.clear();
@@ -567,83 +674,55 @@ public class ServerManager extends MiniPlugin
_serverKeyTagMap.clear();
- FileInputStream fstream = null;
- BufferedReader br = null;
-
- HashSet npcNames = new HashSet();
+ Region region = getPlugin().getConfig().getBoolean("serverstatus.us") ? Region.US : Region.EU;
try
{
- File npcFile = new File("ServerManager.dat");
-
- if (npcFile.exists())
+ for (ServerGroup serverGroup : mineplex.serverdata.servers.ServerManager.getServerRepository(region).getServerGroups(null))
{
- fstream = new FileInputStream(npcFile);
- br = new BufferedReader(new InputStreamReader(fstream));
+ addServerGroup(serverGroup); // Caches prefix/tag pairing
- String line = br.readLine();
-
- while (line != null)
+ if (!serverGroup.getServerNpcName().isEmpty())
{
- String serverNpcName = line.substring(0, line.indexOf('|')).trim();
- String[] serverTags = line.substring(line.indexOf('|') + 1, line.indexOf('|', line.indexOf('|') + 1)).trim().split(",");
- String[] locations = line.substring(line.indexOf('|', line.indexOf('|') + 1) + 1).trim().split(",");
+ if (!HasServerNpc(serverGroup.getServerNpcName()))
+ {
+ AddServerNpc(serverGroup);
+ }
+ }
- for (String location : locations)
+ if (!serverGroup.getPortalBottomCornerLocation().isEmpty() && !serverGroup.getPortalTopCornerLocation().isEmpty())
+ {
+ Vector bottomVector = ParseVector(serverGroup.getPortalBottomCornerLocation());
+ Vector topVector = ParseVector(serverGroup.getPortalTopCornerLocation());
+ int blocks = 0;
+
+ while (blocks < 10 && (bottomVector.getBlockX() != topVector.getBlockX() || bottomVector.getBlockZ() != topVector.getBlockZ()))
{
- _serverPortalLocations.put(ParseVector(location), serverNpcName);
+ _serverPortalLocations.put(new Vector(bottomVector.getBlockX(), bottomVector.getBlockY(), bottomVector.getBlockZ()), serverGroup.getServerNpcName());
+
+ if (bottomVector.getBlockX() != topVector.getBlockX())
+ {
+ bottomVector.add(new Vector(-(bottomVector.getBlockX() - topVector.getBlockX()) / Math.abs(bottomVector.getBlockX() - topVector.getBlockX()), 0, 0));
+ }
+ else if (bottomVector.getBlockZ() != topVector.getBlockZ())
+ {
+ bottomVector.add(new Vector(0, 0, -(bottomVector.getBlockZ() - topVector.getBlockZ()) / Math.abs(bottomVector.getBlockZ() - topVector.getBlockZ())));
+ }
+
+ blocks++;
}
- if (!HasServerNpc(serverNpcName))
- {
- AddServerNpc(serverNpcName, serverTags);
- }
-
- npcNames.add(serverNpcName);
-
- line = br.readLine();
+ _serverPortalLocations.put(bottomVector, serverGroup.getServerNpcName());
}
}
}
catch (Exception e)
{
- System.out.println("ServerManager - Error parsing servers file : " + e.getMessage());
- }
- finally
- {
- if (br != null)
- {
- try
- {
- br.close();
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
- }
-
- if (fstream != null)
- {
- try
- {
- fstream.close();
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
- }
+ System.out.println("ServerManager - Error parsing servergroups : " + e.getMessage());
}
- for (String npcName : npcNames)
- {
- if (!_serverNpcShopMap.containsKey(npcName))
- _serverNpcShopMap.remove(npcName);
-
- if (!_serverKeyInfoMap.containsKey(npcName))
- _serverKeyInfoMap.remove(npcName);
- }
+// AddServerNpc("Event Servers", "EVENT");
+// AddServerNpc("Mineplex Player Servers", "MPS");
}
public int GetRequiredSlots(Player player, String serverType)
diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/LobbyShop.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/LobbyShop.java
index 8cd3347df..dc7f9477e 100644
--- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/LobbyShop.java
+++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/LobbyShop.java
@@ -14,7 +14,8 @@ public class LobbyShop extends ShopBase
{
super(plugin, clientManager, donationManager, name);
- plugin.addServerGroup("Lobby", "Lobby");
+ // TODO: Why is this needed? Re-add?
+ //plugin.addServerGroup("Lobby", "Lobby");
}
@Override
diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerCountSorter.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerCountSorter.java
new file mode 100644
index 000000000..91065658c
--- /dev/null
+++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerCountSorter.java
@@ -0,0 +1,13 @@
+package mineplex.hub.server.ui;
+
+import java.util.Comparator;
+
+import mineplex.hub.server.ServerInfo;
+
+public class ServerCountSorter implements Comparator
+{
+ public int compare(ServerInfo a, ServerInfo b)
+ {
+ return a.CurrentPlayers - b.CurrentPlayers;
+ }
+}
\ No newline at end of file
diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java
index 47a0e34d0..f63540cbf 100644
--- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java
+++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java
@@ -72,7 +72,7 @@ public class ServerGameMenu extends ShopPageBase
ChatColor.RESET + "Stay away from the borders!",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("HG") + ChatColor.RESET + " other players!",
- }));
+ }));
setItem(4, ItemStackFactory.Instance.CreateStack(Material.FEATHER.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Skywars " + C.cGray + "Solo Survival", new String[]
{
diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java
index b44045870..298752e55 100644
--- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java
+++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java
@@ -17,6 +17,7 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilTime;
import mineplex.core.donation.DonationManager;
import mineplex.core.game.GameDisplay;
+import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.shop.item.IButton;
import mineplex.core.shop.item.ShopItem;
import mineplex.core.shop.page.ShopPageBase;
@@ -41,7 +42,7 @@ public class ServerNpcPage extends ShopPageBase im
public ServerNpcPage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player, String serverNpcKey)
{
- super(plugin, shop, clientManager, donationManager, name, player, 54);
+ super(plugin, shop, clientManager, donationManager, name, player, 27);
_serverNpcKey = serverNpcKey;
@@ -51,6 +52,21 @@ public class ServerNpcPage extends ShopPageBase im
@Override
protected void buildPage()
{
+ setItem(12, ItemStackFactory.Instance.CreateStack(Material.SKULL.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Play Solo " + C.cGray + getName(), new String[]
+ {
+ ChatColor.RESET + "Solo Mode",
+ ChatColor.RESET + "",
+ ChatColor.RESET + "Click to play!",
+ ChatColor.RESET + "",
+ ChatColor.RESET + "Teaming in Solo Mode is bannable!",
+ }));
+
+ setItem(14, ItemStackFactory.Instance.CreateStack(Material.SKULL.getId(), (byte)0, 2, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Play Team " + C.cGray + getName(), new String[]
+ {
+ ChatColor.RESET + "Team Mode",
+ ChatColor.RESET + "",
+ ChatColor.RESET + "Click to play!"
+ }));
List serverList = new ArrayList(getPlugin().GetServerList(_serverNpcKey));
int slotsNeeded = 1;
@@ -401,7 +417,7 @@ public class ServerNpcPage extends ShopPageBase im
{
int slots = getPlugin().GetRequiredSlots(player, serverInfo.ServerType);
- if (serverInfo.MaxPlayers - serverInfo.CurrentPlayers < slots && !(getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(serverInfo.ServerType + " ULTRA") || getClient().GetRank().Has(Rank.ULTRA)))
+ if (serverInfo.getAvailableSlots() < slots && !(getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(serverInfo.ServerType + " ULTRA") || getClient().GetRank().Has(Rank.ULTRA)))
{
playDenySound(player);
return;
diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcShop.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcShop.java
index 0c4af2d90..ba4f5bf4a 100644
--- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcShop.java
+++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcShop.java
@@ -11,18 +11,23 @@ import mineplex.core.party.Party;
import mineplex.core.shop.ShopBase;
import mineplex.core.shop.page.ShopPageBase;
import mineplex.hub.server.ServerManager;
+import mineplex.serverdata.data.ServerGroup;
public class ServerNpcShop extends ShopBase
{
- public ServerNpcShop(ServerManager plugin, CoreClientManager clientManager, DonationManager donationManager, String name)
+ private ServerGroup _serverGroup;
+
+ public ServerNpcShop(ServerManager plugin, CoreClientManager clientManager, DonationManager donationManager, ServerGroup serverGroup)
{
- super(plugin, clientManager, donationManager, name);
+ super(plugin, clientManager, donationManager, serverGroup.getServerNpcName());
+
+ _serverGroup = serverGroup;
}
@Override
protected ShopPageBase> buildPagesFor(Player player)
{
- return new ServerNpcPage(getPlugin(), this, getClientManager(), getDonationManager(), getName(), player, getName());
+ return new ServerTypePage(getPlugin(), this, getClientManager(), getDonationManager(), player, _serverGroup);
}
@Override
@@ -65,4 +70,16 @@ public class ServerNpcShop extends ShopBase
{
getPlugin().getHubManager().GetVisibility().removeHiddenPlayer(player);
}
+
+ @Override
+ public boolean attemptShopOpen(Player player)
+ {
+ if (_serverGroup.getTeamServerKey().isEmpty()) // Has no team server key, so auto-join
+ {
+ getPlugin().selectServer(player, getName());
+ return false;
+ }
+
+ return super.attemptShopOpen(player);
+ }
}
diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerTypePage.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerTypePage.java
new file mode 100644
index 000000000..2b9b4c378
--- /dev/null
+++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerTypePage.java
@@ -0,0 +1,89 @@
+package mineplex.hub.server.ui;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.bukkit.ChatColor;
+import org.bukkit.Material;
+import org.bukkit.entity.Player;
+import org.bukkit.event.inventory.ClickType;
+import org.bukkit.inventory.meta.SkullMeta;
+
+import mineplex.core.account.CoreClientManager;
+import mineplex.core.achievement.AchievementCategory;
+import mineplex.core.common.Rank;
+import mineplex.core.common.util.C;
+import mineplex.core.common.util.UtilTime;
+import mineplex.core.donation.DonationManager;
+import mineplex.core.game.GameDisplay;
+import mineplex.core.itemstack.ItemStackFactory;
+import mineplex.core.shop.item.IButton;
+import mineplex.core.shop.item.ShopItem;
+import mineplex.core.shop.page.ShopPageBase;
+import mineplex.hub.server.ServerInfo;
+import mineplex.hub.server.ServerManager;
+import mineplex.hub.server.ServerSorter;
+import mineplex.hub.server.ui.button.JoinServerButton;
+import mineplex.hub.server.ui.button.SelectBRButton;
+import mineplex.hub.server.ui.button.SelectTypeButton;
+import mineplex.serverdata.data.ServerGroup;
+
+public class ServerTypePage extends ShopPageBase
+{
+
+ private ServerGroup _serverGroup;
+
+ public ServerTypePage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager, DonationManager donationManager,
+ Player player, ServerGroup serverGroup)
+ {
+ super(plugin, shop, clientManager, donationManager, serverGroup.getName(), player, 27);
+
+ _serverGroup = serverGroup;
+
+ buildPage();
+ }
+
+ @Override
+ protected void buildPage()
+ {
+ String name = _serverGroup.getName();
+
+ setItem(12, ItemStackFactory.Instance.CreateStack(Material.STICK.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Play Solo " + C.cGray + name, new String[]
+ {
+ ChatColor.RESET + "Solo Mode",
+ ChatColor.RESET + "",
+ ChatColor.RESET + "Click to play!",
+ ChatColor.RESET + "",
+ ChatColor.RESET + "Teaming in Solo Mode is bannable!",
+ }));
+
+ setItem(14, ItemStackFactory.Instance.CreateStack(Material.STICK.getId(), (byte)0, 2, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Play Team " + C.cGray + name, new String[]
+ {
+ ChatColor.RESET + "Team Mode",
+ ChatColor.RESET + "",
+ ChatColor.RESET + "Click to play!"
+ }));
+
+ getButtonMap().put(12, new SelectTypeButton(this, false));
+ getButtonMap().put(14, new SelectTypeButton(this, true));
+ }
+
+ public void Update()
+ {
+ getButtonMap().clear();
+ buildPage();
+ }
+
+ public void selectServer(Player player, boolean team)
+ {
+ if (team)
+ {
+ getPlugin().selectServer(player, _serverGroup.getTeamServerKey()); // TODO: Grab the team-key instead of regular game key
+ }
+ else
+ {
+ getPlugin().selectServer(player, _serverGroup.getPrefix());
+ }
+ }
+}
diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectTypeButton.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectTypeButton.java
new file mode 100644
index 000000000..847cb3933
--- /dev/null
+++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectTypeButton.java
@@ -0,0 +1,28 @@
+package mineplex.hub.server.ui.button;
+
+import org.bukkit.entity.Player;
+import org.bukkit.event.inventory.ClickType;
+
+import mineplex.core.shop.item.IButton;
+import mineplex.hub.server.ServerInfo;
+import mineplex.hub.server.ServerManager;
+import mineplex.hub.server.ui.IServerPage;
+import mineplex.hub.server.ui.ServerTypePage;
+
+public class SelectTypeButton implements IButton
+{
+ private ServerTypePage _page;
+ private boolean _teamBased;
+
+ public SelectTypeButton(ServerTypePage page, boolean teamBased)
+ {
+ _page = page;
+ _teamBased = teamBased;
+ }
+
+ @Override
+ public void onClick(Player player, ClickType clickType)
+ {
+ _page.selectServer(player, _teamBased);
+ }
+}
diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Class/ClientClass.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Class/ClientClass.java
index ae8816f3a..e892c5f75 100644
--- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Class/ClientClass.java
+++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Class/ClientClass.java
@@ -341,7 +341,7 @@ public class ClientClass
if (notify)
{
ListSkills(_client.GetPlayer());
- _client.GetPlayer().getWorld().playSound(_client.GetPlayer().getLocation(), Sound.LEVEL_UP, 1f, 1f);
+ _client.GetPlayer().playSound(_client.GetPlayer().getLocation(), Sound.LEVEL_UP, 1f, 1f);
_client.GetPlayer().sendMessage(F.main("Class", "You equipped " + F.skill(customBuild.Name) + "."));
}
diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Blizzard.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Blizzard.java
index 5616119ee..9075c6d31 100644
--- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Blizzard.java
+++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Blizzard.java
@@ -26,6 +26,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import mineplex.core.common.util.F;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
+import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
@@ -209,7 +210,8 @@ public class Blizzard extends SkillActive
if (damagee == null) return;
event.SetCancelled(GetName());
- damagee.setVelocity(proj.getVelocity().multiply(0.1).add(new Vector(0, 0.15, 0)));
+ UtilAction.velocity(damagee, proj.getVelocity().multiply(0.1).add(new Vector(0, 0.15, 0)),
+ 1, false, 0, 0, 0, false);
}
@EventHandler
diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java
index aab72ed1e..ec5e4113c 100644
--- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java
+++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java
@@ -41,6 +41,7 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
+import org.bukkit.event.player.PlayerVelocityEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;
@@ -251,34 +252,34 @@ public class DamageManager extends MiniPlugin
{
if (stack == null)
continue;
-
+
Map enchants = stack.getEnchantments();
for (Enchantment e : enchants.keySet())
{
if (e.equals(Enchantment.PROTECTION_ENVIRONMENTAL))
event.AddMod("Ench Prot", damagee.getName(), 0.5 * (double)enchants.get(e), false);
-
+
else if (e.equals(Enchantment.PROTECTION_FIRE) &&
event.GetCause() == DamageCause.FIRE &&
event.GetCause() == DamageCause.FIRE_TICK &&
event.GetCause() == DamageCause.LAVA)
event.AddMod("Ench Prot", damagee.getName(), 0.5 * (double)enchants.get(e), false);
-
+
else if (e.equals(Enchantment.PROTECTION_FALL) &&
event.GetCause() == DamageCause.FALL)
event.AddMod("Ench Prot", damagee.getName(), 0.5 * (double)enchants.get(e), false);
-
+
else if (e.equals(Enchantment.PROTECTION_EXPLOSIONS) &&
event.GetCause() == DamageCause.ENTITY_EXPLOSION)
event.AddMod("Ench Prot", damagee.getName(), 0.5 * (double)enchants.get(e), false);
-
+
else if (e.equals(Enchantment.PROTECTION_PROJECTILE) &&
event.GetCause() == DamageCause.PROJECTILE)
event.AddMod("Ench Prot", damagee.getName(), 0.5 * (double)enchants.get(e), false);
}
}
}
-
+
//Offensive
Player damager = event.GetDamagerPlayer(true);
if (damager != null)
@@ -390,11 +391,22 @@ public class DamageManager extends MiniPlugin
trajectory.multiply(0.6 * knockback);
trajectory.setY(Math.abs(trajectory.getY()));
- //Apply
- UtilAction.velocity(event.GetDamageeEntity(),
- trajectory, 0.2 + trajectory.length() * 0.8, false, 0, Math.abs(0.2 * knockback), 0.4 + (0.04 * knockback), true);
- }
+ //Debug
+ if (event.GetDamageeEntity() instanceof Player && UtilGear.isMat(((Player)event.GetDamageeEntity()).getItemInHand(), Material.SUGAR))
+ {
+ Bukkit.broadcastMessage("--------- " +
+ UtilEnt.getName(event.GetDamageeEntity()) + " hit by " + UtilEnt.getName(event.GetDamagerEntity(true)) + "-----------" );
+
+ Bukkit.broadcastMessage(F.main("Debug", "Damage: " + event.GetDamage()));
+ }
+
+ //Apply
+ double vel = 0.2 + trajectory.length() * 0.8;
+
+ UtilAction.velocity(event.GetDamageeEntity(), trajectory, vel,
+ false, 0, Math.abs(0.2 * knockback), 0.4 + (0.04 * knockback), true);
+ }
}
catch (IllegalAccessException e)
{
@@ -414,7 +426,7 @@ public class DamageManager extends MiniPlugin
{
for (Player player : UtilServer.getPlayers())
{
- if (!UtilGear.isMat(player.getItemInHand(), Material.BOOK))
+ if (!UtilGear.isMat(player.getItemInHand(), Material.COMMAND))
continue;
UtilPlayer.message(player, " ");
diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/mechanics/PistonJump.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/mechanics/PistonJump.java
index 1a23e9669..72080881d 100644
--- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/mechanics/PistonJump.java
+++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/mechanics/PistonJump.java
@@ -6,6 +6,7 @@ import java.util.HashSet;
import mineplex.core.MiniPlugin;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
+import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilTime;
import org.bukkit.Material;
@@ -54,8 +55,7 @@ public class PistonJump extends MiniPlugin
//Vector
Vector vec = new Vector(0,1.2,0);
- player.setVelocity(vec);
- player.setFallDistance(0);
+ UtilAction.velocity(player, vec);
}
final Block block = below;
diff --git a/Plugins/Mineplex.ServerData/src/mineplex/serverdata/Utility.java b/Plugins/Mineplex.ServerData/src/mineplex/serverdata/Utility.java
index 790a2efa3..b71a39583 100644
--- a/Plugins/Mineplex.ServerData/src/mineplex/serverdata/Utility.java
+++ b/Plugins/Mineplex.ServerData/src/mineplex/serverdata/Utility.java
@@ -1,5 +1,7 @@
package mineplex.serverdata;
+import java.util.concurrent.ConcurrentHashMap;
+
import mineplex.serverdata.servers.ConnectionData;
import mineplex.serverdata.servers.ServerManager;
import redis.clients.jedis.Jedis;
@@ -15,17 +17,20 @@ import com.google.gson.GsonBuilder;
* @author Ty
*
*/
-public class Utility
+public class Utility
{
// The Gson instance used to serialize/deserialize objects in JSON form.
private static Gson _gson = new GsonBuilder().create();
public static Gson getGson() { return _gson; }
-
+
+ // map of all instantiated connection pools, distinguished by their ip:port combination
+ private static final ConcurrentHashMap _pools = new ConcurrentHashMap();
+
// Public static jedis pool for interacting with central default jedis repo.
private static JedisPool _masterPool;
private static JedisPool _slavePool;
-
+
/**
* @param object - the (non-null) object to serialize
* @return the serialized form of {@code object}.
@@ -34,7 +39,7 @@ public class Utility
{
return _gson.toJson(object);
}
-
+
/**
* @param serializedData - the serialized data to be deserialized
* @param type - the resulting class type of the object to be deserialized
@@ -44,7 +49,7 @@ public class Utility
{
return _gson.fromJson(serializedData, type);
}
-
+
/**
* @param delimiter - the delimiter character used to separate the concatenated elements
* @param elements - the set of string elements to be concatenated and returned.
@@ -54,15 +59,15 @@ public class Utility
{
int length = elements.length;
String result = length > 0 ? elements[0] : new String();
-
+
for (int i = 1; i < length; i++)
{
result += delimiter + elements[i];
}
-
+
return result;
}
-
+
/**
* @return the current timestamp (in seconds) fetched from the central jedis repository
* for synced timestamps.
@@ -72,7 +77,7 @@ public class Utility
long currentTime = 0;
JedisPool pool = getPool(false);
Jedis jedis = pool.getResource();
-
+
try
{
currentTime = Long.parseLong(jedis.time().get(0));
@@ -90,10 +95,10 @@ public class Utility
pool.returnResource(jedis);
}
}
-
+
return currentTime;
}
-
+
/**
* @return the current timestamp (in milliseconds) fetched from the central jedis repository
* for synced timestamps.
@@ -121,23 +126,35 @@ public class Utility
pool.returnResource(jedis);
}
}
-
+
return currentTime * 1000;
}
-
+
/**
* @param connData - the connection data specifying the database to be connected to.
* @return a newly instantiated {@link JedisPool} connected to the provided {@link ConnectionData} repository.
*/
public static JedisPool generatePool(ConnectionData connData)
{
- JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
- jedisPoolConfig.setMaxWaitMillis(1000);
- jedisPoolConfig.setMinIdle(5);
- jedisPoolConfig.setTestOnBorrow(true);
- return new JedisPool(jedisPoolConfig, connData.getHost(), connData.getPort());
+ String key = getConnKey(connData);
+ JedisPool pool = _pools.get(key);
+ if (pool == null)
+ {
+ JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
+ jedisPoolConfig.setMaxWaitMillis(1000);
+ jedisPoolConfig.setMinIdle(5);
+ jedisPoolConfig.setTestOnBorrow(true);
+
+ jedisPoolConfig.setMaxTotal(20);
+ jedisPoolConfig.setBlockWhenExhausted(true);
+
+ pool = new JedisPool(jedisPoolConfig, connData.getHost(), connData.getPort());
+ _pools.put(key, pool);
+ }
+
+ return pool;
}
-
+
/**
* @param writeable - whether or not the Jedis connections returned should be writeable to.
* @return a globally available {@link JedisPool}
@@ -150,7 +167,7 @@ public class Utility
{
_masterPool = generatePool(ServerManager.getMasterConnection());
}
-
+
return _masterPool;
}
else
@@ -158,11 +175,17 @@ public class Utility
if (_slavePool == null)
{
ConnectionData slave = ServerManager.getSlaveConnection();
-
+
_slavePool = generatePool(slave);
}
-
+
return _slavePool;
}
}
+
+ private static String getConnKey(ConnectionData connData)
+ {
+ return connData.getHost() + ":" + connData.getPort();
+ }
+
}
diff --git a/Plugins/Mineplex.ServerData/src/mineplex/serverdata/data/ServerGroup.java b/Plugins/Mineplex.ServerData/src/mineplex/serverdata/data/ServerGroup.java
index 40d36f875..02628419d 100644
--- a/Plugins/Mineplex.ServerData/src/mineplex/serverdata/data/ServerGroup.java
+++ b/Plugins/Mineplex.ServerData/src/mineplex/serverdata/data/ServerGroup.java
@@ -57,6 +57,12 @@ public class ServerGroup
private boolean _staffOnly;
private String _resourcePack = "";
+ private String _npcName = "";
+ private String _portalBottomCornerLocation = "";
+ private String _portalTopCornerLocation = "";
+
+ private String _teamServerKey = "";
+
private Region _region;
private Set _servers;
@@ -101,6 +107,10 @@ public class ServerGroup
_resourcePack = data.containsKey("resourcePack") ? data.get("resourcePack") : "";
_host = data.get("host");
_region = data.containsKey("region") ? Region.valueOf(data.get("region")) : Region.ALL;
+ _teamServerKey = data.containsKey("teamServerKey") ? data.get("teamServerKey") : "";
+ _portalBottomCornerLocation = data.containsKey("portalBottomCornerLocation") ? data.get("portalBottomCornerLocation") : "";
+ _portalTopCornerLocation = data.containsKey("portalTopCornerLocation") ? data.get("portalTopCornerLocation") : "";
+ _npcName = data.containsKey("npcName") ? data.get("npcName") : "";
if (serverStatuses != null)
parseServers(serverStatuses);
@@ -109,7 +119,8 @@ public class ServerGroup
public ServerGroup(String name, String prefix, String host, int ram, int cpu, int totalServers, int joinable, int portSection, boolean arcade, String worldZip, String plugin, String configPath
, int minPlayers, int maxPlayers, boolean pvp, boolean tournament, boolean tournamentPoints, String games, String serverType, boolean noCheat, boolean worldEdit, boolean teamRejoin
, boolean teamAutoJoin, boolean teamForceBalance, boolean gameAutoStart, boolean gameTimeout, boolean rewardGems, boolean rewardItems, boolean rewardStats
- , boolean rewardAchievements, boolean hotbarInventory, boolean hotbarHubClock, boolean playerKickIdle, boolean staffOnly, boolean whitelist, String resourcePack, Region region)
+ , boolean rewardAchievements, boolean hotbarInventory, boolean hotbarHubClock, boolean playerKickIdle, boolean staffOnly, boolean whitelist, String resourcePack, Region region
+ , String teamServerKey, String portalBottomCornerLocation, String portalTopCornerLocation, String npcName)
{
_name = name;
_prefix = prefix;
@@ -148,6 +159,10 @@ public class ServerGroup
_whitelist = whitelist;
_resourcePack = resourcePack;
_region = region;
+ _teamServerKey = teamServerKey;
+ _portalBottomCornerLocation = portalBottomCornerLocation;
+ _portalTopCornerLocation = portalTopCornerLocation;
+ _npcName = npcName;
}
public String getName() { return _name; }
@@ -196,6 +211,12 @@ public class ServerGroup
public String getResourcePack() { return _resourcePack; }
public Region getRegion() { return _region; }
+ public String getTeamServerKey() { return _teamServerKey; }
+
+ public String getServerNpcName() { return _npcName; }
+ public String getPortalBottomCornerLocation() { return _portalBottomCornerLocation; }
+ public String getPortalTopCornerLocation() { return _portalTopCornerLocation; }
+
public Set getServers() { return _servers; }
public int getServerCount()
@@ -350,6 +371,10 @@ public class ServerGroup
_dataMap.put("resourcePack", _resourcePack);
_dataMap.put("host", _host);
_dataMap.put("region", _region.name());
+ _dataMap.put("teamServerKey", _teamServerKey);
+ _dataMap.put("portalBottomCornerLocation", _portalBottomCornerLocation);
+ _dataMap.put("portalTopCornerLocation", _portalTopCornerLocation);
+ _dataMap.put("npcName", _npcName);
}
return _dataMap;
diff --git a/Plugins/Mineplex.ServerData/src/mineplex/serverdata/servers/ServerManager.java b/Plugins/Mineplex.ServerData/src/mineplex/serverdata/servers/ServerManager.java
index 1c173ae09..fbf5d563b 100644
--- a/Plugins/Mineplex.ServerData/src/mineplex/serverdata/servers/ServerManager.java
+++ b/Plugins/Mineplex.ServerData/src/mineplex/serverdata/servers/ServerManager.java
@@ -28,7 +28,7 @@ public class ServerManager
// The cached repository instances
private static Map repositories = new HashMap();
-
+
/**
* @param host - the host url used to connect to the database
* @param port - the port to connect to the repository
diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java
index b61c92d36..772f894ed 100644
--- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java
+++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java
@@ -48,6 +48,7 @@ import mineplex.core.status.ServerStatusManager;
import mineplex.core.teleport.Teleport;
import mineplex.core.updater.FileUpdater;
import mineplex.core.updater.Updater;
+import mineplex.core.velocity.VelocityFix;
import mineplex.core.visibility.VisibilityManager;
import mineplex.minecraft.game.core.combat.CombatManager;
import mineplex.minecraft.game.core.damage.DamageManager;
@@ -86,10 +87,14 @@ public class Arcade extends JavaPlugin
_clientManager = new CoreClientManager(this, webServerAddress);
CommandCenter.Instance.setClientManager(_clientManager);
+
ItemStackFactory.Initialize(this, false);
Recharge.Initialize(this);
VisibilityManager.Initialize(this);
Give.Initialize(this);
+
+ //Velocity Fix
+ new VelocityFix(this);
_donationManager = new DonationManager(this, _clientManager, webServerAddress);
diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java
index c53348209..ac0fddf41 100644
--- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java
+++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java
@@ -1,5 +1,6 @@
package nautilus.game.arcade;
+import java.awt.Event;
import java.io.File;
import java.util.ArrayList;
import java.util.HashSet;
@@ -48,6 +49,7 @@ import mineplex.core.common.jsonchat.JsonMessage;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap;
+import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilPlayer;
@@ -110,6 +112,7 @@ import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.GameServerConfig;
import nautilus.game.arcade.game.GameTeam;
+import nautilus.game.arcade.game.games.event.EventModule;
import nautilus.game.arcade.game.games.uhc.UHC;
import nautilus.game.arcade.managers.GameAchievementManager;
import nautilus.game.arcade.managers.GameChatManager;
@@ -143,6 +146,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
private Creature _creature;
private DamageManager _damageManager;
private Explosion _explosionManager;
+ private EventModule _eventManager;
private Fire _fire;
private ProjectileManager _projectileManager;
@@ -257,6 +261,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
_cosmeticManager = cosmeticManager;
_portal = portal;
_petManager = petManager;
+ _eventManager = new EventModule(this, getPlugin());
// Shop
_arcadeShop = new ArcadeShop(this, clientManager, donationManager);
@@ -562,6 +567,11 @@ public class ArcadeManager extends MiniPlugin implements IRelation
return _gameWorldManager;
}
+ public EventModule GetEventModule()
+ {
+ return _eventManager;
+ }
+
public PreferencesManager getPreferences()
{
return _preferencesManager;
@@ -653,7 +663,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
return;
}
- if (!GetServerConfig().PublicServer)
+ if (!GetServerConfig().PublicServer || GetServerConfig().PlayerServerWhitelist)
{
event.setMotd(ChatColor.GRAY + "Private");
return;
@@ -818,6 +828,11 @@ public class ArcadeManager extends MiniPlugin implements IRelation
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, C.Bold + "Server has reached max capacity for gameplay purposes.");
return;
}
+ else if (_gameHostManager.isEventServer() && Bukkit.getServer().getOnlinePlayers().size() >= 128)
+ {
+ event.disallow(PlayerLoginEvent.Result.KICK_OTHER, C.Bold + "Server has reached max capacity for gameplay purposes.");
+ return;
+ }
event.allow();
event.setResult(PlayerLoginEvent.Result.ALLOWED);
@@ -829,6 +844,18 @@ public class ArcadeManager extends MiniPlugin implements IRelation
}
}
+ @EventHandler(priority = EventPriority.LOW)
+ public void AdminOP(PlayerJoinEvent event)
+ {
+ // Give developers operator on their servers
+ boolean testServer = _plugin.getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
+
+ if (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.OWNER) || (testServer && (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.DEVELOPER) || _clientManager.Get(event.getPlayer()).GetRank() == Rank.JNR_DEV)))
+ event.getPlayer().setOp(true);
+ else
+ event.getPlayer().setOp(false);
+ }
+
public boolean IsAlive(Player player)
{
if (_game == null)
@@ -1307,7 +1334,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
player.teleport(GetGame().GetSpectatorLocation());
//Set Spec State
- player.setVelocity(new Vector(0,1,0));
+ UtilAction.velocity(player, new Vector(0,1,0));
player.setAllowFlight(true);
player.setFlying(true);
player.setFlySpeed(0.1f);
diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java
index b2b8e3d40..65ee7948a 100644
--- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java
+++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java
@@ -38,10 +38,11 @@ import nautilus.game.arcade.game.games.quiver.QuiverTeams;
import nautilus.game.arcade.game.games.runner.Runner;
import nautilus.game.arcade.game.games.searchanddestroy.SearchAndDestroy;
import nautilus.game.arcade.game.games.sheep.SheepGame;
-import nautilus.game.arcade.game.games.skywars.Skywars;
-import nautilus.game.arcade.game.games.smash.SuperSmash;
+import nautilus.game.arcade.game.games.skywars.SoloSkywars;
+import nautilus.game.arcade.game.games.skywars.TeamSkywars;
+import nautilus.game.arcade.game.games.smash.SoloSuperSmash;
import nautilus.game.arcade.game.games.smash.SuperSmashDominate;
-import nautilus.game.arcade.game.games.smash.SuperSmashTeam;
+import nautilus.game.arcade.game.games.smash.TeamSuperSmash;
import nautilus.game.arcade.game.games.snake.Snake;
import nautilus.game.arcade.game.games.sneakyassassins.SneakyAssassins;
import nautilus.game.arcade.game.games.snowfight.SnowFight;
@@ -49,8 +50,8 @@ import nautilus.game.arcade.game.games.spleef.Spleef;
import nautilus.game.arcade.game.games.spleef.SpleefTeams;
import nautilus.game.arcade.game.games.squidshooter.SquidShooter;
import nautilus.game.arcade.game.games.stacker.Stacker;
-import nautilus.game.arcade.game.games.survivalgames.SurvivalGames;
-import nautilus.game.arcade.game.games.survivalgames.SurvivalGamesTeams;
+import nautilus.game.arcade.game.games.survivalgames.SoloSurvivalGames;
+import nautilus.game.arcade.game.games.survivalgames.TeamSurvivalGames;
import nautilus.game.arcade.game.games.tug.Tug;
import nautilus.game.arcade.game.games.turfforts.TurfForts;
import nautilus.game.arcade.game.games.uhc.UHC;
@@ -70,7 +71,7 @@ public enum GameType
ChampionsDominate(ChampionsDominate.class, GameDisplay.ChampionsDominate),
//ChampionsMOBA(ChampionsMOBA.class, "Champions MOBA", "Champions", Material.SKULL_ITEM, (byte)0, GameCategory.CHAMPIONS, 7),
ChampionsTDM(ChampionsTDM.class, GameDisplay.ChampionsTDM),
- Christmas(Christmas.class, GameDisplay.Christmas),
+ Christmas(Christmas.class, GameDisplay.Christmas, "http://chivebox.com/file/c/xmas.zip", true),
DeathTag(DeathTag.class, GameDisplay.DeathTag),
DragonEscape(DragonEscape.class, GameDisplay.DragonEscape),
DragonEscapeTeams(DragonEscapeTeams.class, GameDisplay.DragonEscapeTeams),
@@ -81,7 +82,7 @@ public enum GameType
Evolution(Evolution.class, GameDisplay.Evolution),
//FlappyBird(FlappyBird.class, "Flappy Bird", Material.FEATHER, (byte)0, GameCategory.ARCADE, 17),
Gravity(Gravity.class, GameDisplay.Gravity),
- Halloween(Halloween.class, GameDisplay.Halloween),
+ Halloween(Halloween.class, GameDisplay.Halloween, "http://chivebox.com/file/c/hh.zip", true),
HideSeek(HideSeek.class, GameDisplay.HideSeek),
HoleInTheWall(HoleInTheWall.class, GameDisplay.HoleInTheWall),
Horse(Horse.class, GameDisplay.Horse),
@@ -98,9 +99,9 @@ public enum GameType
SearchAndDestroy(SearchAndDestroy.class, GameDisplay.SearchAndDestroy),
Sheep(SheepGame.class, GameDisplay.Sheep),
- Smash(SuperSmash.class, GameDisplay.Smash),
+ Smash(SoloSuperSmash.class, GameDisplay.Smash),
SmashDomination(SuperSmashDominate.class, GameDisplay.SmashDomination),
- SmashTeams(SuperSmashTeam.class, GameDisplay.SmashTeams),
+ SmashTeams(TeamSuperSmash.class, GameDisplay.SmashTeams, new GameType[]{GameType.Smash}, false),
Snake(Snake.class, GameDisplay.Snake),
SneakyAssassins(SneakyAssassins.class, GameDisplay.SneakyAssassins),
SnowFight(SnowFight.class, GameDisplay.SnowFight),
@@ -108,23 +109,35 @@ public enum GameType
SpleefTeams(SpleefTeams.class, GameDisplay.SpleefTeams),
SquidShooter(SquidShooter.class, GameDisplay.SquidShooter),
Stacker(Stacker.class, GameDisplay.Stacker),
- SurvivalGames(SurvivalGames.class, GameDisplay.SurvivalGames),
- SurvivalGamesTeams(SurvivalGamesTeams.class, GameDisplay.SurvivalGamesTeams),
+ SurvivalGames(SoloSurvivalGames.class, GameDisplay.SurvivalGames),
+ SurvivalGamesTeams(TeamSurvivalGames.class, GameDisplay.SurvivalGamesTeams, new GameType[]{GameType.SurvivalGames}, false),
Tug(Tug.class, GameDisplay.Tug),
TurfWars(TurfForts.class, GameDisplay.TurfWars),
UHC(UHC.class, GameDisplay.UHC),
WitherAssault(WitherGame.class, GameDisplay.WitherAssault),
Wizards(Wizards.class, GameDisplay.Wizards, "http://chivebox.com/file/c/ResWizards.zip", true),
ZombieSurvival(ZombieSurvival.class, GameDisplay.ZombieSurvival),
-
Build(Build.class, GameDisplay.Build),
Cards(Cards.class, GameDisplay.Cards),
- Skywars(Skywars.class, GameDisplay.Skywars),
+ Skywars(SoloSkywars.class, GameDisplay.Skywars),
+ SkywarsTeams(TeamSkywars.class, GameDisplay.SkywarsTeams, new GameType[]{GameType.Skywars}, false),
- Event(EventGame.class, GameDisplay.Event);
+ Event(EventGame.class, GameDisplay.Event, new GameType[]{
+ GameType.BaconBrawl, GameType.Barbarians, GameType.Bridge, GameType.Build, GameType.Build,
+ GameType.Cards, GameType.CastleSiege, GameType.ChampionsDominate, GameType.ChampionsTDM, GameType.Christmas,
+ GameType.DeathTag, GameType.DragonEscape, GameType.DragonEscapeTeams, GameType.DragonRiders, GameType.Dragons,
+ GameType.Draw, GameType.Evolution, GameType.Gravity, GameType.Halloween, GameType.HideSeek,
+ GameType.HoleInTheWall, GameType.Horse, GameType.Micro, GameType.MilkCow, GameType.MineStrike, GameType.MineWare,
+ GameType.OldMineWare, GameType.Paintball, GameType.Quiver, GameType.QuiverTeams, GameType.Runner, GameType.SearchAndDestroy,
+ GameType.Sheep, GameType.Skywars, GameType.SkywarsTeams, GameType.Smash, GameType.SmashDomination, GameType.SmashTeams,
+ GameType.Snake, GameType.SneakyAssassins, GameType.SnowFight, GameType.Spleef, GameType.SpleefTeams, GameType.SquidShooter,
+ GameType.Stacker, GameType.SurvivalGames, GameType.SurvivalGamesTeams, GameType.Tug, GameType.TurfWars, GameType.UHC,
+ GameType.WitherAssault, GameType.Wizards, GameType.ZombieSurvival}, true);
GameDisplay _display;
boolean _enforceResourcePack;
+ GameType[] _mapSource;
+ boolean _ownMaps;
String _resourcePack;
Class extends Game> _gameClass;
@@ -133,17 +146,29 @@ public enum GameType
GameType(Class extends Game> gameClass, GameDisplay display)
{
- this(gameClass, display, null, false);
+ this(gameClass, display, null, false, null, true);
}
GameType(Class extends Game> gameClass, GameDisplay display, String resourcePackUrl, boolean enforceResourcePack)
+ {
+ this(gameClass, display, resourcePackUrl, enforceResourcePack, null, true);
+ }
+
+ GameType(Class extends Game> gameClass, GameDisplay display, GameType[] mapSource, boolean ownMap)
+ {
+ this(gameClass, display, null, false, mapSource, ownMap);
+ }
+
+ GameType(Class extends Game> gameClass, GameDisplay display, String resourcePackUrl, boolean enforceResourcePack, GameType[] mapSource, boolean ownMaps)
{
_display = display;
_gameClass = gameClass;
_resourcePack = resourcePackUrl;
_enforceResourcePack = enforceResourcePack;
+ _mapSource = mapSource;
+ _ownMaps = ownMaps;
}
-
+
public Class extends Game> getGameClass()
{
return _gameClass;
@@ -158,6 +183,16 @@ public enum GameType
{
return _resourcePack;
}
+
+ public GameType[] getMapSource()
+ {
+ return _mapSource;
+ }
+
+ public boolean ownMaps()
+ {
+ return _ownMaps;
+ }
public String GetName()
{
@@ -183,4 +218,5 @@ public enum GameType
{
return _display.getGameCategory();
}
+
}
\ No newline at end of file
diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/DisguiseCommand.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/DisguiseCommand.java
index 8e1e5dc51..f45344d2a 100644
--- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/DisguiseCommand.java
+++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/DisguiseCommand.java
@@ -3,9 +3,8 @@ package nautilus.game.arcade.command;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
-
-import nautilus.game.arcade.ArcadeManager;
import net.minecraft.util.com.mojang.authlib.GameProfile;
+
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
@@ -13,12 +12,13 @@ import mineplex.core.common.util.ProfileLoader;
import mineplex.core.common.util.UUIDFetcher;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.disguise.disguises.DisguisePlayer;
+import nautilus.game.arcade.ArcadeManager;
public class DisguiseCommand extends CommandBase
{
public DisguiseCommand(ArcadeManager plugin)
{
- super(plugin, Rank.ADMIN, new Rank[] {Rank.YOUTUBE, Rank.TWITCH}, "disguise");
+ super(plugin, Rank.ADMIN, new Rank[] {Rank.YOUTUBE, Rank.TWITCH, Rank.JNR_DEV}, "disguise");
}
@Override
diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/GameCommand.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/GameCommand.java
index 7cb8a6f80..76e4edb1c 100644
--- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/GameCommand.java
+++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/GameCommand.java
@@ -25,7 +25,7 @@ public class GameCommand extends MultiCommandBase
UtilPlayer.message(caller, F.main(Plugin.getName(), "Commands List:"));
UtilPlayer.message(caller, F.help("/game start", "Start the current game", Rank.ADMIN));
UtilPlayer.message(caller, F.help("/game stop", "Stop the current game", Rank.ADMIN));
- UtilPlayer.message(caller, F.help("/game set (Map)", "Set the current game or next game", Rank.ADMIN));
+ UtilPlayer.message(caller, F.help("/game set (MapSource) (Map)", "Set the current game or next game", Rank.ADMIN));
UtilPlayer.message(caller, F.main("Tip", "Use TAB for games/maps!"));
}
}
diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/SetCommand.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/SetCommand.java
index 0d7f183a7..d6958a663 100644
--- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/SetCommand.java
+++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/SetCommand.java
@@ -29,16 +29,31 @@ public class SetCommand extends CommandBase
if (args == null || args.length == 0)
{
- caller.sendMessage(F.help("/game set (Map)", "Set the current game or next game", Rank.ADMIN));
+ caller.sendMessage(F.help("/game set (MapSource) (Map)", "Set the current game or next game", Rank.ADMIN));
return;
}
String game = args[0].toLowerCase();
- if (args.length > 1)
+ if (args.length >= 2)
{
- Plugin.GetGameCreationManager().MapPref = args[1];
- UtilPlayer.message(caller, C.cAqua + C.Bold + "Map Preference: " + ChatColor.RESET + args[1]);
+ String map = "";
+ String source = "";
+ if(args.length == 3)
+ {
+ Plugin.GetGameCreationManager().MapSource = args[1];
+ Plugin.GetGameCreationManager().MapPref = args[2];
+ source = args[1];
+ map = args[2];
+ }
+ else
+ {
+ Plugin.GetGameCreationManager().MapSource = args[0];
+ Plugin.GetGameCreationManager().MapPref = args[1];
+ source = args[0];
+ map = args[1];
+ }
+ UtilPlayer.message(caller, C.cAqua + C.Bold + "Map Preference: " + ChatColor.RESET + source + ":" + map);
}
//Parse Game
diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/WriteCommand.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/WriteCommand.java
index 1718baec5..386d3867d 100644
--- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/WriteCommand.java
+++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/WriteCommand.java
@@ -11,7 +11,7 @@ public class WriteCommand extends CommandBase
{
public WriteCommand(ArcadeManager plugin)
{
- super(plugin, Rank.ADMIN, "write");
+ super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "write");
}
@Override
diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java
index acd526237..e05d9fd58 100644
--- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java
+++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java
@@ -86,7 +86,7 @@ public abstract class Game implements Listener
protected String[] _gameDesc;
//Map
- private ArrayList _files;
+ private HashMap> _files;
//State
private GameState _gameState = GameState.Loading;
@@ -193,8 +193,6 @@ public abstract class Game implements Listener
public int HungerSet = -1;
public int HealthSet = -1;
- public int SpawnDistanceRequirement = 1;
-
public boolean PrepareFreeze = true;
private double _itemMergeRadius = 0;
@@ -211,6 +209,11 @@ public abstract class Game implements Listener
public int TickPerTeleport = 1;
+ public int FillTeamsInOrderToCount = -1;
+
+ public boolean SpawnNearAllies = false;
+ public boolean SpawnNearEnemies = false;
+
public boolean StrictAntiHack = false;
public boolean DisableKillCommand = true;
@@ -265,6 +268,9 @@ public abstract class Game implements Listener
public boolean CanAddStats = true;
public boolean CanGiveLoot = true;
+ public boolean HideTeamSheep = false;
+ public boolean ReplaceTeamsWithKits = false;
+
public boolean VersionRequire1_8 = false;
public ArrayList GemBoosters = new ArrayList();
@@ -288,16 +294,28 @@ public abstract class Game implements Listener
Scoreboard = new GameScoreboard(this);
//Map Select
- _files = Manager.LoadFiles(GetName());
+ _files = new HashMap>();
+ for(GameType type : GetWorldHostNames())
+ {
+ _files.put(type, Manager.LoadFiles(type.GetName()));
+ }
if (Manager.GetGameCreationManager().MapPref != null)
{
- ArrayList matches = new ArrayList();
- for (String cur : _files)
+ HashMap> matches = new HashMap>();
+ for (GameType game : _files.keySet())
{
- if (cur.toLowerCase().contains(Manager.GetGameCreationManager().MapPref.toLowerCase()))
+ ArrayList list = new ArrayList();
+ for(String cur : _files.get(game))
{
- matches.add(cur);
- System.out.print("Map Preference: " + cur);
+ if (cur.toLowerCase().contains(Manager.GetGameCreationManager().MapPref.toLowerCase()))
+ {
+ if(game.toString().toLowerCase().contains(Manager.GetGameCreationManager().MapSource.toLowerCase()))
+ {
+ list.add(cur);
+ System.out.print("Map Preference: " + cur);
+ matches.put(game, list);
+ }
+ }
}
}
@@ -305,6 +323,7 @@ public abstract class Game implements Listener
_files = matches;
Manager.GetGameCreationManager().MapPref = null;
+ Manager.GetGameCreationManager().MapSource = null;
}
WorldData = new WorldData(this);
@@ -339,7 +358,7 @@ public abstract class Game implements Listener
_kits = kits;
}
- public ArrayList GetFiles()
+ public HashMap> GetFiles()
{
return _files;
}
@@ -348,6 +367,60 @@ public abstract class Game implements Listener
{
return _gameType.GetName();
}
+
+ public GameType[] GetWorldHostNames()
+ {
+ GameType[] mapSource = new GameType[]{GetType()};
+ if(GetType().getMapSource() != null)
+ {
+ if(GetType().ownMaps())
+ {
+ int i = 1;
+ mapSource = new GameType[GetType().getMapSource().length + 1];
+ for(GameType type : GetType().getMapSource())
+ {
+ mapSource[i] = type;
+ i++;
+ }
+ mapSource[0] = GetType();
+ }
+ else
+ {
+ mapSource = GetType().getMapSource();
+ }
+ }
+ return mapSource;
+ }
+
+ public String GetGameNamebyMap(String game, String map)
+ {
+ for(GameType type : _files.keySet())
+ {
+ if(type.GetName().toLowerCase().contains(game.toLowerCase()))
+ {
+ for(String string : _files.get(type))
+ {
+ if(string.toLowerCase().contains(map.toLowerCase()))
+ {
+ return type.GetName();
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ public GameType GetGameByMapList(ArrayList maps)
+ {
+ for(GameType game : _files.keySet())
+ {
+ if(maps.equals(_files.get(game)))
+ {
+ return game;
+ }
+ }
+ return null;
+ }
public String GetMode()
{
@@ -472,9 +545,6 @@ public abstract class Game implements Listener
//Add
GetTeamList().add(team);
- //Set Spawn Data
- team.SetSpawnRequirement(this.SpawnDistanceRequirement);
-
System.out.println("Created Team: " + team.GetName());
}
@@ -556,6 +626,17 @@ public abstract class Game implements Listener
public GameTeam ChooseTeam(Player player)
{
+ if (FillTeamsInOrderToCount != -1)
+ {
+ for (int i = 0; i < _teamList.size(); i++)
+ {
+ if (_teamList.get(i).GetSize() < FillTeamsInOrderToCount)
+ {
+ return _teamList.get(i);
+ }
+ }
+ }
+
GameTeam team = null;
//Random Team
@@ -1381,4 +1462,5 @@ public abstract class Game implements Listener
//End
SetState(GameState.End);
}
+
}
diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/GameServerConfig.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/GameServerConfig.java
index 3ea703536..0e1e2ac03 100644
--- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/GameServerConfig.java
+++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/GameServerConfig.java
@@ -36,6 +36,8 @@ public class GameServerConfig
public boolean PlayerKickIdle = true;
public boolean PublicServer = true;
+
+ public boolean PlayerServerWhitelist = false;
public boolean IsValid()
{
diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/GameTeam.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/GameTeam.java
index c465dbf1d..a4adccbd5 100644
--- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/GameTeam.java
+++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/GameTeam.java
@@ -5,8 +5,10 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
+import mineplex.core.account.CoreClient;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
+import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
@@ -60,19 +62,19 @@ public class GameTeam
private HashMap _players = new HashMap();
private ArrayList _spawns;
-
+
private Creature _teamEntity = null;
private HashSet _kitRestrict = new HashSet();
- private int _spawnDistance = 0;
-
private boolean _visible = true;
+ private boolean _displayTag;
+
//Records order players go out in
protected ArrayList _places = new ArrayList();
- public GameTeam(Game host, String name, ChatColor color, ArrayList spawns)
+ public GameTeam(Game host, String name, ChatColor color, ArrayList spawns, boolean tags)
{
Host = host;
@@ -80,6 +82,12 @@ public class GameTeam
_name = name;
_color = color;
_spawns = spawns;
+ _displayTag = tags;
+ }
+
+ public GameTeam(Game host, String name, ChatColor color, ArrayList spawns)
+ {
+ this(host, name, color, spawns, false);
}
public String GetName()
@@ -99,40 +107,48 @@ public class GameTeam
public Location GetSpawn()
{
- // ArrayList valid = new ArrayList();
-
- Location best = null;
- double bestDist = 0;
-
- for (Location loc : _spawns)
+ //Keep allies together
+ if (!Host.IsLive() && Host.SpawnNearAllies)
{
- double closestPlayer = -1;
-
- for (Player player : Host.GetPlayers(true))
+ //Find Location Nearest Ally
+ Location loc = UtilAlg.getLocationNearPlayers(_spawns, GetPlayers(true), Host.GetPlayers(true));
+ if (loc != null)
+ return loc;
+
+ //No allies existed spawned yet
+
+ //Spawn near enemies (used for SG)
+ if (Host.SpawnNearEnemies)
{
- double playerDist = UtilMath.offsetSquared(player.getLocation(), loc);
-
- if (closestPlayer == -1 || playerDist < closestPlayer)
- closestPlayer = playerDist;
+ loc = UtilAlg.getLocationNearPlayers(_spawns, Host.GetPlayers(true), Host.GetPlayers(true));
+ if (loc != null)
+ return loc;
}
-
- if (best == null || closestPlayer > bestDist)
+ //Spawn away from enemies
+ else
{
- best = loc;
- bestDist = closestPlayer;
- }
-
- // if (closestPlayer > _spawnDistance * _spawnDistance)
- // {
- // valid.add(loc);
- // }
+ loc = UtilAlg.getLocationAwayFromPlayers(_spawns, Host.GetPlayers(true));
+ if (loc != null)
+ return loc;
+ }
+ }
+ else
+ {
+ //Spawn near players
+ if (Host.SpawnNearEnemies)
+ {
+ Location loc = UtilAlg.getLocationNearPlayers(_spawns, Host.GetPlayers(true), Host.GetPlayers(true));
+ if (loc != null)
+ return loc;
+ }
+ //Spawn away from players
+ else
+ {
+ Location loc = UtilAlg.getLocationAwayFromPlayers(_spawns, Host.GetPlayers(true));
+ if (loc != null)
+ return loc;
+ }
}
-
- // if (valid.size() > 0)
- // valid.get(UtilMath.r(valid.size()));
-
- if (best != null)
- return best;
return _spawns.get(UtilMath.r(_spawns.size()));
}
@@ -149,7 +165,14 @@ public class GameTeam
public void DisbandTeam()
{
for (Player player : _players.keySet())
+ {
+ for(Player other : UtilServer.getPlayers())
+ {
+ other.getScoreboard().getTeam(Host.Manager.GetClients().Get(player).GetRank().Name + _name.toUpperCase()).removePlayer(player);
+ other.getScoreboard().getTeam(Host.Manager.GetClients().Get(player).GetRank().Name).addPlayer(player);
+ }
UtilPlayer.message(player, F.main("Team", _color + C.Bold + _displayName + " Team was disbanded."));
+ }
_players.clear();
}
@@ -333,11 +356,6 @@ public class GameTeam
_spawns = spawns;
}
- public void SetSpawnRequirement(int value)
- {
- _spawnDistance = value;
- }
-
public void SetVisible(boolean b)
{
_visible = b;
@@ -347,6 +365,16 @@ public class GameTeam
{
return _visible;
}
+
+ public void setDisplayTag(boolean b)
+ {
+ _displayTag = b;
+ }
+
+ public boolean GetDisplaytag()
+ {
+ return _displayTag;
+ }
public void SetRespawnTime(double i)
{
@@ -390,6 +418,4 @@ public class GameTeam
return _places;
}
-
-
}
diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java
index 52f199735..e17db6abc 100644
--- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java
+++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java
@@ -45,6 +45,7 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.MapUtil;
import mineplex.core.common.util.NautHashMap;
+import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEvent;
@@ -1178,7 +1179,7 @@ public class Bridge extends TeamGame implements OreObsfucation
UtilPlayer.message(event.getPlayer(), F.main("Game",
"Cannot place blocks in liquids until Bridge is down."));
- event.getPlayer().setVelocity(new Vector(0,-0.5,0));
+ UtilAction.velocity(event.getPlayer(), new Vector(0, -0.5, 0));
event.setCancelled(true);
return;
diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java
index 1d7ee11d3..92ead83b8 100644
--- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java
+++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java
@@ -67,6 +67,7 @@ import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap;
+import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
@@ -707,7 +708,7 @@ public class Build extends SoloGame
event.setTo(event.getFrom());
//Velocity
- event.getPlayer().setVelocity(UtilAlg.getTrajectory(event.getTo(), data.Spawn));
+ UtilAction.velocity(event.getPlayer(), UtilAlg.getTrajectory(event.getTo(), data.Spawn));
}
}
diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscape.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscape.java
index 9caea2e88..d385a752f 100644
--- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscape.java
+++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscape.java
@@ -34,6 +34,7 @@ import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap;
+import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilServer;
@@ -526,8 +527,7 @@ public class DragonEscape extends SoloGame
//Teleport
player.teleport(target.getLocation().add(0, 0.5, 0));
- player.setVelocity(new Vector(0,0,0));
- player.setFallDistance(0);
+ UtilAction.velocity(player, new Vector(0,0,0));
//Record
_warpTime.put(player, System.currentTimeMillis());
diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscapeTeams.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscapeTeams.java
index 9460a9d67..01e439add 100644
--- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscapeTeams.java
+++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscapeTeams.java
@@ -26,6 +26,7 @@ import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap;
+import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilInv;
@@ -540,8 +541,7 @@ public class DragonEscapeTeams extends TeamGame
//Teleport
player.teleport(target.getLocation().add(0, 0.5, 0));
- player.setVelocity(new Vector(0,0,0));
- player.setFallDistance(0);
+ UtilAction.velocity(player, new Vector(0,0,0));
//Record
_warpTime.put(player, System.currentTimeMillis());
diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java
index 37211beec..05d1c8508 100644
--- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java
+++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java
@@ -1,48 +1,9 @@
package nautilus.game.arcade.game.games.event;
-import java.util.ArrayList;
-import java.util.HashMap;
+import java.util.Arrays;
import java.util.HashSet;
-import java.util.LinkedList;
import java.util.List;
-import org.bukkit.Bukkit;
-import org.bukkit.ChatColor;
-import org.bukkit.Effect;
-import org.bukkit.GameMode;
-import org.bukkit.Material;
-import org.bukkit.OfflinePlayer;
-import org.bukkit.Sound;
-import org.bukkit.World;
-import org.bukkit.block.BlockFace;
-import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity;
-import org.bukkit.entity.Ageable;
-import org.bukkit.entity.Entity;
-import org.bukkit.entity.EntityType;
-import org.bukkit.entity.Player;
-import org.bukkit.entity.Skeleton;
-import org.bukkit.entity.Slime;
-import org.bukkit.entity.Villager;
-import org.bukkit.entity.Wolf;
-import org.bukkit.entity.Zombie;
-import org.bukkit.entity.Skeleton.SkeletonType;
-import org.bukkit.entity.Villager.Profession;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
-import org.bukkit.event.entity.EntityDeathEvent;
-import org.bukkit.event.entity.EntityExplodeEvent;
-import org.bukkit.event.player.PlayerCommandPreprocessEvent;
-import org.bukkit.event.player.PlayerJoinEvent;
-import org.bukkit.event.player.PlayerToggleFlightEvent;
-import org.bukkit.inventory.ItemStack;
-import org.bukkit.plugin.Plugin;
-import org.bukkit.potion.PotionEffect;
-import org.bukkit.potion.PotionEffectType;
-
-import mineplex.core.common.util.C;
-import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
@@ -50,34 +11,45 @@ import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
-import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
-import mineplex.core.common.util.UtilText;
-import mineplex.core.creature.event.CreatureKillEntitiesEvent;
import mineplex.core.disguise.disguises.DisguiseBase;
import mineplex.core.disguise.disguises.DisguiseBat;
import mineplex.core.disguise.disguises.DisguiseChicken;
import mineplex.core.disguise.disguises.DisguiseEnderman;
import mineplex.core.disguise.disguises.DisguiseWither;
import mineplex.core.gadget.event.GadgetActivateEvent;
-import mineplex.core.gadget.types.Gadget;
-import mineplex.core.gadget.types.GadgetType;
-import mineplex.core.give.Give;
-import mineplex.core.mount.Mount;
import mineplex.core.mount.event.MountActivateEvent;
import mineplex.core.recharge.Recharge;
import mineplex.core.shop.item.SalesPackageBase;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.visibility.VisibilityManager;
-import nautilus.game.arcade.game.games.event.kits.*;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
+import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.SoloGame;
+import nautilus.game.arcade.game.Game.GameState;
+import nautilus.game.arcade.game.games.event.kits.KitPlayer;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.GameHostManager;
-public class EventGame extends SoloGame
+import org.bukkit.Effect;
+import org.bukkit.GameMode;
+import org.bukkit.Sound;
+import org.bukkit.block.BlockFace;
+import org.bukkit.entity.Entity;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
+import org.bukkit.event.entity.EntityDeathEvent;
+import org.bukkit.event.entity.EntityExplodeEvent;
+import org.bukkit.event.player.PlayerJoinEvent;
+import org.bukkit.event.player.PlayerToggleFlightEvent;
+import org.bukkit.inventory.ItemStack;
+
+public class EventGame extends Game
{
private GameHostManager _mps;
@@ -169,1276 +141,6 @@ public class EventGame extends SoloGame
player.setGameMode(GameMode.SURVIVAL);
}
- //Help
- private void commandHelp(Player player)
- {
- UtilPlayer.message(player, F.main("Event", "Displaying Commands;"));
-
- UtilPlayer.message(player, F.value("/e settings", "View Settings Help"));
-
- UtilPlayer.message(player, F.value("/e tp ", "Teleport to Target"));
- UtilPlayer.message(player, F.value("/e tp here ", "Teleport Target to Self"));
- UtilPlayer.message(player, F.value("/e tp here all", "Teleport Everyone to Self"));
-
- UtilPlayer.message(player, F.value("/e gadget", "Toggle Gadgets"));
- UtilPlayer.message(player, F.value("/e gadget list", "Lists Gadgets (Shows Whitelist)"));
- UtilPlayer.message(player, F.value("/e gadget ", "Toggles Whitelist for Gadget"));
- UtilPlayer.message(player, F.value("/e gadget clear", "Clears Gadget Whitelist"));
-
- UtilPlayer.message(player, F.value("/e silence [Time]", "Silence Chat"));
-
- UtilPlayer.message(player, F.value("/e admin [Player]", "Toggle Event Admin"));
-
- UtilPlayer.message(player, F.value("/e gm [Player]", "Toggle Creative Mode"));
-
- UtilPlayer.message(player, F.value("/e radius [Radius]", "Set Forcefield Radius"));
-
- UtilPlayer.message(player, F.value("/e give - ", "Give Item"));
- UtilPlayer.message(player, F.value("/e give
- [e:#,e:#...]", "Give Item"));
-
- UtilPlayer.message(player, F.value("/e doublejump", "Toggles Double Jump"));
-
- UtilPlayer.message(player, F.value("/e scoreboard [Text]", "Sets Scoreboard Text"));
-
- UtilPlayer.message(player, F.value("/e mob [#Amount] n[Name] s[Size] [angry] [baby]", ""));
- UtilPlayer.message(player, F.value("/e mob kill ", "Kill Mobs"));
-
- UtilPlayer.message(player, F.value("/e kit set", "Sets Player Kit to your Hotbar"));
- UtilPlayer.message(player, F.value("/e kit apply", "Gives Kit to Players"));
- UtilPlayer.message(player, F.value("/e kit clear", "Gives Kit to Players"));
-
- UtilPlayer.message(player, F.value("/e effect ", ""));
- UtilPlayer.message(player, F.value("/e effect clear", ""));
- }
-
- private void commandHelpSettings(Player player)
- {
- UtilPlayer.message(player, F.main("Event", "Displaying Settings Commands;"));
- UtilPlayer.message(player, F.value("/e damage all", "Toggles All Damage"));
- UtilPlayer.message(player, F.value("/e damage pvp", "Toggles PvP Damage"));
- UtilPlayer.message(player, F.value("/e damage pve", "Toggles PvE Damage"));
- UtilPlayer.message(player, F.value("/e damage pve", "Toggles EvP Damage"));
- UtilPlayer.message(player, F.value("/e damage fall", "Toggles Fall Damage"));
- UtilPlayer.message(player, F.value("/e health <-1 to 20>", "Locks Players Health"));
- UtilPlayer.message(player, F.value("/e hunger <-1 to 20>", "Locks Players Hunger"));
- UtilPlayer.message(player, F.value("/e item drop", "Toggles Item Drop"));
- UtilPlayer.message(player, F.value("/e item pickup", "Toggles Item Pickup"));
- UtilPlayer.message(player, F.value("/e blockplace", "Toggles Block Placing (On/Off)"));
- UtilPlayer.message(player, F.value("/e blockplace whitelist ", ""));
- UtilPlayer.message(player, F.value("/e blockplace blacklist ", ""));
- UtilPlayer.message(player, F.value("/e blockbreak", "Toggles Block Breaking (On/Off)"));
- UtilPlayer.message(player, F.value("/e blockbreak whitelist ", ""));
- UtilPlayer.message(player, F.value("/e blockbreak blacklist ", ""));
- UtilPlayer.message(player, F.value("/e time <-1 to 24000>", "Sets World Time"));
- }
-
- //Command Handler
- @EventHandler(priority = EventPriority.LOWEST)
- private void commandHandler(PlayerCommandPreprocessEvent event)
- {
- if (!InProgress())
- return;
-
- if (!event.getMessage().toLowerCase().startsWith("/e "))
- return;
-
- event.setCancelled(true);
-
- if (!_mps.isAdmin(event.getPlayer(), false))
- return;
-
- //Trim off /e and split to args
- String[] args = event.getMessage().substring(3, event.getMessage().length()).split(" ");
-
- if (args.length == 0 || args[0].equalsIgnoreCase("help"))
- {
- commandHelp(event.getPlayer());
- }
- else if (args[0].equalsIgnoreCase("settings"))
- {
- if (args.length >= 2 && args[1].equalsIgnoreCase("list"))
- listSettings(event.getPlayer());
- else
- commandHelpSettings(event.getPlayer());
- }
-
- //XXX Commands
- else if (args[0].equalsIgnoreCase("tp"))
- {
- commandTeleport(event.getPlayer(), args);
- }
- else if (args[0].equalsIgnoreCase("gadget"))
- {
- commandGadget(event.getPlayer(), args);
- }
- else if (args[0].equalsIgnoreCase("silence"))
- {
- commandSilence(event.getPlayer(), args);
- }
- else if (args[0].equalsIgnoreCase("admin"))
- {
- commandAdmin(event.getPlayer(), args);
- }
- else if (args[0].equalsIgnoreCase("gm"))
- {
- commandGamemode(event.getPlayer(), args);
- }
- else if (args[0].equalsIgnoreCase("radius"))
- {
- commandForcefieldRadius(event.getPlayer(), args);
- }
- else if (args[0].equalsIgnoreCase("doublejump"))
- {
- commandDoubleJump(event.getPlayer(), args);
- }
- else if (args[0].equalsIgnoreCase("scoreboard"))
- {
- commandScoreboard(event.getPlayer(), args);
- }
- else if (args[0].equalsIgnoreCase("whitelist"))
- {
- commandWhitelist(event.getPlayer(), args);
- }
- else if (args[0].equalsIgnoreCase("give"))
- {
- commandGive(event.getPlayer(), args);
- }
- else if (args[0].equalsIgnoreCase("effect"))
- {
- commandEffect(event.getPlayer(), args);
- }
- else if (args[0].equalsIgnoreCase("kit"))
- {
- commandKit(event.getPlayer(), args);
- }
- else if (args[0].equalsIgnoreCase("mob"))
- {
- if (args.length >= 2 && args[1].equalsIgnoreCase("kill"))
- commandMobKill(event.getPlayer(), args);
- else
- commandMob(event.getPlayer(), args);
- }
-
-
- //XXX Settings
- else if (event.getMessage().toLowerCase().equals("/e damage all"))
- {
- Damage = !Damage;
- Announce(F.main("Event Settings", F.value("Damage All", F.tf(Damage))));
- }
- else if (event.getMessage().toLowerCase().equals("/e damage pvp"))
- {
- DamagePvP = !DamagePvP;
- Announce(F.main("Event Settings", F.value("Damage PvP", F.tf(DamagePvP))));
- }
- else if (event.getMessage().toLowerCase().equals("/e damage pve"))
- {
- DamagePvE = !DamagePvE;
- Announce(F.main("Event Settings", F.value("Damage PvE", F.tf(DamagePvE))));
- }
- else if (event.getMessage().toLowerCase().equals("/e damage evp"))
- {
- DamageEvP = !DamageEvP;
- Announce(F.main("Event Settings", F.value("Damage EvP", F.tf(DamageEvP))));
- }
- else if (event.getMessage().toLowerCase().equals("/e damage fall"))
- {
- DamageFall = !DamageFall;
- Announce(F.main("Event Settings", F.value("Damage Fall", F.tf(DamageFall))));
- }
- else if (args[0].equalsIgnoreCase("health"))
- {
- commandHealth(event.getPlayer(), args);
- }
- else if (args[0].equalsIgnoreCase("hunger"))
- {
- commandHunger(event.getPlayer(), args);
- }
- else if (event.getMessage().toLowerCase().equals("/e item drop"))
- {
- ItemDrop = !ItemDrop;
- Announce(F.main("Event Settings", F.value("Item Drop", F.tf(ItemDrop))));
- }
- else if (event.getMessage().toLowerCase().equals("/e item pickup"))
- {
- ItemPickup = !ItemPickup;
- Announce(F.main("Event Settings", F.value("Item Pickup", F.tf(ItemPickup))));
- }
- else if (event.getMessage().toLowerCase().equals("/e blockplace"))
- {
- BlockPlace = !BlockPlace;
- Announce(F.main("Event Settings", F.value("Block Place", F.tf(BlockPlace))));
- }
- else if (args.length >= 4 && args[0].equalsIgnoreCase("blockplace")
- && (args[1].equalsIgnoreCase("whitelist") || args[1].equalsIgnoreCase("blacklist")))
- {
- commandBlockPlace(event.getPlayer(), args, args[1].equalsIgnoreCase("whitelist"), args[2]);
- }
- else if (event.getMessage().toLowerCase().equals("/e blockbreak"))
- {
- BlockBreak = !BlockBreak;
- Announce(F.main("Event Settings", F.value("Block Break", F.tf(BlockBreak))));
- }
- else if (args.length >= 4 && args[0].equalsIgnoreCase("blockbreak")
- && (args[1].equalsIgnoreCase("whitelist") || args[1].equalsIgnoreCase("blacklist")))
- {
- commandBlockBreak(event.getPlayer(), args, args[1].equalsIgnoreCase("whitelist"), args[2]);
- }
- else if (args[0].equalsIgnoreCase("time"))
- {
- commandTime(event.getPlayer(), args);
- }
- }
-
- private void listSettings(Player player)
- {
- UtilPlayer.message(player, F.value("Damage All", F.tf(Damage)));
- UtilPlayer.message(player, F.value("Damage PvP", F.tf(DamagePvP)));
- UtilPlayer.message(player, F.value("Damage PvE", F.tf(DamagePvE)));
- UtilPlayer.message(player, F.value("Damage EvP", F.tf(DamageEvP)));
- UtilPlayer.message(player, F.value("Damage Fall", F.tf(DamageFall)));
- UtilPlayer.message(player, F.value("Health Set", HealthSet+""));
- UtilPlayer.message(player, F.value("Hunger Set", HungerSet+""));
- UtilPlayer.message(player, F.value("Item Pickup", F.tf(ItemPickup)));
- UtilPlayer.message(player, F.value("Item Drop", F.tf(ItemDrop)));
- UtilPlayer.message(player, F.value("Block Place", F.tf(BlockPlace)));
- UtilPlayer.message(player, F.value("Block Place Whitelist", UtilText.listToString(BlockPlaceAllow, true)));
- UtilPlayer.message(player, F.value("Block Place Blacklist", UtilText.listToString(BlockPlaceDeny, true)));
- UtilPlayer.message(player, F.value("Block Break", F.tf(BlockPlace)));
- UtilPlayer.message(player, F.value("Block Break Whitelist", UtilText.listToString(BlockBreakAllow, true)));
- UtilPlayer.message(player, F.value("Block Break Blacklist", UtilText.listToString(BlockBreakDeny, true)));
- UtilPlayer.message(player, F.value("Time Set", WorldTimeSet+""));
- }
-
- private void commandBlockPlace(Player player, String[] args, boolean whitelist, String command)
- {
- try
- {
- int blockId = Integer.parseInt(args[3]);
-
- if (whitelist)
- {
- if (command.equalsIgnoreCase("add"))
- {
- BlockPlaceAllow.add(blockId);
- UtilPlayer.message(player, F.main("Event Settings", F.value("Block Place Whitelist", "Added " + blockId)));
- }
- else if (command.equalsIgnoreCase("remove"))
- {
- BlockPlaceAllow.remove(blockId);
- UtilPlayer.message(player, F.main("Event Settings", F.value("Block Place Whitelist", "Removed " + blockId)));
- }
- else if (command.equalsIgnoreCase("clear"))
- {
- BlockPlaceAllow.clear();
- UtilPlayer.message(player, F.main("Event Settings", F.value("Block Place Whitelist", "Cleared")));
- }
- else if (command.equalsIgnoreCase("list"))
- {
- UtilPlayer.message(player, F.main("Event Settings", F.value("Block Place Whitelist", UtilText.listToString(BlockPlaceAllow, true))));
- }
- }
- else
- {
- if (command.equalsIgnoreCase("add"))
- {
- BlockPlaceDeny.add(blockId);
- UtilPlayer.message(player, F.main("Event Settings", F.value("Block Place Blacklist", "Added " + blockId)));
- }
- else if (command.equalsIgnoreCase("remove"))
- {
- BlockPlaceDeny.remove(blockId);
- UtilPlayer.message(player, F.main("Event Settings", F.value("Block Place Blacklist", "Removed " + blockId)));
- }
- else if (command.equalsIgnoreCase("clear"))
- {
- BlockPlaceDeny.clear();
- UtilPlayer.message(player, F.main("Event Settings", F.value("Block Place Blacklist", "Cleared")));
- }
- else if (command.equalsIgnoreCase("list"))
- {
- UtilPlayer.message(player, F.main("Event Settings", F.value("Block Place Blacklist", UtilText.listToString(BlockPlaceDeny, true))));
- }
- }
-
- return;
- }
- catch (Exception e)
- {
-
- }
-
- commandHelpSettings(player);
- }
-
- private void commandBlockBreak(Player player, String[] args, boolean whitelist, String command)
- {
- try
- {
- int blockId = Integer.parseInt(args[3]);
-
- if (whitelist)
- {
- if (command.equalsIgnoreCase("add"))
- {
- BlockBreakAllow.add(blockId);
- UtilPlayer.message(player, F.main("Event Settings", F.value("Block Break Whitelist", "Added " + blockId)));
- }
- else if (command.equalsIgnoreCase("remove"))
- {
- BlockBreakAllow.remove(blockId);
- UtilPlayer.message(player, F.main("Event Settings", F.value("Block Break Whitelist", "Removed " + blockId)));
- }
- else if (command.equalsIgnoreCase("clear"))
- {
- BlockBreakAllow.clear();
- UtilPlayer.message(player, F.main("Event Settings", F.value("Block Break Whitelist", "Cleared")));
- }
- else if (command.equalsIgnoreCase("list"))
- {
- UtilPlayer.message(player, F.main("Event Settings", F.value("Block Break Whitelist", UtilText.listToString(BlockBreakAllow, true))));
- }
- }
- else
- {
- if (command.equalsIgnoreCase("add"))
- {
- BlockBreakDeny.add(blockId);
- UtilPlayer.message(player, F.main("Event Settings", F.value("Block Break Blacklist", "Added " + blockId)));
- }
- else if (command.equalsIgnoreCase("remove"))
- {
- BlockBreakDeny.remove(blockId);
- UtilPlayer.message(player, F.main("Event Settings", F.value("Block Break Blacklist", "Removed " + blockId)));
- }
- else if (command.equalsIgnoreCase("clear"))
- {
- BlockBreakDeny.clear();
- UtilPlayer.message(player, F.main("Event Settings", F.value("Block Break Blacklist", "Cleared")));
- }
- else if (command.equalsIgnoreCase("list"))
- {
- UtilPlayer.message(player, F.main("Event Settings", F.value("Block Break Blacklist", UtilText.listToString(BlockBreakDeny, true))));
- }
- }
-
- return;
- }
- catch (Exception e)
- {
-
- }
-
- commandHelpSettings(player);
- }
-
- private void commandHealth(Player player, String[] args)
- {
- try
- {
- if (args.length >= 2)
- {
- int health = Integer.parseInt(args[1]);
-
- if (health <= 0)
- health = -1;
- if (health > 20)
- health = 20;
-
- HealthSet = health;
-
- if (HealthSet == -1)
- Announce(F.main("Event Settings", F.value("Health Set", "Disabled")));
- else
- Announce(F.main("Event Settings", F.value("Health Set", HealthSet + "")));
-
- return;
- }
- }
- catch (Exception e)
- {
-
- }
-
- commandHelpSettings(player);
- }
-
- private void commandHunger(Player player, String[] args)
- {
- try
- {
- if (args.length >= 2)
- {
- int hunger = Integer.parseInt(args[1]);
-
- if (hunger <= 0)
- hunger = -1;
- if (hunger > 20)
- hunger = 20;
-
- HungerSet = hunger;
-
- if (HungerSet == -1)
- Announce(F.main("Event Settings", F.value("Hunger Set", "Disabled")));
- else
- Announce(F.main("Event Settings", F.value("Hunger Set", HungerSet + "")));
-
- return;
- }
- }
- catch (Exception e)
- {
-
- }
-
- commandHelpSettings(player);
- }
-
- private void commandTime(Player player, String[] args)
- {
- try
- {
- if (args.length >= 2)
- {
- int time = Integer.parseInt(args[1]);
-
- if (time <= -1)
- time = -1;
- if (time > 24000)
- time = 24000;
-
- WorldTimeSet = time;
-
- if (WorldTimeSet == -1)
- Announce(F.main("Event Settings", F.value("Time Set", "Disabled")));
- else
- Announce(F.main("Event Settings", F.value("Time Set", WorldTimeSet + "")));
-
- return;
- }
- }
- catch (Exception e)
- {
-
- }
-
- commandHelpSettings(player);
- }
-
- //Teleport Command (To, Here, All)
- private void commandTeleport(Player player, String[] args)
- {
- if (args.length >= 3 && args[1].equalsIgnoreCase("here"))
- {
- if (args[2].equalsIgnoreCase("all"))
- {
- for (Player other : UtilServer.getPlayers())
- {
- UtilPlayer.message(other, F.main("Event TP", player.getName() + " teleported everyone to self."));
- other.teleport(player);
- }
-
- return;
- }
-
- Player target = UtilPlayer.searchOnline(player, args[2], true);
- if (target != null)
- {
- target.teleport(player);
- UtilPlayer.message(target, F.main("Event TP", player.getName() + " teleported you to self."));
- UtilPlayer.message(player, F.main("Event TP", "Teleported " + target.getName() + " to you."));
- }
-
- return;
- }
-
- if (args.length >= 2)
- {
- Player target = UtilPlayer.searchOnline(player, args[1], true);
- if (target != null)
- {
- player.teleport(target);
- UtilPlayer.message(player, F.main("Event TP", "Teleported to " + target.getName() + "."));
- }
-
- return;
- }
-
- commandHelp(player);
- }
-
- //Gadget Commands (Global & Individual)
- private void commandGadget(Player player, String[] args)
- {
- if (args.length < 2)
- {
- _allowAllGadgets = !_allowAllGadgets;
-
- if (!_allowAllGadgets)
- {
- Manager.getCosmeticManager().getMountManager().DisableAll();
- Manager.getCosmeticManager().getGadgetManager().DisableAll();
- }
-
- Announce(F.main("Inventory", F.value("Allow All Gadgets", F.ed(_allowAllGadgets))));
- return;
- }
-
- if (args.length >= 2 && args[1].equalsIgnoreCase("clear"))
- {
- _gadgetWhitelist.clear();
- Announce(F.main("Inventory", F.value("Gadget Whitelist", "Cleared.")));
- return;
- }
-
- if (args.length >= 2 && args[1].equalsIgnoreCase("list"))
- {
- ChatColor color = ChatColor.AQUA;
-
- //Gadgets
- for (GadgetType type : GadgetType.values())
- {
- String items = C.Bold + type + " Gadgets> ";
-
- for (Gadget gadget : Manager.getCosmeticManager().getGadgetManager().getGadgets(type))
- {
- items += color + gadget.GetName().replaceAll(" ", "") + " ";
- color = (color == ChatColor.AQUA ? ChatColor.DARK_AQUA : ChatColor.AQUA);
- }
-
- UtilPlayer.message(player, items);
- }
-
- //Mounts
- String mounts = C.Bold + "Mount Gadgets> ";
- for (Mount> mount : Manager.getCosmeticManager().getMountManager().getMounts())
- {
- mounts += color + mount.GetName().replaceAll(" ", "") + " ";
- color = (color == ChatColor.AQUA ? ChatColor.DARK_AQUA : ChatColor.AQUA);
- }
- UtilPlayer.message(player, mounts);
-
- return;
- }
-
- if (args.length >= 2)
- {
- //Gadgets
- for (GadgetType type : GadgetType.values())
- {
- for (Gadget gadget : Manager.getCosmeticManager().getGadgetManager().getGadgets(type))
- {
- if (gadget.GetName().replaceAll(" ", "").equalsIgnoreCase(args[1]))
- {
- if (_gadgetWhitelist.remove(gadget))
- {
- Announce(F.main("Inventory", F.value(gadget.GetName() + " Gadget", F.ed(false))));
- gadget.DisableForAll();
- }
- else
- {
- Announce(F.main("Inventory", F.value(gadget.GetName() + " Gadget", F.ed(true))));
- _gadgetWhitelist.add(gadget);
- }
-
- return;
- }
- }
- }
-
- //Mounts
- for (Mount mount : Manager.getCosmeticManager().getMountManager().getMounts())
- {
- if (mount.GetName().replaceAll(" ", "").equalsIgnoreCase(args[1]))
- {
- if (_gadgetWhitelist.remove(mount))
- {
- Announce(F.main("Inventory", F.value(mount.GetName() + " Gadget", F.ed(false))));
- mount.DisableForAll();
- }
- else
- {
- Announce(F.main("Inventory", F.value(mount.GetName() + " Gadget", F.ed(true))));
- _gadgetWhitelist.add(mount);
- }
-
- return;
- }
- }
-
- UtilPlayer.message(player, F.main("Inventory", args[1] + " is not a valid gadget."));
-
- return;
- }
-
- commandHelp(player);
- }
-
- //Silence
- private void commandSilence(Player player, String[] args)
- {
- try
- {
- //Toggle
- if (args.length == 1)
- {
- //Disable
- if (Manager.GetChat().Silenced() != 0)
- {
- Manager.GetChat().Silence(0, true);
- }
- //Enable
- else
- {
- Manager.GetChat().Silence(-1, true);
- }
- }
- //Timer
- else
- {
- long time = (long) (Double.valueOf(args[1]) * 3600000);
-
- Manager.GetChat().Silence(time, true);
- }
- }
- catch (Exception e)
- {
- UtilPlayer.message(player, F.main("Chat", "Invalid Time Parameter."));
- }
- }
-
- //Gamemode (Self and Others)
- private void commandAdmin(Player player, String[] args)
- {
- Player target = player;
-
- if (args.length >= 2)
- {
- Player newTarget = UtilPlayer.searchOnline(player, args[1], true);
- if (newTarget != null)
- target = newTarget;
- else
- return;
- }
-
- if (!Manager.GetGameHostManager().isAdmin(target, false))
- Manager.GetGameHostManager().giveAdmin(target);
- else
- Manager.GetGameHostManager().removeAdmin(target.getName());
-
- UtilPlayer.message(player, F.main("Event Admin", target.getName() + " Admin: " + F.tf(Manager.GetGameHostManager().isAdmin(target, false))));
- }
-
- //Gamemode (Self and Others)
- private void commandGamemode(Player player, String[] args)
- {
- Player target = player;
-
- if (args.length >= 2)
- {
- Player newTarget = UtilPlayer.searchOnline(player, args[1], true);
- if (newTarget != null)
- target = newTarget;
- else
- return;
- }
-
- if (target.getGameMode() == GameMode.CREATIVE)
- target.setGameMode(GameMode.SURVIVAL);
- else
- target.setGameMode(GameMode.CREATIVE);
-
- UtilPlayer.message(player, F.main("Event GM", target.getName() + " Creative: " + F.tf(target.getGameMode() == GameMode.CREATIVE)));
- }
-
- //Forcefield
- private void commandForcefieldRadius(Player player, String[] args)
- {
- //Toggle
- if (args.length >= 2)
- {
- try
- {
- int range = Integer.parseInt(args[1]);
-
- _forcefield.put(player.getName(), range);
-
- UtilPlayer.message(player, F.main("Forcefield", "Enabled with " + F.elem(range + "") + " radius."));
- }
- catch (Exception e)
- {
- UtilPlayer.message(player, F.main("Forcefield", "Invalid Input."));
- }
- }
- else
- {
- _forcefield.remove(player.getName());
- UtilPlayer.message(player, F.main("Forcefield", "Disabled."));
- }
- }
-
- //Give
- private void commandGive(Player player, String[] args)
- {
- String[] newArgs = new String[args.length-1];
-
- for (int i=0 ; i= 2)
- {
- //Line
- int line = 0;
- try
- {
- line = Integer.parseInt(args[1]);
- }
- catch (Exception e)
- {
- UtilPlayer.message(player, F.main("Scoreboard", "Invalid Line Number."));
- return;
- }
-
- if (line < 1 || line > 14)
- {
- UtilPlayer.message(player, F.main("Scoreboard", "Invalid Line Number."));
- return;
- }
-
- //Text
- String lineText = "";
-
- //Reset String
- if (args.length <= 2)
- for (int i=0 ; i= 2 && args[1].equalsIgnoreCase("clear"))
- {
- for (int i=0 ; i<_sideText.length ; i++)
- {
- String lineText = "";
- for (int j=0 ; j= 2)
- {
- if (args[1].equalsIgnoreCase("on") || args[1].equalsIgnoreCase("off"))
- {
- UtilServer.getServer().setWhitelist(args[1].equalsIgnoreCase("on"));
-
- Announce(F.main("Event Settings", F.value("Whitelist", F.tf(args[1].equalsIgnoreCase("on")))));
- return;
- }
- }
-
- //Add and Remove
- if (args.length >= 3)
- {
- if (args[1].equalsIgnoreCase("add") || args[1].equalsIgnoreCase("remove"))
- {
- OfflinePlayer target = Bukkit.getOfflinePlayer(args[2]);
-
- if (args[1].equalsIgnoreCase("add"))
- {
- UtilServer.getServer().getWhitelistedPlayers().add(target);
- UtilPlayer.message(player, F.main("Whitelist", "Added " + args[2] + " to the whitelist."));
- }
- else
- {
- UtilServer.getServer().getWhitelistedPlayers().remove(target);
- UtilPlayer.message(player, F.main("Whitelist", "Removed " + args[2] + " to the whitelist."));
- }
-
- return;
- }
- }
-
- commandHelp(player);
- }
-
- //Mob
- private void commandMob(Player caller, String[] args)
- {
- if (args.length == 1)
- {
- HashMap entMap = new HashMap();
-
- int count = 0;
- for (World world : UtilServer.getServer().getWorlds())
- {
- for (Entity ent : world.getEntities())
- {
- if (!entMap.containsKey(ent.getType()))
- entMap.put(ent.getType(), 0);
-
- entMap.put(ent.getType(), 1 + entMap.get(ent.getType()));
- count++;
- }
- }
-
- UtilPlayer.message(caller, F.main("Creature", "Listing Entities:"));
- for (EntityType cur : entMap.keySet())
- {
- UtilPlayer.message(caller, F.desc(UtilEnt.getName(cur), entMap.get(cur)+""));
- }
-
- UtilPlayer.message(caller, F.desc("Total", count+""));
- }
- else
- {
- EntityType type = UtilEnt.searchEntity(caller, args[1], true);
-
- if (type == null)
- return;
-
- UtilPlayer.message(caller, F.main("Creature", "Spawning Creature(s);"));
-
- //Store Args
- HashSet argSet = new HashSet();
- for (int i = 2 ; i < args.length ; i++)
- if (args[i].length() > 0)
- argSet.add(args[i]);
-
-
- //Search Count
- int count = 1;
- HashSet argHandle = new HashSet();
- for (String arg : argSet)
- {
- try
- {
- int newCount = Integer.parseInt(arg);
-
- if (newCount <= 0)
- continue;
-
- //Set Count
- count = newCount;
- UtilPlayer.message(caller, F.desc("Amount", count+""));
-
- //Flag Arg
- argHandle.add(arg);
- break;
- }
- catch (Exception e)
- {
- //None
- }
- }
- for (String arg : argHandle)
- argSet.remove(arg);
-
- //Spawn
- HashSet entSet = new HashSet();
- for (int i = 0 ; i < count ; i++)
- {
- CreatureAllowOverride = true;
- entSet.add(Manager.GetCreature().SpawnEntity(caller.getTargetBlock(null, 0).getLocation().add(0.5, 1, 0.5), type));
- CreatureAllowOverride = false;
- }
-
- //Search Vars
- for (String arg : argSet)
- {
- if (arg.length() == 0)
- continue;
-
- //Baby
- else if (arg.equalsIgnoreCase("baby") || arg.equalsIgnoreCase("b"))
- {
- for (Entity ent : entSet)
- {
- if (ent instanceof Ageable)
- ((Ageable)ent).setBaby();
- else if (ent instanceof Zombie)
- ((Zombie)ent).setBaby(true);
- }
-
- UtilPlayer.message(caller, F.desc("Baby", "True"));
- argHandle.add(arg);
- }
-
- //Lock
- else if (arg.equalsIgnoreCase("age") || arg.equalsIgnoreCase("lock"))
- {
- for (Entity ent : entSet)
- if (ent instanceof Ageable)
- {
- ((Ageable)ent).setAgeLock(true);
- UtilPlayer.message(caller, F.desc("Age", "False"));
- }
-
- argHandle.add(arg);
- }
-
- //Angry
- else if (arg.equalsIgnoreCase("angry") || arg.equalsIgnoreCase("a"))
- {
- for (Entity ent : entSet)
- if (ent instanceof Wolf)
- ((Wolf)ent).setAngry(true);
-
- for (Entity ent : entSet)
- if (ent instanceof Skeleton)
- ((Skeleton)ent).setSkeletonType(SkeletonType.WITHER);
-
- UtilPlayer.message(caller, F.desc("Angry", "True"));
- argHandle.add(arg);
- }
-
- //Profession
- else if (arg.toLowerCase().charAt(0) == 'p')
- {
- try
- {
- String prof = arg.substring(1, arg.length());
-
- Profession profession = null;
- for (Profession cur : Profession.values())
- if (cur.name().toLowerCase().contains(prof.toLowerCase()))
- profession = cur;
-
- UtilPlayer.message(caller, F.desc("Profession", profession.name()));
-
- for (Entity ent : entSet)
- if (ent instanceof Villager)
- ((Villager)ent).setProfession(profession);
- }
- catch (Exception e)
- {
- UtilPlayer.message(caller, F.desc("Profession", "Invalid [" + arg + "] on " + type.name()));
- }
- argHandle.add(arg);
- }
-
- //Size
- else if (arg.toLowerCase().charAt(0) == 's')
- {
- try
- {
- String size = arg.substring(1, arg.length());
-
- UtilPlayer.message(caller, F.desc("Size", Integer.parseInt(size)+""));
-
- for (Entity ent : entSet)
- if (ent instanceof Slime)
- ((Slime)ent).setSize(Integer.parseInt(size));
- }
- catch (Exception e)
- {
- UtilPlayer.message(caller, F.desc("Size", "Invalid [" + arg + "] on " + type.name()));
- }
- argHandle.add(arg);
- }
-
- else if (arg.toLowerCase().charAt(0) == 'n' && arg.length() > 1)
- {
- try
- {
- String name = "";
-
- for (char c : arg.substring(1, arg.length()).toCharArray())
- {
- if (c != '_')
- name += c;
- else
- name += " ";
- }
-
- for (Entity ent : entSet)
- {
- if (ent instanceof CraftLivingEntity)
- {
- CraftLivingEntity cEnt = (CraftLivingEntity)ent;
- cEnt.setCustomName(name);
- cEnt.setCustomNameVisible(true);
- }
- }
- }
- catch (Exception e)
- {
- UtilPlayer.message(caller, F.desc("Size", "Invalid [" + arg + "] on " + type.name()));
- }
- argHandle.add(arg);
- }
- }
- for (String arg : argHandle)
- argSet.remove(arg);
-
- for (String arg : argSet)
- UtilPlayer.message(caller, F.desc("Unhandled", arg));
-
- //Inform
- UtilPlayer.message(caller, F.main("Creature", "Spawned " + count + " " + UtilEnt.getName(type) + "."));
- }
- }
-
- private void commandMobKill(Player caller, String[] args)
- {
- if (args.length < 3)
- {
- UtilPlayer.message(caller, F.main("Creature", "Missing Entity Type Parameter."));
- return;
- }
-
- EntityType type = UtilEnt.searchEntity(caller, args[2], true);
-
- if (type == null && !args[2].equalsIgnoreCase("all"))
- return;
-
- int count = 0;
- List killList = new ArrayList();
-
- for (World world : UtilServer.getServer().getWorlds())
- {
- for (Entity ent : world.getEntities())
- {
- if (ent.getType() == EntityType.PLAYER)
- continue;
-
- if (type == null || ent.getType() == type)
- {
- killList.add(ent);
- }
- }
- }
-
- CreatureKillEntitiesEvent event = new CreatureKillEntitiesEvent(killList);
- UtilServer.getServer().getPluginManager().callEvent(event);
-
- for (Entity entity : event.GetEntities())
- {
- entity.remove();
- count++;
- }
-
- String target = "ALL";
- if (type != null)
- target = UtilEnt.getName(type);
-
- UtilPlayer.message(caller, F.main("Creature", "Killed " + target + ". " + count + " Removed."));
- }
-
- private void commandKit(Player caller, String[] args)
- {
- if (args.length >= 2 && args[1].equalsIgnoreCase("apply"))
- {
- for (Player player : UtilServer.getPlayers())
- giveItems(player);
-
- Announce(F.main("Event Settings", F.value("Player Kit", "Applied to Players")));
- return;
- }
-
- if (args.length >= 2 && args[1].equalsIgnoreCase("clear"))
- {
- _kitItems = new ItemStack[6];
- Announce(F.main("Event Settings", F.value("Player Kit", "Cleared Kit")));
- return;
- }
-
- if (args.length >= 2 && args[1].equalsIgnoreCase("set"))
- {
- _kitItems = new ItemStack[6];
-
- for (int i=0 ; i<6 ; i++)
- {
- if (caller.getInventory().getItem(i) != null)
- _kitItems[i] = caller.getInventory().getItem(i).clone();
- else
- _kitItems[i] = null;
- }
-
- Announce(F.main("Event Settings", F.value("Player Kit", "Updated Items")));
- return;
- }
-
- commandHelp(caller);
- }
-
- private void commandEffect(Player caller, String[] args)
- {
- //Clear
- if (args.length >= 3 && args[2].equalsIgnoreCase("clear"))
- {
- //Get Targets
- LinkedList targets = new LinkedList();
-
- if (args[1].equalsIgnoreCase("all"))
- {
- for (Player cur : UtilServer.getPlayers())
- targets.add(cur);
- }
- else
- {
- targets = UtilPlayer.matchOnline(caller, args[1], true);
- if (targets.isEmpty())
- return;
- }
-
- for (Player player : targets)
- {
- //Remove all conditions
- Manager.GetCondition().EndCondition(player, null, null);
-
- //Remove all effects
- player.removePotionEffect(PotionEffectType.ABSORPTION);
- player.removePotionEffect(PotionEffectType.BLINDNESS);
- player.removePotionEffect(PotionEffectType.CONFUSION);
- player.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE);
- player.removePotionEffect(PotionEffectType.FAST_DIGGING);
- player.removePotionEffect(PotionEffectType.FIRE_RESISTANCE);
- player.removePotionEffect(PotionEffectType.HARM);
- player.removePotionEffect(PotionEffectType.HEAL);
- player.removePotionEffect(PotionEffectType.HEALTH_BOOST);
- player.removePotionEffect(PotionEffectType.HUNGER);
- player.removePotionEffect(PotionEffectType.INCREASE_DAMAGE);
- player.removePotionEffect(PotionEffectType.INVISIBILITY);
- player.removePotionEffect(PotionEffectType.JUMP);
- player.removePotionEffect(PotionEffectType.NIGHT_VISION);
- player.removePotionEffect(PotionEffectType.POISON);
- player.removePotionEffect(PotionEffectType.REGENERATION);
- player.removePotionEffect(PotionEffectType.SATURATION);
- player.removePotionEffect(PotionEffectType.SLOW);
- player.removePotionEffect(PotionEffectType.SLOW_DIGGING);
- player.removePotionEffect(PotionEffectType.SPEED);
- player.removePotionEffect(PotionEffectType.WATER_BREATHING);
- player.removePotionEffect(PotionEffectType.WEAKNESS);
- player.removePotionEffect(PotionEffectType.WITHER);
- }
-
- return;
- }
-
- //Apply
- if (args.length >= 5)
- {
- //Get Targets
- LinkedList targets = new LinkedList();
-
- if (args[1].equalsIgnoreCase("all"))
- {
- for (Player cur : UtilServer.getPlayers())
- targets.add(cur);
- }
- else
- {
- targets = UtilPlayer.matchOnline(caller, args[1], true);
- if (targets.isEmpty())
- return;
- }
-
- //Get Type
- PotionEffectType type = PotionEffectType.getByName(args[2]);
- if (type == null)
- {
- UtilPlayer.message(caller, F.main("Effect", "Invalid Effect Type: " + args[2]));
- UtilPlayer.message(caller, F.value("Valid Types", "http://minecraft.gamepedia.com/Status_effect"));
- return;
- }
-
- //Get Multiplier
- int mult = 0;
- try
- {
- mult = Integer.parseInt(args[3]);
-
- if (mult <= 0)
- mult = 0;
- if (mult > 255)
- mult = 255;
- }
- catch (Exception e)
- {
- UtilPlayer.message(caller, F.main("Effect", "Invalid Effect Level: " + args[3]));
- return;
- }
-
- //Get Duration
- int dur = 0;
- try
- {
- dur = Integer.parseInt(args[4]);
-
- if (dur <= 0)
- dur = 0;
- }
- catch (Exception e)
- {
- UtilPlayer.message(caller, F.main("Effect", "Invalid Effect Duration: " + args[4]));
- return;
- }
-
- //Apply
- PotionEffect effect = new PotionEffect(type, dur*20, mult);
- for (Player cur : targets)
- {
- cur.addPotionEffect(effect);
- }
-
- if (args[1].equalsIgnoreCase("all"))
- Announce(F.main("Effect", F.value("Applied Effect", type.getName() + " " + (mult+1) + " for " + dur + "s")));
- else
- UtilPlayer.message(caller, F.main("Effect", "Applied " + type.getName() + " " + (mult+1) + " for " + dur + "s for Targets."));
-
- return;
- }
-
- commandHelp(caller);
- }
-
@EventHandler
public void doubleJumpTrigger(PlayerToggleFlightEvent event)
{
@@ -1685,4 +387,81 @@ public class EventGame extends SoloGame
{
event.getDrops().clear();
}
+
+ public boolean isAllowGadget()
+ {
+ return _allowAllGadgets;
+ }
+
+ public void setAllowGadget(boolean var)
+ {
+ _allowAllGadgets = var;
+ }
+
+ public HashSet getGadgetWhitelist()
+ {
+ return _gadgetWhitelist;
+ }
+
+ public boolean isDoubleJump()
+ {
+ return _doubleJump;
+ }
+
+ public void setDoubleJump(boolean var)
+ {
+ _doubleJump = var;
+ }
+
+ public NautHashMap