Merge remote-tracking branch 'origin/master' into Myst_EVO
This commit is contained in:
commit
a9350bfacd
@ -18,6 +18,8 @@
|
||||
<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="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>
|
||||
</artifact>
|
||||
</component>
|
@ -37,6 +37,7 @@
|
||||
</codeStyleSettings>
|
||||
</value>
|
||||
</option>
|
||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Mineplex" />
|
||||
</component>
|
||||
</project>
|
@ -21,8 +21,34 @@
|
||||
<profile default="true" name="Default" enabled="false">
|
||||
<processorPath useClasspath="true" />
|
||||
</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>
|
||||
<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 name="JavacSettings">
|
||||
<option name="GENERATE_NO_WARNINGS" value="true" />
|
||||
|
@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
|
||||
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false">
|
||||
<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>
|
||||
|
||||
|
@ -7,6 +7,13 @@
|
||||
</list>
|
||||
</component>
|
||||
<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">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
|
@ -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.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$/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>
|
||||
</component>
|
||||
</project>
|
@ -39,7 +39,7 @@ public class MotdManager implements Listener, Runnable
|
||||
if (new File("updateMOTD.dat").exists())
|
||||
{
|
||||
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(" §f§l◄§c§lMAINTENANCE§f§l►");
|
||||
|
||||
|
@ -1,20 +1,20 @@
|
||||
package mineplex.core.common;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
|
||||
public enum Rank
|
||||
{
|
||||
LT("LT", ChatColor.DARK_RED),
|
||||
OWNER("Owner", ChatColor.DARK_RED),
|
||||
DEVELOPER("Dev", ChatColor.RED),
|
||||
ADMIN("Admin", ChatColor.RED),
|
||||
JNR_DEV("Jr.Dev", ChatColor.RED),
|
||||
SNR_MODERATOR("Sr.Mod", ChatColor.GOLD),
|
||||
MODERATOR("Mod", ChatColor.GOLD),
|
||||
JNR_DEV("Jr.Dev", ChatColor.RED),
|
||||
HELPER("Trainee", ChatColor.DARK_AQUA),
|
||||
MAPLEAD("MapLead", ChatColor.DARK_PURPLE),
|
||||
MAPDEV("Builder", ChatColor.BLUE),
|
||||
|
@ -1,11 +1,23 @@
|
||||
package mineplex.core.common.util;
|
||||
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class UtilAction
|
||||
{
|
||||
private static VelocityReceiver _velocityFix;
|
||||
|
||||
public static void velocity(Entity ent, Vector vec)
|
||||
{
|
||||
velocity(ent, vec, 1, false, 0, 0, vec.length(), false);
|
||||
}
|
||||
|
||||
public static void registerVelocityFix(VelocityReceiver velocityFix)
|
||||
{
|
||||
_velocityFix = velocityFix;
|
||||
}
|
||||
|
||||
public static void velocity(Entity ent, double str, double yAdd, double yMax, boolean groundBoost)
|
||||
{
|
||||
velocity(ent, ent.getLocation().getDirection(), str, false, 0, yAdd, yMax, groundBoost);
|
||||
@ -14,7 +26,10 @@ public class UtilAction
|
||||
public static void velocity(Entity ent, Vector vec, double str, boolean ySet, double yBase, double yAdd, double yMax, boolean groundBoost)
|
||||
{
|
||||
if (Double.isNaN(vec.getX()) || Double.isNaN(vec.getY()) || Double.isNaN(vec.getZ()) || vec.length() == 0)
|
||||
{
|
||||
zeroVelocity(ent);
|
||||
return;
|
||||
}
|
||||
|
||||
//YSet
|
||||
if (ySet)
|
||||
@ -37,6 +52,29 @@ public class UtilAction
|
||||
|
||||
//Velocity
|
||||
ent.setFallDistance(0);
|
||||
|
||||
//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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import java.util.TreeSet;
|
||||
|
||||
|
||||
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -260,4 +261,96 @@ public class UtilAlg
|
||||
return isInPyramid(player.getLocation().getDirection(), UtilAlg.getTrajectory(player.getEyeLocation(), target.getEyeLocation()), angleLimit) ||
|
||||
isInPyramid(player.getLocation().getDirection(), UtilAlg.getTrajectory(player.getEyeLocation(), target.getLocation()), angleLimit);
|
||||
}
|
||||
|
||||
public static Location getLocationAwayFromPlayers(ArrayList<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;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
@ -227,7 +227,7 @@ public class CoreClientManager extends MiniPlugin
|
||||
Bukkit.getServer().getPluginManager().callEvent(new ClientWebResponseEvent(response, uuid));
|
||||
|
||||
if (client.getAccountId() > 0)
|
||||
_accountCacheRepository.addElement(new AccountCache(uuid, client.getAccountId()));
|
||||
_accountCacheRepository.addElement(new AccountCache(uuid, client.getAccountId()), 60 * 60 * 6);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
@ -301,7 +301,16 @@ public class CoreClientManager extends MiniPlugin
|
||||
System.out.println(client.GetPlayerName() + "'s account id = " + client.getAccountId());
|
||||
|
||||
if (client.getAccountId() > 0)
|
||||
_accountCacheRepository.addElement(new AccountCache(uuid, client.getAccountId()));
|
||||
{
|
||||
try
|
||||
{
|
||||
_accountCacheRepository.addElement(new AccountCache(uuid, client.getAccountId()), 60 * 60 * 6);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
return !_clientLoginLock.containsKey(client.GetPlayerName());
|
||||
}
|
||||
|
@ -19,12 +19,20 @@ public class UpdateRank extends CommandBase<CoreClientManager>
|
||||
{
|
||||
public UpdateRank(CoreClientManager plugin)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, "updateRank");
|
||||
super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV /*On test servers only*/}, "updateRank");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Execute(final Player caller, String[] args)
|
||||
{
|
||||
boolean testServer = Plugin.getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
|
||||
|
||||
if (Plugin.Get(caller).GetRank() == Rank.JNR_DEV && !testServer)
|
||||
{
|
||||
F.main(Plugin.getName(), F.elem(Rank.JNR_DEV.GetTag(true, true)) + "s are only permitted to set ranks on test servers!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (args == null)
|
||||
{
|
||||
UtilPlayer.message(caller, F.main(Plugin.getName(), "/" + AliasUsed + " joeschmo MODERATOR"));
|
||||
@ -52,9 +60,9 @@ public class UpdateRank extends CommandBase<CoreClientManager>
|
||||
|
||||
final Rank rank = tempRank;
|
||||
|
||||
if (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR)
|
||||
if (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR || rank == Rank.JNR_DEV || rank == Rank.DEVELOPER)
|
||||
{
|
||||
if (rank == Rank.ADMIN && !Plugin.hasRank(caller, Rank.LT))
|
||||
if (!testServer && rank.Has(Rank.ADMIN) && !Plugin.hasRank(caller, Rank.LT))
|
||||
{
|
||||
UtilPlayer.message(caller, F.main(Plugin.getName(), ChatColor.RED + "" + ChatColor.BOLD + "Insufficient privileges!"));
|
||||
return;
|
||||
|
@ -56,7 +56,7 @@ public enum Achievement
|
||||
//Survival Games
|
||||
SURVIVAL_GAMES_WINS("Katniss Everdeen", 600,
|
||||
new String[]{"Survival Games.Wins"},
|
||||
new String[]{"Win 30 games of Survival Games"},
|
||||
new String[]{"Win 20 games of Survival Games"},
|
||||
new int[]{30},
|
||||
AchievementCategory.SURVIVAL_GAMES),
|
||||
|
||||
@ -87,8 +87,8 @@ public enum Achievement
|
||||
//Skywars
|
||||
SKYWARS_WINS("Sky King",2000,
|
||||
new String[]{"Skywars.Wins"},
|
||||
new String[]{"Win 30 Games of Skywars"},
|
||||
new int[]{30},
|
||||
new String[]{"Win 20 Games of Skywars"},
|
||||
new int[]{20},
|
||||
AchievementCategory.SKYWARS),
|
||||
|
||||
SKYWARS_BOMBER("Master Bomber",500,
|
||||
@ -644,38 +644,30 @@ public enum Achievement
|
||||
new int[]{2000},
|
||||
AchievementCategory.BOMB_LOBBERS),
|
||||
|
||||
// BOMB_LOBBERS_REKT_X3("Rekt x3", 800,
|
||||
// new String[]{"Bomb Lobbers.3Kill"},
|
||||
// new String[]{"Kill 3 players with one explosion"},
|
||||
// new int[]{1},
|
||||
// AchievementCategory.BOMB_LOBBERS),
|
||||
|
||||
BOMB_LOBBERS_ULTIMATE_KILLER("Ultimate Killer", 800,
|
||||
new String[]{"Bomb Lobbers.Killer"},
|
||||
new String[]{"Kill 6 players in a single game"},
|
||||
new int[]{1},
|
||||
AchievementCategory.BOMB_LOBBERS),
|
||||
|
||||
BOMB_LOBBERS_EXPLOSION_PROOF("Jelly Skin", 1000,
|
||||
BOMB_LOBBERS_EXPLOSION_PROOF("Jelly Skin", 1200,
|
||||
new String[]{"Bomb Lobbers.JellySkin"},
|
||||
new String[]{"Win a game without taking any damage."},
|
||||
new int[]{1},
|
||||
AchievementCategory.BOMB_LOBBERS),
|
||||
|
||||
BOMB_LOBBERS_BEST_TEAM("The Best Team", 800,
|
||||
new String[]{"Bomb Lobbers.BestTeam"},
|
||||
new String[]{"Win a game without losing a teammate"},
|
||||
new int[]{1},
|
||||
AchievementCategory.BOMB_LOBBERS),
|
||||
|
||||
BOMB_LOBBERS_BLAST_PROOF("Blast Proof", 800,
|
||||
new String[]{"Bomb Lobbers.BlastProof"},
|
||||
new String[]{"Win 20 games using Armorer"},
|
||||
new int[]{20},
|
||||
AchievementCategory.BOMB_LOBBERS),
|
||||
|
||||
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;
|
||||
|
@ -208,18 +208,22 @@ public class AchievementManager extends MiniPlugin
|
||||
{
|
||||
int level = get(sender, Achievement.GLOBAL_MINEPLEX_LEVEL).getLevel();
|
||||
|
||||
if (sender.getName().equalsIgnoreCase("B2_mp"))
|
||||
return 101;
|
||||
|
||||
if (rank.Has(Rank.MODERATOR))
|
||||
level = Math.max(level, 5);
|
||||
if (rank.Has(Rank.SNR_MODERATOR))
|
||||
level = Math.max(level, 15);
|
||||
if (rank.Has(Rank.JNR_DEV))
|
||||
level = Math.max(level, 25);
|
||||
if (rank.Has(Rank.ADMIN))
|
||||
level = Math.max(level, 30 + get(sender, Achievement.GLOBAL_GEM_HUNTER).getLevel());
|
||||
if (rank.Has(Rank.OWNER))
|
||||
level = Math.max(level, 50 + get(sender, Achievement.GLOBAL_GEM_HUNTER).getLevel());
|
||||
|
||||
if (sender.getName().equalsIgnoreCase("Phinary"))
|
||||
level = -level;
|
||||
else if (sender.getName().equalsIgnoreCase("B2_mp"))
|
||||
return 101;
|
||||
else if (rank.Has(Rank.OWNER))
|
||||
level = Math.max(level, 50 + get(sender, Achievement.GLOBAL_GEM_HUNTER).getLevel());
|
||||
else if (rank.Has(Rank.ADMIN))
|
||||
level = Math.max(level, 30 + get(sender, Achievement.GLOBAL_GEM_HUNTER).getLevel());
|
||||
else if (rank.Has(Rank.SNR_MODERATOR))
|
||||
level = Math.max(level, 15);
|
||||
else if (rank.Has(Rank.MODERATOR))
|
||||
level = Math.max(level, 5);
|
||||
|
||||
return level;
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ import mineplex.core.cosmetic.ui.button.ActivateGadgetButton;
|
||||
import mineplex.core.cosmetic.ui.button.DeactivateGadgetButton;
|
||||
import mineplex.core.cosmetic.ui.button.GadgetButton;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.gadget.gadgets.MorphBlock;
|
||||
import mineplex.core.gadget.gadgets.MorphNotch;
|
||||
import mineplex.core.gadget.types.Gadget;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
@ -68,6 +69,13 @@ public class GadgetPage extends ShopPageBase<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));
|
||||
//return;
|
||||
}
|
||||
else if (gadget instanceof MorphBlock)
|
||||
{
|
||||
//Prevent stacker bug
|
||||
if (getPlayer().getPassenger() != null)
|
||||
return;
|
||||
}
|
||||
|
||||
List<String> itemLore = new ArrayList<String>();
|
||||
|
||||
if (gadget.GetCost(CurrencyType.Coins) >= 0)
|
||||
|
@ -6,12 +6,14 @@ import java.util.List;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.event.player.PlayerToggleSneakEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
@ -430,4 +432,16 @@ public class GadgetManager extends MiniPlugin
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void chissMeow(PlayerToggleSneakEvent event)
|
||||
{
|
||||
if (event.getPlayer().getName().equals("Chiss"))
|
||||
{
|
||||
if (!event.getPlayer().isSneaking())
|
||||
{
|
||||
event.getPlayer().getWorld().playSound(event.getPlayer().getLocation(), Sound.CAT_MEOW, 1f, 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ public class MorphWither extends MorphGadget
|
||||
player.setFlying(true);
|
||||
|
||||
if (UtilEnt.isGrounded(player))
|
||||
player.setVelocity(new Vector(0,1,0));
|
||||
UtilAction.velocity(player, new Vector(0,1,0), 1, false, 0, 0, 1, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ public enum GameDisplay
|
||||
SquidShooter("Squid Shooter", Material.FIREWORK_CHARGE, (byte)0, GameCategory.ARCADE, 43),
|
||||
Stacker("Super Stacker", Material.BOWL, (byte)0, GameCategory.ARCADE, 42),
|
||||
SurvivalGames("Survival Games", Material.IRON_SWORD, (byte)0, GameCategory.SURVIVAL, 22),
|
||||
SurvivalGamesTeams("Survival Games Teams", Material.IRON_SWORD, (byte)0, GameCategory.TEAM_VARIANT, 23),
|
||||
SurvivalGamesTeams("Survival Games", Material.IRON_SWORD, (byte)0, GameCategory.TEAM_VARIANT, 23),
|
||||
Tug("Tug of Wool", Material.WHEAT, (byte)0, GameCategory.ARCADE, 44),
|
||||
TurfWars("Turf Wars", Material.STAINED_CLAY, (byte)14, GameCategory.ARCADE, 45),
|
||||
UHC("Ultra Hardcore", Material.GOLDEN_APPLE, (byte)0, GameCategory.SURVIVAL, 46),
|
||||
@ -61,7 +61,8 @@ public enum GameDisplay
|
||||
|
||||
Build("Master Builders", Material.WOOD, (byte)0, GameCategory.CLASSICS, 50),
|
||||
Cards("Craft Against Humanity", Material.MAP, (byte)0, GameCategory.CLASSICS, 51),
|
||||
Skywars("Skywars", Material.FEATHER, (byte) 0, GameCategory.SURVIVAL, 52),
|
||||
Skywars("Skywars", "Skywars", Material.FEATHER, (byte) 0, GameCategory.SURVIVAL, 52),
|
||||
SkywarsTeams("Skywars Teams", "Skywars",Material.FEATHER, (byte)5, GameCategory.TEAM_VARIANT, 53),
|
||||
|
||||
Event("Mineplex Event", Material.CAKE, (byte)0, GameCategory.EVENT, 999);
|
||||
|
||||
|
@ -52,7 +52,6 @@ public class MountSheep extends HorseMount
|
||||
|
||||
DisguiseSheep disguise = new DisguiseSheep(horse);
|
||||
disguise.setName(player.getName(), Manager.getClientManager().Get(player).GetRank());
|
||||
disguise.setCustomNameVisible(true);
|
||||
//disguise.setColor(DyeColor.getByColor(org.bukkit.Color.fromRGB(100, 0, 200)));
|
||||
Manager.getDisguiseManager().disguise(disguise);
|
||||
|
||||
|
@ -48,7 +48,6 @@ public class MountSlime extends Mount<Slime>
|
||||
mount.setSize(2);
|
||||
|
||||
mount.setCustomName(player.getName() + "'s " + GetName());
|
||||
mount.setCustomNameVisible(true);
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(player, F.main("Mount", "You spawned " + F.elem(GetName()) + "."));
|
||||
|
@ -45,8 +45,8 @@ public class NotificationManager extends MiniPlugin
|
||||
// if (event.getType() == UpdateType.MIN_08)
|
||||
// hugeSale();
|
||||
|
||||
if (event.getType() == UpdateType.MIN_16)
|
||||
sale();
|
||||
// if (event.getType() == UpdateType.MIN_16)
|
||||
// sale();
|
||||
}
|
||||
|
||||
private void sale()
|
||||
|
@ -12,7 +12,7 @@ public class HomeCommand extends CommandBase<NpcManager>
|
||||
{
|
||||
public HomeCommand(NpcManager plugin)
|
||||
{
|
||||
super(plugin, Rank.DEVELOPER, "home");
|
||||
super(plugin, Rank.DEVELOPER, new Rank[] {Rank.JNR_DEV}, "home");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -10,7 +10,7 @@ public class NpcCommand extends MultiCommandBase<NpcManager>
|
||||
{
|
||||
public NpcCommand(NpcManager plugin)
|
||||
{
|
||||
super(plugin, Rank.DEVELOPER, "npc");
|
||||
super(plugin, Rank.DEVELOPER, new Rank[] {Rank.JNR_DEV}, "npc");
|
||||
|
||||
AddCommand(new AddCommand(plugin));
|
||||
AddCommand(new DeleteCommand(plugin));
|
||||
|
@ -157,7 +157,7 @@ public class PersonalServerManager extends MiniPlugin
|
||||
}
|
||||
|
||||
final ServerGroup serverGroup = new ServerGroup(serverName, serverName, host.getName(), ram, cpu, 1, 0, UtilMath.random.nextInt(250) + 19999, true, "arcade.zip", "Arcade.jar", "plugins/Arcade/", minPlayers, maxPlayers,
|
||||
true, false, false, games, "Player", true, event, false, true, false, true, true, false, false, false, false, true, true, true, false, false, "", _us ? Region.US : Region.EU);
|
||||
true, false, false, games, "Player", true, event, false, true, false, true, true, false, false, false, false, true, true, true, false, false, "", _us ? Region.US : Region.EU, "", "", "", "");
|
||||
|
||||
getPlugin().getServer().getScheduler().runTaskAsynchronously(getPlugin(), new Runnable()
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ public class SendCommand extends CommandBase<Portal>
|
||||
{
|
||||
public SendCommand(Portal plugin)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, "send");
|
||||
super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "send");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -261,7 +261,7 @@ public class PreferencesPage extends ShopPageBase<PreferencesManager, Preference
|
||||
buildPreference(42, Material.SLIME_BALL, "Hub Forcefield", userPreferences.HubForcefield, _toggleHubForcefield);
|
||||
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(38, Material.SLIME_BALL, "Hub Forcefield", userPreferences.HubForcefield, _toggleHubForcefield);
|
||||
|
@ -7,6 +7,19 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
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.common.Rank;
|
||||
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.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
|
||||
{
|
||||
private Punish _plugin;
|
||||
@ -232,14 +233,12 @@ public class PunishPage extends CraftInventoryCustom implements Listener
|
||||
examplePrefixEx + " Forcefield",
|
||||
examplePrefixEx + " Speed Hack",
|
||||
examplePrefixEx + " Reach Hack",
|
||||
examplePrefixEx + " Speed Hack",
|
||||
examplePrefixEx + " Other Hack",
|
||||
" ",
|
||||
examplePrefix + "Hack Reports (SR & FR);",
|
||||
examplePrefixEx + " Forcefield",
|
||||
examplePrefixEx + " Speed Hack",
|
||||
examplePrefixEx + " Reach Hack",
|
||||
examplePrefixEx + " Speed Hack",
|
||||
examplePrefixEx + " Other 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));
|
||||
}
|
||||
|
||||
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());
|
||||
|
||||
int slot = 45;
|
||||
|
@ -1,6 +1,7 @@
|
||||
package mineplex.core.recharge;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
@ -219,6 +220,26 @@ public class Recharge extends MiniPlugin
|
||||
_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)
|
||||
{
|
||||
if (!_recharge.containsKey(player.getName()))
|
||||
|
@ -87,23 +87,10 @@ public abstract class ShopBase<PluginType extends MiniPlugin> implements Listene
|
||||
|
||||
private boolean attemptShopOpen(Player player, LivingEntity entity)
|
||||
{
|
||||
if (!_openedShop.contains(player.getName()) && entity.isCustomNameVisible() && entity.getCustomName() != null && ChatColor.stripColor(entity.getCustomName()).equalsIgnoreCase(ChatColor.stripColor(_name)))
|
||||
{
|
||||
if (!canOpenShop(player))
|
||||
return false;
|
||||
|
||||
_openedShop.add(player.getName());
|
||||
|
||||
openShopForPlayer(player);
|
||||
if (!_playerPageMap.containsKey(player.getName()))
|
||||
{
|
||||
_playerPageMap.put(player.getName(), buildPagesFor(player));
|
||||
}
|
||||
|
||||
openPageForPlayer(player, getOpeningPageForPlayer(player));
|
||||
|
||||
return true;
|
||||
}
|
||||
if (entity.isCustomNameVisible() && entity.getCustomName() != null && ChatColor.stripColor(entity.getCustomName()).equalsIgnoreCase(ChatColor.stripColor(_name)))
|
||||
{
|
||||
return attemptShopOpen(player);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ import org.jooq.impl.DSL;
|
||||
import mineplex.core.account.ILoginProcessor;
|
||||
import mineplex.core.database.DBPool;
|
||||
import mineplex.database.Tables;
|
||||
import org.jooq.types.ULong;
|
||||
|
||||
public class SecondaryStatHandler implements ILoginProcessor
|
||||
{
|
||||
@ -58,7 +59,7 @@ public class SecondaryStatHandler implements ILoginProcessor
|
||||
.insertInto(Tables.accountStat)
|
||||
.set(Tables.accountStat.accountId, accountId)
|
||||
.set(Tables.accountStat.statId, statId)
|
||||
.set(Tables.accountStat.value, Math.max(oldPlayerStats.getStat(statName), 0L));
|
||||
.set(Tables.accountStat.value, ULong.valueOf(Math.max(oldPlayerStats.getStat(statName), 0L)));
|
||||
|
||||
inserts.add(insert);
|
||||
}
|
||||
@ -99,13 +100,13 @@ public class SecondaryStatHandler implements ILoginProcessor
|
||||
.insertInto(Tables.accountStat)
|
||||
.set(Tables.accountStat.accountId, accountId)
|
||||
.set(Tables.accountStat.statId, statId)
|
||||
.set(Tables.accountStat.value, Math.max(oldPlayerStats.getStat(statName), 0L));
|
||||
.set(Tables.accountStat.value, ULong.valueOf(Math.max(oldPlayerStats.getStat(statName), 0L)));
|
||||
|
||||
inserts.add(insert);
|
||||
|
||||
Update update = context
|
||||
.update(Tables.accountStat)
|
||||
.set(Tables.accountStat.value, Math.max(oldPlayerStats.getStat(statName), 0L))
|
||||
.set(Tables.accountStat.value, ULong.valueOf(Math.max(oldPlayerStats.getStat(statName), 0L)))
|
||||
.where(Tables.accountStat.accountId.eq(accountId))
|
||||
.and(Tables.accountStat.statId.eq(statId));
|
||||
|
||||
|
@ -22,6 +22,7 @@ import org.jooq.Result;
|
||||
import org.jooq.SQLDialect;
|
||||
import org.jooq.Update;
|
||||
import org.jooq.impl.DSL;
|
||||
import org.jooq.types.ULong;
|
||||
|
||||
public class StatsRepository extends RepositoryBase
|
||||
{
|
||||
@ -102,7 +103,7 @@ public class StatsRepository extends RepositoryBase
|
||||
.insertInto(Tables.accountStat)
|
||||
.set(Tables.accountStat.accountId, accountId)
|
||||
.set(Tables.accountStat.statId, statId)
|
||||
.set(Tables.accountStat.value, uploadQueue.get(accountId).get(statId));
|
||||
.set(Tables.accountStat.value, ULong.valueOf(uploadQueue.get(accountId).get(statId)));
|
||||
|
||||
inserts.add(insert);
|
||||
}
|
||||
@ -137,7 +138,7 @@ public class StatsRepository extends RepositoryBase
|
||||
context = DSL.using(getConnectionPool(), SQLDialect.MYSQL);
|
||||
}
|
||||
|
||||
Result<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)
|
||||
.on(Tables.stats.id.eq(Tables.accountStat.statId))
|
||||
.where(Tables.accountStat.accountId.eq(DSL.select(Tables.accounts.id)
|
||||
@ -149,9 +150,9 @@ public class StatsRepository extends RepositoryBase
|
||||
if (result.isNotEmpty())
|
||||
{
|
||||
playerStats = new PlayerStats();
|
||||
for (Record2<String, Long> record : result)
|
||||
for (Record2<String, ULong> record : result)
|
||||
{
|
||||
playerStats.addStat(record.value1(), record.value2());
|
||||
playerStats.addStat(record.value1(), record.value2().longValue());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ public class TimeCommand extends CommandBase<StatsManager>
|
||||
else
|
||||
{
|
||||
long time = Plugin.Get(target).getStat("Global.TimeInGame");
|
||||
UtilPlayer.message(caller, F.main("Time", F.name(target.getName() + " has spent " + F.elem(UtilTime.convertString(time * 1000L, 1, UtilTime.TimeUnit.FIT)) + " in game")));
|
||||
UtilPlayer.message(caller, F.main("Time", F.name(target.getName()) + " has spent " + F.elem(UtilTime.convertString(time * 1000L, 1, UtilTime.TimeUnit.FIT)) + " in game"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -116,10 +116,8 @@ public class ServerStatusManager extends MiniPlugin
|
||||
if (event.getType() != UpdateType.FASTER)
|
||||
return;
|
||||
|
||||
if (!_enabled)
|
||||
return;
|
||||
|
||||
saveServerStatus();
|
||||
if (_enabled)
|
||||
saveServerStatus();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -139,19 +137,6 @@ public class ServerStatusManager extends MiniPlugin
|
||||
if (server != null && !server.getPublicAddress().equalsIgnoreCase(serverSnapshot.getPublicAddress()))
|
||||
{
|
||||
timeout = -DEFAULT_SERVER_TIMEOUT;
|
||||
/*
|
||||
ProcessRunner pr = new ProcessRunner(new String[] {"/bin/sh", "/home/mineplex/config/killServer.sh", serverSnapshot.getName()});
|
||||
pr.start(new GenericRunnable<Boolean>()
|
||||
{
|
||||
public void run(Boolean error)
|
||||
{
|
||||
if (error)
|
||||
log("Error Killing myself.");
|
||||
else
|
||||
log("It worked.");
|
||||
}
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
_repository.updataServerStatus(serverSnapshot, timeout);
|
||||
|
@ -20,6 +20,7 @@ import mineplex.core.common.jsonchat.JsonMessage;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.NautHashMap;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilWorld;
|
||||
@ -285,7 +286,7 @@ public class Teleport extends MiniPlugin
|
||||
}
|
||||
|
||||
player.setFallDistance(0);
|
||||
player.setVelocity(new Vector(0,0,0));
|
||||
UtilAction.velocity(player, new Vector(0,1,0), 0, false, 0, 0, 0, false);
|
||||
|
||||
player.teleport(loc);
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ public class HereCommand extends CommandBase<Teleport>
|
||||
{
|
||||
public HereCommand(Teleport plugin)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, "here", "h");
|
||||
super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "here", "h");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -327,6 +327,11 @@ public class TreasureLocation implements Listener
|
||||
_hologram.start();
|
||||
}
|
||||
|
||||
public Treasure getCurrentTreasure()
|
||||
{
|
||||
return _currentTreasure;
|
||||
}
|
||||
|
||||
public void openShop(Player player)
|
||||
{
|
||||
_shop.attemptShopOpen(player);
|
||||
|
@ -125,6 +125,22 @@ public class TreasureManager extends MiniPlugin
|
||||
return _rewardManager.getRewards(player, rewardType);
|
||||
}
|
||||
|
||||
public boolean isOpening(Player player)
|
||||
{
|
||||
for (TreasureLocation treasureLocation : _treasureLocations)
|
||||
{
|
||||
Treasure treasure = treasureLocation.getCurrentTreasure();
|
||||
|
||||
if (treasure == null)
|
||||
continue;
|
||||
|
||||
if (treasure.getPlayer().equals(player))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public BlockRestore getBlockRestore()
|
||||
{
|
||||
return _blockRestore;
|
||||
|
@ -15,7 +15,7 @@ public class RestartServerCommand extends CommandBase<FileUpdater>
|
||||
{
|
||||
public RestartServerCommand(FileUpdater plugin)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, "restart");
|
||||
super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "restart");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
@ -16,7 +16,7 @@ package mineplex.database;
|
||||
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class Account extends org.jooq.impl.SchemaImpl implements java.io.Serializable, java.lang.Cloneable {
|
||||
|
||||
private static final long serialVersionUID = 625106486;
|
||||
private static final long serialVersionUID = 2034846771;
|
||||
|
||||
/**
|
||||
* The reference instance of <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.ActiveTournaments.activeTournaments,
|
||||
mineplex.database.tables.Bonus.bonus,
|
||||
mineplex.database.tables.Chatsnap.chatsnap,
|
||||
mineplex.database.tables.ClanAlliances.clanAlliances,
|
||||
mineplex.database.tables.ClanEnemies.clanEnemies,
|
||||
mineplex.database.tables.ClanMember.clanMember,
|
||||
|
@ -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.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.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.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;
|
||||
@ -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.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.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.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;
|
||||
@ -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.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.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.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);
|
||||
@ -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.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.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.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);
|
||||
|
@ -54,6 +54,19 @@ public class Routines {
|
||||
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>
|
||||
*/
|
||||
|
@ -91,6 +91,11 @@ public class Tables {
|
||||
*/
|
||||
public static final mineplex.database.tables.Bonus bonus = mineplex.database.tables.Bonus.bonus;
|
||||
|
||||
/**
|
||||
* The table Account.chatsnap
|
||||
*/
|
||||
public static final mineplex.database.tables.Chatsnap chatsnap = mineplex.database.tables.Chatsnap.chatsnap;
|
||||
|
||||
/**
|
||||
* The table Account.clanAlliances
|
||||
*/
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
@ -16,7 +16,7 @@ package mineplex.database.tables;
|
||||
@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 {
|
||||
|
||||
private static final long serialVersionUID = 956897097;
|
||||
private static final long serialVersionUID = 34581219;
|
||||
|
||||
/**
|
||||
* 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>.
|
||||
*/
|
||||
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
|
||||
|
@ -16,7 +16,7 @@ package mineplex.database.tables;
|
||||
@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 {
|
||||
|
||||
private static final long serialVersionUID = -70389593;
|
||||
private static final long serialVersionUID = -524321170;
|
||||
|
||||
/**
|
||||
* 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, "");
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
@ -14,9 +14,9 @@ package mineplex.database.tables.records;
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl<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>.
|
||||
@ -49,15 +49,15 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl<mineple
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>Account.accountStat.value</code>.
|
||||
*/
|
||||
public java.lang.Long getValue() {
|
||||
return (java.lang.Long) getValue(2);
|
||||
public org.jooq.types.ULong getValue() {
|
||||
return (org.jooq.types.ULong) getValue(2);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@ -80,7 +80,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl<mineple
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@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();
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl<mineple
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@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();
|
||||
}
|
||||
|
||||
@ -112,7 +112,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl<mineple
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
|
||||
@ -136,7 +136,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl<mineple
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public java.lang.Long value3() {
|
||||
public org.jooq.types.ULong value3() {
|
||||
return getValue();
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl<mineple
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public AccountStatRecord value3(java.lang.Long value) {
|
||||
public AccountStatRecord value3(org.jooq.types.ULong value) {
|
||||
setValue(value);
|
||||
return this;
|
||||
}
|
||||
@ -171,7 +171,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl<mineple
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
|
||||
@ -189,7 +189,7 @@ public class AccountStatRecord extends org.jooq.impl.UpdatableRecordImpl<mineple
|
||||
/**
|
||||
* 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);
|
||||
|
||||
setValue(0, accountId);
|
||||
|
@ -14,9 +14,9 @@ package mineplex.database.tables.records;
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@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>.
|
||||
@ -60,6 +60,90 @@ public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.data
|
||||
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
|
||||
// -------------------------------------------------------------------------
|
||||
@ -73,23 +157,23 @@ public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.data
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Record3 type implementation
|
||||
// Record9 type implementation
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Row3<java.lang.Integer, java.sql.Timestamp, java.sql.Date> fieldsRow() {
|
||||
return (org.jooq.Row3) super.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.Row9) super.fieldsRow();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public org.jooq.Row3<java.lang.Integer, java.sql.Timestamp, java.sql.Date> valuesRow() {
|
||||
return (org.jooq.Row3) super.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.Row9) super.valuesRow();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -116,6 +200,54 @@ public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.data
|
||||
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}
|
||||
*/
|
||||
@ -140,6 +272,54 @@ public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.data
|
||||
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}
|
||||
*/
|
||||
@ -171,7 +351,61 @@ public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.data
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
|
||||
@ -189,11 +423,17 @@ public class BonusRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.data
|
||||
/**
|
||||
* 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);
|
||||
|
||||
setValue(0, accountId);
|
||||
setValue(1, dailytime);
|
||||
setValue(2, ranktime);
|
||||
setValue(3, votetime);
|
||||
setValue(4, dailyStreak);
|
||||
setValue(5, maxDailyStreak);
|
||||
setValue(6, voteStreak);
|
||||
setValue(7, maxVoteStreak);
|
||||
setValue(8, tickets);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
@ -46,6 +46,7 @@ import mineplex.core.task.TaskManager;
|
||||
import mineplex.core.teleport.Teleport;
|
||||
import mineplex.core.updater.FileUpdater;
|
||||
import mineplex.core.updater.Updater;
|
||||
import mineplex.core.velocity.VelocityFix;
|
||||
import mineplex.core.visibility.VisibilityManager;
|
||||
import mineplex.hub.modules.StackerManager;
|
||||
import mineplex.hub.poll.PollManager;
|
||||
@ -78,6 +79,9 @@ public class Hub extends JavaPlugin implements IRelation
|
||||
|
||||
//Logger.initialize(this);
|
||||
|
||||
//Velocity Fix
|
||||
new VelocityFix(this);
|
||||
|
||||
//Static Modules
|
||||
CommandCenter.Initialize(this);
|
||||
CoreClientManager clientManager = new CoreClientManager(this, webServerAddress);
|
||||
|
@ -1,16 +1,13 @@
|
||||
package mineplex.hub;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.craftbukkit.v1_7_R4.CraftWorld;
|
||||
import org.bukkit.entity.Egg;
|
||||
import org.bukkit.entity.Entity;
|
||||
@ -54,7 +51,6 @@ import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilFirework;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
@ -91,11 +87,11 @@ import mineplex.hub.commands.GadgetToggle;
|
||||
import mineplex.hub.commands.GameModeCommand;
|
||||
import mineplex.hub.commands.NewsCommand;
|
||||
import mineplex.hub.modules.ForcefieldManager;
|
||||
import mineplex.hub.modules.HubVisibilityManager;
|
||||
import mineplex.hub.modules.JumpManager;
|
||||
import mineplex.hub.modules.NewsManager;
|
||||
import mineplex.hub.modules.ParkourManager;
|
||||
import mineplex.hub.modules.TextManager;
|
||||
import mineplex.hub.modules.HubVisibilityManager;
|
||||
import mineplex.hub.modules.WorldManager;
|
||||
import mineplex.hub.poll.PollManager;
|
||||
import mineplex.hub.tutorial.TutorialManager;
|
||||
@ -499,7 +495,10 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void AdminOP(PlayerJoinEvent event)
|
||||
{
|
||||
if (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.OWNER))
|
||||
// Give developers operator on their servers
|
||||
boolean testServer = _plugin.getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
|
||||
|
||||
if (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.OWNER) || (testServer && (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.DEVELOPER) || _clientManager.Get(event.getPlayer()).GetRank() == Rank.JNR_DEV)))
|
||||
event.getPlayer().setOp(true);
|
||||
else
|
||||
event.getPlayer().setOp(false);
|
||||
@ -899,6 +898,11 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
return _gadgetManager;
|
||||
}
|
||||
|
||||
public TreasureManager GetTreasure()
|
||||
{
|
||||
return _treasureManager;
|
||||
}
|
||||
|
||||
public MountManager GetMount()
|
||||
{
|
||||
return _mountManager;
|
||||
|
@ -10,7 +10,7 @@ public class GadgetToggle extends CommandBase<HubManager>
|
||||
{
|
||||
public GadgetToggle(HubManager plugin)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, new String[] {"gadget"});
|
||||
super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, new String[] {"gadget"});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -13,7 +13,7 @@ public class GameModeCommand extends CommandBase<HubManager>
|
||||
{
|
||||
public GameModeCommand(HubManager plugin)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, new String[] {"gm"});
|
||||
super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, new String[] {"gm"});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -10,7 +10,7 @@ public class NewsCommand extends MultiCommandBase<HubManager>
|
||||
{
|
||||
public NewsCommand(HubManager plugin)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, "news");
|
||||
super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "news");
|
||||
|
||||
AddCommand(new NewsAddCommand(plugin));
|
||||
AddCommand(new NewsDeleteCommand(plugin));
|
||||
|
@ -19,7 +19,7 @@ public class NewsListCommand extends CommandBase<HubManager>
|
||||
{
|
||||
public NewsListCommand(HubManager plugin)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, "list");
|
||||
super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "list");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -42,7 +42,7 @@ public class ForcefieldManager extends MiniPlugin
|
||||
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
{
|
||||
if (Manager.getPreferences().Get(player).HubForcefield && Manager.GetClients().Get(player).GetRank().Has(Rank.ADMIN))
|
||||
if (Manager.getPreferences().Get(player).HubForcefield && (Manager.GetClients().Get(player).GetRank().Has(Rank.ADMIN) || Manager.GetClients().Get(player).GetRank() == Rank.JNR_DEV))
|
||||
{
|
||||
for (Player other : UtilServer.getPlayers())
|
||||
{
|
||||
@ -56,7 +56,7 @@ public class ForcefieldManager extends MiniPlugin
|
||||
if (UtilMath.offset(other, player) > range)
|
||||
continue;
|
||||
|
||||
if (Manager.GetClients().Get(other).GetRank().Has(Rank.ADMIN))
|
||||
if (Manager.GetClients().Get(other).GetRank().Has(Rank.ADMIN) || Manager.GetClients().Get(other).GetRank() == Rank.JNR_DEV)
|
||||
continue;
|
||||
|
||||
if (Recharge.Instance.use(other, "Forcefield Bump", 500, false, false))
|
||||
|
@ -28,6 +28,8 @@ import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.event.StackerEvent;
|
||||
import mineplex.core.gadget.gadgets.MorphBlock;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
import mineplex.core.projectile.IThrown;
|
||||
import mineplex.core.projectile.ProjectileManager;
|
||||
import mineplex.core.projectile.ProjectileUser;
|
||||
@ -105,15 +107,33 @@ public class StackerManager extends MiniPlugin implements IThrown
|
||||
return;
|
||||
}
|
||||
|
||||
if (Manager.GetGadget().getActive(stacker, GadgetType.Morph) instanceof MorphBlock)
|
||||
{
|
||||
UtilPlayer.message(stacker, F.main("Stacker", "You cannot stack while using the Block Morph."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (Manager.GetTreasure().isOpening(stacker))
|
||||
return;
|
||||
|
||||
stackerEvent = new StackerEvent(stackee);
|
||||
Bukkit.getServer().getPluginManager().callEvent(stackerEvent);
|
||||
if (stackerEvent.isCancelled())
|
||||
return;
|
||||
|
||||
if (stackee instanceof Player && !Manager.CanBump(((Player)stackee)))
|
||||
if (stackee instanceof Player)
|
||||
{
|
||||
UtilPlayer.message(stacker, F.main("Stacker", F.name(UtilEnt.getName(stackee)) + " is not playing stacker."));
|
||||
return;
|
||||
if (!Manager.CanBump(((Player)stackee)))
|
||||
{
|
||||
UtilPlayer.message(stacker, F.main("Stacker", F.name(UtilEnt.getName(stackee)) + " is not playing stacker."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (Manager.GetTreasure().isOpening((Player) stackee))
|
||||
{
|
||||
UtilPlayer.message(stacker, F.main("Stacker", F.main("Stacker", F.name(UtilEnt.getName(stackee)) + " is opening a chest!")));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (stackee instanceof LivingEntity)
|
||||
@ -235,7 +255,8 @@ public class StackerManager extends MiniPlugin implements IThrown
|
||||
Manager.SetPortalDelay(rider);
|
||||
|
||||
rider.leaveVehicle();
|
||||
rider.setVelocity(new Vector(0.25 - Math.random()/2, Math.random()/2, 0.25 - Math.random()/2));
|
||||
UtilAction.velocity(rider, new Vector(0.25 - Math.random()/2, Math.random()/2, 0.25 - Math.random()/2),
|
||||
1, false, 0, 0, 0, false);
|
||||
rider = rider.getPassenger();
|
||||
}
|
||||
|
||||
|
@ -10,4 +10,9 @@ public class ServerInfo
|
||||
public String ServerType;
|
||||
public String Game;
|
||||
public boolean HostedByStaff;
|
||||
|
||||
public int getAvailableSlots()
|
||||
{
|
||||
return MaxPlayers - CurrentPlayers;
|
||||
}
|
||||
}
|
@ -10,8 +10,11 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
@ -56,7 +59,9 @@ import mineplex.hub.queue.QueueManager;
|
||||
import mineplex.hub.queue.ui.QueueShop;
|
||||
import mineplex.hub.server.ui.LobbyShop;
|
||||
import mineplex.hub.server.ui.QuickShop;
|
||||
import mineplex.hub.server.ui.ServerCountSorter;
|
||||
import mineplex.hub.server.ui.ServerNpcShop;
|
||||
import mineplex.serverdata.Region;
|
||||
import mineplex.serverdata.data.MinecraftServer;
|
||||
import mineplex.serverdata.data.ServerGroup;
|
||||
|
||||
@ -64,7 +69,12 @@ public class ServerManager extends MiniPlugin
|
||||
{
|
||||
private static final Long FREE_PORTAL_TIMER = 20000L;
|
||||
private static final Long BETA_PORTAL_TIMER = 120000L;
|
||||
private static final Random random = new Random();
|
||||
|
||||
public final int TOP_SERVERS = 3; // The number of top contending servers for auto-joining games
|
||||
public final int MIN_SLOTS_REQUIRED = 12; // The number of slots the max server must have for auto-join
|
||||
|
||||
public final long QUEUE_COOLDOWN = 2000; // Cooldown (in milliseconds) between queueing again for players
|
||||
private CoreClientManager _clientManager;
|
||||
private DonationManager _donationManager;
|
||||
private Portal _portal;
|
||||
@ -74,6 +84,7 @@ public class ServerManager extends MiniPlugin
|
||||
private StackerManager _stackerManager;
|
||||
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, String> _serverKeyTagMap = new NautHashMap<String, String>();
|
||||
private NautHashMap<String, Integer> _serverPlayerCounts = new NautHashMap<String, Integer>();
|
||||
@ -108,7 +119,7 @@ public class ServerManager extends MiniPlugin
|
||||
|
||||
plugin.getServer().getMessenger().registerOutgoingPluginChannel(plugin, "BungeeCord");
|
||||
|
||||
LoadServers();
|
||||
loadServers();
|
||||
|
||||
_quickShop = new QuickShop(this, clientManager, donationManager, "Quick Menu");
|
||||
_lobbyShop = new LobbyShop(this, clientManager, donationManager, "Lobby Menu");
|
||||
@ -278,18 +289,6 @@ public class ServerManager extends MiniPlugin
|
||||
timeLeft = 0;
|
||||
}
|
||||
|
||||
// if (party != null)
|
||||
// {
|
||||
// if (player.getName().equals(party.GetLeader()))
|
||||
// {
|
||||
// for (Player partyPlayer : party.GetPlayersOnline())
|
||||
// {
|
||||
// if (!partyPlayer.equals(player))
|
||||
// timeLeft = Math.max(timeLeft, getMillisecondsUntilPortal(partyPlayer));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
return timeLeft;
|
||||
}
|
||||
|
||||
@ -303,18 +302,18 @@ public class ServerManager extends MiniPlugin
|
||||
_serverInfoMap.remove(serverName);
|
||||
}
|
||||
|
||||
public void addServerGroup(String serverKey, String...serverTag)
|
||||
public void addServerGroup(ServerGroup serverGroup)
|
||||
{
|
||||
_serverKeyInfoMap.put(serverKey, new HashSet<ServerInfo>());
|
||||
_serverKeyInfoMap.put(serverGroup.getName(), new HashSet<ServerInfo>());
|
||||
_serverKeyTagMap.put(serverGroup.getPrefix(), serverGroup.getName());
|
||||
|
||||
for (String tag : serverTag)
|
||||
_serverKeyTagMap.put(tag, serverKey);
|
||||
if (!serverGroup.getServerNpcName().isEmpty())
|
||||
_serverKeyTagMap.put(serverGroup.getServerNpcName(), serverGroup.getName());
|
||||
}
|
||||
|
||||
public void AddServerNpc(String serverNpcName, String...serverTag)
|
||||
public void AddServerNpc(ServerGroup serverGroup)
|
||||
{
|
||||
addServerGroup(serverNpcName, serverTag);
|
||||
_serverNpcShopMap.put(serverNpcName, new ServerNpcShop(this, _clientManager, _donationManager, serverNpcName));
|
||||
_serverNpcShopMap.put(serverGroup.getServerNpcName(), new ServerNpcShop(this, _clientManager, _donationManager, serverGroup));
|
||||
}
|
||||
|
||||
public void RemoveServerNpc(String serverNpcName)
|
||||
@ -396,7 +395,6 @@ public class ServerManager extends MiniPlugin
|
||||
|
||||
_retrieving = true;
|
||||
|
||||
|
||||
_statusManager.retrieveServerGroups(new Callback<Collection<ServerGroup>>()
|
||||
{
|
||||
public void run(final Collection<ServerGroup> serverGroups)
|
||||
@ -482,6 +480,8 @@ public class ServerManager extends MiniPlugin
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
updateCooldowns();
|
||||
}
|
||||
|
||||
public void Help(Player caller, String message)
|
||||
@ -522,6 +522,113 @@ public class ServerManager extends MiniPlugin
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
UtilPlayer.message(caller, F.main(getName(), "Listing Server Npcs:"));
|
||||
@ -555,7 +662,7 @@ public class ServerManager extends MiniPlugin
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadServers()
|
||||
public void loadServers()
|
||||
{
|
||||
_serverInfoMap.clear();
|
||||
_serverUpdate.clear();
|
||||
@ -567,83 +674,55 @@ public class ServerManager extends MiniPlugin
|
||||
|
||||
_serverKeyTagMap.clear();
|
||||
|
||||
FileInputStream fstream = null;
|
||||
BufferedReader br = null;
|
||||
|
||||
HashSet<String> npcNames = new HashSet<String>();
|
||||
Region region = getPlugin().getConfig().getBoolean("serverstatus.us") ? Region.US : Region.EU;
|
||||
|
||||
try
|
||||
{
|
||||
File npcFile = new File("ServerManager.dat");
|
||||
|
||||
if (npcFile.exists())
|
||||
for (ServerGroup serverGroup : mineplex.serverdata.servers.ServerManager.getServerRepository(region).getServerGroups(null))
|
||||
{
|
||||
fstream = new FileInputStream(npcFile);
|
||||
br = new BufferedReader(new InputStreamReader(fstream));
|
||||
addServerGroup(serverGroup); // Caches prefix/tag pairing
|
||||
|
||||
String line = br.readLine();
|
||||
|
||||
while (line != null)
|
||||
if (!serverGroup.getServerNpcName().isEmpty())
|
||||
{
|
||||
String serverNpcName = line.substring(0, line.indexOf('|')).trim();
|
||||
String[] serverTags = line.substring(line.indexOf('|') + 1, line.indexOf('|', line.indexOf('|') + 1)).trim().split(",");
|
||||
String[] locations = line.substring(line.indexOf('|', line.indexOf('|') + 1) + 1).trim().split(",");
|
||||
|
||||
for (String location : locations)
|
||||
if (!HasServerNpc(serverGroup.getServerNpcName()))
|
||||
{
|
||||
_serverPortalLocations.put(ParseVector(location), serverNpcName);
|
||||
AddServerNpc(serverGroup);
|
||||
}
|
||||
}
|
||||
|
||||
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(new Vector(bottomVector.getBlockX(), bottomVector.getBlockY(), bottomVector.getBlockZ()), serverGroup.getServerNpcName());
|
||||
|
||||
if (bottomVector.getBlockX() != topVector.getBlockX())
|
||||
{
|
||||
bottomVector.add(new Vector(-(bottomVector.getBlockX() - topVector.getBlockX()) / Math.abs(bottomVector.getBlockX() - topVector.getBlockX()), 0, 0));
|
||||
}
|
||||
else if (bottomVector.getBlockZ() != topVector.getBlockZ())
|
||||
{
|
||||
bottomVector.add(new Vector(0, 0, -(bottomVector.getBlockZ() - topVector.getBlockZ()) / Math.abs(bottomVector.getBlockZ() - topVector.getBlockZ())));
|
||||
}
|
||||
|
||||
blocks++;
|
||||
}
|
||||
|
||||
if (!HasServerNpc(serverNpcName))
|
||||
{
|
||||
AddServerNpc(serverNpcName, serverTags);
|
||||
}
|
||||
|
||||
npcNames.add(serverNpcName);
|
||||
|
||||
line = br.readLine();
|
||||
_serverPortalLocations.put(bottomVector, serverGroup.getServerNpcName());
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("ServerManager - Error parsing servers file : " + e.getMessage());
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (br != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
br.close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (fstream != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
fstream.close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
System.out.println("ServerManager - Error parsing servergroups : " + e.getMessage());
|
||||
}
|
||||
|
||||
for (String npcName : npcNames)
|
||||
{
|
||||
if (!_serverNpcShopMap.containsKey(npcName))
|
||||
_serverNpcShopMap.remove(npcName);
|
||||
|
||||
if (!_serverKeyInfoMap.containsKey(npcName))
|
||||
_serverKeyInfoMap.remove(npcName);
|
||||
}
|
||||
// AddServerNpc("Event Servers", "EVENT");
|
||||
// AddServerNpc("Mineplex Player Servers", "MPS");
|
||||
}
|
||||
|
||||
public int GetRequiredSlots(Player player, String serverType)
|
||||
|
@ -14,7 +14,8 @@ public class LobbyShop extends ShopBase<ServerManager>
|
||||
{
|
||||
super(plugin, clientManager, donationManager, name);
|
||||
|
||||
plugin.addServerGroup("Lobby", "Lobby");
|
||||
// TODO: Why is this needed? Re-add?
|
||||
//plugin.addServerGroup("Lobby", "Lobby");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -17,6 +17,7 @@ import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.game.GameDisplay;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.shop.item.IButton;
|
||||
import mineplex.core.shop.item.ShopItem;
|
||||
import mineplex.core.shop.page.ShopPageBase;
|
||||
@ -41,7 +42,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
|
||||
|
||||
public ServerNpcPage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player, String serverNpcKey)
|
||||
{
|
||||
super(plugin, shop, clientManager, donationManager, name, player, 54);
|
||||
super(plugin, shop, clientManager, donationManager, name, player, 27);
|
||||
|
||||
_serverNpcKey = serverNpcKey;
|
||||
|
||||
@ -51,6 +52,21 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
|
||||
@Override
|
||||
protected void buildPage()
|
||||
{
|
||||
setItem(12, ItemStackFactory.Instance.CreateStack(Material.SKULL.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Play Solo " + C.cGray + getName(), new String[]
|
||||
{
|
||||
ChatColor.RESET + "Solo Mode",
|
||||
ChatColor.RESET + "",
|
||||
ChatColor.RESET + "Click to play!",
|
||||
ChatColor.RESET + "",
|
||||
ChatColor.RESET + "Teaming in Solo Mode is bannable!",
|
||||
}));
|
||||
|
||||
setItem(14, ItemStackFactory.Instance.CreateStack(Material.SKULL.getId(), (byte)0, 2, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Play Team " + C.cGray + getName(), new String[]
|
||||
{
|
||||
ChatColor.RESET + "Team Mode",
|
||||
ChatColor.RESET + "",
|
||||
ChatColor.RESET + "Click to play!"
|
||||
}));
|
||||
List<ServerInfo> serverList = new ArrayList<ServerInfo>(getPlugin().GetServerList(_serverNpcKey));
|
||||
int slotsNeeded = 1;
|
||||
|
||||
@ -401,7 +417,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
|
||||
{
|
||||
int slots = getPlugin().GetRequiredSlots(player, serverInfo.ServerType);
|
||||
|
||||
if (serverInfo.MaxPlayers - serverInfo.CurrentPlayers < slots && !(getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(serverInfo.ServerType + " ULTRA") || getClient().GetRank().Has(Rank.ULTRA)))
|
||||
if (serverInfo.getAvailableSlots() < slots && !(getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(serverInfo.ServerType + " ULTRA") || getClient().GetRank().Has(Rank.ULTRA)))
|
||||
{
|
||||
playDenySound(player);
|
||||
return;
|
||||
|
@ -11,18 +11,23 @@ import mineplex.core.party.Party;
|
||||
import mineplex.core.shop.ShopBase;
|
||||
import mineplex.core.shop.page.ShopPageBase;
|
||||
import mineplex.hub.server.ServerManager;
|
||||
import mineplex.serverdata.data.ServerGroup;
|
||||
|
||||
public class ServerNpcShop extends ShopBase<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
|
||||
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
|
||||
@ -65,4 +70,16 @@ public class ServerNpcShop extends ShopBase<ServerManager>
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -341,7 +341,7 @@ public class ClientClass
|
||||
if (notify)
|
||||
{
|
||||
ListSkills(_client.GetPlayer());
|
||||
_client.GetPlayer().getWorld().playSound(_client.GetPlayer().getLocation(), Sound.LEVEL_UP, 1f, 1f);
|
||||
_client.GetPlayer().playSound(_client.GetPlayer().getLocation(), Sound.LEVEL_UP, 1f, 1f);
|
||||
|
||||
_client.GetPlayer().sendMessage(F.main("Class", "You equipped " + F.skill(customBuild.Name) + "."));
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
@ -209,7 +210,8 @@ public class Blizzard extends SkillActive
|
||||
if (damagee == null) return;
|
||||
|
||||
event.SetCancelled(GetName());
|
||||
damagee.setVelocity(proj.getVelocity().multiply(0.1).add(new Vector(0, 0.15, 0)));
|
||||
UtilAction.velocity(damagee, proj.getVelocity().multiply(0.1).add(new Vector(0, 0.15, 0)),
|
||||
1, false, 0, 0, 0, false);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -41,6 +41,7 @@ import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.player.PlayerVelocityEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.util.Vector;
|
||||
@ -390,11 +391,22 @@ public class DamageManager extends MiniPlugin
|
||||
trajectory.multiply(0.6 * knockback);
|
||||
trajectory.setY(Math.abs(trajectory.getY()));
|
||||
|
||||
//Apply
|
||||
UtilAction.velocity(event.GetDamageeEntity(),
|
||||
trajectory, 0.2 + trajectory.length() * 0.8, false, 0, Math.abs(0.2 * knockback), 0.4 + (0.04 * knockback), true);
|
||||
}
|
||||
//Debug
|
||||
if (event.GetDamageeEntity() instanceof Player && UtilGear.isMat(((Player)event.GetDamageeEntity()).getItemInHand(), Material.SUGAR))
|
||||
{
|
||||
Bukkit.broadcastMessage("--------- " +
|
||||
UtilEnt.getName(event.GetDamageeEntity()) + " hit by " + UtilEnt.getName(event.GetDamagerEntity(true)) + "-----------" );
|
||||
|
||||
Bukkit.broadcastMessage(F.main("Debug", "Damage: " + event.GetDamage()));
|
||||
}
|
||||
|
||||
|
||||
//Apply
|
||||
double vel = 0.2 + trajectory.length() * 0.8;
|
||||
|
||||
UtilAction.velocity(event.GetDamageeEntity(), trajectory, vel,
|
||||
false, 0, Math.abs(0.2 * knockback), 0.4 + (0.04 * knockback), true);
|
||||
}
|
||||
}
|
||||
catch (IllegalAccessException e)
|
||||
{
|
||||
@ -414,7 +426,7 @@ public class DamageManager extends MiniPlugin
|
||||
{
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
{
|
||||
if (!UtilGear.isMat(player.getItemInHand(), Material.BOOK))
|
||||
if (!UtilGear.isMat(player.getItemInHand(), Material.COMMAND))
|
||||
continue;
|
||||
|
||||
UtilPlayer.message(player, " ");
|
||||
|
@ -6,6 +6,7 @@ import java.util.HashSet;
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
|
||||
import org.bukkit.Material;
|
||||
@ -54,8 +55,7 @@ public class PistonJump extends MiniPlugin
|
||||
//Vector
|
||||
Vector vec = new Vector(0,1.2,0);
|
||||
|
||||
player.setVelocity(vec);
|
||||
player.setFallDistance(0);
|
||||
UtilAction.velocity(player, vec);
|
||||
}
|
||||
|
||||
final Block block = below;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.serverdata;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import mineplex.serverdata.servers.ConnectionData;
|
||||
import mineplex.serverdata.servers.ServerManager;
|
||||
import redis.clients.jedis.Jedis;
|
||||
@ -22,6 +24,9 @@ public class Utility
|
||||
private static Gson _gson = new GsonBuilder().create();
|
||||
public static Gson getGson() { return _gson; }
|
||||
|
||||
// map of all instantiated connection pools, distinguished by their ip:port combination
|
||||
private static final ConcurrentHashMap<String, JedisPool> _pools = new ConcurrentHashMap<String, JedisPool>();
|
||||
|
||||
// Public static jedis pool for interacting with central default jedis repo.
|
||||
private static JedisPool _masterPool;
|
||||
private static JedisPool _slavePool;
|
||||
@ -131,11 +136,23 @@ public class Utility
|
||||
*/
|
||||
public static JedisPool generatePool(ConnectionData connData)
|
||||
{
|
||||
JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
|
||||
jedisPoolConfig.setMaxWaitMillis(1000);
|
||||
jedisPoolConfig.setMinIdle(5);
|
||||
jedisPoolConfig.setTestOnBorrow(true);
|
||||
return new JedisPool(jedisPoolConfig, connData.getHost(), connData.getPort());
|
||||
String key = getConnKey(connData);
|
||||
JedisPool pool = _pools.get(key);
|
||||
if (pool == null)
|
||||
{
|
||||
JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
|
||||
jedisPoolConfig.setMaxWaitMillis(1000);
|
||||
jedisPoolConfig.setMinIdle(5);
|
||||
jedisPoolConfig.setTestOnBorrow(true);
|
||||
|
||||
jedisPoolConfig.setMaxTotal(20);
|
||||
jedisPoolConfig.setBlockWhenExhausted(true);
|
||||
|
||||
pool = new JedisPool(jedisPoolConfig, connData.getHost(), connData.getPort());
|
||||
_pools.put(key, pool);
|
||||
}
|
||||
|
||||
return pool;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -165,4 +182,10 @@ public class Utility
|
||||
return _slavePool;
|
||||
}
|
||||
}
|
||||
|
||||
private static String getConnKey(ConnectionData connData)
|
||||
{
|
||||
return connData.getHost() + ":" + connData.getPort();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -57,6 +57,12 @@ public class ServerGroup
|
||||
private boolean _staffOnly;
|
||||
private String _resourcePack = "";
|
||||
|
||||
private String _npcName = "";
|
||||
private String _portalBottomCornerLocation = "";
|
||||
private String _portalTopCornerLocation = "";
|
||||
|
||||
private String _teamServerKey = "";
|
||||
|
||||
private Region _region;
|
||||
|
||||
private Set<MinecraftServer> _servers;
|
||||
@ -101,6 +107,10 @@ public class ServerGroup
|
||||
_resourcePack = data.containsKey("resourcePack") ? data.get("resourcePack") : "";
|
||||
_host = data.get("host");
|
||||
_region = data.containsKey("region") ? Region.valueOf(data.get("region")) : Region.ALL;
|
||||
_teamServerKey = data.containsKey("teamServerKey") ? data.get("teamServerKey") : "";
|
||||
_portalBottomCornerLocation = data.containsKey("portalBottomCornerLocation") ? data.get("portalBottomCornerLocation") : "";
|
||||
_portalTopCornerLocation = data.containsKey("portalTopCornerLocation") ? data.get("portalTopCornerLocation") : "";
|
||||
_npcName = data.containsKey("npcName") ? data.get("npcName") : "";
|
||||
|
||||
if (serverStatuses != null)
|
||||
parseServers(serverStatuses);
|
||||
@ -109,7 +119,8 @@ public class ServerGroup
|
||||
public ServerGroup(String name, String prefix, String host, int ram, int cpu, int totalServers, int joinable, int portSection, boolean arcade, String worldZip, String plugin, String configPath
|
||||
, int minPlayers, int maxPlayers, boolean pvp, boolean tournament, boolean tournamentPoints, String games, String serverType, boolean noCheat, boolean worldEdit, boolean teamRejoin
|
||||
, boolean teamAutoJoin, boolean teamForceBalance, boolean gameAutoStart, boolean gameTimeout, boolean rewardGems, boolean rewardItems, boolean rewardStats
|
||||
, boolean rewardAchievements, boolean hotbarInventory, boolean hotbarHubClock, boolean playerKickIdle, boolean staffOnly, boolean whitelist, String resourcePack, Region region)
|
||||
, boolean rewardAchievements, boolean hotbarInventory, boolean hotbarHubClock, boolean playerKickIdle, boolean staffOnly, boolean whitelist, String resourcePack, Region region
|
||||
, String teamServerKey, String portalBottomCornerLocation, String portalTopCornerLocation, String npcName)
|
||||
{
|
||||
_name = name;
|
||||
_prefix = prefix;
|
||||
@ -148,6 +159,10 @@ public class ServerGroup
|
||||
_whitelist = whitelist;
|
||||
_resourcePack = resourcePack;
|
||||
_region = region;
|
||||
_teamServerKey = teamServerKey;
|
||||
_portalBottomCornerLocation = portalBottomCornerLocation;
|
||||
_portalTopCornerLocation = portalTopCornerLocation;
|
||||
_npcName = npcName;
|
||||
}
|
||||
|
||||
public String getName() { return _name; }
|
||||
@ -196,6 +211,12 @@ public class ServerGroup
|
||||
public String getResourcePack() { return _resourcePack; }
|
||||
public Region getRegion() { return _region; }
|
||||
|
||||
public String getTeamServerKey() { return _teamServerKey; }
|
||||
|
||||
public String getServerNpcName() { return _npcName; }
|
||||
public String getPortalBottomCornerLocation() { return _portalBottomCornerLocation; }
|
||||
public String getPortalTopCornerLocation() { return _portalTopCornerLocation; }
|
||||
|
||||
public Set<MinecraftServer> getServers() { return _servers; }
|
||||
|
||||
public int getServerCount()
|
||||
@ -350,6 +371,10 @@ public class ServerGroup
|
||||
_dataMap.put("resourcePack", _resourcePack);
|
||||
_dataMap.put("host", _host);
|
||||
_dataMap.put("region", _region.name());
|
||||
_dataMap.put("teamServerKey", _teamServerKey);
|
||||
_dataMap.put("portalBottomCornerLocation", _portalBottomCornerLocation);
|
||||
_dataMap.put("portalTopCornerLocation", _portalTopCornerLocation);
|
||||
_dataMap.put("npcName", _npcName);
|
||||
}
|
||||
|
||||
return _dataMap;
|
||||
|
@ -48,6 +48,7 @@ import mineplex.core.status.ServerStatusManager;
|
||||
import mineplex.core.teleport.Teleport;
|
||||
import mineplex.core.updater.FileUpdater;
|
||||
import mineplex.core.updater.Updater;
|
||||
import mineplex.core.velocity.VelocityFix;
|
||||
import mineplex.core.visibility.VisibilityManager;
|
||||
import mineplex.minecraft.game.core.combat.CombatManager;
|
||||
import mineplex.minecraft.game.core.damage.DamageManager;
|
||||
@ -86,11 +87,15 @@ public class Arcade extends JavaPlugin
|
||||
_clientManager = new CoreClientManager(this, webServerAddress);
|
||||
CommandCenter.Instance.setClientManager(_clientManager);
|
||||
|
||||
|
||||
ItemStackFactory.Initialize(this, false);
|
||||
Recharge.Initialize(this);
|
||||
VisibilityManager.Initialize(this);
|
||||
Give.Initialize(this);
|
||||
|
||||
//Velocity Fix
|
||||
new VelocityFix(this);
|
||||
|
||||
_donationManager = new DonationManager(this, _clientManager, webServerAddress);
|
||||
|
||||
_serverConfiguration = new ServerConfiguration(this, _clientManager);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package nautilus.game.arcade;
|
||||
|
||||
import java.awt.Event;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
@ -48,6 +49,7 @@ import mineplex.core.common.jsonchat.JsonMessage;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.NautHashMap;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
@ -110,6 +112,7 @@ import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.Game.GameState;
|
||||
import nautilus.game.arcade.game.GameServerConfig;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.games.event.EventModule;
|
||||
import nautilus.game.arcade.game.games.uhc.UHC;
|
||||
import nautilus.game.arcade.managers.GameAchievementManager;
|
||||
import nautilus.game.arcade.managers.GameChatManager;
|
||||
@ -143,6 +146,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
private Creature _creature;
|
||||
private DamageManager _damageManager;
|
||||
private Explosion _explosionManager;
|
||||
private EventModule _eventManager;
|
||||
|
||||
private Fire _fire;
|
||||
private ProjectileManager _projectileManager;
|
||||
@ -257,6 +261,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
_cosmeticManager = cosmeticManager;
|
||||
_portal = portal;
|
||||
_petManager = petManager;
|
||||
_eventManager = new EventModule(this, getPlugin());
|
||||
|
||||
// Shop
|
||||
_arcadeShop = new ArcadeShop(this, clientManager, donationManager);
|
||||
@ -562,6 +567,11 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
return _gameWorldManager;
|
||||
}
|
||||
|
||||
public EventModule GetEventModule()
|
||||
{
|
||||
return _eventManager;
|
||||
}
|
||||
|
||||
public PreferencesManager getPreferences()
|
||||
{
|
||||
return _preferencesManager;
|
||||
@ -653,7 +663,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GetServerConfig().PublicServer)
|
||||
if (!GetServerConfig().PublicServer || GetServerConfig().PlayerServerWhitelist)
|
||||
{
|
||||
event.setMotd(ChatColor.GRAY + "Private");
|
||||
return;
|
||||
@ -818,6 +828,11 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, C.Bold + "Server has reached max capacity for gameplay purposes.");
|
||||
return;
|
||||
}
|
||||
else if (_gameHostManager.isEventServer() && Bukkit.getServer().getOnlinePlayers().size() >= 128)
|
||||
{
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, C.Bold + "Server has reached max capacity for gameplay purposes.");
|
||||
return;
|
||||
}
|
||||
|
||||
event.allow();
|
||||
event.setResult(PlayerLoginEvent.Result.ALLOWED);
|
||||
@ -829,6 +844,18 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void AdminOP(PlayerJoinEvent event)
|
||||
{
|
||||
// Give developers operator on their servers
|
||||
boolean testServer = _plugin.getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
|
||||
|
||||
if (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.OWNER) || (testServer && (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.DEVELOPER) || _clientManager.Get(event.getPlayer()).GetRank() == Rank.JNR_DEV)))
|
||||
event.getPlayer().setOp(true);
|
||||
else
|
||||
event.getPlayer().setOp(false);
|
||||
}
|
||||
|
||||
public boolean IsAlive(Player player)
|
||||
{
|
||||
if (_game == null)
|
||||
@ -1307,7 +1334,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
player.teleport(GetGame().GetSpectatorLocation());
|
||||
|
||||
//Set Spec State
|
||||
player.setVelocity(new Vector(0,1,0));
|
||||
UtilAction.velocity(player, new Vector(0,1,0));
|
||||
player.setAllowFlight(true);
|
||||
player.setFlying(true);
|
||||
player.setFlySpeed(0.1f);
|
||||
|
@ -38,10 +38,11 @@ import nautilus.game.arcade.game.games.quiver.QuiverTeams;
|
||||
import nautilus.game.arcade.game.games.runner.Runner;
|
||||
import nautilus.game.arcade.game.games.searchanddestroy.SearchAndDestroy;
|
||||
import nautilus.game.arcade.game.games.sheep.SheepGame;
|
||||
import nautilus.game.arcade.game.games.skywars.Skywars;
|
||||
import nautilus.game.arcade.game.games.smash.SuperSmash;
|
||||
import nautilus.game.arcade.game.games.skywars.SoloSkywars;
|
||||
import nautilus.game.arcade.game.games.skywars.TeamSkywars;
|
||||
import nautilus.game.arcade.game.games.smash.SoloSuperSmash;
|
||||
import nautilus.game.arcade.game.games.smash.SuperSmashDominate;
|
||||
import nautilus.game.arcade.game.games.smash.SuperSmashTeam;
|
||||
import nautilus.game.arcade.game.games.smash.TeamSuperSmash;
|
||||
import nautilus.game.arcade.game.games.snake.Snake;
|
||||
import nautilus.game.arcade.game.games.sneakyassassins.SneakyAssassins;
|
||||
import nautilus.game.arcade.game.games.snowfight.SnowFight;
|
||||
@ -49,8 +50,8 @@ import nautilus.game.arcade.game.games.spleef.Spleef;
|
||||
import nautilus.game.arcade.game.games.spleef.SpleefTeams;
|
||||
import nautilus.game.arcade.game.games.squidshooter.SquidShooter;
|
||||
import nautilus.game.arcade.game.games.stacker.Stacker;
|
||||
import nautilus.game.arcade.game.games.survivalgames.SurvivalGames;
|
||||
import nautilus.game.arcade.game.games.survivalgames.SurvivalGamesTeams;
|
||||
import nautilus.game.arcade.game.games.survivalgames.SoloSurvivalGames;
|
||||
import nautilus.game.arcade.game.games.survivalgames.TeamSurvivalGames;
|
||||
import nautilus.game.arcade.game.games.tug.Tug;
|
||||
import nautilus.game.arcade.game.games.turfforts.TurfForts;
|
||||
import nautilus.game.arcade.game.games.uhc.UHC;
|
||||
@ -70,7 +71,7 @@ public enum GameType
|
||||
ChampionsDominate(ChampionsDominate.class, GameDisplay.ChampionsDominate),
|
||||
//ChampionsMOBA(ChampionsMOBA.class, "Champions MOBA", "Champions", Material.SKULL_ITEM, (byte)0, GameCategory.CHAMPIONS, 7),
|
||||
ChampionsTDM(ChampionsTDM.class, GameDisplay.ChampionsTDM),
|
||||
Christmas(Christmas.class, GameDisplay.Christmas),
|
||||
Christmas(Christmas.class, GameDisplay.Christmas, "http://chivebox.com/file/c/xmas.zip", true),
|
||||
DeathTag(DeathTag.class, GameDisplay.DeathTag),
|
||||
DragonEscape(DragonEscape.class, GameDisplay.DragonEscape),
|
||||
DragonEscapeTeams(DragonEscapeTeams.class, GameDisplay.DragonEscapeTeams),
|
||||
@ -81,7 +82,7 @@ public enum GameType
|
||||
Evolution(Evolution.class, GameDisplay.Evolution),
|
||||
//FlappyBird(FlappyBird.class, "Flappy Bird", Material.FEATHER, (byte)0, GameCategory.ARCADE, 17),
|
||||
Gravity(Gravity.class, GameDisplay.Gravity),
|
||||
Halloween(Halloween.class, GameDisplay.Halloween),
|
||||
Halloween(Halloween.class, GameDisplay.Halloween, "http://chivebox.com/file/c/hh.zip", true),
|
||||
HideSeek(HideSeek.class, GameDisplay.HideSeek),
|
||||
HoleInTheWall(HoleInTheWall.class, GameDisplay.HoleInTheWall),
|
||||
Horse(Horse.class, GameDisplay.Horse),
|
||||
@ -98,9 +99,9 @@ public enum GameType
|
||||
SearchAndDestroy(SearchAndDestroy.class, GameDisplay.SearchAndDestroy),
|
||||
Sheep(SheepGame.class, GameDisplay.Sheep),
|
||||
|
||||
Smash(SuperSmash.class, GameDisplay.Smash),
|
||||
Smash(SoloSuperSmash.class, GameDisplay.Smash),
|
||||
SmashDomination(SuperSmashDominate.class, GameDisplay.SmashDomination),
|
||||
SmashTeams(SuperSmashTeam.class, GameDisplay.SmashTeams),
|
||||
SmashTeams(TeamSuperSmash.class, GameDisplay.SmashTeams, new GameType[]{GameType.Smash}, false),
|
||||
Snake(Snake.class, GameDisplay.Snake),
|
||||
SneakyAssassins(SneakyAssassins.class, GameDisplay.SneakyAssassins),
|
||||
SnowFight(SnowFight.class, GameDisplay.SnowFight),
|
||||
@ -108,23 +109,35 @@ public enum GameType
|
||||
SpleefTeams(SpleefTeams.class, GameDisplay.SpleefTeams),
|
||||
SquidShooter(SquidShooter.class, GameDisplay.SquidShooter),
|
||||
Stacker(Stacker.class, GameDisplay.Stacker),
|
||||
SurvivalGames(SurvivalGames.class, GameDisplay.SurvivalGames),
|
||||
SurvivalGamesTeams(SurvivalGamesTeams.class, GameDisplay.SurvivalGamesTeams),
|
||||
SurvivalGames(SoloSurvivalGames.class, GameDisplay.SurvivalGames),
|
||||
SurvivalGamesTeams(TeamSurvivalGames.class, GameDisplay.SurvivalGamesTeams, new GameType[]{GameType.SurvivalGames}, false),
|
||||
Tug(Tug.class, GameDisplay.Tug),
|
||||
TurfWars(TurfForts.class, GameDisplay.TurfWars),
|
||||
UHC(UHC.class, GameDisplay.UHC),
|
||||
WitherAssault(WitherGame.class, GameDisplay.WitherAssault),
|
||||
Wizards(Wizards.class, GameDisplay.Wizards, "http://chivebox.com/file/c/ResWizards.zip", true),
|
||||
ZombieSurvival(ZombieSurvival.class, GameDisplay.ZombieSurvival),
|
||||
|
||||
Build(Build.class, GameDisplay.Build),
|
||||
Cards(Cards.class, GameDisplay.Cards),
|
||||
Skywars(Skywars.class, GameDisplay.Skywars),
|
||||
Skywars(SoloSkywars.class, GameDisplay.Skywars),
|
||||
SkywarsTeams(TeamSkywars.class, GameDisplay.SkywarsTeams, new GameType[]{GameType.Skywars}, false),
|
||||
|
||||
Event(EventGame.class, GameDisplay.Event);
|
||||
Event(EventGame.class, GameDisplay.Event, new GameType[]{
|
||||
GameType.BaconBrawl, GameType.Barbarians, GameType.Bridge, GameType.Build, GameType.Build,
|
||||
GameType.Cards, GameType.CastleSiege, GameType.ChampionsDominate, GameType.ChampionsTDM, GameType.Christmas,
|
||||
GameType.DeathTag, GameType.DragonEscape, GameType.DragonEscapeTeams, GameType.DragonRiders, GameType.Dragons,
|
||||
GameType.Draw, GameType.Evolution, GameType.Gravity, GameType.Halloween, GameType.HideSeek,
|
||||
GameType.HoleInTheWall, GameType.Horse, GameType.Micro, GameType.MilkCow, GameType.MineStrike, GameType.MineWare,
|
||||
GameType.OldMineWare, GameType.Paintball, GameType.Quiver, GameType.QuiverTeams, GameType.Runner, GameType.SearchAndDestroy,
|
||||
GameType.Sheep, GameType.Skywars, GameType.SkywarsTeams, GameType.Smash, GameType.SmashDomination, GameType.SmashTeams,
|
||||
GameType.Snake, GameType.SneakyAssassins, GameType.SnowFight, GameType.Spleef, GameType.SpleefTeams, GameType.SquidShooter,
|
||||
GameType.Stacker, GameType.SurvivalGames, GameType.SurvivalGamesTeams, GameType.Tug, GameType.TurfWars, GameType.UHC,
|
||||
GameType.WitherAssault, GameType.Wizards, GameType.ZombieSurvival}, true);
|
||||
|
||||
GameDisplay _display;
|
||||
boolean _enforceResourcePack;
|
||||
GameType[] _mapSource;
|
||||
boolean _ownMaps;
|
||||
String _resourcePack;
|
||||
Class<? extends Game> _gameClass;
|
||||
|
||||
@ -133,15 +146,27 @@ public enum GameType
|
||||
|
||||
GameType(Class<? extends Game> gameClass, GameDisplay display)
|
||||
{
|
||||
this(gameClass, display, null, false);
|
||||
this(gameClass, display, null, false, null, true);
|
||||
}
|
||||
|
||||
GameType(Class<? extends Game> gameClass, GameDisplay display, String resourcePackUrl, boolean enforceResourcePack)
|
||||
{
|
||||
this(gameClass, display, resourcePackUrl, enforceResourcePack, null, true);
|
||||
}
|
||||
|
||||
GameType(Class<? extends Game> gameClass, GameDisplay display, GameType[] mapSource, boolean ownMap)
|
||||
{
|
||||
this(gameClass, display, null, false, mapSource, ownMap);
|
||||
}
|
||||
|
||||
GameType(Class<? extends Game> gameClass, GameDisplay display, String resourcePackUrl, boolean enforceResourcePack, GameType[] mapSource, boolean ownMaps)
|
||||
{
|
||||
_display = display;
|
||||
_gameClass = gameClass;
|
||||
_resourcePack = resourcePackUrl;
|
||||
_enforceResourcePack = enforceResourcePack;
|
||||
_mapSource = mapSource;
|
||||
_ownMaps = ownMaps;
|
||||
}
|
||||
|
||||
public Class<? extends Game> getGameClass()
|
||||
@ -159,6 +184,16 @@ public enum GameType
|
||||
return _resourcePack;
|
||||
}
|
||||
|
||||
public GameType[] getMapSource()
|
||||
{
|
||||
return _mapSource;
|
||||
}
|
||||
|
||||
public boolean ownMaps()
|
||||
{
|
||||
return _ownMaps;
|
||||
}
|
||||
|
||||
public String GetName()
|
||||
{
|
||||
return _display.getName();
|
||||
@ -183,4 +218,5 @@ public enum GameType
|
||||
{
|
||||
return _display.getGameCategory();
|
||||
}
|
||||
|
||||
}
|
@ -3,9 +3,8 @@ package nautilus.game.arcade.command;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import net.minecraft.util.com.mojang.authlib.GameProfile;
|
||||
|
||||
import mineplex.core.command.CommandBase;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
@ -13,12 +12,13 @@ import mineplex.core.common.util.ProfileLoader;
|
||||
import mineplex.core.common.util.UUIDFetcher;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.disguise.disguises.DisguisePlayer;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
|
||||
public class DisguiseCommand extends CommandBase<ArcadeManager>
|
||||
{
|
||||
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
|
||||
|
@ -25,7 +25,7 @@ public class GameCommand extends MultiCommandBase<ArcadeManager>
|
||||
UtilPlayer.message(caller, F.main(Plugin.getName(), "Commands List:"));
|
||||
UtilPlayer.message(caller, F.help("/game start", "Start the current game", Rank.ADMIN));
|
||||
UtilPlayer.message(caller, F.help("/game stop", "Stop the current game", Rank.ADMIN));
|
||||
UtilPlayer.message(caller, F.help("/game set <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!"));
|
||||
}
|
||||
}
|
||||
|
@ -29,16 +29,31 @@ public class SetCommand extends CommandBase<ArcadeManager>
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
String game = args[0].toLowerCase();
|
||||
|
||||
if (args.length > 1)
|
||||
if (args.length >= 2)
|
||||
{
|
||||
Plugin.GetGameCreationManager().MapPref = args[1];
|
||||
UtilPlayer.message(caller, C.cAqua + C.Bold + "Map Preference: " + ChatColor.RESET + args[1]);
|
||||
String map = "";
|
||||
String source = "";
|
||||
if(args.length == 3)
|
||||
{
|
||||
Plugin.GetGameCreationManager().MapSource = args[1];
|
||||
Plugin.GetGameCreationManager().MapPref = args[2];
|
||||
source = args[1];
|
||||
map = args[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
Plugin.GetGameCreationManager().MapSource = args[0];
|
||||
Plugin.GetGameCreationManager().MapPref = args[1];
|
||||
source = args[0];
|
||||
map = args[1];
|
||||
}
|
||||
UtilPlayer.message(caller, C.cAqua + C.Bold + "Map Preference: " + ChatColor.RESET + source + ":" + map);
|
||||
}
|
||||
|
||||
//Parse Game
|
||||
|
@ -11,7 +11,7 @@ public class WriteCommand extends CommandBase<ArcadeManager>
|
||||
{
|
||||
public WriteCommand(ArcadeManager plugin)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, "write");
|
||||
super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "write");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -86,7 +86,7 @@ public abstract class Game implements Listener
|
||||
protected String[] _gameDesc;
|
||||
|
||||
//Map
|
||||
private ArrayList<String> _files;
|
||||
private HashMap<GameType, ArrayList<String>> _files;
|
||||
|
||||
//State
|
||||
private GameState _gameState = GameState.Loading;
|
||||
@ -193,8 +193,6 @@ public abstract class Game implements Listener
|
||||
public int HungerSet = -1;
|
||||
public int HealthSet = -1;
|
||||
|
||||
public int SpawnDistanceRequirement = 1;
|
||||
|
||||
public boolean PrepareFreeze = true;
|
||||
|
||||
private double _itemMergeRadius = 0;
|
||||
@ -211,6 +209,11 @@ public abstract class Game implements Listener
|
||||
|
||||
public int TickPerTeleport = 1;
|
||||
|
||||
public int FillTeamsInOrderToCount = -1;
|
||||
|
||||
public boolean SpawnNearAllies = false;
|
||||
public boolean SpawnNearEnemies = false;
|
||||
|
||||
public boolean StrictAntiHack = false;
|
||||
|
||||
public boolean DisableKillCommand = true;
|
||||
@ -265,6 +268,9 @@ public abstract class Game implements Listener
|
||||
public boolean CanAddStats = true;
|
||||
public boolean CanGiveLoot = true;
|
||||
|
||||
public boolean HideTeamSheep = false;
|
||||
public boolean ReplaceTeamsWithKits = false;
|
||||
|
||||
public boolean VersionRequire1_8 = false;
|
||||
|
||||
public ArrayList<String> GemBoosters = new ArrayList<String>();
|
||||
@ -288,16 +294,28 @@ public abstract class Game implements Listener
|
||||
Scoreboard = new GameScoreboard(this);
|
||||
|
||||
//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)
|
||||
{
|
||||
ArrayList<String> matches = new ArrayList<String>();
|
||||
for (String cur : _files)
|
||||
HashMap<GameType, ArrayList<String>> matches = new HashMap<GameType, ArrayList<String>>();
|
||||
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);
|
||||
System.out.print("Map Preference: " + cur);
|
||||
if (cur.toLowerCase().contains(Manager.GetGameCreationManager().MapPref.toLowerCase()))
|
||||
{
|
||||
if(game.toString().toLowerCase().contains(Manager.GetGameCreationManager().MapSource.toLowerCase()))
|
||||
{
|
||||
list.add(cur);
|
||||
System.out.print("Map Preference: " + cur);
|
||||
matches.put(game, list);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -305,6 +323,7 @@ public abstract class Game implements Listener
|
||||
_files = matches;
|
||||
|
||||
Manager.GetGameCreationManager().MapPref = null;
|
||||
Manager.GetGameCreationManager().MapSource = null;
|
||||
}
|
||||
WorldData = new WorldData(this);
|
||||
|
||||
@ -339,7 +358,7 @@ public abstract class Game implements Listener
|
||||
_kits = kits;
|
||||
}
|
||||
|
||||
public ArrayList<String> GetFiles()
|
||||
public HashMap<GameType, ArrayList<String>> GetFiles()
|
||||
{
|
||||
return _files;
|
||||
}
|
||||
@ -349,6 +368,60 @@ public abstract class Game implements Listener
|
||||
return _gameType.GetName();
|
||||
}
|
||||
|
||||
public GameType[] GetWorldHostNames()
|
||||
{
|
||||
GameType[] mapSource = new GameType[]{GetType()};
|
||||
if(GetType().getMapSource() != null)
|
||||
{
|
||||
if(GetType().ownMaps())
|
||||
{
|
||||
int i = 1;
|
||||
mapSource = new GameType[GetType().getMapSource().length + 1];
|
||||
for(GameType type : GetType().getMapSource())
|
||||
{
|
||||
mapSource[i] = type;
|
||||
i++;
|
||||
}
|
||||
mapSource[0] = GetType();
|
||||
}
|
||||
else
|
||||
{
|
||||
mapSource = GetType().getMapSource();
|
||||
}
|
||||
}
|
||||
return mapSource;
|
||||
}
|
||||
|
||||
public String GetGameNamebyMap(String game, String map)
|
||||
{
|
||||
for(GameType type : _files.keySet())
|
||||
{
|
||||
if(type.GetName().toLowerCase().contains(game.toLowerCase()))
|
||||
{
|
||||
for(String string : _files.get(type))
|
||||
{
|
||||
if(string.toLowerCase().contains(map.toLowerCase()))
|
||||
{
|
||||
return type.GetName();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public GameType GetGameByMapList(ArrayList<String> maps)
|
||||
{
|
||||
for(GameType game : _files.keySet())
|
||||
{
|
||||
if(maps.equals(_files.get(game)))
|
||||
{
|
||||
return game;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String GetMode()
|
||||
{
|
||||
return null;
|
||||
@ -472,9 +545,6 @@ public abstract class Game implements Listener
|
||||
//Add
|
||||
GetTeamList().add(team);
|
||||
|
||||
//Set Spawn Data
|
||||
team.SetSpawnRequirement(this.SpawnDistanceRequirement);
|
||||
|
||||
System.out.println("Created Team: " + team.GetName());
|
||||
}
|
||||
|
||||
@ -556,6 +626,17 @@ public abstract class Game implements Listener
|
||||
|
||||
public GameTeam ChooseTeam(Player player)
|
||||
{
|
||||
if (FillTeamsInOrderToCount != -1)
|
||||
{
|
||||
for (int i = 0; i < _teamList.size(); i++)
|
||||
{
|
||||
if (_teamList.get(i).GetSize() < FillTeamsInOrderToCount)
|
||||
{
|
||||
return _teamList.get(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GameTeam team = null;
|
||||
|
||||
//Random Team
|
||||
@ -1381,4 +1462,5 @@ public abstract class Game implements Listener
|
||||
//End
|
||||
SetState(GameState.End);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -37,6 +37,8 @@ public class GameServerConfig
|
||||
|
||||
public boolean PublicServer = true;
|
||||
|
||||
public boolean PlayerServerWhitelist = false;
|
||||
|
||||
public boolean IsValid()
|
||||
{
|
||||
return ServerType != null && MinPlayers != -1 && MaxPlayers != -1;
|
||||
|
@ -5,8 +5,10 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
import mineplex.core.account.CoreClient;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
@ -65,14 +67,14 @@ public class GameTeam
|
||||
|
||||
private HashSet<Kit> _kitRestrict = new HashSet<Kit>();
|
||||
|
||||
private int _spawnDistance = 0;
|
||||
|
||||
private boolean _visible = true;
|
||||
|
||||
private boolean _displayTag;
|
||||
|
||||
//Records order players go out in
|
||||
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;
|
||||
|
||||
@ -80,6 +82,12 @@ public class GameTeam
|
||||
_name = name;
|
||||
_color = color;
|
||||
_spawns = spawns;
|
||||
_displayTag = tags;
|
||||
}
|
||||
|
||||
public GameTeam(Game host, String name, ChatColor color, ArrayList<Location> spawns)
|
||||
{
|
||||
this(host, name, color, spawns, false);
|
||||
}
|
||||
|
||||
public String GetName()
|
||||
@ -99,40 +107,48 @@ public class GameTeam
|
||||
|
||||
public Location GetSpawn()
|
||||
{
|
||||
// ArrayList<Location> valid = new ArrayList<Location>();
|
||||
|
||||
Location best = null;
|
||||
double bestDist = 0;
|
||||
|
||||
for (Location loc : _spawns)
|
||||
//Keep allies together
|
||||
if (!Host.IsLive() && Host.SpawnNearAllies)
|
||||
{
|
||||
double closestPlayer = -1;
|
||||
//Find Location Nearest Ally
|
||||
Location loc = UtilAlg.getLocationNearPlayers(_spawns, GetPlayers(true), Host.GetPlayers(true));
|
||||
if (loc != null)
|
||||
return loc;
|
||||
|
||||
for (Player player : Host.GetPlayers(true))
|
||||
//No allies existed spawned yet
|
||||
|
||||
//Spawn near enemies (used for SG)
|
||||
if (Host.SpawnNearEnemies)
|
||||
{
|
||||
double playerDist = UtilMath.offsetSquared(player.getLocation(), loc);
|
||||
|
||||
if (closestPlayer == -1 || playerDist < closestPlayer)
|
||||
closestPlayer = playerDist;
|
||||
loc = UtilAlg.getLocationNearPlayers(_spawns, Host.GetPlayers(true), Host.GetPlayers(true));
|
||||
if (loc != null)
|
||||
return loc;
|
||||
}
|
||||
|
||||
if (best == null || closestPlayer > bestDist)
|
||||
//Spawn away from enemies
|
||||
else
|
||||
{
|
||||
best = loc;
|
||||
bestDist = closestPlayer;
|
||||
loc = UtilAlg.getLocationAwayFromPlayers(_spawns, Host.GetPlayers(true));
|
||||
if (loc != null)
|
||||
return loc;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Spawn near players
|
||||
if (Host.SpawnNearEnemies)
|
||||
{
|
||||
Location loc = UtilAlg.getLocationNearPlayers(_spawns, Host.GetPlayers(true), Host.GetPlayers(true));
|
||||
if (loc != null)
|
||||
return loc;
|
||||
}
|
||||
//Spawn away from players
|
||||
else
|
||||
{
|
||||
Location loc = UtilAlg.getLocationAwayFromPlayers(_spawns, Host.GetPlayers(true));
|
||||
if (loc != null)
|
||||
return loc;
|
||||
}
|
||||
|
||||
// if (closestPlayer > _spawnDistance * _spawnDistance)
|
||||
// {
|
||||
// valid.add(loc);
|
||||
// }
|
||||
}
|
||||
|
||||
// if (valid.size() > 0)
|
||||
// valid.get(UtilMath.r(valid.size()));
|
||||
|
||||
if (best != null)
|
||||
return best;
|
||||
|
||||
return _spawns.get(UtilMath.r(_spawns.size()));
|
||||
}
|
||||
@ -149,7 +165,14 @@ public class GameTeam
|
||||
public void DisbandTeam()
|
||||
{
|
||||
for (Player player : _players.keySet())
|
||||
{
|
||||
for(Player other : UtilServer.getPlayers())
|
||||
{
|
||||
other.getScoreboard().getTeam(Host.Manager.GetClients().Get(player).GetRank().Name + _name.toUpperCase()).removePlayer(player);
|
||||
other.getScoreboard().getTeam(Host.Manager.GetClients().Get(player).GetRank().Name).addPlayer(player);
|
||||
}
|
||||
UtilPlayer.message(player, F.main("Team", _color + C.Bold + _displayName + " Team was disbanded."));
|
||||
}
|
||||
|
||||
_players.clear();
|
||||
}
|
||||
@ -333,11 +356,6 @@ public class GameTeam
|
||||
_spawns = spawns;
|
||||
}
|
||||
|
||||
public void SetSpawnRequirement(int value)
|
||||
{
|
||||
_spawnDistance = value;
|
||||
}
|
||||
|
||||
public void SetVisible(boolean b)
|
||||
{
|
||||
_visible = b;
|
||||
@ -348,6 +366,16 @@ public class GameTeam
|
||||
return _visible;
|
||||
}
|
||||
|
||||
public void setDisplayTag(boolean b)
|
||||
{
|
||||
_displayTag = b;
|
||||
}
|
||||
|
||||
public boolean GetDisplaytag()
|
||||
{
|
||||
return _displayTag;
|
||||
}
|
||||
|
||||
public void SetRespawnTime(double i)
|
||||
{
|
||||
_respawnTime = i;
|
||||
@ -390,6 +418,4 @@ public class GameTeam
|
||||
|
||||
return _places;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.MapUtil;
|
||||
import mineplex.core.common.util.NautHashMap;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilEvent;
|
||||
@ -1178,7 +1179,7 @@ public class Bridge extends TeamGame implements OreObsfucation
|
||||
UtilPlayer.message(event.getPlayer(), F.main("Game",
|
||||
"Cannot place blocks in liquids until Bridge is down."));
|
||||
|
||||
event.getPlayer().setVelocity(new Vector(0,-0.5,0));
|
||||
UtilAction.velocity(event.getPlayer(), new Vector(0, -0.5, 0));
|
||||
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
|
@ -67,6 +67,7 @@ import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.NautHashMap;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilEvent;
|
||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
@ -707,7 +708,7 @@ public class Build extends SoloGame
|
||||
event.setTo(event.getFrom());
|
||||
|
||||
//Velocity
|
||||
event.getPlayer().setVelocity(UtilAlg.getTrajectory(event.getTo(), data.Spawn));
|
||||
UtilAction.velocity(event.getPlayer(), UtilAlg.getTrajectory(event.getTo(), data.Spawn));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@ import org.bukkit.util.Vector;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.NautHashMap;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilEvent;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
@ -526,8 +527,7 @@ public class DragonEscape extends SoloGame
|
||||
|
||||
//Teleport
|
||||
player.teleport(target.getLocation().add(0, 0.5, 0));
|
||||
player.setVelocity(new Vector(0,0,0));
|
||||
player.setFallDistance(0);
|
||||
UtilAction.velocity(player, new Vector(0,0,0));
|
||||
|
||||
//Record
|
||||
_warpTime.put(player, System.currentTimeMillis());
|
||||
|
@ -26,6 +26,7 @@ import org.bukkit.util.Vector;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.NautHashMap;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilFirework;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
@ -540,8 +541,7 @@ public class DragonEscapeTeams extends TeamGame
|
||||
|
||||
//Teleport
|
||||
player.teleport(target.getLocation().add(0, 0.5, 0));
|
||||
player.setVelocity(new Vector(0,0,0));
|
||||
player.setFallDistance(0);
|
||||
UtilAction.velocity(player, new Vector(0,0,0));
|
||||
|
||||
//Record
|
||||
_warpTime.put(player, System.currentTimeMillis());
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -99,7 +99,7 @@ public class Evolution extends SoloGame
|
||||
|
||||
PrepareFreeze = false;
|
||||
|
||||
SpawnDistanceRequirement = 16;
|
||||
this.PrepareFreeze = false;
|
||||
|
||||
GemKillDeathRespawn = 2;
|
||||
GemAssistDeathRespawn = .5;
|
||||
|
@ -8,6 +8,7 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
@ -15,6 +16,7 @@ import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
import nautilus.game.arcade.game.SoloGame;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -225,7 +227,8 @@ public class HoleInTheWall extends SoloGame
|
||||
{
|
||||
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);
|
||||
}
|
||||
/*Location toTeleport = player.getLocation();
|
||||
|
@ -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.TNTThrowEvent;
|
||||
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.KitPitcher;
|
||||
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.TrackerBestTeam;
|
||||
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.TrackerTNTThrown;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
@ -79,7 +79,6 @@ public class BombLobbers extends TeamGame implements IThrown
|
||||
new KitJumper(manager),
|
||||
new KitArmorer(manager),
|
||||
new KitPitcher(manager),
|
||||
// new KitMortar(manager), << Spare time kit for Bobbeh
|
||||
new KitWaller(manager)
|
||||
}, new String[]
|
||||
{
|
||||
@ -109,7 +108,21 @@ public class BombLobbers extends TeamGame implements IThrown
|
||||
|
||||
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)
|
||||
@ -295,6 +308,8 @@ public class BombLobbers extends TeamGame implements IThrown
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
NautHashMap<TNTPrimed, BombToken> toAdd = new NautHashMap<TNTPrimed, BombToken>();
|
||||
|
||||
Iterator<Entry<TNTPrimed, BombToken>> iterator = _tnt.entrySet().iterator();
|
||||
while (iterator.hasNext())
|
||||
{
|
||||
@ -330,10 +345,16 @@ public class BombLobbers extends TeamGame implements IThrown
|
||||
tnt.getKey().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
|
||||
@ -540,7 +561,7 @@ public class BombLobbers extends TeamGame implements IThrown
|
||||
if (target != null)
|
||||
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
|
||||
@ -560,6 +581,6 @@ public class BombLobbers extends TeamGame implements IThrown
|
||||
if (event.GetCause() != DamageCause.ENTITY_EXPLOSION && event.GetCause() != DamageCause.BLOCK_EXPLOSION)
|
||||
return;
|
||||
|
||||
event.AddKnockback("Explosion", 1.5D);
|
||||
event.AddKnockback("Explosion", 1.7D);
|
||||
}
|
||||
}
|
||||
|
@ -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.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.perks.PerkDummy;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class KitArmorer extends Kit
|
||||
{
|
||||
@ -21,15 +23,18 @@ public class KitArmorer extends Kit
|
||||
{
|
||||
super(manager, "Armorer", KitAvailability.Gem, 2000, new String[]
|
||||
{
|
||||
"He uses his expert armor-making",
|
||||
"skills to block excess damage!",
|
||||
"",
|
||||
C.cGray + "Recieve " + C.cYellow + "Full Gold Armor"
|
||||
C.cGray + "He uses his expert armor-making",
|
||||
C.cGray + "skills to block excess damage!"
|
||||
}, new Perk[]
|
||||
{
|
||||
new PerkDummy("Armorer",
|
||||
new String[]
|
||||
{
|
||||
C.cGray + "Recieve " + C.cYellow + "Full Gold Armor"
|
||||
}),
|
||||
new PerkCraftman()
|
||||
}, EntityType.ZOMBIE,
|
||||
new ItemBuilder(Material.GOLD_INGOT).build());
|
||||
new ItemBuilder(Material.GOLD_HELMET).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -51,12 +56,11 @@ public class KitArmorer extends Kit
|
||||
}
|
||||
|
||||
@Override
|
||||
public void SpawnCustom(LivingEntity ent)
|
||||
public void SpawnCustom(LivingEntity entity)
|
||||
{
|
||||
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());
|
||||
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
|
||||
|
@ -1,5 +1,6 @@
|
||||
package nautilus.game.arcade.game.games.lobbers.kits;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.itemstack.ItemBuilder;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
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.Perk;
|
||||
import nautilus.game.arcade.kit.perks.PerkDoubleJump;
|
||||
import nautilus.game.arcade.kit.perks.PerkDummy;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.EntityType;
|
||||
@ -22,11 +24,15 @@ public class KitJumper extends Kit
|
||||
{
|
||||
super(manager, "Jumper", KitAvailability.Free, 0, new String[]
|
||||
{
|
||||
"Use your jumping abilities to leap away from trouble!",
|
||||
"You take no fall damage."
|
||||
C.cGray + "Use your jumping abilities to leap away from trouble!"
|
||||
}, new Perk[]
|
||||
{
|
||||
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()
|
||||
}, EntityType.ZOMBIE, new ItemBuilder(Material.IRON_AXE).build());
|
||||
}
|
||||
|
@ -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.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.perks.PerkDummy;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.EntityType;
|
||||
@ -27,14 +28,16 @@ public class KitPitcher extends Kit
|
||||
{
|
||||
super(manager, "Pitcher", KitAvailability.Gem, 4000, new String[]
|
||||
{
|
||||
"He can easily pitch the perfect 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.",
|
||||
C.cGray + "He can easily pitch the perfect",
|
||||
C.cGray + "shot for any occasion."
|
||||
}, 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()
|
||||
}, EntityType.ZOMBIE,
|
||||
new ItemBuilder(Material.LEVER).build());
|
||||
@ -43,7 +46,7 @@ public class KitPitcher extends Kit
|
||||
@Override
|
||||
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
|
||||
@ -112,11 +115,11 @@ public class KitPitcher extends Kit
|
||||
private double getVelocity(int amount)
|
||||
{
|
||||
if (amount == 1)
|
||||
return 1.5;
|
||||
|
||||
if (amount == 2)
|
||||
return 1.75;
|
||||
|
||||
if (amount == 3)
|
||||
return 2.25;
|
||||
|
||||
return 2.0;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package nautilus.game.arcade.game.games.lobbers.kits;
|
||||
|
||||
import mineplex.core.achievement.Achievement;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.itemstack.ItemBuilder;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
@ -27,6 +28,16 @@ public class KitWaller extends Kit
|
||||
new PerkCraftman()
|
||||
}, EntityType.ZOMBIE,
|
||||
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
|
||||
@ -36,3 +47,4 @@ public class KitWaller extends Kit
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,6 @@ import org.bukkit.event.EventHandler;
|
||||
|
||||
public class Tracker6Kill extends StatTracker<Game>
|
||||
{
|
||||
|
||||
public Tracker6Kill(Game game)
|
||||
{
|
||||
super(game);
|
||||
|
@ -1,51 +0,0 @@
|
||||
package nautilus.game.arcade.game.games.lobbers.trackers;
|
||||
|
||||
import mineplex.core.common.util.NautHashMap;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.Game.GameState;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.stats.StatTracker;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
||||
public class TrackerBestTeam extends StatTracker<Game>
|
||||
{
|
||||
private NautHashMap<GameTeam, Integer> _teams = new NautHashMap<GameTeam, Integer>();
|
||||
|
||||
public TrackerBestTeam(Game game)
|
||||
{
|
||||
super(game);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onGameStart(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() != GameState.Prepare)
|
||||
return;
|
||||
|
||||
for (GameTeam team : getGame().GetTeamList())
|
||||
{
|
||||
_teams.put(team, team.GetPlayers(true).size());
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onGameEnd(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() != GameState.End)
|
||||
return;
|
||||
|
||||
for (GameTeam team : getGame().GetTeamList())
|
||||
{
|
||||
if (_teams.get(team) == team.GetPlayers(true).size())
|
||||
{
|
||||
for (Player player : team.GetPlayers(true))
|
||||
{
|
||||
addStat(player, "BestTeam", 1, true, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package nautilus.game.arcade.game.games.lobbers.trackers;
|
||||
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.stats.StatTracker;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
public class TrackerDirectHit extends StatTracker<Game>
|
||||
{
|
||||
public TrackerDirectHit(Game game)
|
||||
{
|
||||
super(game);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onKillDirectHit(CustomDamageEvent event)
|
||||
{
|
||||
if (!getGame().IsLive())
|
||||
return;
|
||||
|
||||
if (event.GetDamagerPlayer(true) == null)
|
||||
return;
|
||||
|
||||
Player damager = event.GetDamagerPlayer(true);
|
||||
|
||||
if (!getGame().IsAlive(damager))
|
||||
return;
|
||||
|
||||
if (event.GetReason() == null)
|
||||
return;
|
||||
|
||||
if (event.GetReason().toLowerCase().contains("direct hit"))
|
||||
addStat(damager, "Direct Hit", 1, false, false);
|
||||
}
|
||||
}
|
@ -3,7 +3,6 @@ package nautilus.game.arcade.game.games.lobbers.trackers;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
@ -16,36 +15,25 @@ import org.bukkit.event.EventPriority;
|
||||
|
||||
public class TrackerNoDamage extends StatTracker<Game>
|
||||
{
|
||||
private Set<String> _noDamage = new HashSet<String>();
|
||||
private Set<String> _damaged = new HashSet<String>();
|
||||
|
||||
public TrackerNoDamage(Game game)
|
||||
{
|
||||
super(game);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onGameStart(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() != GameState.Prepare)
|
||||
return;
|
||||
|
||||
for (Player player : getGame().GetPlayers(true))
|
||||
{
|
||||
_noDamage.add(player.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onGameEnd(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() != GameState.End)
|
||||
return;
|
||||
|
||||
for (String name : _noDamage)
|
||||
{
|
||||
Player player = UtilPlayer.searchExact(name);
|
||||
if (event.GetGame().getWinners() == null)
|
||||
return;
|
||||
|
||||
if (player == null || !player.isOnline())
|
||||
for (Player player : event.GetGame().getWinners())
|
||||
{
|
||||
if (_damaged.contains(player.getName()))
|
||||
continue;
|
||||
|
||||
addStat(player, "JellySkin", 1, true, false);
|
||||
@ -61,9 +49,7 @@ public class TrackerNoDamage extends StatTracker<Game>
|
||||
if (event.GetDamageePlayer() == null || !event.GetDamageePlayer().isOnline())
|
||||
return;
|
||||
|
||||
if (_noDamage.contains(event.GetDamageePlayer().getName()))
|
||||
{
|
||||
_noDamage.remove(event.GetDamageePlayer().getName());
|
||||
}
|
||||
if (!_damaged.contains(event.GetDamageePlayer().getName()))
|
||||
_damaged.add(event.GetDamageePlayer().getName());
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user