Merge remote-tracking branch 'refs/remotes/origin/develop' into feature/gem-hunters-persistence
This commit is contained in:
commit
82ebd28400
@ -1,6 +1,7 @@
|
|||||||
package mineplex.core.common;
|
package mineplex.core.common;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.DyeColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
@ -10,44 +11,46 @@ import mineplex.core.common.util.UtilPlayer;
|
|||||||
public enum Rank
|
public enum Rank
|
||||||
{
|
{
|
||||||
//Staff
|
//Staff
|
||||||
LT("Leader", "lt", ChatColor.DARK_RED, "Leaders manage the operation of their respective team \nor projects. They usually operate on affairs within \nthe staff, development, or management team.", 11),
|
LT("Leader", "lt", ChatColor.DARK_RED, "Leaders manage the operation of their respective team \nor projects. They usually operate on affairs within \nthe staff, development, or management team.", 11, DyeColor.RED),
|
||||||
OWNER("Owner", "owner", ChatColor.DARK_RED, "Owners are the founders of Mineplex. \nEach owner manages a different aspect of the \nserver and ensures its efficient operation.", 55),
|
OWNER("Owner", "owner", ChatColor.DARK_RED, "Owners are the founders of Mineplex. \nEach owner manages a different aspect of the \nserver and ensures its efficient operation.", 55, DyeColor.RED),
|
||||||
DEVELOPER("Dev", "dev", ChatColor.DARK_RED, "Developers work behind the scenes to \ncreate new games and features, and fix bugs to \ngive the best experience.", 5),
|
DEVELOPER("Dev", "dev", ChatColor.DARK_RED, "Developers work behind the scenes to \ncreate new games and features, and fix bugs to \ngive the best experience.", 5, DyeColor.RED),
|
||||||
ADMIN("Admin", "adm", ChatColor.DARK_RED, "An Administrator’s role is to manage \ntheir respective Senior Moderator team \nand all moderators within it.", 10),
|
ADMIN("Admin", "adm", ChatColor.DARK_RED, "An Administrator’s role is to manage \ntheir respective Senior Moderator team \nand all moderators within it.", 10, DyeColor.RED),
|
||||||
JNR_DEV("Jr.Dev", "jrdev", ChatColor.GOLD, "Junior Developers work behind the scenes to \ncreate new games and features, and fix bugs to \ngive the best experience.", -1),
|
JNR_DEV("Jr.Dev", "jrdev", ChatColor.GOLD, "Junior Developers work behind the scenes to \ncreate new games and features, and fix bugs to \ngive the best experience.", -1, DyeColor.ORANGE),
|
||||||
SUPPORT("Support", "spp", ChatColor.BLUE, "Support agents handle tickets and \nprovide customer service.", 47),
|
SUPPORT("Support", "spp", ChatColor.BLUE, "Support agents handle tickets and \nprovide customer service.", 47, DyeColor.BLUE),
|
||||||
CMOD("C.Mod", "cmod", ChatColor.GOLD, "Clans Moderators are members of the Clans Management Senior Mod team. \nTheir duties include moderation and support within the Clans servers. \n\nFor assistance, contact them using " + F.elem("/a <message>") + ".", 32),
|
CMOD("C.Mod", "cmod", ChatColor.GOLD, "Clans Moderators are members of the Clans Management Senior Mod team. \nTheir duties include moderation and support within the Clans servers. \n\nFor assistance, contact them using " + F.elem("/a <message>") + ".", 32, DyeColor.ORANGE),
|
||||||
SNR_MODERATOR("Sr.Mod", "srmod", ChatColor.GOLD, "Senior Moderators are members of a special \nSenior Moderator team where they have to fulfill specific tasks. \nJust like Moderators, you can always ask them for help. \n\nFor assistance, contact them using " + F.elem("/a <message>") + ".", 44),
|
EVENT_MODERATOR("Sr.Mod", "eventmod", ChatColor.GOLD, "Senior Moderators are members of a special \nSenior Moderator team where they have to fulfill specific tasks. \nJust like Moderators, you can always ask them for help. \n\nFor assistance, contact them using " + F.elem("/a <message>") + ".", 44, DyeColor.ORANGE),
|
||||||
MODERATOR("Mod", "mod", ChatColor.GOLD, "Moderators enforce rules and provide help to \nanyone with questions or concerns. \n\nFor assistance, contact them using " + F.elem("/a <message>") + ".", 32),
|
SNR_MODERATOR("Sr.Mod", "srmod", ChatColor.GOLD, "Senior Moderators are members of a special \nSenior Moderator team where they have to fulfill specific tasks. \nJust like Moderators, you can always ask them for help. \n\nFor assistance, contact them using " + F.elem("/a <message>") + ".", 44, DyeColor.ORANGE),
|
||||||
HELPER("Trainee", "train", ChatColor.GOLD, "Trainees are moderators-in-training. \nTheir duties include enforcing the rules and \nproviding help to anyone with questions or concerns. \n\nFor assistance, contact them using " + F.elem("/a <message>") + ".", 24),
|
MODERATOR("Mod", "mod", ChatColor.GOLD, "Moderators enforce rules and provide help to \nanyone with questions or concerns. \n\nFor assistance, contact them using " + F.elem("/a <message>") + ".", 32, DyeColor.ORANGE),
|
||||||
MAPLEAD("MapLead", "mapl", ChatColor.BLUE, "Map Leaders are leaders of the Mineplex Build Team. \nThey oversee the creation of new maps and manage Builders.", 25),
|
HELPER("Trainee", "train", ChatColor.GOLD, "Trainees are moderators-in-training. \nTheir duties include enforcing the rules and \nproviding help to anyone with questions or concerns. \n\nFor assistance, contact them using " + F.elem("/a <message>") + ".", 24, DyeColor.ORANGE),
|
||||||
MAPDEV("Builder", "mapd", ChatColor.BLUE, "Builders are members of the Mineplex Build Team. \nThey create many of the maps used across Mineplex.", 26),
|
MAPLEAD("MapLead", "mapl", ChatColor.BLUE, "Map Leaders are leaders of the Mineplex Build Team. \nThey oversee the creation of new maps and manage Builders.", 25, DyeColor.BLUE),
|
||||||
MEDIA("Media", "media", ChatColor.BLUE, "The Media rank is given to talented artists who are\n endorsed to create content for Mineplex.", -1),
|
MAPDEV("Builder", "mapd", ChatColor.BLUE, "Builders are members of the Mineplex Build Team. \nThey create many of the maps used across Mineplex.", 26, DyeColor.BLUE),
|
||||||
|
MEDIA("Media", "media", ChatColor.BLUE, "The Media rank is given to talented artists who are\n endorsed to create content for Mineplex.", -1, DyeColor.BLUE),
|
||||||
|
|
||||||
EVENT("Event", "evnt", ChatColor.WHITE, "A member of the official Mineplex Events team!", -1),
|
EVENT("Event", "evnt", ChatColor.WHITE, "A member of the official Mineplex Events team!", -1, DyeColor.WHITE),
|
||||||
|
|
||||||
//Media
|
//Media
|
||||||
YOUTUBE("YouTube", "yt", ChatColor.RED, "A YouTuber who creates content for \nor related to Mineplex.", 22),
|
YOUTUBE("YouTube", "yt", ChatColor.RED, "A YouTuber who creates content for \nor related to Mineplex.", 22, DyeColor.RED),
|
||||||
YOUTUBE_SMALL("YT", "ytsm", ChatColor.DARK_PURPLE, "A YouTuber who creates content for \nor related to Mineplex. \n\nThey have fewer subscribers than full YouTubers.", 20),
|
YOUTUBE_SMALL("YT", "ytsm", ChatColor.DARK_PURPLE, "A YouTuber who creates content for \nor related to Mineplex. \n\nThey have fewer subscribers than full YouTubers.", 20, DyeColor.PURPLE),
|
||||||
TWITCH("Twitch", "tw", ChatColor.DARK_PURPLE, "A Twitch streamer who often features \nMineplex in their streams.", 21),
|
TWITCH("Twitch", "tw", ChatColor.DARK_PURPLE, "A Twitch streamer who often features \nMineplex in their streams.", 21, DyeColor.PURPLE),
|
||||||
|
|
||||||
//Player
|
//Player
|
||||||
ETERNAL("Eternal", "et", ChatColor.DARK_AQUA, true, "Fantastic and magical, no one \nexcept the time lords truly understand \nthe power of this rank.\n\nThe fifth purchasable rank at Mineplex.com/shop", 18),
|
ETERNAL("Eternal", "et", ChatColor.DARK_AQUA, true, "Fantastic and magical, no one \nexcept the time lords truly understand \nthe power of this rank.\n\nThe fifth purchasable rank at Mineplex.com/shop", 18, DyeColor.CYAN),
|
||||||
TITAN("Titan", "t", ChatColor.RED, true, "Ancient myths spoke of a gigantic being \nwith immense power... \n\nThe fourth purchasable rank at Mineplex.com/shop", 15),
|
TITAN("Titan", "t", ChatColor.RED, true, "Ancient myths spoke of a gigantic being \nwith immense power... \n\nThe fourth purchasable rank at Mineplex.com/shop", 15, DyeColor.RED),
|
||||||
LEGEND("Legend", "l", ChatColor.GREEN, true, "Years they have told stories of this rank, \nonly for the legends to be true. \n\nThe third purchasable rank at Mineplex.com/shop", 14),
|
LEGEND("Legend", "l", ChatColor.GREEN, true, "Years they have told stories of this rank, \nonly for the legends to be true. \n\nThe third purchasable rank at Mineplex.com/shop", 14, DyeColor.GREEN),
|
||||||
HERO("Hero", "h", ChatColor.LIGHT_PURPLE, true, "There are many stories of a \nvaliant Hero who was brave enough to \ntame the most fearsome dragon in the land. \n\nThe second purchasable rank at Mineplex.com/shop", 13),
|
HERO("Hero", "h", ChatColor.LIGHT_PURPLE, true, "There are many stories of a \nvaliant Hero who was brave enough to \ntame the most fearsome dragon in the land. \n\nThe second purchasable rank at Mineplex.com/shop", 13, DyeColor.MAGENTA),
|
||||||
ULTRA("Ultra", "u", ChatColor.AQUA, true, "A first step into the stories of the mist. \nOnly those brave enough may enter. \n\nThe first purchasable rank at Mineplex.com/shop", 12),
|
ULTRA("Ultra", "u", ChatColor.AQUA, true, "A first step into the stories of the mist. \nOnly those brave enough may enter. \n\nThe first purchasable rank at Mineplex.com/shop", 12, DyeColor.LIGHT_BLUE),
|
||||||
ALL("", "", ChatColor.WHITE, null, -1);
|
ALL("", "", ChatColor.WHITE, null, -1, DyeColor.WHITE);
|
||||||
|
|
||||||
private ChatColor _color;
|
private ChatColor _color;
|
||||||
private boolean _donor;
|
private boolean _donor;
|
||||||
private String _description;
|
private String _description;
|
||||||
private int _forumId;
|
private int _forumId;
|
||||||
|
private DyeColor _dyeColor;
|
||||||
|
|
||||||
public String Name;
|
public String Name;
|
||||||
public String ScoreboardTag;
|
public String ScoreboardTag;
|
||||||
|
|
||||||
Rank(String name, String scoreboardTag, ChatColor color, String description, int forumId)
|
Rank(String name, String scoreboardTag, ChatColor color, String description, int forumId, DyeColor dyeColor)
|
||||||
{
|
{
|
||||||
_color = color;
|
_color = color;
|
||||||
Name = name;
|
Name = name;
|
||||||
@ -55,9 +58,10 @@ public enum Rank
|
|||||||
_description = description;
|
_description = description;
|
||||||
ScoreboardTag = scoreboardTag;
|
ScoreboardTag = scoreboardTag;
|
||||||
_forumId = forumId;
|
_forumId = forumId;
|
||||||
|
_dyeColor = dyeColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
Rank(String name, String scoreboardTag, ChatColor color, boolean donor, String description, int forumId)
|
Rank(String name, String scoreboardTag, ChatColor color, boolean donor, String description, int forumId, DyeColor dyeColor)
|
||||||
{
|
{
|
||||||
_color = color;
|
_color = color;
|
||||||
Name = name;
|
Name = name;
|
||||||
@ -65,6 +69,7 @@ public enum Rank
|
|||||||
_description = description;
|
_description = description;
|
||||||
ScoreboardTag = scoreboardTag;
|
ScoreboardTag = scoreboardTag;
|
||||||
_forumId = forumId;
|
_forumId = forumId;
|
||||||
|
_dyeColor = dyeColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDescription()
|
public String getDescription()
|
||||||
@ -151,4 +156,9 @@ public enum Rank
|
|||||||
{
|
{
|
||||||
return _forumId;
|
return _forumId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DyeColor getDyeColor()
|
||||||
|
{
|
||||||
|
return _dyeColor;
|
||||||
|
}
|
||||||
}
|
}
|
@ -152,12 +152,30 @@ public class ShapeWings extends ShapeGrid implements CosmeticShape
|
|||||||
"$##$$$$$$$$$$$$$$$"
|
"$##$$$$$$$$$$$$$$$"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public static final String[] KINGS_CAPE = new String[]
|
||||||
|
{
|
||||||
|
"00000$00000",
|
||||||
|
"0000$#$0000",
|
||||||
|
"000$###$000",
|
||||||
|
"000$###$000",
|
||||||
|
"00$#####$00",
|
||||||
|
"00$#####$00",
|
||||||
|
"00$#####$00",
|
||||||
|
"00$#####$00",
|
||||||
|
"0$#######$0",
|
||||||
|
"$#########$"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default rotation to give the wings a little tilt when displayed on players for instance
|
* Default rotation to give the wings a little tilt when displayed on players for instance
|
||||||
*/
|
*/
|
||||||
public static double DEFAULT_ROTATION = Math.PI/0.05;
|
public static double DEFAULT_ROTATION = Math.PI/0.05;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Doesn't have any rotation, so it doesn't go inside the player
|
||||||
|
*/
|
||||||
|
public static double NO_ROTATION = 0;
|
||||||
|
|
||||||
private String _particle;
|
private String _particle;
|
||||||
private Vector _offsetData;
|
private Vector _offsetData;
|
||||||
|
@ -232,7 +232,6 @@ public class UtilAlg
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static boolean inBoundingBox(Location loc, Vector cornerA, Vector cornerB)
|
public static boolean inBoundingBox(Location loc, Vector cornerA, Vector cornerB)
|
||||||
{
|
{
|
||||||
if (loc.getX() <= Math.min(cornerA.getX(), cornerB.getX())) return false;
|
if (loc.getX() <= Math.min(cornerA.getX(), cornerB.getX())) return false;
|
||||||
|
@ -89,12 +89,13 @@ public class CommandCenter implements Listener, IPacketHandler
|
|||||||
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event)
|
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event)
|
||||||
{
|
{
|
||||||
String commandName = event.getMessage().substring(1);
|
String commandName = event.getMessage().substring(1);
|
||||||
|
String argString = event.getMessage().substring(event.getMessage().indexOf(' ') + 1);
|
||||||
String[] args = new String[]{};
|
String[] args = new String[]{};
|
||||||
|
|
||||||
if (commandName.contains(" "))
|
if (commandName.contains(" "))
|
||||||
{
|
{
|
||||||
commandName = commandName.split(" ")[0];
|
commandName = commandName.split(" ")[0];
|
||||||
args = event.getMessage().substring(event.getMessage().indexOf(' ') + 1).split(" ");
|
args = argString.split(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
ICommand command = Commands.get(commandName.toLowerCase());
|
ICommand command = Commands.get(commandName.toLowerCase());
|
||||||
@ -113,6 +114,12 @@ public class CommandCenter implements Listener, IPacketHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
command.SetAliasUsed(commandName.toLowerCase());
|
command.SetAliasUsed(commandName.toLowerCase());
|
||||||
|
|
||||||
|
if (command instanceof LoggedCommand)
|
||||||
|
{
|
||||||
|
((LoggedCommand) command).execute(System.currentTimeMillis(), event.getPlayer().getName(), commandName, argString);
|
||||||
|
}
|
||||||
|
|
||||||
command.Execute(event.getPlayer(), args);
|
command.Execute(event.getPlayer(), args);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
package mineplex.core.command;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LoggedCommand
|
||||||
|
*
|
||||||
|
* @author xXVevzZXx
|
||||||
|
*/
|
||||||
|
public interface LoggedCommand
|
||||||
|
{
|
||||||
|
|
||||||
|
default void execute(long time, String username, String command, String args)
|
||||||
|
{
|
||||||
|
LoggingServerCommand cmd = new LoggingServerCommand(time, username, command, args);
|
||||||
|
cmd.publish();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package mineplex.core.command;
|
||||||
|
|
||||||
|
import mineplex.serverdata.commands.ServerCommand;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LoggingServerCommand
|
||||||
|
*
|
||||||
|
* @author xXVevzZXx
|
||||||
|
*/
|
||||||
|
public class LoggingServerCommand extends ServerCommand
|
||||||
|
{
|
||||||
|
private final long _time;
|
||||||
|
private final String _username;
|
||||||
|
private final String _command;
|
||||||
|
private final String _args;
|
||||||
|
|
||||||
|
public LoggingServerCommand(long time, String username, String command, String args)
|
||||||
|
{
|
||||||
|
_time = time;
|
||||||
|
_username = username;
|
||||||
|
_command = command;
|
||||||
|
_args = args;
|
||||||
|
}
|
||||||
|
}
|
@ -167,6 +167,8 @@ import mineplex.core.gadget.gadgets.particle.ParticleChristmasTree;
|
|||||||
import mineplex.core.gadget.gadgets.particle.ParticleCoalFumes;
|
import mineplex.core.gadget.gadgets.particle.ParticleCoalFumes;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleFairy;
|
import mineplex.core.gadget.gadgets.particle.ParticleFairy;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleFireRings;
|
import mineplex.core.gadget.gadgets.particle.ParticleFireRings;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.king.CastleManager;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.king.ParticleKing;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleLegend;
|
import mineplex.core.gadget.gadgets.particle.ParticleLegend;
|
||||||
import mineplex.core.gadget.gadgets.particle.spring.ParticleSpringHalo;
|
import mineplex.core.gadget.gadgets.particle.spring.ParticleSpringHalo;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleWingsAngel;
|
import mineplex.core.gadget.gadgets.particle.ParticleWingsAngel;
|
||||||
@ -267,6 +269,7 @@ public class GadgetManager extends MiniPlugin
|
|||||||
private final IncognitoManager _incognitoManager;
|
private final IncognitoManager _incognitoManager;
|
||||||
private TreasureManager _treasureManager;
|
private TreasureManager _treasureManager;
|
||||||
private SoulManager _soulManager;
|
private SoulManager _soulManager;
|
||||||
|
private CastleManager _castleManager;
|
||||||
|
|
||||||
private Map<GadgetType, List<Gadget>> _gadgets;
|
private Map<GadgetType, List<Gadget>> _gadgets;
|
||||||
|
|
||||||
@ -286,7 +289,7 @@ public class GadgetManager extends MiniPlugin
|
|||||||
public GadgetManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager,
|
public GadgetManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager,
|
||||||
MountManager mountManager, PetManager petManager, PreferencesManager preferencesManager,
|
MountManager mountManager, PetManager petManager, PreferencesManager preferencesManager,
|
||||||
DisguiseManager disguiseManager, BlockRestore blockRestore, ProjectileManager projectileManager, AchievementManager achievementManager,
|
DisguiseManager disguiseManager, BlockRestore blockRestore, ProjectileManager projectileManager, AchievementManager achievementManager,
|
||||||
PacketHandler packetHandler, HologramManager hologramManager, IncognitoManager incognitoManager)
|
PacketHandler packetHandler, HologramManager hologramManager, IncognitoManager incognitoManager, CastleManager castleManager)
|
||||||
{
|
{
|
||||||
super("Gadget Manager", plugin);
|
super("Gadget Manager", plugin);
|
||||||
|
|
||||||
@ -306,6 +309,7 @@ public class GadgetManager extends MiniPlugin
|
|||||||
_boosterManager = new OutfitWindUpSuitBoosterManager(this);
|
_boosterManager = new OutfitWindUpSuitBoosterManager(this);
|
||||||
_incognitoManager = incognitoManager;
|
_incognitoManager = incognitoManager;
|
||||||
_soulManager = new SoulManager();
|
_soulManager = new SoulManager();
|
||||||
|
_castleManager = castleManager;
|
||||||
|
|
||||||
createGadgets();
|
createGadgets();
|
||||||
createSets();
|
createSets();
|
||||||
@ -369,8 +373,6 @@ public class GadgetManager extends MiniPlugin
|
|||||||
addGadget(new ItemBow(this));
|
addGadget(new ItemBow(this));
|
||||||
addGadget(new ItemLovePotion(this));
|
addGadget(new ItemLovePotion(this));
|
||||||
addGadget(new ItemFlowerGift(this));
|
addGadget(new ItemFlowerGift(this));
|
||||||
// NEXT MONTH'S PPC
|
|
||||||
//addGadget(new ItemBubbleBlaster(this));
|
|
||||||
|
|
||||||
// Costume
|
// Costume
|
||||||
addGadget(new OutfitRaveSuitHelmet(this));
|
addGadget(new OutfitRaveSuitHelmet(this));
|
||||||
@ -461,6 +463,7 @@ public class GadgetManager extends MiniPlugin
|
|||||||
addGadget(new ParticleWingsLove(this));
|
addGadget(new ParticleWingsLove(this));
|
||||||
addGadget(new ParticleSpringHalo(this));
|
addGadget(new ParticleSpringHalo(this));
|
||||||
addGadget(new ParticleWingsBee(this));
|
addGadget(new ParticleWingsBee(this));
|
||||||
|
addGadget(new ParticleKing(this, _castleManager));
|
||||||
|
|
||||||
// Arrow Trails
|
// Arrow Trails
|
||||||
addGadget(new ArrowTrailFrostLord(this));
|
addGadget(new ArrowTrailFrostLord(this));
|
||||||
@ -1407,4 +1410,9 @@ public class GadgetManager extends MiniPlugin
|
|||||||
taunt.start(player);
|
taunt.start(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CastleManager getCastleManager()
|
||||||
|
{
|
||||||
|
return _castleManager;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,16 @@
|
|||||||
package mineplex.core.gadget.gadgets.item;
|
package mineplex.core.gadget.gadgets.item;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.entity.Bat;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.LineFormat;
|
import mineplex.core.common.util.LineFormat;
|
||||||
@ -20,16 +31,6 @@ import mineplex.core.preferences.Preference;
|
|||||||
import mineplex.core.recharge.Recharge;
|
import mineplex.core.recharge.Recharge;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.Sound;
|
|
||||||
import org.bukkit.entity.Bat;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.util.Vector;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
public class ItemBatGun extends ItemGadget
|
public class ItemBatGun extends ItemGadget
|
||||||
{
|
{
|
||||||
@ -94,6 +95,13 @@ public class ItemBatGun extends ItemGadget
|
|||||||
{
|
{
|
||||||
if (!bat.isValid())
|
if (!bat.isValid())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (Manager.getCastleManager().isInsideCastle(bat.getLocation()))
|
||||||
|
{
|
||||||
|
bat.remove();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
Vector rand = new Vector((Math.random() - 0.5)/3, (Math.random() - 0.5)/3, (Math.random() - 0.5)/3);
|
Vector rand = new Vector((Math.random() - 0.5)/3, (Math.random() - 0.5)/3, (Math.random() - 0.5)/3);
|
||||||
bat.setVelocity(loc.getDirection().clone().multiply(0.5).add(rand));
|
bat.setVelocity(loc.getDirection().clone().multiply(0.5).add(rand));
|
||||||
|
|
||||||
|
@ -73,6 +73,9 @@ public class ItemFleshHook extends ItemGadget implements IThrown
|
|||||||
if (target instanceof ArmorStand)
|
if (target instanceof ArmorStand)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (Manager.getCastleManager().isInsideCastle(target.getLocation()))
|
||||||
|
return;
|
||||||
|
|
||||||
//Pull
|
//Pull
|
||||||
UtilAction.velocity(target,
|
UtilAction.velocity(target,
|
||||||
UtilAlg.getTrajectory(target.getLocation(), player.getLocation()),
|
UtilAlg.getTrajectory(target.getLocation(), player.getLocation()),
|
||||||
|
@ -74,7 +74,7 @@ public class ItemMelonLauncher extends ItemGadget implements IThrown
|
|||||||
{
|
{
|
||||||
if (target != null)
|
if (target != null)
|
||||||
{
|
{
|
||||||
if (!(target instanceof ArmorStand))
|
if (!(target instanceof ArmorStand) && !Manager.getCastleManager().isInsideCastle(target.getLocation()))
|
||||||
{
|
{
|
||||||
//Push
|
//Push
|
||||||
UtilAction.velocity(target,
|
UtilAction.velocity(target,
|
||||||
|
@ -68,6 +68,9 @@ public class ItemTNT extends ItemGadget
|
|||||||
if (Manager.collideEvent(killer, this, player))
|
if (Manager.collideEvent(killer, this, player))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (Manager.getCastleManager().isInsideCastle(player.getLocation()))
|
||||||
|
continue;
|
||||||
|
|
||||||
double mult = players.get(player);
|
double mult = players.get(player);
|
||||||
|
|
||||||
//Knockback
|
//Knockback
|
||||||
|
@ -0,0 +1,680 @@
|
|||||||
|
package mineplex.core.gadget.gadgets.particle.king;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.Item;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.block.Action;
|
||||||
|
import org.bukkit.event.entity.EntitySpawnEvent;
|
||||||
|
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||||
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
import org.spigotmc.event.entity.EntityDismountEvent;
|
||||||
|
|
||||||
|
import mineplex.core.MiniPlugin;
|
||||||
|
import mineplex.core.account.CoreClientManager;
|
||||||
|
import mineplex.core.common.Rank;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.UtilAction;
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.UtilWorld;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.king.types.King;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.king.types.Peasant;
|
||||||
|
import mineplex.core.hologram.Hologram;
|
||||||
|
import mineplex.core.hologram.HologramManager;
|
||||||
|
import mineplex.core.mount.event.MountActivateEvent;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Manages the castle in the main lobbies
|
||||||
|
*/
|
||||||
|
public class CastleManager extends MiniPlugin
|
||||||
|
{
|
||||||
|
|
||||||
|
private King _king;
|
||||||
|
|
||||||
|
private Location _castleLocationA = new Location(UtilWorld.getWorld("world"), 32, 71, -4);
|
||||||
|
private Location _castleLocationB = new Location(UtilWorld.getWorld("world"), 44, 82, 8);
|
||||||
|
|
||||||
|
private Location _removedKingLocation = new Location(UtilWorld.getWorld("world"), 28, 71, 6);
|
||||||
|
|
||||||
|
private Location _hologramLocation = new Location(UtilWorld.getWorld("world"), 28.5, 74, 2.5);
|
||||||
|
|
||||||
|
private Location[] _woolLocations = new Location[]
|
||||||
|
{
|
||||||
|
new Location(UtilWorld.getWorld("world"), 33, 80, -3),
|
||||||
|
new Location(UtilWorld.getWorld("world"), 33, 80, 7),
|
||||||
|
new Location(UtilWorld.getWorld("world"), 43, 80, -3),
|
||||||
|
new Location(UtilWorld.getWorld("world"), 43, 80, 7)
|
||||||
|
};
|
||||||
|
|
||||||
|
private Location[] _throneLocations = new Location[]
|
||||||
|
{
|
||||||
|
new Location(UtilWorld.getWorld("world"), 41, 76, 2),
|
||||||
|
new Location(UtilWorld.getWorld("world"), 42, 77, 2),
|
||||||
|
new Location(UtilWorld.getWorld("world"), 42, 78, 2),
|
||||||
|
};
|
||||||
|
|
||||||
|
private CoreClientManager _coreClientManager;
|
||||||
|
private HologramManager _hologramManager;
|
||||||
|
|
||||||
|
private Hologram _hologram;
|
||||||
|
|
||||||
|
private boolean _isHub = false;
|
||||||
|
|
||||||
|
private Map<Player, King> _kings = new HashMap<>();
|
||||||
|
private Map<Player, Peasant> _peasants = new HashMap<>();
|
||||||
|
|
||||||
|
private Item _item;
|
||||||
|
|
||||||
|
public CastleManager(JavaPlugin plugin, CoreClientManager coreClientManager, HologramManager hologramManager, boolean isHub)
|
||||||
|
{
|
||||||
|
super("CastleManager", plugin);
|
||||||
|
_coreClientManager = coreClientManager;
|
||||||
|
_hologramManager = hologramManager;
|
||||||
|
_isHub = isHub;
|
||||||
|
spawnHologram();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the lobby's king
|
||||||
|
* @param king The new king
|
||||||
|
*/
|
||||||
|
public void setKing(King king)
|
||||||
|
{
|
||||||
|
_king = king;
|
||||||
|
updateHologram();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the current king
|
||||||
|
* @return The king of that lobby
|
||||||
|
*/
|
||||||
|
public King getKing()
|
||||||
|
{
|
||||||
|
return _king;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the server is a hub server or not
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean isHub()
|
||||||
|
{
|
||||||
|
return _isHub;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stops entities from spawning inside the castle
|
||||||
|
* @param event
|
||||||
|
*/
|
||||||
|
@EventHandler
|
||||||
|
public void onEntitySpawn(EntitySpawnEvent event)
|
||||||
|
{
|
||||||
|
if (!isHub())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.getEntity() instanceof Player)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.getEntity() instanceof Item)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (isInsideCastle(event.getLocation()))
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stops players from walking inside the castle
|
||||||
|
* @param event
|
||||||
|
*/
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerMove(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (!isHub())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Player player : UtilServer.getPlayers())
|
||||||
|
{
|
||||||
|
if (_king != null)
|
||||||
|
if (_king.getKing().equals(player))
|
||||||
|
continue;
|
||||||
|
if (isInsideCastle(player.getLocation()))
|
||||||
|
{
|
||||||
|
Entity target = player;
|
||||||
|
while (target.getVehicle() != null)
|
||||||
|
{
|
||||||
|
target = target.getVehicle();
|
||||||
|
}
|
||||||
|
Location spawnLocation = new Location(target.getWorld(), 0, 64, 0);
|
||||||
|
UtilAction.velocity(target, UtilAlg.getTrajectory(target.getLocation(), spawnLocation).multiply(-1), 1.5, true, 0.8, 0, 1.0, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detects when a player right clicks another player to tag them as their peasant
|
||||||
|
* @param event
|
||||||
|
*/
|
||||||
|
@EventHandler
|
||||||
|
public void onTagPeasant(PlayerInteractEntityEvent event)
|
||||||
|
{
|
||||||
|
if (!isHub())
|
||||||
|
return;
|
||||||
|
|
||||||
|
Player clicker = event.getPlayer();
|
||||||
|
|
||||||
|
if (!isKing(clicker))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!(event.getRightClicked() instanceof Player))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Player clicked = (Player) event.getRightClicked();
|
||||||
|
|
||||||
|
if (!isPeasant(clicked))
|
||||||
|
return;
|
||||||
|
|
||||||
|
King king = getKing(clicker);
|
||||||
|
Peasant peasant = getPeasant(clicked);
|
||||||
|
|
||||||
|
if (peasant.isInCooldown())
|
||||||
|
{
|
||||||
|
UtilPlayer.message(clicker, F.main("Kingdom", "You cannot claim " + F.name(clicked.getName()) + " because they have been claimed too recently! Try again later."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (king.hasPeasant(peasant))
|
||||||
|
{
|
||||||
|
UtilPlayer.message(clicker, F.main("Kingdom", "You cannot claim " + F.name(clicked.getName()) + " because they are already a member of your kingdom!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (peasant.getKing() != null)
|
||||||
|
{
|
||||||
|
King oldKing = peasant.getKing();
|
||||||
|
oldKing.removePeasant(peasant);
|
||||||
|
UtilPlayer.message(oldKing.getKing(), F.main("Kingdom", "" + F.name(clicked.getName()) + ", a member of your kingdom, was kidnapped by the evil monarch " + F.name(clicker.getName()) + "!"));
|
||||||
|
}
|
||||||
|
|
||||||
|
peasant.setCooldown();
|
||||||
|
king.addPeasant(peasant);
|
||||||
|
peasant.setKing(king);
|
||||||
|
UtilPlayer.message(clicker, F.main("Kingdom", "You claimed " + F.name(clicked.getName()) + " as a member of your kingdom!"));
|
||||||
|
UtilPlayer.message(clicker, F.main("Kingdom", "Kingdom population: " + F.count(king.amountOfPeasants())));
|
||||||
|
UtilPlayer.message(clicker, F.main("Kingdom", "Kingdom position: " + F.count("#" + getKingPosition(king))));
|
||||||
|
UtilPlayer.message(peasant.getPeasant(), F.main("Kingdom", "" + F.name(clicker.getName()) + " claimed you as a member of their kingdom!"));
|
||||||
|
|
||||||
|
updateLobbyKing();
|
||||||
|
updateHologram();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lets player sit on throne
|
||||||
|
* @param event
|
||||||
|
*/
|
||||||
|
@EventHandler
|
||||||
|
public void onSitThrone(PlayerInteractEvent event)
|
||||||
|
{
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
|
if (!isKing(player))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!getKing().getKing().equals(player))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.getAction() != Action.RIGHT_CLICK_BLOCK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!isHub())
|
||||||
|
return;
|
||||||
|
|
||||||
|
Block block = event.getClickedBlock();
|
||||||
|
|
||||||
|
boolean isThrone = false;
|
||||||
|
for (Location location : _throneLocations)
|
||||||
|
{
|
||||||
|
if (isThrone)
|
||||||
|
break;
|
||||||
|
|
||||||
|
isThrone = block.getLocation().getBlockX() == location.getBlockX()
|
||||||
|
&& block.getLocation().getBlockY() == location.getBlockY()
|
||||||
|
&& block.getLocation().getBlockZ() == location.getBlockZ();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isThrone)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Location loc = _throneLocations[0].clone().add(0.5, 1, 0.5);
|
||||||
|
loc.setYaw(90);
|
||||||
|
loc.setPitch(0);
|
||||||
|
Item item = loc.getWorld().dropItem(loc, new ItemStack(Material.WOOL, 1, (byte) 14));
|
||||||
|
item.setPickupDelay(Integer.MAX_VALUE);
|
||||||
|
item.setVelocity(new Vector(0, 0, 0));
|
||||||
|
item.teleport(loc);
|
||||||
|
item.setPassenger(player);
|
||||||
|
_item = item;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes armor stand after player leaves it
|
||||||
|
* @param event
|
||||||
|
*/
|
||||||
|
@EventHandler
|
||||||
|
public void onLeaveThrone(EntityDismountEvent event)
|
||||||
|
{
|
||||||
|
if (!isHub())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!(event.getEntity() instanceof Item))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (_item == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!event.getEntity().equals(_item))
|
||||||
|
return;
|
||||||
|
|
||||||
|
_item.remove();
|
||||||
|
_item = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets player as peasant
|
||||||
|
* @param event
|
||||||
|
*/
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerJoin(PlayerJoinEvent event)
|
||||||
|
{
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
setPlayerAsPeasant(player);
|
||||||
|
updateLobbyKing();
|
||||||
|
updateHologram();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes peasant from king if they leave
|
||||||
|
* @param event
|
||||||
|
*/
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerLeave(PlayerQuitEvent event)
|
||||||
|
{
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
if (isPeasant(player))
|
||||||
|
{
|
||||||
|
Peasant peasant = getPeasant(player);
|
||||||
|
if (peasant.getKing() != null)
|
||||||
|
{
|
||||||
|
peasant.getKing().removePeasant(peasant);
|
||||||
|
}
|
||||||
|
removePeasant(player);
|
||||||
|
}
|
||||||
|
else if (isKing(player))
|
||||||
|
{
|
||||||
|
removeKing(player);
|
||||||
|
}
|
||||||
|
updateLobbyKing();
|
||||||
|
updateHologram();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Spawns the hologram above the castle
|
||||||
|
*/
|
||||||
|
private void spawnHologram()
|
||||||
|
{
|
||||||
|
if (!isHub())
|
||||||
|
return;
|
||||||
|
|
||||||
|
_hologram = new Hologram(_hologramManager, _hologramLocation, "Mineplex Castle", "Current King: " + F.name("No one") + "!");
|
||||||
|
_hologram.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the hologram above the castle
|
||||||
|
*/
|
||||||
|
private void updateHologram()
|
||||||
|
{
|
||||||
|
if (!isHub())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (_hologram != null)
|
||||||
|
{
|
||||||
|
_hologram.stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_king != null && _king.getKing().isOnline())
|
||||||
|
{
|
||||||
|
_hologram = new Hologram(_hologramManager, _hologramLocation, "Mineplex Castle", "Current King: " + F.name(_king.getKing().getName()) + " (" + F.count(_king.amountOfPeasants()) + ")!");
|
||||||
|
_hologram.start();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_hologram = new Hologram(_hologramManager, _hologramLocation, "Mineplex Castle", "Current King: " + F.name("No one") + "!");
|
||||||
|
_hologram.start();
|
||||||
|
}
|
||||||
|
updateWool();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the hub king
|
||||||
|
* @param oldKing The old king
|
||||||
|
* @param newKing The new king
|
||||||
|
*/
|
||||||
|
private void updateKing(King oldKing, King newKing)
|
||||||
|
{
|
||||||
|
setKing(newKing);
|
||||||
|
|
||||||
|
if (!isHub())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (oldKing != null && oldKing.getKing().isOnline())
|
||||||
|
{
|
||||||
|
// Removes old king from the throne
|
||||||
|
if (isInsideCastle(oldKing.getKing().getLocation()))
|
||||||
|
{
|
||||||
|
oldKing.getKing().teleport(new Location(UtilWorld.getWorld("world"), 0, 78, -31));
|
||||||
|
UtilPlayer.message(oldKing.getKing(), F.main("Kingdom", "You are no longer the king of that castle!"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (newKing != null && newKing.getKing().isOnline())
|
||||||
|
Bukkit.broadcastMessage(F.main("Kingdom", "" + F.name(newKing.getKing().getName()) + " is the new King of this lobby!"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the player as king
|
||||||
|
* @param player The player
|
||||||
|
*/
|
||||||
|
public void setPlayerAsKing(Player player)
|
||||||
|
{
|
||||||
|
if (isKing(player))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (isPeasant(player))
|
||||||
|
removePeasant(player);
|
||||||
|
|
||||||
|
_kings.put(player, new King(player));
|
||||||
|
|
||||||
|
updateLobbyKing();
|
||||||
|
updateHologram();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the player is a king
|
||||||
|
* @param player The player
|
||||||
|
* @return true if player is king
|
||||||
|
*/
|
||||||
|
private boolean isKing(Player player)
|
||||||
|
{
|
||||||
|
return _kings.containsKey(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes the player from the king map
|
||||||
|
* @param player The player
|
||||||
|
*/
|
||||||
|
private void removeKing(Player player)
|
||||||
|
{
|
||||||
|
if (!isKing(player))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (getKing().equals(getKing(player)))
|
||||||
|
_king = null;
|
||||||
|
|
||||||
|
_kings.get(player).clearPeasants();
|
||||||
|
_kings.remove(player);
|
||||||
|
|
||||||
|
if (_item != null)
|
||||||
|
{
|
||||||
|
if (_item.getPassenger() != null)
|
||||||
|
{
|
||||||
|
if (_item.getPassenger().equals(player))
|
||||||
|
{
|
||||||
|
player.leaveVehicle();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
updateLobbyKing();
|
||||||
|
updateHologram();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the king object for the player
|
||||||
|
* @param player The player
|
||||||
|
* @return The king object
|
||||||
|
*/
|
||||||
|
private King getKing(Player player)
|
||||||
|
{
|
||||||
|
if (!isKing(player))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return _kings.get(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the player as a peasant
|
||||||
|
* @param player The player
|
||||||
|
*/
|
||||||
|
public void setPlayerAsPeasant(Player player)
|
||||||
|
{
|
||||||
|
if (isPeasant(player))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (isKing(player))
|
||||||
|
removeKing(player);
|
||||||
|
|
||||||
|
_peasants.put(player, new Peasant(player));
|
||||||
|
updateLobbyKing();
|
||||||
|
updateHologram();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the player is a peasant
|
||||||
|
* @param player The player
|
||||||
|
* @return true if player is peasant
|
||||||
|
*/
|
||||||
|
private boolean isPeasant(Player player)
|
||||||
|
{
|
||||||
|
return _peasants.containsKey(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes the player from the peasant map
|
||||||
|
* @param player The player
|
||||||
|
*/
|
||||||
|
private void removePeasant(Player player)
|
||||||
|
{
|
||||||
|
if (!isPeasant(player))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (getPeasant(player) != null)
|
||||||
|
{
|
||||||
|
Peasant peasant = getPeasant(player);
|
||||||
|
if (peasant.getKing() != null)
|
||||||
|
{
|
||||||
|
peasant.getKing().removePeasant(peasant);
|
||||||
|
peasant.removeKing();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_peasants.remove(player);
|
||||||
|
|
||||||
|
updateLobbyKing();
|
||||||
|
updateHologram();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the peasant object for the player
|
||||||
|
* @param player The player
|
||||||
|
* @return The peasant object
|
||||||
|
*/
|
||||||
|
private Peasant getPeasant(Player player)
|
||||||
|
{
|
||||||
|
if (!isPeasant(player))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return _peasants.get(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the lobby should update the king (If a king has more peasants than the current king)
|
||||||
|
*/
|
||||||
|
public void updateLobbyKing()
|
||||||
|
{
|
||||||
|
if (_kings.size() == 0)
|
||||||
|
{
|
||||||
|
removeKing();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
King lobbyKing = null;
|
||||||
|
for (King king : _kings.values())
|
||||||
|
{
|
||||||
|
if (lobbyKing == null)
|
||||||
|
lobbyKing = king;
|
||||||
|
else if (lobbyKing.amountOfPeasants() < king.amountOfPeasants())
|
||||||
|
lobbyKing = king;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_king != null && lobbyKing != null)
|
||||||
|
{
|
||||||
|
if (_king.amountOfPeasants() == lobbyKing.amountOfPeasants())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!_king.equals(lobbyKing))
|
||||||
|
{
|
||||||
|
updateKing(_king, lobbyKing);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (lobbyKing != null)
|
||||||
|
{
|
||||||
|
setKing(lobbyKing);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes the lobby king
|
||||||
|
*/
|
||||||
|
private void removeKing()
|
||||||
|
{
|
||||||
|
_king = null;
|
||||||
|
updateHologram();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the position of a kingdom
|
||||||
|
* @param king The king
|
||||||
|
* @return The position of that kingdom
|
||||||
|
*/
|
||||||
|
private int getKingPosition(King king)
|
||||||
|
{
|
||||||
|
if (_king != null)
|
||||||
|
if (_king.equals(king))
|
||||||
|
return 1;
|
||||||
|
int position = 1;
|
||||||
|
for (King otherKing : _kings.values())
|
||||||
|
{
|
||||||
|
if (otherKing.equals(king))
|
||||||
|
continue;
|
||||||
|
if (otherKing.amountOfPeasants() >= king.amountOfPeasants())
|
||||||
|
position++;
|
||||||
|
}
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the wools above the castle
|
||||||
|
*/
|
||||||
|
private void updateWool()
|
||||||
|
{
|
||||||
|
Material material = Material.AIR;
|
||||||
|
byte data = (byte) 0;
|
||||||
|
if (_king != null)
|
||||||
|
{
|
||||||
|
King king = getKing();
|
||||||
|
Rank rank = _coreClientManager.Get(king.getKing()).getRealOrDisguisedRank();
|
||||||
|
material = Material.WOOL;
|
||||||
|
data = rank.getDyeColor().getWoolData();
|
||||||
|
}
|
||||||
|
for (Location location : _woolLocations)
|
||||||
|
{
|
||||||
|
location.getBlock().setType(material);
|
||||||
|
location.getBlock().setData(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if location is inside the castle
|
||||||
|
* @param location
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean isInsideCastle(Location location)
|
||||||
|
{
|
||||||
|
if (!isHub())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!location.getWorld().equals(_castleLocationA.getWorld()))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return UtilAlg.inBoundingBox(location, _castleLocationA, _castleLocationB);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cancels item despawn
|
||||||
|
* @param event
|
||||||
|
*/
|
||||||
|
@EventHandler
|
||||||
|
public void onItemDespawn(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (!isHub())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (_item == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!_item.isValid())
|
||||||
|
{
|
||||||
|
Location loc = _throneLocations[0].clone().add(0.5, 1, 0.5);
|
||||||
|
loc.setYaw(90);
|
||||||
|
loc.setPitch(0);
|
||||||
|
Item item = loc.getWorld().dropItem(loc, new ItemStack(Material.WOOL, 1, (byte) 14));
|
||||||
|
item.setPickupDelay(Integer.MAX_VALUE);
|
||||||
|
item.setVelocity(new Vector(0, 0, 0));
|
||||||
|
item.teleport(loc);
|
||||||
|
item.setPassenger(_king.getKing());
|
||||||
|
_item = item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onMount(MountActivateEvent event)
|
||||||
|
{
|
||||||
|
if (!isHub())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (isInsideCastle(event.getPlayer().getLocation()))
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,91 @@
|
|||||||
|
package mineplex.core.gadget.gadgets.particle.king;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.time.Month;
|
||||||
|
import java.time.YearMonth;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import mineplex.core.common.shape.ShapeWings;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.LineFormat;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilText;
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.types.ParticleGadget;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
|
||||||
|
public class ParticleKing extends ParticleGadget
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final int CROWN_POINTS = 12;
|
||||||
|
|
||||||
|
private ShapeWings _capeRed = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(0.2,0.2,0.2), 1, 0, false, ShapeWings.NO_ROTATION, ShapeWings.KINGS_CAPE);
|
||||||
|
private ShapeWings _capeWhite = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(0.1,0.1,0.1), 1, 0, true, ShapeWings.NO_ROTATION, ShapeWings.KINGS_CAPE);
|
||||||
|
|
||||||
|
private CastleManager _castleManager;
|
||||||
|
|
||||||
|
public ParticleKing(GadgetManager manager, CastleManager castleManager)
|
||||||
|
{
|
||||||
|
super(manager, "King", UtilText.splitLinesToArray(new String[]
|
||||||
|
{
|
||||||
|
C.cGray + "Hail to the King!",
|
||||||
|
C.cBlack + "",
|
||||||
|
C.cWhite + "Right Click players in the Lobby to claim them for your Kingdom.",
|
||||||
|
C.cWhite + "The King with the biggest Kingdom will own the Castle in our Lobby."
|
||||||
|
}, LineFormat.LORE),
|
||||||
|
-14,
|
||||||
|
Material.GOLD_HELMET, (byte) 0, YearMonth.of(2017, Month.MAY));
|
||||||
|
_castleManager = castleManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void playParticle(Player player, UpdateEvent event)
|
||||||
|
{
|
||||||
|
Location loc = player.getLocation().add(0, 0.8, 0).add(player.getLocation().getDirection().multiply(-0.3));
|
||||||
|
if (Manager.isMoving(player))
|
||||||
|
{
|
||||||
|
if (event.getType() == UpdateType.TICK)
|
||||||
|
{
|
||||||
|
_capeRed.displayColoredParticle(loc, Color.RED);
|
||||||
|
_capeWhite.displayColoredParticle(loc, Color.WHITE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (event.getType() == UpdateType.FAST)
|
||||||
|
{
|
||||||
|
_capeRed.displayColored(loc, Color.RED);
|
||||||
|
_capeWhite.displayColored(loc, Color.WHITE);
|
||||||
|
}
|
||||||
|
if (event.getType() == UpdateType.FAST)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 360; i += 360 / CROWN_POINTS)
|
||||||
|
{
|
||||||
|
double angle = (i * Math.PI / 180);
|
||||||
|
double x = 0.5 * Math.cos(angle);
|
||||||
|
double z = 0.5 * Math.sin(angle);
|
||||||
|
Location crown = player.getEyeLocation().add(x, 0.3, z);
|
||||||
|
UtilParticle.PlayParticleToAll(UtilParticle.ParticleType.FLAME, crown, null, 0, 1, UtilParticle.ViewDist.NORMAL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void enableCustom(Player player, boolean message)
|
||||||
|
{
|
||||||
|
super.enableCustom(player, message);
|
||||||
|
_castleManager.setPlayerAsKing(player);
|
||||||
|
_castleManager.updateLobbyKing();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void disableCustom(Player player, boolean message)
|
||||||
|
{
|
||||||
|
super.disableCustom(player, message);
|
||||||
|
_castleManager.setPlayerAsPeasant(player);
|
||||||
|
_castleManager.updateLobbyKing();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
package mineplex.core.gadget.gadgets.particle.king.events;
|
||||||
|
|
||||||
|
import org.bukkit.event.Event;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
|
import mineplex.core.gadget.gadgets.particle.king.types.King;
|
||||||
|
|
||||||
|
public class UpdateKingEvent extends Event
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final HandlerList handlers = new HandlerList();
|
||||||
|
|
||||||
|
private King _newKing;
|
||||||
|
private King _oldKing;
|
||||||
|
|
||||||
|
public UpdateKingEvent(King newKing, King oldKing)
|
||||||
|
{
|
||||||
|
_newKing = newKing;
|
||||||
|
_oldKing = oldKing;
|
||||||
|
}
|
||||||
|
|
||||||
|
public King getNewKing()
|
||||||
|
{
|
||||||
|
return _newKing;
|
||||||
|
}
|
||||||
|
|
||||||
|
public King getOldKing()
|
||||||
|
{
|
||||||
|
return _oldKing;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HandlerList getHandlers()
|
||||||
|
{
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HandlerList getHandlerList()
|
||||||
|
{
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
package mineplex.core.gadget.gadgets.particle.king.types;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class King
|
||||||
|
{
|
||||||
|
|
||||||
|
private Player _king;
|
||||||
|
private List<Peasant> _peasants = new ArrayList<>();
|
||||||
|
|
||||||
|
public King(Player king)
|
||||||
|
{
|
||||||
|
_king = king;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Player getKing()
|
||||||
|
{
|
||||||
|
return _king;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int amountOfPeasants()
|
||||||
|
{
|
||||||
|
return _peasants.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addPeasant(Peasant peasant)
|
||||||
|
{
|
||||||
|
_peasants.add(peasant);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removePeasant(Peasant peasant)
|
||||||
|
{
|
||||||
|
_peasants.remove(peasant);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasPeasant(Peasant peasant)
|
||||||
|
{
|
||||||
|
return _peasants.contains(peasant);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearPeasants()
|
||||||
|
{
|
||||||
|
_peasants.forEach(Peasant::removeKing);
|
||||||
|
_peasants.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,51 @@
|
|||||||
|
package mineplex.core.gadget.gadgets.particle.king.types;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilTime;
|
||||||
|
|
||||||
|
public class Peasant
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final long PLAYER_COOLDOWN = 15000;
|
||||||
|
|
||||||
|
private Player _player;
|
||||||
|
private long _cooldown = 0;
|
||||||
|
private King _king;
|
||||||
|
|
||||||
|
public Peasant(Player player)
|
||||||
|
{
|
||||||
|
_player = player;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Player getPeasant()
|
||||||
|
{
|
||||||
|
return _player;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isInCooldown()
|
||||||
|
{
|
||||||
|
return !UtilTime.elapsed(_cooldown, PLAYER_COOLDOWN);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCooldown()
|
||||||
|
{
|
||||||
|
_cooldown = System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
public King getKing()
|
||||||
|
{
|
||||||
|
return _king;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKing(King king)
|
||||||
|
{
|
||||||
|
_king = king;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeKing()
|
||||||
|
{
|
||||||
|
_king = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -57,6 +57,13 @@ public class MusicGadget extends Gadget
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Inside castle
|
||||||
|
if (Manager.getCastleManager().isInsideCastle(player.getLocation()))
|
||||||
|
{
|
||||||
|
UtilPlayer.message(player, F.main("Music", "Cannot play songs inside the Castle."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//Near Portal
|
//Near Portal
|
||||||
for (Block block : UtilBlock.getInRadius(player.getLocation(), 3).keySet())
|
for (Block block : UtilBlock.getInRadius(player.getLocation(), 3).keySet())
|
||||||
{
|
{
|
||||||
|
@ -25,9 +25,10 @@ public class CircleEffect extends Effect
|
|||||||
private int _maxCircles = -1;
|
private int _maxCircles = -1;
|
||||||
private int _totalCircles = 0;
|
private int _totalCircles = 0;
|
||||||
private double _yOffset = 0.0;
|
private double _yOffset = 0.0;
|
||||||
|
private int _particles = 20;
|
||||||
|
private boolean _infinite = false;
|
||||||
|
|
||||||
private static final double RANDOM_COLOR_CHANCE = 0.5;
|
private static final double RANDOM_COLOR_CHANCE = 0.5;
|
||||||
private static final int PARTICLES_PER_CIRCLE = 20;
|
|
||||||
|
|
||||||
public CircleEffect(JavaPlugin plugin, Location location, double radius, Color color)
|
public CircleEffect(JavaPlugin plugin, Location location, double radius, Color color)
|
||||||
{
|
{
|
||||||
@ -50,6 +51,18 @@ public class CircleEffect extends Effect
|
|||||||
_instantly = instantly;
|
_instantly = instantly;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CircleEffect(JavaPlugin plugin, Location location, double radius, Color color, boolean instantly, int particles)
|
||||||
|
{
|
||||||
|
this(plugin, location, radius, color, instantly);
|
||||||
|
_particles = particles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CircleEffect(JavaPlugin plugin, Entity entity, double radius, Color color, boolean instantly, int particles)
|
||||||
|
{
|
||||||
|
this(plugin, entity, radius, color, instantly);
|
||||||
|
_particles = particles;
|
||||||
|
}
|
||||||
|
|
||||||
public void addRandomColor(Color color)
|
public void addRandomColor(Color color)
|
||||||
{
|
{
|
||||||
_randomColors.add(color);
|
_randomColors.add(color);
|
||||||
@ -65,15 +78,20 @@ public class CircleEffect extends Effect
|
|||||||
_yOffset = yOffset;
|
_yOffset = yOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setInfinite(boolean infinite)
|
||||||
|
{
|
||||||
|
_infinite = infinite;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void runEffect()
|
public void runEffect()
|
||||||
{
|
{
|
||||||
if (_instantly)
|
if (_instantly)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < PARTICLES_PER_CIRCLE; i++)
|
for (int i = 0; i < _particles; i++)
|
||||||
{
|
{
|
||||||
Location location = getEffectLocation().getLocation().add(0, _yOffset, 0);
|
Location location = getEffectLocation().getLocation().add(0, _yOffset, 0);
|
||||||
double increment = (2 * Math.PI) / PARTICLES_PER_CIRCLE;
|
double increment = (2 * Math.PI) / _particles;
|
||||||
double angle = _steps * increment;
|
double angle = _steps * increment;
|
||||||
Vector vector = new Vector(Math.cos(angle) * _radius, 0, Math.sin(angle) * _radius);
|
Vector vector = new Vector(Math.cos(angle) * _radius, 0, Math.sin(angle) * _radius);
|
||||||
ColoredParticle coloredParticle = new ColoredParticle(UtilParticle.ParticleType.RED_DUST, new DustSpellColor(_color), location.add(vector));
|
ColoredParticle coloredParticle = new ColoredParticle(UtilParticle.ParticleType.RED_DUST, new DustSpellColor(_color), location.add(vector));
|
||||||
@ -89,6 +107,7 @@ public class CircleEffect extends Effect
|
|||||||
}
|
}
|
||||||
_steps++;
|
_steps++;
|
||||||
}
|
}
|
||||||
|
if (!_infinite)
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -102,7 +121,7 @@ public class CircleEffect extends Effect
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Location location = getEffectLocation().getLocation().add(0, _yOffset, 0);
|
Location location = getEffectLocation().getLocation().add(0, _yOffset, 0);
|
||||||
double increment = (2 * Math.PI) / PARTICLES_PER_CIRCLE;
|
double increment = (2 * Math.PI) / _particles;
|
||||||
double angle = _steps * increment;
|
double angle = _steps * increment;
|
||||||
Vector vector = new Vector(Math.cos(angle) * _radius, 0, Math.sin(angle) * _radius);
|
Vector vector = new Vector(Math.cos(angle) * _radius, 0, Math.sin(angle) * _radius);
|
||||||
ColoredParticle coloredParticle = new ColoredParticle(UtilParticle.ParticleType.RED_DUST, new DustSpellColor(_color), location.add(vector));
|
ColoredParticle coloredParticle = new ColoredParticle(UtilParticle.ParticleType.RED_DUST, new DustSpellColor(_color), location.add(vector));
|
||||||
@ -117,7 +136,7 @@ public class CircleEffect extends Effect
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
_steps++;
|
_steps++;
|
||||||
if (_steps >= PARTICLES_PER_CIRCLE)
|
if (_steps >= _particles)
|
||||||
{
|
{
|
||||||
_totalCircles++;
|
_totalCircles++;
|
||||||
_steps = 0;
|
_steps = 0;
|
||||||
|
@ -3,16 +3,20 @@ package mineplex.core.personalServer;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import mineplex.core.command.CommandBase;
|
import mineplex.core.command.CommandBase;
|
||||||
|
import mineplex.core.command.LoggedCommand;
|
||||||
import mineplex.core.common.Rank;
|
import mineplex.core.common.Rank;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.recharge.Recharge;
|
import mineplex.core.recharge.Recharge;
|
||||||
|
|
||||||
public class HostEventServerCommand extends CommandBase<PersonalServerManager>
|
public class HostEventServerCommand extends CommandBase<PersonalServerManager> implements LoggedCommand
|
||||||
{
|
{
|
||||||
public HostEventServerCommand(PersonalServerManager plugin)
|
public HostEventServerCommand(PersonalServerManager plugin)
|
||||||
{
|
{
|
||||||
super(plugin, Rank.ADMIN, "hostevent");
|
super(plugin, Rank.ADMIN, new Rank[]
|
||||||
|
{
|
||||||
|
Rank.EVENT_MODERATOR
|
||||||
|
}, "hostevent");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -0,0 +1,35 @@
|
|||||||
|
package mineplex.core.personalServer;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import mineplex.core.command.CommandBase;
|
||||||
|
import mineplex.core.command.LoggedCommand;
|
||||||
|
import mineplex.core.common.Rank;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.recharge.Recharge;
|
||||||
|
|
||||||
|
public class HostPersonalEventServer extends CommandBase<PersonalServerManager> implements LoggedCommand
|
||||||
|
{
|
||||||
|
public HostPersonalEventServer(PersonalServerManager plugin)
|
||||||
|
{
|
||||||
|
super(plugin, Rank.ADMIN, new Rank[]
|
||||||
|
{
|
||||||
|
Rank.EVENT_MODERATOR
|
||||||
|
}, "hostmes");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void Execute(Player caller, String[] args)
|
||||||
|
{
|
||||||
|
if (!Recharge.Instance.use(caller, "Host Event", 30000, false, false))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(Plugin.getClients().Get(caller).isDisguised())
|
||||||
|
{
|
||||||
|
UtilPlayer.message(caller, F.main("Disguise", "You can't create a event server while you are disguised!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Plugin.hostServer(caller, caller.getName(), false, true);
|
||||||
|
}
|
||||||
|
}
|
@ -106,6 +106,7 @@ public class PersonalServerManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
addCommand(new HostServerCommand(this));
|
addCommand(new HostServerCommand(this));
|
||||||
addCommand(new HostEventServerCommand(this));
|
addCommand(new HostEventServerCommand(this));
|
||||||
|
addCommand(new HostPersonalEventServer(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupConfigValues()
|
private void setupConfigValues()
|
||||||
@ -124,6 +125,11 @@ public class PersonalServerManager extends MiniPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void hostServer(Player player, String serverName, boolean eventServer)
|
public void hostServer(Player player, String serverName, boolean eventServer)
|
||||||
|
{
|
||||||
|
hostServer(player, serverName, eventServer, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void hostServer(Player player, String serverName, boolean eventServer, boolean eventgame)
|
||||||
{
|
{
|
||||||
int ram = 1024;
|
int ram = 1024;
|
||||||
int cpu = 1;
|
int cpu = 1;
|
||||||
@ -143,8 +149,17 @@ public class PersonalServerManager extends MiniPlugin
|
|||||||
createGroup(player, "EVENT", ram, cpu, 40, 80, "Event", eventServer);
|
createGroup(player, "EVENT", ram, cpu, 40, 80, "Event", eventServer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (eventgame)
|
||||||
|
{
|
||||||
|
createGroup(player, serverName, ram, cpu, 40, 80, "Event", eventServer);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
createGroup(player, serverName, ram, cpu, 40, 80, "Smash", eventServer);
|
createGroup(player, serverName, ram, cpu, 40, 80, "Smash", eventServer);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void hostCommunityServer(Player host, Community community)
|
public void hostCommunityServer(Player host, Community community)
|
||||||
{
|
{
|
||||||
|
@ -70,6 +70,7 @@ import mineplex.core.disguise.disguises.DisguiseVillager;
|
|||||||
import mineplex.core.disguise.disguises.DisguiseWither;
|
import mineplex.core.disguise.disguises.DisguiseWither;
|
||||||
import mineplex.core.disguise.disguises.DisguiseZombie;
|
import mineplex.core.disguise.disguises.DisguiseZombie;
|
||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.king.CastleManager;
|
||||||
import mineplex.core.inventory.InventoryManager;
|
import mineplex.core.inventory.InventoryManager;
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
import mineplex.core.pet.repository.PetRepository;
|
import mineplex.core.pet.repository.PetRepository;
|
||||||
@ -96,6 +97,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
private DonationManager _donationManager;
|
private DonationManager _donationManager;
|
||||||
private CoreClientManager _clientManager;
|
private CoreClientManager _clientManager;
|
||||||
private InventoryManager _inventoryManager;
|
private InventoryManager _inventoryManager;
|
||||||
|
private CastleManager _castleManager;
|
||||||
|
|
||||||
private Map<Entity, FlyingPetManager> _flyingPets = new HashMap<>();
|
private Map<Entity, FlyingPetManager> _flyingPets = new HashMap<>();
|
||||||
private Map<Entity, TrueLoveData> _trueLovePets = new HashMap<>();
|
private Map<Entity, TrueLoveData> _trueLovePets = new HashMap<>();
|
||||||
@ -108,7 +110,8 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
private ShapeWings _cupidWingsEdge = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(0, 0, 0), 1, 0, true, ShapeWings.DEFAULT_ROTATION, ShapeWings.SMALL_HEART_WING_PATTERN);
|
private ShapeWings _cupidWingsEdge = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(0, 0, 0), 1, 0, true, ShapeWings.DEFAULT_ROTATION, ShapeWings.SMALL_HEART_WING_PATTERN);
|
||||||
|
|
||||||
public PetManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager
|
public PetManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager
|
||||||
, InventoryManager inventoryManager, DisguiseManager disguiseManager, mineplex.core.creature.Creature creatureModule, BlockRestore restore)
|
, InventoryManager inventoryManager, DisguiseManager disguiseManager, mineplex.core.creature.Creature creatureModule, BlockRestore restore,
|
||||||
|
CastleManager castleManager)
|
||||||
{
|
{
|
||||||
super("Pet Manager", plugin);
|
super("Pet Manager", plugin);
|
||||||
|
|
||||||
@ -213,6 +216,12 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_castleManager.isInsideCastle(location))
|
||||||
|
{
|
||||||
|
UtilPlayer.message(player, F.main("Pets", "You cannot spawn a pet inside the castle!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Entity pet;
|
Entity pet;
|
||||||
EntityType entityType = petType.getEntityType();
|
EntityType entityType = petType.getEntityType();
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ public class PowerPlayClubRewards
|
|||||||
.put(YearMonth.of(2017, Month.FEBRUARY), new PetItem(PetType.TRUE_LOVE_PET))
|
.put(YearMonth.of(2017, Month.FEBRUARY), new PetItem(PetType.TRUE_LOVE_PET))
|
||||||
.put(YearMonth.of(2017, Month.MARCH), new UnknownSalesPackageItem("Gold Pot Morph"))
|
.put(YearMonth.of(2017, Month.MARCH), new UnknownSalesPackageItem("Gold Pot Morph"))
|
||||||
.put(YearMonth.of(2017, Month.APRIL), new UnknownSalesPackageItem("Bumblebee's Wings"))
|
.put(YearMonth.of(2017, Month.APRIL), new UnknownSalesPackageItem("Bumblebee's Wings"))
|
||||||
|
.put(YearMonth.of(2017, Month.MAY), new UnknownSalesPackageItem("King"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
public interface PowerPlayClubItem
|
public interface PowerPlayClubItem
|
||||||
|
@ -47,6 +47,8 @@ public class PreferenceMenu extends Menu<PreferencesManager>
|
|||||||
if (rank.has(Rank.HELPER) && !rank.has(Rank.ADMIN))
|
if (rank.has(Rank.HELPER) && !rank.has(Rank.ADMIN))
|
||||||
{
|
{
|
||||||
preferences.remove(Preference.INVISIBILITY);
|
preferences.remove(Preference.INVISIBILITY);
|
||||||
|
|
||||||
|
if (rank != Rank.EVENT_MODERATOR)
|
||||||
preferences.remove(Preference.FORCE_FIELD);
|
preferences.remove(Preference.FORCE_FIELD);
|
||||||
}
|
}
|
||||||
else if (rank == Rank.YOUTUBE || rank == Rank.TWITCH)
|
else if (rank == Rank.YOUTUBE || rank == Rank.TWITCH)
|
||||||
|
@ -23,6 +23,7 @@ import mineplex.core.disguise.DisguiseManager;
|
|||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
import mineplex.core.elo.EloManager;
|
import mineplex.core.elo.EloManager;
|
||||||
import mineplex.core.friend.FriendManager;
|
import mineplex.core.friend.FriendManager;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.king.CastleManager;
|
||||||
import mineplex.core.give.Give;
|
import mineplex.core.give.Give;
|
||||||
import mineplex.core.globalpacket.GlobalPacketManager;
|
import mineplex.core.globalpacket.GlobalPacketManager;
|
||||||
import mineplex.core.hologram.HologramManager;
|
import mineplex.core.hologram.HologramManager;
|
||||||
@ -120,7 +121,9 @@ public class ClansHub extends JavaPlugin
|
|||||||
Creature creature = new Creature(this);
|
Creature creature = new Creature(this);
|
||||||
NpcManager npcManager = new NpcManager(this, creature);
|
NpcManager npcManager = new NpcManager(this, creature);
|
||||||
InventoryManager inventoryManager = new InventoryManager(this, clientManager);
|
InventoryManager inventoryManager = new InventoryManager(this, clientManager);
|
||||||
PetManager petManager = new PetManager(this, clientManager, donationManager, inventoryManager, disguiseManager, creature, blockRestore);
|
HologramManager hologramManager = new HologramManager(this, packetHandler);
|
||||||
|
CastleManager castleManager = new CastleManager(this, clientManager, hologramManager, false);
|
||||||
|
PetManager petManager = new PetManager(this, clientManager, donationManager, inventoryManager, disguiseManager, creature, blockRestore, castleManager);
|
||||||
PollManager pollManager = new PollManager(this, clientManager, donationManager);
|
PollManager pollManager = new PollManager(this, clientManager, donationManager);
|
||||||
|
|
||||||
//Main Modules
|
//Main Modules
|
||||||
@ -153,8 +156,6 @@ public class ClansHub extends JavaPlugin
|
|||||||
BoosterManager boosterManager = new BoosterManager(this, "", clientManager, donationManager, inventoryManager, thankManager);
|
BoosterManager boosterManager = new BoosterManager(this, "", clientManager, donationManager, inventoryManager, thankManager);
|
||||||
HubManager hubManager = new HubManager(this, blockRestore, clientManager, incognito, donationManager, inventoryManager, condition, disguiseManager, new TaskManager(this, clientManager), portal, partyManager, preferenceManager, petManager, pollManager, statsManager, achievementManager, new HologramManager(this, packetHandler), npcManager, packetHandler, punish, serverStatusManager, customDataManager, thankManager, boosterManager);
|
HubManager hubManager = new HubManager(this, blockRestore, clientManager, incognito, donationManager, inventoryManager, condition, disguiseManager, new TaskManager(this, clientManager), portal, partyManager, preferenceManager, petManager, pollManager, statsManager, achievementManager, new HologramManager(this, packetHandler), npcManager, packetHandler, punish, serverStatusManager, customDataManager, thankManager, boosterManager);
|
||||||
|
|
||||||
HologramManager hologramManager = new HologramManager(this, packetHandler);
|
|
||||||
|
|
||||||
ClansTransferManager serverManager = new ClansTransferManager(this, clientManager, donationManager, partyManager, portal, hubManager);
|
ClansTransferManager serverManager = new ClansTransferManager(this, clientManager, donationManager, partyManager, portal, hubManager);
|
||||||
|
|
||||||
Chat chat = new Chat(this, incognito, clientManager, preferenceManager, achievementManager, serverStatusManager.getCurrentServerName());
|
Chat chat = new Chat(this, incognito, clientManager, preferenceManager, achievementManager, serverStatusManager.getCurrentServerName());
|
||||||
|
@ -84,6 +84,7 @@ import mineplex.core.facebook.FacebookManager;
|
|||||||
import mineplex.core.gadget.GadgetManager;
|
import mineplex.core.gadget.GadgetManager;
|
||||||
import mineplex.core.gadget.event.GadgetCollideEntityEvent;
|
import mineplex.core.gadget.event.GadgetCollideEntityEvent;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphWither;
|
import mineplex.core.gadget.gadgets.morph.MorphWither;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.king.CastleManager;
|
||||||
import mineplex.core.gadget.types.Gadget;
|
import mineplex.core.gadget.types.Gadget;
|
||||||
import mineplex.core.gadget.types.GadgetType;
|
import mineplex.core.gadget.types.GadgetType;
|
||||||
import mineplex.core.hologram.HologramManager;
|
import mineplex.core.hologram.HologramManager;
|
||||||
@ -194,7 +195,8 @@ public class HubManager extends MiniPlugin implements IChatMessageFormatter
|
|||||||
_inventoryManager = inventoryManager;
|
_inventoryManager = inventoryManager;
|
||||||
new BenefitManager(plugin, clientManager, _inventoryManager);
|
new BenefitManager(plugin, clientManager, _inventoryManager);
|
||||||
|
|
||||||
_gadgetManager = new GadgetManager(_plugin, clientManager, donationManager, _inventoryManager, _mountManager, petManager, preferences, disguiseManager, blockRestore, new ProjectileManager(plugin), achievementManager, packetHandler, hologramManager, incognito);
|
CastleManager castleManager = new CastleManager(_plugin, _clientManager, hologramManager, false);
|
||||||
|
_gadgetManager = new GadgetManager(_plugin, clientManager, donationManager, _inventoryManager, _mountManager, petManager, preferences, disguiseManager, blockRestore, new ProjectileManager(plugin), achievementManager, packetHandler, hologramManager, incognito, castleManager);
|
||||||
|
|
||||||
FacebookManager facebookManager = new FacebookManager(plugin, clientManager, donationManager, inventoryManager);
|
FacebookManager facebookManager = new FacebookManager(plugin, clientManager, donationManager, inventoryManager);
|
||||||
YoutubeManager youtubeManager = new YoutubeManager(plugin, clientManager, donationManager);
|
YoutubeManager youtubeManager = new YoutubeManager(plugin, clientManager, donationManager);
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
package mineplex.hub;
|
package mineplex.hub;
|
||||||
|
|
||||||
import static mineplex.core.Managers.require;
|
|
||||||
|
|
||||||
import mineplex.hub.modules.AprilFoolsTreasureHunt;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -34,6 +31,7 @@ import mineplex.core.donation.DonationManager;
|
|||||||
import mineplex.core.elo.EloManager;
|
import mineplex.core.elo.EloManager;
|
||||||
import mineplex.core.energy.Energy;
|
import mineplex.core.energy.Energy;
|
||||||
import mineplex.core.friend.FriendManager;
|
import mineplex.core.friend.FriendManager;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.king.CastleManager;
|
||||||
import mineplex.core.give.Give;
|
import mineplex.core.give.Give;
|
||||||
import mineplex.core.globalpacket.GlobalPacketManager;
|
import mineplex.core.globalpacket.GlobalPacketManager;
|
||||||
import mineplex.core.hologram.HologramManager;
|
import mineplex.core.hologram.HologramManager;
|
||||||
@ -79,6 +77,7 @@ import mineplex.core.updater.Updater;
|
|||||||
import mineplex.core.velocity.VelocityFix;
|
import mineplex.core.velocity.VelocityFix;
|
||||||
import mineplex.core.visibility.VisibilityManager;
|
import mineplex.core.visibility.VisibilityManager;
|
||||||
import mineplex.core.website.WebsiteLinkManager;
|
import mineplex.core.website.WebsiteLinkManager;
|
||||||
|
import mineplex.hub.modules.AprilFoolsTreasureHunt;
|
||||||
import mineplex.hub.modules.BillboardManager;
|
import mineplex.hub.modules.BillboardManager;
|
||||||
import mineplex.hub.queue.QueueManager;
|
import mineplex.hub.queue.QueueManager;
|
||||||
import mineplex.hub.server.ServerManager;
|
import mineplex.hub.server.ServerManager;
|
||||||
@ -93,6 +92,8 @@ import mineplex.minecraft.game.core.combat.CombatManager;
|
|||||||
import mineplex.minecraft.game.core.damage.DamageManager;
|
import mineplex.minecraft.game.core.damage.DamageManager;
|
||||||
import mineplex.minecraft.game.core.fire.Fire;
|
import mineplex.minecraft.game.core.fire.Fire;
|
||||||
|
|
||||||
|
import static mineplex.core.Managers.require;
|
||||||
|
|
||||||
public class Hub extends JavaPlugin implements IRelation
|
public class Hub extends JavaPlugin implements IRelation
|
||||||
{
|
{
|
||||||
private NpcManager _npcManager;
|
private NpcManager _npcManager;
|
||||||
@ -138,12 +139,15 @@ public class Hub extends JavaPlugin implements IRelation
|
|||||||
|
|
||||||
incognito.setPreferencesManager(preferenceManager);
|
incognito.setPreferencesManager(preferenceManager);
|
||||||
|
|
||||||
|
HologramManager hologramManager = new HologramManager(this, packetHandler);
|
||||||
|
|
||||||
preferenceManager.GiveItem = true;
|
preferenceManager.GiveItem = true;
|
||||||
Creature creature = new Creature(this);
|
Creature creature = new Creature(this);
|
||||||
NpcManager npcManager = new NpcManager(this, creature);
|
NpcManager npcManager = new NpcManager(this, creature);
|
||||||
_npcManager = npcManager;
|
_npcManager = npcManager;
|
||||||
InventoryManager inventoryManager = new InventoryManager(this, clientManager);
|
InventoryManager inventoryManager = new InventoryManager(this, clientManager);
|
||||||
PetManager petManager = new PetManager(this, clientManager, donationManager, inventoryManager, disguiseManager, creature, blockRestore);
|
CastleManager castleManager = new CastleManager(this, clientManager, hologramManager, true);
|
||||||
|
PetManager petManager = new PetManager(this, clientManager, donationManager, inventoryManager, disguiseManager, creature, blockRestore, castleManager);
|
||||||
PollManager pollManager = new PollManager(this, clientManager, donationManager);
|
PollManager pollManager = new PollManager(this, clientManager, donationManager);
|
||||||
//new TournamentManager(this, clientManager, donationManager);
|
//new TournamentManager(this, clientManager, donationManager);
|
||||||
|
|
||||||
@ -180,8 +184,7 @@ public class Hub extends JavaPlugin implements IRelation
|
|||||||
String boosterGroup = serverConfiguration.getServerGroup().getBoosterGroup();
|
String boosterGroup = serverConfiguration.getServerGroup().getBoosterGroup();
|
||||||
ThankManager thankManager = new ThankManager(this, clientManager, donationManager);
|
ThankManager thankManager = new ThankManager(this, clientManager, donationManager);
|
||||||
BoosterManager boosterManager = new BoosterManager(this, boosterGroup, clientManager, donationManager, inventoryManager, thankManager);
|
BoosterManager boosterManager = new BoosterManager(this, boosterGroup, clientManager, donationManager, inventoryManager, thankManager);
|
||||||
HubManager hubManager = new HubManager(this, blockRestore, clientManager, incognito, donationManager, inventoryManager, conditionManager, disguiseManager, new TaskManager(this, clientManager), portal, partyManager, preferenceManager, petManager, pollManager, statsManager, achievementManager, new HologramManager(this, packetHandler), npcManager, personalServerManager, packetHandler, punish, serverStatusManager, customDataManager, thankManager, boosterManager);
|
HubManager hubManager = new HubManager(this, blockRestore, clientManager, incognito, donationManager, inventoryManager, conditionManager, disguiseManager, new TaskManager(this, clientManager), portal, partyManager, preferenceManager, petManager, pollManager, statsManager, achievementManager, new HologramManager(this, packetHandler), npcManager, personalServerManager, packetHandler, punish, serverStatusManager, customDataManager, thankManager, boosterManager, castleManager);
|
||||||
HologramManager hologramManager = new HologramManager(this, packetHandler);
|
|
||||||
|
|
||||||
QueueManager queueManager = new QueueManager(this, clientManager, donationManager, eloManager, partyManager);
|
QueueManager queueManager = new QueueManager(this, clientManager, donationManager, eloManager, partyManager);
|
||||||
ServerManager serverManager = new ServerManager(this, clientManager, donationManager, portal, partyManager, serverStatusManager, hubManager, queueManager, boosterManager);
|
ServerManager serverManager = new ServerManager(this, clientManager, donationManager, portal, partyManager, serverStatusManager, hubManager, queueManager, boosterManager);
|
||||||
|
@ -4,6 +4,13 @@ import java.util.HashMap;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||||
|
import net.md_5.bungee.api.chat.HoverEvent;
|
||||||
|
import net.md_5.bungee.api.chat.HoverEvent.Action;
|
||||||
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
|
import net.minecraft.server.v1_8_R3.EntityInsentient;
|
||||||
|
import net.minecraft.server.v1_8_R3.EntityPlayer;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
@ -69,6 +76,7 @@ import mineplex.core.donation.Donor;
|
|||||||
import mineplex.core.facebook.FacebookManager;
|
import mineplex.core.facebook.FacebookManager;
|
||||||
import mineplex.core.gadget.GadgetManager;
|
import mineplex.core.gadget.GadgetManager;
|
||||||
import mineplex.core.gadget.event.GadgetCollideEntityEvent;
|
import mineplex.core.gadget.event.GadgetCollideEntityEvent;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.king.CastleManager;
|
||||||
import mineplex.core.hologram.HologramManager;
|
import mineplex.core.hologram.HologramManager;
|
||||||
import mineplex.core.incognito.IncognitoManager;
|
import mineplex.core.incognito.IncognitoManager;
|
||||||
import mineplex.core.incognito.events.IncognitoHidePlayerEvent;
|
import mineplex.core.incognito.events.IncognitoHidePlayerEvent;
|
||||||
@ -131,12 +139,6 @@ import mineplex.minecraft.game.classcombat.item.event.ItemTriggerEvent;
|
|||||||
import mineplex.minecraft.game.core.combat.DeathMessageType;
|
import mineplex.minecraft.game.core.combat.DeathMessageType;
|
||||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||||
import mineplex.minecraft.game.core.condition.ConditionManager;
|
import mineplex.minecraft.game.core.condition.ConditionManager;
|
||||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
|
||||||
import net.md_5.bungee.api.chat.HoverEvent;
|
|
||||||
import net.md_5.bungee.api.chat.HoverEvent.Action;
|
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
|
||||||
import net.minecraft.server.v1_8_R3.EntityInsentient;
|
|
||||||
import net.minecraft.server.v1_8_R3.EntityPlayer;
|
|
||||||
|
|
||||||
public class HubManager extends MiniClientPlugin<HubClient> implements IChatMessageFormatter
|
public class HubManager extends MiniClientPlugin<HubClient> implements IChatMessageFormatter
|
||||||
{
|
{
|
||||||
@ -188,7 +190,7 @@ public class HubManager extends MiniClientPlugin<HubClient> implements IChatMess
|
|||||||
|
|
||||||
private HashMap<String, ArrayList<String>> _creativeAdmin = new HashMap<String, ArrayList<String>>();
|
private HashMap<String, ArrayList<String>> _creativeAdmin = new HashMap<String, ArrayList<String>>();
|
||||||
|
|
||||||
public HubManager(JavaPlugin plugin, BlockRestore blockRestore, CoreClientManager clientManager, IncognitoManager incognito, DonationManager donationManager, InventoryManager inventoryManager, ConditionManager conditionManager, DisguiseManager disguiseManager, TaskManager taskManager, Portal portal, PartyManager partyManager, PreferencesManager preferences, PetManager petManager, PollManager pollManager, StatsManager statsManager, AchievementManager achievementManager, HologramManager hologramManager, NpcManager npcManager, PersonalServerManager personalServerManager, PacketHandler packetHandler, Punish punish, ServerStatusManager serverStatusManager, CustomDataManager customDataManager, ThankManager thankManager, BoosterManager boosterManager)
|
public HubManager(JavaPlugin plugin, BlockRestore blockRestore, CoreClientManager clientManager, IncognitoManager incognito, DonationManager donationManager, InventoryManager inventoryManager, ConditionManager conditionManager, DisguiseManager disguiseManager, TaskManager taskManager, Portal portal, PartyManager partyManager, PreferencesManager preferences, PetManager petManager, PollManager pollManager, StatsManager statsManager, AchievementManager achievementManager, HologramManager hologramManager, NpcManager npcManager, PersonalServerManager personalServerManager, PacketHandler packetHandler, Punish punish, ServerStatusManager serverStatusManager, CustomDataManager customDataManager, ThankManager thankManager, BoosterManager boosterManager, CastleManager castleManager)
|
||||||
{
|
{
|
||||||
super("Hub Manager", plugin);
|
super("Hub Manager", plugin);
|
||||||
|
|
||||||
@ -222,7 +224,7 @@ public class HubManager extends MiniClientPlugin<HubClient> implements IChatMess
|
|||||||
_mountManager = new MountManager(_plugin, clientManager, donationManager, blockRestore, _disguiseManager);
|
_mountManager = new MountManager(_plugin, clientManager, donationManager, blockRestore, _disguiseManager);
|
||||||
_inventoryManager = inventoryManager;
|
_inventoryManager = inventoryManager;
|
||||||
new BenefitManager(plugin, clientManager, _inventoryManager);
|
new BenefitManager(plugin, clientManager, _inventoryManager);
|
||||||
_gadgetManager = new GadgetManager(_plugin, clientManager, donationManager, _inventoryManager, _mountManager, petManager, preferences, disguiseManager, blockRestore, Managers.get(ProjectileManager.class), achievementManager, packetHandler, hologramManager, incognito);
|
_gadgetManager = new GadgetManager(_plugin, clientManager, donationManager, _inventoryManager, _mountManager, petManager, preferences, disguiseManager, blockRestore, Managers.get(ProjectileManager.class), achievementManager, packetHandler, hologramManager, incognito, castleManager);
|
||||||
|
|
||||||
FacebookManager facebookManager = new FacebookManager(plugin, clientManager, donationManager, inventoryManager);
|
FacebookManager facebookManager = new FacebookManager(plugin, clientManager, donationManager, inventoryManager);
|
||||||
YoutubeManager youtubeManager = new YoutubeManager(plugin, clientManager, donationManager);
|
YoutubeManager youtubeManager = new YoutubeManager(plugin, clientManager, donationManager);
|
||||||
|
@ -3,7 +3,6 @@ package nautilus.game.arcade;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import mineplex.core.aprilfools.AprilFoolsManager;
|
|
||||||
import net.minecraft.server.v1_8_R3.MinecraftServer;
|
import net.minecraft.server.v1_8_R3.MinecraftServer;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -24,6 +23,7 @@ import mineplex.core.achievement.AchievementManager;
|
|||||||
import mineplex.core.antihack.AntiHack;
|
import mineplex.core.antihack.AntiHack;
|
||||||
import mineplex.core.antihack.RelationProvider;
|
import mineplex.core.antihack.RelationProvider;
|
||||||
import mineplex.core.antihack.logging.AntihackLogger;
|
import mineplex.core.antihack.logging.AntihackLogger;
|
||||||
|
import mineplex.core.aprilfools.AprilFoolsManager;
|
||||||
import mineplex.core.blockrestore.BlockRestore;
|
import mineplex.core.blockrestore.BlockRestore;
|
||||||
import mineplex.core.blood.Blood;
|
import mineplex.core.blood.Blood;
|
||||||
import mineplex.core.boosters.BoosterManager;
|
import mineplex.core.boosters.BoosterManager;
|
||||||
@ -44,6 +44,7 @@ import mineplex.core.donation.DonationManager;
|
|||||||
import mineplex.core.elo.EloManager;
|
import mineplex.core.elo.EloManager;
|
||||||
import mineplex.core.friend.FriendManager;
|
import mineplex.core.friend.FriendManager;
|
||||||
import mineplex.core.gadget.GadgetManager;
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.king.CastleManager;
|
||||||
import mineplex.core.give.Give;
|
import mineplex.core.give.Give;
|
||||||
import mineplex.core.globalpacket.GlobalPacketManager;
|
import mineplex.core.globalpacket.GlobalPacketManager;
|
||||||
import mineplex.core.hologram.HologramManager;
|
import mineplex.core.hologram.HologramManager;
|
||||||
@ -86,6 +87,7 @@ import mineplex.minecraft.game.core.damage.DamageManager;
|
|||||||
import nautilus.game.arcade.anticheatmetadata.GameInfoMetadata;
|
import nautilus.game.arcade.anticheatmetadata.GameInfoMetadata;
|
||||||
import nautilus.game.arcade.game.Game;
|
import nautilus.game.arcade.game.Game;
|
||||||
import nautilus.game.arcade.game.GameServerConfig;
|
import nautilus.game.arcade.game.GameServerConfig;
|
||||||
|
|
||||||
import static mineplex.core.Managers.require;
|
import static mineplex.core.Managers.require;
|
||||||
|
|
||||||
public class Arcade extends JavaPlugin
|
public class Arcade extends JavaPlugin
|
||||||
@ -199,9 +201,10 @@ public class Arcade extends JavaPlugin
|
|||||||
|
|
||||||
//Inventory
|
//Inventory
|
||||||
InventoryManager inventoryManager = new InventoryManager(this, _clientManager);
|
InventoryManager inventoryManager = new InventoryManager(this, _clientManager);
|
||||||
PetManager petManager = new PetManager(this, _clientManager, _donationManager, inventoryManager, disguiseManager, creature, blockRestore);
|
CastleManager castleManager = new CastleManager(this, _clientManager, hologramManager, false);
|
||||||
|
PetManager petManager = new PetManager(this, _clientManager, _donationManager, inventoryManager, disguiseManager, creature, blockRestore, castleManager);
|
||||||
MountManager mountManager = new MountManager(this, _clientManager, _donationManager, blockRestore, disguiseManager);
|
MountManager mountManager = new MountManager(this, _clientManager, _donationManager, blockRestore, disguiseManager);
|
||||||
GadgetManager gadgetManager = new GadgetManager(this, _clientManager, _donationManager, inventoryManager, mountManager, petManager, preferenceManager, disguiseManager, blockRestore, projectileManager, achievementManager, packetHandler, hologramManager, incognito);
|
GadgetManager gadgetManager = new GadgetManager(this, _clientManager, _donationManager, inventoryManager, mountManager, petManager, preferenceManager, disguiseManager, blockRestore, projectileManager, achievementManager, packetHandler, hologramManager, incognito, castleManager);
|
||||||
ThankManager thankManager = new ThankManager(this, _clientManager, _donationManager);
|
ThankManager thankManager = new ThankManager(this, _clientManager, _donationManager);
|
||||||
BoosterManager boosterManager = new BoosterManager(this, _serverConfiguration.getServerGroup().getBoosterGroup(), _clientManager, _donationManager, inventoryManager, thankManager);
|
BoosterManager boosterManager = new BoosterManager(this, _serverConfiguration.getServerGroup().getBoosterGroup(), _clientManager, _donationManager, inventoryManager, thankManager);
|
||||||
CosmeticManager cosmeticManager = new CosmeticManager(this, _clientManager, _donationManager, inventoryManager, gadgetManager, mountManager, petManager, null, boosterManager);
|
CosmeticManager cosmeticManager = new CosmeticManager(this, _clientManager, _donationManager, inventoryManager, gadgetManager, mountManager, petManager, null, boosterManager);
|
||||||
|
@ -1632,7 +1632,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
{
|
{
|
||||||
// Disables gadgets if player count is greater than 40
|
// Disables gadgets if player count is greater than 40
|
||||||
int playerCount = UtilServer.getPlayers().length;
|
int playerCount = UtilServer.getPlayers().length;
|
||||||
getCosmeticManager().getGadgetManager().setGadgetEnabled(playerCount <= 40);
|
getCosmeticManager().getGadgetManager().setGadgetEnabled(playerCount <= (GetGameHostManager().isEventServer() ? 120 : 40));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public void saveBasicStats(final Game game)
|
/*public void saveBasicStats(final Game game)
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -21,6 +21,8 @@ import mineplex.core.common.util.UtilParticle.ParticleType;
|
|||||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||||
import nautilus.game.arcade.game.games.bridge.Bridge;
|
import nautilus.game.arcade.game.games.bridge.Bridge;
|
||||||
import nautilus.game.arcade.game.games.bridge.animation.BridgeAnimation;
|
import nautilus.game.arcade.game.games.bridge.animation.BridgeAnimation;
|
||||||
|
import org.bukkit.block.BlockFace;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public abstract class CustomBridgeAnimation extends BridgeAnimation
|
public abstract class CustomBridgeAnimation extends BridgeAnimation
|
||||||
{
|
{
|
||||||
@ -198,7 +200,18 @@ public abstract class CustomBridgeAnimation extends BridgeAnimation
|
|||||||
_maxDistance = dist;
|
_maxDistance = dist;
|
||||||
}
|
}
|
||||||
|
|
||||||
_restore.add(block, Material.AIR.getId(), (byte) 0, Integer.MAX_VALUE);
|
int toSet = Material.AIR.getId();
|
||||||
|
|
||||||
|
for (Block surround : getNextBlocks(block))
|
||||||
|
{
|
||||||
|
if (surround.getType() == Material.WATER || surround.getType() == Material.STATIONARY_WATER)
|
||||||
|
{
|
||||||
|
toSet = Material.STATIONARY_WATER.getId();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_restore.add(block, toSet, (byte) 0, Integer.MAX_VALUE);
|
||||||
_bridgeBlocks.put(block.getLocation(), dist);
|
_bridgeBlocks.put(block.getLocation(), dist);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -248,4 +261,16 @@ public abstract class CustomBridgeAnimation extends BridgeAnimation
|
|||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<Block> getNextBlocks(Block block)
|
||||||
|
{
|
||||||
|
List<Block> blocks = new ArrayList<>(4);
|
||||||
|
|
||||||
|
blocks.add(block.getRelative(BlockFace.NORTH));
|
||||||
|
blocks.add(block.getRelative(BlockFace.EAST));
|
||||||
|
blocks.add(block.getRelative(BlockFace.SOUTH));
|
||||||
|
blocks.add(block.getRelative(BlockFace.WEST));
|
||||||
|
|
||||||
|
return blocks;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ import nautilus.game.arcade.GameType;
|
|||||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||||
import nautilus.game.arcade.game.Game;
|
import nautilus.game.arcade.game.Game;
|
||||||
import nautilus.game.arcade.game.games.event.kits.KitPlayer;
|
import nautilus.game.arcade.game.games.event.kits.KitPlayer;
|
||||||
|
import nautilus.game.arcade.game.games.event.staffoscars.StaffOscarsModule;
|
||||||
import nautilus.game.arcade.game.modules.compass.CompassModule;
|
import nautilus.game.arcade.game.modules.compass.CompassModule;
|
||||||
import nautilus.game.arcade.kit.Kit;
|
import nautilus.game.arcade.kit.Kit;
|
||||||
import nautilus.game.arcade.managers.GameHostManager;
|
import nautilus.game.arcade.managers.GameHostManager;
|
||||||
@ -126,6 +127,15 @@ public class EventGame extends Game
|
|||||||
.register(this);
|
.register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void ParseData()
|
||||||
|
{
|
||||||
|
if (WorldData.MapName.equals("Staff Oscars"))
|
||||||
|
{
|
||||||
|
new StaffOscarsModule().register(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void registerSigns(GameStateChangeEvent event)
|
public void registerSigns(GameStateChangeEvent event)
|
||||||
{
|
{
|
||||||
|
@ -6,31 +6,6 @@ import java.util.HashSet;
|
|||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import mineplex.core.MiniPlugin;
|
|
||||||
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.UtilEnt;
|
|
||||||
import mineplex.core.common.util.UtilEvent;
|
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
|
||||||
import mineplex.core.common.util.UtilServer;
|
|
||||||
import mineplex.core.common.util.UtilText;
|
|
||||||
import mineplex.core.common.util.UtilTextMiddle;
|
|
||||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
|
||||||
import mineplex.core.common.util.UtilInv;
|
|
||||||
import mineplex.core.creature.event.CreatureKillEntitiesEvent;
|
|
||||||
import mineplex.core.event.StackerEvent;
|
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphBlock;
|
|
||||||
import mineplex.core.gadget.types.Gadget;
|
|
||||||
import mineplex.core.gadget.types.GadgetType;
|
|
||||||
import mineplex.core.give.Give;
|
|
||||||
import mineplex.core.mount.Mount;
|
|
||||||
import mineplex.core.updater.UpdateType;
|
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
|
||||||
import nautilus.game.arcade.ArcadeManager;
|
|
||||||
import nautilus.game.arcade.game.games.bridge.Bridge;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Effect;
|
import org.bukkit.Effect;
|
||||||
@ -54,6 +29,7 @@ import org.bukkit.entity.Zombie;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||||
|
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
@ -62,6 +38,36 @@ import org.bukkit.plugin.java.JavaPlugin;
|
|||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
|
import mineplex.core.MiniPlugin;
|
||||||
|
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.UtilEnt;
|
||||||
|
import mineplex.core.common.util.UtilEvent;
|
||||||
|
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||||
|
import mineplex.core.common.util.UtilInv;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.UtilText;
|
||||||
|
import mineplex.core.common.util.UtilTextMiddle;
|
||||||
|
import mineplex.core.creature.event.CreatureKillEntitiesEvent;
|
||||||
|
import mineplex.core.event.StackerEvent;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.MorphBlock;
|
||||||
|
import mineplex.core.gadget.types.Gadget;
|
||||||
|
import mineplex.core.gadget.types.GadgetType;
|
||||||
|
import mineplex.core.give.Give;
|
||||||
|
import mineplex.core.mount.Mount;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
|
||||||
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.game.GameTeam.PlayerState;
|
||||||
|
import nautilus.game.arcade.game.games.bridge.Bridge;
|
||||||
|
import nautilus.game.arcade.game.games.smash.SuperSmash;
|
||||||
|
import nautilus.game.arcade.game.games.survivalgames.SurvivalGames;
|
||||||
|
import nautilus.game.arcade.kit.Kit;
|
||||||
|
|
||||||
public class EventModule extends MiniPlugin
|
public class EventModule extends MiniPlugin
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -78,6 +84,8 @@ public class EventModule extends MiniPlugin
|
|||||||
private ArrayList<Player> _damage;
|
private ArrayList<Player> _damage;
|
||||||
private boolean _allowStacker;
|
private boolean _allowStacker;
|
||||||
|
|
||||||
|
private boolean _keepInventory;
|
||||||
|
|
||||||
public EventModule(ArcadeManager manager, JavaPlugin plugin)
|
public EventModule(ArcadeManager manager, JavaPlugin plugin)
|
||||||
{
|
{
|
||||||
super("EventModule", plugin);
|
super("EventModule", plugin);
|
||||||
@ -159,7 +167,6 @@ public class EventModule extends MiniPlugin
|
|||||||
UtilPlayer.message(player, F.value("/e doublejump", "Toggles Double Jump"));
|
UtilPlayer.message(player, F.value("/e doublejump", "Toggles Double Jump"));
|
||||||
UtilPlayer.message(player, F.value("/e bc", "Broadcast a message with colorcodes"));
|
UtilPlayer.message(player, F.value("/e bc", "Broadcast a message with colorcodes"));
|
||||||
UtilPlayer.message(player, F.value("/e tempgadget", "Activates gadget for all player"));
|
UtilPlayer.message(player, F.value("/e tempgadget", "Activates gadget for all player"));
|
||||||
UtilPlayer.message(player, F.value("/e playerdamage", "Toggles damage fpr player"));
|
|
||||||
UtilPlayer.message(player, F.value("/e stacker [Player]", "toggles stacker global or for Players"));
|
UtilPlayer.message(player, F.value("/e stacker [Player]", "toggles stacker global or for Players"));
|
||||||
UtilPlayer.message(player, F.value("/e kick", "Remove a player from the event"));
|
UtilPlayer.message(player, F.value("/e kick", "Remove a player from the event"));
|
||||||
UtilPlayer.message(player, F.value("/e area PVP|ALL|PVE|EVP|Gadget|Effect / add", "Create and edit areas"));
|
UtilPlayer.message(player, F.value("/e area PVP|ALL|PVE|EVP|Gadget|Effect / add", "Create and edit areas"));
|
||||||
@ -175,6 +182,18 @@ public class EventModule extends MiniPlugin
|
|||||||
|
|
||||||
UtilPlayer.message(player, F.value("/e effect <player> <type> <mult> <seconds>", ""));
|
UtilPlayer.message(player, F.value("/e effect <player> <type> <mult> <seconds>", ""));
|
||||||
UtilPlayer.message(player, F.value("/e effect <player> clear", ""));
|
UtilPlayer.message(player, F.value("/e effect <player> clear", ""));
|
||||||
|
|
||||||
|
UtilPlayer.message(player, F.value("/e announce <text>", "Broadcasts a 1.8 announcement"));
|
||||||
|
UtilPlayer.message(player, F.value("/e clear <player>", "Clears player’s inventory"));
|
||||||
|
UtilPlayer.message(player, F.value("/e clear all", "Clears all inventories"));
|
||||||
|
UtilPlayer.message(player, F.value("/e bridge", "Forces Bridges countdown to 10 seconds"));
|
||||||
|
UtilPlayer.message(player, F.value("/e revive", "Revive a Player"));
|
||||||
|
UtilPlayer.message(player, F.value("/e keepinventory", ""));
|
||||||
|
UtilPlayer.message(player, F.value("/e gamekit", "Change kit of a Player"));
|
||||||
|
UtilPlayer.message(player, F.value("/e smash", "spawn smash Crystal in Smash"));
|
||||||
|
UtilPlayer.message(player, F.value("/e dm", "start dm in SG"));
|
||||||
|
UtilPlayer.message(player, F.value("/e supplydrop", "spawn supply Drop in SG"));
|
||||||
|
UtilPlayer.message(player, F.value("/ea", "Talk in event chat"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void commandHelpSettings(Player player)
|
public void commandHelpSettings(Player player)
|
||||||
@ -199,9 +218,6 @@ public class EventModule extends MiniPlugin
|
|||||||
UtilPlayer.message(player, F.value("/e blockbreak whitelist <add/remove/list/clear> <id>", ""));
|
UtilPlayer.message(player, F.value("/e blockbreak whitelist <add/remove/list/clear> <id>", ""));
|
||||||
UtilPlayer.message(player, F.value("/e blockbreak blacklist <add/remove/list/clear> <id>", ""));
|
UtilPlayer.message(player, F.value("/e blockbreak blacklist <add/remove/list/clear> <id>", ""));
|
||||||
UtilPlayer.message(player, F.value("/e time <-1 to 24000>", "Sets World Time"));
|
UtilPlayer.message(player, F.value("/e time <-1 to 24000>", "Sets World Time"));
|
||||||
//UtilPlayer.message(player, F.value("/e joiningame", "toggles Join In Process for games"));
|
|
||||||
//UtilPlayer.message(player, F.value("/e deathout", "toggles Deathout in games"));
|
|
||||||
//UtilPlayer.message(player, F.value("/e quitout", "toggles Quitout in games"));
|
|
||||||
UtilPlayer.message(player, F.value("/e mobgriefing", "toggles mobgriefing in games"));
|
UtilPlayer.message(player, F.value("/e mobgriefing", "toggles mobgriefing in games"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,10 +225,7 @@ public class EventModule extends MiniPlugin
|
|||||||
@EventHandler(priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void commandHandler(PlayerCommandPreprocessEvent event)
|
public void commandHandler(PlayerCommandPreprocessEvent event)
|
||||||
{
|
{
|
||||||
if (Manager.GetGame() == null || !Manager.GetGame().InProgress())
|
if (Manager.GetGame() == null)
|
||||||
return;
|
|
||||||
|
|
||||||
if (!event.getMessage().toLowerCase().startsWith("/e "))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
boolean eventTestServer = _plugin.getConfig().getString("serverstatus.name").equalsIgnoreCase("SMTestServer-1");
|
boolean eventTestServer = _plugin.getConfig().getString("serverstatus.name").equalsIgnoreCase("SMTestServer-1");
|
||||||
@ -220,13 +233,22 @@ public class EventModule extends MiniPlugin
|
|||||||
if(!Manager.GetGameHostManager().isEventServer() && !eventTestServer)
|
if(!Manager.GetGameHostManager().isEventServer() && !eventTestServer)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
//Trim off /e and split to args
|
||||||
|
String[] args = event.getMessage().substring(3, event.getMessage().length()).split(" ");
|
||||||
|
|
||||||
|
if (event.getMessage().toLowerCase().startsWith("/ea"))
|
||||||
|
{
|
||||||
|
commandEventChat(event.getPlayer(), args);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!event.getMessage().toLowerCase().startsWith("/e "))
|
||||||
|
return;
|
||||||
|
|
||||||
if (!Manager.GetGameHostManager().isAdmin(event.getPlayer(), false))
|
if (!Manager.GetGameHostManager().isAdmin(event.getPlayer(), false))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//Trim off /e and split to args
|
event.setCancelled(true);
|
||||||
String[] args = event.getMessage().substring(3, event.getMessage().length()).split(" ");
|
|
||||||
|
|
||||||
if (args.length == 0 || args[0].equalsIgnoreCase("help"))
|
if (args.length == 0 || args[0].equalsIgnoreCase("help"))
|
||||||
{
|
{
|
||||||
@ -240,7 +262,6 @@ public class EventModule extends MiniPlugin
|
|||||||
commandHelpSettings(event.getPlayer());
|
commandHelpSettings(event.getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
//XXX Commands
|
|
||||||
else if (args[0].equalsIgnoreCase("tp"))
|
else if (args[0].equalsIgnoreCase("tp"))
|
||||||
{
|
{
|
||||||
commandTeleport(event.getPlayer(), args);
|
commandTeleport(event.getPlayer(), args);
|
||||||
@ -257,9 +278,90 @@ public class EventModule extends MiniPlugin
|
|||||||
{
|
{
|
||||||
commandAdmin(event.getPlayer(), args);
|
commandAdmin(event.getPlayer(), args);
|
||||||
}
|
}
|
||||||
|
else if (args[0].equalsIgnoreCase("whitelist"))
|
||||||
|
{
|
||||||
|
commandWhitelist(event.getPlayer(), args);
|
||||||
|
}
|
||||||
|
else if (args[0].equalsIgnoreCase("give"))
|
||||||
|
{
|
||||||
|
commandGive(event.getPlayer(), args);
|
||||||
|
}
|
||||||
|
else if (args[0].equalsIgnoreCase("effect"))
|
||||||
|
{
|
||||||
|
commandEffect(event.getPlayer(), args, null);
|
||||||
|
}
|
||||||
|
else if (args[0].equalsIgnoreCase("mob"))
|
||||||
|
{
|
||||||
|
if (args.length >= 2 && args[1].equalsIgnoreCase("kill"))
|
||||||
|
commandMobKill(event.getPlayer(), args);
|
||||||
|
else
|
||||||
|
commandMob(event.getPlayer(), args);
|
||||||
|
}
|
||||||
|
else if(args[0].equalsIgnoreCase("bc"))
|
||||||
|
{
|
||||||
|
commandBC(event.getPlayer(), args);
|
||||||
|
}
|
||||||
|
else if(args[0].equalsIgnoreCase("kick"))
|
||||||
|
{
|
||||||
|
if(Bukkit.getPlayer(args[1]) == null)
|
||||||
|
{
|
||||||
|
UtilPlayer.message(event.getPlayer(), "No matches for: " + C.cYellow + args[1]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Manager.GetGameHostManager().getBlacklist().contains(Bukkit.getPlayer(args[1]).getName()))
|
||||||
|
{
|
||||||
|
Manager.GetGameHostManager().getBlacklist().remove(Bukkit.getPlayer(args[1]).getName());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Manager.GetGameHostManager().getBlacklist().add(Bukkit.getPlayer(args[1]).getName());
|
||||||
|
UtilPlayer.message(event.getPlayer(), F.main("Event", "You removed " + C.cYellow + Bukkit.getPlayer(args[1]).getName()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(args[0].equalsIgnoreCase("tempgadget"))
|
||||||
|
{
|
||||||
|
String gadget = args[1];
|
||||||
|
for(int e = 2; e < args.length; e++)
|
||||||
|
gadget+= " " + args[e];
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
for(Player target : UtilServer.getPlayers())
|
||||||
|
Manager.GetDonation().Get(target).addOwnedUnknownSalesPackage(gadget);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
UtilPlayer.message(event.getPlayer(), F.main("Event", "Gadget is not vallid"));
|
||||||
|
}
|
||||||
|
UtilPlayer.message(event.getPlayer(), F.main("Event", "You gave the gadget " + F.item(gadget) + " to all Players!"));
|
||||||
|
}
|
||||||
|
else if (args[0].equalsIgnoreCase("announce"))
|
||||||
|
{
|
||||||
|
String text = args[1];
|
||||||
|
|
||||||
|
for (int i = 2; i < args.length; i++)
|
||||||
|
{
|
||||||
|
text += " " + args[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
UtilTextMiddle.display(C.cDGreenB + "Announcement", text);
|
||||||
|
UtilServer.broadcast(F.main("Event Announcement", text));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Manager.GetGame().InProgress())
|
||||||
|
return;
|
||||||
|
|
||||||
|
//XXX Commands
|
||||||
else if (args[0].equalsIgnoreCase("gm"))
|
else if (args[0].equalsIgnoreCase("gm"))
|
||||||
{
|
{
|
||||||
commandGamemode(event.getPlayer(), args);
|
commandGamemode(event.getPlayer(), args);
|
||||||
|
}else if (args[0].equalsIgnoreCase("gamekit"))
|
||||||
|
{
|
||||||
|
commandGameKit(event.getPlayer(), args);
|
||||||
|
}
|
||||||
|
else if (args[0].equalsIgnoreCase("keepinventory"))
|
||||||
|
{
|
||||||
|
commandKeepInventory(event.getPlayer());
|
||||||
}
|
}
|
||||||
else if (args[0].equalsIgnoreCase("radius"))
|
else if (args[0].equalsIgnoreCase("radius"))
|
||||||
{
|
{
|
||||||
@ -273,28 +375,13 @@ public class EventModule extends MiniPlugin
|
|||||||
{
|
{
|
||||||
commandScoreboard(event.getPlayer(), args);
|
commandScoreboard(event.getPlayer(), args);
|
||||||
}
|
}
|
||||||
else if (args[0].equalsIgnoreCase("whitelist"))
|
|
||||||
{
|
|
||||||
commandWhitelist(event.getPlayer(), args);
|
|
||||||
}
|
|
||||||
else if (args[0].equalsIgnoreCase("give"))
|
|
||||||
{
|
|
||||||
commandGive(event.getPlayer(), args);
|
|
||||||
}
|
|
||||||
else if (args[0].equalsIgnoreCase("effect"))
|
|
||||||
{
|
|
||||||
commandEffect(event.getPlayer(), args, null);
|
|
||||||
}
|
|
||||||
else if (args[0].equalsIgnoreCase("kit"))
|
else if (args[0].equalsIgnoreCase("kit"))
|
||||||
{
|
{
|
||||||
commandKit(event.getPlayer(), args);
|
commandKit(event.getPlayer(), args);
|
||||||
}
|
}
|
||||||
else if (args[0].equalsIgnoreCase("mob"))
|
else if (args[0].equalsIgnoreCase("revive"))
|
||||||
{
|
{
|
||||||
if (args.length >= 2 && args[1].equalsIgnoreCase("kill"))
|
commandRevive(event.getPlayer(), args);
|
||||||
commandMobKill(event.getPlayer(), args);
|
|
||||||
else
|
|
||||||
commandMob(event.getPlayer(), args);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -366,22 +453,14 @@ public class EventModule extends MiniPlugin
|
|||||||
{
|
{
|
||||||
commandTime(event.getPlayer(), args);
|
commandTime(event.getPlayer(), args);
|
||||||
}
|
}
|
||||||
/*else if(args[0].equalsIgnoreCase("joiningame"))
|
|
||||||
{
|
|
||||||
commandSpectators(event.getPlayer(), args);
|
|
||||||
}
|
|
||||||
else if(args[0].equalsIgnoreCase("deathout"))
|
|
||||||
{
|
|
||||||
commandDeathout(event.getPlayer(), args);
|
|
||||||
}
|
|
||||||
else if(args[0].equalsIgnoreCase("quitout"))
|
|
||||||
{
|
|
||||||
commandQuitOut(event.getPlayer(), args);
|
|
||||||
}*/
|
|
||||||
else if(args[0].equalsIgnoreCase("blockplacecreative"))
|
else if(args[0].equalsIgnoreCase("blockplacecreative"))
|
||||||
{
|
{
|
||||||
commandBlockPlaceInCreative(event.getPlayer(), args);
|
commandBlockPlaceInCreative(event.getPlayer(), args);
|
||||||
}
|
}
|
||||||
|
else if(args[0].equalsIgnoreCase("blockbreakcreative"))
|
||||||
|
{
|
||||||
|
commandBlockBreakInCreative(event.getPlayer(), args);
|
||||||
|
}
|
||||||
else if(args[0].equalsIgnoreCase("stacker"))
|
else if(args[0].equalsIgnoreCase("stacker"))
|
||||||
{
|
{
|
||||||
commandStacker(event.getPlayer(), args);
|
commandStacker(event.getPlayer(), args);
|
||||||
@ -405,10 +484,6 @@ public class EventModule extends MiniPlugin
|
|||||||
else
|
else
|
||||||
_damage.add(Bukkit.getPlayer(args[1]));
|
_damage.add(Bukkit.getPlayer(args[1]));
|
||||||
}
|
}
|
||||||
else if(args[0].equalsIgnoreCase("bc"))
|
|
||||||
{
|
|
||||||
commandBC(event.getPlayer(), args);
|
|
||||||
}
|
|
||||||
else if(args[0].equalsIgnoreCase("area"))
|
else if(args[0].equalsIgnoreCase("area"))
|
||||||
{
|
{
|
||||||
if(!(Manager.GetGame() instanceof EventGame)) {
|
if(!(Manager.GetGame() instanceof EventGame)) {
|
||||||
@ -422,46 +497,6 @@ public class EventModule extends MiniPlugin
|
|||||||
{
|
{
|
||||||
commandMobGriefing(event.getPlayer(), args);
|
commandMobGriefing(event.getPlayer(), args);
|
||||||
}
|
}
|
||||||
else if(args[0].equalsIgnoreCase("kick"))
|
|
||||||
{
|
|
||||||
if(Bukkit.getPlayer(args[1]) == null)
|
|
||||||
{
|
|
||||||
UtilPlayer.message(event.getPlayer(), "No matches for: " + C.cYellow + args[1]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//Bukkit.getPlayer(args[1]).kickPlayer("You where kicked from the event, probably you didn't stick to the Event Rules.");
|
|
||||||
Manager.GetGameHostManager().getBlacklist().add(Bukkit.getPlayer(args[1]).getName());
|
|
||||||
UtilPlayer.message(event.getPlayer(), F.main("Event", "You removed " + C.cYellow + Bukkit.getPlayer(args[1]).getName()));
|
|
||||||
}
|
|
||||||
else if(args[0].equalsIgnoreCase("tempgadget"))
|
|
||||||
{
|
|
||||||
String gadget = args[1];
|
|
||||||
for(int e = 2; e < args.length; e++)
|
|
||||||
gadget+= " " + args[e];
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
for(Player target : UtilServer.getPlayers())
|
|
||||||
Manager.GetDonation().Get(target).addOwnedUnknownSalesPackage(gadget);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
UtilPlayer.message(event.getPlayer(), F.main("Event", "Gadget is not vallid"));
|
|
||||||
}
|
|
||||||
UtilPlayer.message(event.getPlayer(), F.main("Event", "You gave the gadget " + F.item(gadget) + " to all Players!"));
|
|
||||||
}
|
|
||||||
else if (args[0].equalsIgnoreCase("announce"))
|
|
||||||
{
|
|
||||||
String text = args[1];
|
|
||||||
|
|
||||||
for (int i = 2; i < args.length; i++)
|
|
||||||
{
|
|
||||||
text += " " + args[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
UtilTextMiddle.display(C.cDGreenB + "Announcement", text);
|
|
||||||
UtilServer.broadcast(F.main("Event Announcement", text));
|
|
||||||
}
|
|
||||||
else if (args[0].equalsIgnoreCase("clear"))
|
else if (args[0].equalsIgnoreCase("clear"))
|
||||||
{
|
{
|
||||||
String playerName = args[1];
|
String playerName = args[1];
|
||||||
@ -528,6 +563,50 @@ public class EventModule extends MiniPlugin
|
|||||||
((Bridge) Manager.GetGame()).setBridgeTime((int) ((System.currentTimeMillis() - Manager.GetGame().GetStateTime()) + seconds * 1000));
|
((Bridge) Manager.GetGame()).setBridgeTime((int) ((System.currentTimeMillis() - Manager.GetGame().GetStateTime()) + seconds * 1000));
|
||||||
UtilPlayer.message(event.getPlayer(), F.main("Event", "Bridges will drop in " + F.elem(seconds + " Seconds") + "!"));
|
UtilPlayer.message(event.getPlayer(), F.main("Event", "Bridges will drop in " + F.elem(seconds + " Seconds") + "!"));
|
||||||
}
|
}
|
||||||
|
else if (args[0].equalsIgnoreCase("dm"))
|
||||||
|
{
|
||||||
|
if (!(Manager.GetGame() instanceof SurvivalGames))
|
||||||
|
{
|
||||||
|
UtilPlayer.message(event.getPlayer(), F.main("Event", "You can only start the deathmatch in SG!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (((SurvivalGames) Manager.GetGame()).isDeathMatchTeleported())
|
||||||
|
{
|
||||||
|
UtilPlayer.message(event.getPlayer(), F.main("Event", "The Deathmatch has already began!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Manager.GetGame().Announce(C.cGreen + C.Bold + event.getPlayer().getName()
|
||||||
|
+ " has initiated Deathmatch!");
|
||||||
|
Manager.GetGame().Announce(C.cGreen + C.Bold + "Deathmatch starting in 60 seconds...");
|
||||||
|
|
||||||
|
((SurvivalGames) Manager.GetGame()).setDeathMatchTime(60);
|
||||||
|
|
||||||
|
for (Player player : UtilServer.getPlayers())
|
||||||
|
player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 1f,
|
||||||
|
1f);
|
||||||
|
}
|
||||||
|
else if (args[0].equalsIgnoreCase("supplydrop"))
|
||||||
|
{
|
||||||
|
if (!(Manager.GetGame() instanceof SurvivalGames))
|
||||||
|
{
|
||||||
|
UtilPlayer.message(event.getPlayer(), F.main("Event", "You can only start the Supply Srop in SG!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Manager.GetGame().WorldData.World.setTime(18000);
|
||||||
|
}
|
||||||
|
else if (args[0].equalsIgnoreCase("smash"))
|
||||||
|
{
|
||||||
|
if (!(Manager.GetGame() instanceof SuperSmash))
|
||||||
|
{
|
||||||
|
UtilPlayer.message(event.getPlayer(), F.main("Event", "You can only add a Smash Crystal in Smash!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
((SuperSmash) Manager.GetGame()).setNextPowerupTime(100);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void listSettings(Player player)
|
public void listSettings(Player player)
|
||||||
@ -560,6 +639,80 @@ public class EventModule extends MiniPlugin
|
|||||||
UtilPlayer.message(player, F.main("Settings", "BlockBreakCreative: " + F.tf(Manager.GetGame().BlockBreakCreative)));
|
UtilPlayer.message(player, F.main("Settings", "BlockBreakCreative: " + F.tf(Manager.GetGame().BlockBreakCreative)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void commandKeepInventory(Player player)
|
||||||
|
{
|
||||||
|
_keepInventory = !_keepInventory;
|
||||||
|
|
||||||
|
UtilPlayer.message(player, F.main("Settings", "BlockBreakCreative: " + F.tf(_keepInventory)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void commandGameKit(Player player, String[] args)
|
||||||
|
{
|
||||||
|
Player target = player;
|
||||||
|
String kitString = "";
|
||||||
|
|
||||||
|
if (args.length >= 3)
|
||||||
|
{
|
||||||
|
Player newTarget = UtilPlayer.searchOnline(player, args[1], true);
|
||||||
|
if (newTarget != null)
|
||||||
|
{
|
||||||
|
target = newTarget;
|
||||||
|
kitString = args[2];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
Kit[] kits = Manager.GetGame().GetKits();
|
||||||
|
Kit kit = null;
|
||||||
|
for (Kit otherKit : kits)
|
||||||
|
if (otherKit.GetName().replace(" ", "").equalsIgnoreCase(kitString))
|
||||||
|
kit = otherKit;
|
||||||
|
|
||||||
|
if (kit == null)
|
||||||
|
{
|
||||||
|
UtilPlayer.message(player, F.main("Event", "No Kit found"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Manager.GetGame().SetKit(target, kit, true, true);
|
||||||
|
UtilPlayer.message(player, F.main("Event", "Kit [" + kit.GetName() + "] applied"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void commandEventChat(Player player, String[] args)
|
||||||
|
{
|
||||||
|
String message = ChatColor.BLUE + "[Event Chat] " + ChatColor.GREEN + player.getName() + ": " + F.combine(args, 1, null, false);
|
||||||
|
UtilPlayer.message(player, message);
|
||||||
|
for (Player other : UtilServer.getPlayers())
|
||||||
|
{
|
||||||
|
if (player == other)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (Manager.GetGameHostManager().isAdmin(other, true))
|
||||||
|
UtilPlayer.message(other, message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void commandRevive(Player player, String[] args)
|
||||||
|
{
|
||||||
|
Player target = player;
|
||||||
|
|
||||||
|
if (args.length >= 2)
|
||||||
|
{
|
||||||
|
Player newTarget = UtilPlayer.searchOnline(player, args[1], true);
|
||||||
|
if (newTarget != null)
|
||||||
|
target = newTarget;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Manager.GetGame().SetPlayerState(target, PlayerState.IN);
|
||||||
|
Manager.GetGame().RespawnPlayer(target);
|
||||||
|
UtilPlayer.message(target, F.main("Game", "You have been Respawned!"));
|
||||||
|
}
|
||||||
|
|
||||||
public void commandStacker(Player player, String[] args)
|
public void commandStacker(Player player, String[] args)
|
||||||
{
|
{
|
||||||
if(args.length == 1)
|
if(args.length == 1)
|
||||||
@ -861,7 +1014,8 @@ public class EventModule extends MiniPlugin
|
|||||||
//Gadget Commands (Global & Individual)
|
//Gadget Commands (Global & Individual)
|
||||||
public void commandGadget(Player player, String[] args)
|
public void commandGadget(Player player, String[] args)
|
||||||
{
|
{
|
||||||
if(!(Manager.GetGame() instanceof EventGame)) {
|
if(!(Manager.GetGame() instanceof EventGame))
|
||||||
|
{
|
||||||
UtilPlayer.message(player, F.main("Inventory", "You can only enable/disable gadgets in the Event game!"));
|
UtilPlayer.message(player, F.main("Inventory", "You can only enable/disable gadgets in the Event game!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2003,6 +2157,33 @@ public class EventModule extends MiniPlugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority=EventPriority.HIGHEST)
|
||||||
|
public void death(PlayerDeathEvent event)
|
||||||
|
{
|
||||||
|
if (Manager.GetGame() == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!Manager.GetGame().InProgress())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!_keepInventory)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ArrayList<ItemStack> stacks = new ArrayList<>();
|
||||||
|
stacks.addAll(event.getDrops());
|
||||||
|
event.getDrops().clear();
|
||||||
|
|
||||||
|
Manager.runSyncLater(new Runnable()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
for (ItemStack item : stacks)
|
||||||
|
event.getEntity().getInventory().addItem(item);
|
||||||
|
}
|
||||||
|
}, 40);
|
||||||
|
}
|
||||||
|
|
||||||
public ArrayList<Player> getDamagePlayers()
|
public ArrayList<Player> getDamagePlayers()
|
||||||
{
|
{
|
||||||
return _damage;
|
return _damage;
|
||||||
|
@ -0,0 +1,41 @@
|
|||||||
|
package nautilus.game.arcade.game.games.event.staffoscars;
|
||||||
|
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.entity.ArmorStand;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class ChairData
|
||||||
|
{
|
||||||
|
|
||||||
|
private Player _player;
|
||||||
|
private Block _block;
|
||||||
|
private ArmorStand _stand;
|
||||||
|
|
||||||
|
public ChairData(Player player, Block block)
|
||||||
|
{
|
||||||
|
_player = player;
|
||||||
|
_block = block;
|
||||||
|
_stand = block.getWorld().spawn(block.getLocation().add(0.5, -0.4, 0.5), ArmorStand.class);
|
||||||
|
|
||||||
|
_stand.setGravity(false);
|
||||||
|
_stand.setSmall(true);
|
||||||
|
_stand.setVisible(false);
|
||||||
|
_stand.setPassenger(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Player getPlayer()
|
||||||
|
{
|
||||||
|
return _player;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Block getBlock()
|
||||||
|
{
|
||||||
|
return _block;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArmorStand getStand()
|
||||||
|
{
|
||||||
|
return _stand;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,110 @@
|
|||||||
|
package nautilus.game.arcade.game.games.event.staffoscars;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilTime;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
import org.bukkit.Color;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.Sheep;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
public class RainbowSheep implements Listener
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final Color[] COLOURS = {
|
||||||
|
Color.RED, Color.ORANGE, Color.YELLOW, Color.LIME, Color.AQUA, Color.BLUE, Color.PURPLE
|
||||||
|
};
|
||||||
|
|
||||||
|
private final Set<Sheep> _sheep;
|
||||||
|
private Player _player;
|
||||||
|
private boolean _active;
|
||||||
|
private long _start;
|
||||||
|
|
||||||
|
public RainbowSheep()
|
||||||
|
{
|
||||||
|
_sheep = new HashSet<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void updateSpawn(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.FASTER || !_active)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (UtilTime.elapsed(_start, 5000))
|
||||||
|
{
|
||||||
|
for (Sheep sheep : _sheep)
|
||||||
|
{
|
||||||
|
sheep.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
_sheep.clear();
|
||||||
|
_active = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Vector direction = _player.getLocation().getDirection();
|
||||||
|
Vector left = UtilAlg.getLeft(direction).add(direction.clone().multiply(1.5));
|
||||||
|
Vector right = UtilAlg.getRight(direction).add(direction.clone().multiply(1.5));
|
||||||
|
|
||||||
|
spawnSheep(_player, direction);
|
||||||
|
spawnSheep(_player, left);
|
||||||
|
spawnSheep(_player, right);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void updateParticles(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Sheep sheep : _sheep)
|
||||||
|
{
|
||||||
|
UtilParticle.playColoredParticleToAll(COLOURS[UtilMath.r(COLOURS.length)], UtilParticle.ParticleType.RED_DUST, sheep.getLocation().add(0, 0.75, 0), 2, UtilParticle.ViewDist.LONGER);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void entityDamage(EntityDamageEvent event)
|
||||||
|
{
|
||||||
|
if (_sheep.contains(event.getEntity()))
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void spawnSheep(Player player, Vector vector)
|
||||||
|
{
|
||||||
|
Sheep sheep = player.getWorld().spawn(player.getEyeLocation(), Sheep.class);
|
||||||
|
|
||||||
|
sheep.setCustomName("jeb_");
|
||||||
|
sheep.setVelocity(vector);
|
||||||
|
|
||||||
|
_sheep.add(sheep);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActive(Player player)
|
||||||
|
{
|
||||||
|
_player = player;
|
||||||
|
_active = true;
|
||||||
|
_start = System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isActive()
|
||||||
|
{
|
||||||
|
return _active;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,257 @@
|
|||||||
|
package nautilus.game.arcade.game.games.event.staffoscars;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.*;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||||
|
import nautilus.game.arcade.game.Game;
|
||||||
|
import nautilus.game.arcade.game.modules.Module;
|
||||||
|
import org.bukkit.Color;
|
||||||
|
import org.bukkit.FireworkEffect;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.player.PlayerArmorStandManipulateEvent;
|
||||||
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||||
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
public class StaffOscarsModule extends Module
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final int MAX_X = 18;
|
||||||
|
|
||||||
|
private List<Location> _blocks;
|
||||||
|
private boolean _open;
|
||||||
|
private boolean _animate;
|
||||||
|
private int _x;
|
||||||
|
private Location _center;
|
||||||
|
|
||||||
|
private Set<ChairData> _chairs;
|
||||||
|
|
||||||
|
private List<Location> _fireworks;
|
||||||
|
|
||||||
|
private RainbowSheep _sheep;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setup()
|
||||||
|
{
|
||||||
|
_chairs = new HashSet<>();
|
||||||
|
_blocks = getGame().WorldData.GetCustomLocs(String.valueOf(Material.EMERALD_BLOCK.getId()));
|
||||||
|
_center = UtilAlg.getAverageLocation(_blocks);
|
||||||
|
_fireworks = getGame().WorldData.GetDataLocs("YELLOW");
|
||||||
|
_sheep = new RainbowSheep();
|
||||||
|
UtilServer.RegisterEvents(_sheep);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cleanup()
|
||||||
|
{
|
||||||
|
UtilServer.Unregister(_sheep);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void prepare(GameStateChangeEvent event)
|
||||||
|
{
|
||||||
|
if (event.GetState() != Game.GameState.Prepare)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Location location : _blocks)
|
||||||
|
{
|
||||||
|
MapUtil.QuickChangeBlockAt(location, Material.WOOL, (byte) 14);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void update(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.FAST || !_animate)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Location location : _blocks)
|
||||||
|
{
|
||||||
|
boolean in = UtilMath.offset2d(location, _center) < _x;
|
||||||
|
|
||||||
|
if (in && _open)
|
||||||
|
{
|
||||||
|
MapUtil.QuickChangeBlockAt(location, Material.AIR);
|
||||||
|
}
|
||||||
|
else if (!in && !_open)
|
||||||
|
{
|
||||||
|
MapUtil.QuickChangeBlockAt(location, Material.WOOL, (byte) 14);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_open)
|
||||||
|
{
|
||||||
|
_x++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_x--;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_open && _x == MAX_X || !_open && _x == -1)
|
||||||
|
{
|
||||||
|
_animate = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void curtainCommand(PlayerCommandPreprocessEvent event)
|
||||||
|
{
|
||||||
|
String message = event.getMessage();
|
||||||
|
|
||||||
|
if (message.startsWith("/curtain") && getGame().getArcadeManager().GetGameHostManager().isAdmin(event.getPlayer(), false))
|
||||||
|
{
|
||||||
|
_open = !_open;
|
||||||
|
_animate = true;
|
||||||
|
|
||||||
|
event.setCancelled(true);
|
||||||
|
event.getPlayer().sendMessage(F.main("Event", "Curtain open state = " + _open + "."));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void chairInteract(PlayerInteractEvent event)
|
||||||
|
{
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
Block block = event.getClickedBlock();
|
||||||
|
|
||||||
|
if (block == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (UtilBlock.usable(block))
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (block.getType() != Material.WOOD_STAIRS)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (ChairData data : _chairs)
|
||||||
|
{
|
||||||
|
if (data.getBlock().equals(block))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.getPlayer().equals(player))
|
||||||
|
{
|
||||||
|
handleDismount(player);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_chairs.add(new ChairData(player, block));
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void playerQuit(PlayerQuitEvent event)
|
||||||
|
{
|
||||||
|
handleDismount(event.getPlayer());
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void updateDismount(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.FAST)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Iterator<ChairData> iterator = _chairs.iterator();
|
||||||
|
|
||||||
|
while (iterator.hasNext())
|
||||||
|
{
|
||||||
|
ChairData data = iterator.next();
|
||||||
|
|
||||||
|
if (data.getPlayer().isInsideVehicle())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
data.getStand().remove();
|
||||||
|
iterator.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleDismount(Player player)
|
||||||
|
{
|
||||||
|
Iterator<ChairData> iterator = _chairs.iterator();
|
||||||
|
|
||||||
|
while (iterator.hasNext())
|
||||||
|
{
|
||||||
|
ChairData data = iterator.next();
|
||||||
|
|
||||||
|
if (!data.getPlayer().equals(player))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
data.getStand().remove();
|
||||||
|
iterator.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void armourStandEdit(PlayerArmorStandManipulateEvent event)
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void fireworksCommand(PlayerCommandPreprocessEvent event)
|
||||||
|
{
|
||||||
|
String message = event.getMessage();
|
||||||
|
|
||||||
|
if (message.startsWith("/firework") && getGame().getArcadeManager().GetGameHostManager().isAdmin(event.getPlayer(), false))
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
|
||||||
|
FireworkEffect fireworkEffect = FireworkEffect.builder().with(FireworkEffect.Type.BALL_LARGE).withColor(Color.YELLOW).build();
|
||||||
|
|
||||||
|
for (Location location : _fireworks)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
UtilFirework.launchFirework(location, fireworkEffect, null, UtilMath.r(3) + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void rainbowSheepCommand(PlayerCommandPreprocessEvent event)
|
||||||
|
{
|
||||||
|
String message = event.getMessage();
|
||||||
|
|
||||||
|
if (!message.startsWith("/deantm") || !getGame().getArcadeManager().GetGameHostManager().isAdmin(event.getPlayer(), false))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_sheep.isActive())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
event.setCancelled(true);
|
||||||
|
_sheep.setActive(event.getPlayer());
|
||||||
|
}
|
||||||
|
}
|
@ -773,4 +773,9 @@ public abstract class SuperSmash extends Game
|
|||||||
_lives.put(player, MAX_LIVES);
|
_lives.put(player, MAX_LIVES);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setNextPowerupTime(long time)
|
||||||
|
{
|
||||||
|
_nextPowerup = time;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2185,4 +2185,9 @@ public abstract class SurvivalGames extends Game
|
|||||||
return _spawn;
|
return _spawn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDeathMatchTime(int time)
|
||||||
|
{
|
||||||
|
_deathMatchTime = time;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,9 @@ public class PlayerHeadButton implements IButton
|
|||||||
|
|
||||||
int maxCap = _arcadeManager.GetGameHostManager().getMaxPlayerCap();
|
int maxCap = _arcadeManager.GetGameHostManager().getMaxPlayerCap();
|
||||||
|
|
||||||
|
if (_arcadeManager.GetGameHostManager().isEventServer())
|
||||||
|
maxCap = 120;
|
||||||
|
|
||||||
if (clickType.isLeftClick())
|
if (clickType.isLeftClick())
|
||||||
newMax = ++maxPlayers > maxCap ? maxCap : maxPlayers;
|
newMax = ++maxPlayers > maxCap ? maxCap : maxPlayers;
|
||||||
else
|
else
|
||||||
|
@ -1,24 +1,8 @@
|
|||||||
package nautilus.game.arcade.managers;
|
package nautilus.game.arcade.managers;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import java.util.Map;
|
||||||
import com.google.common.collect.Maps;
|
import java.util.UUID;
|
||||||
import mineplex.core.common.util.C;
|
|
||||||
import mineplex.core.common.util.F;
|
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
|
||||||
import mineplex.core.common.util.UtilServer;
|
|
||||||
import mineplex.core.progression.data.PlayerKit;
|
|
||||||
import mineplex.core.progression.gui.guis.KitDisplayMenu;
|
|
||||||
import mineplex.core.progression.math.Calculations;
|
|
||||||
import nautilus.game.arcade.ArcadeFormat;
|
|
||||||
import nautilus.game.arcade.ArcadeManager;
|
|
||||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
|
||||||
import nautilus.game.arcade.events.PlayerKitApplyEvent;
|
|
||||||
import nautilus.game.arcade.game.Game;
|
|
||||||
import nautilus.game.arcade.game.Game.GameState;
|
|
||||||
import nautilus.game.arcade.kit.ChampionsKit;
|
|
||||||
import nautilus.game.arcade.kit.Kit;
|
|
||||||
import nautilus.game.arcade.kit.KitProgressionData;
|
|
||||||
import nautilus.game.arcade.kit.ProgressingKit;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -31,8 +15,27 @@ import org.bukkit.event.player.PlayerQuitEvent;
|
|||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
|
||||||
import java.util.Map;
|
import com.google.common.collect.Lists;
|
||||||
import java.util.UUID;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.progression.data.PlayerKit;
|
||||||
|
import mineplex.core.progression.gui.guis.KitDisplayMenu;
|
||||||
|
import mineplex.core.progression.math.Calculations;
|
||||||
|
|
||||||
|
import nautilus.game.arcade.ArcadeFormat;
|
||||||
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||||
|
import nautilus.game.arcade.events.PlayerKitApplyEvent;
|
||||||
|
import nautilus.game.arcade.game.Game;
|
||||||
|
import nautilus.game.arcade.game.Game.GameState;
|
||||||
|
import nautilus.game.arcade.kit.ChampionsKit;
|
||||||
|
import nautilus.game.arcade.kit.Kit;
|
||||||
|
import nautilus.game.arcade.kit.KitProgressionData;
|
||||||
|
import nautilus.game.arcade.kit.ProgressingKit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages all things related to the ProgressingKit System for Arcade
|
* Manages all things related to the ProgressingKit System for Arcade
|
||||||
|
@ -24,6 +24,7 @@ import mineplex.core.donation.DonationManager;
|
|||||||
import mineplex.core.elo.EloManager;
|
import mineplex.core.elo.EloManager;
|
||||||
import mineplex.core.friend.FriendManager;
|
import mineplex.core.friend.FriendManager;
|
||||||
import mineplex.core.gadget.GadgetManager;
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.king.CastleManager;
|
||||||
import mineplex.core.give.Give;
|
import mineplex.core.give.Give;
|
||||||
import mineplex.core.hologram.HologramManager;
|
import mineplex.core.hologram.HologramManager;
|
||||||
import mineplex.core.ignore.IgnoreManager;
|
import mineplex.core.ignore.IgnoreManager;
|
||||||
@ -126,11 +127,12 @@ public class Hub extends JavaPlugin
|
|||||||
ServerConfiguration serverConfiguration = new ServerConfiguration(this, _clientManager);
|
ServerConfiguration serverConfiguration = new ServerConfiguration(this, _clientManager);
|
||||||
|
|
||||||
// Inventory
|
// Inventory
|
||||||
|
CastleManager castleManager = new CastleManager(this, _clientManager, hologramManager, false);
|
||||||
InventoryManager inventoryManager = new InventoryManager(this, _clientManager);
|
InventoryManager inventoryManager = new InventoryManager(this, _clientManager);
|
||||||
PetManager petManager = new PetManager(this, _clientManager, _donationManager, inventoryManager, disguiseManager, creature, blockRestore);
|
PetManager petManager = new PetManager(this, _clientManager, _donationManager, inventoryManager, disguiseManager, creature, blockRestore, castleManager);
|
||||||
MountManager mountManager = new MountManager(this, _clientManager, _donationManager, blockRestore, disguiseManager);
|
MountManager mountManager = new MountManager(this, _clientManager, _donationManager, blockRestore, disguiseManager);
|
||||||
GadgetManager gadgetManager = new GadgetManager(this, _clientManager, _donationManager, inventoryManager, mountManager, petManager,
|
GadgetManager gadgetManager = new GadgetManager(this, _clientManager, _donationManager, inventoryManager, mountManager, petManager,
|
||||||
preferenceManager, disguiseManager, blockRestore, projectileManager, achievementManager, packetHandler, hologramManager, incognito);
|
preferenceManager, disguiseManager, blockRestore, projectileManager, achievementManager, packetHandler, hologramManager, incognito, castleManager);
|
||||||
ThankManager thankManager = new ThankManager(this, _clientManager, _donationManager);
|
ThankManager thankManager = new ThankManager(this, _clientManager, _donationManager);
|
||||||
BoosterManager boosterManager = new BoosterManager(this, serverConfiguration.getServerGroup().getBoosterGroup(), _clientManager, _donationManager, inventoryManager, thankManager);
|
BoosterManager boosterManager = new BoosterManager(this, serverConfiguration.getServerGroup().getBoosterGroup(), _clientManager, _donationManager, inventoryManager, thankManager);
|
||||||
RewardManager rewardManager = new RewardManager(_clientManager, _donationManager, inventoryManager, petManager, gadgetManager, statsManager);
|
RewardManager rewardManager = new RewardManager(_clientManager, _donationManager, inventoryManager, petManager, gadgetManager, statsManager);
|
||||||
|
@ -1,18 +1,5 @@
|
|||||||
package mineplex.gemhunters;
|
package mineplex.gemhunters;
|
||||||
|
|
||||||
import mineplex.core.task.TaskManager;
|
|
||||||
import mineplex.core.texttutorial.TextTutorialManager;
|
|
||||||
import mineplex.gemhunters.join.JoinModule;
|
|
||||||
import mineplex.gemhunters.persistence.PersistenceModule;
|
|
||||||
import mineplex.gemhunters.tutorial.GemHuntersTutorial;
|
|
||||||
import net.minecraft.server.v1_8_R3.MinecraftServer;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.World;
|
|
||||||
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
|
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
|
||||||
import org.spigotmc.SpigotConfig;
|
|
||||||
|
|
||||||
import mineplex.core.CustomTagFix;
|
import mineplex.core.CustomTagFix;
|
||||||
import mineplex.core.FoodDupeFix;
|
import mineplex.core.FoodDupeFix;
|
||||||
import mineplex.core.TimingsFix;
|
import mineplex.core.TimingsFix;
|
||||||
@ -40,6 +27,7 @@ import mineplex.core.elo.EloManager;
|
|||||||
import mineplex.core.explosion.Explosion;
|
import mineplex.core.explosion.Explosion;
|
||||||
import mineplex.core.friend.FriendManager;
|
import mineplex.core.friend.FriendManager;
|
||||||
import mineplex.core.gadget.GadgetManager;
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.king.CastleManager;
|
||||||
import mineplex.core.give.Give;
|
import mineplex.core.give.Give;
|
||||||
import mineplex.core.hologram.HologramManager;
|
import mineplex.core.hologram.HologramManager;
|
||||||
import mineplex.core.ignore.IgnoreManager;
|
import mineplex.core.ignore.IgnoreManager;
|
||||||
@ -67,7 +55,9 @@ import mineplex.core.report.ReportPlugin;
|
|||||||
import mineplex.core.serverConfig.ServerConfiguration;
|
import mineplex.core.serverConfig.ServerConfiguration;
|
||||||
import mineplex.core.stats.StatsManager;
|
import mineplex.core.stats.StatsManager;
|
||||||
import mineplex.core.status.ServerStatusManager;
|
import mineplex.core.status.ServerStatusManager;
|
||||||
|
import mineplex.core.task.TaskManager;
|
||||||
import mineplex.core.teleport.Teleport;
|
import mineplex.core.teleport.Teleport;
|
||||||
|
import mineplex.core.texttutorial.TextTutorialManager;
|
||||||
import mineplex.core.thank.ThankManager;
|
import mineplex.core.thank.ThankManager;
|
||||||
import mineplex.core.twofactor.TwoFactorAuth;
|
import mineplex.core.twofactor.TwoFactorAuth;
|
||||||
import mineplex.core.updater.FileUpdater;
|
import mineplex.core.updater.FileUpdater;
|
||||||
@ -80,11 +70,13 @@ import mineplex.gemhunters.death.DeathModule;
|
|||||||
import mineplex.gemhunters.death.quitnpc.QuitNPCModule;
|
import mineplex.gemhunters.death.quitnpc.QuitNPCModule;
|
||||||
import mineplex.gemhunters.economy.CashOutModule;
|
import mineplex.gemhunters.economy.CashOutModule;
|
||||||
import mineplex.gemhunters.economy.EconomyModule;
|
import mineplex.gemhunters.economy.EconomyModule;
|
||||||
|
import mineplex.gemhunters.join.JoinModule;
|
||||||
import mineplex.gemhunters.loot.InventoryModule;
|
import mineplex.gemhunters.loot.InventoryModule;
|
||||||
import mineplex.gemhunters.loot.LootModule;
|
import mineplex.gemhunters.loot.LootModule;
|
||||||
import mineplex.gemhunters.map.ItemMapModule;
|
import mineplex.gemhunters.map.ItemMapModule;
|
||||||
import mineplex.gemhunters.moderation.ModerationModule;
|
import mineplex.gemhunters.moderation.ModerationModule;
|
||||||
import mineplex.gemhunters.mount.MountModule;
|
import mineplex.gemhunters.mount.MountModule;
|
||||||
|
import mineplex.gemhunters.persistence.PersistenceModule;
|
||||||
import mineplex.gemhunters.playerstatus.PlayerStatusModule;
|
import mineplex.gemhunters.playerstatus.PlayerStatusModule;
|
||||||
import mineplex.gemhunters.quest.QuestModule;
|
import mineplex.gemhunters.quest.QuestModule;
|
||||||
import mineplex.gemhunters.safezone.SafezoneModule;
|
import mineplex.gemhunters.safezone.SafezoneModule;
|
||||||
@ -92,6 +84,7 @@ import mineplex.gemhunters.scoreboard.ScoreboardModule;
|
|||||||
import mineplex.gemhunters.shop.ShopModule;
|
import mineplex.gemhunters.shop.ShopModule;
|
||||||
import mineplex.gemhunters.spawn.SpawnModule;
|
import mineplex.gemhunters.spawn.SpawnModule;
|
||||||
import mineplex.gemhunters.supplydrop.SupplyDropModule;
|
import mineplex.gemhunters.supplydrop.SupplyDropModule;
|
||||||
|
import mineplex.gemhunters.tutorial.GemHuntersTutorial;
|
||||||
import mineplex.gemhunters.world.DebugListeners;
|
import mineplex.gemhunters.world.DebugListeners;
|
||||||
import mineplex.gemhunters.world.TimeCycle;
|
import mineplex.gemhunters.world.TimeCycle;
|
||||||
import mineplex.gemhunters.world.UndergroundMobs;
|
import mineplex.gemhunters.world.UndergroundMobs;
|
||||||
@ -100,6 +93,12 @@ import mineplex.gemhunters.worldevent.WorldEventModule;
|
|||||||
import mineplex.minecraft.game.core.combat.CombatManager;
|
import mineplex.minecraft.game.core.combat.CombatManager;
|
||||||
import mineplex.minecraft.game.core.condition.ConditionManager;
|
import mineplex.minecraft.game.core.condition.ConditionManager;
|
||||||
import mineplex.minecraft.game.core.damage.DamageManager;
|
import mineplex.minecraft.game.core.damage.DamageManager;
|
||||||
|
import net.minecraft.server.v1_8_R3.MinecraftServer;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import org.spigotmc.SpigotConfig;
|
||||||
|
|
||||||
import static mineplex.core.Managers.require;
|
import static mineplex.core.Managers.require;
|
||||||
|
|
||||||
@ -253,10 +252,11 @@ public class GemHunters extends JavaPlugin
|
|||||||
|
|
||||||
// Gadgets, used for mounts, lots of managers for something really small
|
// Gadgets, used for mounts, lots of managers for something really small
|
||||||
// :(
|
// :(
|
||||||
|
CastleManager castleManager = new CastleManager(this, clientManager, hologramManager, false);
|
||||||
MountManager mountManager = new MountManager(this, clientManager, donationManager, blockRestore, disguiseManager);
|
MountManager mountManager = new MountManager(this, clientManager, donationManager, blockRestore, disguiseManager);
|
||||||
PetManager petManager = new PetManager(this, clientManager, donationManager, inventoryManager, disguiseManager, creature, blockRestore);
|
PetManager petManager = new PetManager(this, clientManager, donationManager, inventoryManager, disguiseManager, creature, blockRestore, castleManager);
|
||||||
ProjectileManager projectileManager = new ProjectileManager(this);
|
ProjectileManager projectileManager = new ProjectileManager(this);
|
||||||
GadgetManager gadgetManager = new GadgetManager(this, clientManager, donationManager, inventoryManager, mountManager, petManager, preferenceManager, disguiseManager, blockRestore, projectileManager, achievementManager, packetHandler, hologramManager, incognito);
|
GadgetManager gadgetManager = new GadgetManager(this, clientManager, donationManager, inventoryManager, mountManager, petManager, preferenceManager, disguiseManager, blockRestore, projectileManager, achievementManager, packetHandler, hologramManager, incognito, castleManager);
|
||||||
ThankManager thankManager = new ThankManager(this, clientManager, donationManager);
|
ThankManager thankManager = new ThankManager(this, clientManager, donationManager);
|
||||||
BoosterManager boosterManager = new BoosterManager(this, null, clientManager, donationManager, inventoryManager, thankManager);
|
BoosterManager boosterManager = new BoosterManager(this, null, clientManager, donationManager, inventoryManager, thankManager);
|
||||||
CosmeticManager cosmeticManager = new CosmeticManager(this, clientManager, donationManager, inventoryManager, gadgetManager, mountManager, petManager, null, boosterManager);
|
CosmeticManager cosmeticManager = new CosmeticManager(this, clientManager, donationManager, inventoryManager, gadgetManager, mountManager, petManager, null, boosterManager);
|
||||||
|
Loading…
Reference in New Issue
Block a user