From 44abf8f1e2275da367ab0c24b65cde68dedf0a1b Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Thu, 31 Mar 2016 16:47:16 +1100 Subject: [PATCH 01/12] Naming fixes --- .../tutorials/clans/objective/AttackEnemyObjective.java | 4 ++-- .../tutorial/tutorials/clans/objective/ClanObjective.java | 3 +-- .../clans/objective/goals/attackenemy/BlowUpWallGoal.java | 2 +- .../clans/objective/goals/attackenemy/LoadCannonGoal.java | 2 +- .../clans/objective/goals/attackenemy/MountCannonGoal.java | 2 +- .../objective/goals/attackenemy/StealEnemyPotatoesGoal.java | 2 +- .../tutorials/clans/objective/goals/clan/BuildHouseGoal.java | 2 +- .../clans/objective/goals/clan/ClanManagementGoal.java | 2 +- .../tutorials/clans/objective/goals/clan/SetHomeGoal.java | 2 +- 9 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java index 00c7eea61..285dececb 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java @@ -24,11 +24,11 @@ public class AttackEnemyObjective extends OrderedObjective public AttackEnemyObjective(ClansMainTutorial clansMainTutorial, JavaPlugin javaPlugin) { - super(clansMainTutorial, javaPlugin, "Attack Enemy", "Attack and raid this enemy!"); + super(clansMainTutorial, javaPlugin, "Enemy Clans", "Attack and raid this enemy!"); _cannon = new HashMap<>(); addGoal(new GetMapGoal(this)); - addGoal(new HoldItemGoal(this, Material.MAP, "Identify Enemy Clan", "By looking at your map, identify your new enemy")); + addGoal(new HoldItemGoal(this, Material.MAP, "Locate Enemy on Map", "By looking at your map, identify your new enemy")); addGoal(new MountCannonGoal(this)); addGoal(new LoadCannonGoal(this)); addGoal(new BlowUpWallGoal(this)); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/ClanObjective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/ClanObjective.java index e8b2b4a7a..af1d57fdb 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/ClanObjective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/ClanObjective.java @@ -13,12 +13,11 @@ public class ClanObjective extends OrderedObjective { public ClanObjective(ClansMainTutorial clansMainTutorial, JavaPlugin javaPlugin) { - super(clansMainTutorial, javaPlugin, "Clans", "Create clan with /c create "); + super(clansMainTutorial, javaPlugin, "Clan Basics", "Create clan with /c create "); addGoal(new LeaveSpawnGoal(this)); addGoal(new CreateClanGoal(this)); addGoal(new ClanManagementGoal(this)); - addGoal(new ClanDetailsGoal(this)); addGoal(new ClanInfoGoal(this)); addGoal(new ClaimLandGoal(this)); addGoal(new BuildHouseGoal(this)); 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 082b7f0ee..fa7df76c4 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 @@ -24,7 +24,7 @@ public class BlowUpWallGoal extends ObjectiveGoal { public BlowUpWallGoal(AttackEnemyObjective objective) { - super(objective, "Attack Enemy", "Attack enemy clan! Blow a hole in their base by Left-Clicking to fire the Cannon."); + super(objective, "Blow up the Enemy Base", "Attack enemy clan! Blow a hole in their base by Left-Clicking to fire the Cannon."); } @Override 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 2dd2d056c..78a48a6ad 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 @@ -13,7 +13,7 @@ public class LoadCannonGoal extends ObjectiveGoal { public LoadCannonGoal(AttackEnemyObjective objective) { - super(objective, "Load Cannon", "Right click to open the Cannon, and load it with TNT!"); + super(objective, "Load the Cannon", "Right click to open the Cannon, and load it with TNT!"); } @Override 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 54cfe9b0e..abe677db9 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 @@ -20,7 +20,7 @@ public class MountCannonGoal extends ObjectiveGoal { public MountCannonGoal(AttackEnemyObjective objective) { - super(objective, "Get on Cannon", "Right click on the Cannon to hop on!"); + super(objective, "Get on the Cannon", "Right click on the Cannon to hop on!"); } @Override 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 2e381d2c9..fda9e8830 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 @@ -27,7 +27,7 @@ public class StealEnemyPotatoesGoal extends ObjectiveGoal public StealEnemyPotatoesGoal(AttackEnemyObjective objective) { - super(objective, "Steal Enemy Potatoes", "Steal the enemy's potatoes"); + super(objective, "Steal Potatoes", "Steal the enemy's potatoes"); } @Override 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 208696b65..15ab7376b 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 @@ -35,7 +35,7 @@ public class BuildHouseGoal extends ObjectiveGoal public BuildHouseGoal(ClanObjective objective) { - super(objective, "Build House", "Build a Stone Brick house. (Place all your blocks)"); + super(objective, "Build a House", "Build a Stone Brick house. (Place all your blocks)"); } @Override 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 68deb498c..95f71c7a4 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 @@ -17,7 +17,7 @@ public class ClanManagementGoal extends ObjectiveGoal { public ClanManagementGoal(ClanObjective objective) { - super(objective, "Manage your clan", "Manage your clan by using the command /c"); + super(objective, "Open the Clan Menu", "Manage your clan by using the command /c"); } @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 041126606..907f628c0 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 @@ -18,7 +18,7 @@ public class SetHomeGoal extends ObjectiveGoal { public SetHomeGoal(ClanObjective objective) { - super(objective, "Set Home", "Set your Clan's home by typing /c sethome"); + super(objective, "Set Clan Home", "Set your Clan's home by typing /c sethome"); } @Override From 50518250dee355e9548af9f73dce4f5957046351 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Thu, 31 Mar 2016 17:02:38 +1100 Subject: [PATCH 02/12] PC-51 - Rename randomClan to EnemyClan --- .../clans/objective/AttackEnemyObjective.java | 2 ++ .../clans/objective/ClanObjective.java | 1 - .../objective/goals/clan/ClanInfoGoal.java | 29 ++++++++++--------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java index 285dececb..5d9e90d9c 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java @@ -13,6 +13,7 @@ import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy. import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy.LoadCannonGoal; import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy.MountCannonGoal; import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy.StealEnemyPotatoesGoal; +import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan.ClanInfoGoal; import java.util.HashMap; import java.util.Map; @@ -29,6 +30,7 @@ public class AttackEnemyObjective extends OrderedObjective addGoal(new GetMapGoal(this)); addGoal(new HoldItemGoal(this, Material.MAP, "Locate Enemy on Map", "By looking at your map, identify your new enemy")); + addGoal(new ClanInfoGoal(this)); addGoal(new MountCannonGoal(this)); addGoal(new LoadCannonGoal(this)); addGoal(new BlowUpWallGoal(this)); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/ClanObjective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/ClanObjective.java index af1d57fdb..f01ad1eeb 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/ClanObjective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/ClanObjective.java @@ -18,7 +18,6 @@ public class ClanObjective extends OrderedObjective addGoal(new LeaveSpawnGoal(this)); addGoal(new CreateClanGoal(this)); addGoal(new ClanManagementGoal(this)); - addGoal(new ClanInfoGoal(this)); addGoal(new ClaimLandGoal(this)); addGoal(new BuildHouseGoal(this)); addGoal(new SetHomeGoal(this)); 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 c1a4d273d..a5c0ba03d 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 @@ -1,8 +1,6 @@ package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan; -import mineplex.core.common.util.Callback; -import mineplex.core.common.util.F; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilTime; import mineplex.game.clans.clans.ClanInfo; @@ -12,7 +10,7 @@ import mineplex.game.clans.clans.ClansPlayer; import mineplex.game.clans.clans.event.ClansCommandPreExecutedEvent; import mineplex.game.clans.core.repository.tokens.ClanToken; import mineplex.game.clans.tutorial.objective.ObjectiveGoal; -import mineplex.game.clans.tutorial.tutorials.clans.objective.ClanObjective; +import mineplex.game.clans.tutorial.tutorials.clans.objective.AttackEnemyObjective; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -20,17 +18,16 @@ import java.sql.Timestamp; import java.util.UUID; -public class ClanInfoGoal extends ObjectiveGoal +public class ClanInfoGoal extends ObjectiveGoal { - public ClanInfoGoal(ClanObjective objective) + public ClanInfoGoal(AttackEnemyObjective objective) { - super(objective, "Info on other clan", "Get info on other clans by using the command /c "); + super(objective, "Lookup Enemy Details", "View info about the enemy clan by typing /c EnemyClan"); } @Override protected void customStart(Player player) { - player.sendMessage(F.main("Clans", "You can use the command /c to get information about other clans. Try typing /c randomClan")); } @Override @@ -46,23 +43,27 @@ public class ClanInfoGoal extends ObjectiveGoal if(event.getArguments().length < 1) return; event.setCancelled(true); - event.setCancelled(true); + + if (!event.getArguments()[0].equalsIgnoreCase("EnemyClan")) + { + // Display info + return; + } ClanToken token = new ClanToken(); - token.Name = event.getArguments()[0]; - token.Description = "Best clan ever!"; + token.Name = "EnemyClan"; + token.Description = "The meanest clan in the world!"; token.Home = ""; token.Admin = false; token.Energy = 4320; - token.Id = UtilMath.random.nextInt(100); - token.Energy = UtilMath.random.nextInt(1000); + token.Id = -1; token.Kills = UtilMath.random.nextInt(100); token.Murder = UtilMath.random.nextInt(100); token.Deaths = UtilMath.random.nextInt(100); token.WarWins = UtilMath.random.nextInt(100); token.WarLosses = UtilMath.random.nextInt(100); - token.DateCreated = new Timestamp(System.currentTimeMillis()); - token.LastOnline = new Timestamp(System.currentTimeMillis()); + token.DateCreated = new Timestamp(System.currentTimeMillis() - (UtilTime.TimeUnit.DAYS.getMilliseconds() * 10)); + token.LastOnline = new Timestamp(System.currentTimeMillis() - (UtilTime.TimeUnit.DAYS.getMilliseconds() * 1)); ClanInfo clan = new ClanInfo(ClansManager.getInstance(), token); From 7867da277d391c2c310edc6dee68dc535ae8e766 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Thu, 31 Mar 2016 17:05:59 +1100 Subject: [PATCH 03/12] PC-52 - Rename Identify Enemy Clan to Identify Enemy on Map --- .../tutorials/clans/objective/AttackEnemyObjective.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java index 5d9e90d9c..44ff17d15 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java @@ -29,7 +29,7 @@ public class AttackEnemyObjective extends OrderedObjective _cannon = new HashMap<>(); addGoal(new GetMapGoal(this)); - addGoal(new HoldItemGoal(this, Material.MAP, "Locate Enemy on Map", "By looking at your map, identify your new enemy")); + addGoal(new HoldItemGoal(this, Material.MAP, "Identify Enemy on Map", "By looking at your map, identify your new enemy")); addGoal(new ClanInfoGoal(this)); addGoal(new MountCannonGoal(this)); addGoal(new LoadCannonGoal(this)); From 25975e47b8843037260174d2b35c557cc7bd982f Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Thu, 31 Mar 2016 17:07:08 +1100 Subject: [PATCH 04/12] PC-54 - Rename Identify Shops to Identify Shops on Map --- .../tutorial/tutorials/clans/objective/ShopsObjective.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/ShopsObjective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/ShopsObjective.java index 8c0c908ed..984354027 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/ShopsObjective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/ShopsObjective.java @@ -35,7 +35,7 @@ public class ShopsObjective extends OrderedObjective _npcMap = new HashMap<>(); _npcManager = npcManager; - addGoal(new HoldItemGoal(this, Material.MAP, "Identify Shops", "Look at your map and find the shops")); + addGoal(new HoldItemGoal(this, Material.MAP, "Identify Shops on Map", "Look at your map and find the shops")); addGoal(new GoToShopsGoal(this)); addGoal(new SellPotatoesGoal(this)); } From f229da132700bf84ad26172ed9b2dbb61261a6ff Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Thu, 31 Mar 2016 17:08:26 +1100 Subject: [PATCH 05/12] PC-55 - Remove all potatoes from inventory when player completes "Sell Potatoes" --- .../clans/objective/goals/shops/SellPotatoesGoal.java | 4 ++++ 1 file changed, 4 insertions(+) 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 a71f6d9c9..ab8bb42ff 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 @@ -6,6 +6,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilPlayer; import mineplex.game.clans.clans.event.ClansPlayerSellItemEvent; import mineplex.game.clans.tutorial.objective.ObjectiveGoal; @@ -29,6 +30,9 @@ public class SellPotatoesGoal extends ObjectiveGoal { // Shops Fences Closed getObjective().getPlugin().spawnFences(getObjective().getPlugin().getRegion(player), DyeColor.BROWN); + + // Remove all potatoes from inventory + UtilInv.removeAll(player, Material.POTATO_ITEM, (byte) 0); } @EventHandler From c51830145e54183ddabc5af53dea43976afa96c7 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Thu, 31 Mar 2016 17:09:51 +1100 Subject: [PATCH 06/12] PC-58 - Close gate to the fields after you sell diamonds --- .../clans/objective/goals/fields/SellDiamondsGoal.java | 2 ++ 1 file changed, 2 insertions(+) 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 ea95ef419..278a1f7d4 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 @@ -29,6 +29,8 @@ public class SellDiamondsGoal extends ObjectiveGoal { // Close Middle Gate getObjective().getPlugin().destroyFences(getObjective().getPlugin().getRegion(player), DyeColor.RED); + // Close Fields Gate + getObjective().getPlugin().destroyFences(getObjective().getPlugin().getRegion(player), DyeColor.BLACK); } @EventHandler From e7b9d866ae0cb98d4f4aed20085f46b57be2327e Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Thu, 31 Mar 2016 17:10:56 +1100 Subject: [PATCH 07/12] PC-57 - Rename Identify Fields to Identify Fields on Map --- .../tutorial/tutorials/clans/objective/FieldsObjective.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/FieldsObjective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/FieldsObjective.java index 83fc9b181..4b93da67c 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/FieldsObjective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/FieldsObjective.java @@ -18,7 +18,7 @@ public class FieldsObjective extends OrderedObjective { super(clansMainTutorial, javaPlugin, "Fields", "Get various resources by mining for them in the fields"); - addGoal(new HoldItemGoal(this, Material.MAP, "Identify Fields", "Look at your map and find the Fields Region")); + addGoal(new HoldItemGoal(this, Material.MAP, "Identify Fields on Map", "Look at your map and find the Fields Region")); addGoal(new GoToFieldsGoal(this)); addGoal(new MineDiamondsGoal(this)); addGoal(new SellDiamondsGoal(this)); From 7c70092f3bf97bec0cccb85833d49759bcaeaaa5 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Thu, 31 Mar 2016 18:19:06 +1100 Subject: [PATCH 08/12] PC-48 - Create a hologram saying "Jump Off" at the edge of spawn island --- .../tutorials/clans/ClansMainTutorial.java | 16 ++++++++++++++++ .../objective/goals/clan/LeaveSpawnGoal.java | 10 +--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/ClansMainTutorial.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/ClansMainTutorial.java index cae94dc9c..6b05307e6 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/ClansMainTutorial.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/ClansMainTutorial.java @@ -19,6 +19,7 @@ import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.plugin.java.JavaPlugin; +import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilInv; @@ -127,6 +128,21 @@ public class ClansMainTutorial extends Tutorial player.getInventory().clear(); ClansManager.getInstance().getPvpTimer().pause(player); + + // Spawn Holograms + addHologram(player, + getPoint(region, ClansMainTutorial.Point.SPAWN).add(0, 1.5, -6), + C.cGoldB + "Welcome to the Clans Tutorial!", + " ", + "This will teach you the basics of Clans.", + "It will take about 5 minutes to complete.", + "You must complete it before playing Clans.", + " ", + "Walk forward to begin!"); + + addHologram(player, + getPoint(region, ClansMainTutorial.Point.SPAWN).add(0, 1.5, -23), + "Jump Off!"); } @Override 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 e903467cc..16111fb53 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 @@ -24,15 +24,7 @@ public class LeaveSpawnGoal extends ObjectiveGoal @Override protected void setup(Player player, TutorialRegion region) { - getObjective().getPlugin().addHologram(player, - getObjective().getPlugin().getPoint(region, ClansMainTutorial.Point.SPAWN).add(0, 1.5, -6), - C.cGoldB + "Welcome to the Clans Tutorial!", - " ", - "This will teach you the basics of Clans.", - "It will take about 5 minutes to complete.", - "You must complete it before playing Clans.", - " ", - "Walk forward to begin!"); + } @Override From 30a098c645292c350be11e51ca1cbe858eaddf7e Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Thu, 31 Mar 2016 18:24:47 +1100 Subject: [PATCH 09/12] PC-49 - Kick players out of their clan when they start the tutorial if they have one (from previously playing the tutorial). --- .../clans/tutorial/tutorials/clans/ClansMainTutorial.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/ClansMainTutorial.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/ClansMainTutorial.java index 6b05307e6..40fb5637e 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/ClansMainTutorial.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/ClansMainTutorial.java @@ -20,6 +20,7 @@ import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.plugin.java.JavaPlugin; import mineplex.core.common.util.C; +import mineplex.core.common.util.Callback; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilInv; @@ -28,6 +29,7 @@ import mineplex.core.hologram.HologramManager; import mineplex.core.npc.NpcManager; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; +import mineplex.game.clans.clans.ClanInfo; import mineplex.game.clans.clans.ClansManager; import mineplex.game.clans.clans.event.ClansCommandPreExecutedEvent; import mineplex.game.clans.economy.GoldManager; @@ -143,6 +145,12 @@ public class ClansMainTutorial extends Tutorial addHologram(player, getPoint(region, ClansMainTutorial.Point.SPAWN).add(0, 1.5, -23), "Jump Off!"); + + ClanInfo clan = ClansManager.getInstance().getClan(player); + if (clan != null) + { + ClansManager.getInstance().getClanDataAccess().delete(clan, null); + } } @Override From b3392e78f552be3c1ead5d1299e40c0d73a84d9a Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Thu, 31 Mar 2016 20:08:45 +1100 Subject: [PATCH 10/12] PC-28 - Improve Flow of Tutorials --- .../clans/tutorial/objective/Objective.java | 59 +++++++++++++++++++ .../tutorial/objective/ObjectiveGoal.java | 54 ++++++++++++++++- .../clans/objective/AttackEnemyObjective.java | 4 +- .../clans/objective/ClanObjective.java | 3 + .../clans/objective/ClassesObjective.java | 2 + .../clans/objective/EnergyObjective.java | 2 + .../clans/objective/FieldsObjective.java | 2 + .../clans/objective/FinalObjective.java | 2 + .../objective/PurchaseItemsObjective.java | 2 + .../clans/objective/ShopsObjective.java | 2 + .../clans/objective/goals/HoldItemGoal.java | 9 ++- .../goals/attackenemy/GetMapGoal.java | 2 + .../objective/goals/clan/LeaveSpawnGoal.java | 3 + .../objective/goals/clan/SetHomeGoal.java | 2 + .../goals/classes/EquipDefaultBuildGoal.java | 2 + .../goals/energy/ExplainEnergyGoal.java | 2 + .../goals/finalobj/TpClanHomeGoal.java | 2 + .../objective/goals/shops/PurchaseGoal.java | 3 + 18 files changed, 154 insertions(+), 3 deletions(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/Objective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/Objective.java index 694e0573d..847b352e0 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/Objective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/Objective.java @@ -6,12 +6,15 @@ import java.util.List; import java.util.Set; import java.util.UUID; +import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; +import mineplex.core.common.util.C; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilTextMiddle; import mineplex.game.clans.tutorial.TutorialRegion; /** @@ -24,6 +27,10 @@ public abstract class Objective implements L private String _name; private String _description; private String _extraDescription; + private boolean _displayStartMessage; + private int _startMessageDelay; + private boolean _displayFinishMessage; + private int _finishMessageDelay; private HashMap _active; private List _listeners; @@ -35,6 +42,10 @@ public abstract class Objective implements L _name = name; _description = description; _extraDescription = extraDescription; + _displayStartMessage = true; + _displayFinishMessage = true; + _startMessageDelay = 60; + _finishMessageDelay = 1; _active = new HashMap<>(); _listeners = new LinkedList<>(); @@ -114,6 +125,9 @@ public abstract class Objective implements L _listeners.forEach(listener -> listener.onObjectiveStart(player, this)); + if (_displayStartMessage) + Bukkit.getServer().getScheduler().runTaskLater(getJavaPlugin(), () -> showStartMessage(player), _startMessageDelay); + customStart(player); } @@ -181,8 +195,13 @@ public abstract class Objective implements L { System.out.println(String.format("Tutorial> [%s] finished objective [%s]", player.getName(), getName(player))); + showFinishMessage(player); + _active.remove(player.getUniqueId()); + if (_displayFinishMessage) + Bukkit.getServer().getScheduler().runTaskLater(getJavaPlugin(), () -> showFinishMessage(player), _finishMessageDelay); + customFinish(player); _listeners.forEach(listener -> listener.onObjectiveFinish(player, this)); @@ -241,4 +260,44 @@ public abstract class Objective implements L } public abstract void addScoreboardLines(Player player, List lines); + + private void showStartMessage(Player player) + { + UtilTextMiddle.display(C.cAqua + "Tutorial", getName(player), player); + } + + private void showFinishMessage(Player player) + { + UtilTextMiddle.display(C.cGreen + "Tutorial Completed", getName(player), player); + } + + public void setDisplayStartMessage(boolean displayStartMessage) + { + _displayStartMessage = displayStartMessage; + } + + public void setDisplayFinishMessage(boolean displayFinishMessage) + { + _displayFinishMessage = displayFinishMessage; + } + + public int getStartMessageDelay() + { + return _startMessageDelay; + } + + public void setStartMessageDelay(int startMessageDelay) + { + _startMessageDelay = startMessageDelay; + } + + public int getFinishMessageDelay() + { + return _finishMessageDelay; + } + + public void setFinishMessageDelay(int finishMessageDelay) + { + _finishMessageDelay = finishMessageDelay; + } } 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 c64ca8885..d8fb13226 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 @@ -4,9 +4,12 @@ import java.util.HashSet; import java.util.Set; import java.util.UUID; +import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.Listener; +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilTextMiddle; import mineplex.game.clans.tutorial.TutorialRegion; public abstract class ObjectiveGoal implements Listener @@ -17,6 +20,10 @@ public abstract class ObjectiveGoal implements Listener private String _name; private String _description; private String _extraDescription; + private boolean _displayStartMessage; + private int _startMessageDelay; + private boolean _displayFinishMessage; + private int _finishMessageDelay; public ObjectiveGoal(T objective, String name, String description) { @@ -31,6 +38,10 @@ public abstract class ObjectiveGoal implements Listener _name = name; _description = description; _extraDescription = extraDescription; + _displayStartMessage = true; + _startMessageDelay = 40; + _displayFinishMessage = true; + _finishMessageDelay = 1; } public String getName(Player player) @@ -68,6 +79,12 @@ public abstract class ObjectiveGoal implements Listener System.out.println(String.format("Tutorial> [%s] started objective goal [%s]", player.getName(), getName(player))); _active.add(player.getUniqueId()); + + if (_displayStartMessage) + { + Bukkit.getServer().getScheduler().runTaskLater(_objective.getJavaPlugin(), () -> displayStartMessage(player), _startMessageDelay); + } + customStart(player); } @@ -96,10 +113,15 @@ public abstract class ObjectiveGoal implements Listener System.out.println(String.format("Tutorial> [%s] finished objective goal [%s]", player.getName(), getName(player))); _active.remove(player.getUniqueId()); + + if (_displayFinishMessage) + { + Bukkit.getServer().getScheduler().runTaskLater(_objective.getJavaPlugin(), () -> displayFinishMessage(player), _finishMessageDelay); + } + customFinish(player); _objective.completeGoal(this, player); - } } @@ -123,4 +145,34 @@ public abstract class ObjectiveGoal implements Listener { return _objective; } + + protected void displayFinishMessage(Player player) + { + UtilTextMiddle.display(C.cGreen + "Completed Objective", getName(player), player); + } + + protected void displayStartMessage(Player player) + { + UtilTextMiddle.display(C.cYellow + "New Objective", getName(player), player); + } + + public void setDisplayStartMessage(boolean displayStartMessage) + { + _displayStartMessage = displayStartMessage; + } + + public void setDisplayFinishMessage(boolean displayFinishMessage) + { + _displayFinishMessage = displayFinishMessage; + } + + public void setStartMessageDelay(int startMessageDelay) + { + _startMessageDelay = startMessageDelay; + } + + public void setFinishMessageDelay(int finishMessageDelay) + { + _finishMessageDelay = finishMessageDelay; + } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java index 44ff17d15..3620a018e 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java @@ -29,12 +29,14 @@ public class AttackEnemyObjective extends OrderedObjective _cannon = new HashMap<>(); addGoal(new GetMapGoal(this)); - addGoal(new HoldItemGoal(this, Material.MAP, "Identify Enemy on Map", "By looking at your map, identify your new enemy")); + addGoal(new HoldItemGoal(this, Material.MAP, "Identify Enemy on Map", "By looking at your map, identify your new enemy", 40)); addGoal(new ClanInfoGoal(this)); addGoal(new MountCannonGoal(this)); addGoal(new LoadCannonGoal(this)); addGoal(new BlowUpWallGoal(this)); addGoal(new StealEnemyPotatoesGoal(this)); + + setStartMessageDelay(60); } @Override diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/ClanObjective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/ClanObjective.java index f01ad1eeb..2b1e764b1 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/ClanObjective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/ClanObjective.java @@ -21,6 +21,9 @@ public class ClanObjective extends OrderedObjective addGoal(new ClaimLandGoal(this)); addGoal(new BuildHouseGoal(this)); addGoal(new SetHomeGoal(this)); + + // Wait 1 second because the player is logging in/loading + setStartMessageDelay(20); } @Override diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/ClassesObjective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/ClassesObjective.java index 388887fcd..642b6a1c2 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/ClassesObjective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/ClassesObjective.java @@ -18,6 +18,8 @@ public class ClassesObjective extends OrderedObjective addGoal(new EquipDefaultBuildGoal(this)); addGoal(new OpenClassManagerGoal(this)); addGoal(new UseBullsChargeGoal(this)); + + setStartMessageDelay(60); } @Override diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/EnergyObjective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/EnergyObjective.java index 7a0895b85..5b1dc6dfb 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/EnergyObjective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/EnergyObjective.java @@ -16,6 +16,8 @@ public class EnergyObjective extends OrderedObjective addGoal(new ExplainEnergyGoal(this)); addGoal(new BuyEnergyGoal(this)); + + setStartMessageDelay(60); } @Override diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/FieldsObjective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/FieldsObjective.java index 4b93da67c..86a8051af 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/FieldsObjective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/FieldsObjective.java @@ -22,6 +22,8 @@ public class FieldsObjective extends OrderedObjective addGoal(new GoToFieldsGoal(this)); addGoal(new MineDiamondsGoal(this)); addGoal(new SellDiamondsGoal(this)); + + setStartMessageDelay(60); } @Override diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/FinalObjective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/FinalObjective.java index 299f46135..256580404 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/FinalObjective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/FinalObjective.java @@ -16,6 +16,8 @@ public class FinalObjective extends OrderedObjective addGoal(new TpClanHomeGoal(this)); // IMPLEMENTED addGoal(new DisbandClanGoal(this)); // IMPLEMENTED + + setStartMessageDelay(60); } @Override 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 6422e8c11..e2325ff5f 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 @@ -20,6 +20,8 @@ public class PurchaseItemsObjective extends UnorderedObjective addGoal(new HoldItemGoal(this, Material.MAP, "Identify Shops on Map", "Look at your map and find the shops")); addGoal(new GoToShopsGoal(this)); addGoal(new SellPotatoesGoal(this)); + + setStartMessageDelay(60); } @Override 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 7991c1a2a..8aab1e8c2 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 @@ -17,11 +17,18 @@ public class HoldItemGoal extends ObjectiveGoal private DefaultHashMap> _ticksHeld = new DefaultHashMap<>(key -> new EnclosedObject<>(Integer.valueOf(0))); private Material _material; - public HoldItemGoal(Objective objective, Material material, String name, String description) + public HoldItemGoal(Objective objective, Material material, String name, String description, int startDelay) { super(objective, name, description); _material = material; + + setStartMessageDelay(startDelay); + } + + public HoldItemGoal(Objective objective, Material material, String name, String description) + { + this(objective, material, name, description, 120); } @Override 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 3df50bc2d..8eeb25204 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 @@ -16,6 +16,8 @@ public class GetMapGoal extends ObjectiveGoal public GetMapGoal(AttackEnemyObjective objective) { super(objective, "Get a Map", "Use the /map command to recieve a map."); + + setStartMessageDelay(120); } @Override 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 16111fb53..eeecf27d8 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 @@ -19,6 +19,9 @@ public class LeaveSpawnGoal extends ObjectiveGoal public LeaveSpawnGoal(ClanObjective objective) { super(objective, "Leave Spawn", "Exit the tutorial spawn area"); + + // 2 seconds after start message + setStartMessageDelay(20 * 3); } @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 907f628c0..6da4bb42d 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 @@ -19,6 +19,8 @@ public class SetHomeGoal extends ObjectiveGoal public SetHomeGoal(ClanObjective objective) { super(objective, "Set Clan Home", "Set your Clan's home by typing /c sethome"); + + setDisplayFinishMessage(false); } @Override 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 0be669819..f26390553 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 @@ -12,6 +12,8 @@ public class EquipDefaultBuildGoal extends ObjectiveGoal public EquipDefaultBuildGoal(ClassesObjective objective) { super(objective, "Equip Armor", "Equip your newly bought armor to try out it's abilities"); + + setStartMessageDelay(120); } @Override 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 2577ffb0f..caacf56c3 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 @@ -34,6 +34,8 @@ public class ExplainEnergyGoal extends ObjectiveGoal finish(player); }, 20 * 10L); }, 20 * 3L); + + setStartMessageDelay(120); } @Override 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 9ac3d2dc2..2c2eddc8c 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 @@ -21,6 +21,8 @@ public class TpClanHomeGoal extends ObjectiveGoal public TpClanHomeGoal(FinalObjective objective) { super(objective, "Teleport to Clan Home", "Use the /c home command to teleport to your Clan Home"); + + setStartMessageDelay(120); } @Override 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 d44c417eb..6623879e2 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 @@ -17,6 +17,9 @@ public class PurchaseGoal extends ObjectiveGoal { super(objective, name, description); _material = material; + + setDisplayStartMessage(false); + setDisplayFinishMessage(false); } @Override From 86bdbbb8bc169a1373e62f2f4527283340fb5a28 Mon Sep 17 00:00:00 2001 From: phobia Date: Thu, 31 Mar 2016 20:35:21 +1100 Subject: [PATCH 11/12] PC-46 + adding in events for buttons --- .../clans/gui/button/ClanAddAllyButton.java | 6 +- .../gui/button/ClanAddTrustedButton.java | 5 ++ .../clans/gui/button/ClanAddWarButton.java | 4 ++ .../clans/gui/button/ClanCreateButton.java | 3 + .../clans/gui/button/ClanDisbandButton.java | 4 ++ .../clans/gui/button/ClanEnergyButton.java | 4 +- .../clans/gui/button/ClanInviteButton.java | 4 ++ .../clans/gui/button/ClanJoinButton.java | 4 ++ .../clans/gui/button/ClanLeaveButton.java | 21 +++++- .../clans/gui/button/ClanMemeberButton.java | 4 ++ .../clans/gui/button/ClanTerritoryButton.java | 4 ++ .../clans/clans/gui/button/ClanWhoButton.java | 4 ++ .../gui/events/ClansButtonClickEvent.java | 65 +++++++++++++++++++ .../tutorials/clans/ClansMainTutorial.java | 7 ++ .../objective/goals/clan/ClaimLandGoal.java | 9 +++ .../objective/goals/clan/ClanDetailsGoal.java | 9 +++ .../goals/clan/ClanManagementGoal.java | 9 +++ .../objective/goals/clan/CreateClanGoal.java | 9 +++ .../objective/goals/clan/SetHomeGoal.java | 4 +- .../goals/energy/ExplainEnergyGoal.java | 10 +++ .../goals/finalobj/DisbandClanGoal.java | 8 +++ 21 files changed, 191 insertions(+), 6 deletions(-) create mode 100644 Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/events/ClansButtonClickEvent.java diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanAddAllyButton.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanAddAllyButton.java index 58b7d88c3..0ffc86737 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanAddAllyButton.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanAddAllyButton.java @@ -1,5 +1,7 @@ package mineplex.game.clans.clans.gui.button; +import mineplex.core.common.util.UtilServer; +import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; @@ -13,8 +15,10 @@ public class ClanAddAllyButton implements IButton @Override public void onClick(Player player, ClickType clickType) { - player.closeInventory(); + if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.AddAlly)).isCancelled()) + return; + player.closeInventory(); JsonMessage message = new JsonMessage(C.cRed + C.Bold + "Click here to add an Ally").click(ClickEvent.SUGGEST_COMMAND, "/c ally "); message.sendToPlayer(player); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanAddTrustedButton.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanAddTrustedButton.java index 505eb674b..6a8d8a552 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanAddTrustedButton.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanAddTrustedButton.java @@ -1,5 +1,7 @@ package mineplex.game.clans.clans.gui.button; +import mineplex.core.common.util.UtilServer; +import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; @@ -13,6 +15,9 @@ public class ClanAddTrustedButton implements IButton @Override public void onClick(Player player, ClickType clickType) { + if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.AddTrusted)).isCancelled()) + return; + player.closeInventory(); JsonMessage message = new JsonMessage(C.cRed + C.Bold + "Click here to trust a clan").click(ClickEvent.SUGGEST_COMMAND, "/c trust "); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanAddWarButton.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanAddWarButton.java index 22e4ce7ef..d0faaa721 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanAddWarButton.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanAddWarButton.java @@ -1,5 +1,7 @@ package mineplex.game.clans.clans.gui.button; +import mineplex.core.common.util.UtilServer; +import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; @@ -13,6 +15,8 @@ public class ClanAddWarButton implements IButton @Override public void onClick(Player player, ClickType clickType) { + if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.AddWar)).isCancelled()) + return; player.closeInventory(); JsonMessage message = new JsonMessage(C.cRed + C.Bold + "Click here to war a clan").click(ClickEvent.SUGGEST_COMMAND, "/war "); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanCreateButton.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanCreateButton.java index ea75bfc73..39815a0f8 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanCreateButton.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanCreateButton.java @@ -1,5 +1,7 @@ package mineplex.game.clans.clans.gui.button; +import mineplex.core.common.util.UtilServer; +import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; @@ -18,5 +20,6 @@ public class ClanCreateButton implements IButton @Override public void onClick(Player player, ClickType clickType) { + UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Create)); } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanDisbandButton.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanDisbandButton.java index 5450e21a8..6165d054b 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanDisbandButton.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanDisbandButton.java @@ -1,5 +1,7 @@ package mineplex.game.clans.clans.gui.button; +import mineplex.core.common.util.UtilServer; +import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; @@ -18,6 +20,8 @@ public class ClanDisbandButton extends ClanButton @Override public void onClick(Player player, ClickType clickType) { + if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Disband)).isCancelled()) + return; getPlayer().closeInventory(); getClansManager().getClanUtility().delete(getPlayer()); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanEnergyButton.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanEnergyButton.java index ae2d56236..20038637d 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanEnergyButton.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanEnergyButton.java @@ -1,5 +1,7 @@ package mineplex.game.clans.clans.gui.button; +import mineplex.core.common.util.UtilServer; +import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; @@ -18,6 +20,6 @@ public class ClanEnergyButton extends ClanButton @Override public void onClick(Player player, ClickType clickType) { - + UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Energy)); } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanInviteButton.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanInviteButton.java index afd3eff2b..f32e20b19 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanInviteButton.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanInviteButton.java @@ -1,5 +1,7 @@ package mineplex.game.clans.clans.gui.button; +import mineplex.core.common.util.UtilServer; +import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; @@ -23,6 +25,8 @@ public class ClanInviteButton extends ClanButton @Override public void onClick(Player player, ClickType clickType) { + if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Invite)).isCancelled()) + return; getShop().openPageForPlayer(getPlayer(), new ClanInvitePage(getClansManager(), getShop(), getClansManager().getClientManager(), _donationManager, player)); } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanJoinButton.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanJoinButton.java index f3e451d0a..fb8c78623 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanJoinButton.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanJoinButton.java @@ -1,5 +1,7 @@ package mineplex.game.clans.clans.gui.button; +import mineplex.core.common.util.UtilServer; +import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; @@ -21,6 +23,8 @@ public class ClanJoinButton implements IButton @Override public void onClick(Player player, ClickType clickType) { + if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Join)).isCancelled()) + return; player.closeInventory(); _clansManager.getClanUtility().join(player, _clanInfo); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanLeaveButton.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanLeaveButton.java index 114f3eb79..fbf261c8e 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanLeaveButton.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanLeaveButton.java @@ -1,5 +1,7 @@ package mineplex.game.clans.clans.gui.button; +import mineplex.core.common.util.UtilServer; +import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; @@ -18,7 +20,22 @@ public class ClanLeaveButton extends ClanButton @Override public void onClick(Player player, ClickType clickType) { - getPlayer().closeInventory(); - getClansManager().getClanUtility().leave(getPlayer()); + if(clickType.equals(ClickType.SHIFT_RIGHT)) //disband + { + if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Disband)).isCancelled()) + return; + + getPlayer().closeInventory(); + getClansManager().getClanUtility().delete(getPlayer()); + + }else if(clickType.equals(ClickType.SHIFT_LEFT)) //leave + { + if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Leave)).isCancelled()) + return; + + getPlayer().closeInventory(); + getClansManager().getClanUtility().leave(getPlayer()); + } + } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanMemeberButton.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanMemeberButton.java index da1194fe2..0570693d2 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanMemeberButton.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanMemeberButton.java @@ -1,5 +1,7 @@ package mineplex.game.clans.clans.gui.button; +import mineplex.core.common.util.UtilServer; +import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; @@ -24,6 +26,8 @@ public class ClanMemeberButton extends ClanButton @Override public void onClick(Player player, ClickType clickType) { + if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Member)).isCancelled()) + return; if (clickType == ClickType.LEFT) { // Promote diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanTerritoryButton.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanTerritoryButton.java index 27c4ac02e..363c78f01 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanTerritoryButton.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanTerritoryButton.java @@ -1,5 +1,7 @@ package mineplex.game.clans.clans.gui.button; +import mineplex.core.common.util.UtilServer; +import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import org.bukkit.ChatColor; import org.bukkit.Chunk; import org.bukkit.entity.Player; @@ -23,6 +25,8 @@ public class ClanTerritoryButton extends ClanButton @Override public void onClick(Player player, ClickType clickType) { + if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Territory)).isCancelled()) + return; // if (_clansManager.getNetherManager().isInNether(player)) // { // _clansManager.message(player, "You are not allowed to do anything with Territory while in " + F.clansNether("The Nether") + "."); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanWhoButton.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanWhoButton.java index 20385402b..ce482aeed 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanWhoButton.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/button/ClanWhoButton.java @@ -1,5 +1,7 @@ package mineplex.game.clans.clans.gui.button; +import mineplex.core.common.util.UtilServer; +import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; @@ -13,6 +15,8 @@ public class ClanWhoButton implements IButton @Override public void onClick(Player player, ClickType clickType) { + if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Who)).isCancelled()) + return; player.closeInventory(); JsonMessage message = new JsonMessage(C.cRed + C.Bold + "Click here to lookup a clan").click(ClickEvent.SUGGEST_COMMAND, "/c who "); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/events/ClansButtonClickEvent.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/events/ClansButtonClickEvent.java new file mode 100644 index 000000000..72bad2675 --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/events/ClansButtonClickEvent.java @@ -0,0 +1,65 @@ +package mineplex.game.clans.clans.gui.events; + +import org.bukkit.entity.Player; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + +public class ClansButtonClickEvent extends Event +{ + private static final HandlerList handlers = new HandlerList(); + + private Player _player; + private ButtonType _type; + + private boolean _cancelled; + + public ClansButtonClickEvent(Player player, ButtonType type) + { + _player = player; + _type = type; + } + + public Player getPlayer() + { + return _player; + } + + public void setCancelled(boolean cancelled) + { + _cancelled = cancelled; + } + + public boolean isCancelled() + { + return _cancelled; + } + + public ButtonType getButtonType() { return _type} + + public HandlerList getHandlers() + { + return handlers; + } + + public static HandlerList getHandlerList() + { + return handlers; + } + + + public enum ButtonType + { + AddAlly, + AddTrusted, + AddWar, + Create, + Disband, + Energy, + Invite, + Join, + Leave, + Member, + Territory, + Who; + } +} diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/ClansMainTutorial.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/ClansMainTutorial.java index cae94dc9c..8b052fd69 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/ClansMainTutorial.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/ClansMainTutorial.java @@ -4,6 +4,7 @@ import java.io.IOException; import java.util.List; import java.util.UUID; +import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import org.bukkit.DyeColor; import org.bukkit.GameMode; import org.bukkit.Location; @@ -378,4 +379,10 @@ public class ClansMainTutorial extends Tutorial { return _mapManager; } + + @EventHandler (priority = EventPriority.LOWEST) + public void onClick(ClansButtonClickEvent event) { + if(isInTutorial(event.getPlayer())) + event.setCancelled(true); + } } 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 fed391cb0..09fe9f7d6 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 @@ -2,6 +2,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.Location; import org.bukkit.Material; import org.bukkit.entity.Player; @@ -15,6 +16,7 @@ import mineplex.game.clans.clans.event.PlayerPreClaimTerritoryEvent; import mineplex.game.clans.tutorial.TutorialRegion; import mineplex.game.clans.tutorial.tutorials.clans.ClansMainTutorial; import mineplex.game.clans.tutorial.tutorials.clans.objective.ClanObjective; +import org.bukkit.event.EventPriority; public class ClaimLandGoal extends ObjectiveGoal { @@ -54,4 +56,11 @@ public class ClaimLandGoal extends ObjectiveGoal event.setCancelled(true); } } + + + @EventHandler (priority = EventPriority.HIGHEST) + public void onClick(ClansButtonClickEvent event) { + if(contains(event.getPlayer()) && event.getButtonType().equals(ClansButtonClickEvent.ButtonType.Territory)) + event.setCancelled(false); + } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/ClanDetailsGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/ClanDetailsGoal.java index 3b84a1fd3..fed068ddf 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/ClanDetailsGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/ClanDetailsGoal.java @@ -1,5 +1,6 @@ package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan; +import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -8,6 +9,7 @@ import mineplex.game.clans.clans.ClanInfo; import mineplex.game.clans.clans.ClansManager; import mineplex.game.clans.clans.event.ClansCommandExecutedEvent; import mineplex.game.clans.tutorial.tutorials.clans.objective.ClanObjective; +import org.bukkit.event.EventPriority; public class ClanDetailsGoal extends ObjectiveGoal { @@ -51,4 +53,11 @@ public class ClanDetailsGoal extends ObjectiveGoal } } } + + + @EventHandler (priority = EventPriority.HIGHEST) + public void onClick(ClansButtonClickEvent event) { + if(contains(event.getPlayer()) && (event.getButtonType().equals(ClansButtonClickEvent.ButtonType.Who))) + event.setCancelled(false); + } } 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 68deb498c..c97a1f2de 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 @@ -5,10 +5,12 @@ import mineplex.game.clans.clans.ClanInfo; import mineplex.game.clans.clans.ClansManager; import mineplex.game.clans.clans.event.ClansCommandExecutedEvent; import mineplex.game.clans.clans.event.ClansCommandPreExecutedEvent; +import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import mineplex.game.clans.tutorial.objective.ObjectiveGoal; import mineplex.game.clans.tutorial.tutorials.clans.objective.ClanObjective; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; /** * Created by Adam on 29/03/2016. @@ -42,4 +44,11 @@ public class ClanManagementGoal extends ObjectiveGoal } } } + + + @EventHandler (priority = EventPriority.HIGHEST) + public void onClick(ClansButtonClickEvent event) { + if(contains(event.getPlayer()) && event.getButtonType().equals(ClansButtonClickEvent.ButtonType.Energy)) + event.setCancelled(false); + } } 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 c05793033..c3a041d8a 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 @@ -1,5 +1,6 @@ package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan; +import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -7,6 +8,7 @@ import mineplex.game.clans.tutorial.objective.ObjectiveGoal; import mineplex.game.clans.clans.ClansManager; import mineplex.game.clans.clans.event.ClanCreationCompleteEvent; import mineplex.game.clans.tutorial.tutorials.clans.objective.ClanObjective; +import org.bukkit.event.EventPriority; public class CreateClanGoal extends ObjectiveGoal { @@ -39,4 +41,11 @@ public class CreateClanGoal extends ObjectiveGoal finish(event.getFounder()); } } + + + @EventHandler (priority = EventPriority.HIGHEST) + public void onClick(ClansButtonClickEvent event) { + if(contains(event.getPlayer()) && event.getButtonType().equals(ClansButtonClickEvent.ButtonType.Create)) + event.setCancelled(false); + } } 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 041126606..82095acd9 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 @@ -48,7 +48,7 @@ public class SetHomeGoal extends ObjectiveGoal // we need to save this for later when the player teleports home! getObjective().getPlugin().getTutorialSession(event.getPlayer()).setHomeLocation(event.getPlayer().getLocation()); - + finish(event.getPlayer()); UtilPlayer.message(event.getPlayer(), F.main("Clans", "You have successfully set your Clan's Home to " + UtilWorld.locToStrClean(event.getPlayer().getLocation()) + ".")); @@ -57,7 +57,7 @@ public class SetHomeGoal extends ObjectiveGoal { UtilPlayer.message(event.getPlayer(), F.main("Tutorial", "You must set your home in your own land claim.")); } - + event.setCancelled(true); } } 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 2577ffb0f..1c000e52a 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 @@ -1,5 +1,6 @@ package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.energy; +import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import org.bukkit.Sound; import org.bukkit.entity.Player; @@ -9,6 +10,8 @@ import mineplex.core.common.util.UtilTextMiddle; import mineplex.game.clans.clans.ClansManager; import mineplex.game.clans.tutorial.objective.ObjectiveGoal; import mineplex.game.clans.tutorial.tutorials.clans.objective.EnergyObjective; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; public class ExplainEnergyGoal extends ObjectiveGoal { @@ -40,4 +43,11 @@ public class ExplainEnergyGoal extends ObjectiveGoal protected void customFinish(Player player) { } + + + @EventHandler(priority = EventPriority.HIGHEST) + public void onClick(ClansButtonClickEvent event) { + if(contains(event.getPlayer()) && event.getButtonType().equals(ClansButtonClickEvent.ButtonType.Energy)) + event.setCancelled(false); + } } 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 a69e6139d..fedb379bf 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,6 +1,7 @@ package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.finalobj; import mineplex.game.clans.clans.event.ClanDisbandedEvent; +import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -44,4 +45,11 @@ public class DisbandClanGoal extends ObjectiveGoal ClansManager.getInstance().getClanDataAccess().delete(ClansManager.getInstance().getClan(event.getDisbander()), null); finish(event.getDisbander()); } + + + @EventHandler (priority = EventPriority.HIGHEST) + public void onClick(ClansButtonClickEvent event) { + if(contains(event.getPlayer()) && event.getButtonType().equals(ClansButtonClickEvent.ButtonType.Disband)) + event.setCancelled(false); + } } From 4ec833727ffc0045b6c8d520f4a857f4938f1546 Mon Sep 17 00:00:00 2001 From: William Burns Date: Thu, 31 Mar 2016 18:45:17 +0100 Subject: [PATCH 12/12] PC-20 - Detailed Objective Text --- .../src/mineplex/core/updater/UpdateType.java | 6 +++- .../gui/events/ClansButtonClickEvent.java | 4 ++- .../game/clans/tutorial/Tutorial.java | 32 +++++++++++++++++++ .../game/clans/tutorial/TutorialSession.java | 12 +++++++ .../clans/tutorial/objective/Objective.java | 3 +- .../tutorial/objective/ObjectiveGoal.java | 17 ++++++++++ .../tutorial/objective/OrderedObjective.java | 3 +- .../tutorial/objective/SingleObjective.java | 3 +- .../objective/UnorderedObjective.java | 3 +- .../clans/objective/AttackEnemyObjective.java | 10 +++++- .../clans/objective/FieldsObjective.java | 9 +++++- .../objective/PurchaseItemsObjective.java | 20 +++++++++--- .../clans/objective/ShopsObjective.java | 9 +++++- .../clans/objective/goals/HoldItemGoal.java | 8 ++--- .../goals/attackenemy/BlowUpWallGoal.java | 7 +++- .../goals/attackenemy/GetMapGoal.java | 11 ++++++- .../goals/attackenemy/LoadCannonGoal.java | 8 ++++- .../goals/attackenemy/MountCannonGoal.java | 8 ++++- .../attackenemy/StealEnemyPotatoesGoal.java | 10 ++++-- .../objective/goals/clan/BuildHouseGoal.java | 8 ++++- .../objective/goals/clan/ClaimLandGoal.java | 8 ++++- .../objective/goals/clan/ClanInfoGoal.java | 9 +++++- .../goals/clan/ClanManagementGoal.java | 8 ++++- .../objective/goals/clan/CreateClanGoal.java | 10 +++++- .../objective/goals/clan/LeaveSpawnGoal.java | 11 ++++++- .../objective/goals/clan/SetHomeGoal.java | 9 +++++- .../goals/classes/EquipDefaultBuildGoal.java | 8 ++++- .../goals/classes/OpenClassManagerGoal.java | 9 +++++- .../goals/classes/SelectBullsChargeGoal.java | 6 ++++ .../goals/classes/UseBullsChargeGoal.java | 8 ++++- .../objective/goals/energy/BuyEnergyGoal.java | 7 +++- .../goals/energy/ExplainEnergyGoal.java | 9 +++++- .../goals/fields/GoToFieldsGoal.java | 8 ++++- .../goals/fields/MineDiamondsGoal.java | 8 ++++- .../goals/fields/SellDiamondsGoal.java | 7 +++- .../goals/finalobj/DisbandClanGoal.java | 9 +++++- .../goals/finalobj/TpClanHomeGoal.java | 7 +++- .../objective/goals/shops/GoToShopsGoal.java | 7 +++- .../objective/goals/shops/PurchaseGoal.java | 10 ++++++ .../goals/shops/SellPotatoesGoal.java | 9 +++++- 40 files changed, 315 insertions(+), 43 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/updater/UpdateType.java b/Plugins/Mineplex.Core/src/mineplex/core/updater/UpdateType.java index 419ace87c..68f1634b9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/updater/UpdateType.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/updater/UpdateType.java @@ -53,9 +53,13 @@ public enum UpdateType */ SLOWEST(32000), /** - * ONce every 30 seconds + * Once every 30 seconds */ SEC_30(30000), + /** + * Once every 20 seconds + */ + SEC_20(20000), /** * Once every 16 seconds */ diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/events/ClansButtonClickEvent.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/events/ClansButtonClickEvent.java index 72bad2675..844a1159b 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/events/ClansButtonClickEvent.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/gui/events/ClansButtonClickEvent.java @@ -34,7 +34,9 @@ public class ClansButtonClickEvent extends Event return _cancelled; } - public ButtonType getButtonType() { return _type} + public ButtonType getButtonType() { + return _type; + } public HandlerList getHandlers() { diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/Tutorial.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/Tutorial.java index 97c137068..a998d2556 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/Tutorial.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/Tutorial.java @@ -20,8 +20,10 @@ import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.plugin.java.JavaPlugin; import mineplex.core.common.util.C; +import mineplex.core.common.util.F; import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilTextBottom; import mineplex.core.hologram.Hologram; import mineplex.core.hologram.HologramManager; @@ -286,6 +288,36 @@ public abstract class Tutorial implements Listener, ObjectiveListener } } + @EventHandler + public void displayText(UpdateEvent event) + { + if (event.getType() != UpdateType.SEC) + { + return; + } + + for (Map.Entry entry : _playerSessionMap.entrySet()) + { + String extra = _objectives.get(entry.getValue().getObjectiveIndex()).getExtraDescription(entry.getKey()); + if (extra == null) + { + // None defined. + continue; + } + + if (entry.getValue().incrementAndGetTextSeconds() < 20) + { + // 20 second delay between displaying. + return; + } + + UtilPlayer.message(entry.getKey(), C.cGold + C.Strike + "---------------------------------------------"); + UtilPlayer.message(entry.getKey(), C.cGray + " " + extra); + UtilPlayer.message(entry.getKey(), C.cGold + C.Strike + "---------------------------------------------"); + entry.getValue().setTextSeconds(0); + } + } + public void addHologram(Player player, Location location, String... text) { if (_playerSessionMap.containsKey(player)) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/TutorialSession.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/TutorialSession.java index 45658cf6d..81190d0da 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/TutorialSession.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/TutorialSession.java @@ -14,6 +14,7 @@ public class TutorialSession private List _hologramList = new ArrayList<>(); private Location _homeLocation; private int _colorTick; + private int _textSeconds; public TutorialSession() { @@ -58,4 +59,15 @@ public class TutorialSession { return ++_colorTick; } + + public void setTextSeconds(int seconds) + { + _textSeconds = seconds; + } + + public int incrementAndGetTextSeconds() + { + _textSeconds++; + return _textSeconds; + } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/Objective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/Objective.java index 847b352e0..839a92901 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/Objective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/Objective.java @@ -15,12 +15,13 @@ import org.bukkit.plugin.java.JavaPlugin; import mineplex.core.common.util.C; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilTextMiddle; +import mineplex.game.clans.tutorial.Tutorial; import mineplex.game.clans.tutorial.TutorialRegion; /** * An Objective represents a set of goals that need to be completed to move on to the next Objective in the quest */ -public abstract class Objective implements Listener +public abstract class Objective implements Listener { private Plugin _plugin; private JavaPlugin _javaPlugin; 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 d8fb13226..43bfad084 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 @@ -9,6 +9,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.Listener; import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilTextMiddle; import mineplex.game.clans.tutorial.TutorialRegion; @@ -112,6 +113,8 @@ public abstract class ObjectiveGoal implements Listener { System.out.println(String.format("Tutorial> [%s] finished objective goal [%s]", player.getName(), getName(player))); + getObjective().getPlugin().getTutorialSession(player).setTextSeconds(0); + _active.remove(player.getUniqueId()); if (_displayFinishMessage) @@ -153,7 +156,21 @@ public abstract class ObjectiveGoal implements Listener protected void displayStartMessage(Player player) { + if (player == null || !player.isOnline()) + { + return; + } + UtilTextMiddle.display(C.cYellow + "New Objective", getName(player), player); + + if (getExtraDescription(player) != null) + { + // Display extra information for the first time. + UtilPlayer.message(player, C.cGold + C.Strike + "---------------------------------------------"); + UtilPlayer.message(player, C.cGray + " " + getExtraDescription(player)); + UtilPlayer.message(player, C.cGold + C.Strike + "---------------------------------------------"); + getObjective().getPlugin().getTutorialSession(player).setTextSeconds(0); + } } public void setDisplayStartMessage(boolean displayStartMessage) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/OrderedObjective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/OrderedObjective.java index 9f986d2cb..f4b8c532d 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/OrderedObjective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/OrderedObjective.java @@ -6,9 +6,10 @@ import java.util.List; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; +import mineplex.game.clans.tutorial.Tutorial; import net.md_5.bungee.api.ChatColor; -public abstract class OrderedObjective extends Objective +public abstract class OrderedObjective extends Objective { private List _goals; diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/SingleObjective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/SingleObjective.java index 1740304a9..c594286b6 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/SingleObjective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/SingleObjective.java @@ -6,8 +6,9 @@ import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; import mineplex.core.common.util.C; +import mineplex.game.clans.tutorial.Tutorial; -public abstract class SingleObjective extends Objective +public abstract class SingleObjective extends Objective { private final ObjectiveData _nullData; diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/UnorderedObjective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/UnorderedObjective.java index 4bf4c1f75..817a6ad5e 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/UnorderedObjective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/objective/UnorderedObjective.java @@ -6,9 +6,10 @@ import java.util.List; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; +import mineplex.game.clans.tutorial.Tutorial; import net.md_5.bungee.api.ChatColor; -public abstract class UnorderedObjective extends Objective +public abstract class UnorderedObjective extends Objective { private List _goals; diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java index 3620a018e..179326472 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java @@ -1,5 +1,6 @@ package mineplex.game.clans.tutorial.tutorials.clans.objective; +import mineplex.core.common.util.C; import mineplex.game.clans.clans.siege.weapon.Cannon; import org.bukkit.Material; import org.bukkit.entity.Player; @@ -29,7 +30,14 @@ public class AttackEnemyObjective extends OrderedObjective _cannon = new HashMap<>(); addGoal(new GetMapGoal(this)); - addGoal(new HoldItemGoal(this, Material.MAP, "Identify Enemy on Map", "By looking at your map, identify your new enemy", 40)); + addGoal(new HoldItemGoal( + this, Material.MAP, + "Identify Enemy on Map", + "Find the red square land on the map.", + "Look at your map to help find where the Enemy Clan is. It's marked by " + + "a " + C.cRed + "red square" + C.mBody + ".", + 40 + )); addGoal(new ClanInfoGoal(this)); addGoal(new MountCannonGoal(this)); addGoal(new LoadCannonGoal(this)); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/FieldsObjective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/FieldsObjective.java index 86a8051af..2113b24c5 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/FieldsObjective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/FieldsObjective.java @@ -5,6 +5,7 @@ import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; +import mineplex.core.common.util.C; import mineplex.game.clans.tutorial.objective.OrderedObjective; import mineplex.game.clans.tutorial.tutorials.clans.ClansMainTutorial; import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.HoldItemGoal; @@ -18,7 +19,13 @@ public class FieldsObjective extends OrderedObjective { super(clansMainTutorial, javaPlugin, "Fields", "Get various resources by mining for them in the fields"); - addGoal(new HoldItemGoal(this, Material.MAP, "Identify Fields on Map", "Look at your map and find the Fields Region")); + addGoal(new HoldItemGoal( + this, + Material.MAP, + "Identify Fields on Map", + "Find the Orange Striped Area on your map", + "Fields are marked by " + C.cGold + "Orange Stripes" + C.mBody + "." + )); addGoal(new GoToFieldsGoal(this)); addGoal(new MineDiamondsGoal(this)); addGoal(new SellDiamondsGoal(this)); 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 e2325ff5f..d02bfeb15 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 @@ -14,11 +14,21 @@ public class PurchaseItemsObjective extends UnorderedObjective _npcMap = new HashMap<>(); _npcManager = npcManager; - addGoal(new HoldItemGoal(this, Material.MAP, "Identify Shops on Map", "Look at your map and find the shops")); + addGoal(new HoldItemGoal( + this, + Material.MAP, + "Identify Shops on Map", + "Find the Yellow striped area on your map", + "Shops are marked on the map by the " + F.elem("Yellow Stripes") + "." + )); addGoal(new GoToShopsGoal(this)); addGoal(new SellPotatoesGoal(this)); 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 8aab1e8c2..858a2f63a 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 @@ -17,18 +17,18 @@ public class HoldItemGoal extends ObjectiveGoal private DefaultHashMap> _ticksHeld = new DefaultHashMap<>(key -> new EnclosedObject<>(Integer.valueOf(0))); private Material _material; - public HoldItemGoal(Objective objective, Material material, String name, String description, int startDelay) + public HoldItemGoal(Objective objective, Material material, String name, String description, String helpText, int startDelay) { - super(objective, name, description); + super(objective, name, description, helpText); _material = material; setStartMessageDelay(startDelay); } - public HoldItemGoal(Objective objective, Material material, String name, String description) + public HoldItemGoal(Objective objective, Material material, String name, String description, String helpText) { - this(objective, material, name, description, 120); + this(objective, material, name, description, helpText, 120); } @Override 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 41908275c..1f68e5645 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 @@ -24,7 +24,12 @@ public class BlowUpWallGoal extends ObjectiveGoal { public BlowUpWallGoal(AttackEnemyObjective objective) { - super(objective, "Blow up the Enemy Base", "Attack enemy clan! Blow a hole in their base by Left-Clicking to fire the Cannon."); + super( + 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!" + ); } @Override 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 8eeb25204..e38c8e828 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 @@ -6,6 +6,7 @@ import java.util.Map; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import mineplex.core.common.util.C; import mineplex.game.clans.clans.map.events.PlayerGetMapEvent; import mineplex.game.clans.clans.siege.weapon.Cannon; import mineplex.game.clans.tutorial.objective.ObjectiveGoal; @@ -15,7 +16,15 @@ public class GetMapGoal extends ObjectiveGoal { public GetMapGoal(AttackEnemyObjective objective) { - super(objective, "Get a Map", "Use the /map command to recieve a map."); + super( + objective, + "Get a Map", + "Get a Map ( Type /map )", + "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 + "." + ); 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 78a48a6ad..a42d2f2e5 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 @@ -13,7 +13,13 @@ public class LoadCannonGoal extends ObjectiveGoal { public LoadCannonGoal(AttackEnemyObjective objective) { - super(objective, "Load the Cannon", "Right click to open the Cannon, and load it with TNT!"); + super( + objective, + "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!" + ); } @Override 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 abe677db9..b93c9411e 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 @@ -20,7 +20,13 @@ public class MountCannonGoal extends ObjectiveGoal { public MountCannonGoal(AttackEnemyObjective objective) { - super(objective, "Get on the Cannon", "Right click on the Cannon to hop on!"); + super( + objective, + "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!" + ); } @Override 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 fda9e8830..b070d1e07 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 @@ -27,14 +27,20 @@ public class StealEnemyPotatoesGoal extends ObjectiveGoal public StealEnemyPotatoesGoal(AttackEnemyObjective objective) { - super(objective, "Steal Potatoes", "Steal the enemy's potatoes"); + super( + objective, + "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!" + ); } @Override public String getDescription(Player player) { int count = _playersMap.get(player.getUniqueId()).get(); - return "Steal Potatoes " + count + "/10"; + return "Retrieve the potatoes from the Enemy Clan’s base " + count + "/10"; } @Override 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 15ab7376b..eda507507 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 @@ -35,7 +35,13 @@ public class BuildHouseGoal extends ObjectiveGoal public BuildHouseGoal(ClanObjective objective) { - super(objective, "Build a House", "Build a Stone Brick house. (Place all your blocks)"); + super( + objective, + "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!" + ); } @Override 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 09fe9f7d6..121da7567 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 @@ -22,7 +22,13 @@ public class ClaimLandGoal extends ObjectiveGoal { public ClaimLandGoal(ClanObjective objective) { - super(objective, "Claim Land", "Claim land by opening the Clan Management page with /c and click the Claim Land Button"); + super( + objective, + "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." + ); } @Override 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 a5c0ba03d..e0c6495f2 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 @@ -22,7 +22,14 @@ public class ClanInfoGoal extends ObjectiveGoal { public ClanInfoGoal(AttackEnemyObjective objective) { - super(objective, "Lookup Enemy Details", "View info about the enemy clan by typing /c EnemyClan"); + super( + objective, + "Lookup Enemy Details", + "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." + ); } @Override 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 95efed295..3fa8fe462 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 @@ -19,7 +19,13 @@ public class ClanManagementGoal extends ObjectiveGoal { public ClanManagementGoal(ClanObjective objective) { - super(objective, "Open the Clan Menu", "Manage your clan by using the command /c"); + super( + objective, + "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." + ); } @Override 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 c3a041d8a..49a4c17e5 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 @@ -1,5 +1,6 @@ package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan; +import mineplex.core.common.util.F; import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -14,7 +15,14 @@ public class CreateClanGoal extends ObjectiveGoal { public CreateClanGoal(ClanObjective objective) { - super(objective, "Create a Clan", "Create a Clan using /c create"); + super( + objective, + "Create a Clan", + "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." + ); } @Override 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 eeecf27d8..c976aae6b 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 @@ -7,6 +7,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import mineplex.core.common.util.C; +import mineplex.core.common.util.F; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.game.clans.tutorial.TutorialRegion; @@ -18,7 +19,15 @@ public class LeaveSpawnGoal extends ObjectiveGoal { public LeaveSpawnGoal(ClanObjective objective) { - super(objective, "Leave Spawn", "Exit the tutorial spawn area"); + super( + objective, + "Leave Spawn", + "Jump off Spawn Island", + 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!" + ); // 2 seconds after start message setStartMessageDelay(20 * 3); 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 877029be2..bf9137780 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 @@ -18,7 +18,14 @@ public class SetHomeGoal extends ObjectiveGoal { public SetHomeGoal(ClanObjective objective) { - super(objective, "Set Clan Home", "Set your Clan's home by typing /c sethome"); + super( + objective, + "Set Clan Home", + "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") + "." + ); 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 f26390553..4772ed37b 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 @@ -11,7 +11,13 @@ public class EquipDefaultBuildGoal extends ObjectiveGoal { public EquipDefaultBuildGoal(ClassesObjective objective) { - super(objective, "Equip Armor", "Equip your newly bought armor to try out it's abilities"); + super( + objective, + "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." + ); 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 6b06e9833..a1cf2d055 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 @@ -5,6 +5,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerInteractEvent; +import mineplex.core.common.util.F; import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.game.clans.tutorial.objective.ObjectiveGoal; @@ -14,7 +15,13 @@ public class OpenClassManagerGoal extends ObjectiveGoal { public OpenClassManagerGoal(ClassesObjective objective) { - super(objective, "Open Class Manager", "Open the Class Manager by right clicking on an enchantment table"); + super( + objective, "Open Class Manager", + "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." + ); } @Override diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/classes/SelectBullsChargeGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/classes/SelectBullsChargeGoal.java index 515145fd0..0ebdd7221 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/classes/SelectBullsChargeGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/classes/SelectBullsChargeGoal.java @@ -4,6 +4,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.game.clans.clans.ClansManager; import mineplex.game.clans.tutorial.objective.ObjectiveGoal; @@ -32,6 +33,11 @@ public class SelectBullsChargeGoal extends ObjectiveGoal @EventHandler public void update(UpdateEvent event) { + if (event.getType() != UpdateType.TICK) + { + return; + } + getActivePlayers().forEach(uuid -> { Player player = UtilPlayer.searchExact(uuid); 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 720448e01..5a6b789ca 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 @@ -11,7 +11,13 @@ public class UseBullsChargeGoal extends ObjectiveGoal { public UseBullsChargeGoal(ClassesObjective objective) { - super(objective, "Use Bulls Charge", "Use the Bull's Charge skill to make yourself run faster"); + super( + objective, + "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." + ); } @Override 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 4622ff542..0aa7db2df 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 @@ -12,7 +12,12 @@ public class BuyEnergyGoal extends ObjectiveGoal { public BuyEnergyGoal(EnergyObjective objective) { - super(objective, "Buy Energy", "Buy Energy from the Energy Shop"); + super( + objective, + "Buy Energy", + "Buy Clan Energy from the Energy Shop", + "You can buy Clan Energy at the Shops." + ); } @Override 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 8d3f2f114..8f8058cad 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 @@ -17,7 +17,14 @@ public class ExplainEnergyGoal extends ObjectiveGoal { public ExplainEnergyGoal(EnergyObjective objective) { - super(objective, "About Energy", "Check your Energy"); + super( + objective, + "About Energy", + "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!" + ); } @Override 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 c454971e2..9281515cb 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 @@ -20,7 +20,13 @@ public class GoToFieldsGoal extends ObjectiveGoal { public GoToFieldsGoal(FieldsObjective objective) { - super(objective, "Go to the Fields", "Run to the center of the map, to the Fields"); + super( + objective, + "Go to the Fields", + "Go to the Fields", + "The Fields are a very dangerous place where players come to fight and harvest " + + "resources!" + ); } @Override 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 09cfe93e6..81d094ca2 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 @@ -25,7 +25,13 @@ public class MineDiamondsGoal extends ObjectiveGoal public MineDiamondsGoal(FieldsObjective objective) { - super(objective, "Mine Diamonds", "Search for some diamonds in the Fields and mine them"); + super( + objective, + "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!" + ); _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 278a1f7d4..1ff580789 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 @@ -15,7 +15,12 @@ public class SellDiamondsGoal extends ObjectiveGoal { public SellDiamondsGoal(FieldsObjective objective) { - super(objective, "Sell Diamonds", "Return to shops and sell your diamonds to the Mining NPC"); + super( + objective, + "Sell Diamonds", + "Sell your Diamonds to the Mining Shop", + "Go back to the Shops and sell your precious diamonds!" + ); } @Override 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 fedb379bf..fb1aa9210 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 @@ -19,7 +19,14 @@ public class DisbandClanGoal extends ObjectiveGoal { public DisbandClanGoal(FinalObjective objective) { - super(objective, "Disband Clan", "Use the /c command to disband your Tutorial Clan"); + super( + objective, + "Disband Clan", + "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." + ); } @Override 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 2c2eddc8c..030bb18c8 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 @@ -20,7 +20,12 @@ public class TpClanHomeGoal extends ObjectiveGoal { public TpClanHomeGoal(FinalObjective objective) { - super(objective, "Teleport to Clan Home", "Use the /c home command to teleport to your Clan Home"); + super( + 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!" + ); 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 b4f8365c6..92aba23d7 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 @@ -20,7 +20,12 @@ public class GoToShopsGoal extends ObjectiveGoal { public GoToShopsGoal(ShopsObjective objective) { - super(objective, "Go to the Shops", "Head over to the Shops (use your map)"); + super( + 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!" + ); } @Override 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 6623879e2..dfe7d5139 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 @@ -22,6 +22,16 @@ public class PurchaseGoal extends ObjectiveGoal setDisplayFinishMessage(false); } + public PurchaseGoal(Objective objective, Material material, String name, String description, + String helpText) + { + super(objective, name, description, helpText); + _material = material; + + setDisplayStartMessage(false); + setDisplayFinishMessage(false); + } + @Override protected void customStart(Player player) { 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 ab8bb42ff..7b51f0ce1 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 @@ -16,7 +16,14 @@ public class SellPotatoesGoal extends ObjectiveGoal { public SellPotatoesGoal(ShopsObjective objective) { - super(objective, "Sell Potatoes", "Right click the Organic Produce NPC and sell your potatoes"); + super( + objective, + "Sell Potatoes", + "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!" + ); } @Override