Hub Parkour update
Smash kit prices
This commit is contained in:
parent
02dd579844
commit
313f675ae4
@ -119,4 +119,18 @@ public class UtilAlg
|
|||||||
{
|
{
|
||||||
return list.get(UtilMath.r(list.size()));
|
return list.get(UtilMath.r(list.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean inBoundingBox(Location loc, Location cornerA, Location cornerB)
|
||||||
|
{
|
||||||
|
if (loc.getX() < Math.min(cornerA.getX(), cornerB.getX())) return false;
|
||||||
|
if (loc.getX() > Math.max(cornerA.getX(), cornerB.getX())) return false;
|
||||||
|
|
||||||
|
if (loc.getY() < Math.min(cornerA.getY(), cornerB.getY())) return false;
|
||||||
|
if (loc.getY() > Math.max(cornerA.getY(), cornerB.getY())) return false;
|
||||||
|
|
||||||
|
if (loc.getZ() < Math.min(cornerA.getZ(), cornerB.getZ())) return false;
|
||||||
|
if (loc.getZ() > Math.max(cornerA.getZ(), cornerB.getZ())) return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -181,6 +181,17 @@ public class GadgetManager extends MiniPlugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void DisableAll(Player player)
|
||||||
|
{
|
||||||
|
for (GadgetType gadgetType : _gadgets.keySet())
|
||||||
|
{
|
||||||
|
for (Gadget gadget : _gadgets.get(gadgetType))
|
||||||
|
{
|
||||||
|
gadget.Disable(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public PetManager getPetManager()
|
public PetManager getPetManager()
|
||||||
{
|
{
|
||||||
return _petManager;
|
return _petManager;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package mineplex.core.gadget.event;
|
package mineplex.core.gadget.event;
|
||||||
|
|
||||||
import mineplex.core.gadget.types.Gadget;
|
import mineplex.core.gadget.types.Gadget;
|
||||||
|
import mineplex.core.mount.Mount;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
@ -12,9 +13,16 @@ public class GadgetActivateEvent extends Event
|
|||||||
|
|
||||||
private Player _player;
|
private Player _player;
|
||||||
private Gadget _gadget;
|
private Gadget _gadget;
|
||||||
|
private Mount _mount;
|
||||||
|
|
||||||
private boolean _cancelled = false;
|
private boolean _cancelled = false;
|
||||||
|
|
||||||
|
public GadgetActivateEvent(Player player, Mount mount)
|
||||||
|
{
|
||||||
|
_player = player;
|
||||||
|
_mount = mount;
|
||||||
|
}
|
||||||
|
|
||||||
public GadgetActivateEvent(Player player, Gadget gadget)
|
public GadgetActivateEvent(Player player, Gadget gadget)
|
||||||
{
|
{
|
||||||
_player = player;
|
_player = player;
|
||||||
@ -36,6 +44,11 @@ public class GadgetActivateEvent extends Event
|
|||||||
return _gadget;
|
return _gadget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Mount getMount()
|
||||||
|
{
|
||||||
|
return _mount;
|
||||||
|
}
|
||||||
|
|
||||||
public Player getPlayer()
|
public Player getPlayer()
|
||||||
{
|
{
|
||||||
return _player;
|
return _player;
|
||||||
|
@ -139,13 +139,4 @@ public class MorphChicken extends MorphGadget
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void HeroOwner(PlayerJoinEvent event)
|
|
||||||
{
|
|
||||||
if (Manager.getClientManager().Get(event.getPlayer()).GetRank().Has(Rank.HERO))
|
|
||||||
{
|
|
||||||
Manager.getDonationManager().Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(GetName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,8 @@ public class MorphCreeper extends MorphGadget
|
|||||||
C.cWhite + "Transforms the wearer into a creepy Creeper!",
|
C.cWhite + "Transforms the wearer into a creepy Creeper!",
|
||||||
" ",
|
" ",
|
||||||
C.cYellow + "Crouch" + C.cGray + " to use " + C.cGreen + "Detonate",
|
C.cYellow + "Crouch" + C.cGray + " to use " + C.cGreen + "Detonate",
|
||||||
|
" ",
|
||||||
|
C.cPurple + "Unlocked with Hero Rank",
|
||||||
},
|
},
|
||||||
-1,
|
-1,
|
||||||
ArmorSlot.Helmet, Material.SKULL_ITEM, (byte)4);
|
ArmorSlot.Helmet, Material.SKULL_ITEM, (byte)4);
|
||||||
|
@ -3,9 +3,13 @@ package mineplex.core.gadget.types;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
import mineplex.core.common.CurrencyType;
|
import mineplex.core.common.CurrencyType;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.gadget.GadgetManager;
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.event.GadgetActivateEvent;
|
||||||
import mineplex.core.shop.item.SalesPackageBase;
|
import mineplex.core.shop.item.SalesPackageBase;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -55,6 +59,15 @@ public abstract class Gadget extends SalesPackageBase implements Listener
|
|||||||
|
|
||||||
public void Enable(Player player)
|
public void Enable(Player player)
|
||||||
{
|
{
|
||||||
|
GadgetActivateEvent gadgetEvent = new GadgetActivateEvent(player, this);
|
||||||
|
Bukkit.getServer().getPluginManager().callEvent(gadgetEvent);
|
||||||
|
|
||||||
|
if (gadgetEvent.isCancelled())
|
||||||
|
{
|
||||||
|
UtilPlayer.message(player, F.main("Inventory", "You cannot use Inventory Items."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Manager.setActive(player, this);
|
Manager.setActive(player, this);
|
||||||
EnableCustom(player);
|
EnableCustom(player);
|
||||||
}
|
}
|
||||||
|
@ -122,12 +122,6 @@ public abstract class ItemGadget extends Gadget
|
|||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
||||||
GadgetActivateEvent gadgetEvent = new GadgetActivateEvent(player, this);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(gadgetEvent);
|
|
||||||
|
|
||||||
if (gadgetEvent.isCancelled())
|
|
||||||
return;
|
|
||||||
|
|
||||||
//Recharge
|
//Recharge
|
||||||
if (!Recharge.Instance.use(player, GetName(), _recharge, _recharge > 1000, false))
|
if (!Recharge.Instance.use(player, GetName(), _recharge, _recharge > 1000, false))
|
||||||
return;
|
return;
|
||||||
|
@ -3,6 +3,7 @@ package mineplex.core.mount;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -11,6 +12,9 @@ import org.bukkit.event.player.PlayerJoinEvent;
|
|||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
|
||||||
import mineplex.core.common.CurrencyType;
|
import mineplex.core.common.CurrencyType;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.gadget.event.GadgetActivateEvent;
|
||||||
import mineplex.core.shop.item.SalesPackageBase;
|
import mineplex.core.shop.item.SalesPackageBase;
|
||||||
|
|
||||||
public abstract class Mount<T> extends SalesPackageBase implements Listener
|
public abstract class Mount<T> extends SalesPackageBase implements Listener
|
||||||
@ -35,6 +39,15 @@ public abstract class Mount<T> extends SalesPackageBase implements Listener
|
|||||||
|
|
||||||
public final void Enable(Player player)
|
public final void Enable(Player player)
|
||||||
{
|
{
|
||||||
|
GadgetActivateEvent gadgetEvent = new GadgetActivateEvent(player, this);
|
||||||
|
Bukkit.getServer().getPluginManager().callEvent(gadgetEvent);
|
||||||
|
|
||||||
|
if (gadgetEvent.isCancelled())
|
||||||
|
{
|
||||||
|
UtilPlayer.message(player, F.main("Inventory", "You cannot use Inventory Items."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Manager.setActive(player, this);
|
Manager.setActive(player, this);
|
||||||
EnableCustom(player);
|
EnableCustom(player);
|
||||||
}
|
}
|
||||||
|
@ -235,7 +235,7 @@ public class PreferencesPage extends ShopPageBase<PreferencesManager, Preference
|
|||||||
index = 9;
|
index = 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildPreference(index, Material.FIREBALL, "Hub Games", userPreferences.HubGames, _toggleHubGames);
|
buildPreference(index, Material.FIREBALL, "Hub Stacker", userPreferences.HubGames, _toggleHubGames);
|
||||||
index += 2;
|
index += 2;
|
||||||
buildPreference(index, Material.EYE_OF_ENDER, "Hub Player Visibility", userPreferences.ShowPlayers, _toggleHubPlayers);
|
buildPreference(index, Material.EYE_OF_ENDER, "Hub Player Visibility", userPreferences.ShowPlayers, _toggleHubPlayers);
|
||||||
index += 2;
|
index += 2;
|
||||||
|
@ -76,7 +76,6 @@ public class Hub extends JavaPlugin implements IRelation
|
|||||||
Recharge.Initialize(this);
|
Recharge.Initialize(this);
|
||||||
Punish punish = new Punish(this, webServerAddress, clientManager);
|
Punish punish = new Punish(this, webServerAddress, clientManager);
|
||||||
|
|
||||||
|
|
||||||
DonationManager donationManager = new DonationManager(this, webServerAddress);
|
DonationManager donationManager = new DonationManager(this, webServerAddress);
|
||||||
|
|
||||||
//Other Modules
|
//Other Modules
|
||||||
|
@ -718,18 +718,26 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
|||||||
|
|
||||||
int line = 15;
|
int line = 15;
|
||||||
|
|
||||||
|
//Stacker
|
||||||
|
obj.getScore(C.cAqua + C.Bold + "Stacker").setScore(line--);
|
||||||
|
player.getScoreboard().resetScores(Get(player).BestPig);
|
||||||
|
Get(player).BestPig = _pigStacker;
|
||||||
|
obj.getScore(Get(player).BestPig).setScore(line--);
|
||||||
|
|
||||||
|
//Space
|
||||||
|
obj.getScore(" ").setScore(line--);
|
||||||
|
|
||||||
|
//Gems
|
||||||
obj.getScore(C.cGreen + C.Bold + "Gems").setScore(line--);
|
obj.getScore(C.cGreen + C.Bold + "Gems").setScore(line--);
|
||||||
|
// Remove Old/Add New
|
||||||
// Remove Old
|
|
||||||
player.getScoreboard().resetScores(Get(player.getName()).GetLastGemCount() + "");
|
player.getScoreboard().resetScores(Get(player.getName()).GetLastGemCount() + "");
|
||||||
// Add New
|
|
||||||
obj.getScore(GetDonation().Get(player.getName()).GetGems() + "").setScore(line--);
|
obj.getScore(GetDonation().Get(player.getName()).GetGems() + "").setScore(line--);
|
||||||
|
|
||||||
Get(player.getName()).SetLastGemCount(GetDonation().Get(player.getName()).GetGems());
|
Get(player.getName()).SetLastGemCount(GetDonation().Get(player.getName()).GetGems());
|
||||||
|
|
||||||
//Space
|
//Space
|
||||||
obj.getScore(" ").setScore(line--);
|
obj.getScore(" ").setScore(line--);
|
||||||
|
|
||||||
|
//Coins
|
||||||
obj.getScore(C.cYellow + C.Bold + "Coins").setScore(line--);
|
obj.getScore(C.cYellow + C.Bold + "Coins").setScore(line--);
|
||||||
|
|
||||||
// Remove Old
|
// Remove Old
|
||||||
@ -739,53 +747,23 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
|||||||
|
|
||||||
Get(player.getName()).SetLastCoinCount(GetDonation().Get(player.getName()).getCoins());
|
Get(player.getName()).SetLastCoinCount(GetDonation().Get(player.getName()).getCoins());
|
||||||
|
|
||||||
//Space
|
|
||||||
obj.getScore(" ").setScore(line--);
|
|
||||||
|
|
||||||
/*
|
|
||||||
//News
|
|
||||||
obj.getScore(C.cGray + C.Bold + "Latest News")).setScore(line--);
|
|
||||||
player.getScoreboard().resetScores(Get(player).GetNewsText(false)));
|
|
||||||
obj.getScore(Get(player).GetNewsText(true))).setScore(line--);
|
|
||||||
*/
|
|
||||||
|
|
||||||
//Stacker
|
|
||||||
obj.getScore(C.cGray + C.Bold + "Stacker").setScore(line--);
|
|
||||||
player.getScoreboard().resetScores(Get(player).BestPig);
|
|
||||||
Get(player).BestPig = _pigStacker;
|
|
||||||
obj.getScore(Get(player).BestPig).setScore(line--);
|
|
||||||
|
|
||||||
//Space
|
//Space
|
||||||
obj.getScore(" ").setScore(line--);
|
obj.getScore(" ").setScore(line--);
|
||||||
|
|
||||||
|
|
||||||
//Display Rank
|
//Display Rank
|
||||||
if (GetClients().Get(player).GetRank().Has(Rank.HERO))
|
obj.getScore(C.cGold + C.Bold + "Rank").setScore(line--);
|
||||||
{
|
if (GetClients().Get(player).GetRank().Has(Rank.ULTRA))
|
||||||
obj.getScore(C.cPurple + C.Bold + "Hero Rank").setScore(line--);
|
obj.getScore(GetClients().Get(player).GetRank().Name).setScore(line--);
|
||||||
|
|
||||||
player.getScoreboard().resetScores(Get(player).GetUltraText(false));
|
|
||||||
obj.getScore(Get(player).GetUltraText(true)).setScore(line--);
|
|
||||||
}
|
|
||||||
else if (GetClients().Get(player).GetRank().Has(Rank.ULTRA))
|
|
||||||
{
|
|
||||||
obj.getScore(C.cAqua + C.Bold + "Ultra Rank").setScore(line--);
|
|
||||||
|
|
||||||
player.getScoreboard().resetScores(Get(player).GetUltraText(false));
|
|
||||||
obj.getScore(Get(player).GetUltraText(true)).setScore(line--);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
obj.getScore("No Rank").setScore(line--);
|
||||||
obj.getScore(C.cRed + C.Bold + "No Rank").setScore(line--);
|
|
||||||
|
|
||||||
player.getScoreboard().resetScores(Get(player).GetPurchaseText(false));
|
|
||||||
obj.getScore(Get(player).GetPurchaseText(true)).setScore(line--);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Space
|
//Space
|
||||||
obj.getScore(" ").setScore(line--);
|
obj.getScore(" ").setScore(line--);
|
||||||
|
|
||||||
//Website
|
//Website
|
||||||
obj.getScore(C.cYellow + C.Bold + "Website").setScore(line--);
|
obj.getScore(C.cRed + C.Bold + "Website").setScore(line--);
|
||||||
obj.getScore("www.mineplex.com").setScore(line--);
|
obj.getScore("www.mineplex.com").setScore(line--);
|
||||||
obj.getScore("----------------").setScore(line--);
|
obj.getScore("----------------").setScore(line--);
|
||||||
}
|
}
|
||||||
|
@ -52,15 +52,6 @@ public class JumpManager extends MiniPlugin
|
|||||||
//Disable Flight
|
//Disable Flight
|
||||||
player.setAllowFlight(false);
|
player.setAllowFlight(false);
|
||||||
|
|
||||||
//Parkour Disable
|
|
||||||
if (Manager.GetParkour().InParkour(player))
|
|
||||||
{
|
|
||||||
UtilPlayer.message(player, F.main("Parkour", "You cannot Double Jump near Parkour Challenges."));
|
|
||||||
player.setVelocity(new Vector(0,0,0));
|
|
||||||
player.teleport(player.getLocation());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Velocity
|
//Velocity
|
||||||
UtilAction.velocity(player, 1.4, 0.2, 1, true);
|
UtilAction.velocity(player, 1.4, 0.2, 1, true);
|
||||||
|
|
||||||
@ -79,6 +70,13 @@ public class JumpManager extends MiniPlugin
|
|||||||
if (player.getGameMode() == GameMode.CREATIVE)
|
if (player.getGameMode() == GameMode.CREATIVE)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (Manager.GetParkour().isParkourMode(player))
|
||||||
|
{
|
||||||
|
player.setAllowFlight(false);
|
||||||
|
player.setFlying(false);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (UtilEnt.isGrounded(player) || UtilBlock.solid(player.getLocation().getBlock().getRelative(BlockFace.DOWN)))
|
if (UtilEnt.isGrounded(player) || UtilBlock.solid(player.getLocation().getBlock().getRelative(BlockFace.DOWN)))
|
||||||
{
|
{
|
||||||
player.setAllowFlight(true);
|
player.setAllowFlight(true);
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package mineplex.hub.modules;
|
package mineplex.hub.modules;
|
||||||
|
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -12,28 +14,45 @@ public class ParkourData
|
|||||||
public String Name;
|
public String Name;
|
||||||
public String[] Desc;
|
public String[] Desc;
|
||||||
public int Gems;
|
public int Gems;
|
||||||
public Location Location;
|
public Location NPC;
|
||||||
|
public Location CornerA;
|
||||||
|
public Location CornerB;
|
||||||
public double Distance;
|
public double Distance;
|
||||||
|
|
||||||
public ParkourData(String name, String[] desc, int gems, Location loc, double dist)
|
public ParkourData(String name, String[] desc, int gems, Location npc, Location cornerA, Location cornerB)
|
||||||
{
|
{
|
||||||
Name = name;
|
Name = name;
|
||||||
Desc = desc;
|
Desc = desc;
|
||||||
Gems = gems;
|
Gems = gems;
|
||||||
Location = loc;
|
NPC = npc;
|
||||||
Distance = dist;
|
CornerA = cornerA;
|
||||||
|
CornerB = cornerB;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Inform(Player player)
|
public void Inform(Player player)
|
||||||
{
|
{
|
||||||
//Inform
|
UtilPlayer.message(player, "");
|
||||||
UtilPlayer.message(player, F.main("Parkour", "Welcome to the " + F.elem(Name) + " course."));
|
UtilPlayer.message(player, C.cDGreen + C.Strike + "=============================================");
|
||||||
|
|
||||||
|
UtilPlayer.message(player, "§f§l" + Name + " Course");
|
||||||
|
UtilPlayer.message(player, "");
|
||||||
|
|
||||||
for (String cur : Desc)
|
for (String cur : Desc)
|
||||||
{
|
{
|
||||||
UtilPlayer.message(player, " " + cur);
|
UtilPlayer.message(player, " " + cur);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UtilPlayer.message(player, "");
|
||||||
|
UtilPlayer.message(player, C.cWhite + C.Bold + "You must " + C.cGreen + C.Bold + "Right-Click" + C.cWhite + C.Bold + " the NPC to begin!");
|
||||||
|
|
||||||
|
UtilPlayer.message(player, "");
|
||||||
|
UtilPlayer.message(player, C.cDGreen + C.Strike + "=============================================");
|
||||||
|
|
||||||
player.playSound(player.getLocation(), Sound.ORB_PICKUP, 1f, 2f);
|
player.playSound(player.getLocation(), Sound.ORB_PICKUP, 1f, 2f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean InBoundary(Location loc)
|
||||||
|
{
|
||||||
|
return (UtilAlg.inBoundingBox(loc, CornerA, CornerB));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,10 +15,13 @@ import org.bukkit.entity.LivingEntity;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.block.BlockBreakEvent;
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.event.entity.EntityCombustEvent;
|
import org.bukkit.event.entity.EntityCombustEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||||
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
import org.bukkit.event.player.PlayerVelocityEvent;
|
||||||
|
|
||||||
import mineplex.core.MiniPlugin;
|
import mineplex.core.MiniPlugin;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
@ -31,6 +34,7 @@ import mineplex.core.common.util.UtilPlayer;
|
|||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
import mineplex.core.common.util.UtilTime;
|
import mineplex.core.common.util.UtilTime;
|
||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
|
import mineplex.core.gadget.event.GadgetActivateEvent;
|
||||||
import mineplex.core.gadget.event.GadgetBlockEvent;
|
import mineplex.core.gadget.event.GadgetBlockEvent;
|
||||||
import mineplex.core.recharge.Recharge;
|
import mineplex.core.recharge.Recharge;
|
||||||
import mineplex.core.task.TaskManager;
|
import mineplex.core.task.TaskManager;
|
||||||
@ -42,6 +46,8 @@ public class ParkourManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
public HubManager Manager;
|
public HubManager Manager;
|
||||||
|
|
||||||
|
private HashSet<Player> _active = new HashSet<Player>();
|
||||||
|
|
||||||
private HashSet<ParkourData> _parkour = new HashSet<ParkourData>();
|
private HashSet<ParkourData> _parkour = new HashSet<ParkourData>();
|
||||||
|
|
||||||
private Location _lavaParkourReturn;
|
private Location _lavaParkourReturn;
|
||||||
@ -67,7 +73,8 @@ public class ParkourManager extends MiniPlugin
|
|||||||
"You will need to find the correct way through",
|
"You will need to find the correct way through",
|
||||||
"the ruins, overcoming many challenging jumps.",
|
"the ruins, overcoming many challenging jumps.",
|
||||||
},
|
},
|
||||||
4000, new Location(Manager.GetSpawn().getWorld(), 115,70,-10), 60));
|
6000, new Location(Manager.GetSpawn().getWorld(), 110,66,-44),
|
||||||
|
new Location(Manager.GetSpawn().getWorld(), 103,100,-60), new Location(Manager.GetSpawn().getWorld(), 150,50,26)));
|
||||||
|
|
||||||
|
|
||||||
_parkour.add(new ParkourData("Lava Parkour", new String[]
|
_parkour.add(new ParkourData("Lava Parkour", new String[]
|
||||||
@ -75,100 +82,139 @@ public class ParkourManager extends MiniPlugin
|
|||||||
"This parkour is HOT! It's so hot that you",
|
"This parkour is HOT! It's so hot that you",
|
||||||
"must keep sprinting for the entire course,",
|
"must keep sprinting for the entire course,",
|
||||||
"or you will die in flames!"
|
"or you will die in flames!"
|
||||||
}, 1000, new Location(Manager.GetSpawn().getWorld(), -100,60,0), 60));
|
}, 4000, new Location(Manager.GetSpawn().getWorld(), -93,67,38),
|
||||||
|
new Location(Manager.GetSpawn().getWorld(), -86,100,42), new Location(Manager.GetSpawn().getWorld(), -120,50,-17)));
|
||||||
|
|
||||||
_lavaParkourReturn = new Location(Manager.GetSpawn().getWorld(), -89.5,68,36.5);
|
_lavaParkourReturn = new Location(Manager.GetSpawn().getWorld(), -89.5,68,36.5);
|
||||||
_lavaParkourReturn.setYaw(90);
|
_lavaParkourReturn.setYaw(90);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
public boolean isParkourMode(Player player)
|
||||||
public void gadgetBlockChange(GadgetBlockEvent event)
|
|
||||||
{
|
{
|
||||||
for (Iterator<Block> iterator = event.getBlocks().iterator(); iterator.hasNext();)
|
return _active.contains(player);
|
||||||
{
|
|
||||||
for (ParkourData data : _parkour)
|
|
||||||
{
|
|
||||||
if (UtilMath.offset(iterator.next().getLocation(), data.Location) < data.Distance)
|
|
||||||
{
|
|
||||||
iterator.remove();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean InParkour(Entity ent)
|
public void setParkourMode(Player player, boolean enabled)
|
||||||
{
|
{
|
||||||
for (ParkourData data : _parkour)
|
if (enabled)
|
||||||
{
|
{
|
||||||
if (UtilMath.offset(ent.getLocation(), data.Location) < data.Distance)
|
_active.add(player);
|
||||||
{
|
UtilPlayer.message(player, F.main("Parkour", "You have entered " + F.elem("Parkour Mode") + "."));
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
Manager.GetGadget().DisableAll();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
@EventHandler
|
|
||||||
public void BlockBreak(BlockBreakEvent event)
|
|
||||||
{
|
{
|
||||||
if (InParkour(event.getPlayer()))
|
_active.remove(player);
|
||||||
{
|
UtilPlayer.message(player, F.main("Parkour", "You have exited " + F.elem("Parkour Mode") + "."));
|
||||||
event.getPlayer().teleport(Manager.GetSpawn());
|
|
||||||
UtilPlayer.message(event.getPlayer(), F.main("Parkour", "You cannot break blocks near parkour!"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void combustPrevent(EntityCombustEvent event)
|
public void playerVelocity(PlayerVelocityEvent event)
|
||||||
{
|
|
||||||
if (event.getEntity() instanceof Player)
|
|
||||||
{
|
{
|
||||||
|
if (isParkourMode(event.getPlayer()))
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void disableGadgets(GadgetActivateEvent event)
|
||||||
|
{
|
||||||
|
if (isParkourMode(event.getPlayer()))
|
||||||
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void LavaReturn(EntityDamageEvent event)
|
public void playerEnterParkour(UpdateEvent event)
|
||||||
{
|
{
|
||||||
if (event.getCause() == DamageCause.LAVA)
|
if (event.getType() != UpdateType.FAST)
|
||||||
if (event.getEntity() instanceof Player)
|
return;
|
||||||
|
|
||||||
|
for (Player player : UtilServer.getPlayers())
|
||||||
{
|
{
|
||||||
|
if (isParkourMode(player))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
for (ParkourData data : _parkour)
|
||||||
|
if (UtilMath.offset(player.getLocation(), data.NPC) < 6)
|
||||||
|
if (Recharge.Instance.use(player, data.Name+" Info", 60000, false, false))
|
||||||
|
data.Inform(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void parkourUpdate(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.FAST)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Iterator<Player> playerIterator = _active.iterator();
|
||||||
|
|
||||||
|
while (playerIterator.hasNext())
|
||||||
|
{
|
||||||
|
Player player = playerIterator.next();
|
||||||
|
|
||||||
|
player.leaveVehicle();
|
||||||
|
player.eject();
|
||||||
|
|
||||||
|
if (!InsideParkour(player.getLocation()))
|
||||||
|
{
|
||||||
|
playerIterator.remove();
|
||||||
|
UtilPlayer.message(player, F.main("Parkour", "You have exited " + F.elem("Parkour Mode") + "."));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void playerQuit(PlayerQuitEvent event)
|
||||||
|
{
|
||||||
|
_active.remove(event.getPlayer());
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void disallowBlockBreak(BlockBreakEvent event)
|
||||||
|
{
|
||||||
|
if (isParkourMode(event.getPlayer()))
|
||||||
|
{
|
||||||
|
event.getPlayer().teleport(Manager.GetSpawn());
|
||||||
|
UtilPlayer.message(event.getPlayer(), F.main("Parkour", "You cannot break blocks in Parkour Mode!"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void disallowBlockPlace(BlockPlaceEvent event)
|
||||||
|
{
|
||||||
|
if (isParkourMode(event.getPlayer()))
|
||||||
|
{
|
||||||
|
event.getPlayer().teleport(Manager.GetSpawn());
|
||||||
|
UtilPlayer.message(event.getPlayer(), F.main("Parkour", "You cannot place blocks in Parkour Mode!"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void lavaReturn(EntityDamageEvent event)
|
||||||
|
{
|
||||||
|
if (event.getCause() != DamageCause.LAVA)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!(event.getEntity() instanceof Player))
|
||||||
|
{
|
||||||
|
event.getEntity().remove();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Player player = (Player)event.getEntity();
|
||||||
|
|
||||||
|
if (!isParkourMode(player))
|
||||||
|
return;
|
||||||
|
|
||||||
event.getEntity().eject();
|
event.getEntity().eject();
|
||||||
event.getEntity().leaveVehicle();
|
event.getEntity().leaveVehicle();
|
||||||
event.getEntity().teleport(_lavaParkourReturn);
|
event.getEntity().teleport(_lavaParkourReturn);
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
|
||||||
event.getEntity().remove();
|
|
||||||
|
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void preventCarriers(UpdateEvent event)
|
public void lavaBlockReturn(UpdateEvent event)
|
||||||
{
|
|
||||||
if (event.getType() != UpdateType.SEC)
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (Player player : UtilServer.getPlayers())
|
|
||||||
{
|
|
||||||
if (InParkour(player))
|
|
||||||
{
|
|
||||||
if ((player.getVehicle() != null && !(player.getVehicle() instanceof EnderDragon)) || player.getPassenger() != null)
|
|
||||||
{
|
|
||||||
player.eject();
|
|
||||||
player.leaveVehicle();
|
|
||||||
|
|
||||||
UtilPlayer.message(player, F.main("Parkour", "You can't be a passenger near Parkours!"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void LavaBlockReturn(UpdateEvent event)
|
|
||||||
{
|
{
|
||||||
if (event.getType() != UpdateType.TICK)
|
if (event.getType() != UpdateType.TICK)
|
||||||
return;
|
return;
|
||||||
@ -178,6 +224,9 @@ public class ParkourManager extends MiniPlugin
|
|||||||
if (!UtilEnt.isGrounded(player))
|
if (!UtilEnt.isGrounded(player))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (!isParkourMode(player))
|
||||||
|
continue;
|
||||||
|
|
||||||
int id = player.getLocation().getBlock().getRelative(BlockFace.DOWN).getTypeId();
|
int id = player.getLocation().getBlock().getRelative(BlockFace.DOWN).getTypeId();
|
||||||
int data = player.getLocation().getBlock().getRelative(BlockFace.DOWN).getData();
|
int data = player.getLocation().getBlock().getRelative(BlockFace.DOWN).getData();
|
||||||
if (id != 0 && id != 112 && id != 114 && !(id == 43 && data == 6) && !(id == 44 && data == 6))
|
if (id != 0 && id != 112 && id != 114 && !(id == 43 && data == 6) && !(id == 44 && data == 6))
|
||||||
@ -219,7 +268,7 @@ public class ParkourManager extends MiniPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void Finish(PlayerInteractEntityEvent event)
|
public void finishParkour(PlayerInteractEntityEvent event)
|
||||||
{
|
{
|
||||||
if (event.getRightClicked() == null)
|
if (event.getRightClicked() == null)
|
||||||
return;
|
return;
|
||||||
@ -242,7 +291,7 @@ public class ParkourManager extends MiniPlugin
|
|||||||
if (!ent.getCustomName().contains(data.Name))
|
if (!ent.getCustomName().contains(data.Name))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
data.Inform(player);
|
setParkourMode(player, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,6 +300,14 @@ public class ParkourManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
|
|
||||||
|
if (!isParkourMode(player))
|
||||||
|
{
|
||||||
|
//Inform
|
||||||
|
UtilPlayer.message(player, F.main("Parkour", "Cannot finish parkour unless you are in " + F.elem("Parkour Mode") + "."));
|
||||||
|
UtilPlayer.message(player, F.main("Parkour", "Talk to the " + F.elem("Start NPC") + " to enter Parkour Mode."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!Recharge.Instance.use(player, "Finish Parkour", 30000, false, false))
|
if (!Recharge.Instance.use(player, "Finish Parkour", 30000, false, false))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -283,4 +340,29 @@ public class ParkourManager extends MiniPlugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void gadgetBlockChange(GadgetBlockEvent event)
|
||||||
|
{
|
||||||
|
for (Iterator<Block> iterator = event.getBlocks().iterator(); iterator.hasNext();)
|
||||||
|
{
|
||||||
|
for (ParkourData data : _parkour)
|
||||||
|
{
|
||||||
|
if (data.InBoundary(iterator.next().getLocation()))
|
||||||
|
{
|
||||||
|
iterator.remove();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean InsideParkour(Location loc)
|
||||||
|
{
|
||||||
|
for (ParkourData data : _parkour)
|
||||||
|
if (data.InBoundary(loc))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ public class StackerManager extends MiniPlugin implements IThrown
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
//Parkour Disable
|
//Parkour Disable
|
||||||
if (Manager.GetParkour().InParkour(stacker))
|
if (Manager.GetParkour().InsideParkour(stacker.getLocation()))
|
||||||
{
|
{
|
||||||
UtilPlayer.message(stacker, F.main("Parkour", "You cannot Stack/Throw near Parkour Challenges."));
|
UtilPlayer.message(stacker, F.main("Parkour", "You cannot Stack/Throw near Parkour Challenges."));
|
||||||
return;
|
return;
|
||||||
@ -186,10 +186,9 @@ public class StackerManager extends MiniPlugin implements IThrown
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Parkour Disable
|
//Parkour Disable
|
||||||
if (Manager.GetParkour().InParkour(thrower))
|
if (Manager.GetParkour().InsideParkour(thrower.getLocation()))
|
||||||
{
|
{
|
||||||
UtilPlayer.message(thrower, F.main("Parkour", "You cannot Stack/Throw near Parkour Challenges."));
|
UtilPlayer.message(thrower, F.main("Parkour", "You cannot Stack/Throw near Parkour Challenges."));
|
||||||
UtilPlayer.message(throwee, F.main("Parkour", "You cannot Stack/Throw near Parkour Challenges."));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,11 +67,11 @@ public class TextManager extends MiniPlugin
|
|||||||
UtilText.MakeText("DOMINATE", locComp.clone().add(15, 14, 0), faceComp, 159, (byte)4, TextAlign.CENTER);
|
UtilText.MakeText("DOMINATE", locComp.clone().add(15, 14, 0), faceComp, 159, (byte)4, TextAlign.CENTER);
|
||||||
UtilText.MakeText("DOMINATE", locComp.clone().add(16, 14, 0), faceComp, 159, (byte)15, TextAlign.CENTER);
|
UtilText.MakeText("DOMINATE", locComp.clone().add(16, 14, 0), faceComp, 159, (byte)15, TextAlign.CENTER);
|
||||||
|
|
||||||
UtilText.MakeText("DEATHMATCH", locComp.clone().add(15, 21, 0), faceComp, 159, (byte)1, TextAlign.CENTER);
|
UtilText.MakeText("TEAM DEATHMATCH", locComp.clone().add(15, 21, 0), faceComp, 159, (byte)1, TextAlign.CENTER);
|
||||||
UtilText.MakeText("DEATHMATCH", locComp.clone().add(16, 21, 0), faceComp, 159, (byte)15, TextAlign.CENTER);
|
UtilText.MakeText("TEAM DEATHMATCH", locComp.clone().add(16, 21, 0), faceComp, 159, (byte)15, TextAlign.CENTER);
|
||||||
|
|
||||||
UtilText.MakeText("CAPTURE THE PIG", locComp.clone().add(15, 28, 0), faceComp, 159, (byte)14, TextAlign.CENTER);
|
//UtilText.MakeText("CAPTURE THE PIG", locComp.clone().add(15, 28, 0), faceComp, 159, (byte)14, TextAlign.CENTER);
|
||||||
UtilText.MakeText("CAPTURE THE PIG", locComp.clone().add(16, 28, 0), faceComp, 159, (byte)15, TextAlign.CENTER);
|
//UtilText.MakeText("CAPTURE THE PIG", locComp.clone().add(16, 28, 0), faceComp, 159, (byte)15, TextAlign.CENTER);
|
||||||
|
|
||||||
//Arcade
|
//Arcade
|
||||||
UtilText.MakeText("ARCADE", locArcade, faceArcade, 159, (byte)5, TextAlign.CENTER);
|
UtilText.MakeText("ARCADE", locArcade, faceArcade, 159, (byte)5, TextAlign.CENTER);
|
||||||
|
@ -38,6 +38,7 @@ import org.bukkit.event.block.BlockFormEvent;
|
|||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.event.block.BlockSpreadEvent;
|
import org.bukkit.event.block.BlockSpreadEvent;
|
||||||
import org.bukkit.event.block.LeavesDecayEvent;
|
import org.bukkit.event.block.LeavesDecayEvent;
|
||||||
|
import org.bukkit.event.entity.EntityCombustEvent;
|
||||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||||
import org.bukkit.event.entity.EntityTargetEvent;
|
import org.bukkit.event.entity.EntityTargetEvent;
|
||||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||||
@ -269,4 +270,13 @@ public class WorldManager extends MiniPlugin
|
|||||||
if (event.GetDamageeEntity() instanceof Boat)
|
if (event.GetDamageeEntity() instanceof Boat)
|
||||||
event.SetCancelled("Boat Cancel");
|
event.SetCancelled("Boat Cancel");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void combustPrevent(EntityCombustEvent event)
|
||||||
|
{
|
||||||
|
if (event.getEntity() instanceof Player)
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ public class CompassAddon extends MiniPlugin
|
|||||||
|
|
||||||
if (target != null)
|
if (target != null)
|
||||||
{
|
{
|
||||||
if (Manager.GetGame().CompassGiveItem || player.getGameMode() == GameMode.SURVIVAL)
|
if (Manager.GetGame().CompassGiveItem || player.getGameMode() != GameMode.SURVIVAL)
|
||||||
if (!player.getInventory().contains(Material.COMPASS))
|
if (!player.getInventory().contains(Material.COMPASS))
|
||||||
{
|
{
|
||||||
if (player.getOpenInventory() == null || player.getOpenInventory().getCursor() == null || player.getOpenInventory().getCursor().getType() != Material.COMPASS)
|
if (player.getOpenInventory() == null || player.getOpenInventory().getCursor() == null || player.getOpenInventory().getCursor().getType() != Material.COMPASS)
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
package nautilus.game.arcade.game.games.smash;
|
package nautilus.game.arcade.game.games.smash;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -24,7 +22,6 @@ import mineplex.core.common.util.UtilPlayer;
|
|||||||
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 mineplex.minecraft.game.core.combat.DeathMessageType;
|
|
||||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||||
import nautilus.game.arcade.ArcadeFormat;
|
import nautilus.game.arcade.ArcadeFormat;
|
||||||
import nautilus.game.arcade.ArcadeManager;
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
@ -27,7 +27,7 @@ public class KitBlaze extends SmashKit
|
|||||||
{
|
{
|
||||||
public KitBlaze(ArcadeManager manager)
|
public KitBlaze(ArcadeManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Blaze", KitAvailability.Green, 6000,
|
super(manager, "Blaze", KitAvailability.Green, 8000,
|
||||||
|
|
||||||
new String[]
|
new String[]
|
||||||
{
|
{
|
||||||
|
@ -23,7 +23,7 @@ public class KitChicken extends SmashKit
|
|||||||
{
|
{
|
||||||
public KitChicken(ArcadeManager manager)
|
public KitChicken(ArcadeManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Chicken", KitAvailability.Green, 5000,
|
super(manager, "Chicken", KitAvailability.Green, 10000,
|
||||||
|
|
||||||
new String[]
|
new String[]
|
||||||
{
|
{
|
||||||
|
@ -23,7 +23,7 @@ public class KitPig extends SmashKit
|
|||||||
{
|
{
|
||||||
public KitPig(ArcadeManager manager)
|
public KitPig(ArcadeManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Pig", KitAvailability.Green, 5000,
|
super(manager, "Pig", KitAvailability.Green, 7000,
|
||||||
|
|
||||||
new String[]
|
new String[]
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,7 @@ public class KitSkeletalHorse extends SmashKit
|
|||||||
{
|
{
|
||||||
public KitSkeletalHorse(ArcadeManager manager)
|
public KitSkeletalHorse(ArcadeManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Skeletal Horse", KitAvailability.Green, 5000,
|
super(manager, "Skeletal Horse", KitAvailability.Green, 7000,
|
||||||
|
|
||||||
new String[]
|
new String[]
|
||||||
{
|
{
|
||||||
|
@ -22,7 +22,7 @@ public class KitWolf extends SmashKit
|
|||||||
{
|
{
|
||||||
public KitWolf(ArcadeManager manager)
|
public KitWolf(ArcadeManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Wolf", KitAvailability.Green,
|
super(manager, "Wolf", KitAvailability.Green, 3000,
|
||||||
|
|
||||||
new String[]
|
new String[]
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,113 @@
|
|||||||
|
package nautilus.game.arcade.managers;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import mineplex.core.achievement.Achievement;
|
||||||
|
import mineplex.core.achievement.AchievementLog;
|
||||||
|
import mineplex.core.achievement.AchivementData;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.NautHashMap;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import nautilus.game.arcade.ArcadeFormat;
|
||||||
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||||
|
import nautilus.game.arcade.game.Game;
|
||||||
|
import nautilus.game.arcade.game.Game.GameState;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
|
||||||
|
public class GameAchievementManager implements Listener
|
||||||
|
{
|
||||||
|
ArcadeManager Manager;
|
||||||
|
|
||||||
|
public GameAchievementManager(ArcadeManager manager)
|
||||||
|
{
|
||||||
|
Manager = manager;
|
||||||
|
|
||||||
|
Manager.GetPluginManager().registerEvents(this, Manager.GetPlugin());
|
||||||
|
}
|
||||||
|
|
||||||
|
//Ensure that past achievement progress is ignored
|
||||||
|
@EventHandler
|
||||||
|
public void clearAchievementLog(PlayerJoinEvent event)
|
||||||
|
{
|
||||||
|
Manager.GetAchievement().clearLog(event.getPlayer());
|
||||||
|
}
|
||||||
|
|
||||||
|
//@EventHandler(priority = EventPriority.MONITOR)
|
||||||
|
public void processAchievementLog(final GameStateChangeEvent event)
|
||||||
|
{
|
||||||
|
if (Manager.IsTournamentServer())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.GetState() != GameState.Dead)
|
||||||
|
return;
|
||||||
|
|
||||||
|
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable()
|
||||||
|
{
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
for (Player player : UtilServer.getPlayers())
|
||||||
|
{
|
||||||
|
displayAchievementLog(player, event.GetGame(), Manager.GetAchievement().getLog(player));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 120);
|
||||||
|
//Delay after Gems
|
||||||
|
}
|
||||||
|
|
||||||
|
public void displayAchievementLog(Player player, Game game, NautHashMap<Achievement, AchievementLog> log)
|
||||||
|
{
|
||||||
|
if (log == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
player.playSound(player.getLocation(), Sound.LEVEL_UP, 2f, 1f);
|
||||||
|
|
||||||
|
UtilPlayer.message(player, "");
|
||||||
|
UtilPlayer.message(player, ArcadeFormat.Line);
|
||||||
|
|
||||||
|
UtilPlayer.message(player, "§f§lAchievement Progress");
|
||||||
|
|
||||||
|
int out = 0;
|
||||||
|
|
||||||
|
//Display
|
||||||
|
for (Achievement type : log.keySet())
|
||||||
|
{
|
||||||
|
UtilPlayer.message(player, "");
|
||||||
|
|
||||||
|
AchivementData data = Manager.GetAchievement().get(player, type);
|
||||||
|
|
||||||
|
if (log.get(type).LevelUp)
|
||||||
|
{
|
||||||
|
UtilPlayer.message(player, F.elem(type.getName() + " " + data.getLevel() + "/" + type.getMaxLevel()) +
|
||||||
|
" " + F.elem(C.cGreen + "+" + log.get(type).Amount) +
|
||||||
|
" " + F.elem(C.cAqua + "LEVELED UP!"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UtilPlayer.message(player, F.elem(type.getName() + " " + data.getLevel() + "/" + type.getMaxLevel()) +
|
||||||
|
" " + F.elem(C.cGreen + "+" + log.get(type).Amount) +
|
||||||
|
" " + F.elem(ChatColor.YELLOW + "" + (data.getExpNextLevel() - data.getExpRemainder()) + " to Next Level"));
|
||||||
|
}
|
||||||
|
|
||||||
|
out++;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (out < 5)
|
||||||
|
{
|
||||||
|
//UtilPlayer.message(player, "");
|
||||||
|
out++;
|
||||||
|
}
|
||||||
|
|
||||||
|
UtilPlayer.message(player, "");
|
||||||
|
UtilPlayer.message(player, ArcadeFormat.Line);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user