diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/open/OpenTaunts.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/open/OpenTaunts.java index 032ed4c03..e87cdcfb1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/open/OpenTaunts.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/open/OpenTaunts.java @@ -16,6 +16,6 @@ public class OpenTaunts extends OpenPageButton @Override protected void leftClick(Player player) { - getMenu().getShop().openPageForPlayer(player, new TauntPage(getMenu().getPlugin(), getMenu().getShop(), getMenu().getClientManager(), getMenu().getDonationManager(), "Particles", player)); + getMenu().getShop().openPageForPlayer(player, new TauntPage(getMenu().getPlugin(), getMenu().getShop(), getMenu().getClientManager(), getMenu().getDonationManager(), "Taunts", player)); } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/TauntPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/TauntPage.java index 3db625e5d..a519cfce8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/TauntPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/TauntPage.java @@ -1,57 +1,57 @@ -package mineplex.core.cosmetic.ui.page; - -import java.util.List; - -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.event.inventory.ClickType; - -import mineplex.core.account.CoreClientManager; -import mineplex.core.common.util.C; -import mineplex.core.cosmetic.CosmeticManager; -import mineplex.core.cosmetic.ui.CosmeticShop; -import mineplex.core.donation.DonationManager; -import mineplex.core.gadget.types.Gadget; -import mineplex.core.gadget.types.GadgetType; -import mineplex.core.shop.item.IButton; -import mineplex.core.shop.item.ShopItem; - -public class TauntPage extends GadgetPage -{ - - - public TauntPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, - Player player) - { - super(plugin, shop, clientManager, donationManager, name, player); - } - - @Override - protected void buildPage() - { - int slot = 10; - - List list = getPlugin().getGadgetManager().getGadgets(GadgetType.TAUNT); - if(list != null) - for (Gadget gadget : list) - { - addGadget(gadget, slot); - - if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.MORPH) == gadget) - addGlow(slot); - - slot++; - - if (slot == 26) - slot += 2; - } - - addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton() - { - public void onClick(Player player, ClickType clickType) - { - getShop().openPageForPlayer(getPlayer(), new Menu(getPlugin(), getShop(), getClientManager(), getDonationManager(), player)); - } - }); - } -} +package mineplex.core.cosmetic.ui.page; + +import java.util.List; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.ClickType; + +import mineplex.core.account.CoreClientManager; +import mineplex.core.common.util.C; +import mineplex.core.cosmetic.CosmeticManager; +import mineplex.core.cosmetic.ui.CosmeticShop; +import mineplex.core.donation.DonationManager; +import mineplex.core.gadget.types.Gadget; +import mineplex.core.gadget.types.GadgetType; +import mineplex.core.shop.item.IButton; +import mineplex.core.shop.item.ShopItem; + +public class TauntPage extends GadgetPage +{ + + + public TauntPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, + Player player) + { + super(plugin, shop, clientManager, donationManager, name, player); + } + + @Override + protected void buildPage() + { + int slot = 10; + + List list = getPlugin().getGadgetManager().getGadgets(GadgetType.TAUNT); + if(list != null) + for (Gadget gadget : list) + { + addGadget(gadget, slot); + + if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.TAUNT) == gadget) + addGlow(slot); + + slot++; + + if (slot == 26) + slot += 2; + } + + addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton() + { + public void onClick(Player player, ClickType clickType) + { + getShop().openPageForPlayer(getPlayer(), new Menu(getPlugin(), getShop(), getClientManager(), getDonationManager(), player)); + } + }); + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index b3ddb9da3..ef523aba8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -169,6 +169,7 @@ import mineplex.core.gadget.gadgets.particle.shadow.ParticleFoot; import mineplex.core.gadget.gadgets.particle.titan.ParticleTitan; import mineplex.core.gadget.gadgets.particle.vampire.ParticleBlood; import mineplex.core.gadget.gadgets.particle.wisdom.ParticleEnchant; +import mineplex.core.gadget.gadgets.taunts.EternalTaunt; import mineplex.core.gadget.gadgets.wineffect.WinEffectBabyChicken; import mineplex.core.gadget.gadgets.wineffect.WinEffectFlames; import mineplex.core.gadget.gadgets.wineffect.WinEffectHalloween; @@ -532,6 +533,9 @@ public class GadgetManager extends MiniPlugin // Balloons //addGadget(new BabyCowBalloon(this)); + // TAUNTS!!! + addGadget(new EternalTaunt(this)); + for (GadgetType gadgetType : GadgetType.values()) { if (!_gadgets.containsKey(gadgetType)) @@ -766,7 +770,10 @@ public class GadgetManager extends MiniPlugin if (gadget instanceof WinEffectGadget) continue; - if(gadget instanceof GameModifierGadget) + if (gadget instanceof GameModifierGadget) + continue; + + if (gadget instanceof TauntGadget) continue; for (Player player : UtilServer.getPlayers()) @@ -1250,21 +1257,35 @@ public class GadgetManager extends MiniPlugin { Player player = event.getPlayer(); - if (getActive(player, GadgetType.TAUNT) == null) + Gadget gadget = getActive(player, GadgetType.TAUNT); + + if (gadget == null) + { event.setState(TauntCommandEvent.TauntState.NO_TAUNT); + UtilPlayer.message(player, F.main("Taunt", event.getState().getMessage())); + return; + } - TauntGadget taunt = (TauntGadget) getActive(player, GadgetType.TAUNT); + if (!(gadget instanceof TauntGadget)) + { + event.setState(TauntCommandEvent.TauntState.NO_TAUNT); + UtilPlayer.message(player, F.main("Taunt", event.getState().getMessage())); + return; + } - if (!event.isGameInProgress()) + TauntGadget taunt = (TauntGadget) gadget; + + if (!event.isGameInProgress() && event.getState().equals(TauntCommandEvent.TauntState.NONE)) event.setState(TauntCommandEvent.TauntState.NOT_IN_GAME); - if (!event.isAlive()) + if (!event.isAlive() && event.getState().equals(TauntCommandEvent.TauntState.NONE)) event.setState(TauntCommandEvent.TauntState.NOT_ALIVE); - if (event.isSpectator()) + if (event.isSpectator() && event.getState().equals(TauntCommandEvent.TauntState.NONE)) event.setState(TauntCommandEvent.TauntState.SPECTATOR); - if (event.isInPvp() && !taunt.canPlayWithPvp()) + if (event.isInPvp(taunt.getPvpCooldown()) && !taunt.canPlayWithPvp() + && event.getState().equals(TauntCommandEvent.TauntState.NONE)) event.setState(TauntCommandEvent.TauntState.PVP); if (event.getState() != TauntCommandEvent.TauntState.NONE) @@ -1273,6 +1294,6 @@ public class GadgetManager extends MiniPlugin return; } - taunt.start(); + taunt.start(player); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/event/TauntCommandEvent.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/event/TauntCommandEvent.java index 8f4b4120f..04dad3f1b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/event/TauntCommandEvent.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/event/TauntCommandEvent.java @@ -4,6 +4,8 @@ import org.bukkit.entity.Player; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; +import mineplex.core.common.util.UtilTime; + public class TauntCommandEvent extends Event { @@ -13,16 +15,16 @@ public class TauntCommandEvent extends Event private boolean _gameInProgress; private boolean _alive; private boolean _spectator; - private boolean _inPvp; - private TauntState _state; + private long _lastPvp; + private TauntState _state = TauntState.NONE; - public TauntCommandEvent(Player player, boolean gameInProgress, boolean alive, boolean spectator, boolean inPvp) + public TauntCommandEvent(Player player, boolean gameInProgress, boolean alive, boolean spectator, long lastPvp) { _player = player; _gameInProgress = gameInProgress; _alive = alive; _spectator = spectator; - _inPvp = inPvp; + _lastPvp = lastPvp; } public Player getPlayer() @@ -45,9 +47,9 @@ public class TauntCommandEvent extends Event return _spectator; } - public boolean isInPvp() + public boolean isInPvp(long cooldown) { - return _inPvp; + return !UtilTime.elapsed(_lastPvp, cooldown); } public TauntState getState() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/EternalTaunt.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/EternalTaunt.java index 6a5192736..862ed7104 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/EternalTaunt.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/EternalTaunt.java @@ -1,62 +1,115 @@ package mineplex.core.gadget.gadgets.taunts; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.bukkit.Bukkit; +import org.bukkit.Color; +import org.bukkit.FireworkEffect; import org.bukkit.Material; -import org.bukkit.entity.Item; -import org.bukkit.util.Vector; +import org.bukkit.entity.Player; import mineplex.core.common.util.LineFormat; -import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilText; +import mineplex.core.events.EnableArcadeSpawnEvent; import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.taunts.eternal.EternalClock; import mineplex.core.gadget.types.TauntGadget; -import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; public class EternalTaunt extends TauntGadget { - private List _clocks = new ArrayList<>(); + private static final int COOLDOWN = 30000; + + private Map> _clocks = new HashMap<>(); + private Map _ticksPerPlayer = new HashMap<>(); public EternalTaunt(GadgetManager manager) { super(manager, "Eternal Taunt", UtilText.splitLinesToArray(new String[]{"Placeholder"}, LineFormat.LORE), -15, Material.GLASS, (byte) 0); setCanPlayWithPvp(false); + setPvpCooldown(5000); setShouldPlay(true); - setEventType(UpdateType.FAST); + setEventType(UpdateType.TICK); } @Override - public void start() + public void start(Player player) { - // TODO PARTICLE EFFECT - } + if (!Recharge.Instance.use(player, getName(), COOLDOWN, true, false, "Cosmetics")) + return; + UtilFirework.playFirework(player.getLocation(), FireworkEffect.builder().with(FireworkEffect.Type.BALL_LARGE).withColor(Color.fromRGB(255, 175, 175)).withFade(Color.RED).build()); + List clocks = new ArrayList<>(); - @Override - public void play() - { - Item clock = _player.getWorld().dropItem(_player.getLocation().add(0, 3, 0), ItemStackFactory.Instance.CreateStack(Material.WATCH, (byte) 0, 1, "" + System.currentTimeMillis())); - _clocks.add(clock); + EnableArcadeSpawnEvent enableArcadeSpawnEvent = new EnableArcadeSpawnEvent(true); + Bukkit.getPluginManager().callEvent(enableArcadeSpawnEvent); - int i = getTicks(); - Vector vel = new Vector(Math.sin(i * 9/5d), 0, Math.cos(i * 9/5d)); - UtilAction.velocity(clock, vel, Math.abs(Math.sin(i * 12/3000d)), false, 0, 0.2 + Math.abs(Math.cos(i * 12/3000d))*0.6, 1, false); - - if (getTicks() >= 40) + // Creates armor stands + for (EternalClock.ClockPosition clockPosition : EternalClock.ClockPosition.values()) { - finish(); + EternalClock eternalClock = new EternalClock(player, clockPosition); + eternalClock.createStand(); + clocks.add(eternalClock); + } + + _clocks.put(player.getUniqueId(), clocks); + + enableArcadeSpawnEvent = new EnableArcadeSpawnEvent(false); + Bukkit.getPluginManager().callEvent(enableArcadeSpawnEvent); + + _ticksPerPlayer.put(player.getUniqueId(), 0); + } + + @Override + public void play(Player player) + { + if (!_clocks.containsKey(player.getUniqueId())) + return; + + // Keps armorstand close to player + for (EternalClock eternalClock : _clocks.get(player.getUniqueId())) + { + eternalClock.moveStand(); + } + + if (getTicks(player) >= 60) + { + finish(player); + } + else + { + increaseTicks(player); } } @Override - public void finish() + public void finish(Player player) { - setShouldPlay(false); - _clocks.forEach(c -> c.remove()); - _clocks.clear(); + if (_clocks.containsKey(player.getUniqueId())) + { + _clocks.get(player.getUniqueId()).forEach(eternalClock -> eternalClock.removeStand()); + _clocks.get(player.getUniqueId()).clear(); + _clocks.remove(player.getUniqueId()); + } + } + + private int getTicks(Player player) + { + return _ticksPerPlayer.get(player.getUniqueId()); + } + + private void increaseTicks(Player player) + { + int ticks = getTicks(player); + ticks++; + _ticksPerPlayer.put(player.getUniqueId(), ticks); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/eternal/EternalClock.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/eternal/EternalClock.java new file mode 100644 index 000000000..5debf7bd9 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/eternal/EternalClock.java @@ -0,0 +1,80 @@ +package mineplex.core.gadget.gadgets.taunts.eternal; + +import org.bukkit.Material; +import org.bukkit.entity.ArmorStand; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +public class EternalClock +{ + + private Player _player; + private ClockPosition _clockPosition; + private ArmorStand _armorStand; + + public EternalClock(Player player, ClockPosition clockPosition) + { + _player = player; + _clockPosition = clockPosition; + } + + public void createStand() + { + _armorStand = _player.getWorld().spawn(_player.getLocation().clone().add(_clockPosition.getX(), .5, + _clockPosition.getZ()), ArmorStand.class); + _armorStand.setItemInHand(new ItemStack(Material.WATCH)); + _armorStand.setVisible(false); + _armorStand.setGravity(false); + } + + public void moveStand() + { + switch (_clockPosition) + { + case A: + _clockPosition = ClockPosition.B; + break; + case B: + _clockPosition = ClockPosition.C; + break; + case C: + _clockPosition = ClockPosition.D; + break; + case D: + _clockPosition = ClockPosition.A; + } + _armorStand.teleport(_player.getLocation().clone().add(_clockPosition.getX(), .5, _clockPosition.getZ())); + } + + public void removeStand() + { + _armorStand.remove(); + } + + public enum ClockPosition + { + A(1, 0), + B(0, 1), + C(-1, 0), + D(0, -1); + + private int _x, _z; + + ClockPosition(int x, int z) + { + _x = x; + _z = z; + } + + public int getX() + { + return _x; + } + + public int getZ() + { + return _z; + } + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/TauntGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/TauntGadget.java index 472d2aaca..1a54b2100 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/TauntGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/TauntGadget.java @@ -16,21 +16,14 @@ import mineplex.core.updater.event.UpdateEvent; public abstract class TauntGadget extends Gadget { - /** The player that ran the taunt command */ - protected Player _player; - /** The milliseconds time the taunt started playing */ - protected long _started; - /** Has the taunt effect started yet? */ - protected boolean _hasStarted = false; - /** Sets if this specific taunt can be used while in PvP */ private boolean _canPlayWithPvp = false; + /** Sets the cooldown for pvp */ + private long _pvpCooldown = 0; /** Sets if this taunt needs to run on updates */ private boolean _shouldPlay = false; /** Sets when the taunt will run, if set above */ private UpdateType _updateType = UpdateType.TICK; - /** The number of ticks that have passed since the start */ - private int _ticks = 0; /** * @param manager The normal GadgetManager @@ -63,17 +56,22 @@ public abstract class TauntGadget extends Gadget super(manager, GadgetType.TAUNT, name, desc, cost, mat, data, yearMonth, 1, alternativeSalesPackageNames); } - public abstract void start(); + public abstract void start(Player player); - public abstract void play(); + public abstract void play(Player player); - public abstract void finish(); + public abstract void finish(Player player); public void setCanPlayWithPvp(boolean canPlayWithPvp) { _canPlayWithPvp = canPlayWithPvp; } + public void setPvpCooldown(long pvpCooldown) + { + _pvpCooldown = pvpCooldown; + } + public void setShouldPlay(boolean shouldPlay) { _shouldPlay = shouldPlay; @@ -89,25 +87,24 @@ public abstract class TauntGadget extends Gadget return _canPlayWithPvp; } - public int getTicks() + public long getPvpCooldown() { - return _ticks; + return _pvpCooldown; } @EventHandler public void onUpdate(UpdateEvent event) { - if (!_hasStarted) - return; - if (!_shouldPlay) return; if (event.getType() != _updateType) return; - play(); - _ticks++; + for (Player player : getActive()) + { + play(player); + } } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/Effect.java b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/Effect.java index 5ddda6a72..f72a32fbf 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/Effect.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/Effect.java @@ -4,6 +4,7 @@ import org.bukkit.Bukkit; import org.bukkit.plugin.java.JavaPlugin; import mineplex.core.common.util.Callback; +import mineplex.core.particleeffects.events.EffectStopEvent; public abstract class Effect { @@ -50,6 +51,8 @@ public abstract class Effect { _running = false; Bukkit.getScheduler().cancelTask(_task); + EffectStopEvent effectStopEvent = new EffectStopEvent(this); + Bukkit.getPluginManager().callEvent(effectStopEvent); if (_callback != null) _callback.run(this); onStop(); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/LineEffect.java b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/LineEffect.java new file mode 100644 index 000000000..8698761dd --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/LineEffect.java @@ -0,0 +1,51 @@ +package mineplex.core.particleeffects; + +import org.bukkit.Color; +import org.bukkit.Location; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.util.Vector; + +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.particles.ColoredParticle; +import mineplex.core.common.util.particles.DustSpellColor; + +public class LineEffect extends Effect +{ + + private int _particles = 100; + private Color _color; + private int _count = 0; + private Vector _vector; + private Location _fixedLoc; + + public LineEffect(JavaPlugin plugin, Location location, Location target, Color color) + { + super(-1, new EffectLocation(location), plugin); + setTargetLocation(new EffectLocation(target)); + _color = color; + } + + @Override + public void runEffect() + { + Location location = _effectLocation.getFixedLocation().clone().add(0, 1, 0); + if (_vector == null) + { + Location targetLoc = getTargetLocation().getFixedLocation().clone(); + Vector link = targetLoc.toVector().subtract(location.toVector()); + float length = (float) link.length(); + link.normalize(); + Vector vector = link.multiply(length / _particles); + _vector = vector; + _fixedLoc = location.clone().subtract(_vector); + } + ColoredParticle coloredParticle = new ColoredParticle(UtilParticle.ParticleType.RED_DUST, + new DustSpellColor(_color), _effectLocation.getLocation().clone()); + _fixedLoc.add(_vector); + if (_count == _particles) + { + stop(); + } + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java index 21d84d816..75b658660 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java @@ -375,7 +375,7 @@ public class RewardManager addGadget(Type.NORMAL, getGadget(ParticlePartyTime.class), rarity, 12); //Game Modifiers MineStrike - /*addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.AWP_Asiimov, rarity, 200); + addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.AWP_Asiimov, rarity, 200); addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.P90_Asiimov, rarity, 200); addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.SSG_08_Blood_in_the_Water, rarity, 50); addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.Galil_AR_Eco, rarity, 20); @@ -386,14 +386,9 @@ public class RewardManager addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.PP_Bizon_Streak, rarity, 40); addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.CZ75_Auto_Tigris, rarity, 100); addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.Steyr_AUG_Torque, rarity, 30); - addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.XM1014_Tranquility, rarity, 30);*/ - for (MineStrikeSkin skin : MineStrikeSkin.values()) - { - addMineStrikeSkin(Type.MINESTRIKE, skin, rarity, 200); - } - - + addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.XM1014_Tranquility, rarity, 30); + // VALENTINES //Hats addHat(Type.VALENTINES_GIFT, HatType.COMPANION_BLOCK, rarity, 100, 0); @@ -556,7 +551,7 @@ public class RewardManager addGadget(Type.NORMAL, getGadget(WinEffectRiseOfTheElderGuardian.class), rarity, 4); //GameModifier MineStrike - /*addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.AWP_Asiimov, rarity, 8); + addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.AWP_Asiimov, rarity, 8); addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.P90_Asiimov, rarity, 8); addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.Desert_Eagle_Blaze, rarity, 10); addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.Glock_18_Fade, rarity, 20); @@ -565,7 +560,7 @@ public class RewardManager addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.P250_Muertos, rarity, 20); addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.FAMAS_Pulse, rarity, 33); addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.SG553_Pulse, rarity, 33); - addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.AK_47_Vulcan, rarity, 5);*/ + addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.AK_47_Vulcan, rarity, 5); //WINTER diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java index b30413717..ea864c012 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java @@ -356,7 +356,8 @@ public class TreasurePage extends ShopPageBase gingerbreadLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop"); } - List minestrikeLore = Lists.newArrayList(); + // Minestrike Chests not being released in this update! + /*List minestrikeLore = Lists.newArrayList(); minestrikeLore.add(" "); minestrikeLore.add(F.value("Minestrike Chests Owned", "" + minestrikeCount)); minestrikeLore.add(" "); @@ -371,7 +372,7 @@ public class TreasurePage extends ShopPageBase minestrikeLore.add(ChatColor.RESET + "Click to craft for " + C.cAqua + "20000 Treasure Shards"); minestrikeLore.add(" "); minestrikeLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop"); - } + }*/ ShopItem shards = new ShopItem(Material.PRISMARINE_SHARD, C.cAqua + C.Bold + treasureShards + " Treasure Shards", shardLore.toArray(new String[0]), 0, false); @@ -381,7 +382,7 @@ public class TreasurePage extends ShopPageBase ShopItem legendary = new ShopItem(Material.ENDER_CHEST, C.cRed + C.Bold + "Mythical Treasure", legendaryLore.toArray(new String[0]), 0, false, false); ItemStack illuminated = new ShopItem(Material.SEA_LANTERN, C.cDAqua + C.Bold + "Illuminated Treasure", illuminatedLore.toArray(new String[0]), 0, false, false); ItemStack omega = SkinData.OMEGA_CHEST.getSkull(C.cAquaB + "Omega Treasure", omegaLore); - ItemStack minestrike = new ShopItem(Material.GLASS, C.cGoldB + "Minestrike Treasure", minestrikeLore.toArray(new String[0]), 0, false, false); + //ItemStack minestrike = new ShopItem(Material.GLASS, C.cGoldB + "Minestrike Treasure", minestrikeLore.toArray(new String[0]), 0, false, false); // Seasonal chests ItemStack christmas = SkinData.PRESENT.getSkull(C.cDGreen + C.Bold + "Winter Holiday Treasure", christmasLore); @@ -402,7 +403,7 @@ public class TreasurePage extends ShopPageBase TreasurePageItem mythicalTreasureItem = new TreasurePageItem(legendary, legendaryCount, TreasureType.MYTHICAL); TreasurePageItem illuminatedTreasureItem = new TreasurePageItem(illuminated, illuminatedCount, TreasureType.ILLUMINATED); TreasurePageItem omegaTreasureItem = new TreasurePageItem(omega, omegaCount, TreasureType.OMEGA); - TreasurePageItem minestrikeTreasureItem = new TreasurePageItem(minestrike, minestrikeCount, TreasureType.MINESTRIKE); + //TreasurePageItem minestrikeTreasureItem = new TreasurePageItem(minestrike, minestrikeCount, TreasureType.MINESTRIKE); // Seasonal chests TreasurePageItem winterTreasureItem = new TreasurePageItem(christmas, christmasCount, TreasureType.CHRISTMAS); @@ -417,7 +418,7 @@ public class TreasurePage extends ShopPageBase _normalTreasures.add(mythicalTreasureItem); _normalTreasures.add(illuminatedTreasureItem); _normalTreasures.add(omegaTreasureItem); - _normalTreasures.add(minestrikeTreasureItem); + //_normalTreasures.add(minestrikeTreasureItem); _seasonalTreasures.add(winterTreasureItem); _seasonalTreasures.add(freedomTreasureItem); @@ -442,7 +443,7 @@ public class TreasurePage extends ShopPageBase i = 0; } - int[] normalDisplayPositions = new int[]{19, 22, 25, 38, 40, 42}; + int[] normalDisplayPositions = getNormalDisplayOrder(); for (TreasurePageItem treasurePageItem : _normalTreasures) { addChest(treasurePageItem, normalDisplayPositions[i]); @@ -505,6 +506,29 @@ public class TreasurePage extends ShopPageBase return new int[]{4}; } + private int[] getNormalDisplayOrder() + { + int seasonalTreasuresSize = _seasonalTreasures.size(); + switch (seasonalTreasuresSize) + { + case 5: + return new int[]{20, 22, 24, 39, 41}; + case 6: + return new int[]{19, 21, 23, 25, 38, 42}; + case 7: + return new int[]{19, 21, 23, 25, 38, 40, 42}; + case 8: + return new int[]{19, 21, 23, 25, 37, 39, 41, 43}; + case 9: + return new int[]{19, 21, 23, 25, 31, 37, 39, 41, 43}; + case 10: + return new int[]{19, 21, 23, 25, 29, 33, 37, 39, 41, 43}; + case 11: + return new int[]{19, 21, 23, 25, 29, 31, 33, 37, 39, 32, 43}; + } + return new int[]{20, 22, 24, 39, 41}; + } + private int[] getSeasonalDisplayOrder() { int seasonalTreasuresSize = _seasonalTreasures.size(); diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatLog.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatLog.java index 879fc3c30..c2f6329e5 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatLog.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatLog.java @@ -4,14 +4,14 @@ import java.util.HashMap; import java.util.LinkedList; import java.util.List; -import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilTime; -import mineplex.minecraft.game.core.damage.DamageChange; - import org.bukkit.ChatColor; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilTime; +import mineplex.minecraft.game.core.damage.DamageChange; + public class CombatLog { private LinkedList _damager = new LinkedList(); @@ -34,6 +34,7 @@ public class CombatLog { _expireTime = expireTime; _player = new CombatComponent(player.getName(), player); + _lastCombatEngaged = 0; // Just so taunts can be used before pvp } public LinkedList GetAttackers() diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/TauntCommand.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/TauntCommand.java index 2e127a83b..874850719 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/TauntCommand.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/TauntCommand.java @@ -34,7 +34,7 @@ public class TauntCommand extends CommandBase pvp = UtilTime.elapsed(combatManager.Get(player).GetLastCombatEngaged(), 5000 * 60); } TauntCommandEvent event = new TauntCommandEvent(player, _arcadeManager.isGameInProgress(), - _arcadeManager.GetGame().IsAlive(player), UtilPlayer.isSpectator(player), pvp); + _arcadeManager.GetGame().IsAlive(player), UtilPlayer.isSpectator(player), combatManager.Get(player).GetLastCombatEngaged()); Bukkit.getPluginManager().callEvent(event); }