Merge remote-tracking branch 'refs/remotes/origin/develop' into update/ssm
This commit is contained in:
commit
6d4a68acdf
@ -1,6 +1,7 @@
|
||||
package mineplex.core.common;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
@ -10,45 +11,46 @@ import mineplex.core.common.util.UtilPlayer;
|
||||
public enum Rank
|
||||
{
|
||||
//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),
|
||||
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),
|
||||
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),
|
||||
ADMIN("Admin", "adm", ChatColor.DARK_RED, "An Administrator’s role is to manage \ntheir respective Senior Moderator team \nand all moderators within it.", 10),
|
||||
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),
|
||||
SUPPORT("Support", "spp", ChatColor.BLUE, "Support agents handle tickets and \nprovide customer service.", 47),
|
||||
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),
|
||||
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),
|
||||
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),
|
||||
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),
|
||||
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),
|
||||
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),
|
||||
MAPDEV("Builder", "mapd", ChatColor.BLUE, "Builders are members of the Mineplex Build Team. \nThey create many of the maps used across Mineplex.", 26),
|
||||
MEDIA("Media", "media", ChatColor.BLUE, "The Media rank is given to talented artists who are\n endorsed to create content for Mineplex.", -1),
|
||||
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, 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, 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, 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, DyeColor.ORANGE),
|
||||
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, DyeColor.ORANGE),
|
||||
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),
|
||||
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),
|
||||
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),
|
||||
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),
|
||||
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),
|
||||
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
|
||||
YOUTUBE("YouTube", "yt", ChatColor.RED, "A YouTuber who creates content for \nor related to Mineplex.", 22),
|
||||
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),
|
||||
TWITCH("Twitch", "tw", ChatColor.DARK_PURPLE, "A Twitch streamer who often features \nMineplex in their streams.", 21),
|
||||
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, DyeColor.PURPLE),
|
||||
TWITCH("Twitch", "tw", ChatColor.DARK_PURPLE, "A Twitch streamer who often features \nMineplex in their streams.", 21, DyeColor.PURPLE),
|
||||
|
||||
//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),
|
||||
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),
|
||||
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),
|
||||
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),
|
||||
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),
|
||||
ALL("", "", ChatColor.WHITE, null, -1);
|
||||
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, 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, 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, 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, DyeColor.LIGHT_BLUE),
|
||||
ALL("", "", ChatColor.WHITE, null, -1, DyeColor.WHITE);
|
||||
|
||||
private ChatColor _color;
|
||||
private boolean _donor;
|
||||
private String _description;
|
||||
private int _forumId;
|
||||
private DyeColor _dyeColor;
|
||||
|
||||
public String Name;
|
||||
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;
|
||||
Name = name;
|
||||
@ -56,9 +58,10 @@ public enum Rank
|
||||
_description = description;
|
||||
ScoreboardTag = scoreboardTag;
|
||||
_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;
|
||||
Name = name;
|
||||
@ -66,6 +69,7 @@ public enum Rank
|
||||
_description = description;
|
||||
ScoreboardTag = scoreboardTag;
|
||||
_forumId = forumId;
|
||||
_dyeColor = dyeColor;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
@ -152,4 +156,9 @@ public enum Rank
|
||||
{
|
||||
return _forumId;
|
||||
}
|
||||
|
||||
public DyeColor getDyeColor()
|
||||
{
|
||||
return _dyeColor;
|
||||
}
|
||||
}
|
||||
|
@ -151,14 +151,32 @@ 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
|
||||
*/
|
||||
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 Vector _offsetData;
|
||||
private float _speed;
|
||||
|
@ -231,7 +231,6 @@ public class UtilAlg
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public static boolean inBoundingBox(Location loc, Vector cornerA, Vector cornerB)
|
||||
{
|
||||
|
@ -167,6 +167,8 @@ import mineplex.core.gadget.gadgets.particle.ParticleChristmasTree;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleCoalFumes;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleFairy;
|
||||
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.spring.ParticleSpringHalo;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleWingsAngel;
|
||||
@ -267,6 +269,7 @@ public class GadgetManager extends MiniPlugin
|
||||
private final IncognitoManager _incognitoManager;
|
||||
private TreasureManager _treasureManager;
|
||||
private SoulManager _soulManager;
|
||||
private CastleManager _castleManager;
|
||||
|
||||
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,
|
||||
MountManager mountManager, PetManager petManager, PreferencesManager preferencesManager,
|
||||
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);
|
||||
|
||||
@ -306,6 +309,7 @@ public class GadgetManager extends MiniPlugin
|
||||
_boosterManager = new OutfitWindUpSuitBoosterManager(this);
|
||||
_incognitoManager = incognitoManager;
|
||||
_soulManager = new SoulManager();
|
||||
_castleManager = castleManager;
|
||||
|
||||
createGadgets();
|
||||
createSets();
|
||||
@ -369,8 +373,6 @@ public class GadgetManager extends MiniPlugin
|
||||
addGadget(new ItemBow(this));
|
||||
addGadget(new ItemLovePotion(this));
|
||||
addGadget(new ItemFlowerGift(this));
|
||||
// NEXT MONTH'S PPC
|
||||
//addGadget(new ItemBubbleBlaster(this));
|
||||
|
||||
// Costume
|
||||
addGadget(new OutfitRaveSuitHelmet(this));
|
||||
@ -461,6 +463,7 @@ public class GadgetManager extends MiniPlugin
|
||||
addGadget(new ParticleWingsLove(this));
|
||||
addGadget(new ParticleSpringHalo(this));
|
||||
addGadget(new ParticleWingsBee(this));
|
||||
addGadget(new ParticleKing(this, _castleManager));
|
||||
|
||||
// Arrow Trails
|
||||
addGadget(new ArrowTrailFrostLord(this));
|
||||
@ -1407,4 +1410,9 @@ public class GadgetManager extends MiniPlugin
|
||||
taunt.start(player);
|
||||
}
|
||||
|
||||
public CastleManager getCastleManager()
|
||||
{
|
||||
return _castleManager;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,16 @@
|
||||
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.F;
|
||||
import mineplex.core.common.util.LineFormat;
|
||||
@ -20,16 +31,6 @@ import mineplex.core.preferences.Preference;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
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
|
||||
{
|
||||
@ -94,6 +95,13 @@ public class ItemBatGun extends ItemGadget
|
||||
{
|
||||
if (!bat.isValid())
|
||||
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);
|
||||
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)
|
||||
return;
|
||||
|
||||
if (Manager.getCastleManager().isInsideCastle(target.getLocation()))
|
||||
return;
|
||||
|
||||
//Pull
|
||||
UtilAction.velocity(target,
|
||||
UtilAlg.getTrajectory(target.getLocation(), player.getLocation()),
|
||||
|
@ -74,7 +74,7 @@ public class ItemMelonLauncher extends ItemGadget implements IThrown
|
||||
{
|
||||
if (target != null)
|
||||
{
|
||||
if (!(target instanceof ArmorStand))
|
||||
if (!(target instanceof ArmorStand) && !Manager.getCastleManager().isInsideCastle(target.getLocation()))
|
||||
{
|
||||
//Push
|
||||
UtilAction.velocity(target,
|
||||
|
@ -67,7 +67,10 @@ public class ItemTNT extends ItemGadget
|
||||
{
|
||||
if (Manager.collideEvent(killer, this, player))
|
||||
continue;
|
||||
|
||||
|
||||
if (Manager.getCastleManager().isInsideCastle(player.getLocation()))
|
||||
continue;
|
||||
|
||||
double mult = players.get(player);
|
||||
|
||||
//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;
|
||||
}
|
||||
|
||||
}
|
@ -56,7 +56,14 @@ public class MusicGadget extends Gadget
|
||||
UtilPlayer.message(player, F.main("Music", "There is already a song playing."));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Inside castle
|
||||
if (Manager.getCastleManager().isInsideCastle(player.getLocation()))
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Music", "Cannot play songs inside the Castle."));
|
||||
return;
|
||||
}
|
||||
|
||||
//Near Portal
|
||||
for (Block block : UtilBlock.getInRadius(player.getLocation(), 3).keySet())
|
||||
{
|
||||
|
@ -25,9 +25,10 @@ public class CircleEffect extends Effect
|
||||
private int _maxCircles = -1;
|
||||
private int _totalCircles = 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 int PARTICLES_PER_CIRCLE = 20;
|
||||
|
||||
public CircleEffect(JavaPlugin plugin, Location location, double radius, Color color)
|
||||
{
|
||||
@ -50,6 +51,18 @@ public class CircleEffect extends Effect
|
||||
_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)
|
||||
{
|
||||
_randomColors.add(color);
|
||||
@ -65,15 +78,20 @@ public class CircleEffect extends Effect
|
||||
_yOffset = yOffset;
|
||||
}
|
||||
|
||||
public void setInfinite(boolean infinite)
|
||||
{
|
||||
_infinite = infinite;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void runEffect()
|
||||
{
|
||||
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);
|
||||
double increment = (2 * Math.PI) / PARTICLES_PER_CIRCLE;
|
||||
double increment = (2 * Math.PI) / _particles;
|
||||
double angle = _steps * increment;
|
||||
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));
|
||||
@ -89,7 +107,8 @@ public class CircleEffect extends Effect
|
||||
}
|
||||
_steps++;
|
||||
}
|
||||
stop();
|
||||
if (!_infinite)
|
||||
stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -102,7 +121,7 @@ public class CircleEffect extends Effect
|
||||
}
|
||||
}
|
||||
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;
|
||||
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));
|
||||
@ -117,7 +136,7 @@ public class CircleEffect extends Effect
|
||||
}
|
||||
}
|
||||
_steps++;
|
||||
if (_steps >= PARTICLES_PER_CIRCLE)
|
||||
if (_steps >= _particles)
|
||||
{
|
||||
_totalCircles++;
|
||||
_steps = 0;
|
||||
|
@ -70,6 +70,7 @@ import mineplex.core.disguise.disguises.DisguiseVillager;
|
||||
import mineplex.core.disguise.disguises.DisguiseWither;
|
||||
import mineplex.core.disguise.disguises.DisguiseZombie;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.gadget.gadgets.particle.king.CastleManager;
|
||||
import mineplex.core.inventory.InventoryManager;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.pet.repository.PetRepository;
|
||||
@ -96,6 +97,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
||||
private DonationManager _donationManager;
|
||||
private CoreClientManager _clientManager;
|
||||
private InventoryManager _inventoryManager;
|
||||
private CastleManager _castleManager;
|
||||
|
||||
private Map<Entity, FlyingPetManager> _flyingPets = 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);
|
||||
|
||||
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);
|
||||
|
||||
@ -213,6 +216,12 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
||||
return;
|
||||
}
|
||||
|
||||
if (_castleManager.isInsideCastle(location))
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Pets", "You cannot spawn a pet inside the castle!"));
|
||||
return;
|
||||
}
|
||||
|
||||
Entity pet;
|
||||
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.MARCH), new UnknownSalesPackageItem("Gold Pot Morph"))
|
||||
.put(YearMonth.of(2017, Month.APRIL), new UnknownSalesPackageItem("Bumblebee's Wings"))
|
||||
.put(YearMonth.of(2017, Month.MAY), new UnknownSalesPackageItem("King"))
|
||||
.build();
|
||||
|
||||
public interface PowerPlayClubItem
|
||||
|
@ -23,6 +23,7 @@ import mineplex.core.disguise.DisguiseManager;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.elo.EloManager;
|
||||
import mineplex.core.friend.FriendManager;
|
||||
import mineplex.core.gadget.gadgets.particle.king.CastleManager;
|
||||
import mineplex.core.give.Give;
|
||||
import mineplex.core.globalpacket.GlobalPacketManager;
|
||||
import mineplex.core.hologram.HologramManager;
|
||||
@ -120,7 +121,9 @@ public class ClansHub extends JavaPlugin
|
||||
Creature creature = new Creature(this);
|
||||
NpcManager npcManager = new NpcManager(this, creature);
|
||||
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);
|
||||
|
||||
//Main Modules
|
||||
@ -153,8 +156,6 @@ public class ClansHub extends JavaPlugin
|
||||
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);
|
||||
|
||||
HologramManager hologramManager = new HologramManager(this, packetHandler);
|
||||
|
||||
ClansTransferManager serverManager = new ClansTransferManager(this, clientManager, donationManager, partyManager, portal, hubManager);
|
||||
|
||||
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.event.GadgetCollideEntityEvent;
|
||||
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.GadgetType;
|
||||
import mineplex.core.hologram.HologramManager;
|
||||
@ -194,7 +195,8 @@ public class HubManager extends MiniPlugin implements IChatMessageFormatter
|
||||
_inventoryManager = 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);
|
||||
YoutubeManager youtubeManager = new YoutubeManager(plugin, clientManager, donationManager);
|
||||
|
@ -1,8 +1,5 @@
|
||||
package mineplex.hub;
|
||||
|
||||
import static mineplex.core.Managers.require;
|
||||
|
||||
import mineplex.hub.modules.AprilFoolsTreasureHunt;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -34,6 +31,7 @@ import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.elo.EloManager;
|
||||
import mineplex.core.energy.Energy;
|
||||
import mineplex.core.friend.FriendManager;
|
||||
import mineplex.core.gadget.gadgets.particle.king.CastleManager;
|
||||
import mineplex.core.give.Give;
|
||||
import mineplex.core.globalpacket.GlobalPacketManager;
|
||||
import mineplex.core.hologram.HologramManager;
|
||||
@ -79,6 +77,7 @@ import mineplex.core.updater.Updater;
|
||||
import mineplex.core.velocity.VelocityFix;
|
||||
import mineplex.core.visibility.VisibilityManager;
|
||||
import mineplex.core.website.WebsiteLinkManager;
|
||||
import mineplex.hub.modules.AprilFoolsTreasureHunt;
|
||||
import mineplex.hub.modules.BillboardManager;
|
||||
import mineplex.hub.queue.QueueManager;
|
||||
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.fire.Fire;
|
||||
|
||||
import static mineplex.core.Managers.require;
|
||||
|
||||
public class Hub extends JavaPlugin implements IRelation
|
||||
{
|
||||
private NpcManager _npcManager;
|
||||
@ -138,12 +139,15 @@ public class Hub extends JavaPlugin implements IRelation
|
||||
|
||||
incognito.setPreferencesManager(preferenceManager);
|
||||
|
||||
HologramManager hologramManager = new HologramManager(this, packetHandler);
|
||||
|
||||
preferenceManager.GiveItem = true;
|
||||
Creature creature = new Creature(this);
|
||||
NpcManager npcManager = new NpcManager(this, creature);
|
||||
_npcManager = npcManager;
|
||||
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);
|
||||
//new TournamentManager(this, clientManager, donationManager);
|
||||
|
||||
@ -180,8 +184,7 @@ public class Hub extends JavaPlugin implements IRelation
|
||||
String boosterGroup = serverConfiguration.getServerGroup().getBoosterGroup();
|
||||
ThankManager thankManager = new ThankManager(this, clientManager, donationManager);
|
||||
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);
|
||||
HologramManager hologramManager = new HologramManager(this, packetHandler);
|
||||
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);
|
||||
|
||||
QueueManager queueManager = new QueueManager(this, clientManager, donationManager, eloManager, partyManager);
|
||||
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.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.ChatColor;
|
||||
import org.bukkit.GameMode;
|
||||
@ -69,6 +76,7 @@ import mineplex.core.donation.Donor;
|
||||
import mineplex.core.facebook.FacebookManager;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.event.GadgetCollideEntityEvent;
|
||||
import mineplex.core.gadget.gadgets.particle.king.CastleManager;
|
||||
import mineplex.core.hologram.HologramManager;
|
||||
import mineplex.core.incognito.IncognitoManager;
|
||||
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.event.CombatDeathEvent;
|
||||
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
|
||||
{
|
||||
@ -188,7 +190,7 @@ public class HubManager extends MiniClientPlugin<HubClient> implements IChatMess
|
||||
|
||||
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);
|
||||
|
||||
@ -222,7 +224,7 @@ public class HubManager extends MiniClientPlugin<HubClient> implements IChatMess
|
||||
_mountManager = new MountManager(_plugin, clientManager, donationManager, blockRestore, _disguiseManager);
|
||||
_inventoryManager = 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);
|
||||
YoutubeManager youtubeManager = new YoutubeManager(plugin, clientManager, donationManager);
|
||||
|
@ -3,7 +3,6 @@ package nautilus.game.arcade;
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
|
||||
import mineplex.core.aprilfools.AprilFoolsManager;
|
||||
import net.minecraft.server.v1_8_R3.MinecraftServer;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
@ -24,6 +23,7 @@ import mineplex.core.achievement.AchievementManager;
|
||||
import mineplex.core.antihack.AntiHack;
|
||||
import mineplex.core.antihack.RelationProvider;
|
||||
import mineplex.core.antihack.logging.AntihackLogger;
|
||||
import mineplex.core.aprilfools.AprilFoolsManager;
|
||||
import mineplex.core.blockrestore.BlockRestore;
|
||||
import mineplex.core.blood.Blood;
|
||||
import mineplex.core.boosters.BoosterManager;
|
||||
@ -44,6 +44,7 @@ import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.elo.EloManager;
|
||||
import mineplex.core.friend.FriendManager;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.gadgets.particle.king.CastleManager;
|
||||
import mineplex.core.give.Give;
|
||||
import mineplex.core.globalpacket.GlobalPacketManager;
|
||||
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.game.Game;
|
||||
import nautilus.game.arcade.game.GameServerConfig;
|
||||
|
||||
import static mineplex.core.Managers.require;
|
||||
|
||||
public class Arcade extends JavaPlugin
|
||||
@ -199,9 +201,10 @@ public class Arcade extends JavaPlugin
|
||||
|
||||
//Inventory
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
|
@ -254,7 +254,7 @@ public abstract class Game extends ListenerComponent implements Lifetimed
|
||||
public long PrepareTime = 9000;
|
||||
public boolean PlaySoundGameStart = true;
|
||||
|
||||
public double XpMult = 2;
|
||||
public double XpMult = 1;
|
||||
|
||||
public boolean SpeedMeasurement = false;
|
||||
|
||||
|
@ -1,24 +1,8 @@
|
||||
package nautilus.game.arcade.managers;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
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;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -31,8 +15,27 @@ import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import com.google.common.collect.Lists;
|
||||
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
|
||||
|
@ -24,6 +24,7 @@ import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.elo.EloManager;
|
||||
import mineplex.core.friend.FriendManager;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.gadgets.particle.king.CastleManager;
|
||||
import mineplex.core.give.Give;
|
||||
import mineplex.core.hologram.HologramManager;
|
||||
import mineplex.core.ignore.IgnoreManager;
|
||||
@ -126,11 +127,12 @@ public class Hub extends JavaPlugin
|
||||
ServerConfiguration serverConfiguration = new ServerConfiguration(this, _clientManager);
|
||||
|
||||
// Inventory
|
||||
CastleManager castleManager = new CastleManager(this, _clientManager, hologramManager, false);
|
||||
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);
|
||||
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);
|
||||
BoosterManager boosterManager = new BoosterManager(this, serverConfiguration.getServerGroup().getBoosterGroup(), _clientManager, _donationManager, inventoryManager, thankManager);
|
||||
RewardManager rewardManager = new RewardManager(_clientManager, _donationManager, inventoryManager, petManager, gadgetManager, statsManager);
|
||||
|
@ -1,6 +1,5 @@
|
||||
package mineplex.gemhunters;
|
||||
|
||||
import mineplex.core.aprilfools.AprilFoolsManager;
|
||||
import net.minecraft.server.v1_8_R3.MinecraftServer;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
@ -15,6 +14,7 @@ import mineplex.core.TimingsFix;
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.achievement.AchievementManager;
|
||||
import mineplex.core.antihack.AntiHack;
|
||||
import mineplex.core.aprilfools.AprilFoolsManager;
|
||||
import mineplex.core.beta.BetaWhitelist;
|
||||
import mineplex.core.blockrestore.BlockRestore;
|
||||
import mineplex.core.boosters.BoosterManager;
|
||||
@ -36,6 +36,7 @@ import mineplex.core.elo.EloManager;
|
||||
import mineplex.core.explosion.Explosion;
|
||||
import mineplex.core.friend.FriendManager;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.gadgets.particle.king.CastleManager;
|
||||
import mineplex.core.give.Give;
|
||||
import mineplex.core.hologram.HologramManager;
|
||||
import mineplex.core.ignore.IgnoreManager;
|
||||
@ -249,10 +250,11 @@ public class GemHunters extends JavaPlugin
|
||||
|
||||
// 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);
|
||||
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);
|
||||
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);
|
||||
BoosterManager boosterManager = new BoosterManager(this, null, clientManager, donationManager, inventoryManager, thankManager);
|
||||
CosmeticManager cosmeticManager = new CosmeticManager(this, clientManager, donationManager, inventoryManager, gadgetManager, mountManager, petManager, null, boosterManager);
|
||||
|
Loading…
Reference in New Issue
Block a user