From c3a119cfe42d4268e39cc348ef9ab16f6e4bddba Mon Sep 17 00:00:00 2001 From: phobia Date: Mon, 4 Apr 2016 10:11:26 +1000 Subject: [PATCH 01/19] Display completion only to player who completes --- .../game/clans/tutorial/tutorials/clans/ClansMainTutorial.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 222828d2e..be51c9bcd 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 @@ -94,7 +94,7 @@ public class ClansMainTutorial extends Tutorial protected void onFinish(Player player) { _fireworks.add(player); - UtilTextMiddle.display(C.cYellow + "Congratulations", "You have completed the Tutorial!", 10, 60, 10); + UtilTextMiddle.display(C.cYellow + "Congratulations", "You have completed the Tutorial!", 10, 60, 10, player); Bukkit.getScheduler().runTaskLater(getPlugin(), () -> { _fireworks.remove(player); getMessage().removePlayer(player); From 5195e4a13d410d8592bcec2893d98b4a4d9ac402 Mon Sep 17 00:00:00 2001 From: phobia Date: Mon, 4 Apr 2016 10:15:15 +1000 Subject: [PATCH 02/19] Message fixes --- .../src/mineplex/game/clans/tutorial/objective/Objective.java | 4 ++-- 1 file changed, 2 insertions(+), 2 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 6139a0cb1..aa711ad4f 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 @@ -269,12 +269,12 @@ public abstract class Objective Date: Mon, 4 Apr 2016 12:32:22 +1000 Subject: [PATCH 03/19] More tutorial tweaking --- .../src/mineplex/core/npc/NpcManager.java | 1 + .../src/mineplex/game/clans/Clans.java | 2 +- .../game/clans/clans/ClansManager.java | 2 +- .../game/clans/tutorial/Tutorial.java | 50 ++++++++++++++----- .../game/clans/tutorial/TutorialManager.java | 9 ++++ .../game/clans/tutorial/TutorialSession.java | 34 +++++++++++++ .../clans/tutorial/command/FinishCommand.java | 23 +++++++++ .../clans/tutorial/command/StartCommand.java | 2 +- .../tutorial/command/TutorialCommand.java | 3 +- .../clans/tutorial/objective/Objective.java | 27 +++++++++- .../tutorial/objective/ObjectiveGoal.java | 15 +----- .../tutorial/objective/OrderedObjective.java | 8 +++ .../tutorial/objective/SingleObjective.java | 6 +++ .../objective/UnorderedObjective.java | 9 ++++ .../tutorials/clans/ClansMainTutorial.java | 47 +++++++++++++++-- .../attackenemy/StealEnemyPotatoesGoal.java | 2 +- .../objective/goals/clan/LeaveSpawnGoal.java | 2 +- 17 files changed, 204 insertions(+), 38 deletions(-) create mode 100644 Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/command/FinishCommand.java diff --git a/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java b/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java index 3e7bfe05b..87c84076d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java @@ -486,6 +486,7 @@ public class NpcManager extends MiniPlugin public void removeFakeNpc(Npc npc) { _npcs.remove(npc); + npc.getEntity().remove(); } public void loadNpcs() throws SQLException diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java index c8665c8be..8385bc856 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java @@ -130,7 +130,7 @@ public class Clans extends JavaPlugin new Explosion(this, blockRestore); new InventoryManager(this, _clientManager); ResourcePackManager resourcePackManager = new ResourcePackManager(this, portal); - resourcePackManager.setResourcePack("http://garblox.com/files/b/ResClans.zip", "http://garblox.com/files/mineplex/ResClans19.zip", true); + resourcePackManager.setResourcePack("http://phinary.ca/ResClans.zip", "http://phinary.ca/ResClans19.zip", true); // Enable custom-gear related managers new CustomTagFix(this, packetHandler); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java index 299bcd519..7563c4c2c 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java @@ -821,7 +821,7 @@ public class ClansManager extends MiniClientPluginimplements IRelati List recipients = new ArrayList<>(); - for (Player other : UtilServer.getPlayers()) + for (Player other : event.getRecipients()) { ClanInfo otherClan = _clanUtility.getClanByPlayer(other); 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 15bf9b6e0..f66c84fdd 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 @@ -159,7 +159,7 @@ public abstract class Tutorial implements Listener, ObjectiveListener { } - private void finish(Player player) + protected final void finish(Player player) { _objectives.forEach(objective -> objective.clean(player, getRegion(player))); @@ -281,7 +281,7 @@ public abstract class Tutorial implements Listener, ObjectiveListener for (Map.Entry entry : _playerSessionMap.entrySet()) { - String prefix = entry.getValue().incrementAndGetColorTick() % 2 == 0 ? C.cYellow : C.cGold; + String prefix = entry.getValue().incrementAndGetColorTick() % 2 == 0 ? C.cWhite : C.cGreen; Objective objective = _objectives.get(entry.getValue().getObjectiveIndex()); UtilTextBottom.display(prefix + objective.getDescription(entry.getKey()), entry.getKey()); } @@ -297,12 +297,8 @@ public abstract class Tutorial implements Listener, ObjectiveListener for (Map.Entry entry : _playerSessionMap.entrySet()) { - String extra = _objectives.get(entry.getValue().getObjectiveIndex()).getExtraDescription(entry.getKey()); - if (extra == null) - { - // None defined. - continue; - } + Player player = entry.getKey(); + Objective objective = _objectives.get(entry.getValue().getObjectiveIndex()); if (entry.getValue().incrementAndGetTextSeconds() < 20) { @@ -310,10 +306,7 @@ public abstract class Tutorial implements Listener, ObjectiveListener 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); + objective.displayChatMessages(player); } } @@ -327,6 +320,39 @@ public abstract class Tutorial implements Listener, ObjectiveListener } } + public void setSpawnHologram(Player player, Location location, String... text) + { + if (_playerSessionMap.containsKey(player)) + { + TutorialSession session = _playerSessionMap.get(player); + if (session.getSpawnHologram() == null && !session.isRemovedHologram()) + { + Hologram hologram = new Hologram(_hologram, location, text); + session.setSpawnHologram(hologram); + hologram.start(); + } + else + { + session.getSpawnHologram().setText(text); + } + } + } + + public void removeSpawnHologram(Player player) + { + if (_playerSessionMap.containsKey(player)) + { + TutorialSession session = _playerSessionMap.get(player); + if (session.getSpawnHologram() != null) + { + session.getSpawnHologram().stop(); + session.setSpawnHologram(null); + } + + session.setRemovedHologram(true); + } + } + public TutorialSession getTutorialSession(Player player) { return _playerSessionMap.get(player); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/TutorialManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/TutorialManager.java index e8b43f243..4bd716595 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/TutorialManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/TutorialManager.java @@ -121,6 +121,15 @@ public class TutorialManager extends MiniPlugin implements ScoreboardElement return null; } + public void finishTutorial(Player player) + { + Tutorial tutorial = getTutorial(player); + if (tutorial != null) + { + tutorial.finish(player); + } + } + public boolean startTutorial(Player player, TutorialType type) { if (inTutorial(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 ced0ea35f..271db3e05 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 @@ -9,6 +9,7 @@ import mineplex.core.hologram.Hologram; public class TutorialSession { + private final long _startTime; private int _objectiveIndex; private TutorialRegion _region; private List _hologramList = new ArrayList<>(); @@ -16,9 +17,12 @@ public class TutorialSession private int _colorTick; private int _textSeconds; private Location _mapTargetLocation; + private Hologram _spawnHologram; + private boolean _removedHologram; public TutorialSession() { + _startTime = System.currentTimeMillis(); } public List getHolograms() @@ -81,4 +85,34 @@ public class TutorialSession { return _mapTargetLocation; } + + public long getStartTime() + { + return _startTime; + } + + public long getElapsedTime() + { + return System.currentTimeMillis() - _startTime; + } + + public boolean isRemovedHologram() + { + return _removedHologram; + } + + public void setRemovedHologram(boolean removedHologram) + { + _removedHologram = removedHologram; + } + + public void setSpawnHologram(Hologram spawnHologram) + { + _spawnHologram = spawnHologram; + } + + public Hologram getSpawnHologram() + { + return _spawnHologram; + } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/command/FinishCommand.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/command/FinishCommand.java new file mode 100644 index 000000000..be204fd2e --- /dev/null +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/command/FinishCommand.java @@ -0,0 +1,23 @@ +package mineplex.game.clans.tutorial.command; + +import org.bukkit.entity.Player; + +import mineplex.core.command.CommandBase; +import mineplex.core.common.Rank; +import mineplex.game.clans.tutorial.TutorialManager; + +public class FinishCommand extends CommandBase +{ + public FinishCommand(TutorialManager plugin) + { + super(plugin, Rank.MODERATOR, "finish", "end"); + } + + @Override + public void Execute(Player caller, String[] args) + { + Plugin.finishTutorial(caller); + + + } +} diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/command/StartCommand.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/command/StartCommand.java index 3bfa840b5..859503bbc 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/command/StartCommand.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/command/StartCommand.java @@ -13,7 +13,7 @@ public class StartCommand extends CommandBase { public StartCommand(TutorialManager plugin) { - super(plugin, Rank.JNR_DEV, "start"); + super(plugin, Rank.MODERATOR, "start"); } @Override diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/command/TutorialCommand.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/command/TutorialCommand.java index 139655bbb..a2814ddd3 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/command/TutorialCommand.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/command/TutorialCommand.java @@ -13,9 +13,10 @@ public class TutorialCommand extends MultiCommandBase { public TutorialCommand(TutorialManager plugin) { - super(plugin, Rank.JNR_DEV, "tutorial", "tut"); + super(plugin, Rank.MODERATOR, "tutorial", "tut"); AddCommand(new StartCommand(plugin)); + AddCommand(new FinishCommand(plugin)); } @Override 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 6139a0cb1..caf405c4e 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 @@ -199,8 +199,6 @@ public abstract class Objective [%s] finished objective [%s]", player.getName(), getName(player))); - showFinishMessage(player); - _active.remove(player.getUniqueId()); if (_displayFinishMessage) @@ -277,11 +275,36 @@ public abstract class Objective goal = getLatestGoal(player); + String name = goal == null ? getName(player) : goal.getName(player); + String extra = getExtraDescription(player); +// UtilPlayer.message(player, C.cGold + C.Strike + "---------------------------------------------"); + UtilPlayer.message(player, C.cPurpleB + name); + if (extra != null) + { + UtilPlayer.message(player, ""); + UtilPlayer.message(player, C.cGray + " " + extra); + } + UtilPlayer.message(player, ""); + UtilPlayer.message(player, C.cGreen + getDescription(player)); +// UtilPlayer.message(player, C.cGold + C.Strike + "---------------------------------------------"); + getPlugin().getTutorialSession(player).setTextSeconds(0); + } + public void setDisplayStartMessage(boolean displayStartMessage) { _displayStartMessage = displayStartMessage; } + public abstract ObjectiveGoal getLatestGoal(Player player); + public void setDisplayFinishMessage(boolean displayFinishMessage) { _displayFinishMessage = displayFinishMessage; 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 36f92a3ef..88f58cf34 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 @@ -152,7 +152,7 @@ public abstract class ObjectiveGoal > implements Liste */ protected void clean(Player player, TutorialRegion region) { - + _removeList.add(player.getUniqueId()); } public T getObjective() @@ -174,18 +174,7 @@ public abstract class ObjectiveGoal > implements Liste UtilTextMiddle.display(C.cYellow + "New Objective", getName(player), player); - if (getExtraDescription(player) != null) - { - for (int i = 0; i < 5; i++) - { - UtilPlayer.message(player, ""); - } - // 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); - } + _objective.displayChatMessages(player); } 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 95e1a7145..91302df37 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 @@ -73,6 +73,14 @@ public abstract class OrderedObjective extends Objectiv return _goals.get(index).getExtraDescription(player); } + @Override + public ObjectiveGoal getLatestGoal(Player player) + { + OrderedObjectiveData data = getData(player); + int index = data == null ? 0 : data.getIndex(); + return _goals.get(index); + } + @Override protected void customStart(Player player) { 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 2dcf162e1..78e47d648 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 @@ -36,6 +36,12 @@ public abstract class SingleObjective extends Objective // Do Nothing } + @Override + public ObjectiveGoal getLatestGoal(Player player) + { + return null; + } + @Override protected List> getGoals() { 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 4d38a9c45..f145c2270 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 @@ -74,6 +74,15 @@ public abstract class UnorderedObjective extends Object return index == -1 ? super.getExtraDescription(player) : _goals.get(index).getExtraDescription(player); } + @Override + public ObjectiveGoal getLatestGoal(Player player) + { + UnorderedObjectiveData data = getData(player); + if (data == null) return null; + int index = data.getFirstIncompleteIndex(); + return index == -1 ? null : _goals.get(index); + } + @Override protected void customStart(Player player) { 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 222828d2e..5465cad44 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 @@ -6,6 +6,7 @@ import java.util.List; import java.util.Objects; import java.util.UUID; +import mineplex.core.hologram.Hologram; import mineplex.core.common.util.*; import mineplex.game.clans.clans.ClanInfo; import mineplex.game.clans.clans.event.ClansPlayerBuyItemEvent; @@ -40,6 +41,7 @@ import mineplex.game.clans.message.ClansMessageManager; import mineplex.game.clans.spawn.Spawn; import mineplex.game.clans.tutorial.Tutorial; import mineplex.game.clans.tutorial.TutorialRegion; +import mineplex.game.clans.tutorial.TutorialSession; import mineplex.game.clans.tutorial.TutorialWorldManager; import mineplex.game.clans.tutorial.map.TutorialMapManager; import mineplex.game.clans.tutorial.tutorials.clans.objective.AttackEnemyObjective; @@ -105,7 +107,7 @@ public class ClansMainTutorial extends Tutorial ClansManager.getInstance().getItemMapManager().setMap(player); }, 20 * 10L); - + player.setWalkSpeed(0.2F); //ClansManager.getInstance().getPvpTimer().unpause(player); @@ -148,15 +150,17 @@ public class ClansMainTutorial extends Tutorial //ClansManager.getInstance().getPvpTimer().pause(player); // Spawn Holograms - addHologram(player, - getPoint(region, ClansMainTutorial.Point.SPAWN).add(0, 1.5, -6), + setSpawnHologram(player, + getPoint(region, ClansMainTutorial.Point.SPAWN).add(0, 1.5, -3), 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!"); + "Starting in " + C.cGreen + "10 Seconds"); + + player.setWalkSpeed(0); addHologram(player, getPoint(region, ClansMainTutorial.Point.SPAWN).add(0, 1.5, -23), @@ -429,6 +433,39 @@ public class ClansMainTutorial extends Tutorial */ } + @EventHandler + public void preventMovement(UpdateEvent event) + { + if (event.getType() != UpdateType.FAST) + return; + + for (Player player : getPlayers()) + { + TutorialSession session = getTutorialSession(player); + long time = session.getElapsedTime(); + if (time <= 10000) // 10 seconds + { +// player.teleport(getSpawn(session.getRegion())); + + String secondsLeft = UtilTime.convertString(10000 - time, 0, UtilTime.TimeUnit.SECONDS); + setSpawnHologram(player, + getPoint(session.getRegion(), ClansMainTutorial.Point.SPAWN).add(0, 1.5, -3), + 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.", + " ", + "Starting in " + C.cGreen + secondsLeft); + } + else if (!session.isRemovedHologram()) + { + removeSpawnHologram(player); + player.setWalkSpeed(0.2F); + } + } + } + public void performGateCheck(Player player, DyeColor key) { if(player == null || !player.isOnline()) return; @@ -442,7 +479,7 @@ public class ClansMainTutorial extends Tutorial return; } - if (player.getLocation().distanceSquared(fence) <= (GATE_OPEN_DISTANCE * 2)) + if (player.getLocation().distanceSquared(fence) <= (GATE_OPEN_DISTANCE * GATE_OPEN_DISTANCE)) { // Within the correct blocks of the gates. destroyFences(getRegion(player), key); 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 b046c693d..8339ed67c 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 @@ -115,7 +115,7 @@ public class StealEnemyPotatoesGoal extends ObjectiveGoal if (event.getItem().getItemStack().getType() == Material.POTATO_ITEM) { - int count = _playersMap.get(event.getPlayer().getUniqueId()).getAndIncrement(); + int count = _playersMap.get(event.getPlayer().getUniqueId()).incrementAndGet(); if (count == 10) finish(event.getPlayer()); } 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 d7347e245..80d01bcd7 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 @@ -33,7 +33,7 @@ public class LeaveSpawnGoal extends ObjectiveGoal ); // 2 seconds after start message -// setStartMessageDelay(20 * 3); + setStartMessageDelay(20 * 11); } @Override From 0a39b7b756c2928048b4d1c8540a08f6000f5e7c Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Mon, 4 Apr 2016 12:36:47 +1000 Subject: [PATCH 04/19] Fix objective ordering --- .../clans/objective/AttackEnemyObjective.java | 3 +- .../{clan => attackenemy}/ClanInfoGoal.java | 2 +- .../goals/fields/KillZombiesGoal.java | 58 ------------------- 3 files changed, 2 insertions(+), 61 deletions(-) rename Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/{clan => attackenemy}/ClanInfoGoal.java (99%) delete mode 100644 Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/fields/KillZombiesGoal.java 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 fa12438cd..7b81b3a45 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 @@ -8,7 +8,6 @@ import java.util.Map; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; -import org.bukkit.craftbukkit.v1_8_R3.entity.CraftZombie; import org.bukkit.entity.Arrow; import org.bukkit.entity.Player; import org.bukkit.entity.Zombie; @@ -40,7 +39,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 mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy.ClanInfoGoal; public class AttackEnemyObjective extends OrderedObjective { 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/attackenemy/ClanInfoGoal.java similarity index 99% rename from Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/ClanInfoGoal.java rename to Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/ClanInfoGoal.java index 424576bb4..4610b5c15 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/attackenemy/ClanInfoGoal.java @@ -1,4 +1,4 @@ -package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan; +package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy; import mineplex.core.common.util.F; diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/fields/KillZombiesGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/fields/KillZombiesGoal.java deleted file mode 100644 index d393dbe08..000000000 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/fields/KillZombiesGoal.java +++ /dev/null @@ -1,58 +0,0 @@ -package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.fields; - -import java.util.UUID; - -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.entity.EntityDeathEvent; - -import mineplex.core.common.DefaultHashMap; -import mineplex.game.clans.tutorial.objective.Objective; -import mineplex.game.clans.tutorial.objective.ObjectiveGoal; - -public class KillZombiesGoal extends ObjectiveGoal -{ - private DefaultHashMap _kills = new DefaultHashMap<>(uuid -> 0); - - public KillZombiesGoal(Objective objective) - { - super(objective, "Kill Zombies", "Kill a few zombies in the Fields."); - } - - @Override - protected void customStart(Player player) - { - } - - @Override - protected void customFinish(Player player) - { - } - - @EventHandler - public void entityKilled(EntityDeathEvent event) - { - if (event.getEntityType() != EntityType.ZOMBIE) - { - return; - } - - if (event.getEntity().getKiller() == null) - { - return; - } - - if (!contains(event.getEntity().getKiller())) - { - return; - } - - _kills.put(event.getEntity().getKiller().getUniqueId(), Integer.valueOf(_kills.get(event.getEntity().getKiller().getUniqueId()).intValue() + 1)); - - if (_kills.get(event.getEntity().getKiller().getUniqueId()).intValue() >= 2) - { - finish(event.getEntity().getKiller()); - } - } -} From 5ad877f8649e6258a6a79ed70839550ac6da3158 Mon Sep 17 00:00:00 2001 From: phobia Date: Mon, 4 Apr 2016 12:47:23 +1000 Subject: [PATCH 05/19] So many fixes <3 --- .../game/clans/clans/siege/weapon/Cannon.java | 1 + .../clans/worldevent/kinghill/KingHill.java | 16 +++++++++++---- .../clans/worldevent/undead/UndeadCamp.java | 20 +++++++++++++------ .../game/clans/gameplay/Gameplay.java | 5 ----- .../src/mineplex/game/clans/shop/PvpItem.java | 2 +- .../clans/tutorial/command/StartCommand.java | 2 +- .../tutorial/command/TutorialCommand.java | 2 +- .../tutorials/clans/ClansMainTutorial.java | 10 ++++++++++ .../clans/objective/FieldsObjective.java | 3 ++- .../clans/objective/ShopsObjective.java | 3 ++- .../clans/objective/goals/HoldItemGoal.java | 9 +++++---- .../goals/attackenemy/BlowUpWallGoal.java | 2 +- .../objective/goals/energy/BuyEnergyGoal.java | 1 - .../objective/goals/shops/PurchaseGoal.java | 1 - .../minecraft/game/core/boss/WorldEvent.java | 4 ++-- 15 files changed, 52 insertions(+), 29 deletions(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/weapon/Cannon.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/weapon/Cannon.java index e487410ae..1b7f3f0c9 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/weapon/Cannon.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/weapon/Cannon.java @@ -226,6 +226,7 @@ public class Cannon extends SiegeWeapon if(_inventory.getViewers().contains(event.getWhoClicked())) { event.setCancelled(true); //block shift right clicking tnt into this inventory + getClans().runSyncLater(() -> ((Player) event.getWhoClicked()).updateInventory(), 1L); } return; } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/kinghill/KingHill.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/kinghill/KingHill.java index 6d08c9e19..5a227791f 100755 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/kinghill/KingHill.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/kinghill/KingHill.java @@ -6,14 +6,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import mineplex.core.common.util.*; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.Player; -import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilTime; -import mineplex.core.common.util.UtilWorld; import mineplex.core.scoreboard.ScoreboardManager; import mineplex.game.clans.clans.ClanInfo; import mineplex.game.clans.clans.ClansManager; @@ -184,4 +181,15 @@ public class KingHill extends WorldEvent { public int TicksOnHill; } + + @Override + public void announceStart() + { + for(Player player : UtilServer.getPlayers()) { + if(_clansManager.getTutorials().isInTutorial(player)) continue; + + UtilTextMiddle.display(C.cGreen + getName(), UtilWorld.locToStrClean(getCenterLocation()), 10, 100, 40, player); + player.sendMessage(F.main("Event", F.elem(getName()) + " has started at coordinates " + F.elem(UtilWorld.locToStrClean(getCenterLocation())))); + } + } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/undead/UndeadCamp.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/undead/UndeadCamp.java index a3a746469..d0410515b 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/undead/UndeadCamp.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/undead/UndeadCamp.java @@ -4,22 +4,18 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Set; +import mineplex.core.common.util.*; import mineplex.game.clans.clans.ClansManager; import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; +import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerInteractEvent; -import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilBlock; -import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilWorld; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; @@ -509,4 +505,16 @@ public class UndeadCamp extends WorldEvent } } } + + + @Override + public void announceStart() + { + for(Player player : UtilServer.getPlayers()) { + if(ClansManager.getInstance().getTutorials().isInTutorial(player)) continue; + + UtilTextMiddle.display(C.cGreen + getName(), UtilWorld.locToStrClean(getCenterLocation()), 10, 100, 40, player); + player.sendMessage(F.main("Event", F.elem(getName()) + " has started at coordinates " + F.elem(UtilWorld.locToStrClean(getCenterLocation())))); + } + } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java index 700be5313..eee7092d4 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java @@ -432,11 +432,6 @@ public class Gameplay extends MiniPlugin return; } - if (_clansManager.getTutorials().isInTutorial(event.getPlayer())) - { - return; - } - Block block = event.getClickedBlock(); // Knock diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/shop/PvpItem.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/shop/PvpItem.java index 1dd6c2183..a62f2ad89 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/shop/PvpItem.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/shop/PvpItem.java @@ -29,7 +29,7 @@ public class PvpItem extends ShopItem super(type, data, name, new String[] { C.cWhite + " ", LEFT_CLICK_BUY, - C.cWhite + "Costs " + C.cGreen + (buyPrice == 0 ? "Free" : buyPrice + "g"), + C.cWhite + "Costs " + C.cGreen + (buyPrice == 0 ? "Free (Tutorial)" : buyPrice + "g"), C.cWhite + " ", UtilItem.isArmor(type) || UtilItem.isTool(type) ? "" : C.cYellow + "Shift Left-Click" + C.cWhite + " to Buy " + C.cGreen + bulkCount, UtilItem.isArmor(type) || UtilItem.isTool(type) ? "" : C.cWhite + "Costs " + C.cGreen + (buyPrice * bulkCount) + "g", C.cWhite + " ", diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/command/StartCommand.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/command/StartCommand.java index 3bfa840b5..859503bbc 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/command/StartCommand.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/command/StartCommand.java @@ -13,7 +13,7 @@ public class StartCommand extends CommandBase { public StartCommand(TutorialManager plugin) { - super(plugin, Rank.JNR_DEV, "start"); + super(plugin, Rank.MODERATOR, "start"); } @Override diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/command/TutorialCommand.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/command/TutorialCommand.java index 139655bbb..11eb9e463 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/command/TutorialCommand.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/command/TutorialCommand.java @@ -13,7 +13,7 @@ public class TutorialCommand extends MultiCommandBase { public TutorialCommand(TutorialManager plugin) { - super(plugin, Rank.JNR_DEV, "tutorial", "tut"); + super(plugin, Rank.MODERATOR, "tutorial", "tut"); AddCommand(new StartCommand(plugin)); } 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 be51c9bcd..00d48a3da 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 @@ -10,6 +10,7 @@ import mineplex.core.common.util.*; import mineplex.game.clans.clans.ClanInfo; import mineplex.game.clans.clans.event.ClansPlayerBuyItemEvent; import mineplex.game.clans.clans.event.ClansPlayerSellItemEvent; +import mineplex.game.clans.clans.event.PreEnergyShopBuyEvent; import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import org.bukkit.*; import org.bukkit.block.Block; @@ -473,4 +474,13 @@ public class ClansMainTutorial extends Tutorial if(isInTutorial(event.getPlayer())) event.setCancelled(true); } + + @EventHandler + public void energyBuy(PreEnergyShopBuyEvent event) + { + if (isInTutorial(event.getPlayer())) + { + event.setCancelled(true); + } + } } 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 e1f060696..1e06c6649 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 @@ -25,7 +25,8 @@ public class FieldsObjective extends OrderedObjective Material.MAP, "Identify Fields on Map", "Find the Orange Striped Area on your map", - "Fields are marked by " + C.cGold + "Orange Stripes" + C.mBody + "." + "Fields are marked by " + C.cGold + "Orange Stripes" + C.mBody + ".", + 60L )); addGoal(new GoToFieldsGoal(this)); addGoal(new MineDiamondsGoal(this)); 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 c317a434a..43a39a13a 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 @@ -43,7 +43,8 @@ public class ShopsObjective extends OrderedObjective Material.MAP, "Identify Shops on Map", "Find the Blue striped area on your map", - "Shops are marked on the map by the " + C.cDAqua + "Blue Stripes" + C.mBody + "." + "Shops are marked on the map by the " + C.cDAqua + "Blue Stripes" + C.mBody + ".", + 60L )); 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 9412598d7..dde20c741 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 @@ -16,19 +16,20 @@ public class HoldItemGoal extends ObjectiveGoal> { private DefaultHashMap> _ticksHeld = new DefaultHashMap<>(key -> new EnclosedObject<>(Integer.valueOf(0))); private Material _material; + private long _holdTicks; - public HoldItemGoal(Objective objective, Material material, String name, String description, String helpText, int startDelay) + public HoldItemGoal(Objective objective, Material material, String name, String description, String helpText, int startDelay, long holdTicks) { super(objective, name, description, helpText, null); _material = material; - + _holdTicks = holdTicks; // setStartMessageDelay(startDelay); } - public HoldItemGoal(Objective objective, Material material, String name, String description, String helpText) + public HoldItemGoal(Objective objective, Material material, String name, String description, String helpText, long holdTicks) { - this(objective, material, name, description, helpText, 120); + this(objective, material, name, description, helpText, 120, holdTicks); } @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 8ff57b6b0..ed1c5067b 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 @@ -106,7 +106,7 @@ public class BlowUpWallGoal extends ObjectiveGoal } else { - UtilPlayer.message(shooter, F.main("Clans", "You missed! Try to hit the enemies front wall, that should make a nice big hole!")); + UtilPlayer.message(shooter, F.main("Clans", "You missed! Try to hit the enemy's front wall, that should make a nice big hole!")); UtilInv.give(shooter, Material.TNT); } 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 079c91c8f..40ab1a5cc 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 @@ -48,7 +48,6 @@ public class BuyEnergyGoal extends ObjectiveGoal { if (contains(event.getPlayer())) { - event.setCancelled(true); finish(event.getPlayer()); event.getPlayer().closeInventory(); } 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 f9126c5be..a5ba6bc0a 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 @@ -51,7 +51,6 @@ public class PurchaseGoal extends ObjectiveGoal if (contains(event.getPlayer()) && event.getMaterial() == _material) { event.setBuyPrice(0); - event.setSellPrice(0); } } diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/WorldEvent.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/WorldEvent.java index d75b6655d..f1cd8424b 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/WorldEvent.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/WorldEvent.java @@ -263,11 +263,11 @@ public abstract class WorldEvent implements Listener, ScoreboardElement HandlerList.unregisterAll(creature); _creatures.remove(creature); } - + public void announceStart() { UtilTextMiddle.display(C.cGreen + getName(), UtilWorld.locToStrClean(getCenterLocation()), 10, 100, 40); - + UtilServer.broadcast(F.main("Event", F.elem(getName()) + " has started at coordinates " + F.elem(UtilWorld.locToStrClean(getCenterLocation())))); } From 8dee8eab0a883a56383f5138d1d639004985c536 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Mon, 4 Apr 2016 12:52:52 +1000 Subject: [PATCH 06/19] Bug fixes --- .../src/mineplex/game/clans/tutorial/objective/Objective.java | 2 +- .../mineplex/game/clans/tutorial/objective/ObjectiveGoal.java | 3 ++- .../game/clans/tutorial/tutorials/clans/ClansMainTutorial.java | 2 +- 3 files changed, 4 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 caf405c4e..bb800fe8c 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 @@ -277,7 +277,7 @@ public abstract class Objective> implements Liste { System.out.println(String.format("Tutorial> [%s] finished objective goal [%s]", player.getName(), getName(player))); - getObjective().getPlugin().getTutorialSession(player).setTextSeconds(0); + if (getObjective().getPlugin().getTutorialSession(player) != null) + getObjective().getPlugin().getTutorialSession(player).setTextSeconds(0); _removeList.add(player.getUniqueId()); 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 5465cad44..2f7da444b 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 @@ -96,7 +96,7 @@ public class ClansMainTutorial extends Tutorial protected void onFinish(Player player) { _fireworks.add(player); - UtilTextMiddle.display(C.cYellow + "Congratulations", "You have completed the Tutorial!", 10, 60, 10); + UtilTextMiddle.display(C.cYellow + "Congratulations", "You have completed the Tutorial!", 10, 60, 10, player); Bukkit.getScheduler().runTaskLater(getPlugin(), () -> { _fireworks.remove(player); getMessage().removePlayer(player); From 6c92b4233579dc66b9b017f89d01e7262966ebb2 Mon Sep 17 00:00:00 2001 From: Cheese Date: Mon, 4 Apr 2016 13:01:54 +1000 Subject: [PATCH 07/19] text changes --- .../tutorial/tutorials/clans/objective/ClanObjective.java | 2 +- .../tutorials/clans/objective/FieldsObjective.java | 2 +- .../tutorials/clans/objective/FinalObjective.java | 2 +- .../clans/objective/goals/attackenemy/BlowUpWallGoal.java | 4 ++-- .../clans/objective/goals/attackenemy/ClanInfoGoal.java | 2 +- .../clans/objective/goals/attackenemy/GetMapGoal.java | 2 +- .../clans/objective/goals/attackenemy/LoadCannonGoal.java | 5 ++--- .../objective/goals/attackenemy/MountCannonGoal.java | 6 +++--- .../goals/attackenemy/StealEnemyPotatoesGoal.java | 7 +++---- .../clans/objective/goals/clan/ClaimLandGoal.java | 8 ++++---- .../clans/objective/goals/clan/ClanManagementGoal.java | 5 ++--- .../clans/objective/goals/clan/LeaveSpawnGoal.java | 4 ++-- .../tutorials/clans/objective/goals/clan/SetHomeGoal.java | 3 +-- .../objective/goals/classes/OpenClassManagerGoal.java | 2 +- .../clans/objective/goals/classes/UseBullsChargeGoal.java | 2 +- .../clans/objective/goals/fields/MineDiamondsGoal.java | 2 +- .../clans/objective/goals/shops/GoToShopsGoal.java | 5 +++-- .../clans/objective/goals/shops/SellPotatoesGoal.java | 5 ++--- 18 files changed, 32 insertions(+), 36 deletions(-) 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 2b1e764b1..c9e68e3aa 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,7 +13,7 @@ public class ClanObjective extends OrderedObjective { public ClanObjective(ClansMainTutorial clansMainTutorial, JavaPlugin javaPlugin) { - super(clansMainTutorial, javaPlugin, "Clan Basics", "Create clan with /c create "); + super(clansMainTutorial, javaPlugin, "Clans", "Create clan with /c create "); addGoal(new LeaveSpawnGoal(this)); addGoal(new CreateClanGoal(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 e1f060696..3a5e2c03c 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 @@ -24,7 +24,7 @@ public class FieldsObjective extends OrderedObjective this, Material.MAP, "Identify Fields on Map", - "Find the Orange Striped Area on your map", + "Find the Orange Striped Area on your Map", "Fields are marked by " + C.cGold + "Orange Stripes" + C.mBody + "." )); addGoal(new GoToFieldsGoal(this)); 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 af1aa5dc9..b81cede20 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 @@ -13,7 +13,7 @@ public class FinalObjective extends OrderedObjective { public FinalObjective(ClansMainTutorial clansMainTutorial, JavaPlugin javaPlugin) { - super(clansMainTutorial, javaPlugin, "Finishing", "Finalize your knowledge of Clans"); + super(clansMainTutorial, javaPlugin, "Clans Basics 2", "Finalize your knowledge of Clans"); addGoal(new TpClanHomeGoal(this)); // IMPLEMENTED addGoal(new DisbandClanGoal(this)); // IMPLEMENTED 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 8ff57b6b0..e3b3f2fc2 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 @@ -29,8 +29,8 @@ public class BlowUpWallGoal extends ObjectiveGoal 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!", + "Left-Click to shoot TNT at the Enemy Base", + "TNT Cannons will rotate to the direction you are looking. Simply look at the Enemy Base, wait for it to rotate, and then FIRE!", DyeColor.MAGENTA ); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/ClanInfoGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/ClanInfoGoal.java index 4610b5c15..1f1b586b0 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/ClanInfoGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/ClanInfoGoal.java @@ -29,7 +29,7 @@ public class ClanInfoGoal extends ObjectiveGoal "View info about the enemy clan by typing /c EnemyClan", "You can lookup details about your enemy before going for an " + "attack! This can give you a crucial advantage before " + - "you begin.", + "you fight.", null ); } 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 86c2156b5..b0c8581dd 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 @@ -21,7 +21,7 @@ public class GetMapGoal extends ObjectiveGoal "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" + + "owns the land around the map. Your clan is " + C.cAqua + "blue" + C.mBody + ", your allies are " + C.cGreen + "green" + C.mBody + ", " + "and your enemies are " + C.cRed + "red" + C.mBody + ".", null 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 8fb911aca..81ca051c6 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 @@ -16,9 +16,8 @@ public class LoadCannonGoal extends ObjectiveGoal 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!", + "Right-Click while on the Cannon, and insert your TNT", + "TNT Cannons require TNT to be able to shoot. You can also change the range your cannon fires in the Cannon Menu.", null ); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/MountCannonGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/MountCannonGoal.java index 6ed7cd3fe..a7d6c3562 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 @@ -26,9 +26,9 @@ public class MountCannonGoal extends ObjectiveGoal 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!", + "Right-Click on the Cannon", + "You cannot break blocks in enemy territory, however you can blow them up! " + + "TNT Cannons are the best way to do destroy enemy bases!", DyeColor.BLACK ); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/StealEnemyPotatoesGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/StealEnemyPotatoesGoal.java index 8339ed67c..5e042c4bd 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 @@ -32,9 +32,8 @@ public class StealEnemyPotatoesGoal extends ObjectiveGoal 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!", + "Steal potatoes from the Enemy Clan’s base", + "Raiding enemy bases is one of the best parts of Clans! There's nothing better than looting Legendary weapons from enemies!", DyeColor.PURPLE ); } @@ -43,7 +42,7 @@ public class StealEnemyPotatoesGoal extends ObjectiveGoal public String getDescription(Player player) { int count = _playersMap.get(player.getUniqueId()).get(); - return "Retrieve the potatoes from the Enemy Clan’s base " + count + "/10"; + return "Steal 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/ClaimLandGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/ClaimLandGoal.java index c066b8a59..46895d689 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 @@ -27,10 +27,10 @@ public class ClaimLandGoal extends ObjectiveGoal 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. " + - "You must be inside the " + C.cAqua + "blue" + C.cGray + " outline to claim land.", + "Type /c to Claim Land using the Clan Menu", + "Clans are able to claim land for themselves. " + + "Once claimed, no one else can break or place blocks there! " + + "You must be inside the " + C.cAqua + "blue" + C.cGray + " outline to claim land.", DyeColor.ORANGE ); } 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 628cab02e..4f2e8cadc 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 @@ -22,9 +22,8 @@ public class ClanManagementGoal extends ObjectiveGoal super( objective, "Open the Clan Menu", - "Open the Clan Menu ( Type /c )", - "Clan Menu lets you view all clan information and perform actions such as: " + - "who is online, Claiming Land, Inviting Players and much more.", + "Type /c to open the Clan Menu", + "Clan Menu lets you do lots of Clans actions, and view information about your Clan. Take a moment to look at it all!", null ); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/LeaveSpawnGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/LeaveSpawnGoal.java index 80d01bcd7..3de4a6674 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 @@ -23,12 +23,12 @@ public class LeaveSpawnGoal extends ObjectiveGoal { super( objective, - "Leave Spawn", + "Leave Spawn Island", "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!", + "hints.", DyeColor.WHITE ); 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 d8e5172ec..bc07f4143 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 @@ -24,8 +24,7 @@ public class SetHomeGoal extends ObjectiveGoal "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") + ".", + "to from " + F.elem("Spawn Island") + " or at any time by typing " + F.elem("/c home") + ".", DyeColor.ORANGE ); 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 50cb18704..a67f38855 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 @@ -20,7 +20,7 @@ public class OpenClassManagerGoal extends ObjectiveGoal 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 " + + "equip! Right-Click on an " + F.elem("Enchanting Table") + " to have a look at " + "this menu.", DyeColor.CYAN ); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/classes/UseBullsChargeGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/classes/UseBullsChargeGoal.java index d95287c5a..6c17de60c 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 @@ -21,7 +21,7 @@ public class UseBullsChargeGoal extends ObjectiveGoal { super( objective, "Use Bulls Charge", - "Right-Click with Axe to use Bull's Charge", + "Right-Click with Axe to use Bulls 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.", null 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 d70fe6791..aca99b031 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 @@ -29,7 +29,7 @@ public class MineDiamondsGoal extends ObjectiveGoal super( objective, "Mine Diamonds", - "Search for some diamonds in the Fields and mine them", + "Mine Diamonds in the Fields", "Mining in the Fields is a great way to make lots of money! The ores will " + "regenerate over time. Be careful of enemies though!", DyeColor.LIME 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 356653bc1..f08161fe0 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 @@ -23,8 +23,9 @@ public class GoToShopsGoal extends ObjectiveGoal 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!", + "Walk to the Shops", + "The shops are the place where you can buy and sell all sorts of items! " + + "The Shops are a " + F.elem("Safe Zone") + ", meaning meaning that players cannot hurt each other.", DyeColor.LIGHT_BLUE ); } 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 81ae58458..325d091a5 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/shops/SellPotatoesGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/shops/SellPotatoesGoal.java @@ -22,10 +22,9 @@ public class SellPotatoesGoal extends ObjectiveGoal super( objective, "Sell Potatoes", - "Sell your Potatoes to the " + F.elem("Organic Produce Shop NPC") + ".", + "Sell your Potatoes to the " + F.elem("Organic Produce Shop") + ".", "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!", + "harvest the crops, and sell it to the shops for profit!", DyeColor.PINK ); } From 29bcd6aeea6fadd4fcbbb0a4e982546793210bdb Mon Sep 17 00:00:00 2001 From: Cheese Date: Mon, 4 Apr 2016 13:30:15 +1000 Subject: [PATCH 08/19] more text cahnges --- .../tutorials/clans/objective/AttackEnemyObjective.java | 4 ++-- .../tutorial/tutorials/clans/objective/ShopsObjective.java | 2 +- .../clans/objective/goals/attackenemy/ClanInfoGoal.java | 2 +- .../clans/objective/goals/attackenemy/GetMapGoal.java | 2 +- .../tutorials/clans/objective/goals/clan/ClaimLandGoal.java | 2 +- .../clans/objective/goals/clan/ClanManagementGoal.java | 2 +- .../tutorials/clans/objective/goals/clan/CreateClanGoal.java | 2 +- .../tutorials/clans/objective/goals/clan/SetHomeGoal.java | 2 +- .../clans/objective/goals/energy/ExplainEnergyGoal.java | 4 ++-- .../clans/objective/goals/finalobj/DisbandClanGoal.java | 5 ++--- .../clans/objective/goals/finalobj/TpClanHomeGoal.java | 4 ++-- .../clans/objective/goals/shops/SellPotatoesGoal.java | 2 +- 12 files changed, 16 insertions(+), 17 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 7b81b3a45..029abd327 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 @@ -58,9 +58,9 @@ public class AttackEnemyObjective extends OrderedObjective addGoal(new HoldItemGoal( this, Material.MAP, "Identify Enemy on Map", - "Find the red square land on the map.", + "Find the Red Square on your Map.", "Look at your map to help find where the Enemy Clan is. It's marked by " + - "a " + C.cRed + "red square" + C.mBody + ".", + "a " + C.cRed + "Red Square" + C.mBody + ".", 40 )); addGoal(new ClanInfoGoal(this)); 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 43a39a13a..8e0fc2289 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 @@ -42,7 +42,7 @@ public class ShopsObjective extends OrderedObjective this, Material.MAP, "Identify Shops on Map", - "Find the Blue striped area on your map", + "Find the Blue Striped Area on your map", "Shops are marked on the map by the " + C.cDAqua + "Blue Stripes" + C.mBody + ".", 60L )); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/ClanInfoGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/ClanInfoGoal.java index 1f1b586b0..f240f5c2a 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/ClanInfoGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/ClanInfoGoal.java @@ -26,7 +26,7 @@ public class ClanInfoGoal extends ObjectiveGoal super( objective, "Lookup Enemy Details", - "View info about the enemy clan by typing /c EnemyClan", + "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 fight.", 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 b0c8581dd..c1301087f 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 @@ -19,7 +19,7 @@ public class GetMapGoal extends ObjectiveGoal super( objective, "Get a Map", - "Get a Map ( Type /map )", + "Type '/map' to get a 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 + "blue" + C.mBody + ", your allies are " + C.cGreen + "green" + C.mBody + ", " + 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 46895d689..93d82a088 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 @@ -27,7 +27,7 @@ public class ClaimLandGoal extends ObjectiveGoal super( objective, "Claim Land", - "Type /c to Claim Land using the Clan Menu", + "Type '/c' to Claim Land using the Clan Menu", "Clans are able to claim land for themselves. " + "Once claimed, no one else can break or place blocks there! " + "You must be inside the " + C.cAqua + "blue" + C.cGray + " outline to claim land.", 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 4f2e8cadc..b74e7d678 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 @@ -22,7 +22,7 @@ public class ClanManagementGoal extends ObjectiveGoal super( objective, "Open the Clan Menu", - "Type /c to open the Clan Menu", + "Type '/c' to open the Clan Menu", "Clan Menu lets you do lots of Clans actions, and view information about your Clan. Take a moment to look at it all!", null ); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/CreateClanGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/clan/CreateClanGoal.java index ce75703a6..693b7cda2 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 @@ -18,7 +18,7 @@ public class CreateClanGoal extends ObjectiveGoal super( objective, "Create a Clan", - "Type /c create to create a new 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.", 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 bc07f4143..d8a8042f9 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 @@ -22,7 +22,7 @@ public class SetHomeGoal extends ObjectiveGoal super( objective, "Set Clan Home", - "Set your Clan's Home ( Type /c sethome )", + "Type '/c sethome' to set your Clan's Home", "Your Clan Home is a special place in your base that you can teleport " + "to from " + F.elem("Spawn Island") + " or at any time by typing " + F.elem("/c home") + ".", DyeColor.ORANGE 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 c90c31f8f..9123cd0ce 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 @@ -19,8 +19,8 @@ public class ExplainEnergyGoal extends ObjectiveGoal { super( objective, - "About Energy", - "Look at your energy in your Clans Menu ( Type /c )", + "Check your Clans Energy", + "Type '/c' to check your Clans Energy", "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!", 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 092aab4d2..60a243659 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 @@ -22,10 +22,9 @@ public class DisbandClanGoal extends ObjectiveGoal super( objective, "Disband Clan", - "Disband your Clan ( Type /c )", + "Type '/c' and Disband your Clan", "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.", + "Clan will delete it, and unclaim all of your land.", null ); } 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 ef1827b93..18c5b08a3 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 @@ -22,8 +22,8 @@ public class TpClanHomeGoal extends ObjectiveGoal 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!", + "Type '/c home' to teleport to Clan Home", + "You can teleport back to your Clan Home at any time! If enemies break your bed, then you cannot teleport to it!", null ); 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 325d091a5..abfca5e9f 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/shops/SellPotatoesGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/shops/SellPotatoesGoal.java @@ -22,7 +22,7 @@ public class SellPotatoesGoal extends ObjectiveGoal super( objective, "Sell Potatoes", - "Sell your Potatoes to the " + F.elem("Organic Produce Shop") + ".", + "Sell your Potatoes to the " + F.elem("Organic Produce Shop"), "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!", DyeColor.PINK From 040026724b657b7df18720748b6b645ae88df390 Mon Sep 17 00:00:00 2001 From: Cheese Date: Mon, 4 Apr 2016 14:10:26 +1000 Subject: [PATCH 09/19] renamed tutorials --- .../tutorials/clans/objective/AttackEnemyObjective.java | 2 +- .../clans/tutorial/tutorials/clans/objective/ClanObjective.java | 2 +- .../tutorial/tutorials/clans/objective/ClassesObjective.java | 2 +- .../tutorial/tutorials/clans/objective/EnergyObjective.java | 2 +- .../tutorial/tutorials/clans/objective/FieldsObjective.java | 2 +- .../tutorial/tutorials/clans/objective/FinalObjective.java | 2 +- .../tutorials/clans/objective/PurchaseItemsObjective.java | 2 +- .../tutorial/tutorials/clans/objective/ShopsObjective.java | 2 +- 8 files changed, 8 insertions(+), 8 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 029abd327..4742b3dba 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 @@ -49,7 +49,7 @@ public class AttackEnemyObjective extends OrderedObjective public AttackEnemyObjective(ClansMainTutorial clansMainTutorial, JavaPlugin javaPlugin) { - super(clansMainTutorial, javaPlugin, "Enemy Clans", "Attack and raid this enemy!"); + super(clansMainTutorial, javaPlugin, "Enemy Clans Tutorial", "Attack and raid this enemy!"); _cannon = new HashMap<>(); _shooters = new DefaultHashMap<>(username -> new ArrayList<>()); 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 c9e68e3aa..2374ae9bd 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,7 +13,7 @@ public class ClanObjective extends OrderedObjective { public ClanObjective(ClansMainTutorial clansMainTutorial, JavaPlugin javaPlugin) { - super(clansMainTutorial, javaPlugin, "Clans", "Create clan with /c create "); + super(clansMainTutorial, javaPlugin, "Clans Tutorial", "Create clan with /c create "); addGoal(new LeaveSpawnGoal(this)); addGoal(new CreateClanGoal(this)); 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 bef417c8d..671596940 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 @@ -14,7 +14,7 @@ public class ClassesObjective extends OrderedObjective { public ClassesObjective(ClansMainTutorial clansMainTutorial, JavaPlugin javaPlugin) { - super(clansMainTutorial, javaPlugin, "Classes", "Learn to use our fully customizable classes"); + super(clansMainTutorial, javaPlugin, "Classes Tutorial", "Learn to use our fully customizable classes"); addGoal(new EquipDefaultBuildGoal(this)); addGoal(new OpenClassManagerGoal(this)); 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 5ded6a9b6..ecced2abd 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 @@ -13,7 +13,7 @@ public class EnergyObjective extends OrderedObjective { public EnergyObjective(ClansMainTutorial clansMainTutorial, JavaPlugin javaPlugin) { - super(clansMainTutorial, javaPlugin, "Energy", "A Clan requires Energy to maintain all of it's territory."); + super(clansMainTutorial, javaPlugin, "Energy Tutorial", "A Clan requires Energy to maintain all of it's territory."); addGoal(new ExplainEnergyGoal(this)); addGoal(new BuyEnergyGoal(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 3a5e2c03c..2003906bf 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 { public FieldsObjective(ClansMainTutorial clansMainTutorial, JavaPlugin javaPlugin) { - super(clansMainTutorial, javaPlugin, "Fields", "Get various resources by mining for them in the fields"); + super(clansMainTutorial, javaPlugin, "Fields Tutorial", "Get various resources by mining for them in the fields"); addGoal(new HoldItemGoal( this, 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 b81cede20..9ea92b621 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 @@ -13,7 +13,7 @@ public class FinalObjective extends OrderedObjective { public FinalObjective(ClansMainTutorial clansMainTutorial, JavaPlugin javaPlugin) { - super(clansMainTutorial, javaPlugin, "Clans Basics 2", "Finalize your knowledge of Clans"); + super(clansMainTutorial, javaPlugin, "Clans Tutorial 2", "Finalize your knowledge of Clans"); addGoal(new TpClanHomeGoal(this)); // IMPLEMENTED addGoal(new DisbandClanGoal(this)); // IMPLEMENTED 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 24b4c1bb3..b86ab328e 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 @@ -21,7 +21,7 @@ public class PurchaseItemsObjective extends UnorderedObjective public ShopsObjective(ClansMainTutorial clansMainTutorial, NpcManager npcManager, JavaPlugin javaPlugin) { - super(clansMainTutorial, javaPlugin, "Shops", "Learn your way around our shops"); + super(clansMainTutorial, javaPlugin, "Shops Tutorial", "Learn your way around our shops"); _npcMap = new HashMap<>(); _npcManager = npcManager; From 543719b95dfb3dab419934747e5f5b257eed9720 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Mon, 4 Apr 2016 14:47:33 +1000 Subject: [PATCH 10/19] More tutorial fixes --- .../mineplex/game/clans/tutorial/Tutorial.java | 16 +++++++++++++++- .../tutorials/clans/ClansMainTutorial.java | 2 ++ .../clans/objective/FieldsObjective.java | 3 ++- .../objective/goals/shops/GoToShopsGoal.java | 1 + 4 files changed, 20 insertions(+), 2 deletions(-) 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 f66c84fdd..eb682e221 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 @@ -15,6 +15,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.HandlerList; import org.bukkit.event.Listener; +import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.event.player.PlayerKickEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.plugin.java.JavaPlugin; @@ -193,6 +194,9 @@ public abstract class Tutorial implements Listener, ObjectiveListener _worldManager.returnRegion(session.getRegion()); } + if (session.getSpawnHologram() != null) + session.getSpawnHologram().stop(); + session.getHolograms().forEach(Hologram::stop); } } @@ -233,7 +237,8 @@ public abstract class Tutorial implements Listener, ObjectiveListener int objectiveIndex = session.getObjectiveIndex(); Objective currentObjective = _objectives.get(objectiveIndex); - lines.add(C.cGoldB + (objectiveIndex + 1) + "/" + _objectives.size() + ": " + currentObjective.getName(player)); + lines.add(C.cGreenB + currentObjective.getName(player)); + lines.add(" "); currentObjective.addScoreboardLines(player, lines); } return lines; @@ -273,6 +278,15 @@ public abstract class Tutorial implements Listener, ObjectiveListener } } + @EventHandler + public void onHungerChange(FoodLevelChangeEvent event) + { + if (event.getEntity() instanceof Player && isInTutorial(((Player) event.getEntity()))) + { + event.setFoodLevel(20); + } + } + @EventHandler public void displayDescription(UpdateEvent event) { 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 664e237bf..ded35b664 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 @@ -147,6 +147,8 @@ public class ClansMainTutorial extends Tutorial player.setGameMode(GameMode.SURVIVAL); player.getInventory().clear(); player.getInventory().setArmorContents(new ItemStack[4]); + player.setHealth(20); + player.setFoodLevel(20); //ClansManager.getInstance().getPvpTimer().pause(player); 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 2003906bf..7ff835cc3 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 @@ -25,7 +25,8 @@ public class FieldsObjective extends OrderedObjective Material.MAP, "Identify Fields on Map", "Find the Orange Striped Area on your Map", - "Fields are marked by " + C.cGold + "Orange Stripes" + C.mBody + "." + "Fields are marked by " + C.cGold + "Orange Stripes" + C.mBody + ".", + 80L )); addGoal(new GoToFieldsGoal(this)); addGoal(new MineDiamondsGoal(this)); 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 f08161fe0..0177f3f9f 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 @@ -8,6 +8,7 @@ import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAlg; import mineplex.game.clans.tutorial.objective.ObjectiveGoal; import mineplex.core.common.util.UtilPlayer; From 400d2f0ccaa8994fb9cba1d1eff84dc6d80b8d97 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Mon, 4 Apr 2016 00:59:13 -0500 Subject: [PATCH 11/19] Added bonus log view for customer support. --- .../customerSupport/CustomerSupport.java | 218 +++++++++++------- .../CustomerSupportRepository.java | 25 ++ .../customerSupport/checkCommand.java | 2 +- 3 files changed, 158 insertions(+), 87 deletions(-) create mode 100644 Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupportRepository.java diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java index 58e91b517..ee4bcc968 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java @@ -1,6 +1,10 @@ package mineplex.staffServer.customerSupport; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; import java.util.HashSet; +import java.util.List; import mineplex.core.MiniPlugin; import mineplex.core.account.CoreClient; @@ -13,6 +17,7 @@ import mineplex.core.donation.DonationManager; import mineplex.core.donation.Donor; import mineplex.core.donation.repository.token.CoinTransactionToken; import mineplex.core.donation.repository.token.TransactionToken; +import mineplex.serverdata.database.ResultSetCallable; import mineplex.staffServer.salespackage.SalesPackageManager; import org.bukkit.GameMode; @@ -27,13 +32,15 @@ import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.plugin.java.JavaPlugin; -public class CustomerSupport extends MiniPlugin +public class CustomerSupport extends MiniPlugin implements ResultSetCallable { private CoreClientManager _clientManager; private DonationManager _donationManager; private SalesPackageManager _salesPackageManager; + private CustomerSupportRepository _repository; private NautHashMap> _agentCacheMap = new NautHashMap>(); + private NautHashMap> _accountBonusLog = new NautHashMap<>(); public CustomerSupport(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, SalesPackageManager salesPackageManager) { @@ -42,6 +49,7 @@ public class CustomerSupport extends MiniPlugin _clientManager = clientManager; _donationManager = donationManager; _salesPackageManager = salesPackageManager; + _repository = new CustomerSupportRepository(getPlugin()); } @EventHandler @@ -94,98 +102,121 @@ public class CustomerSupport extends MiniPlugin { CoreClient client = _clientManager.Get(playerName); Donor donor = _donationManager.Get(playerName); + CustomerSupport instance = this; - caller.sendMessage(C.cDGreen + C.Strike + "============================================="); - caller.sendMessage(C.cBlue + "Name : " + C.cYellow + playerName); - caller.sendMessage(C.cBlue + "Rank : " + C.cYellow + (client.GetRank() == null ? C.cRed + "Error rank null!" : (client.GetRank().Name.isEmpty() ? "Regular" : client.GetRank().Name))); - caller.sendMessage(C.cBlue + "Coins : " + C.cYellow + donor.getCoins()); - caller.sendMessage(C.cBlue + "Gems : " + C.cYellow + donor.GetGems()); - - int enjinCoinsReceived = 0; - int oldChestsReceived = 0; - int ancientChestsReceived = 0; - int mythicalChestsReceived = 0; - int winterChestsReceived = 0; - int valentinesGiftsReceived = 0; - - for (CoinTransactionToken transaction : donor.getCoinTransactions()) + runAsync(new Runnable() { - if (transaction.Source.equalsIgnoreCase("Poll") || transaction.Source.equalsIgnoreCase("Halloween Pumpkin") || transaction.Source.equalsIgnoreCase("Treasure Chest") || transaction.Source.equalsIgnoreCase("Coin Party Bomb Pickup") || transaction.Source.contains("Reward") || transaction.Source.contains("purchase")) + public void run() { - if (transaction.Source.contains("purchase")) - enjinCoinsReceived += transaction.Amount; - } - } + _repository.loadBonusLogForAccountId(client.getAccountId(), instance); + + runSync(new Runnable() + { + public void run() + { + caller.sendMessage(C.cDGreen + C.Strike + "============================================="); + caller.sendMessage(C.cBlue + "Name : " + C.cYellow + playerName); + caller.sendMessage(C.cBlue + "Rank : " + C.cYellow + (client.GetRank() == null ? C.cRed + "Error rank null!" : (client.GetRank().Name.isEmpty() ? "Regular" : client.GetRank().Name))); + caller.sendMessage(C.cBlue + "Coins : " + C.cYellow + donor.getCoins()); + caller.sendMessage(C.cBlue + "Gems : " + C.cYellow + donor.GetGems()); - for (TransactionToken transaction : donor.getTransactions()) - { - if (transaction.SalesPackageName.startsWith("Old Chest")) - { - if (transaction.Coins == 0 && transaction.Gems == 0) - { - if (transaction.SalesPackageName.split(" ").length == 3) - oldChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]); - else if (transaction.SalesPackageName.split(" ").length == 2) - oldChestsReceived += 1; - } - - } - if (transaction.SalesPackageName.startsWith("Ancient Chest")) - { - if (transaction.Coins == 0 && transaction.Gems == 0) - { - if (transaction.SalesPackageName.split(" ").length == 3) - ancientChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]); - else if (transaction.SalesPackageName.split(" ").length == 2) - ancientChestsReceived += 1; - } - - } - if (transaction.SalesPackageName.startsWith("Mythical Chest")) - { - if (transaction.Coins == 0 && transaction.Gems == 0) - { - if (transaction.SalesPackageName.split(" ").length == 3) - mythicalChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]); - else if (transaction.SalesPackageName.split(" ").length == 2) - mythicalChestsReceived += 1; - } - - } - if (transaction.SalesPackageName.startsWith("Winter Chest")) - { - if (transaction.Coins == 0 && transaction.Gems == 0) - { - if (transaction.SalesPackageName.split(" ").length == 3) - winterChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]); - else if (transaction.SalesPackageName.split(" ").length == 2) - winterChestsReceived += 1; - } + int enjinCoinsReceived = 0; + int oldChestsReceived = 0; + int ancientChestsReceived = 0; + int mythicalChestsReceived = 0; + int winterChestsReceived = 0; + int valentinesGiftsReceived = 0; + + for (CoinTransactionToken transaction : donor.getCoinTransactions()) + { + if (transaction.Source.equalsIgnoreCase("Poll") || transaction.Source.equalsIgnoreCase("Halloween Pumpkin") || transaction.Source.equalsIgnoreCase("Treasure Chest") || transaction.Source.equalsIgnoreCase("Coin Party Bomb Pickup") || transaction.Source.contains("Reward") || transaction.Source.contains("purchase")) + { + if (transaction.Source.contains("purchase")) + enjinCoinsReceived += transaction.Amount; + } + } - } - if (transaction.SalesPackageName.startsWith("Valentines Gift")) - { - if (transaction.Coins == 0 && transaction.Gems == 0) - { - if (transaction.SalesPackageName.split(" ").length == 3) - valentinesGiftsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]); - else if (transaction.SalesPackageName.split(" ").length == 2) - valentinesGiftsReceived += 1; - } + for (TransactionToken transaction : donor.getTransactions()) + { + if (transaction.SalesPackageName.startsWith("Old Chest")) + { + if (transaction.Coins == 0 && transaction.Gems == 0) + { + if (transaction.SalesPackageName.split(" ").length == 3) + oldChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]); + else if (transaction.SalesPackageName.split(" ").length == 2) + oldChestsReceived += 1; + } + + } + if (transaction.SalesPackageName.startsWith("Ancient Chest")) + { + if (transaction.Coins == 0 && transaction.Gems == 0) + { + if (transaction.SalesPackageName.split(" ").length == 3) + ancientChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]); + else if (transaction.SalesPackageName.split(" ").length == 2) + ancientChestsReceived += 1; + } + + } + if (transaction.SalesPackageName.startsWith("Mythical Chest")) + { + if (transaction.Coins == 0 && transaction.Gems == 0) + { + if (transaction.SalesPackageName.split(" ").length == 3) + mythicalChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]); + else if (transaction.SalesPackageName.split(" ").length == 2) + mythicalChestsReceived += 1; + } + + } + if (transaction.SalesPackageName.startsWith("Winter Chest")) + { + if (transaction.Coins == 0 && transaction.Gems == 0) + { + if (transaction.SalesPackageName.split(" ").length == 3) + winterChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]); + else if (transaction.SalesPackageName.split(" ").length == 2) + winterChestsReceived += 1; + } + } + if (transaction.SalesPackageName.startsWith("Valentines Gift")) + { + if (transaction.Coins == 0 && transaction.Gems == 0) + { + if (transaction.SalesPackageName.split(" ").length == 3) + valentinesGiftsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]); + else if (transaction.SalesPackageName.split(" ").length == 2) + valentinesGiftsReceived += 1; + } + + } + } + + caller.sendMessage(C.cBlue + "Enjin Coin Total Received : " + C.cYellow + enjinCoinsReceived); + caller.sendMessage(C.cBlue + "Old Chests Received : " + C.cYellow + oldChestsReceived); + caller.sendMessage(C.cBlue + "Ancient Chests Received : " + C.cYellow + ancientChestsReceived); + caller.sendMessage(C.cBlue + "Mythical Chests Received : " + C.cYellow + mythicalChestsReceived); + caller.sendMessage(C.cBlue + "Winter Chests Received : " + C.cYellow + winterChestsReceived); + caller.sendMessage(C.cBlue + "Valentines Gifts Received : " + C.cYellow + valentinesGiftsReceived); + caller.sendMessage(C.cBlue + "Monthly Bonus Log (Last 6 entries):"); + + for (String logEntry : _accountBonusLog.get(client.getAccountId())) + { + caller.sendMessage(C.cYellow + logEntry); + } + + caller.sendMessage(C.cDGreen + C.Strike + "============================================="); + _salesPackageManager.displaySalesPackages(caller, playerName); + caller.sendMessage(C.cDGreen + C.Strike + "============================================="); + + _accountBonusLog.remove(client.getAccountId()); + } + }); } - } - - caller.sendMessage(C.cBlue + "Enjin Coin Total Received : " + C.cYellow + enjinCoinsReceived); - caller.sendMessage(C.cBlue + "Old Chests Received : " + C.cYellow + oldChestsReceived); - caller.sendMessage(C.cBlue + "Ancient Chests Received : " + C.cYellow + ancientChestsReceived); - caller.sendMessage(C.cBlue + "Mythical Chests Received : " + C.cYellow + mythicalChestsReceived); - caller.sendMessage(C.cBlue + "Winter Chests Received : " + C.cYellow + winterChestsReceived); - caller.sendMessage(C.cBlue + "Valentines Gifts Received : " + C.cYellow + valentinesGiftsReceived); - - caller.sendMessage(C.cDGreen + C.Strike + "============================================="); - _salesPackageManager.displaySalesPackages(caller, playerName); - caller.sendMessage(C.cDGreen + C.Strike + "============================================="); + }); } @EventHandler @@ -215,4 +246,19 @@ public class CustomerSupport extends MiniPlugin event.setCancelled(true); } + + @Override + public void processResultSet(ResultSet resultSet) throws SQLException + { + List log = new ArrayList(); + int accountId = 0; + + while (resultSet.next() && log.size() < 6) + { + accountId = resultSet.getInt(1); + log.add("Received " + resultSet.getInt(3) + " " + resultSet.getString(2) + " on " + resultSet.getDate(4)); + } + + _accountBonusLog.put(accountId, log); + } } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupportRepository.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupportRepository.java new file mode 100644 index 000000000..877a4c71d --- /dev/null +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupportRepository.java @@ -0,0 +1,25 @@ +package mineplex.staffServer.customerSupport; + +import org.bukkit.plugin.java.JavaPlugin; + +import mineplex.core.database.MinecraftRepository; +import mineplex.serverdata.database.DBPool; + +public class CustomerSupportRepository extends MinecraftRepository +{ + public CustomerSupportRepository(JavaPlugin plugin) + { + super(plugin, DBPool.getAccount()); + } + + @Override + protected void initialize() { } + + @Override + protected void update() { } + + public void loadBonusLogForAccountId(int accountId, CustomerSupport customerSupport) + { + executeQuery("SELECT accountId, items.name, itemChange, time FROM bonusLog INNER JOIN items ON itemId = items.id WHERE accountId = " + accountId + " ORDER BY bonusLog.id DESC;", customerSupport); + } +} diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/checkCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/checkCommand.java index c548351ca..b6303f8b3 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/checkCommand.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/checkCommand.java @@ -34,8 +34,8 @@ public class checkCommand extends CommandBase { public void run() { - Plugin.addAgentMapping(caller, name); Plugin.showPlayerInfo(caller, name); + Plugin.addAgentMapping(caller, name); } }); } From 02f774ce942576763127696446781f24abb558a3 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Mon, 4 Apr 2016 16:45:20 +1000 Subject: [PATCH 12/19] A lot of bug fixes --- .../game/clans/clans/ClansManager.java | 45 +++++++++-------- .../clans/clans/regions/ClansRegions.java | 36 ++++--------- .../clans/worldevent/kinghill/KingHill.java | 2 +- .../clans/worldevent/undead/UndeadCamp.java | 2 +- .../src/mineplex/game/clans/spawn/Spawn.java | 8 ++- .../game/clans/tutorial/Tutorial.java | 4 +- .../game/clans/tutorial/TutorialManager.java | 5 +- .../tutorials/clans/ClansMainTutorial.java | 50 +++++++++++++------ 8 files changed, 79 insertions(+), 73 deletions(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java index 7563c4c2c..8b2f50822 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java @@ -175,8 +175,9 @@ public class ClansManager extends MiniClientPluginimplements IRelati private ClansBlacklist _blacklist; private Playtime _playTracker; - - private mineplex.game.clans.legacytutorial.TutorialManager _tutorialManager; + + private TutorialManager _tutorial; + private mineplex.game.clans.legacytutorial.TutorialManager _legacyTutorial; private ClassManager _classManager; @@ -197,6 +198,7 @@ public class ClansManager extends MiniClientPluginimplements IRelati private WarPointEvasion _warPointEvasion; private ObserverManager _observerManager; private Punish _punish; + private TaskManager _taskManager; private int _inviteExpire = 2; private int _nameMin = 3; @@ -258,7 +260,7 @@ public class ClansManager extends MiniClientPluginimplements IRelati _worldEvent = new WorldEventManager(plugin, this, _damageManager, _lootManager, blockRestore, _clanRegions, null); - TaskManager taskManager = new TaskManager(plugin, _clientManager, webServerAddress); + _taskManager = new TaskManager(plugin, _clientManager, webServerAddress); ClanTips = new ClanTips(plugin, this, preferencesManager); @@ -269,8 +271,8 @@ public class ClansManager extends MiniClientPluginimplements IRelati _clanDisplay = new ClansDisplay(plugin, this); _clanGame = new ClansGame(plugin, this); _clanUtility = new ClansUtility(this); - TutorialManager tutorial = new TutorialManager(plugin, clientManager, donationManager, chat, hologramManager, _npcManager); - _itemMapManager = new ItemMapManager(this, tutorial, _worldEvent); + _tutorial = new TutorialManager(plugin, clientManager, donationManager, chat, hologramManager, _npcManager, _taskManager); + _itemMapManager = new ItemMapManager(this, _tutorial, _worldEvent); new TntGeneratorManager(plugin, this); new SupplyDropManager(plugin, this); @@ -300,7 +302,7 @@ public class ClansManager extends MiniClientPluginimplements IRelati new ClanEnergyTracker(plugin, this); // new StuckManager(this); - new ClansBetaManager(this, taskManager); + new ClansBetaManager(this, _taskManager); new PotatoManager(plugin, this); @@ -334,9 +336,9 @@ public class ClansManager extends MiniClientPluginimplements IRelati _playTracker = new Playtime(this, statsManager); - _tutorialManager = new mineplex.game.clans.legacytutorial.TutorialManager(plugin, _playTracker, _goldManager, taskManager, donationManager, preferencesManager, this, packetHandler); + _legacyTutorial = new mineplex.game.clans.legacytutorial.TutorialManager(plugin, _playTracker, _goldManager, _taskManager, donationManager, preferencesManager, this, packetHandler); - _scoreboard = new ClansScoreboardManager(plugin, this, _warManager, _worldEvent, tutorial, clientManager, donationManager); + _scoreboard = new ClansScoreboardManager(plugin, this, _warManager, _worldEvent, _tutorial, clientManager, donationManager); _clanDataAccess = new ClansDataAccessLayer(this, _scoreboard); for (ClanToken token : _clanDataAccess.getRepository().retrieveClans()) @@ -436,9 +438,14 @@ public class ClansManager extends MiniClientPluginimplements IRelati return _disguiseManager; } - public mineplex.game.clans.legacytutorial.TutorialManager getTutorials() + public mineplex.game.clans.legacytutorial.TutorialManager getLegacyTutorial() { - return _tutorialManager; + return _legacyTutorial; + } + + public TutorialManager getTutorial() + { + return _tutorial; } public NpcManager getNPCManager() @@ -598,7 +605,7 @@ public class ClansManager extends MiniClientPluginimplements IRelati for (Player other : UtilServer.getPlayers()) { - if (_tutorialManager.isInTutorial(other)) + if (_tutorial.inTutorial(other)) { // Don't display join message if player in tutorial. continue; @@ -621,7 +628,7 @@ public class ClansManager extends MiniClientPluginimplements IRelati for (Player other : UtilServer.getPlayers()) { - if (_tutorialManager.isInTutorial(other)) + if (_tutorial.inTutorial(other)) { // Don't display quit message if player in tutorial. continue; @@ -646,7 +653,7 @@ public class ClansManager extends MiniClientPluginimplements IRelati for (Player other : UtilServer.getPlayers()) { - if (_tutorialManager.isInTutorial(other)) + if (_tutorial.inTutorial(other)) { // Don't display leave message if player in tutorial. continue; @@ -1170,16 +1177,10 @@ public class ClansManager extends MiniClientPluginimplements IRelati } Rank rank = _clientManager.Get(event.getPlayer()).GetRank(); - if (!event.getPlayer().isOp() && !event.getPlayer().isWhitelisted() && !rank.has(Rank.LEGEND)) + if (UtilServer.getPlayers().length >= UtilServer.getServer().getMaxPlayers() && !rank.has(Rank.ADMIN) && !event.getPlayer().isWhitelisted() && !event.getPlayer().isOp()) { - event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Clans is currently in Legend+ only Alpha!"); - // event.setKickMessage("This server is whitelisted!"); - event.setKickMessage("Clans is currently in Legend+ only Alpha!"); - } - else if (UtilServer.getPlayers().length >= UtilServer.getServer().getMaxPlayers() && !rank.has(Rank.ADMIN) && !event.getPlayer().isWhitelisted() && !event.getPlayer().isOp()) - { - event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Clans Alpha is full! Try again soon"); - event.setKickMessage("Clans Alpha is full! Try again soon"); + event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Clans Beta is full! Try again soon"); + event.setKickMessage("Clans Beta is full! Try again soon"); } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/regions/ClansRegions.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/regions/ClansRegions.java index e129da1c8..a414f5486 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/regions/ClansRegions.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/regions/ClansRegions.java @@ -69,7 +69,7 @@ public class ClansRegions extends MiniPlugin claimArea("Spawn", SPAWN_RADIUS, 0, false, true, new Location[] { Spawn.getNorthSpawn(), Spawn.getSouthSpawn() }); claimArea("Shops", 2, 0, true, false, new Location[]{Spawn.getWestTownCenter(), Spawn.getEastTownCenter()}); - claimArea("Shops", SHOP_RADIUS, 2, false, false, new Location[]{Spawn.getWestTownCenter(), Spawn.getEastTownCenter()}); + claimArea("Shops", SHOP_RADIUS, 3, false, false, new Location[]{Spawn.getWestTownCenter(), Spawn.getEastTownCenter()}); // Initialize Fields and Borderlands factions and claims claimArea("Fields", FIELDS_RADIUS, 0, false, true, worldCenter); @@ -149,34 +149,16 @@ public class ClansRegions extends MiniPlugin { if (clan != null) { - _manager.getClanDataAccess().delete(clan, status -> { - _manager.getClanDataAccess().create("ClansRegions", clanName, true, new Callback() - { - @Override - public void run(ClanInfo data) - { - if (data != null) - { - for (Location location : locations) - { - claimArea(data, location, chunkRadius, claimOffset, addNegative, safe); - log(String.format("Initialized %s faction territory and creation!", clanName)); - } - - debugClan(clanName); - } - else - { - System.out.println("Clans Regions error!"); - System.out.println("Seek out help!"); - } - } - }); - }); - + for (Location location : locations) + { + claimArea(clan, location, chunkRadius, claimOffset, addNegative, safe); + log(String.format("Initialized %s faction territory and creation!", clanName)); + } + + debugClan(clanName); return; } - + _manager.getClanDataAccess().create("ClansRegions", clanName, true, new Callback() { @Override diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/kinghill/KingHill.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/kinghill/KingHill.java index 5a227791f..6b14c395f 100755 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/kinghill/KingHill.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/kinghill/KingHill.java @@ -186,7 +186,7 @@ public class KingHill extends WorldEvent public void announceStart() { for(Player player : UtilServer.getPlayers()) { - if(_clansManager.getTutorials().isInTutorial(player)) continue; + if(_clansManager.getTutorial().inTutorial(player)) continue; UtilTextMiddle.display(C.cGreen + getName(), UtilWorld.locToStrClean(getCenterLocation()), 10, 100, 40, player); player.sendMessage(F.main("Event", F.elem(getName()) + " has started at coordinates " + F.elem(UtilWorld.locToStrClean(getCenterLocation())))); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/undead/UndeadCamp.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/undead/UndeadCamp.java index d0410515b..6ccc12bfa 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/undead/UndeadCamp.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/undead/UndeadCamp.java @@ -511,7 +511,7 @@ public class UndeadCamp extends WorldEvent public void announceStart() { for(Player player : UtilServer.getPlayers()) { - if(ClansManager.getInstance().getTutorials().isInTutorial(player)) continue; + if(ClansManager.getInstance().getTutorial().inTutorial(player)) continue; UtilTextMiddle.display(C.cGreen + getName(), UtilWorld.locToStrClean(getCenterLocation()), 10, 100, 40, player); player.sendMessage(F.main("Event", F.elem(getName()) + " has started at coordinates " + F.elem(UtilWorld.locToStrClean(getCenterLocation())))); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/spawn/Spawn.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/spawn/Spawn.java index 433c4f1bf..aa44d5d2f 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/spawn/Spawn.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/spawn/Spawn.java @@ -281,10 +281,7 @@ public class Spawn extends MiniPlugin event.setRespawnLocation(getSpawnLocation()); } - /** - * Ensure player spawns into a Spawn location if it's their first time on the server. - * @param event - */ + /* @EventHandler public void onPlayerFirstJoin(PlayerJoinEvent event) { @@ -293,6 +290,7 @@ public class Spawn extends MiniPlugin teleport(event.getPlayer(), getSpawnLocation(), 2); // Teleport player to spawn after 2-tick delay to prevent on-join bug } } + */ /** * Prevent creatures from spawning inside Spawn @@ -493,7 +491,7 @@ public class Spawn extends MiniPlugin return _clansManager.getCondition().HasCondition(player, ConditionType.CUSTOM, COMBAT_TAG_NAME); } - private void teleport(final Player player, final Location location, int delay) + public void teleport(final Player player, final Location location, int delay) { Bukkit.getScheduler().scheduleSyncDelayedTask(getPlugin(), new Runnable() { @Override 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 eb682e221..1771b70be 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 @@ -81,10 +81,12 @@ public abstract class Tutorial implements Listener, ObjectiveListener session.setRegion(region); _playerSessionMap.put(player, session); + + onStart(player); + // Start at first objective! setObjective(player, 0); - onStart(player); _objectives.forEach(objective -> objective.setup(player, region)); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/TutorialManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/TutorialManager.java index 4bd716595..3fc5c825b 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/TutorialManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/TutorialManager.java @@ -22,6 +22,7 @@ import mineplex.core.hologram.HologramManager; import mineplex.core.npc.NpcManager; import mineplex.core.scoreboard.ScoreboardManager; import mineplex.core.scoreboard.elements.ScoreboardElement; +import mineplex.core.task.TaskManager; import mineplex.game.clans.message.ClansMessageManager; import mineplex.game.clans.tutorial.command.TutorialCommand; import mineplex.game.clans.tutorial.gui.TutorialShop; @@ -36,7 +37,7 @@ public class TutorialManager extends MiniPlugin implements ScoreboardElement private EnumMap _tutorialMap; private EnumMap _shopMap; // Don't need to do anything with shops currently - public TutorialManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, Chat chat, HologramManager hologram, NpcManager npcManager) + public TutorialManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, Chat chat, HologramManager hologram, NpcManager npcManager, TaskManager taskManager) { super("Clans Tutorial", plugin); @@ -47,7 +48,7 @@ public class TutorialManager extends MiniPlugin implements ScoreboardElement _tutorialMap = new EnumMap(TutorialType.class); _shopMap = new EnumMap(TutorialType.class); - addTutorial(TutorialType.MAIN, new ClansMainTutorial(plugin, _clansMessageManager, hologram, npcManager)); + addTutorial(TutorialType.MAIN, new ClansMainTutorial(plugin, _clansMessageManager, hologram, npcManager, taskManager)); chat.AddFilter(event -> { if (inTutorial(event.getPlayer())) 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 ded35b664..3900e90be 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 @@ -8,6 +8,7 @@ import java.util.UUID; import mineplex.core.hologram.Hologram; import mineplex.core.common.util.*; +import mineplex.core.task.TaskManager; import mineplex.game.clans.clans.ClanInfo; import mineplex.game.clans.clans.event.ClansPlayerBuyItemEvent; import mineplex.game.clans.clans.event.ClansPlayerSellItemEvent; @@ -38,6 +39,7 @@ import mineplex.core.updater.event.UpdateEvent; import mineplex.game.clans.clans.ClansManager; import mineplex.game.clans.clans.event.ClansCommandPreExecutedEvent; import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; +import mineplex.game.clans.economy.GoldManager; import mineplex.game.clans.message.ClansMessageManager; import mineplex.game.clans.spawn.Spawn; import mineplex.game.clans.tutorial.Tutorial; @@ -53,6 +55,7 @@ import mineplex.game.clans.tutorial.tutorials.clans.objective.FieldsObjective; import mineplex.game.clans.tutorial.tutorials.clans.objective.FinalObjective; import mineplex.game.clans.tutorial.tutorials.clans.objective.PurchaseItemsObjective; import mineplex.game.clans.tutorial.tutorials.clans.objective.ShopsObjective; +import mineplex.game.clans.tutorial.tutorials.clans.repository.TutorialRepository; //import mineplex.game.clans.tutorial.tutorials.clans.repository.TutorialRepository; public class ClansMainTutorial extends Tutorial @@ -63,10 +66,11 @@ public class ClansMainTutorial extends Tutorial private TutorialMapManager _mapManager; private List _fireworks; // private TutorialRepository _repository; + private TaskManager _taskManager; - public ClansMainTutorial(JavaPlugin plugin, ClansMessageManager message, HologramManager hologram, NpcManager npcManager) + public ClansMainTutorial(JavaPlugin plugin, ClansMessageManager message, HologramManager hologram, NpcManager npcManager, TaskManager taskManager) { - super(plugin, message, hologram, "Clans Tutorial", "Clans.MainTutorial", Material.DIAMOND_SWORD, (byte) 0); + super(plugin, message, hologram, "Clans Tutorial", "main", Material.DIAMOND_SWORD, (byte) 0); _fireworks = new ArrayList(); @@ -80,6 +84,7 @@ public class ClansMainTutorial extends Tutorial } _mapManager = new TutorialMapManager(plugin, this, getWorldManager().getTutorialWorld(), -10, 0, 117, 127); + _taskManager = taskManager; // _repository = new TutorialRepository(ClansManager.getInstance().getClientManager()); @@ -98,11 +103,12 @@ public class ClansMainTutorial extends Tutorial { _fireworks.add(player); UtilTextMiddle.display(C.cYellow + "Congratulations", "You have completed the Tutorial!", 10, 60, 10, player); + Bukkit.getScheduler().runTaskLater(getPlugin(), () -> { _fireworks.remove(player); - getMessage().removePlayer(player); + getMessage().removePlayer(player); - player.teleport(Spawn.getNorthSpawn()); + player.teleport(Spawn.getNorthSpawn()); UtilInv.Clear(player); ClansManager.getInstance().getItemMapManager().setMap(player); @@ -112,6 +118,17 @@ public class ClansMainTutorial extends Tutorial //ClansManager.getInstance().getPvpTimer().unpause(player); + _taskManager.completedTask(new Callback() + { + @Override + public void run(Boolean data) + { + + GoldManager.getInstance().addGold(player, 32000); + UtilPlayer.message(player, F.main("Clans", "You have earned " + F.elem(32000 + " Gold") + " for finishing the tutorial!")); + } + }, player, getTaskIdentifier()); + /* ClansManager.getInstance().runAsync(() -> { _repository.SetTimesPlayed(player.getUniqueId(), _repository.GetTimesPlayed(player.getUniqueId()) + 1); @@ -124,7 +141,7 @@ public class ClansMainTutorial extends Tutorial if (times == 1) { GoldManager.getInstance().addGold(player, 32000); - UtilPlayer.message(player, F.main("Clans", "You have recieved " + F.elem(32000 + " Gold") + " for finishing the tutorial!")); + UtilPlayer.message(player, F.main("Clans", "You have earned " + F.elem(32000 + " Gold") + " for finishing the tutorial!")); } UtilInv.give(player, Material.COOKIE); @@ -424,16 +441,21 @@ public class ClansMainTutorial extends Tutorial @EventHandler public void onJoin(PlayerJoinEvent event) { - start(event.getPlayer()); +// ClansManager.getInstance().runAsync(() -> { +// if (_repository.GetTimesPlayed(event.getPlayer().getUniqueId()) == 0) +// { +// ClansManager.getInstance().runSync(() -> start(event.getPlayer())); +// } +// }); - /* - ClansManager.getInstance().runAsync(() -> { - if (_repository.GetTimesPlayed(event.getPlayer().getUniqueId()) == 0) - { - ClansManager.getInstance().runSync(() -> start(event.getPlayer())); - } - }); - */ + if (!_taskManager.hasCompletedTask(event.getPlayer(), getTaskIdentifier())) + { + start(event.getPlayer()); + } + else if (!event.getPlayer().hasPlayedBefore() || !event.getPlayer().getLocation().getWorld().equals(Spawn.getSpawnWorld())) + { + Spawn.getInstance().teleport(event.getPlayer(), Spawn.getInstance().getSpawnLocation(), 2); + } } @EventHandler From 56a087612b4aef0146845fac5e1d7a885023c776 Mon Sep 17 00:00:00 2001 From: phobia Date: Mon, 4 Apr 2016 16:58:16 +1000 Subject: [PATCH 13/19] Changes to explain energy goal --- .../goals/energy/ExplainEnergyGoal.java | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) 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 9123cd0ce..f4267c521 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.event.ClansCommandPreExecutedEvent; import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import org.bukkit.Sound; import org.bukkit.entity.Player; @@ -31,17 +32,7 @@ public class ExplainEnergyGoal extends ObjectiveGoal @Override protected void customStart(Player player) { - ClansManager.getInstance().runSyncLater(() -> { - // Explain Energy - UtilPlayer.message(player, F.main("Clans", "Energy is required to maintain a Clan's territory, without it, any territory that your Clan owns will be claimed by the Wilderness, and anyone will be able to claim that territory. You can buy Energy at the Energy Shop in the Shops.")); - player.playSound(player.getLocation(), Sound.NOTE_PLING, 1.0f, 1.0f); - - ClansManager.getInstance().runSyncLater(() -> { - finish(player); - }, 20 * 10L); - }, 20 * 3L); - -// setStartMessageDelay(120); + player.playSound(player.getLocation(), Sound.NOTE_PLING, 1.0f, 1.0f); } @Override @@ -49,6 +40,14 @@ public class ExplainEnergyGoal extends ObjectiveGoal { } + @EventHandler + public void onCommand(ClansCommandPreExecutedEvent event) + { + if(contains(event.getPlayer()) && event.getArguments().length == 0) + { + finish(event.getPlayer()); + } + } @EventHandler(priority = EventPriority.HIGHEST) public void onClick(ClansButtonClickEvent event) { From 23e116f9b519c6572074f3c6410b5621ba9ef40b Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Mon, 4 Apr 2016 17:10:52 +1000 Subject: [PATCH 14/19] Region fixes --- .../game/clans/clans/ClansManager.java | 35 +++++++++---------- .../clans/clans/regions/ClansRegions.java | 24 +++++-------- .../clans/tutorial/TutorialWorldManager.java | 4 +-- 3 files changed, 27 insertions(+), 36 deletions(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java index 8b2f50822..468f3a29a 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java @@ -357,30 +357,27 @@ public class ClansManager extends MiniClientPluginimplements IRelati List jumpOffHolograms = Arrays.asList( // West Spawn - new Location(Spawn.getSpawnWorld(), -295.5, 204, 36.5), - new Location(Spawn.getSpawnWorld(), -295.5, 204, -26.5), - new Location(Spawn.getSpawnWorld(), -331.5, 204, 6.5), - new Location(Spawn.getSpawnWorld(), -266.5, 204, 6.5), + new Location(Spawn.getSpawnWorld(), 8, 204, 359), + new Location(Spawn.getSpawnWorld(), 34, 204, 390), + new Location(Spawn.getSpawnWorld(), 8, 204, 418), + new Location(Spawn.getSpawnWorld(), -25, 204, 390), // East Spawn - new Location(Spawn.getSpawnWorld(), 304.5, 207, -26.5), - new Location(Spawn.getSpawnWorld(), 332.5, 207, 6.5), - new Location(Spawn.getSpawnWorld(), 304.5, 207, 36.5), - new Location(Spawn.getSpawnWorld(), 268.5, 207, 6.5) + new Location(Spawn.getSpawnWorld(), 34, 207, -393), + new Location(Spawn.getSpawnWorld(), 8, 207, -365), + new Location(Spawn.getSpawnWorld(), -25, 207, -393), + new Location(Spawn.getSpawnWorld(), 8, 207, -424) ); List welcomeHolograms = Arrays.asList( - // West Spawn - new Location(Spawn.getSpawnWorld(), -304.5, 204, 6.5), - new Location(Spawn.getSpawnWorld(), -295.5, 204, 15.5), - new Location(Spawn.getSpawnWorld(), -286.5, 204, 6.5), - new Location(Spawn.getSpawnWorld(), -295.5, 204, -2.5), - - // East Spawn - new Location(Spawn.getSpawnWorld(), 295.5, 207, 6.5), - new Location(Spawn.getSpawnWorld(), 304.5, 207, -2.5), - new Location(Spawn.getSpawnWorld(), 313.5, 207, 6.5), - new Location(Spawn.getSpawnWorld(), 304.5, 207, 15.5) + new Location(Spawn.getSpawnWorld(), 17, 204, 390), + new Location(Spawn.getSpawnWorld(), 8, 204, 399), + new Location(Spawn.getSpawnWorld(), 0, 204, 390), + new Location(Spawn.getSpawnWorld(), 8, 204, 381), + new Location(Spawn.getSpawnWorld(), 8, 207, -384), + new Location(Spawn.getSpawnWorld(), 0, 207, -393), + new Location(Spawn.getSpawnWorld(), 8, 207, -402), + new Location(Spawn.getSpawnWorld(), 17, 207, -393) ); for (Location location : jumpOffHolograms) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/regions/ClansRegions.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/regions/ClansRegions.java index a414f5486..8ee9a773c 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/regions/ClansRegions.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/regions/ClansRegions.java @@ -144,21 +144,8 @@ public class ClansRegions extends MiniPlugin { final ClanInfo clan = _manager.getClan(clanName); - // Only claim if the clan doesn't have claims. Speeds up startup time - if (clan == null || clan.getClaimSet().size() == 0) + if (clan == null) { - if (clan != null) - { - for (Location location : locations) - { - claimArea(clan, location, chunkRadius, claimOffset, addNegative, safe); - log(String.format("Initialized %s faction territory and creation!", clanName)); - } - - debugClan(clanName); - return; - } - _manager.getClanDataAccess().create("ClansRegions", clanName, true, new Callback() { @Override @@ -171,7 +158,7 @@ public class ClansRegions extends MiniPlugin claimArea(data, location, chunkRadius, claimOffset, addNegative, safe); log(String.format("Initialized %s faction territory and creation!", clanName)); } - + debugClan(clanName); } else @@ -182,6 +169,13 @@ public class ClansRegions extends MiniPlugin } }); } + else + { + for (Location location : locations) + { + claimArea(clan, location, chunkRadius, claimOffset, addNegative, safe); + } + } } /*private void claimArea(String clanName, int chunkRadius, int claimOffset, boolean safe, Location... locations) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/TutorialWorldManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/TutorialWorldManager.java index 01215d6fe..40ac68fc6 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/TutorialWorldManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/TutorialWorldManager.java @@ -59,9 +59,9 @@ public class TutorialWorldManager extends MiniPlugin _regionStack = new Stack<>(); // Populate the stack with 100 available tutorial regions - for (int x = 0; x < 4; x++) + for (int x = 0; x < 10; x++) { - for (int z = 0; z < 4; z++) + for (int z = 0; z < 10; z++) { long time = System.currentTimeMillis(); double xLoc = (x) * BLOCKS_BETWEEN_TUTORIALS; // 1000x1000 regions From aaccb6fd48a80734f9e0d3d78e854fd12984f567 Mon Sep 17 00:00:00 2001 From: phobia Date: Mon, 4 Apr 2016 17:20:21 +1000 Subject: [PATCH 15/19] Join/leave/death messages --- .../game/clans/clans/ClansManager.java | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java index 468f3a29a..233b267e2 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java @@ -575,7 +575,7 @@ public class ClansManager extends MiniClientPluginimplements IRelati } } } - + @EventHandler public void StaffIncognito(IncognitoStatusChangeEvent event) { @@ -589,16 +589,16 @@ public class ClansManager extends MiniClientPluginimplements IRelati } } - @EventHandler(priority = EventPriority.LOWEST) + @EventHandler(priority = EventPriority.HIGHEST) public void Join(PlayerJoinEvent event) { + event.setJoinMessage(null); + if (IncognitoManager.Instance.Get(event.getPlayer()).Status) { - event.setJoinMessage(null); return; } - event.setJoinMessage(null); for (Player other : UtilServer.getPlayers()) { @@ -612,16 +612,16 @@ public class ClansManager extends MiniClientPluginimplements IRelati } } - @EventHandler(priority = EventPriority.LOWEST) + @EventHandler(priority = EventPriority.HIGHEST) public void Quit(PlayerQuitEvent event) { + event.setQuitMessage(null); + if (IncognitoManager.Instance.Get(event.getPlayer()).Status) { - event.setQuitMessage(null); return; } - event.setQuitMessage(null); for (Player other : UtilServer.getPlayers()) { @@ -634,8 +634,8 @@ public class ClansManager extends MiniClientPluginimplements IRelati other.sendMessage(F.sys("Quit", event.getPlayer().getName())); } } - - @EventHandler(priority = EventPriority.LOWEST) + + @EventHandler(priority = EventPriority.HIGHEST) public void Kick(PlayerKickEvent event) { if (IncognitoManager.Instance.Get(event.getPlayer()).Status) @@ -1172,7 +1172,7 @@ public class ClansManager extends MiniClientPluginimplements IRelati { return; } - + Rank rank = _clientManager.Get(event.getPlayer()).GetRank(); if (UtilServer.getPlayers().length >= UtilServer.getServer().getMaxPlayers() && !rank.has(Rank.ADMIN) && !event.getPlayer().isWhitelisted() && !event.getPlayer().isOp()) { @@ -1248,6 +1248,14 @@ public class ClansManager extends MiniClientPluginimplements IRelati @EventHandler(priority = EventPriority.HIGH) public void handleClansDeath(PlayerDeathEvent event) { + event.setDeathMessage(null); + + for(Player player : UtilServer.getPlayers()) + { + if(!_tutorial.inTutorial(player)) + player.sendMessage(event.getDeathMessage()); + } + PlayerClan playerClan; PlayerClan killerClan = null; From 2e0c9d3965ef071f27c538e38e35cbb4d7eda471 Mon Sep 17 00:00:00 2001 From: phobia Date: Mon, 4 Apr 2016 17:34:39 +1000 Subject: [PATCH 16/19] Remove potatoe message --- .../objective/goals/attackenemy/StealEnemyPotatoesGoal.java | 1 - 1 file changed, 1 deletion(-) 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 5e042c4bd..cbe7a28b8 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 @@ -49,7 +49,6 @@ public class StealEnemyPotatoesGoal extends ObjectiveGoal protected void customStart(Player player) { _playersMap.put(player.getUniqueId(), new AtomicInteger(0)); - UtilPlayer.message(player, F.main("Clans", "Now that you have blown a hole in the enemy's base, go and steal their potatoes.")); TutorialSession session = getObjective().getPlugin().getTutorialSession(player); session.setMapTargetLocation(getObjective().getPlugin().getCenter(session.getRegion(), ClansMainTutorial.Bounds.ENEMY_LAND)); From 963bba06f7b1a7069860568358c47f11d25776b3 Mon Sep 17 00:00:00 2001 From: phobia Date: Mon, 4 Apr 2016 17:47:58 +1000 Subject: [PATCH 17/19] fix for displaying territorial movements --- .../game/clans/clans/event/PlayerEnterTerritoryEvent.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/event/PlayerEnterTerritoryEvent.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/event/PlayerEnterTerritoryEvent.java index 80e9a4a4d..ef243563e 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/event/PlayerEnterTerritoryEvent.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/event/PlayerEnterTerritoryEvent.java @@ -22,6 +22,7 @@ public class PlayerEnterTerritoryEvent extends Event _lastTerritory = lastTerritory; _newTerritory = newTerritory; _safe = safe; + _sendMessage = sendMessage; } public Player getPlayer() From 4262a4d4b70c01286fc20857d71539929cc23d20 Mon Sep 17 00:00:00 2001 From: phobia Date: Mon, 4 Apr 2016 22:07:58 +1000 Subject: [PATCH 18/19] Increase radius + delete iron doors after done --- .../clans/objective/goals/attackenemy/BlowUpWallGoal.java | 2 +- .../goals/attackenemy/StealEnemyPotatoesGoal.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) 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 bd9e808da..4be7d83e2 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 @@ -64,7 +64,7 @@ public class BlowUpWallGoal extends ObjectiveGoal if (getObjective().getPlugin().isIn(center, region, ClansMainTutorial.Bounds.ENEMY_ATTACK_AREA)) { - double radius = 4.2; + double radius = 5.2; HashMap blockList = new HashMap(); int iR = (int) radius + 1; 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 cbe7a28b8..1f4261568 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 @@ -3,9 +3,11 @@ package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy import java.util.UUID; import java.util.concurrent.atomic.AtomicInteger; +import mineplex.core.common.util.UtilBlock; import org.bukkit.Bukkit; import org.bukkit.DyeColor; import org.bukkit.Material; +import org.bukkit.block.Block; import org.bukkit.entity.Creature; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -52,6 +54,12 @@ public class StealEnemyPotatoesGoal extends ObjectiveGoal TutorialSession session = getObjective().getPlugin().getTutorialSession(player); session.setMapTargetLocation(getObjective().getPlugin().getCenter(session.getRegion(), ClansMainTutorial.Bounds.ENEMY_LAND)); + + UtilBlock.getInRadius( + getObjective().getPlugin().getRegion(player).getLocationMap().getSpongeLocations(DyeColor.MAGENTA).get(0), 5). + keySet().stream().filter(block -> block.getType().name().contains("IRON_DOOR")).forEach(block -> + block.setType(Material.AIR) + ); } @Override From e85a1e6a3b60fcb368da0fee25662610a407471b Mon Sep 17 00:00:00 2001 From: phobia Date: Mon, 4 Apr 2016 22:22:07 +1000 Subject: [PATCH 19/19] fixes to breakingand placing in claim --- .../tutorials/clans/ClansMainTutorial.java | 71 ++++++++++++++++--- .../objective/goals/clan/BuildHouseGoal.java | 47 ++---------- 2 files changed, 70 insertions(+), 48 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 3900e90be..af19d1e42 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 @@ -6,6 +6,7 @@ import java.util.List; import java.util.Objects; import java.util.UUID; +import com.google.common.collect.Lists; import mineplex.core.hologram.Hologram; import mineplex.core.common.util.*; import mineplex.core.task.TaskManager; @@ -21,6 +22,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.block.BlockBreakEvent; +import org.bukkit.event.block.BlockDamageEvent; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.player.PlayerDropItemEvent; @@ -68,6 +70,15 @@ public class ClansMainTutorial extends Tutorial // private TutorialRepository _repository; private TaskManager _taskManager; + + private List _items = Lists.newArrayList( + Material.SMOOTH_BRICK, + Material.TORCH, + Material.IRON_DOOR, + Material.IRON_DOOR_BLOCK + ); + + public ClansMainTutorial(JavaPlugin plugin, ClansMessageManager message, HologramManager hologram, NpcManager npcManager, TaskManager taskManager) { super(plugin, message, hologram, "Clans Tutorial", "main", Material.DIAMOND_SWORD, (byte) 0); @@ -313,14 +324,6 @@ public class ClansMainTutorial extends Tutorial } } - @EventHandler - public void placeBlock(BlockPlaceEvent event) { - if (isInTutorial(event.getPlayer())) - { - event.setCancelled(true); - } - } - @EventHandler public void blockDamage(EntityDamageEvent event) { @@ -544,4 +547,56 @@ public class ClansMainTutorial extends Tutorial event.setCancelled(true); } } + + @EventHandler + public void blockBreak(BlockDamageEvent event) + { + if (!isInTutorial(event.getPlayer())) + { + return; + } + + if (!isInBuildArea(event.getPlayer(), event.getBlock())) + { + return; + } + + + if (_items.contains(event.getBlock().getType())) + { + event.getBlock().breakNaturally(); + + event.getBlock().getWorld().playEffect(event.getBlock().getLocation(), Effect.TILE_BREAK, event.getBlock().getTypeId(), 18); + + event.getPlayer().playSound(event.getBlock().getLocation(), Sound.LAVA_POP, 1.f, 1.f); + } + } + + + + + @EventHandler (priority = EventPriority.HIGHEST) + public void blockPlace(BlockPlaceEvent event) + { + if (!isInTutorial(event.getPlayer())) + { + return; + } + + if (isInBuildArea(event.getPlayer(), event.getBlock())) + { + event.setCancelled(false); + } + else + { + UtilPlayer.message(event.getPlayer(), F.main("Clans", "You are not allowed to place blocks here.")); + event.setCancelled(true); + } + } + + public boolean isInBuildArea(Player player, Block block) + { + TutorialRegion region = getRegion(player); + return isIn(block.getLocation(), region, ClansMainTutorial.Bounds.LAND_CLAIM); + } } 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 989af681b..250e6d96e 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 @@ -32,8 +32,8 @@ public class BuildHouseGoal extends ObjectiveGoal new ItemStack(Material.TORCH, 2), new ItemStack(Material.IRON_DOOR, 1) ); - - + + public BuildHouseGoal(ClanObjective objective) { super( @@ -58,40 +58,11 @@ public class BuildHouseGoal extends ObjectiveGoal protected void customFinish(Player player) { } - - @EventHandler - public void blockBreak(BlockDamageEvent event) - { - if (!contains(event.getPlayer())) - { - return; - } - - if (!isInBuildArea(event.getPlayer(), event.getBlock())) - { - return; - } - - - - for (ItemStack stack : _items) - { - if (event.getBlock().getType().equals(stack.getType()) || event.getBlock().getType().equals(Material.IRON_DOOR_BLOCK)) - { - event.getBlock().breakNaturally(); - - event.getBlock().getWorld().playEffect(event.getBlock().getLocation(), Effect.TILE_BREAK, event.getBlock().getTypeId(), 18); - - event.getPlayer().playSound(event.getBlock().getLocation(), Sound.LAVA_POP, 1.f, 1.f); - break; - } - } - } @EventHandler (priority = EventPriority.HIGHEST) public void blockPlace(BlockPlaceEvent event) { - if (!contains(event.getPlayer())) + if (!getObjective().getPlugin().isInTutorial(event.getPlayer())) { return; } @@ -99,7 +70,7 @@ public class BuildHouseGoal extends ObjectiveGoal event.setCancelled(false); - if (isInBuildArea(event.getPlayer(), event.getBlock())) + if (getObjective().getPlugin().isInBuildArea(event.getPlayer(), event.getBlock())) { // Run 1 tick later because inventory doesn't get updated instantly ClansManager.getInstance().runSync(() -> { @@ -108,7 +79,7 @@ public class BuildHouseGoal extends ObjectiveGoal { if (stack == null) continue; - + for (ItemStack other : _items) if (stack.getType() == other.getType()) { @@ -116,7 +87,7 @@ public class BuildHouseGoal extends ObjectiveGoal break; } } - + if (ja) // JA! finish(event.getPlayer()); }); @@ -128,9 +99,5 @@ public class BuildHouseGoal extends ObjectiveGoal } } - private boolean isInBuildArea(Player player, Block block) - { - TutorialRegion region = getObjective().getPlugin().getRegion(player); - return getObjective().getPlugin().isIn(block.getLocation(), region, ClansMainTutorial.Bounds.LAND_CLAIM); - } + }