From 673dd327ff624c698269cc2de45f1b54c5f04dd0 Mon Sep 17 00:00:00 2001 From: phobia Date: Sat, 2 Apr 2016 20:29:56 +1100 Subject: [PATCH] Push for shaun Fireworks --- .../core/common/block/DataLocationMap.java | 20 +++++++++++ .../common/block/schematic/Schematic.java | 32 ++++++++++++++++++ .../core/common/util/UtilFirework.java | 10 ++++++ .../tutorial/objective/ObjectiveGoal.java | 33 +++++++++++++++---- .../objective/PurchaseItemsObjective.java | 25 +++++++++++++- .../clans/objective/goals/HoldItemGoal.java | 2 +- .../goals/attackenemy/BlowUpWallGoal.java | 4 ++- .../goals/attackenemy/GetMapGoal.java | 3 +- .../goals/attackenemy/LoadCannonGoal.java | 3 +- .../goals/attackenemy/MountCannonGoal.java | 4 ++- .../attackenemy/StealEnemyPotatoesGoal.java | 4 ++- .../objective/goals/clan/BuildHouseGoal.java | 4 ++- .../objective/goals/clan/ClaimLandGoal.java | 4 ++- .../objective/goals/clan/ClanInfoGoal.java | 3 +- .../goals/clan/ClanManagementGoal.java | 3 +- .../objective/goals/clan/CreateClanGoal.java | 3 +- .../objective/goals/clan/LeaveSpawnGoal.java | 6 ++-- .../objective/goals/clan/SetHomeGoal.java | 4 ++- .../goals/classes/EquipDefaultBuildGoal.java | 3 +- .../goals/classes/OpenClassManagerGoal.java | 4 ++- .../goals/classes/UseBullsChargeGoal.java | 3 +- .../objective/goals/energy/BuyEnergyGoal.java | 4 ++- .../goals/energy/ExplainEnergyGoal.java | 3 +- .../goals/fields/GoToFieldsGoal.java | 3 +- .../goals/fields/MineDiamondsGoal.java | 4 ++- .../goals/fields/SellDiamondsGoal.java | 3 +- .../goals/finalobj/DisbandClanGoal.java | 18 ++++++++-- .../goals/finalobj/TpClanHomeGoal.java | 3 +- .../objective/goals/shops/GoToShopsGoal.java | 3 +- .../objective/goals/shops/PurchaseGoal.java | 2 +- .../goals/shops/SellPotatoesGoal.java | 3 +- 31 files changed, 188 insertions(+), 35 deletions(-) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/block/DataLocationMap.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/block/DataLocationMap.java index 03960a50a..147732edd 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/block/DataLocationMap.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/block/DataLocationMap.java @@ -12,11 +12,13 @@ public class DataLocationMap { private EnumMap> _goldDataMap; private EnumMap> _ironDataMap; + private EnumMap> _spongeDataMap; public DataLocationMap() { _goldDataMap = new EnumMap<>(DyeColor.class); _ironDataMap = new EnumMap<>(DyeColor.class); + _spongeDataMap = new EnumMap<>(DyeColor.class); } public List getGoldLocations(DyeColor color) @@ -59,5 +61,23 @@ public class DataLocationMap } } + public void addSpongeLocation(DyeColor color, Location location) { + if (_spongeDataMap.containsKey(color)) + { + _spongeDataMap.get(color).add(location); + } + else + { + List list = new ArrayList<>(); + list.add(location); + _spongeDataMap.put(color, list); + } + } + + public List getSpongeLocations(DyeColor color) + { + List list = _spongeDataMap.get(color); + return list == null ? Collections.emptyList() : list; + } } diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/block/schematic/Schematic.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/block/schematic/Schematic.java index b9cb080f6..43e8d5c8e 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/block/schematic/Schematic.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/block/schematic/Schematic.java @@ -59,6 +59,11 @@ public class Schematic if (addDataWool(locationMap, false, originLocation, x, y - 1, z)) continue; } + else if (materialId == Material.SPONGE.getId()) + { + if (addSpongeLocation(locationMap, originLocation, x, y + 1, z)) + continue; + } else if (materialId == 35) { // Check if this is a dataloc so we can skip setting the block @@ -68,7 +73,14 @@ public class Schematic if (Math.abs(_blocks[aboveIndex]) == Material.GOLD_PLATE.getId() || Math.abs(_blocks[aboveIndex]) == Material.IRON_PLATE.getId()) continue; } + int belowIndex = getIndex(x, y - 1, z); + if (hasIndex(belowIndex)) + { + if(Math.abs(_blocks[belowIndex]) == Material.SPONGE.getId()) + continue; + } } + UtilBlock.setQuick(originLocation.getWorld(), startX + x, startY + y, startZ + z, materialId, _blockData[index]); } @@ -110,6 +122,26 @@ public class Schematic return false; } + private boolean addSpongeLocation(DataLocationMap map, Location origin, int x, int y, int z) + { + int index = getIndex(x, y, z); + if (hasIndex(index)) + { + int materialId = Math.abs(_blocks[index]); + if (materialId == 35) // WOOL + { + byte data = _blockData[index]; + DyeColor color = DyeColor.getByWoolData(data); + if (color != null) + { + map.addSpongeLocation(color, origin.clone().add(x, y - 1, z)); + return true; + } + } + } + return false; + } + public int getSize() { return _blocks.length; diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilFirework.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilFirework.java index c017bab66..9118dba81 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilFirework.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilFirework.java @@ -98,4 +98,14 @@ public class UtilFirework UtilPlayer.sendPacket(viewing, packet); } } + + public void spawnRandomFirework(Location location) + { + playFirework(location, + Type.values()[UtilMath.r(Type.values().length)], + Color.fromRGB(UtilMath.r(256), UtilMath.r(256), UtilMath.r(256)), + UtilMath.random.nextBoolean(), + UtilMath.random.nextBoolean() + ); + } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/ObjectiveGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/ObjectiveGoal.java index 43bfad084..448db9176 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/ObjectiveGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/ObjectiveGoal.java @@ -1,11 +1,13 @@ package mineplex.game.clans.tutorial.objective; -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; +import java.util.*; -import org.bukkit.Bukkit; +import mineplex.core.common.util.UtilFirework; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import org.bukkit.*; import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import mineplex.core.common.util.C; @@ -25,13 +27,14 @@ public abstract class ObjectiveGoal implements Listener private int _startMessageDelay; private boolean _displayFinishMessage; private int _finishMessageDelay; + private DyeColor _fireworkLocations; public ObjectiveGoal(T objective, String name, String description) { - this(objective, name, description, null); + this(objective, name, description, null, null); } - public ObjectiveGoal(T objective, String name, String description, String extraDescription) + public ObjectiveGoal(T objective, String name, String description, String extraDescription, DyeColor fireworkLocs) { _objective = objective; @@ -43,6 +46,7 @@ public abstract class ObjectiveGoal implements Listener _startMessageDelay = 40; _displayFinishMessage = true; _finishMessageDelay = 1; + _fireworkLocations = fireworkLocs; } public String getName(Player player) @@ -192,4 +196,21 @@ public abstract class ObjectiveGoal implements Listener { _finishMessageDelay = finishMessageDelay; } + + @EventHandler + public void update(UpdateEvent event) { + if(!event.getType().equals(UpdateType.SEC_05)) return; + if (_fireworkLocations == null) return; + + for (UUID id : getActivePlayers()) + { + if (Bukkit.getPlayer(id) == null) continue; + List locations = getObjective().getPlugin().getRegion(Bukkit.getPlayer(id)).getLocationMap().getSpongeLocations(_fireworkLocations); + if (locations == null) continue; + for(Location loc : locations) + { + UtilFirework.playFirework(loc, FireworkEffect.Type.BURST, Color.AQUA, true, true); + } + } + } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/PurchaseItemsObjective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/PurchaseItemsObjective.java index d02bfeb15..5e1c5c068 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/PurchaseItemsObjective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/PurchaseItemsObjective.java @@ -1,13 +1,20 @@ package mineplex.game.clans.tutorial.tutorials.clans.objective; -import org.bukkit.Material; +import mineplex.core.common.util.UtilFirework; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import org.bukkit.*; import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; import org.bukkit.plugin.java.JavaPlugin; import mineplex.game.clans.tutorial.objective.UnorderedObjective; import mineplex.game.clans.tutorial.tutorials.clans.ClansMainTutorial; import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.shops.PurchaseGoal; +import java.util.List; +import java.util.UUID; + public class PurchaseItemsObjective extends UnorderedObjective { public PurchaseItemsObjective(ClansMainTutorial clansMainTutorial, JavaPlugin javaPlugin) @@ -38,4 +45,20 @@ public class PurchaseItemsObjective extends UnorderedObjective locations = getPlugin().getRegion(player).getLocationMap().getSpongeLocations(DyeColor.BROWN); + if (locations == null) continue; + for(Location loc : locations) + { + UtilFirework.playFirework(loc, FireworkEffect.Type.BURST, Color.AQUA, true, true); + } + } + } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/HoldItemGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/HoldItemGoal.java index 858a2f63a..9897e0d33 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/HoldItemGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/HoldItemGoal.java @@ -19,7 +19,7 @@ public class HoldItemGoal extends ObjectiveGoal public HoldItemGoal(Objective objective, Material material, String name, String description, String helpText, int startDelay) { - super(objective, name, description, helpText); + super(objective, name, description, helpText, null); _material = material; diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/BlowUpWallGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/BlowUpWallGoal.java index 551743138..be6b4ae61 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/BlowUpWallGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/BlowUpWallGoal.java @@ -2,6 +2,7 @@ package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy import java.util.HashMap; +import org.bukkit.DyeColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; @@ -28,7 +29,8 @@ public class BlowUpWallGoal extends ObjectiveGoal objective, "Blow up the Enemy Base", "Left-Click whilst sitting on the cannon to fire", - "This is the fun part. Use the Cannon to smash a hole in your enemy’s wall KA-BOOM!" + "This is the fun part. Use the Cannon to smash a hole in your enemy’s wall KA-BOOM!", + DyeColor.MAGENTA ); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/GetMapGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/GetMapGoal.java index e38c8e828..88622c78e 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/GetMapGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/GetMapGoal.java @@ -23,7 +23,8 @@ public class GetMapGoal extends ObjectiveGoal "You can get a Map any time you need one. The map will show you who " + "owns the land around the map. Your clan is " + C.cAqua + "aqua" + C.mBody + ", your allies are " + C.cGreen + "green" + C.mBody + ", " + - "and your enemies are " + C.cRed + "red" + C.mBody + "." + "and your enemies are " + C.cRed + "red" + C.mBody + ".", + null ); setStartMessageDelay(120); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/LoadCannonGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/LoadCannonGoal.java index a42d2f2e5..8fb911aca 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/LoadCannonGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/LoadCannonGoal.java @@ -18,7 +18,8 @@ public class LoadCannonGoal extends ObjectiveGoal "Load the Cannon", "Right click whilst sitting on the Cannon, and load it with TNT!", "First you’ll need to load this baby up with some TNT. Right click whilst sitting " + - "on the Cannon, and load it with TNT!" + "on the Cannon, and load it with TNT!", + null ); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/MountCannonGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/MountCannonGoal.java index b93c9411e..1a5b3fcc0 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/MountCannonGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/MountCannonGoal.java @@ -3,6 +3,7 @@ package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy import java.util.HashMap; import java.util.Map; +import org.bukkit.DyeColor; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -25,7 +26,8 @@ public class MountCannonGoal extends ObjectiveGoal "Get on the Cannon", "Right click on the Cannon to hop on!", "To break through an enemy Clan’s fortress you’ll need some serious " + - "firepower. Try using this TNT Cannon to get the job done!" + "firepower. Try using this TNT Cannon to get the job done!", + DyeColor.BLACK ); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/StealEnemyPotatoesGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/StealEnemyPotatoesGoal.java index b070d1e07..a13c6ba75 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/StealEnemyPotatoesGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/StealEnemyPotatoesGoal.java @@ -4,6 +4,7 @@ import java.util.UUID; import java.util.concurrent.atomic.AtomicInteger; import org.bukkit.Bukkit; +import org.bukkit.DyeColor; import org.bukkit.Material; import org.bukkit.entity.Creature; import org.bukkit.entity.Player; @@ -32,7 +33,8 @@ public class StealEnemyPotatoesGoal extends ObjectiveGoal "Steal Potatoes", "Retrieve the potatoes from the Enemy Clan’s base", "Now that their walls are down, it’s time to get rich! Go steal their " + - "potatoes for your Clan!" + "potatoes for your Clan!", + DyeColor.PURPLE ); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/BuildHouseGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/BuildHouseGoal.java index 0187a6f98..989af681b 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/BuildHouseGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/BuildHouseGoal.java @@ -2,6 +2,7 @@ package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan; import java.util.List; +import org.bukkit.DyeColor; import org.bukkit.Effect; import org.bukkit.Material; import org.bukkit.Sound; @@ -40,7 +41,8 @@ public class BuildHouseGoal extends ObjectiveGoal "Build a House", "Build a House (place all your blocks)", "The first thing you should do on your land is build a house, even " + - "if it’s made of dirt! This will give you a safe place to store your loot!" + "if it’s made of dirt! This will give you a safe place to store your loot!", + DyeColor.ORANGE ); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/ClaimLandGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/ClaimLandGoal.java index 121da7567..ca71fc0fd 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/ClaimLandGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/ClaimLandGoal.java @@ -3,6 +3,7 @@ package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan; import java.util.List; import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; +import org.bukkit.DyeColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.Player; @@ -27,7 +28,8 @@ public class ClaimLandGoal extends ObjectiveGoal "Claim Land", "Claim Land using the Clan Menu ( Type /c )", "The first thing your Clan needs to do before you can start to " + - "build your fortress is claim the land in an area for your Clan." + "build your fortress is claim the land in an area for your Clan.", + DyeColor.ORANGE ); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/ClanInfoGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/ClanInfoGoal.java index e0c6495f2..11f5add7a 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/ClanInfoGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/ClanInfoGoal.java @@ -28,7 +28,8 @@ public class ClanInfoGoal extends ObjectiveGoal "View info about the enemy clan by typing /c EnemyClan", "You can lookup details about your enemy before going for an " + "attack! This can give you a crucial advantage before " + - "you begin." + "you begin.", + null ); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/ClanManagementGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/ClanManagementGoal.java index 3fa8fe462..7a1b4407a 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/ClanManagementGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/ClanManagementGoal.java @@ -24,7 +24,8 @@ public class ClanManagementGoal extends ObjectiveGoal "Open the Clan Menu", "Open the Clan Menu ( Type /c )", "Clan Menu lets you view all clan information and perform actions: " + - "who is online, Claiming Land, Inviting Players and much more." + "who is online, Claiming Land, Inviting Players and much more.", + null ); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/CreateClanGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/CreateClanGoal.java index 010847631..ce75703a6 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/CreateClanGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/CreateClanGoal.java @@ -21,7 +21,8 @@ public class CreateClanGoal extends ObjectiveGoal "Type /c create to create a new Clan", F.elem("Clans") + " are groups of players that can claim land, build fortresses, " + "and fight epic battles. Together they will challenge other clans for " + - "control of the land." + "control of the land.", + null ); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/LeaveSpawnGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/LeaveSpawnGoal.java index 94a7a404d..d74ad75c3 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/LeaveSpawnGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/LeaveSpawnGoal.java @@ -4,6 +4,7 @@ import java.util.HashSet; import java.util.UUID; import org.bukkit.Bukkit; +import org.bukkit.DyeColor; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -29,7 +30,8 @@ public class LeaveSpawnGoal extends ObjectiveGoal F.elem("Spawn Island") + " is where you will respawn when you die. This area is " + "a " + F.elem("Safe Zone") + ", meaning that players cannot hurt each other. " + "From here, you can teleport to various places, as well as read some helpful " + - "hints. To leave " + F.elem("Spawn Island") + ", simply jump off!" + "hints. To leave " + F.elem("Spawn Island") + ", simply jump off!", + DyeColor.WHITE ); // 2 seconds after start message @@ -45,7 +47,7 @@ public class LeaveSpawnGoal extends ObjectiveGoal @Override protected void customStart(Player player) { - + player.getInventory().clear(); } @Override diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/SetHomeGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/SetHomeGoal.java index bf9137780..14625997c 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/SetHomeGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/SetHomeGoal.java @@ -2,6 +2,7 @@ package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan; import mineplex.core.common.util.UtilBlock; import net.minecraft.server.v1_8_R3.EnumDirection; +import org.bukkit.DyeColor; import org.bukkit.block.BlockFace; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -24,7 +25,8 @@ public class SetHomeGoal extends ObjectiveGoal "Set your Clan's Home ( Type /c sethome )", "Your Clan Home is a special place in your base that you can teleport " + "to from " + F.elem("Spawn Island") + ". You can teleport to it " + - "at any time by typing " + F.elem("/c home") + "." + "at any time by typing " + F.elem("/c home") + ".", + DyeColor.ORANGE ); setDisplayFinishMessage(false); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/classes/EquipDefaultBuildGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/classes/EquipDefaultBuildGoal.java index 4772ed37b..637ffd2b3 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/classes/EquipDefaultBuildGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/classes/EquipDefaultBuildGoal.java @@ -16,7 +16,8 @@ public class EquipDefaultBuildGoal extends ObjectiveGoal "Equip Armor", "Put on your Iron Armor", "When you wear a full set of armor, it will equip a class! The Iron set makes you " + - "into a Knight. Each class has different skills and is strong in its own way." + "into a Knight. Each class has different skills and is strong in its own way.", + null ); setStartMessageDelay(120); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/classes/OpenClassManagerGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/classes/OpenClassManagerGoal.java index a1cf2d055..50cb18704 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/classes/OpenClassManagerGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/classes/OpenClassManagerGoal.java @@ -1,5 +1,6 @@ package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.classes; +import org.bukkit.DyeColor; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -20,7 +21,8 @@ public class OpenClassManagerGoal extends ObjectiveGoal "Right-Click on the Enchantment Table", "Each class has lots of different skills, and you can pick which ones you want to " + "equip! Click on an " + F.elem("Enchanting Table") + " to have a look at " + - "this menu." + "this menu.", + DyeColor.CYAN ); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/classes/UseBullsChargeGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/classes/UseBullsChargeGoal.java index d2a716d2a..99cafa74b 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/classes/UseBullsChargeGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/classes/UseBullsChargeGoal.java @@ -23,7 +23,8 @@ public class UseBullsChargeGoal extends ObjectiveGoal { "Use Bulls Charge", "Right-Click with Axe to use Bull's Charge", "One of your default abilities as Knight is Bulls Charge. This ability will make " + - "you run faster for a short time, and deal extra damage to enemies." + "you run faster for a short time, and deal extra damage to enemies.", + null ); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/energy/BuyEnergyGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/energy/BuyEnergyGoal.java index 0aa7db2df..ba592560e 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/energy/BuyEnergyGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/energy/BuyEnergyGoal.java @@ -1,5 +1,6 @@ package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.energy; +import org.bukkit.DyeColor; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -16,7 +17,8 @@ public class BuyEnergyGoal extends ObjectiveGoal objective, "Buy Energy", "Buy Clan Energy from the Energy Shop", - "You can buy Clan Energy at the Shops." + "You can buy Clan Energy at the Shops.", + DyeColor.RED ); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/energy/ExplainEnergyGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/energy/ExplainEnergyGoal.java index 8f8058cad..64de4157d 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/energy/ExplainEnergyGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/energy/ExplainEnergyGoal.java @@ -23,7 +23,8 @@ public class ExplainEnergyGoal extends ObjectiveGoal "Look at your energy in your Clans Menu ( Type /c )", "Owning land isn’t free! You will need to buy Energy from the Shops to retain " + "ownership of it. If your Clan Energy ever reaches 0, you will lose your " + - "land claims!" + "land claims!", + null ); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/fields/GoToFieldsGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/fields/GoToFieldsGoal.java index 9281515cb..6b3dab0f6 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/fields/GoToFieldsGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/fields/GoToFieldsGoal.java @@ -25,7 +25,8 @@ public class GoToFieldsGoal extends ObjectiveGoal "Go to the Fields", "Go to the Fields", "The Fields are a very dangerous place where players come to fight and harvest " + - "resources!" + "resources!", + DyeColor.YELLOW ); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/fields/MineDiamondsGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/fields/MineDiamondsGoal.java index 47506ed95..463bf5957 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/fields/MineDiamondsGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/fields/MineDiamondsGoal.java @@ -5,6 +5,7 @@ import java.util.UUID; import java.util.concurrent.atomic.AtomicInteger; import org.bukkit.Bukkit; +import org.bukkit.DyeColor; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -30,7 +31,8 @@ public class MineDiamondsGoal extends ObjectiveGoal "Mine Diamonds", "Search for some diamonds in the Fields and mine them", "Mining in the Fields is a great way to make lots of money! The ores will " + - "regenerate over time. Be careful of enemies though!" + "regenerate over time. Be careful of enemies though!", + DyeColor.LIME ); _playersMap = new HashMap<>(); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/fields/SellDiamondsGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/fields/SellDiamondsGoal.java index 1a14e6a3c..8c1792dd7 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/fields/SellDiamondsGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/fields/SellDiamondsGoal.java @@ -20,7 +20,8 @@ public class SellDiamondsGoal extends ObjectiveGoal objective, "Sell Diamonds", "Sell your Diamonds to the Mining Shop", - "Go back to the Shops and sell your precious diamonds!" + "Go back to the Shops and sell your precious diamonds!", + DyeColor.GRAY ); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/finalobj/DisbandClanGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/finalobj/DisbandClanGoal.java index 2feef0100..c5d9b5eb3 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/finalobj/DisbandClanGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/finalobj/DisbandClanGoal.java @@ -1,7 +1,9 @@ package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.finalobj; +import mineplex.core.updater.event.UpdateEvent; import mineplex.game.clans.clans.event.ClanDisbandedEvent; import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; +import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -14,6 +16,7 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.game.clans.clans.ClansManager; import mineplex.game.clans.clans.event.ClansCommandExecutedEvent; import mineplex.game.clans.tutorial.tutorials.clans.objective.FinalObjective; +import org.jooq.Update; public class DisbandClanGoal extends ObjectiveGoal { @@ -25,7 +28,8 @@ public class DisbandClanGoal extends ObjectiveGoal "Disband your Clan ( Type /c )", "Now that the tutorial is almost finished, let’s delete your Clan. Disbanding a " + "Clan will delete it, and unclaim all of your land. Open the Clans Menu " + - "and do this now." + "and do this now.", + null ); } @@ -37,7 +41,7 @@ public class DisbandClanGoal extends ObjectiveGoal @Override protected void customFinish(Player player) { - ClansManager.getInstance().resetLeftTimer(player.getUniqueId()); + } @EventHandler(priority = EventPriority.HIGHEST) @@ -52,9 +56,19 @@ public class DisbandClanGoal extends ObjectiveGoal UtilPlayer.message(event.getDisbander(), F.main("Clans", "You have disbanded your Tutorial Clan.")); ClansManager.getInstance().getClanDataAccess().delete(ClansManager.getInstance().getClan(event.getDisbander()), null); ClansManager.getInstance().resetLeftTimer(event.getDisbander().getUniqueId()); + + Bukkit.getScheduler().runTaskLater(getObjective().getJavaPlugin(), () -> { + + }, 500L); finish(event.getDisbander()); } + @EventHandler + public void update(UpdateEvent event) + { + //TODO FINISH fireworks boom boom - chiss + } + @EventHandler (priority = EventPriority.HIGHEST) public void onClick(ClansButtonClickEvent event) { diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/finalobj/TpClanHomeGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/finalobj/TpClanHomeGoal.java index c7b189ec5..68e23571f 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/finalobj/TpClanHomeGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/finalobj/TpClanHomeGoal.java @@ -23,7 +23,8 @@ public class TpClanHomeGoal extends ObjectiveGoal objective, "Teleport to Clan Home", "Teleport back to your Clan Home ( Type /c home )", - "You can teleport back to your Clan Home at any time, as long as it's set!" + "You can teleport back to your Clan Home at any time, as long as it's set!", + null ); setStartMessageDelay(120); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/shops/GoToShopsGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/shops/GoToShopsGoal.java index 92aba23d7..303230475 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/shops/GoToShopsGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/shops/GoToShopsGoal.java @@ -24,7 +24,8 @@ public class GoToShopsGoal extends ObjectiveGoal objective, "Go to the Shops", "Head over to the Shops (use your map)", - "The shops are the place where you can buy and sell all sorts of items!" + "The shops are the place where you can buy and sell all sorts of items!", + DyeColor.LIGHT_BLUE ); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/shops/PurchaseGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/shops/PurchaseGoal.java index dfe7d5139..aee3422cc 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/shops/PurchaseGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/shops/PurchaseGoal.java @@ -25,7 +25,7 @@ public class PurchaseGoal extends ObjectiveGoal public PurchaseGoal(Objective objective, Material material, String name, String description, String helpText) { - super(objective, name, description, helpText); + super(objective, name, description, helpText, null); _material = material; setDisplayStartMessage(false); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/shops/SellPotatoesGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/shops/SellPotatoesGoal.java index 7b51f0ce1..38b79d222 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/shops/SellPotatoesGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/shops/SellPotatoesGoal.java @@ -22,7 +22,8 @@ public class SellPotatoesGoal extends ObjectiveGoal "Sell your Potatoes to the " + F.elem("Organic Produce Shop NPC") + ".", "Farming is a great way to make money in Clans. Build a farm in your land, " + "harvest " + - "the crops and sell it to the shops for profit!" + "the crops and sell it to the shops for profit!", + DyeColor.PINK ); }