From 42fd210b20b146417153e494e0684bd28592dd8e Mon Sep 17 00:00:00 2001 From: phobia Date: Fri, 1 Apr 2016 21:51:31 +1100 Subject: [PATCH] PC-56 --- .../clans/tutorial/objective/Objective.java | 4 +-- .../goals/attackenemy/BlowUpWallGoal.java | 4 +-- .../objective/goals/clan/BuildHouseGoal.java | 9 ++++-- .../goals/classes/UseBullsChargeGoal.java | 29 +++++++++---------- .../goals/fields/MineDiamondsGoal.java | 3 -- .../goals/finalobj/TpClanHomeGoal.java | 1 - 6 files changed, 23 insertions(+), 27 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 839a92901..fd614fe24 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 @@ -264,12 +264,12 @@ public abstract class Objective public void siegeWeaponExplode(SiegeWeaponExplodeEvent event) { Player shooter = event.getProjectile().getShooter(); - - System.out.println(shooter.getName()); - + if (!contains(shooter)) { if (getObjective().getPlugin().isInTutorial(shooter)) 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 7b77783fd..0187a6f98 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 @@ -69,7 +69,9 @@ public class BuildHouseGoal extends ObjectiveGoal { return; } - + + + for (ItemStack stack : _items) { if (event.getBlock().getType().equals(stack.getType()) || event.getBlock().getType().equals(Material.IRON_DOOR_BLOCK)) @@ -91,7 +93,10 @@ public class BuildHouseGoal extends ObjectiveGoal { return; } - + + event.setCancelled(false); + + if (isInBuildArea(event.getPlayer(), event.getBlock())) { // Run 1 tick later because inventory doesn't get updated instantly 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 aa71751e8..d2a716d2a 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 @@ -1,20 +1,23 @@ package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.classes; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilEvent; import mineplex.game.clans.clans.ClansManager; import mineplex.minecraft.game.classcombat.Class.ClassManager; import mineplex.minecraft.game.classcombat.Class.ClientClass; import mineplex.minecraft.game.classcombat.Class.IPvpClass; +import mineplex.minecraft.game.classcombat.Class.event.ClassEquipEvent; +import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import mineplex.game.clans.tutorial.objective.ObjectiveGoal; import mineplex.game.clans.tutorial.tutorials.clans.objective.ClassesObjective; import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent; +import org.bukkit.event.player.PlayerInteractEvent; -public class UseBullsChargeGoal extends ObjectiveGoal -{ - public UseBullsChargeGoal(ClassesObjective objective) - { +public class UseBullsChargeGoal extends ObjectiveGoal { + public UseBullsChargeGoal(ClassesObjective objective) { super( objective, "Use Bulls Charge", @@ -28,26 +31,20 @@ public class UseBullsChargeGoal extends ObjectiveGoal protected void customStart(Player player) { ClientClass client = ClansManager.getInstance().getClassManager().Get(player); - for(IPvpClass clazz: ClansManager.getInstance().getClassManager().GetAllClasses()) { - if(clazz.GetName().toLowerCase().contains("default")) { - client.SetGameClass(clazz); - break; - } - } + client.ResetSkills(player); + client.SetActiveCustomBuild(client.GetGameClass(), client.GetGameClass().getDefaultBuild()); } @Override - protected void customFinish(Player player) - { + protected void customFinish(Player player) { } @EventHandler - public void checkSkill(SkillTriggerEvent event) - { - if (contains(event.GetPlayer())) - { + public void checkSkill(SkillTriggerEvent event) { + if (contains(event.GetPlayer())) { if (event.GetSkillName().toLowerCase().contains("bulls charge")) finish(event.GetPlayer()); } } + } 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 34a47fdd7..47506ed95 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 @@ -59,15 +59,12 @@ public class MineDiamondsGoal extends ObjectiveGoal @EventHandler(priority = EventPriority.HIGHEST) public void onBlockBreak(BlockBreakEvent event) { - System.out.println("a"); if (!contains(event.getPlayer()) || event.getBlock().getType() != Material.DIAMOND_ORE) return; - System.out.println("b"); TutorialRegion region = getObjective().getPlugin().getRegion(event.getPlayer()); if (getObjective().getPlugin().isIn(event.getBlock().getLocation(), region, ClansMainTutorial.Bounds.FIELDS)) { - System.out.println("c"); event.setCancelled(true); event.getBlock().getWorld().dropItemNaturally(event.getBlock().getLocation().add(0.5, 1.5, 0.5), new ItemStack(Material.DIAMOND)); event.getBlock().setType(Material.COBBLESTONE); 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 030bb18c8..c7b189ec5 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 @@ -13,7 +13,6 @@ import mineplex.game.clans.tutorial.objective.Objective; import mineplex.game.clans.tutorial.objective.ObjectiveGoal; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; -import mineplex.game.clans.clans.event.ClansCommandExecutedEvent; import mineplex.game.clans.tutorial.tutorials.clans.objective.FinalObjective; public class TpClanHomeGoal extends ObjectiveGoal