diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java index ab07c5147..db14687ac 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java @@ -29,7 +29,21 @@ public enum Achievement "during Christmas 2015!"}, new int[]{200}, AchievementCategory.HOLIDAY), - + + GLOBAL_GIFT_GIVER_2016("2016 Gift Giver", 2000, + new String[]{"Global.Valentines2016.GiftsGiven"}, + new String[]{"Give 50 Valentines Gifts", + "during Valentines 2016!"}, + new int[]{50}, + AchievementCategory.HOLIDAY), + + GLOBAL_GIFT_GETTER_2016("2016 People Love Me", 2000, + new String[]{"Global.Valentines2016.GiftsReceived"}, + new String[]{"Receive 10 Gifts", + "during Valentines 2016!"}, + new int[]{10}, + AchievementCategory.HOLIDAY), + //Bridges BRIDGES_WINS("Bridge Champion", 600, new String[]{"The Bridges.Wins"}, diff --git a/Plugins/Mineplex.Core/src/mineplex/core/valentines/GiftEffect.java b/Plugins/Mineplex.Core/src/mineplex/core/valentines/GiftEffect.java index 2f0070892..638c15fa1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/valentines/GiftEffect.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/valentines/GiftEffect.java @@ -35,25 +35,25 @@ public class GiftEffect _finished = false; _ticks = 0; - _to.setWalkSpeed(0.0F); - _from.setWalkSpeed(0.0F); +// _to.setWalkSpeed(0.0F); +// _from.setWalkSpeed(0.0F); } public void tick() { _ticks++; - if (_ticks == 20) + if (_ticks == 1) { if (_to.isOnline()) { - UtilTextMiddle.display("", C.cPurple + _from.getName() + " shared a Gift with you", _to); - _to.playSound(_to.getLocation(), Sound.NOTE_PLING, 1f, 1f);; + UtilTextMiddle.display("", C.cYellow + _from.getName() + C.cPurple + " is sharing a Gift with you", _to); + _to.playSound(_to.getLocation(), Sound.CAT_MEOW, 1f, 1f);; } if (_from.isOnline()) { - UtilTextMiddle.display("", C.cPurple + "You shared a Gift with " + _to.getName(), _from); - _from.playSound(_from.getLocation(), Sound.NOTE_PLING, 1f, 1f); + UtilTextMiddle.display("", C.cPurple + "You are sharing a Gift with " + C.cYellow + _to.getName(), _from); + _from.playSound(_from.getLocation(), Sound.CAT_MEOW, 1f, 1f); } } else if (_ticks == 40) @@ -122,8 +122,8 @@ public class GiftEffect { UtilFirework.playFirework(_centerLocation.clone().add(0, 3, 0), FireworkEffect.builder().with(FireworkEffect.Type.STAR).withColor(Color.RED).withFade(Color.WHITE).withFlicker().build()); _finished = true; - if (_to.isOnline()) _to.setWalkSpeed(0.2F); - if (_from.isOnline()) _from.setWalkSpeed(0.2F); +// if (_to.isOnline()) _to.setWalkSpeed(0.2F); +// if (_from.isOnline()) _from.setWalkSpeed(0.2F); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/valentines/ValentinesGiftManager.java b/Plugins/Mineplex.Core/src/mineplex/core/valentines/ValentinesGiftManager.java index a7a5b9ebc..a58a05c10 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/valentines/ValentinesGiftManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/valentines/ValentinesGiftManager.java @@ -10,6 +10,7 @@ import mineplex.core.gadget.GadgetManager; import mineplex.core.inventory.InventoryManager; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.reward.*; +import mineplex.core.stats.StatsManager; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.valentines.event.AttemptGiftEvent; @@ -30,11 +31,12 @@ public class ValentinesGiftManager extends MiniPlugin private RewardManager _rewardManager; private InventoryManager _inventoryManager; private GadgetManager _gadgetManager; + private StatsManager _statsManager; private ValentinesGiftRepository _repository; private LinkedList _effects; - public ValentinesGiftManager(JavaPlugin plugin, CoreClientManager clientManager, RewardManager rewardManager, InventoryManager inventoryManager, GadgetManager gadgetManager) + public ValentinesGiftManager(JavaPlugin plugin, CoreClientManager clientManager, RewardManager rewardManager, InventoryManager inventoryManager, GadgetManager gadgetManager, StatsManager statsManager) { super("Valentines", plugin); @@ -42,6 +44,7 @@ public class ValentinesGiftManager extends MiniPlugin _rewardManager = rewardManager; _inventoryManager = inventoryManager; _gadgetManager = gadgetManager; + _statsManager = statsManager; _repository = new ValentinesGiftRepository(plugin); _effects = new LinkedList<>(); @@ -63,6 +66,9 @@ public class ValentinesGiftManager extends MiniPlugin }); } + /** + * I apologize for this mess. Love, Shaun + */ private void giveGift(Player from, Player to, boolean success) { if (success) @@ -86,6 +92,8 @@ public class ValentinesGiftManager extends MiniPlugin @Override public void run(RewardData fromData) { + + String fromGift = ChatColor.stripColor(fromData.getFriendlyName()); _effects.add(new GiftEffect(from, to, fromGift, toGift, UtilAlg.getMidpoint(to.getLocation(), from.getLocation()))); } @@ -126,4 +134,10 @@ public class ValentinesGiftManager extends MiniPlugin } } + private void incrementStat(Player from, Player to) + { + _statsManager.incrementStat(from, "Global.Valentines2016.GiftsGiven", 1); + _statsManager.incrementStat(to, "Global.Valentines2016.GiftsReceived", 1); + } + } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/valentines/Courtship.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/valentines/Courtship.java index fe867185a..948a334aa 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/valentines/Courtship.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/valentines/Courtship.java @@ -2,6 +2,7 @@ package mineplex.hub.modules.valentines; import org.bukkit.DyeColor; import org.bukkit.Sound; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSheep; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.entity.Sheep; @@ -176,6 +177,7 @@ public class Courtship if (_tick == 130) { _sheep.setColor(DyeColor.PINK); + ((CraftSheep) _sheep).getHandle().setFakeHead(false); return true; }