Merge remote-tracking branch 'origin/master' into Myst_EVO

This commit is contained in:
Mysticate 2015-08-07 11:58:53 -04:00
commit a9350bfacd
177 changed files with 8919 additions and 3104 deletions

View File

@ -18,6 +18,8 @@
<element id="extracted-dir" path="$PROJECT_DIR$/Libraries/gson-2.2.1.jar" path-in-jar="/" /> <element id="extracted-dir" path="$PROJECT_DIR$/Libraries/gson-2.2.1.jar" path-in-jar="/" />
<element id="module-output" name="Mineplex.Database" /> <element id="module-output" name="Mineplex.Database" />
<element id="extracted-dir" path="$PROJECT_DIR$/Libraries/jooq-3.5.2.jar" path-in-jar="/" /> <element id="extracted-dir" path="$PROJECT_DIR$/Libraries/jooq-3.5.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/Libraries/org-apache-commons-lang.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/Libraries/commons-dbcp2-2.0.1.jar" path-in-jar="/" />
</root> </root>
</artifact> </artifact>
</component> </component>

View File

@ -37,6 +37,7 @@
</codeStyleSettings> </codeStyleSettings>
</value> </value>
</option> </option>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Mineplex" /> <option name="PREFERRED_PROJECT_CODE_STYLE" value="Mineplex" />
</component> </component>
</project> </project>

View File

@ -21,8 +21,34 @@
<profile default="true" name="Default" enabled="false"> <profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" /> <processorPath useClasspath="true" />
</profile> </profile>
<profile default="false" name="Annotation profile for hub" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<processorPath useClasspath="true" />
<module name="hub" />
</profile>
<profile default="false" name="Annotation profile for gameplay" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<processorPath useClasspath="true" />
<module name="gameplay" />
</profile>
<profile default="false" name="Annotation profile for common" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<processorPath useClasspath="true" />
<module name="common" />
</profile>
</annotationProcessing> </annotationProcessing>
<bytecodeTargetLevel target="1.7" /> <bytecodeTargetLevel target="1.7">
<module name="common" target="1.7" />
<module name="gameplay" target="1.7" />
<module name="hub" target="1.7" />
<module name="parent" target="1.7" />
</bytecodeTargetLevel>
</component> </component>
<component name="JavacSettings"> <component name="JavacSettings">
<option name="GENERATE_NO_WARNINGS" value="true" /> <option name="GENERATE_NO_WARNINGS" value="true" />

View File

@ -1,5 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" /> <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false">
</project> <file url="file://$PROJECT_DIR$/ParkerFactions" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ParkerFactions/common" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ParkerFactions/gameplay" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ParkerFactions/hub" charset="UTF-8" />
</component>
</project>

View File

@ -7,6 +7,13 @@
</list> </list>
</component> </component>
<component name="IdProvider" IDEtalkID="7E81636CD93857493DFE224533ECF492" /> <component name="IdProvider" IDEtalkID="7E81636CD93857493DFE224533ECF492" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/ParkerFactions/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>

View File

@ -18,6 +18,10 @@
<module fileurl="file://$PROJECT_DIR$/Mineplex.ServerData/Mineplex.ServerData.iml" filepath="$PROJECT_DIR$/Mineplex.ServerData/Mineplex.ServerData.iml" group="Core" /> <module fileurl="file://$PROJECT_DIR$/Mineplex.ServerData/Mineplex.ServerData.iml" filepath="$PROJECT_DIR$/Mineplex.ServerData/Mineplex.ServerData.iml" group="Core" />
<module fileurl="file://$PROJECT_DIR$/Mineplex.ServerMonitor/Mineplex.ServerMonitor.iml" filepath="$PROJECT_DIR$/Mineplex.ServerMonitor/Mineplex.ServerMonitor.iml" group="Core" /> <module fileurl="file://$PROJECT_DIR$/Mineplex.ServerMonitor/Mineplex.ServerMonitor.iml" filepath="$PROJECT_DIR$/Mineplex.ServerMonitor/Mineplex.ServerMonitor.iml" group="Core" />
<module fileurl="file://$PROJECT_DIR$/Nautilus.Game.Arcade/Nautilus.Game.Arcade.iml" filepath="$PROJECT_DIR$/Nautilus.Game.Arcade/Nautilus.Game.Arcade.iml" group="Game" /> <module fileurl="file://$PROJECT_DIR$/Nautilus.Game.Arcade/Nautilus.Game.Arcade.iml" filepath="$PROJECT_DIR$/Nautilus.Game.Arcade/Nautilus.Game.Arcade.iml" group="Game" />
<module fileurl="file://$PROJECT_DIR$/ParkerFactions/common/common.iml" filepath="$PROJECT_DIR$/ParkerFactions/common/common.iml" />
<module fileurl="file://$PROJECT_DIR$/ParkerFactions/gameplay/gameplay.iml" filepath="$PROJECT_DIR$/ParkerFactions/gameplay/gameplay.iml" />
<module fileurl="file://$PROJECT_DIR$/ParkerFactions/hub/hub.iml" filepath="$PROJECT_DIR$/ParkerFactions/hub/hub.iml" />
<module fileurl="file://$PROJECT_DIR$/ParkerFactions/parent.iml" filepath="$PROJECT_DIR$/ParkerFactions/parent.iml" />
</modules> </modules>
</component> </component>
</project> </project>

View File

@ -39,7 +39,7 @@ public class MotdManager implements Listener, Runnable
if (new File("updateMOTD.dat").exists()) if (new File("updateMOTD.dat").exists())
{ {
List<String> lines = new ArrayList<String>(); List<String> lines = new ArrayList<String>();
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(" §d§lRank Sale §a§l40% Off");
//lines.add(" §f§l◄§c§lMAINTENANCE§f§l►"); //lines.add(" §f§l◄§c§lMAINTENANCE§f§l►");

View File

@ -1,20 +1,20 @@
package mineplex.core.common; package mineplex.core.common;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilPlayer;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilPlayer;
public enum Rank public enum Rank
{ {
LT("LT", ChatColor.DARK_RED), LT("LT", ChatColor.DARK_RED),
OWNER("Owner", ChatColor.DARK_RED), OWNER("Owner", ChatColor.DARK_RED),
DEVELOPER("Dev", ChatColor.RED), DEVELOPER("Dev", ChatColor.RED),
ADMIN("Admin", ChatColor.RED), ADMIN("Admin", ChatColor.RED),
JNR_DEV("Jr.Dev", ChatColor.RED),
SNR_MODERATOR("Sr.Mod", ChatColor.GOLD), SNR_MODERATOR("Sr.Mod", ChatColor.GOLD),
MODERATOR("Mod", ChatColor.GOLD), MODERATOR("Mod", ChatColor.GOLD),
JNR_DEV("Jr.Dev", ChatColor.RED),
HELPER("Trainee", ChatColor.DARK_AQUA), HELPER("Trainee", ChatColor.DARK_AQUA),
MAPLEAD("MapLead", ChatColor.DARK_PURPLE), MAPLEAD("MapLead", ChatColor.DARK_PURPLE),
MAPDEV("Builder", ChatColor.BLUE), MAPDEV("Builder", ChatColor.BLUE),

View File

@ -1,11 +1,23 @@
package mineplex.core.common.util; package mineplex.core.common.util;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
public class UtilAction 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) 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); 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) 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) if (Double.isNaN(vec.getX()) || Double.isNaN(vec.getY()) || Double.isNaN(vec.getZ()) || vec.length() == 0)
{
zeroVelocity(ent);
return; return;
}
//YSet //YSet
if (ySet) if (ySet)
vec.setY(yBase); vec.setY(yBase);
@ -23,20 +38,43 @@ public class UtilAction
//Modify //Modify
vec.normalize(); vec.normalize();
vec.multiply(str); vec.multiply(str);
//YAdd //YAdd
vec.setY(vec.getY() + yAdd); vec.setY(vec.getY() + yAdd);
//Limit //Limit
if (vec.getY() > yMax) if (vec.getY() > yMax)
vec.setY(yMax); vec.setY(yMax);
if (groundBoost) if (groundBoost)
if (UtilEnt.isGrounded(ent)) if (UtilEnt.isGrounded(ent))
vec.setY(vec.getY() + 0.2); vec.setY(vec.getY() + 0.2);
//Velocity //Velocity
ent.setFallDistance(0); 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);
}
} }

View File

@ -7,6 +7,7 @@ import java.util.TreeSet;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -260,4 +261,96 @@ public class UtilAlg
return isInPyramid(player.getLocation().getDirection(), UtilAlg.getTrajectory(player.getEyeLocation(), target.getEyeLocation()), angleLimit) || return isInPyramid(player.getLocation().getDirection(), UtilAlg.getTrajectory(player.getEyeLocation(), target.getEyeLocation()), angleLimit) ||
isInPyramid(player.getLocation().getDirection(), UtilAlg.getTrajectory(player.getEyeLocation(), target.getLocation()), angleLimit); isInPyramid(player.getLocation().getDirection(), UtilAlg.getTrajectory(player.getEyeLocation(), target.getLocation()), angleLimit);
} }
public static Location getLocationAwayFromPlayers(ArrayList<Location> locs, ArrayList<Player> 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<Location> locs, ArrayList<Player> players, ArrayList<Player> 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;
}
} }

View File

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

View File

@ -227,7 +227,7 @@ public class CoreClientManager extends MiniPlugin
Bukkit.getServer().getPluginManager().callEvent(new ClientWebResponseEvent(response, uuid)); Bukkit.getServer().getPluginManager().callEvent(new ClientWebResponseEvent(response, uuid));
if (client.getAccountId() > 0) if (client.getAccountId() > 0)
_accountCacheRepository.addElement(new AccountCache(uuid, client.getAccountId())); _accountCacheRepository.addElement(new AccountCache(uuid, client.getAccountId()), 60 * 60 * 6);
} }
catch (Exception exception) catch (Exception exception)
{ {
@ -301,7 +301,16 @@ public class CoreClientManager extends MiniPlugin
System.out.println(client.GetPlayerName() + "'s account id = " + client.getAccountId()); System.out.println(client.GetPlayerName() + "'s account id = " + client.getAccountId());
if (client.getAccountId() > 0) 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()); return !_clientLoginLock.containsKey(client.GetPlayerName());
} }

View File

@ -19,12 +19,20 @@ public class UpdateRank extends CommandBase<CoreClientManager>
{ {
public UpdateRank(CoreClientManager plugin) public UpdateRank(CoreClientManager plugin)
{ {
super(plugin, Rank.ADMIN, "updateRank"); super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV /*On test servers only*/}, "updateRank");
} }
@Override @Override
public void Execute(final Player caller, String[] args) 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) if (args == null)
{ {
UtilPlayer.message(caller, F.main(Plugin.getName(), "/" + AliasUsed + " joeschmo MODERATOR")); UtilPlayer.message(caller, F.main(Plugin.getName(), "/" + AliasUsed + " joeschmo MODERATOR"));
@ -52,9 +60,9 @@ public class UpdateRank extends CommandBase<CoreClientManager>
final Rank rank = tempRank; 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!")); UtilPlayer.message(caller, F.main(Plugin.getName(), ChatColor.RED + "" + ChatColor.BOLD + "Insufficient privileges!"));
return; return;

View File

@ -56,7 +56,7 @@ public enum Achievement
//Survival Games //Survival Games
SURVIVAL_GAMES_WINS("Katniss Everdeen", 600, SURVIVAL_GAMES_WINS("Katniss Everdeen", 600,
new String[]{"Survival Games.Wins"}, new String[]{"Survival Games.Wins"},
new String[]{"Win 30 games of Survival Games"}, new String[]{"Win 20 games of Survival Games"},
new int[]{30}, new int[]{30},
AchievementCategory.SURVIVAL_GAMES), AchievementCategory.SURVIVAL_GAMES),
@ -87,8 +87,8 @@ public enum Achievement
//Skywars //Skywars
SKYWARS_WINS("Sky King",2000, SKYWARS_WINS("Sky King",2000,
new String[]{"Skywars.Wins"}, new String[]{"Skywars.Wins"},
new String[]{"Win 30 Games of Skywars"}, new String[]{"Win 20 Games of Skywars"},
new int[]{30}, new int[]{20},
AchievementCategory.SKYWARS), AchievementCategory.SKYWARS),
SKYWARS_BOMBER("Master Bomber",500, SKYWARS_BOMBER("Master Bomber",500,
@ -643,39 +643,31 @@ public enum Achievement
new String[]{"Throw 2000 TNT"}, new String[]{"Throw 2000 TNT"},
new int[]{2000}, new int[]{2000},
AchievementCategory.BOMB_LOBBERS), 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, BOMB_LOBBERS_ULTIMATE_KILLER("Ultimate Killer", 800,
new String[]{"Bomb Lobbers.Killer"}, new String[]{"Bomb Lobbers.Killer"},
new String[]{"Kill 6 players in a single game"}, new String[]{"Kill 6 players in a single game"},
new int[]{1}, new int[]{1},
AchievementCategory.BOMB_LOBBERS), AchievementCategory.BOMB_LOBBERS),
BOMB_LOBBERS_EXPLOSION_PROOF("Jelly Skin", 1000, BOMB_LOBBERS_EXPLOSION_PROOF("Jelly Skin", 1200,
new String[]{"Bomb Lobbers.JellySkin"}, new String[]{"Bomb Lobbers.JellySkin"},
new String[]{"Win a game without taking any damage."}, new String[]{"Win a game without taking any damage."},
new int[]{1}, new int[]{1},
AchievementCategory.BOMB_LOBBERS), 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, BOMB_LOBBERS_BLAST_PROOF("Blast Proof", 800,
new String[]{"Bomb Lobbers.BlastProof"}, new String[]{"Bomb Lobbers.BlastProof"},
new String[]{"Win 20 games using Armorer"}, new String[]{"Win 20 games using Armorer"},
new int[]{20}, 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; private String _name;

View File

@ -208,18 +208,22 @@ public class AchievementManager extends MiniPlugin
{ {
int level = get(sender, Achievement.GLOBAL_MINEPLEX_LEVEL).getLevel(); 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")) if (sender.getName().equalsIgnoreCase("Phinary"))
level = -level; 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; return level;
} }

View File

@ -17,6 +17,7 @@ import mineplex.core.cosmetic.ui.button.ActivateGadgetButton;
import mineplex.core.cosmetic.ui.button.DeactivateGadgetButton; import mineplex.core.cosmetic.ui.button.DeactivateGadgetButton;
import mineplex.core.cosmetic.ui.button.GadgetButton; import mineplex.core.cosmetic.ui.button.GadgetButton;
import mineplex.core.donation.DonationManager; import mineplex.core.donation.DonationManager;
import mineplex.core.gadget.gadgets.MorphBlock;
import mineplex.core.gadget.gadgets.MorphNotch; import mineplex.core.gadget.gadgets.MorphNotch;
import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.Gadget;
import mineplex.core.gadget.types.GadgetType; import mineplex.core.gadget.types.GadgetType;
@ -68,6 +69,13 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
//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)); //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; //return;
} }
else if (gadget instanceof MorphBlock)
{
//Prevent stacker bug
if (getPlayer().getPassenger() != null)
return;
}
List<String> itemLore = new ArrayList<String>(); List<String> itemLore = new ArrayList<String>();
if (gadget.GetCost(CurrencyType.Coins) >= 0) if (gadget.GetCost(CurrencyType.Coins) >= 0)

View File

@ -6,12 +6,14 @@ import java.util.List;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerToggleSneakEvent;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.MiniPlugin; import mineplex.core.MiniPlugin;
@ -430,4 +432,16 @@ public class GadgetManager extends MiniPlugin
return true; 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);
}
}
}
} }

View File

@ -170,7 +170,7 @@ public class MorphWither extends MorphGadget
player.setFlying(true); player.setFlying(true);
if (UtilEnt.isGrounded(player)) 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);
} }
} }

View File

@ -51,7 +51,7 @@ public enum GameDisplay
SquidShooter("Squid Shooter", Material.FIREWORK_CHARGE, (byte)0, GameCategory.ARCADE, 43), SquidShooter("Squid Shooter", Material.FIREWORK_CHARGE, (byte)0, GameCategory.ARCADE, 43),
Stacker("Super Stacker", Material.BOWL, (byte)0, GameCategory.ARCADE, 42), Stacker("Super Stacker", Material.BOWL, (byte)0, GameCategory.ARCADE, 42),
SurvivalGames("Survival Games", Material.IRON_SWORD, (byte)0, GameCategory.SURVIVAL, 22), 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), Tug("Tug of Wool", Material.WHEAT, (byte)0, GameCategory.ARCADE, 44),
TurfWars("Turf Wars", Material.STAINED_CLAY, (byte)14, GameCategory.ARCADE, 45), TurfWars("Turf Wars", Material.STAINED_CLAY, (byte)14, GameCategory.ARCADE, 45),
UHC("Ultra Hardcore", Material.GOLDEN_APPLE, (byte)0, GameCategory.SURVIVAL, 46), 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), Build("Master Builders", Material.WOOD, (byte)0, GameCategory.CLASSICS, 50),
Cards("Craft Against Humanity", Material.MAP, (byte)0, GameCategory.CLASSICS, 51), 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); Event("Mineplex Event", Material.CAKE, (byte)0, GameCategory.EVENT, 999);

View File

@ -52,7 +52,6 @@ public class MountSheep extends HorseMount
DisguiseSheep disguise = new DisguiseSheep(horse); DisguiseSheep disguise = new DisguiseSheep(horse);
disguise.setName(player.getName(), Manager.getClientManager().Get(player).GetRank()); disguise.setName(player.getName(), Manager.getClientManager().Get(player).GetRank());
disguise.setCustomNameVisible(true);
//disguise.setColor(DyeColor.getByColor(org.bukkit.Color.fromRGB(100, 0, 200))); //disguise.setColor(DyeColor.getByColor(org.bukkit.Color.fromRGB(100, 0, 200)));
Manager.getDisguiseManager().disguise(disguise); Manager.getDisguiseManager().disguise(disguise);

View File

@ -48,7 +48,6 @@ public class MountSlime extends Mount<Slime>
mount.setSize(2); mount.setSize(2);
mount.setCustomName(player.getName() + "'s " + GetName()); mount.setCustomName(player.getName() + "'s " + GetName());
mount.setCustomNameVisible(true);
//Inform //Inform
UtilPlayer.message(player, F.main("Mount", "You spawned " + F.elem(GetName()) + ".")); UtilPlayer.message(player, F.main("Mount", "You spawned " + F.elem(GetName()) + "."));

View File

@ -45,8 +45,8 @@ public class NotificationManager extends MiniPlugin
// if (event.getType() == UpdateType.MIN_08) // if (event.getType() == UpdateType.MIN_08)
// hugeSale(); // hugeSale();
if (event.getType() == UpdateType.MIN_16) // if (event.getType() == UpdateType.MIN_16)
sale(); // sale();
} }
private void sale() private void sale()

View File

@ -484,7 +484,7 @@ public class NpcManager extends MiniPlugin
String serverType = getServerName(); String serverType = getServerName();
try (Connection connection = DBPool.ACCOUNT.getConnection()) try (Connection connection = DBPool.ACCOUNT.getConnection())
{ {
Result<NpcsRecord> result = DSL.using(connection) Result<NpcsRecord> result = DSL.using(connection)
.selectFrom(Tables.npcs) .selectFrom(Tables.npcs)
.where(Tables.npcs.server.eq(serverType)) .where(Tables.npcs.server.eq(serverType))

View File

@ -12,7 +12,7 @@ public class HomeCommand extends CommandBase<NpcManager>
{ {
public HomeCommand(NpcManager plugin) public HomeCommand(NpcManager plugin)
{ {
super(plugin, Rank.DEVELOPER, "home"); super(plugin, Rank.DEVELOPER, new Rank[] {Rank.JNR_DEV}, "home");
} }
@Override @Override

View File

@ -10,7 +10,7 @@ public class NpcCommand extends MultiCommandBase<NpcManager>
{ {
public NpcCommand(NpcManager plugin) 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 AddCommand(plugin));
AddCommand(new DeleteCommand(plugin)); AddCommand(new DeleteCommand(plugin));

View File

@ -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, 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() getPlugin().getServer().getScheduler().runTaskAsynchronously(getPlugin(), new Runnable()
{ {

View File

@ -14,7 +14,7 @@ public class SendCommand extends CommandBase<Portal>
{ {
public SendCommand(Portal plugin) public SendCommand(Portal plugin)
{ {
super(plugin, Rank.ADMIN, "send"); super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "send");
} }
@Override @Override

View File

@ -261,7 +261,7 @@ public class PreferencesPage extends ShopPageBase<PreferencesManager, Preference
buildPreference(42, Material.SLIME_BALL, "Hub Forcefield", userPreferences.HubForcefield, _toggleHubForcefield); buildPreference(42, Material.SLIME_BALL, "Hub Forcefield", userPreferences.HubForcefield, _toggleHubForcefield);
buildPreference(44, Material.SADDLE, "Hub Ignore Velocity", userPreferences.IgnoreVelocity, _toggleHubIgnoreVelocity); buildPreference(44, Material.SADDLE, "Hub Ignore Velocity", userPreferences.IgnoreVelocity, _toggleHubIgnoreVelocity);
} }
if (getClientManager().Get(getPlayer()).GetRank().Has(Rank.ADMIN)) if (getClientManager().Get(getPlayer()).GetRank().Has(Rank.ADMIN) || getClientManager().Get(getPlayer()).GetRank() == Rank.JNR_DEV)
{ {
buildPreference(36, Material.NETHER_STAR, "Hub Invisibility", userPreferences.Invisibility, _toggleHubInvisibility); buildPreference(36, Material.NETHER_STAR, "Hub Invisibility", userPreferences.Invisibility, _toggleHubInvisibility);
buildPreference(38, Material.SLIME_BALL, "Hub Forcefield", userPreferences.HubForcefield, _toggleHubForcefield); buildPreference(38, Material.SLIME_BALL, "Hub Forcefield", userPreferences.HubForcefield, _toggleHubForcefield);

View File

@ -7,6 +7,19 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map.Entry; import java.util.Map.Entry;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftInventoryCustom;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.inventory.ItemStack;
import mineplex.core.antihack.AntiHack; import mineplex.core.antihack.AntiHack;
import mineplex.core.common.Rank; import mineplex.core.common.Rank;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
@ -23,18 +36,6 @@ import mineplex.core.punish.PunishmentSorter;
import mineplex.core.shop.item.IButton; import mineplex.core.shop.item.IButton;
import mineplex.core.shop.item.ShopItem; import mineplex.core.shop.item.ShopItem;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftInventoryCustom;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.inventory.ItemStack;
public class PunishPage extends CraftInventoryCustom implements Listener public class PunishPage extends CraftInventoryCustom implements Listener
{ {
private Punish _plugin; private Punish _plugin;
@ -232,14 +233,12 @@ public class PunishPage extends CraftInventoryCustom implements Listener
examplePrefixEx + " Forcefield", examplePrefixEx + " Forcefield",
examplePrefixEx + " Speed Hack", examplePrefixEx + " Speed Hack",
examplePrefixEx + " Reach Hack", examplePrefixEx + " Reach Hack",
examplePrefixEx + " Speed Hack",
examplePrefixEx + " Other Hack", examplePrefixEx + " Other Hack",
" ", " ",
examplePrefix + "Hack Reports (SR & FR);", examplePrefix + "Hack Reports (SR & FR);",
examplePrefixEx + " Forcefield", examplePrefixEx + " Forcefield",
examplePrefixEx + " Speed Hack", examplePrefixEx + " Speed Hack",
examplePrefixEx + " Reach Hack", examplePrefixEx + " Reach Hack",
examplePrefixEx + " Speed Hack",
examplePrefixEx + " Other Hack", examplePrefixEx + " Other Hack",
examplePrefixEx + " Fly Hack", examplePrefixEx + " Fly Hack",
} }
@ -294,6 +293,20 @@ public class PunishPage extends CraftInventoryCustom implements Listener
}, 1, false, true), new PunishButton(this, Category.ChatOffense, 4, false, -1)); }, 1, false, true), new PunishButton(this, Category.ChatOffense, 4, false, -1));
} }
if (_plugin.GetClients().Get(_player).GetRank() == Rank.DEVELOPER || _plugin.GetClients().Get(_player).GetRank() == Rank.JNR_DEV)
{
ShopItem devWarning = new ShopItem(Material.YELLOW_FLOWER, "DEV WARNING", new String[] {ChatColor.RESET + "Developers are advised against using the punish system", ChatColor.RESET + "unless permitted by LT"}, 1, true, true);
devWarning.addGlow();
AddButton(0, devWarning, new IButton()
{
@Override
public void onClick(Player player, ClickType clickType)
{
}
});
}
Collections.sort(punishments, new PunishmentSorter()); Collections.sort(punishments, new PunishmentSorter());
int slot = 45; int slot = 45;

View File

@ -1,6 +1,7 @@
package mineplex.core.recharge; package mineplex.core.recharge;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList; import java.util.LinkedList;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -218,6 +219,26 @@ public class Recharge extends MiniPlugin
{ {
_recharge.put(player.getName(), new NautHashMap<String, RechargeData>()); _recharge.put(player.getName(), new NautHashMap<String, RechargeData>());
} }
public void Reset(Player player, String stringContains)
{
NautHashMap<String, RechargeData> data = _recharge.get(player.getName());
if (data == null)
return;
Iterator<String> 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) public void debug(Player player, String ability)
{ {

View File

@ -87,23 +87,10 @@ public abstract class ShopBase<PluginType extends MiniPlugin> implements Listene
private boolean attemptShopOpen(Player player, LivingEntity entity) 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 (entity.isCustomNameVisible() && entity.getCustomName() != null && ChatColor.stripColor(entity.getCustomName()).equalsIgnoreCase(ChatColor.stripColor(_name)))
{ {
if (!canOpenShop(player)) return attemptShopOpen(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;
}
return false; return false;
} }

View File

@ -18,6 +18,7 @@ import org.jooq.impl.DSL;
import mineplex.core.account.ILoginProcessor; import mineplex.core.account.ILoginProcessor;
import mineplex.core.database.DBPool; import mineplex.core.database.DBPool;
import mineplex.database.Tables; import mineplex.database.Tables;
import org.jooq.types.ULong;
public class SecondaryStatHandler implements ILoginProcessor public class SecondaryStatHandler implements ILoginProcessor
{ {
@ -58,7 +59,7 @@ public class SecondaryStatHandler implements ILoginProcessor
.insertInto(Tables.accountStat) .insertInto(Tables.accountStat)
.set(Tables.accountStat.accountId, accountId) .set(Tables.accountStat.accountId, accountId)
.set(Tables.accountStat.statId, statId) .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); inserts.add(insert);
} }
@ -99,13 +100,13 @@ public class SecondaryStatHandler implements ILoginProcessor
.insertInto(Tables.accountStat) .insertInto(Tables.accountStat)
.set(Tables.accountStat.accountId, accountId) .set(Tables.accountStat.accountId, accountId)
.set(Tables.accountStat.statId, statId) .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); inserts.add(insert);
Update update = context Update update = context
.update(Tables.accountStat) .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)) .where(Tables.accountStat.accountId.eq(accountId))
.and(Tables.accountStat.statId.eq(statId)); .and(Tables.accountStat.statId.eq(statId));

View File

@ -22,6 +22,7 @@ import org.jooq.Result;
import org.jooq.SQLDialect; import org.jooq.SQLDialect;
import org.jooq.Update; import org.jooq.Update;
import org.jooq.impl.DSL; import org.jooq.impl.DSL;
import org.jooq.types.ULong;
public class StatsRepository extends RepositoryBase public class StatsRepository extends RepositoryBase
{ {
@ -102,7 +103,7 @@ public class StatsRepository extends RepositoryBase
.insertInto(Tables.accountStat) .insertInto(Tables.accountStat)
.set(Tables.accountStat.accountId, accountId) .set(Tables.accountStat.accountId, accountId)
.set(Tables.accountStat.statId, statId) .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); inserts.add(insert);
} }
@ -137,7 +138,7 @@ public class StatsRepository extends RepositoryBase
context = DSL.using(getConnectionPool(), SQLDialect.MYSQL); context = DSL.using(getConnectionPool(), SQLDialect.MYSQL);
} }
Result<Record2<String, Long>> result = context.select(Tables.stats.name, Tables.accountStat.value).from(Tables.accountStat) Result<Record2<String, ULong>> result = context.select(Tables.stats.name, Tables.accountStat.value).from(Tables.accountStat)
.join(Tables.stats) .join(Tables.stats)
.on(Tables.stats.id.eq(Tables.accountStat.statId)) .on(Tables.stats.id.eq(Tables.accountStat.statId))
.where(Tables.accountStat.accountId.eq(DSL.select(Tables.accounts.id) .where(Tables.accountStat.accountId.eq(DSL.select(Tables.accounts.id)
@ -149,9 +150,9 @@ public class StatsRepository extends RepositoryBase
if (result.isNotEmpty()) if (result.isNotEmpty())
{ {
playerStats = new PlayerStats(); playerStats = new PlayerStats();
for (Record2<String, Long> record : result) for (Record2<String, ULong> record : result)
{ {
playerStats.addStat(record.value1(), record.value2()); playerStats.addStat(record.value1(), record.value2().longValue());
} }
} }

View File

@ -71,7 +71,7 @@ public class TimeCommand extends CommandBase<StatsManager>
else else
{ {
long time = Plugin.Get(target).getStat("Global.TimeInGame"); 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"));
} }
} }
} }

View File

@ -116,10 +116,8 @@ public class ServerStatusManager extends MiniPlugin
if (event.getType() != UpdateType.FASTER) if (event.getType() != UpdateType.FASTER)
return; return;
if (!_enabled) if (_enabled)
return; saveServerStatus();
saveServerStatus();
} }
/** /**
@ -139,19 +137,6 @@ public class ServerStatusManager extends MiniPlugin
if (server != null && !server.getPublicAddress().equalsIgnoreCase(serverSnapshot.getPublicAddress())) if (server != null && !server.getPublicAddress().equalsIgnoreCase(serverSnapshot.getPublicAddress()))
{ {
timeout = -DEFAULT_SERVER_TIMEOUT; timeout = -DEFAULT_SERVER_TIMEOUT;
/*
ProcessRunner pr = new ProcessRunner(new String[] {"/bin/sh", "/home/mineplex/config/killServer.sh", serverSnapshot.getName()});
pr.start(new GenericRunnable<Boolean>()
{
public void run(Boolean error)
{
if (error)
log("Error Killing myself.");
else
log("It worked.");
}
});
*/
} }
_repository.updataServerStatus(serverSnapshot, timeout); _repository.updataServerStatus(serverSnapshot, timeout);

View File

@ -20,6 +20,7 @@ import mineplex.core.common.jsonchat.JsonMessage;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilWorld; import mineplex.core.common.util.UtilWorld;
@ -285,7 +286,7 @@ public class Teleport extends MiniPlugin
} }
player.setFallDistance(0); 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); player.teleport(loc);
} }

View File

@ -10,7 +10,7 @@ public class HereCommand extends CommandBase<Teleport>
{ {
public HereCommand(Teleport plugin) public HereCommand(Teleport plugin)
{ {
super(plugin, Rank.ADMIN, "here", "h"); super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "here", "h");
} }
@Override @Override

View File

@ -327,6 +327,11 @@ public class TreasureLocation implements Listener
_hologram.start(); _hologram.start();
} }
public Treasure getCurrentTreasure()
{
return _currentTreasure;
}
public void openShop(Player player) public void openShop(Player player)
{ {
_shop.attemptShopOpen(player); _shop.attemptShopOpen(player);

View File

@ -125,6 +125,22 @@ public class TreasureManager extends MiniPlugin
return _rewardManager.getRewards(player, rewardType); 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() public BlockRestore getBlockRestore()
{ {
return _blockRestore; return _blockRestore;

View File

@ -15,7 +15,7 @@ public class RestartServerCommand extends CommandBase<FileUpdater>
{ {
public RestartServerCommand(FileUpdater plugin) public RestartServerCommand(FileUpdater plugin)
{ {
super(plugin, Rank.ADMIN, "restart"); super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "restart");
} }
@Override @Override

View File

@ -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<Player, Vector> _velocityData = new NautHashMap<Player,Vector>();
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<Player> keyIter = _velocityData.keySet().iterator();
while (keyIter.hasNext())
{
Player player = keyIter.next();
if (player.isOnline())
keyIter.remove();
}
}
}

View File

@ -16,7 +16,7 @@ package mineplex.database;
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" }) @java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Account extends org.jooq.impl.SchemaImpl implements java.io.Serializable, java.lang.Cloneable { 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 <code>Account</code> * The reference instance of <code>Account</code>
@ -54,6 +54,7 @@ public class Account extends org.jooq.impl.SchemaImpl implements java.io.Seriali
mineplex.database.tables.AccountTransactions.accountTransactions, mineplex.database.tables.AccountTransactions.accountTransactions,
mineplex.database.tables.ActiveTournaments.activeTournaments, mineplex.database.tables.ActiveTournaments.activeTournaments,
mineplex.database.tables.Bonus.bonus, mineplex.database.tables.Bonus.bonus,
mineplex.database.tables.Chatsnap.chatsnap,
mineplex.database.tables.ClanAlliances.clanAlliances, mineplex.database.tables.ClanAlliances.clanAlliances,
mineplex.database.tables.ClanEnemies.clanEnemies, mineplex.database.tables.ClanEnemies.clanEnemies,
mineplex.database.tables.ClanMember.clanMember, mineplex.database.tables.ClanMember.clanMember,

View File

@ -34,6 +34,7 @@ public class Keys {
public static final org.jooq.Identity<mineplex.database.tables.records.AccountTasksRecord, java.lang.Integer> IDENTITY_accountTasks = Identities0.IDENTITY_accountTasks; public static final org.jooq.Identity<mineplex.database.tables.records.AccountTasksRecord, java.lang.Integer> IDENTITY_accountTasks = Identities0.IDENTITY_accountTasks;
public static final org.jooq.Identity<mineplex.database.tables.records.AccountTransactionsRecord, java.lang.Integer> IDENTITY_accountTransactions = Identities0.IDENTITY_accountTransactions; public static final org.jooq.Identity<mineplex.database.tables.records.AccountTransactionsRecord, java.lang.Integer> IDENTITY_accountTransactions = Identities0.IDENTITY_accountTransactions;
public static final org.jooq.Identity<mineplex.database.tables.records.BonusRecord, java.lang.Integer> IDENTITY_bonus = Identities0.IDENTITY_bonus; public static final org.jooq.Identity<mineplex.database.tables.records.BonusRecord, java.lang.Integer> IDENTITY_bonus = Identities0.IDENTITY_bonus;
public static final org.jooq.Identity<mineplex.database.tables.records.ChatsnapRecord, java.lang.Integer> IDENTITY_chatsnap = Identities0.IDENTITY_chatsnap;
public static final org.jooq.Identity<mineplex.database.tables.records.ClanAlliancesRecord, java.lang.Integer> IDENTITY_clanAlliances = Identities0.IDENTITY_clanAlliances; public static final org.jooq.Identity<mineplex.database.tables.records.ClanAlliancesRecord, java.lang.Integer> IDENTITY_clanAlliances = Identities0.IDENTITY_clanAlliances;
public static final org.jooq.Identity<mineplex.database.tables.records.ClanEnemiesRecord, java.lang.Integer> IDENTITY_clanEnemies = Identities0.IDENTITY_clanEnemies; public static final org.jooq.Identity<mineplex.database.tables.records.ClanEnemiesRecord, java.lang.Integer> IDENTITY_clanEnemies = Identities0.IDENTITY_clanEnemies;
public static final org.jooq.Identity<mineplex.database.tables.records.ClansRecord, java.lang.Integer> IDENTITY_clans = Identities0.IDENTITY_clans; public static final org.jooq.Identity<mineplex.database.tables.records.ClansRecord, java.lang.Integer> IDENTITY_clans = Identities0.IDENTITY_clans;
@ -83,6 +84,7 @@ public class Keys {
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountTransactionsRecord> KEY_accountTransactions_PRIMARY = UniqueKeys0.KEY_accountTransactions_PRIMARY; public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountTransactionsRecord> KEY_accountTransactions_PRIMARY = UniqueKeys0.KEY_accountTransactions_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.ActiveTournamentsRecord> KEY_activeTournaments_PRIMARY = UniqueKeys0.KEY_activeTournaments_PRIMARY; public static final org.jooq.UniqueKey<mineplex.database.tables.records.ActiveTournamentsRecord> KEY_activeTournaments_PRIMARY = UniqueKeys0.KEY_activeTournaments_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.BonusRecord> KEY_bonus_PRIMARY = UniqueKeys0.KEY_bonus_PRIMARY; public static final org.jooq.UniqueKey<mineplex.database.tables.records.BonusRecord> KEY_bonus_PRIMARY = UniqueKeys0.KEY_bonus_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.ChatsnapRecord> KEY_chatsnap_PRIMARY = UniqueKeys0.KEY_chatsnap_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.ClanAlliancesRecord> KEY_clanAlliances_PRIMARY = UniqueKeys0.KEY_clanAlliances_PRIMARY; public static final org.jooq.UniqueKey<mineplex.database.tables.records.ClanAlliancesRecord> KEY_clanAlliances_PRIMARY = UniqueKeys0.KEY_clanAlliances_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.ClanEnemiesRecord> KEY_clanEnemies_PRIMARY = UniqueKeys0.KEY_clanEnemies_PRIMARY; public static final org.jooq.UniqueKey<mineplex.database.tables.records.ClanEnemiesRecord> KEY_clanEnemies_PRIMARY = UniqueKeys0.KEY_clanEnemies_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.ClanEnemiesRecord> KEY_clanEnemies_unique_clanId = UniqueKeys0.KEY_clanEnemies_unique_clanId; public static final org.jooq.UniqueKey<mineplex.database.tables.records.ClanEnemiesRecord> KEY_clanEnemies_unique_clanId = UniqueKeys0.KEY_clanEnemies_unique_clanId;
@ -175,6 +177,7 @@ public class Keys {
public static org.jooq.Identity<mineplex.database.tables.records.AccountTasksRecord, java.lang.Integer> IDENTITY_accountTasks = createIdentity(mineplex.database.tables.AccountTasks.accountTasks, mineplex.database.tables.AccountTasks.accountTasks.id); public static org.jooq.Identity<mineplex.database.tables.records.AccountTasksRecord, java.lang.Integer> IDENTITY_accountTasks = createIdentity(mineplex.database.tables.AccountTasks.accountTasks, mineplex.database.tables.AccountTasks.accountTasks.id);
public static org.jooq.Identity<mineplex.database.tables.records.AccountTransactionsRecord, java.lang.Integer> IDENTITY_accountTransactions = createIdentity(mineplex.database.tables.AccountTransactions.accountTransactions, mineplex.database.tables.AccountTransactions.accountTransactions.id); public static org.jooq.Identity<mineplex.database.tables.records.AccountTransactionsRecord, java.lang.Integer> IDENTITY_accountTransactions = createIdentity(mineplex.database.tables.AccountTransactions.accountTransactions, mineplex.database.tables.AccountTransactions.accountTransactions.id);
public static org.jooq.Identity<mineplex.database.tables.records.BonusRecord, java.lang.Integer> IDENTITY_bonus = createIdentity(mineplex.database.tables.Bonus.bonus, mineplex.database.tables.Bonus.bonus.accountId); public static org.jooq.Identity<mineplex.database.tables.records.BonusRecord, java.lang.Integer> IDENTITY_bonus = createIdentity(mineplex.database.tables.Bonus.bonus, mineplex.database.tables.Bonus.bonus.accountId);
public static org.jooq.Identity<mineplex.database.tables.records.ChatsnapRecord, java.lang.Integer> IDENTITY_chatsnap = createIdentity(mineplex.database.tables.Chatsnap.chatsnap, mineplex.database.tables.Chatsnap.chatsnap.id);
public static org.jooq.Identity<mineplex.database.tables.records.ClanAlliancesRecord, java.lang.Integer> IDENTITY_clanAlliances = createIdentity(mineplex.database.tables.ClanAlliances.clanAlliances, mineplex.database.tables.ClanAlliances.clanAlliances.id); public static org.jooq.Identity<mineplex.database.tables.records.ClanAlliancesRecord, java.lang.Integer> IDENTITY_clanAlliances = createIdentity(mineplex.database.tables.ClanAlliances.clanAlliances, mineplex.database.tables.ClanAlliances.clanAlliances.id);
public static org.jooq.Identity<mineplex.database.tables.records.ClanEnemiesRecord, java.lang.Integer> IDENTITY_clanEnemies = createIdentity(mineplex.database.tables.ClanEnemies.clanEnemies, mineplex.database.tables.ClanEnemies.clanEnemies.id); public static org.jooq.Identity<mineplex.database.tables.records.ClanEnemiesRecord, java.lang.Integer> IDENTITY_clanEnemies = createIdentity(mineplex.database.tables.ClanEnemies.clanEnemies, mineplex.database.tables.ClanEnemies.clanEnemies.id);
public static org.jooq.Identity<mineplex.database.tables.records.ClansRecord, java.lang.Integer> IDENTITY_clans = createIdentity(mineplex.database.tables.Clans.clans, mineplex.database.tables.Clans.clans.id); public static org.jooq.Identity<mineplex.database.tables.records.ClansRecord, java.lang.Integer> 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<mineplex.database.tables.records.AccountTransactionsRecord> KEY_accountTransactions_PRIMARY = createUniqueKey(mineplex.database.tables.AccountTransactions.accountTransactions, mineplex.database.tables.AccountTransactions.accountTransactions.id); public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountTransactionsRecord> KEY_accountTransactions_PRIMARY = createUniqueKey(mineplex.database.tables.AccountTransactions.accountTransactions, mineplex.database.tables.AccountTransactions.accountTransactions.id);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.ActiveTournamentsRecord> KEY_activeTournaments_PRIMARY = createUniqueKey(mineplex.database.tables.ActiveTournaments.activeTournaments, mineplex.database.tables.ActiveTournaments.activeTournaments.name); public static final org.jooq.UniqueKey<mineplex.database.tables.records.ActiveTournamentsRecord> KEY_activeTournaments_PRIMARY = createUniqueKey(mineplex.database.tables.ActiveTournaments.activeTournaments, mineplex.database.tables.ActiveTournaments.activeTournaments.name);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.BonusRecord> KEY_bonus_PRIMARY = createUniqueKey(mineplex.database.tables.Bonus.bonus, mineplex.database.tables.Bonus.bonus.accountId); public static final org.jooq.UniqueKey<mineplex.database.tables.records.BonusRecord> KEY_bonus_PRIMARY = createUniqueKey(mineplex.database.tables.Bonus.bonus, mineplex.database.tables.Bonus.bonus.accountId);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.ChatsnapRecord> KEY_chatsnap_PRIMARY = createUniqueKey(mineplex.database.tables.Chatsnap.chatsnap, mineplex.database.tables.Chatsnap.chatsnap.id);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.ClanAlliancesRecord> KEY_clanAlliances_PRIMARY = createUniqueKey(mineplex.database.tables.ClanAlliances.clanAlliances, mineplex.database.tables.ClanAlliances.clanAlliances.id); public static final org.jooq.UniqueKey<mineplex.database.tables.records.ClanAlliancesRecord> KEY_clanAlliances_PRIMARY = createUniqueKey(mineplex.database.tables.ClanAlliances.clanAlliances, mineplex.database.tables.ClanAlliances.clanAlliances.id);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.ClanEnemiesRecord> KEY_clanEnemies_PRIMARY = createUniqueKey(mineplex.database.tables.ClanEnemies.clanEnemies, mineplex.database.tables.ClanEnemies.clanEnemies.id); public static final org.jooq.UniqueKey<mineplex.database.tables.records.ClanEnemiesRecord> KEY_clanEnemies_PRIMARY = createUniqueKey(mineplex.database.tables.ClanEnemies.clanEnemies, mineplex.database.tables.ClanEnemies.clanEnemies.id);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.ClanEnemiesRecord> KEY_clanEnemies_unique_clanId = createUniqueKey(mineplex.database.tables.ClanEnemies.clanEnemies, mineplex.database.tables.ClanEnemies.clanEnemies.clanId); public static final org.jooq.UniqueKey<mineplex.database.tables.records.ClanEnemiesRecord> KEY_clanEnemies_unique_clanId = createUniqueKey(mineplex.database.tables.ClanEnemies.clanEnemies, mineplex.database.tables.ClanEnemies.clanEnemies.clanId);

View File

@ -54,6 +54,19 @@ public class Routines {
return p; return p;
} }
/**
* Call <code>Account.check_vote</code>
*/
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 <code>Account.createLeaderboard</code> * Call <code>Account.createLeaderboard</code>
*/ */

View File

@ -91,6 +91,11 @@ public class Tables {
*/ */
public static final mineplex.database.tables.Bonus bonus = mineplex.database.tables.Bonus.bonus; 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 * The table Account.clanAlliances
*/ */

View File

@ -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<java.lang.Void> implements java.io.Serializable, java.lang.Cloneable {
private static final long serialVersionUID = 2035299030;
/**
* The parameter <code>Account.check_vote.accountId_in</code>.
*/
public static final org.jooq.Parameter<java.lang.Integer> accountId_in = createParameter("accountId_in", org.jooq.impl.SQLDataType.INTEGER, false);
/**
* The parameter <code>Account.check_vote.coinsChange</code>.
*/
public static final org.jooq.Parameter<java.lang.Integer> coinsChange = createParameter("coinsChange", org.jooq.impl.SQLDataType.INTEGER, false);
/**
* The parameter <code>Account.check_vote.gemsChange</code>.
*/
public static final org.jooq.Parameter<java.lang.Integer> gemsChange = createParameter("gemsChange", org.jooq.impl.SQLDataType.INTEGER, false);
/**
* The parameter <code>Account.check_vote.pass</code>.
*/
public static final org.jooq.Parameter<java.lang.Byte> pass = createParameter("pass", org.jooq.impl.SQLDataType.TINYINT, false);
/**
* The parameter <code>Account.check_vote.outTime</code>.
*/
public static final org.jooq.Parameter<java.sql.Date> 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 <code>accountId_in</code> 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 <code>coinsChange</code> parameter IN value to the routine
*/
public void setCoinsChange(java.lang.Integer value) {
setValue(mineplex.database.routines.Check_vote.coinsChange, value);
}
/**
* Set the <code>gemsChange</code> parameter IN value to the routine
*/
public void setGemsChange(java.lang.Integer value) {
setValue(mineplex.database.routines.Check_vote.gemsChange, value);
}
/**
* Get the <code>pass</code> parameter OUT value from the routine
*/
public java.lang.Byte getPass() {
return getValue(pass);
}
/**
* Get the <code>outTime</code> parameter OUT value from the routine
*/
public java.sql.Date getOutTime() {
return getValue(outTime);
}
}

View File

@ -16,7 +16,7 @@ package mineplex.database.tables;
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" }) @java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class AccountStat extends org.jooq.impl.TableImpl<mineplex.database.tables.records.AccountStatRecord> implements java.io.Serializable, java.lang.Cloneable { public class AccountStat extends org.jooq.impl.TableImpl<mineplex.database.tables.records.AccountStatRecord> implements java.io.Serializable, java.lang.Cloneable {
private static final long serialVersionUID = 956897097; private static final long serialVersionUID = 34581219;
/** /**
* The reference instance of <code>Account.accountStat</code> * The reference instance of <code>Account.accountStat</code>
@ -44,7 +44,7 @@ public class AccountStat extends org.jooq.impl.TableImpl<mineplex.database.table
/** /**
* The column <code>Account.accountStat.value</code>. * The column <code>Account.accountStat.value</code>.
*/ */
public final org.jooq.TableField<mineplex.database.tables.records.AccountStatRecord, java.lang.Long> value = createField("value", org.jooq.impl.SQLDataType.BIGINT.defaulted(true), this, ""); public final org.jooq.TableField<mineplex.database.tables.records.AccountStatRecord, org.jooq.types.ULong> value = createField("value", org.jooq.impl.SQLDataType.BIGINTUNSIGNED.defaulted(true), this, "");
/** /**
* Create a <code>Account.accountStat</code> table reference * Create a <code>Account.accountStat</code> table reference

View File

@ -16,7 +16,7 @@ package mineplex.database.tables;
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" }) @java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Bonus extends org.jooq.impl.TableImpl<mineplex.database.tables.records.BonusRecord> implements java.io.Serializable, java.lang.Cloneable { public class Bonus extends org.jooq.impl.TableImpl<mineplex.database.tables.records.BonusRecord> implements java.io.Serializable, java.lang.Cloneable {
private static final long serialVersionUID = -70389593; private static final long serialVersionUID = -524321170;
/** /**
* The reference instance of <code>Account.bonus</code> * The reference instance of <code>Account.bonus</code>
@ -46,6 +46,36 @@ public class Bonus extends org.jooq.impl.TableImpl<mineplex.database.tables.reco
*/ */
public final org.jooq.TableField<mineplex.database.tables.records.BonusRecord, java.sql.Date> ranktime = createField("ranktime", org.jooq.impl.SQLDataType.DATE, this, ""); public final org.jooq.TableField<mineplex.database.tables.records.BonusRecord, java.sql.Date> ranktime = createField("ranktime", org.jooq.impl.SQLDataType.DATE, this, "");
/**
* The column <code>Account.bonus.votetime</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.BonusRecord, java.sql.Date> votetime = createField("votetime", org.jooq.impl.SQLDataType.DATE, this, "");
/**
* The column <code>Account.bonus.dailyStreak</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.BonusRecord, java.lang.Integer> dailyStreak = createField("dailyStreak", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>Account.bonus.maxDailyStreak</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.BonusRecord, java.lang.Integer> maxDailyStreak = createField("maxDailyStreak", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>Account.bonus.voteStreak</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.BonusRecord, java.lang.Integer> voteStreak = createField("voteStreak", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>Account.bonus.maxVoteStreak</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.BonusRecord, java.lang.Integer> maxVoteStreak = createField("maxVoteStreak", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>Account.bonus.tickets</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.BonusRecord, java.lang.Integer> tickets = createField("tickets", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/** /**
* Create a <code>Account.bonus</code> table reference * Create a <code>Account.bonus</code> table reference
*/ */

View File

@ -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<mineplex.database.tables.records.ChatsnapRecord> implements java.io.Serializable, java.lang.Cloneable {
private static final long serialVersionUID = -176946707;
/**
* The reference instance of <code>Account.chatsnap</code>
*/
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<mineplex.database.tables.records.ChatsnapRecord> getRecordType() {
return mineplex.database.tables.records.ChatsnapRecord.class;
}
/**
* The column <code>Account.chatsnap.id</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.ChatsnapRecord, java.lang.Integer> id = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>Account.chatsnap.reporterId</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.ChatsnapRecord, java.lang.Integer> reporterId = createField("reporterId", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>Account.chatsnap.reporteeId</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.ChatsnapRecord, java.lang.Integer> reporteeId = createField("reporteeId", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>Account.chatsnap.time</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.ChatsnapRecord, java.sql.Timestamp> time = createField("time", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaulted(true), this, "");
/**
* The column <code>Account.chatsnap.status</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.ChatsnapRecord, java.lang.String> status = createField("status", org.jooq.impl.SQLDataType.VARCHAR.length(10).nullable(false).defaulted(true), this, "");
/**
* The column <code>Account.chatsnap.reason</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.ChatsnapRecord, java.lang.String> reason = createField("reason", org.jooq.impl.SQLDataType.CLOB.length(65535).nullable(false), this, "");
/**
* The column <code>Account.chatsnap.data</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.ChatsnapRecord, java.lang.String> data = createField("data", org.jooq.impl.SQLDataType.CLOB.length(16777215).nullable(false), this, "");
/**
* Create a <code>Account.chatsnap</code> table reference
*/
public Chatsnap() {
this("chatsnap", null);
}
/**
* Create an aliased <code>Account.chatsnap</code> table reference
*/
public Chatsnap(java.lang.String alias) {
this(alias, mineplex.database.tables.Chatsnap.chatsnap);
}
private Chatsnap(java.lang.String alias, org.jooq.Table<mineplex.database.tables.records.ChatsnapRecord> aliased) {
this(alias, aliased, null);
}
private Chatsnap(java.lang.String alias, org.jooq.Table<mineplex.database.tables.records.ChatsnapRecord> aliased, org.jooq.Field<?>[] parameters) {
super(alias, mineplex.database.Account.Account, aliased, parameters, "");
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Identity<mineplex.database.tables.records.ChatsnapRecord, java.lang.Integer> getIdentity() {
return mineplex.database.Keys.IDENTITY_chatsnap;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.UniqueKey<mineplex.database.tables.records.ChatsnapRecord> getPrimaryKey() {
return mineplex.database.Keys.KEY_chatsnap_PRIMARY;
}
/**
* {@inheritDoc}
*/
@Override
public java.util.List<org.jooq.UniqueKey<mineplex.database.tables.records.ChatsnapRecord>> getKeys() {
return java.util.Arrays.<org.jooq.UniqueKey<mineplex.database.tables.records.ChatsnapRecord>>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);
}
}

View File

@ -14,9 +14,9 @@ package mineplex.database.tables.records;
comments = "This class is generated by jOOQ" comments = "This class is generated by jOOQ"
) )
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" }) @java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.AccountStatRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record3<java.lang.Integer, java.lang.Integer, java.lang.Long> { public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.AccountStatRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record3<java.lang.Integer, java.lang.Integer, org.jooq.types.ULong> {
private static final long serialVersionUID = 1109290129; private static final long serialVersionUID = -516667486;
/** /**
* Setter for <code>Account.accountStat.accountId</code>. * Setter for <code>Account.accountStat.accountId</code>.
@ -49,15 +49,15 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl<mineple
/** /**
* Setter for <code>Account.accountStat.value</code>. * Setter for <code>Account.accountStat.value</code>.
*/ */
public void setValue(java.lang.Long value) { public void setValue(org.jooq.types.ULong value) {
setValue(2, value); setValue(2, value);
} }
/** /**
* Getter for <code>Account.accountStat.value</code>. * Getter for <code>Account.accountStat.value</code>.
*/ */
public java.lang.Long getValue() { public org.jooq.types.ULong getValue() {
return (java.lang.Long) getValue(2); return (org.jooq.types.ULong) getValue(2);
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
@ -80,7 +80,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl<mineple
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public org.jooq.Row3<java.lang.Integer, java.lang.Integer, java.lang.Long> fieldsRow() { public org.jooq.Row3<java.lang.Integer, java.lang.Integer, org.jooq.types.ULong> fieldsRow() {
return (org.jooq.Row3) super.fieldsRow(); return (org.jooq.Row3) super.fieldsRow();
} }
@ -88,7 +88,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl<mineple
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public org.jooq.Row3<java.lang.Integer, java.lang.Integer, java.lang.Long> valuesRow() { public org.jooq.Row3<java.lang.Integer, java.lang.Integer, org.jooq.types.ULong> valuesRow() {
return (org.jooq.Row3) super.valuesRow(); return (org.jooq.Row3) super.valuesRow();
} }
@ -112,7 +112,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl<mineple
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public org.jooq.Field<java.lang.Long> field3() { public org.jooq.Field<org.jooq.types.ULong> field3() {
return mineplex.database.tables.AccountStat.accountStat.value; return mineplex.database.tables.AccountStat.accountStat.value;
} }
@ -136,7 +136,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl<mineple
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public java.lang.Long value3() { public org.jooq.types.ULong value3() {
return getValue(); return getValue();
} }
@ -162,7 +162,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl<mineple
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public AccountStatRecord value3(java.lang.Long value) { public AccountStatRecord value3(org.jooq.types.ULong value) {
setValue(value); setValue(value);
return this; return this;
} }
@ -171,7 +171,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl<mineple
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public AccountStatRecord values(java.lang.Integer value1, java.lang.Integer value2, java.lang.Long value3) { public AccountStatRecord values(java.lang.Integer value1, java.lang.Integer value2, org.jooq.types.ULong value3) {
return this; return this;
} }
@ -189,7 +189,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl<mineple
/** /**
* Create a detached, initialised AccountStatRecord * Create a detached, initialised AccountStatRecord
*/ */
public AccountStatRecord(java.lang.Integer accountId, java.lang.Integer statId, java.lang.Long value) { public AccountStatRecord(java.lang.Integer accountId, java.lang.Integer statId, org.jooq.types.ULong value) {
super(mineplex.database.tables.AccountStat.accountStat); super(mineplex.database.tables.AccountStat.accountStat);
setValue(0, accountId); setValue(0, accountId);

View File

@ -14,9 +14,9 @@ package mineplex.database.tables.records;
comments = "This class is generated by jOOQ" comments = "This class is generated by jOOQ"
) )
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" }) @java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.BonusRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record3<java.lang.Integer, java.sql.Timestamp, java.sql.Date> { public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.BonusRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record9<java.lang.Integer, java.sql.Timestamp, java.sql.Date, java.sql.Date, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer> {
private static final long serialVersionUID = -64019858; private static final long serialVersionUID = -785434679;
/** /**
* Setter for <code>Account.bonus.accountId</code>. * Setter for <code>Account.bonus.accountId</code>.
@ -60,6 +60,90 @@ public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.data
return (java.sql.Date) getValue(2); return (java.sql.Date) getValue(2);
} }
/**
* Setter for <code>Account.bonus.votetime</code>.
*/
public void setVotetime(java.sql.Date value) {
setValue(3, value);
}
/**
* Getter for <code>Account.bonus.votetime</code>.
*/
public java.sql.Date getVotetime() {
return (java.sql.Date) getValue(3);
}
/**
* Setter for <code>Account.bonus.dailyStreak</code>.
*/
public void setDailyStreak(java.lang.Integer value) {
setValue(4, value);
}
/**
* Getter for <code>Account.bonus.dailyStreak</code>.
*/
public java.lang.Integer getDailyStreak() {
return (java.lang.Integer) getValue(4);
}
/**
* Setter for <code>Account.bonus.maxDailyStreak</code>.
*/
public void setMaxDailyStreak(java.lang.Integer value) {
setValue(5, value);
}
/**
* Getter for <code>Account.bonus.maxDailyStreak</code>.
*/
public java.lang.Integer getMaxDailyStreak() {
return (java.lang.Integer) getValue(5);
}
/**
* Setter for <code>Account.bonus.voteStreak</code>.
*/
public void setVoteStreak(java.lang.Integer value) {
setValue(6, value);
}
/**
* Getter for <code>Account.bonus.voteStreak</code>.
*/
public java.lang.Integer getVoteStreak() {
return (java.lang.Integer) getValue(6);
}
/**
* Setter for <code>Account.bonus.maxVoteStreak</code>.
*/
public void setMaxVoteStreak(java.lang.Integer value) {
setValue(7, value);
}
/**
* Getter for <code>Account.bonus.maxVoteStreak</code>.
*/
public java.lang.Integer getMaxVoteStreak() {
return (java.lang.Integer) getValue(7);
}
/**
* Setter for <code>Account.bonus.tickets</code>.
*/
public void setTickets(java.lang.Integer value) {
setValue(8, value);
}
/**
* Getter for <code>Account.bonus.tickets</code>.
*/
public java.lang.Integer getTickets() {
return (java.lang.Integer) getValue(8);
}
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// Primary key information // Primary key information
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
@ -73,23 +157,23 @@ public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.data
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// Record3 type implementation // Record9 type implementation
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public org.jooq.Row3<java.lang.Integer, java.sql.Timestamp, java.sql.Date> fieldsRow() { public org.jooq.Row9<java.lang.Integer, java.sql.Timestamp, java.sql.Date, java.sql.Date, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer> fieldsRow() {
return (org.jooq.Row3) super.fieldsRow(); return (org.jooq.Row9) super.fieldsRow();
} }
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public org.jooq.Row3<java.lang.Integer, java.sql.Timestamp, java.sql.Date> valuesRow() { public org.jooq.Row9<java.lang.Integer, java.sql.Timestamp, java.sql.Date, java.sql.Date, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer> valuesRow() {
return (org.jooq.Row3) super.valuesRow(); return (org.jooq.Row9) super.valuesRow();
} }
/** /**
@ -116,6 +200,54 @@ public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.data
return mineplex.database.tables.Bonus.bonus.ranktime; return mineplex.database.tables.Bonus.bonus.ranktime;
} }
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.sql.Date> field4() {
return mineplex.database.tables.Bonus.bonus.votetime;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field5() {
return mineplex.database.tables.Bonus.bonus.dailyStreak;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field6() {
return mineplex.database.tables.Bonus.bonus.maxDailyStreak;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field7() {
return mineplex.database.tables.Bonus.bonus.voteStreak;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field8() {
return mineplex.database.tables.Bonus.bonus.maxVoteStreak;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field9() {
return mineplex.database.tables.Bonus.bonus.tickets;
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@ -140,6 +272,54 @@ public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.data
return getRanktime(); return getRanktime();
} }
/**
* {@inheritDoc}
*/
@Override
public java.sql.Date value4() {
return getVotetime();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value5() {
return getDailyStreak();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value6() {
return getMaxDailyStreak();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value7() {
return getVoteStreak();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value8() {
return getMaxVoteStreak();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value9() {
return getTickets();
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@ -171,7 +351,61 @@ public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.data
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public BonusRecord values(java.lang.Integer value1, java.sql.Timestamp value2, java.sql.Date value3) { public BonusRecord value4(java.sql.Date value) {
setVotetime(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public BonusRecord value5(java.lang.Integer value) {
setDailyStreak(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public BonusRecord value6(java.lang.Integer value) {
setMaxDailyStreak(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public BonusRecord value7(java.lang.Integer value) {
setVoteStreak(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public BonusRecord value8(java.lang.Integer value) {
setMaxVoteStreak(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public BonusRecord value9(java.lang.Integer value) {
setTickets(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public BonusRecord values(java.lang.Integer value1, java.sql.Timestamp value2, java.sql.Date value3, java.sql.Date value4, java.lang.Integer value5, java.lang.Integer value6, java.lang.Integer value7, java.lang.Integer value8, java.lang.Integer value9) {
return this; return this;
} }
@ -189,11 +423,17 @@ public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.data
/** /**
* Create a detached, initialised BonusRecord * Create a detached, initialised BonusRecord
*/ */
public BonusRecord(java.lang.Integer accountId, java.sql.Timestamp dailytime, java.sql.Date ranktime) { public BonusRecord(java.lang.Integer accountId, java.sql.Timestamp dailytime, java.sql.Date ranktime, java.sql.Date votetime, java.lang.Integer dailyStreak, java.lang.Integer maxDailyStreak, java.lang.Integer voteStreak, java.lang.Integer maxVoteStreak, java.lang.Integer tickets) {
super(mineplex.database.tables.Bonus.bonus); super(mineplex.database.tables.Bonus.bonus);
setValue(0, accountId); setValue(0, accountId);
setValue(1, dailytime); setValue(1, dailytime);
setValue(2, ranktime); setValue(2, ranktime);
setValue(3, votetime);
setValue(4, dailyStreak);
setValue(5, maxDailyStreak);
setValue(6, voteStreak);
setValue(7, maxVoteStreak);
setValue(8, tickets);
} }
} }

View File

@ -0,0 +1,359 @@
/**
* This class is generated by jOOQ
*/
package mineplex.database.tables.records;
/**
* 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 ChatsnapRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.ChatsnapRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record7<java.lang.Integer, java.lang.Integer, java.lang.Integer, java.sql.Timestamp, java.lang.String, java.lang.String, java.lang.String> {
private static final long serialVersionUID = 2087133341;
/**
* Setter for <code>Account.chatsnap.id</code>.
*/
public void setId(java.lang.Integer value) {
setValue(0, value);
}
/**
* Getter for <code>Account.chatsnap.id</code>.
*/
public java.lang.Integer getId() {
return (java.lang.Integer) getValue(0);
}
/**
* Setter for <code>Account.chatsnap.reporterId</code>.
*/
public void setReporterId(java.lang.Integer value) {
setValue(1, value);
}
/**
* Getter for <code>Account.chatsnap.reporterId</code>.
*/
public java.lang.Integer getReporterId() {
return (java.lang.Integer) getValue(1);
}
/**
* Setter for <code>Account.chatsnap.reporteeId</code>.
*/
public void setReporteeId(java.lang.Integer value) {
setValue(2, value);
}
/**
* Getter for <code>Account.chatsnap.reporteeId</code>.
*/
public java.lang.Integer getReporteeId() {
return (java.lang.Integer) getValue(2);
}
/**
* Setter for <code>Account.chatsnap.time</code>.
*/
public void setTime(java.sql.Timestamp value) {
setValue(3, value);
}
/**
* Getter for <code>Account.chatsnap.time</code>.
*/
public java.sql.Timestamp getTime() {
return (java.sql.Timestamp) getValue(3);
}
/**
* Setter for <code>Account.chatsnap.status</code>.
*/
public void setStatus(java.lang.String value) {
setValue(4, value);
}
/**
* Getter for <code>Account.chatsnap.status</code>.
*/
public java.lang.String getStatus() {
return (java.lang.String) getValue(4);
}
/**
* Setter for <code>Account.chatsnap.reason</code>.
*/
public void setReason(java.lang.String value) {
setValue(5, value);
}
/**
* Getter for <code>Account.chatsnap.reason</code>.
*/
public java.lang.String getReason() {
return (java.lang.String) getValue(5);
}
/**
* Setter for <code>Account.chatsnap.data</code>.
*/
public void setData(java.lang.String value) {
setValue(6, value);
}
/**
* Getter for <code>Account.chatsnap.data</code>.
*/
public java.lang.String getData() {
return (java.lang.String) getValue(6);
}
// -------------------------------------------------------------------------
// Primary key information
// -------------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Record1<java.lang.Integer> key() {
return (org.jooq.Record1) super.key();
}
// -------------------------------------------------------------------------
// Record7 type implementation
// -------------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row7<java.lang.Integer, java.lang.Integer, java.lang.Integer, java.sql.Timestamp, java.lang.String, java.lang.String, java.lang.String> fieldsRow() {
return (org.jooq.Row7) super.fieldsRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row7<java.lang.Integer, java.lang.Integer, java.lang.Integer, java.sql.Timestamp, java.lang.String, java.lang.String, java.lang.String> valuesRow() {
return (org.jooq.Row7) super.valuesRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field1() {
return mineplex.database.tables.Chatsnap.chatsnap.id;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field2() {
return mineplex.database.tables.Chatsnap.chatsnap.reporterId;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field3() {
return mineplex.database.tables.Chatsnap.chatsnap.reporteeId;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.sql.Timestamp> field4() {
return mineplex.database.tables.Chatsnap.chatsnap.time;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field5() {
return mineplex.database.tables.Chatsnap.chatsnap.status;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field6() {
return mineplex.database.tables.Chatsnap.chatsnap.reason;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> 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);
}
}

View File

@ -46,6 +46,7 @@ import mineplex.core.task.TaskManager;
import mineplex.core.teleport.Teleport; import mineplex.core.teleport.Teleport;
import mineplex.core.updater.FileUpdater; import mineplex.core.updater.FileUpdater;
import mineplex.core.updater.Updater; import mineplex.core.updater.Updater;
import mineplex.core.velocity.VelocityFix;
import mineplex.core.visibility.VisibilityManager; import mineplex.core.visibility.VisibilityManager;
import mineplex.hub.modules.StackerManager; import mineplex.hub.modules.StackerManager;
import mineplex.hub.poll.PollManager; import mineplex.hub.poll.PollManager;
@ -78,6 +79,9 @@ public class Hub extends JavaPlugin implements IRelation
//Logger.initialize(this); //Logger.initialize(this);
//Velocity Fix
new VelocityFix(this);
//Static Modules //Static Modules
CommandCenter.Initialize(this); CommandCenter.Initialize(this);
CoreClientManager clientManager = new CoreClientManager(this, webServerAddress); CoreClientManager clientManager = new CoreClientManager(this, webServerAddress);

View File

@ -1,16 +1,13 @@
package mineplex.hub; package mineplex.hub;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap; import java.util.HashMap;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Color;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; import org.bukkit.craftbukkit.v1_7_R4.CraftWorld;
import org.bukkit.entity.Egg; import org.bukkit.entity.Egg;
import org.bukkit.entity.Entity; 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.F;
import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
@ -91,11 +87,11 @@ import mineplex.hub.commands.GadgetToggle;
import mineplex.hub.commands.GameModeCommand; import mineplex.hub.commands.GameModeCommand;
import mineplex.hub.commands.NewsCommand; import mineplex.hub.commands.NewsCommand;
import mineplex.hub.modules.ForcefieldManager; import mineplex.hub.modules.ForcefieldManager;
import mineplex.hub.modules.HubVisibilityManager;
import mineplex.hub.modules.JumpManager; import mineplex.hub.modules.JumpManager;
import mineplex.hub.modules.NewsManager; import mineplex.hub.modules.NewsManager;
import mineplex.hub.modules.ParkourManager; import mineplex.hub.modules.ParkourManager;
import mineplex.hub.modules.TextManager; import mineplex.hub.modules.TextManager;
import mineplex.hub.modules.HubVisibilityManager;
import mineplex.hub.modules.WorldManager; import mineplex.hub.modules.WorldManager;
import mineplex.hub.poll.PollManager; import mineplex.hub.poll.PollManager;
import mineplex.hub.tutorial.TutorialManager; import mineplex.hub.tutorial.TutorialManager;
@ -107,7 +103,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent;
public class HubManager extends MiniClientPlugin<HubClient> public class HubManager extends MiniClientPlugin<HubClient>
{ {
// Snowman! // Snowman!
public HubType Type = HubType.Normal; public HubType Type = HubType.Normal;
private BlockRestore _blockRestore; private BlockRestore _blockRestore;
private CoreClientManager _clientManager; private CoreClientManager _clientManager;
@ -499,7 +495,10 @@ public class HubManager extends MiniClientPlugin<HubClient>
@EventHandler(priority = EventPriority.LOW) @EventHandler(priority = EventPriority.LOW)
public void AdminOP(PlayerJoinEvent event) 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); event.getPlayer().setOp(true);
else else
event.getPlayer().setOp(false); event.getPlayer().setOp(false);
@ -899,6 +898,11 @@ public class HubManager extends MiniClientPlugin<HubClient>
return _gadgetManager; return _gadgetManager;
} }
public TreasureManager GetTreasure()
{
return _treasureManager;
}
public MountManager GetMount() public MountManager GetMount()
{ {
return _mountManager; return _mountManager;

View File

@ -10,7 +10,7 @@ public class GadgetToggle extends CommandBase<HubManager>
{ {
public GadgetToggle(HubManager plugin) public GadgetToggle(HubManager plugin)
{ {
super(plugin, Rank.ADMIN, new String[] {"gadget"}); super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, new String[] {"gadget"});
} }
@Override @Override

View File

@ -13,7 +13,7 @@ public class GameModeCommand extends CommandBase<HubManager>
{ {
public GameModeCommand(HubManager plugin) public GameModeCommand(HubManager plugin)
{ {
super(plugin, Rank.ADMIN, new String[] {"gm"}); super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, new String[] {"gm"});
} }
@Override @Override

View File

@ -10,7 +10,7 @@ public class NewsCommand extends MultiCommandBase<HubManager>
{ {
public NewsCommand(HubManager plugin) 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 NewsAddCommand(plugin));
AddCommand(new NewsDeleteCommand(plugin)); AddCommand(new NewsDeleteCommand(plugin));

View File

@ -19,7 +19,7 @@ public class NewsListCommand extends CommandBase<HubManager>
{ {
public NewsListCommand(HubManager plugin) public NewsListCommand(HubManager plugin)
{ {
super(plugin, Rank.ADMIN, "list"); super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "list");
} }
@Override @Override

View File

@ -42,7 +42,7 @@ public class ForcefieldManager extends MiniPlugin
for (Player player : UtilServer.getPlayers()) 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()) for (Player other : UtilServer.getPlayers())
{ {
@ -56,7 +56,7 @@ public class ForcefieldManager extends MiniPlugin
if (UtilMath.offset(other, player) > range) if (UtilMath.offset(other, player) > range)
continue; 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; continue;
if (Recharge.Instance.use(other, "Forcefield Bump", 500, false, false)) if (Recharge.Instance.use(other, "Forcefield Bump", 500, false, false))

View File

@ -28,6 +28,8 @@ import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.event.StackerEvent; 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.IThrown;
import mineplex.core.projectile.ProjectileManager; import mineplex.core.projectile.ProjectileManager;
import mineplex.core.projectile.ProjectileUser; import mineplex.core.projectile.ProjectileUser;
@ -105,15 +107,33 @@ public class StackerManager extends MiniPlugin implements IThrown
return; 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); stackerEvent = new StackerEvent(stackee);
Bukkit.getServer().getPluginManager().callEvent(stackerEvent); Bukkit.getServer().getPluginManager().callEvent(stackerEvent);
if (stackerEvent.isCancelled()) if (stackerEvent.isCancelled())
return; 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.")); if (!Manager.CanBump(((Player)stackee)))
return; {
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) if (stackee instanceof LivingEntity)
@ -235,7 +255,8 @@ public class StackerManager extends MiniPlugin implements IThrown
Manager.SetPortalDelay(rider); Manager.SetPortalDelay(rider);
rider.leaveVehicle(); 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(); rider = rider.getPassenger();
} }

View File

@ -10,4 +10,9 @@ public class ServerInfo
public String ServerType; public String ServerType;
public String Game; public String Game;
public boolean HostedByStaff; public boolean HostedByStaff;
public int getAvailableSlots()
{
return MaxPlayers - CurrentPlayers;
}
} }

View File

@ -10,8 +10,11 @@ import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set; import java.util.Set;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
@ -56,7 +59,9 @@ import mineplex.hub.queue.QueueManager;
import mineplex.hub.queue.ui.QueueShop; import mineplex.hub.queue.ui.QueueShop;
import mineplex.hub.server.ui.LobbyShop; import mineplex.hub.server.ui.LobbyShop;
import mineplex.hub.server.ui.QuickShop; import mineplex.hub.server.ui.QuickShop;
import mineplex.hub.server.ui.ServerCountSorter;
import mineplex.hub.server.ui.ServerNpcShop; import mineplex.hub.server.ui.ServerNpcShop;
import mineplex.serverdata.Region;
import mineplex.serverdata.data.MinecraftServer; import mineplex.serverdata.data.MinecraftServer;
import mineplex.serverdata.data.ServerGroup; 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 FREE_PORTAL_TIMER = 20000L;
private static final Long BETA_PORTAL_TIMER = 120000L; 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 CoreClientManager _clientManager;
private DonationManager _donationManager; private DonationManager _donationManager;
private Portal _portal; private Portal _portal;
@ -73,7 +83,8 @@ public class ServerManager extends MiniPlugin
private HubManager _hubManager; private HubManager _hubManager;
private StackerManager _stackerManager; private StackerManager _stackerManager;
private QueueManager _queueManager; private QueueManager _queueManager;
private NautHashMap<String, Long> _queueCooldowns = new NautHashMap<String, Long>();
private NautHashMap<String, HashSet<ServerInfo>> _serverKeyInfoMap = new NautHashMap<String, HashSet<ServerInfo>>(); private NautHashMap<String, HashSet<ServerInfo>> _serverKeyInfoMap = new NautHashMap<String, HashSet<ServerInfo>>();
private NautHashMap<String, String> _serverKeyTagMap = new NautHashMap<String, String>(); private NautHashMap<String, String> _serverKeyTagMap = new NautHashMap<String, String>();
private NautHashMap<String, Integer> _serverPlayerCounts = new NautHashMap<String, Integer>(); private NautHashMap<String, Integer> _serverPlayerCounts = new NautHashMap<String, Integer>();
@ -108,7 +119,7 @@ public class ServerManager extends MiniPlugin
plugin.getServer().getMessenger().registerOutgoingPluginChannel(plugin, "BungeeCord"); plugin.getServer().getMessenger().registerOutgoingPluginChannel(plugin, "BungeeCord");
LoadServers(); loadServers();
_quickShop = new QuickShop(this, clientManager, donationManager, "Quick Menu"); _quickShop = new QuickShop(this, clientManager, donationManager, "Quick Menu");
_lobbyShop = new LobbyShop(this, clientManager, donationManager, "Lobby Menu"); _lobbyShop = new LobbyShop(this, clientManager, donationManager, "Lobby Menu");
@ -278,18 +289,6 @@ public class ServerManager extends MiniPlugin
timeLeft = 0; 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; return timeLeft;
} }
@ -303,18 +302,18 @@ public class ServerManager extends MiniPlugin
_serverInfoMap.remove(serverName); _serverInfoMap.remove(serverName);
} }
public void addServerGroup(String serverKey, String...serverTag) public void addServerGroup(ServerGroup serverGroup)
{ {
_serverKeyInfoMap.put(serverKey, new HashSet<ServerInfo>()); _serverKeyInfoMap.put(serverGroup.getName(), new HashSet<ServerInfo>());
_serverKeyTagMap.put(serverGroup.getPrefix(), serverGroup.getName());
for (String tag : serverTag) if (!serverGroup.getServerNpcName().isEmpty())
_serverKeyTagMap.put(tag, serverKey); _serverKeyTagMap.put(serverGroup.getServerNpcName(), serverGroup.getName());
} }
public void AddServerNpc(String serverNpcName, String...serverTag) public void AddServerNpc(ServerGroup serverGroup)
{ {
addServerGroup(serverNpcName, serverTag); _serverNpcShopMap.put(serverGroup.getServerNpcName(), new ServerNpcShop(this, _clientManager, _donationManager, serverGroup));
_serverNpcShopMap.put(serverNpcName, new ServerNpcShop(this, _clientManager, _donationManager, serverNpcName));
} }
public void RemoveServerNpc(String serverNpcName) public void RemoveServerNpc(String serverNpcName)
@ -396,7 +395,6 @@ public class ServerManager extends MiniPlugin
_retrieving = true; _retrieving = true;
_statusManager.retrieveServerGroups(new Callback<Collection<ServerGroup>>() _statusManager.retrieveServerGroups(new Callback<Collection<ServerGroup>>()
{ {
public void run(final Collection<ServerGroup> serverGroups) public void run(final Collection<ServerGroup> serverGroups)
@ -482,6 +480,8 @@ public class ServerManager extends MiniPlugin
}); });
} }
}); });
updateCooldowns();
} }
public void Help(Player caller, String message) public void Help(Player caller, String message)
@ -521,6 +521,113 @@ public class ServerManager extends MiniPlugin
_portal.sendPlayerToServer(player, serverInfo.Name); _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<ServerInfo> serverList = GetServerList(serverKey);
if (serverList == null) return null;
List<ServerInfo> servers = new ArrayList<ServerInfo>(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<ServerInfo> fetchOpenServers(Player player, List<ServerInfo> servers, int count)
{
List<ServerInfo> results = new ArrayList<ServerInfo>();
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) public void ListServerNpcs(Player caller)
{ {
@ -555,7 +662,7 @@ public class ServerManager extends MiniPlugin
} }
} }
public void LoadServers() public void loadServers()
{ {
_serverInfoMap.clear(); _serverInfoMap.clear();
_serverUpdate.clear(); _serverUpdate.clear();
@ -567,83 +674,55 @@ public class ServerManager extends MiniPlugin
_serverKeyTagMap.clear(); _serverKeyTagMap.clear();
FileInputStream fstream = null; Region region = getPlugin().getConfig().getBoolean("serverstatus.us") ? Region.US : Region.EU;
BufferedReader br = null;
HashSet<String> npcNames = new HashSet<String>();
try try
{ {
File npcFile = new File("ServerManager.dat"); for (ServerGroup serverGroup : mineplex.serverdata.servers.ServerManager.getServerRepository(region).getServerGroups(null))
if (npcFile.exists())
{ {
fstream = new FileInputStream(npcFile); addServerGroup(serverGroup); // Caches prefix/tag pairing
br = new BufferedReader(new InputStreamReader(fstream));
String line = br.readLine(); if (!serverGroup.getServerNpcName().isEmpty())
while (line != null)
{ {
String serverNpcName = line.substring(0, line.indexOf('|')).trim(); if (!HasServerNpc(serverGroup.getServerNpcName()))
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(","); 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)) _serverPortalLocations.put(bottomVector, serverGroup.getServerNpcName());
{
AddServerNpc(serverNpcName, serverTags);
}
npcNames.add(serverNpcName);
line = br.readLine();
} }
} }
} }
catch (Exception e) catch (Exception e)
{ {
System.out.println("ServerManager - Error parsing servers file : " + e.getMessage()); System.out.println("ServerManager - Error parsing servergroups : " + 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();
}
}
} }
for (String npcName : npcNames) // AddServerNpc("Event Servers", "EVENT");
{ // AddServerNpc("Mineplex Player Servers", "MPS");
if (!_serverNpcShopMap.containsKey(npcName))
_serverNpcShopMap.remove(npcName);
if (!_serverKeyInfoMap.containsKey(npcName))
_serverKeyInfoMap.remove(npcName);
}
} }
public int GetRequiredSlots(Player player, String serverType) public int GetRequiredSlots(Player player, String serverType)

View File

@ -14,7 +14,8 @@ public class LobbyShop extends ShopBase<ServerManager>
{ {
super(plugin, clientManager, donationManager, name); super(plugin, clientManager, donationManager, name);
plugin.addServerGroup("Lobby", "Lobby"); // TODO: Why is this needed? Re-add?
//plugin.addServerGroup("Lobby", "Lobby");
} }
@Override @Override

View File

@ -0,0 +1,13 @@
package mineplex.hub.server.ui;
import java.util.Comparator;
import mineplex.hub.server.ServerInfo;
public class ServerCountSorter implements Comparator<ServerInfo>
{
public int compare(ServerInfo a, ServerInfo b)
{
return a.CurrentPlayers - b.CurrentPlayers;
}
}

View File

@ -72,7 +72,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
ChatColor.RESET + "Stay away from the borders!", ChatColor.RESET + "Stay away from the borders!",
ChatColor.RESET + "", ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("HG") + ChatColor.RESET + " other players!", 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[] setItem(4, ItemStackFactory.Instance.CreateStack(Material.FEATHER.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Skywars " + C.cGray + "Solo Survival", new String[]
{ {

View File

@ -17,6 +17,7 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.donation.DonationManager; import mineplex.core.donation.DonationManager;
import mineplex.core.game.GameDisplay; import mineplex.core.game.GameDisplay;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.shop.item.IButton; import mineplex.core.shop.item.IButton;
import mineplex.core.shop.item.ShopItem; import mineplex.core.shop.item.ShopItem;
import mineplex.core.shop.page.ShopPageBase; import mineplex.core.shop.page.ShopPageBase;
@ -41,7 +42,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
public ServerNpcPage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player, String serverNpcKey) 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; _serverNpcKey = serverNpcKey;
@ -51,6 +52,21 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
@Override @Override
protected void buildPage() 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<ServerInfo> serverList = new ArrayList<ServerInfo>(getPlugin().GetServerList(_serverNpcKey)); List<ServerInfo> serverList = new ArrayList<ServerInfo>(getPlugin().GetServerList(_serverNpcKey));
int slotsNeeded = 1; int slotsNeeded = 1;
@ -401,7 +417,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
{ {
int slots = getPlugin().GetRequiredSlots(player, serverInfo.ServerType); 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); playDenySound(player);
return; return;

View File

@ -11,18 +11,23 @@ import mineplex.core.party.Party;
import mineplex.core.shop.ShopBase; import mineplex.core.shop.ShopBase;
import mineplex.core.shop.page.ShopPageBase; import mineplex.core.shop.page.ShopPageBase;
import mineplex.hub.server.ServerManager; import mineplex.hub.server.ServerManager;
import mineplex.serverdata.data.ServerGroup;
public class ServerNpcShop extends ShopBase<ServerManager> public class ServerNpcShop extends ShopBase<ServerManager>
{ {
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 @Override
protected ShopPageBase<ServerManager, ? extends ShopBase<ServerManager>> buildPagesFor(Player player) protected ShopPageBase<ServerManager, ? extends ShopBase<ServerManager>> buildPagesFor(Player player)
{ {
return new ServerNpcPage(getPlugin(), this, getClientManager(), getDonationManager(), getName(), player, getName()); return new ServerTypePage(getPlugin(), this, getClientManager(), getDonationManager(), player, _serverGroup);
} }
@Override @Override
@ -65,4 +70,16 @@ public class ServerNpcShop extends ShopBase<ServerManager>
{ {
getPlugin().getHubManager().GetVisibility().removeHiddenPlayer(player); 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);
}
} }

View File

@ -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<ServerManager, ServerNpcShop>
{
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());
}
}
}

View File

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

View File

@ -341,7 +341,7 @@ public class ClientClass
if (notify) if (notify)
{ {
ListSkills(_client.GetPlayer()); 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) + ".")); _client.GetPlayer().sendMessage(F.main("Class", "You equipped " + F.skill(customBuild.Name) + "."));
} }

View File

@ -26,6 +26,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
@ -209,7 +210,8 @@ public class Blizzard extends SkillActive
if (damagee == null) return; if (damagee == null) return;
event.SetCancelled(GetName()); 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 @EventHandler

View File

@ -41,6 +41,7 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerVelocityEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
@ -251,34 +252,34 @@ public class DamageManager extends MiniPlugin
{ {
if (stack == null) if (stack == null)
continue; continue;
Map<Enchantment, Integer> enchants = stack.getEnchantments(); Map<Enchantment, Integer> enchants = stack.getEnchantments();
for (Enchantment e : enchants.keySet()) for (Enchantment e : enchants.keySet())
{ {
if (e.equals(Enchantment.PROTECTION_ENVIRONMENTAL)) if (e.equals(Enchantment.PROTECTION_ENVIRONMENTAL))
event.AddMod("Ench Prot", damagee.getName(), 0.5 * (double)enchants.get(e), false); event.AddMod("Ench Prot", damagee.getName(), 0.5 * (double)enchants.get(e), false);
else if (e.equals(Enchantment.PROTECTION_FIRE) && else if (e.equals(Enchantment.PROTECTION_FIRE) &&
event.GetCause() == DamageCause.FIRE && event.GetCause() == DamageCause.FIRE &&
event.GetCause() == DamageCause.FIRE_TICK && event.GetCause() == DamageCause.FIRE_TICK &&
event.GetCause() == DamageCause.LAVA) event.GetCause() == DamageCause.LAVA)
event.AddMod("Ench Prot", damagee.getName(), 0.5 * (double)enchants.get(e), false); event.AddMod("Ench Prot", damagee.getName(), 0.5 * (double)enchants.get(e), false);
else if (e.equals(Enchantment.PROTECTION_FALL) && else if (e.equals(Enchantment.PROTECTION_FALL) &&
event.GetCause() == DamageCause.FALL) event.GetCause() == DamageCause.FALL)
event.AddMod("Ench Prot", damagee.getName(), 0.5 * (double)enchants.get(e), false); event.AddMod("Ench Prot", damagee.getName(), 0.5 * (double)enchants.get(e), false);
else if (e.equals(Enchantment.PROTECTION_EXPLOSIONS) && else if (e.equals(Enchantment.PROTECTION_EXPLOSIONS) &&
event.GetCause() == DamageCause.ENTITY_EXPLOSION) event.GetCause() == DamageCause.ENTITY_EXPLOSION)
event.AddMod("Ench Prot", damagee.getName(), 0.5 * (double)enchants.get(e), false); event.AddMod("Ench Prot", damagee.getName(), 0.5 * (double)enchants.get(e), false);
else if (e.equals(Enchantment.PROTECTION_PROJECTILE) && else if (e.equals(Enchantment.PROTECTION_PROJECTILE) &&
event.GetCause() == DamageCause.PROJECTILE) event.GetCause() == DamageCause.PROJECTILE)
event.AddMod("Ench Prot", damagee.getName(), 0.5 * (double)enchants.get(e), false); event.AddMod("Ench Prot", damagee.getName(), 0.5 * (double)enchants.get(e), false);
} }
} }
} }
//Offensive //Offensive
Player damager = event.GetDamagerPlayer(true); Player damager = event.GetDamagerPlayer(true);
if (damager != null) if (damager != null)
@ -390,11 +391,22 @@ public class DamageManager extends MiniPlugin
trajectory.multiply(0.6 * knockback); trajectory.multiply(0.6 * knockback);
trajectory.setY(Math.abs(trajectory.getY())); trajectory.setY(Math.abs(trajectory.getY()));
//Apply //Debug
UtilAction.velocity(event.GetDamageeEntity(), if (event.GetDamageeEntity() instanceof Player && UtilGear.isMat(((Player)event.GetDamageeEntity()).getItemInHand(), Material.SUGAR))
trajectory, 0.2 + trajectory.length() * 0.8, false, 0, Math.abs(0.2 * knockback), 0.4 + (0.04 * knockback), true); {
} 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) catch (IllegalAccessException e)
{ {
@ -414,7 +426,7 @@ public class DamageManager extends MiniPlugin
{ {
for (Player player : UtilServer.getPlayers()) for (Player player : UtilServer.getPlayers())
{ {
if (!UtilGear.isMat(player.getItemInHand(), Material.BOOK)) if (!UtilGear.isMat(player.getItemInHand(), Material.COMMAND))
continue; continue;
UtilPlayer.message(player, " "); UtilPlayer.message(player, " ");

View File

@ -6,6 +6,7 @@ import java.util.HashSet;
import mineplex.core.MiniPlugin; import mineplex.core.MiniPlugin;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import org.bukkit.Material; import org.bukkit.Material;
@ -54,8 +55,7 @@ public class PistonJump extends MiniPlugin
//Vector //Vector
Vector vec = new Vector(0,1.2,0); Vector vec = new Vector(0,1.2,0);
player.setVelocity(vec); UtilAction.velocity(player, vec);
player.setFallDistance(0);
} }
final Block block = below; final Block block = below;

View File

@ -1,5 +1,7 @@
package mineplex.serverdata; package mineplex.serverdata;
import java.util.concurrent.ConcurrentHashMap;
import mineplex.serverdata.servers.ConnectionData; import mineplex.serverdata.servers.ConnectionData;
import mineplex.serverdata.servers.ServerManager; import mineplex.serverdata.servers.ServerManager;
import redis.clients.jedis.Jedis; import redis.clients.jedis.Jedis;
@ -15,17 +17,20 @@ import com.google.gson.GsonBuilder;
* @author Ty * @author Ty
* *
*/ */
public class Utility public class Utility
{ {
// The Gson instance used to serialize/deserialize objects in JSON form. // The Gson instance used to serialize/deserialize objects in JSON form.
private static Gson _gson = new GsonBuilder().create(); private static Gson _gson = new GsonBuilder().create();
public static Gson getGson() { return _gson; } public static Gson getGson() { return _gson; }
// map of all instantiated connection pools, distinguished by their ip:port combination
private static final ConcurrentHashMap<String, JedisPool> _pools = new ConcurrentHashMap<String, JedisPool>();
// Public static jedis pool for interacting with central default jedis repo. // Public static jedis pool for interacting with central default jedis repo.
private static JedisPool _masterPool; private static JedisPool _masterPool;
private static JedisPool _slavePool; private static JedisPool _slavePool;
/** /**
* @param object - the (non-null) object to serialize * @param object - the (non-null) object to serialize
* @return the serialized form of {@code object}. * @return the serialized form of {@code object}.
@ -34,7 +39,7 @@ public class Utility
{ {
return _gson.toJson(object); return _gson.toJson(object);
} }
/** /**
* @param serializedData - the serialized data to be deserialized * @param serializedData - the serialized data to be deserialized
* @param type - the resulting class type of the object 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); return _gson.fromJson(serializedData, type);
} }
/** /**
* @param delimiter - the delimiter character used to separate the concatenated elements * @param delimiter - the delimiter character used to separate the concatenated elements
* @param elements - the set of string elements to be concatenated and returned. * @param elements - the set of string elements to be concatenated and returned.
@ -54,15 +59,15 @@ public class Utility
{ {
int length = elements.length; int length = elements.length;
String result = length > 0 ? elements[0] : new String(); String result = length > 0 ? elements[0] : new String();
for (int i = 1; i < length; i++) for (int i = 1; i < length; i++)
{ {
result += delimiter + elements[i]; result += delimiter + elements[i];
} }
return result; return result;
} }
/** /**
* @return the current timestamp (in seconds) fetched from the central jedis repository * @return the current timestamp (in seconds) fetched from the central jedis repository
* for synced timestamps. * for synced timestamps.
@ -72,7 +77,7 @@ public class Utility
long currentTime = 0; long currentTime = 0;
JedisPool pool = getPool(false); JedisPool pool = getPool(false);
Jedis jedis = pool.getResource(); Jedis jedis = pool.getResource();
try try
{ {
currentTime = Long.parseLong(jedis.time().get(0)); currentTime = Long.parseLong(jedis.time().get(0));
@ -90,10 +95,10 @@ public class Utility
pool.returnResource(jedis); pool.returnResource(jedis);
} }
} }
return currentTime; return currentTime;
} }
/** /**
* @return the current timestamp (in milliseconds) fetched from the central jedis repository * @return the current timestamp (in milliseconds) fetched from the central jedis repository
* for synced timestamps. * for synced timestamps.
@ -121,23 +126,35 @@ public class Utility
pool.returnResource(jedis); pool.returnResource(jedis);
} }
} }
return currentTime * 1000; return currentTime * 1000;
} }
/** /**
* @param connData - the connection data specifying the database to be connected to. * @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. * @return a newly instantiated {@link JedisPool} connected to the provided {@link ConnectionData} repository.
*/ */
public static JedisPool generatePool(ConnectionData connData) public static JedisPool generatePool(ConnectionData connData)
{ {
JedisPoolConfig jedisPoolConfig = new JedisPoolConfig(); String key = getConnKey(connData);
jedisPoolConfig.setMaxWaitMillis(1000); JedisPool pool = _pools.get(key);
jedisPoolConfig.setMinIdle(5); if (pool == null)
jedisPoolConfig.setTestOnBorrow(true); {
return new JedisPool(jedisPoolConfig, connData.getHost(), connData.getPort()); 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. * @param writeable - whether or not the Jedis connections returned should be writeable to.
* @return a globally available {@link JedisPool} * @return a globally available {@link JedisPool}
@ -150,7 +167,7 @@ public class Utility
{ {
_masterPool = generatePool(ServerManager.getMasterConnection()); _masterPool = generatePool(ServerManager.getMasterConnection());
} }
return _masterPool; return _masterPool;
} }
else else
@ -158,11 +175,17 @@ public class Utility
if (_slavePool == null) if (_slavePool == null)
{ {
ConnectionData slave = ServerManager.getSlaveConnection(); ConnectionData slave = ServerManager.getSlaveConnection();
_slavePool = generatePool(slave); _slavePool = generatePool(slave);
} }
return _slavePool; return _slavePool;
} }
} }
private static String getConnKey(ConnectionData connData)
{
return connData.getHost() + ":" + connData.getPort();
}
} }

View File

@ -57,6 +57,12 @@ public class ServerGroup
private boolean _staffOnly; private boolean _staffOnly;
private String _resourcePack = ""; private String _resourcePack = "";
private String _npcName = "";
private String _portalBottomCornerLocation = "";
private String _portalTopCornerLocation = "";
private String _teamServerKey = "";
private Region _region; private Region _region;
private Set<MinecraftServer> _servers; private Set<MinecraftServer> _servers;
@ -101,6 +107,10 @@ public class ServerGroup
_resourcePack = data.containsKey("resourcePack") ? data.get("resourcePack") : ""; _resourcePack = data.containsKey("resourcePack") ? data.get("resourcePack") : "";
_host = data.get("host"); _host = data.get("host");
_region = data.containsKey("region") ? Region.valueOf(data.get("region")) : Region.ALL; _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) if (serverStatuses != null)
parseServers(serverStatuses); 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 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 , 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 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; _name = name;
_prefix = prefix; _prefix = prefix;
@ -148,6 +159,10 @@ public class ServerGroup
_whitelist = whitelist; _whitelist = whitelist;
_resourcePack = resourcePack; _resourcePack = resourcePack;
_region = region; _region = region;
_teamServerKey = teamServerKey;
_portalBottomCornerLocation = portalBottomCornerLocation;
_portalTopCornerLocation = portalTopCornerLocation;
_npcName = npcName;
} }
public String getName() { return _name; } public String getName() { return _name; }
@ -196,6 +211,12 @@ public class ServerGroup
public String getResourcePack() { return _resourcePack; } public String getResourcePack() { return _resourcePack; }
public Region getRegion() { return _region; } 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<MinecraftServer> getServers() { return _servers; } public Set<MinecraftServer> getServers() { return _servers; }
public int getServerCount() public int getServerCount()
@ -350,6 +371,10 @@ public class ServerGroup
_dataMap.put("resourcePack", _resourcePack); _dataMap.put("resourcePack", _resourcePack);
_dataMap.put("host", _host); _dataMap.put("host", _host);
_dataMap.put("region", _region.name()); _dataMap.put("region", _region.name());
_dataMap.put("teamServerKey", _teamServerKey);
_dataMap.put("portalBottomCornerLocation", _portalBottomCornerLocation);
_dataMap.put("portalTopCornerLocation", _portalTopCornerLocation);
_dataMap.put("npcName", _npcName);
} }
return _dataMap; return _dataMap;

View File

@ -28,7 +28,7 @@ public class ServerManager
// The cached repository instances // The cached repository instances
private static Map<Region, ServerRepository> repositories = new HashMap<Region, ServerRepository>(); private static Map<Region, ServerRepository> repositories = new HashMap<Region, ServerRepository>();
/** /**
* @param host - the host url used to connect to the database * @param host - the host url used to connect to the database
* @param port - the port to connect to the repository * @param port - the port to connect to the repository

View File

@ -48,6 +48,7 @@ import mineplex.core.status.ServerStatusManager;
import mineplex.core.teleport.Teleport; import mineplex.core.teleport.Teleport;
import mineplex.core.updater.FileUpdater; import mineplex.core.updater.FileUpdater;
import mineplex.core.updater.Updater; import mineplex.core.updater.Updater;
import mineplex.core.velocity.VelocityFix;
import mineplex.core.visibility.VisibilityManager; import mineplex.core.visibility.VisibilityManager;
import mineplex.minecraft.game.core.combat.CombatManager; import mineplex.minecraft.game.core.combat.CombatManager;
import mineplex.minecraft.game.core.damage.DamageManager; import mineplex.minecraft.game.core.damage.DamageManager;
@ -86,10 +87,14 @@ public class Arcade extends JavaPlugin
_clientManager = new CoreClientManager(this, webServerAddress); _clientManager = new CoreClientManager(this, webServerAddress);
CommandCenter.Instance.setClientManager(_clientManager); CommandCenter.Instance.setClientManager(_clientManager);
ItemStackFactory.Initialize(this, false); ItemStackFactory.Initialize(this, false);
Recharge.Initialize(this); Recharge.Initialize(this);
VisibilityManager.Initialize(this); VisibilityManager.Initialize(this);
Give.Initialize(this); Give.Initialize(this);
//Velocity Fix
new VelocityFix(this);
_donationManager = new DonationManager(this, _clientManager, webServerAddress); _donationManager = new DonationManager(this, _clientManager, webServerAddress);

View File

@ -1,5 +1,6 @@
package nautilus.game.arcade; package nautilus.game.arcade;
import java.awt.Event;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet; 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.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilPlayer; 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.Game.GameState;
import nautilus.game.arcade.game.GameServerConfig; import nautilus.game.arcade.game.GameServerConfig;
import nautilus.game.arcade.game.GameTeam; 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.game.games.uhc.UHC;
import nautilus.game.arcade.managers.GameAchievementManager; import nautilus.game.arcade.managers.GameAchievementManager;
import nautilus.game.arcade.managers.GameChatManager; import nautilus.game.arcade.managers.GameChatManager;
@ -143,6 +146,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
private Creature _creature; private Creature _creature;
private DamageManager _damageManager; private DamageManager _damageManager;
private Explosion _explosionManager; private Explosion _explosionManager;
private EventModule _eventManager;
private Fire _fire; private Fire _fire;
private ProjectileManager _projectileManager; private ProjectileManager _projectileManager;
@ -257,6 +261,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
_cosmeticManager = cosmeticManager; _cosmeticManager = cosmeticManager;
_portal = portal; _portal = portal;
_petManager = petManager; _petManager = petManager;
_eventManager = new EventModule(this, getPlugin());
// Shop // Shop
_arcadeShop = new ArcadeShop(this, clientManager, donationManager); _arcadeShop = new ArcadeShop(this, clientManager, donationManager);
@ -562,6 +567,11 @@ public class ArcadeManager extends MiniPlugin implements IRelation
return _gameWorldManager; return _gameWorldManager;
} }
public EventModule GetEventModule()
{
return _eventManager;
}
public PreferencesManager getPreferences() public PreferencesManager getPreferences()
{ {
return _preferencesManager; return _preferencesManager;
@ -653,7 +663,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
return; return;
} }
if (!GetServerConfig().PublicServer) if (!GetServerConfig().PublicServer || GetServerConfig().PlayerServerWhitelist)
{ {
event.setMotd(ChatColor.GRAY + "Private"); event.setMotd(ChatColor.GRAY + "Private");
return; 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."); event.disallow(PlayerLoginEvent.Result.KICK_OTHER, C.Bold + "Server has reached max capacity for gameplay purposes.");
return; 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.allow();
event.setResult(PlayerLoginEvent.Result.ALLOWED); 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) public boolean IsAlive(Player player)
{ {
if (_game == null) if (_game == null)
@ -1307,7 +1334,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
player.teleport(GetGame().GetSpectatorLocation()); player.teleport(GetGame().GetSpectatorLocation());
//Set Spec State //Set Spec State
player.setVelocity(new Vector(0,1,0)); UtilAction.velocity(player, new Vector(0,1,0));
player.setAllowFlight(true); player.setAllowFlight(true);
player.setFlying(true); player.setFlying(true);
player.setFlySpeed(0.1f); player.setFlySpeed(0.1f);

View File

@ -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.runner.Runner;
import nautilus.game.arcade.game.games.searchanddestroy.SearchAndDestroy; import nautilus.game.arcade.game.games.searchanddestroy.SearchAndDestroy;
import nautilus.game.arcade.game.games.sheep.SheepGame; import nautilus.game.arcade.game.games.sheep.SheepGame;
import nautilus.game.arcade.game.games.skywars.Skywars; import nautilus.game.arcade.game.games.skywars.SoloSkywars;
import nautilus.game.arcade.game.games.smash.SuperSmash; 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.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.snake.Snake;
import nautilus.game.arcade.game.games.sneakyassassins.SneakyAssassins; import nautilus.game.arcade.game.games.sneakyassassins.SneakyAssassins;
import nautilus.game.arcade.game.games.snowfight.SnowFight; 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.spleef.SpleefTeams;
import nautilus.game.arcade.game.games.squidshooter.SquidShooter; import nautilus.game.arcade.game.games.squidshooter.SquidShooter;
import nautilus.game.arcade.game.games.stacker.Stacker; import nautilus.game.arcade.game.games.stacker.Stacker;
import nautilus.game.arcade.game.games.survivalgames.SurvivalGames; import nautilus.game.arcade.game.games.survivalgames.SoloSurvivalGames;
import nautilus.game.arcade.game.games.survivalgames.SurvivalGamesTeams; import nautilus.game.arcade.game.games.survivalgames.TeamSurvivalGames;
import nautilus.game.arcade.game.games.tug.Tug; import nautilus.game.arcade.game.games.tug.Tug;
import nautilus.game.arcade.game.games.turfforts.TurfForts; import nautilus.game.arcade.game.games.turfforts.TurfForts;
import nautilus.game.arcade.game.games.uhc.UHC; import nautilus.game.arcade.game.games.uhc.UHC;
@ -70,7 +71,7 @@ public enum GameType
ChampionsDominate(ChampionsDominate.class, GameDisplay.ChampionsDominate), ChampionsDominate(ChampionsDominate.class, GameDisplay.ChampionsDominate),
//ChampionsMOBA(ChampionsMOBA.class, "Champions MOBA", "Champions", Material.SKULL_ITEM, (byte)0, GameCategory.CHAMPIONS, 7), //ChampionsMOBA(ChampionsMOBA.class, "Champions MOBA", "Champions", Material.SKULL_ITEM, (byte)0, GameCategory.CHAMPIONS, 7),
ChampionsTDM(ChampionsTDM.class, GameDisplay.ChampionsTDM), 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), DeathTag(DeathTag.class, GameDisplay.DeathTag),
DragonEscape(DragonEscape.class, GameDisplay.DragonEscape), DragonEscape(DragonEscape.class, GameDisplay.DragonEscape),
DragonEscapeTeams(DragonEscapeTeams.class, GameDisplay.DragonEscapeTeams), DragonEscapeTeams(DragonEscapeTeams.class, GameDisplay.DragonEscapeTeams),
@ -81,7 +82,7 @@ public enum GameType
Evolution(Evolution.class, GameDisplay.Evolution), Evolution(Evolution.class, GameDisplay.Evolution),
//FlappyBird(FlappyBird.class, "Flappy Bird", Material.FEATHER, (byte)0, GameCategory.ARCADE, 17), //FlappyBird(FlappyBird.class, "Flappy Bird", Material.FEATHER, (byte)0, GameCategory.ARCADE, 17),
Gravity(Gravity.class, GameDisplay.Gravity), 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), HideSeek(HideSeek.class, GameDisplay.HideSeek),
HoleInTheWall(HoleInTheWall.class, GameDisplay.HoleInTheWall), HoleInTheWall(HoleInTheWall.class, GameDisplay.HoleInTheWall),
Horse(Horse.class, GameDisplay.Horse), Horse(Horse.class, GameDisplay.Horse),
@ -98,9 +99,9 @@ public enum GameType
SearchAndDestroy(SearchAndDestroy.class, GameDisplay.SearchAndDestroy), SearchAndDestroy(SearchAndDestroy.class, GameDisplay.SearchAndDestroy),
Sheep(SheepGame.class, GameDisplay.Sheep), Sheep(SheepGame.class, GameDisplay.Sheep),
Smash(SuperSmash.class, GameDisplay.Smash), Smash(SoloSuperSmash.class, GameDisplay.Smash),
SmashDomination(SuperSmashDominate.class, GameDisplay.SmashDomination), 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), Snake(Snake.class, GameDisplay.Snake),
SneakyAssassins(SneakyAssassins.class, GameDisplay.SneakyAssassins), SneakyAssassins(SneakyAssassins.class, GameDisplay.SneakyAssassins),
SnowFight(SnowFight.class, GameDisplay.SnowFight), SnowFight(SnowFight.class, GameDisplay.SnowFight),
@ -108,23 +109,35 @@ public enum GameType
SpleefTeams(SpleefTeams.class, GameDisplay.SpleefTeams), SpleefTeams(SpleefTeams.class, GameDisplay.SpleefTeams),
SquidShooter(SquidShooter.class, GameDisplay.SquidShooter), SquidShooter(SquidShooter.class, GameDisplay.SquidShooter),
Stacker(Stacker.class, GameDisplay.Stacker), Stacker(Stacker.class, GameDisplay.Stacker),
SurvivalGames(SurvivalGames.class, GameDisplay.SurvivalGames), SurvivalGames(SoloSurvivalGames.class, GameDisplay.SurvivalGames),
SurvivalGamesTeams(SurvivalGamesTeams.class, GameDisplay.SurvivalGamesTeams), SurvivalGamesTeams(TeamSurvivalGames.class, GameDisplay.SurvivalGamesTeams, new GameType[]{GameType.SurvivalGames}, false),
Tug(Tug.class, GameDisplay.Tug), Tug(Tug.class, GameDisplay.Tug),
TurfWars(TurfForts.class, GameDisplay.TurfWars), TurfWars(TurfForts.class, GameDisplay.TurfWars),
UHC(UHC.class, GameDisplay.UHC), UHC(UHC.class, GameDisplay.UHC),
WitherAssault(WitherGame.class, GameDisplay.WitherAssault), WitherAssault(WitherGame.class, GameDisplay.WitherAssault),
Wizards(Wizards.class, GameDisplay.Wizards, "http://chivebox.com/file/c/ResWizards.zip", true), Wizards(Wizards.class, GameDisplay.Wizards, "http://chivebox.com/file/c/ResWizards.zip", true),
ZombieSurvival(ZombieSurvival.class, GameDisplay.ZombieSurvival), ZombieSurvival(ZombieSurvival.class, GameDisplay.ZombieSurvival),
Build(Build.class, GameDisplay.Build), Build(Build.class, GameDisplay.Build),
Cards(Cards.class, GameDisplay.Cards), 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; GameDisplay _display;
boolean _enforceResourcePack; boolean _enforceResourcePack;
GameType[] _mapSource;
boolean _ownMaps;
String _resourcePack; String _resourcePack;
Class<? extends Game> _gameClass; Class<? extends Game> _gameClass;
@ -133,17 +146,29 @@ public enum GameType
GameType(Class<? extends Game> gameClass, GameDisplay display) 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) 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; _display = display;
_gameClass = gameClass; _gameClass = gameClass;
_resourcePack = resourcePackUrl; _resourcePack = resourcePackUrl;
_enforceResourcePack = enforceResourcePack; _enforceResourcePack = enforceResourcePack;
_mapSource = mapSource;
_ownMaps = ownMaps;
} }
public Class<? extends Game> getGameClass() public Class<? extends Game> getGameClass()
{ {
return _gameClass; return _gameClass;
@ -158,6 +183,16 @@ public enum GameType
{ {
return _resourcePack; return _resourcePack;
} }
public GameType[] getMapSource()
{
return _mapSource;
}
public boolean ownMaps()
{
return _ownMaps;
}
public String GetName() public String GetName()
{ {
@ -183,4 +218,5 @@ public enum GameType
{ {
return _display.getGameCategory(); return _display.getGameCategory();
} }
} }

View File

@ -3,9 +3,8 @@ package nautilus.game.arcade.command;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import nautilus.game.arcade.ArcadeManager;
import net.minecraft.util.com.mojang.authlib.GameProfile; import net.minecraft.util.com.mojang.authlib.GameProfile;
import mineplex.core.command.CommandBase; import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank; import mineplex.core.common.Rank;
import mineplex.core.common.util.C; 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.UUIDFetcher;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.disguise.disguises.DisguisePlayer; import mineplex.core.disguise.disguises.DisguisePlayer;
import nautilus.game.arcade.ArcadeManager;
public class DisguiseCommand extends CommandBase<ArcadeManager> public class DisguiseCommand extends CommandBase<ArcadeManager>
{ {
public DisguiseCommand(ArcadeManager plugin) 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 @Override

View File

@ -25,7 +25,7 @@ public class GameCommand extends MultiCommandBase<ArcadeManager>
UtilPlayer.message(caller, F.main(Plugin.getName(), "Commands List:")); 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 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 stop", "Stop the current game", Rank.ADMIN));
UtilPlayer.message(caller, F.help("/game set <GameType> (Map)", "Set the current game or next game", Rank.ADMIN)); UtilPlayer.message(caller, F.help("/game set <GameType> (MapSource) (Map)", "Set the current game or next game", Rank.ADMIN));
UtilPlayer.message(caller, F.main("Tip", "Use TAB for games/maps!")); UtilPlayer.message(caller, F.main("Tip", "Use TAB for games/maps!"));
} }
} }

View File

@ -29,16 +29,31 @@ public class SetCommand extends CommandBase<ArcadeManager>
if (args == null || args.length == 0) if (args == null || args.length == 0)
{ {
caller.sendMessage(F.help("/game set <GameType> (Map)", "Set the current game or next game", Rank.ADMIN)); caller.sendMessage(F.help("/game set <GameType> (MapSource) (Map)", "Set the current game or next game", Rank.ADMIN));
return; return;
} }
String game = args[0].toLowerCase(); String game = args[0].toLowerCase();
if (args.length > 1) if (args.length >= 2)
{ {
Plugin.GetGameCreationManager().MapPref = args[1]; String map = "";
UtilPlayer.message(caller, C.cAqua + C.Bold + "Map Preference: " + ChatColor.RESET + args[1]); 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 //Parse Game

View File

@ -11,7 +11,7 @@ public class WriteCommand extends CommandBase<ArcadeManager>
{ {
public WriteCommand(ArcadeManager plugin) public WriteCommand(ArcadeManager plugin)
{ {
super(plugin, Rank.ADMIN, "write"); super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "write");
} }
@Override @Override

View File

@ -86,7 +86,7 @@ public abstract class Game implements Listener
protected String[] _gameDesc; protected String[] _gameDesc;
//Map //Map
private ArrayList<String> _files; private HashMap<GameType, ArrayList<String>> _files;
//State //State
private GameState _gameState = GameState.Loading; private GameState _gameState = GameState.Loading;
@ -193,8 +193,6 @@ public abstract class Game implements Listener
public int HungerSet = -1; public int HungerSet = -1;
public int HealthSet = -1; public int HealthSet = -1;
public int SpawnDistanceRequirement = 1;
public boolean PrepareFreeze = true; public boolean PrepareFreeze = true;
private double _itemMergeRadius = 0; private double _itemMergeRadius = 0;
@ -211,6 +209,11 @@ public abstract class Game implements Listener
public int TickPerTeleport = 1; public int TickPerTeleport = 1;
public int FillTeamsInOrderToCount = -1;
public boolean SpawnNearAllies = false;
public boolean SpawnNearEnemies = false;
public boolean StrictAntiHack = false; public boolean StrictAntiHack = false;
public boolean DisableKillCommand = true; public boolean DisableKillCommand = true;
@ -265,6 +268,9 @@ public abstract class Game implements Listener
public boolean CanAddStats = true; public boolean CanAddStats = true;
public boolean CanGiveLoot = true; public boolean CanGiveLoot = true;
public boolean HideTeamSheep = false;
public boolean ReplaceTeamsWithKits = false;
public boolean VersionRequire1_8 = false; public boolean VersionRequire1_8 = false;
public ArrayList<String> GemBoosters = new ArrayList<String>(); public ArrayList<String> GemBoosters = new ArrayList<String>();
@ -288,16 +294,28 @@ public abstract class Game implements Listener
Scoreboard = new GameScoreboard(this); Scoreboard = new GameScoreboard(this);
//Map Select //Map Select
_files = Manager.LoadFiles(GetName()); _files = new HashMap<GameType, ArrayList<String>>();
for(GameType type : GetWorldHostNames())
{
_files.put(type, Manager.LoadFiles(type.GetName()));
}
if (Manager.GetGameCreationManager().MapPref != null) if (Manager.GetGameCreationManager().MapPref != null)
{ {
ArrayList<String> matches = new ArrayList<String>(); HashMap<GameType, ArrayList<String>> matches = new HashMap<GameType, ArrayList<String>>();
for (String cur : _files) for (GameType game : _files.keySet())
{ {
if (cur.toLowerCase().contains(Manager.GetGameCreationManager().MapPref.toLowerCase())) ArrayList<String> list = new ArrayList<String>();
for(String cur : _files.get(game))
{ {
matches.add(cur); if (cur.toLowerCase().contains(Manager.GetGameCreationManager().MapPref.toLowerCase()))
System.out.print("Map Preference: " + cur); {
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; _files = matches;
Manager.GetGameCreationManager().MapPref = null; Manager.GetGameCreationManager().MapPref = null;
Manager.GetGameCreationManager().MapSource = null;
} }
WorldData = new WorldData(this); WorldData = new WorldData(this);
@ -339,7 +358,7 @@ public abstract class Game implements Listener
_kits = kits; _kits = kits;
} }
public ArrayList<String> GetFiles() public HashMap<GameType, ArrayList<String>> GetFiles()
{ {
return _files; return _files;
} }
@ -348,6 +367,60 @@ public abstract class Game implements Listener
{ {
return _gameType.GetName(); 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<String> maps)
{
for(GameType game : _files.keySet())
{
if(maps.equals(_files.get(game)))
{
return game;
}
}
return null;
}
public String GetMode() public String GetMode()
{ {
@ -472,9 +545,6 @@ public abstract class Game implements Listener
//Add //Add
GetTeamList().add(team); GetTeamList().add(team);
//Set Spawn Data
team.SetSpawnRequirement(this.SpawnDistanceRequirement);
System.out.println("Created Team: " + team.GetName()); System.out.println("Created Team: " + team.GetName());
} }
@ -556,6 +626,17 @@ public abstract class Game implements Listener
public GameTeam ChooseTeam(Player player) 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; GameTeam team = null;
//Random Team //Random Team
@ -1381,4 +1462,5 @@ public abstract class Game implements Listener
//End //End
SetState(GameState.End); SetState(GameState.End);
} }
} }

View File

@ -36,6 +36,8 @@ public class GameServerConfig
public boolean PlayerKickIdle = true; public boolean PlayerKickIdle = true;
public boolean PublicServer = true; public boolean PublicServer = true;
public boolean PlayerServerWhitelist = false;
public boolean IsValid() public boolean IsValid()
{ {

View File

@ -5,8 +5,10 @@ import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import mineplex.core.account.CoreClient;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
@ -60,19 +62,19 @@ public class GameTeam
private HashMap<Player, PlayerState> _players = new HashMap<Player, PlayerState>(); private HashMap<Player, PlayerState> _players = new HashMap<Player, PlayerState>();
private ArrayList<Location> _spawns; private ArrayList<Location> _spawns;
private Creature _teamEntity = null; private Creature _teamEntity = null;
private HashSet<Kit> _kitRestrict = new HashSet<Kit>(); private HashSet<Kit> _kitRestrict = new HashSet<Kit>();
private int _spawnDistance = 0;
private boolean _visible = true; private boolean _visible = true;
private boolean _displayTag;
//Records order players go out in //Records order players go out in
protected ArrayList<Player> _places = new ArrayList<Player>(); protected ArrayList<Player> _places = new ArrayList<Player>();
public GameTeam(Game host, String name, ChatColor color, ArrayList<Location> spawns) public GameTeam(Game host, String name, ChatColor color, ArrayList<Location> spawns, boolean tags)
{ {
Host = host; Host = host;
@ -80,6 +82,12 @@ public class GameTeam
_name = name; _name = name;
_color = color; _color = color;
_spawns = spawns; _spawns = spawns;
_displayTag = tags;
}
public GameTeam(Game host, String name, ChatColor color, ArrayList<Location> spawns)
{
this(host, name, color, spawns, false);
} }
public String GetName() public String GetName()
@ -99,40 +107,48 @@ public class GameTeam
public Location GetSpawn() public Location GetSpawn()
{ {
// ArrayList<Location> valid = new ArrayList<Location>(); //Keep allies together
if (!Host.IsLive() && Host.SpawnNearAllies)
Location best = null;
double bestDist = 0;
for (Location loc : _spawns)
{ {
double closestPlayer = -1; //Find Location Nearest Ally
Location loc = UtilAlg.getLocationNearPlayers(_spawns, GetPlayers(true), Host.GetPlayers(true));
for (Player player : 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); loc = UtilAlg.getLocationNearPlayers(_spawns, Host.GetPlayers(true), Host.GetPlayers(true));
if (loc != null)
if (closestPlayer == -1 || playerDist < closestPlayer) return loc;
closestPlayer = playerDist;
} }
//Spawn away from enemies
if (best == null || closestPlayer > bestDist) else
{ {
best = loc; loc = UtilAlg.getLocationAwayFromPlayers(_spawns, Host.GetPlayers(true));
bestDist = closestPlayer; if (loc != null)
} return loc;
}
// if (closestPlayer > _spawnDistance * _spawnDistance) }
// { else
// valid.add(loc); {
// } //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())); return _spawns.get(UtilMath.r(_spawns.size()));
} }
@ -149,7 +165,14 @@ public class GameTeam
public void DisbandTeam() public void DisbandTeam()
{ {
for (Player player : _players.keySet()) 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.")); UtilPlayer.message(player, F.main("Team", _color + C.Bold + _displayName + " Team was disbanded."));
}
_players.clear(); _players.clear();
} }
@ -333,11 +356,6 @@ public class GameTeam
_spawns = spawns; _spawns = spawns;
} }
public void SetSpawnRequirement(int value)
{
_spawnDistance = value;
}
public void SetVisible(boolean b) public void SetVisible(boolean b)
{ {
_visible = b; _visible = b;
@ -347,6 +365,16 @@ public class GameTeam
{ {
return _visible; return _visible;
} }
public void setDisplayTag(boolean b)
{
_displayTag = b;
}
public boolean GetDisplaytag()
{
return _displayTag;
}
public void SetRespawnTime(double i) public void SetRespawnTime(double i)
{ {
@ -390,6 +418,4 @@ public class GameTeam
return _places; return _places;
} }
} }

View File

@ -45,6 +45,7 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.MapUtil; import mineplex.core.common.util.MapUtil;
import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilEvent;
@ -1178,7 +1179,7 @@ public class Bridge extends TeamGame implements OreObsfucation
UtilPlayer.message(event.getPlayer(), F.main("Game", UtilPlayer.message(event.getPlayer(), F.main("Game",
"Cannot place blocks in liquids until Bridge is down.")); "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); event.setCancelled(true);
return; return;

View File

@ -67,6 +67,7 @@ import mineplex.core.common.Rank;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilEvent.ActionType;
@ -707,7 +708,7 @@ public class Build extends SoloGame
event.setTo(event.getFrom()); event.setTo(event.getFrom());
//Velocity //Velocity
event.getPlayer().setVelocity(UtilAlg.getTrajectory(event.getTo(), data.Spawn)); UtilAction.velocity(event.getPlayer(), UtilAlg.getTrajectory(event.getTo(), data.Spawn));
} }
} }

View File

@ -34,6 +34,7 @@ import org.bukkit.util.Vector;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
@ -526,8 +527,7 @@ public class DragonEscape extends SoloGame
//Teleport //Teleport
player.teleport(target.getLocation().add(0, 0.5, 0)); player.teleport(target.getLocation().add(0, 0.5, 0));
player.setVelocity(new Vector(0,0,0)); UtilAction.velocity(player, new Vector(0,0,0));
player.setFallDistance(0);
//Record //Record
_warpTime.put(player, System.currentTimeMillis()); _warpTime.put(player, System.currentTimeMillis());

View File

@ -26,6 +26,7 @@ import org.bukkit.util.Vector;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilInv;
@ -540,8 +541,7 @@ public class DragonEscapeTeams extends TeamGame
//Teleport //Teleport
player.teleport(target.getLocation().add(0, 0.5, 0)); player.teleport(target.getLocation().add(0, 0.5, 0));
player.setVelocity(new Vector(0,0,0)); UtilAction.velocity(player, new Vector(0,0,0));
player.setFallDistance(0);
//Record //Record
_warpTime.put(player, System.currentTimeMillis()); _warpTime.put(player, System.currentTimeMillis());

View File

@ -99,7 +99,7 @@ public class Evolution extends SoloGame
PrepareFreeze = false; PrepareFreeze = false;
SpawnDistanceRequirement = 16; this.PrepareFreeze = false;
GemKillDeathRespawn = 2; GemKillDeathRespawn = 2;
GemAssistDeathRespawn = .5; GemAssistDeathRespawn = .5;

View File

@ -8,6 +8,7 @@ import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map.Entry; import java.util.Map.Entry;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
@ -15,6 +16,7 @@ import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType; import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Kit;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
@ -225,7 +227,8 @@ public class HoleInTheWall extends SoloGame
{ {
wall.getKnockedPlayers().add(player.getUniqueId()); wall.getKnockedPlayers().add(player.getUniqueId());
player.setVelocity(_wallVector.clone().normalize().multiply(5).setY(0.3));
UtilAction.velocity(player, _wallVector.clone().normalize().multiply(5).setY(0.3));
player.playSound(player.getLocation(), Sound.NOTE_BASS, 2, 1F); player.playSound(player.getLocation(), Sound.NOTE_BASS, 2, 1F);
} }
/*Location toTeleport = player.getLocation(); /*Location toTeleport = player.getLocation();

View File

@ -33,12 +33,12 @@ import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.games.lobbers.events.TNTPreExplodeEvent; import nautilus.game.arcade.game.games.lobbers.events.TNTPreExplodeEvent;
import nautilus.game.arcade.game.games.lobbers.events.TNTThrowEvent; import nautilus.game.arcade.game.games.lobbers.events.TNTThrowEvent;
import nautilus.game.arcade.game.games.lobbers.kits.KitArmorer; import nautilus.game.arcade.game.games.lobbers.kits.KitArmorer;
import nautilus.game.arcade.game.games.lobbers.kits.KitPitcher;
import nautilus.game.arcade.game.games.lobbers.kits.KitJumper; import nautilus.game.arcade.game.games.lobbers.kits.KitJumper;
import nautilus.game.arcade.game.games.lobbers.kits.KitPitcher;
import nautilus.game.arcade.game.games.lobbers.kits.KitWaller; import nautilus.game.arcade.game.games.lobbers.kits.KitWaller;
import nautilus.game.arcade.game.games.lobbers.trackers.Tracker6Kill; import nautilus.game.arcade.game.games.lobbers.trackers.Tracker6Kill;
import nautilus.game.arcade.game.games.lobbers.trackers.TrackerBestTeam;
import nautilus.game.arcade.game.games.lobbers.trackers.TrackerBlastProof; import nautilus.game.arcade.game.games.lobbers.trackers.TrackerBlastProof;
import nautilus.game.arcade.game.games.lobbers.trackers.TrackerDirectHit;
import nautilus.game.arcade.game.games.lobbers.trackers.TrackerNoDamage; import nautilus.game.arcade.game.games.lobbers.trackers.TrackerNoDamage;
import nautilus.game.arcade.game.games.lobbers.trackers.TrackerTNTThrown; import nautilus.game.arcade.game.games.lobbers.trackers.TrackerTNTThrown;
import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Kit;
@ -79,7 +79,6 @@ public class BombLobbers extends TeamGame implements IThrown
new KitJumper(manager), new KitJumper(manager),
new KitArmorer(manager), new KitArmorer(manager),
new KitPitcher(manager), new KitPitcher(manager),
// new KitMortar(manager), << Spare time kit for Bobbeh
new KitWaller(manager) new KitWaller(manager)
}, new String[] }, new String[]
{ {
@ -109,7 +108,21 @@ public class BombLobbers extends TeamGame implements IThrown
HungerSet = 20; HungerSet = 20;
registerStatTrackers(new Tracker6Kill(this), new TrackerBestTeam(this), new TrackerBlastProof(this), new TrackerNoDamage(this), new TrackerTNTThrown(this)); WorldTimeSet = 6000;
registerStatTrackers(new Tracker6Kill(this), new TrackerBlastProof(this), new TrackerNoDamage(this), new TrackerTNTThrown(this), new TrackerDirectHit(this));
}
@EventHandler
public void setTime(GameStateChangeEvent event)
{
if (event.GetState() != GameState.Prepare)
return;
if (WorldData.MapName.equalsIgnoreCase("Intergalactic"))
{
WorldTimeSet = 18000;
}
} }
public void addKill(Player player) public void addKill(Player player)
@ -295,6 +308,8 @@ public class BombLobbers extends TeamGame implements IThrown
if (!IsLive()) if (!IsLive())
return; return;
NautHashMap<TNTPrimed, BombToken> toAdd = new NautHashMap<TNTPrimed, BombToken>();
Iterator<Entry<TNTPrimed, BombToken>> iterator = _tnt.entrySet().iterator(); Iterator<Entry<TNTPrimed, BombToken>> iterator = _tnt.entrySet().iterator();
while (iterator.hasNext()) while (iterator.hasNext())
{ {
@ -330,10 +345,16 @@ public class BombLobbers extends TeamGame implements IThrown
tnt.getKey().remove(); tnt.getKey().remove();
iterator.remove(); iterator.remove();
_tnt.put(newTNT, token); toAdd.put(newTNT, token);
} }
} }
} }
//Prevent concurrent modification thigns
for (Entry<TNTPrimed, BombToken> entry : toAdd.entrySet())
{
_tnt.put(entry.getKey(), entry.getValue());
}
} }
@EventHandler @EventHandler
@ -540,7 +561,7 @@ public class BombLobbers extends TeamGame implements IThrown
if (target != null) if (target != null)
UtilAction.velocity(target, UtilAlg.getTrajectory2d(data.GetThrown().getLocation(), target.getLocation()), .2, false, 0, 0.2, .4, true); UtilAction.velocity(target, UtilAlg.getTrajectory2d(data.GetThrown().getLocation(), target.getLocation()), .2, false, 0, 0.2, .4, true);
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, DamageCause.PROJECTILE, 6.0, false, false, true, "Throwing TNT", "Throwing TNT Direct Hit"); Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, DamageCause.PROJECTILE, 10.0, false, false, false, "Throwing TNT", "Throwing TNT Direct Hit");
} }
@Override @Override
@ -560,6 +581,6 @@ public class BombLobbers extends TeamGame implements IThrown
if (event.GetCause() != DamageCause.ENTITY_EXPLOSION && event.GetCause() != DamageCause.BLOCK_EXPLOSION) if (event.GetCause() != DamageCause.ENTITY_EXPLOSION && event.GetCause() != DamageCause.BLOCK_EXPLOSION)
return; return;
event.AddKnockback("Explosion", 1.5D); event.AddKnockback("Explosion", 1.7D);
} }
} }

View File

@ -8,11 +8,13 @@ import nautilus.game.arcade.game.games.lobbers.kits.perks.PerkCraftman;
import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkDummy;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
public class KitArmorer extends Kit public class KitArmorer extends Kit
{ {
@ -21,15 +23,18 @@ public class KitArmorer extends Kit
{ {
super(manager, "Armorer", KitAvailability.Gem, 2000, new String[] super(manager, "Armorer", KitAvailability.Gem, 2000, new String[]
{ {
"He uses his expert armor-making", C.cGray + "He uses his expert armor-making",
"skills to block excess damage!", C.cGray + "skills to block excess damage!"
"",
C.cGray + "Recieve " + C.cYellow + "Full Gold Armor"
}, new Perk[] }, new Perk[]
{ {
new PerkDummy("Armorer",
new String[]
{
C.cGray + "Recieve " + C.cYellow + "Full Gold Armor"
}),
new PerkCraftman() new PerkCraftman()
}, EntityType.ZOMBIE, }, EntityType.ZOMBIE,
new ItemBuilder(Material.GOLD_INGOT).build()); new ItemBuilder(Material.GOLD_HELMET).build());
} }
@Override @Override
@ -49,16 +54,15 @@ public class KitArmorer extends Kit
UtilInv.Update(player); UtilInv.Update(player);
} }
@Override
public void SpawnCustom(LivingEntity ent)
{
ent.getEquipment().setHelmet(new ItemBuilder(Material.GOLD_HELMET).build());
ent.getEquipment().setChestplate(new ItemBuilder(Material.GOLD_CHESTPLATE).build());
ent.getEquipment().setLeggings(new ItemBuilder(Material.GOLD_LEGGINGS).build());
ent.getEquipment().setBoots(new ItemBuilder(Material.GOLD_BOOTS).build());
}
@Override
public void SpawnCustom(LivingEntity entity)
{
entity.getEquipment().setChestplate(new ItemStack(Material.GOLD_CHESTPLATE));
entity.getEquipment().setLeggings(new ItemStack(Material.GOLD_LEGGINGS));
entity.getEquipment().setBoots(new ItemStack(Material.GOLD_BOOTS));
}
@Override @Override
public void GiveItems(Player player) public void GiveItems(Player player)
{ {

View File

@ -1,5 +1,6 @@
package nautilus.game.arcade.game.games.lobbers.kits; package nautilus.game.arcade.game.games.lobbers.kits;
import mineplex.core.common.util.C;
import mineplex.core.itemstack.ItemBuilder; import mineplex.core.itemstack.ItemBuilder;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
@ -8,6 +9,7 @@ import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkDoubleJump; import nautilus.game.arcade.kit.perks.PerkDoubleJump;
import nautilus.game.arcade.kit.perks.PerkDummy;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
@ -22,11 +24,15 @@ public class KitJumper extends Kit
{ {
super(manager, "Jumper", KitAvailability.Free, 0, new String[] super(manager, "Jumper", KitAvailability.Free, 0, new String[]
{ {
"Use your jumping abilities to leap away from trouble!", C.cGray + "Use your jumping abilities to leap away from trouble!"
"You take no fall damage."
}, new Perk[] }, new Perk[]
{ {
new PerkDoubleJump("Double Jump", 1.2, 1.2, false, 6000, true), new PerkDoubleJump("Double Jump", 1.2, 1.2, false, 6000, true),
new PerkDummy("Feathered Boots",
new String[]
{
C.cGray + "You take no fall damage."
}),
new PerkCraftman() new PerkCraftman()
}, EntityType.ZOMBIE, new ItemBuilder(Material.IRON_AXE).build()); }, EntityType.ZOMBIE, new ItemBuilder(Material.IRON_AXE).build());
} }

View File

@ -13,6 +13,7 @@ import nautilus.game.arcade.game.games.lobbers.kits.perks.PerkCraftman;
import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkDummy;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
@ -27,14 +28,16 @@ public class KitPitcher extends Kit
{ {
super(manager, "Pitcher", KitAvailability.Gem, 4000, new String[] super(manager, "Pitcher", KitAvailability.Gem, 4000, new String[]
{ {
"He can easily pitch the perfect shot for any occasion.", C.cGray + "He can easily pitch the perfect",
"", C.cGray + "shot for any occasion."
C.cYellow + "Left Click" + C.cGray + " lever to " + C.cGreen + "Decrease Velocity",
C.cYellow + "Right Click" + C.cGray + " lever to " + C.cGreen + "Increase Velocity",
"Maximum Velocity of " + C.cYellow + "3.",
"Minimum Velocity of " + C.cYellow + "1.",
}, new Perk[] }, new Perk[]
{ {
new PerkDummy("Pitcher",
new String[]
{
C.cYellow + "Left Click" + C.cGray + " lever to " + C.cGreen + "Decrease Velocity. " + C.cGray + "Minimum of 1.",
C.cYellow + "Right Click" + C.cGray + " lever to " + C.cGreen + "Increase Velocity. " + C.cGray + "Maximum of 3.",
}),
new PerkCraftman() new PerkCraftman()
}, EntityType.ZOMBIE, }, EntityType.ZOMBIE,
new ItemBuilder(Material.LEVER).build()); new ItemBuilder(Material.LEVER).build());
@ -43,7 +46,7 @@ public class KitPitcher extends Kit
@Override @Override
public void GiveItems(Player player) public void GiveItems(Player player)
{ {
player.getInventory().setItem(1, new ItemBuilder(Material.LEVER).setTitle(F.item("Velocity Selector")).setAmount(3).build()); player.getInventory().setItem(1, new ItemBuilder(Material.LEVER).setTitle(F.item("Velocity Selector")).setAmount(2).build());
} }
@EventHandler @EventHandler
@ -112,11 +115,11 @@ public class KitPitcher extends Kit
private double getVelocity(int amount) private double getVelocity(int amount)
{ {
if (amount == 1) if (amount == 1)
return 1.5;
if (amount == 2)
return 1.75; return 1.75;
if (amount == 3)
return 2.25;
return 2.0; return 2.0;
} }
} }

View File

@ -1,5 +1,6 @@
package nautilus.game.arcade.game.games.lobbers.kits; package nautilus.game.arcade.game.games.lobbers.kits;
import mineplex.core.achievement.Achievement;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.itemstack.ItemBuilder; import mineplex.core.itemstack.ItemBuilder;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
@ -27,6 +28,16 @@ public class KitWaller extends Kit
new PerkCraftman() new PerkCraftman()
}, EntityType.ZOMBIE, }, EntityType.ZOMBIE,
new ItemBuilder(Material.SMOOTH_BRICK).setUnbreakable(true).build()); new ItemBuilder(Material.SMOOTH_BRICK).setUnbreakable(true).build());
this.setAchievementRequirements(new Achievement[]
{
Achievement.BOMB_LOBBERS_WINS,
Achievement.BOMB_LOBBERS_ULTIMATE_KILLER,
Achievement.BOMB_LOBBERS_SNIPER,
Achievement.BOMB_LOBBERS_PROFESSIONAL_LOBBER,
Achievement.BOMB_LOBBERS_EXPLOSION_PROOF,
Achievement.BOMB_LOBBERS_BLAST_PROOF
});
} }
@Override @Override
@ -36,3 +47,4 @@ public class KitWaller extends Kit
} }
} }

View File

@ -12,7 +12,6 @@ import org.bukkit.event.EventHandler;
public class Tracker6Kill extends StatTracker<Game> public class Tracker6Kill extends StatTracker<Game>
{ {
public Tracker6Kill(Game game) public Tracker6Kill(Game game)
{ {
super(game); super(game);

Some files were not shown because too many files have changed in this diff Show More