This commit is contained in:
phobia 2016-04-01 21:51:31 +11:00
parent 9a1e5099a4
commit 42fd210b20
6 changed files with 23 additions and 27 deletions

View File

@ -264,12 +264,12 @@ public abstract class Objective<Plugin extends Tutorial, Data extends ObjectiveD
private void showStartMessage(Player player) private void showStartMessage(Player player)
{ {
UtilTextMiddle.display(C.cAqua + "Tutorial", getName(player), player); UtilTextMiddle.display(C.cAqua + "Tutorial", getName(player), 20, 60, 20, player);
} }
private void showFinishMessage(Player player) private void showFinishMessage(Player player)
{ {
UtilTextMiddle.display(C.cGreen + "Tutorial Completed", getName(player), player); UtilTextMiddle.display(C.cGreen + "Tutorial Completed", getName(player), 20, 60, 20, player);
} }
public void setDisplayStartMessage(boolean displayStartMessage) public void setDisplayStartMessage(boolean displayStartMessage)

View File

@ -42,8 +42,6 @@ public class BlowUpWallGoal extends ObjectiveGoal<AttackEnemyObjective>
{ {
Player shooter = event.getProjectile().getShooter(); Player shooter = event.getProjectile().getShooter();
System.out.println(shooter.getName());
if (!contains(shooter)) if (!contains(shooter))
{ {
if (getObjective().getPlugin().isInTutorial(shooter)) if (getObjective().getPlugin().isInTutorial(shooter))

View File

@ -70,6 +70,8 @@ public class BuildHouseGoal extends ObjectiveGoal<ClanObjective>
return; return;
} }
for (ItemStack stack : _items) for (ItemStack stack : _items)
{ {
if (event.getBlock().getType().equals(stack.getType()) || event.getBlock().getType().equals(Material.IRON_DOOR_BLOCK)) if (event.getBlock().getType().equals(stack.getType()) || event.getBlock().getType().equals(Material.IRON_DOOR_BLOCK))
@ -92,6 +94,9 @@ public class BuildHouseGoal extends ObjectiveGoal<ClanObjective>
return; return;
} }
event.setCancelled(false);
if (isInBuildArea(event.getPlayer(), event.getBlock())) if (isInBuildArea(event.getPlayer(), event.getBlock()))
{ {
// Run 1 tick later because inventory doesn't get updated instantly // Run 1 tick later because inventory doesn't get updated instantly

View File

@ -1,20 +1,23 @@
package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.classes; 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.game.clans.clans.ClansManager;
import mineplex.minecraft.game.classcombat.Class.ClassManager; import mineplex.minecraft.game.classcombat.Class.ClassManager;
import mineplex.minecraft.game.classcombat.Class.ClientClass; import mineplex.minecraft.game.classcombat.Class.ClientClass;
import mineplex.minecraft.game.classcombat.Class.IPvpClass; 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.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import mineplex.game.clans.tutorial.objective.ObjectiveGoal; import mineplex.game.clans.tutorial.objective.ObjectiveGoal;
import mineplex.game.clans.tutorial.tutorials.clans.objective.ClassesObjective; import mineplex.game.clans.tutorial.tutorials.clans.objective.ClassesObjective;
import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent; import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent;
import org.bukkit.event.player.PlayerInteractEvent;
public class UseBullsChargeGoal extends ObjectiveGoal<ClassesObjective> public class UseBullsChargeGoal extends ObjectiveGoal<ClassesObjective> {
{ public UseBullsChargeGoal(ClassesObjective objective) {
public UseBullsChargeGoal(ClassesObjective objective)
{
super( super(
objective, objective,
"Use Bulls Charge", "Use Bulls Charge",
@ -28,26 +31,20 @@ public class UseBullsChargeGoal extends ObjectiveGoal<ClassesObjective>
protected void customStart(Player player) { protected void customStart(Player player) {
ClientClass client = ClansManager.getInstance().getClassManager().Get(player); ClientClass client = ClansManager.getInstance().getClassManager().Get(player);
for(IPvpClass clazz: ClansManager.getInstance().getClassManager().GetAllClasses()) { client.ResetSkills(player);
if(clazz.GetName().toLowerCase().contains("default")) { client.SetActiveCustomBuild(client.GetGameClass(), client.GetGameClass().getDefaultBuild());
client.SetGameClass(clazz);
break;
}
}
} }
@Override @Override
protected void customFinish(Player player) protected void customFinish(Player player) {
{
} }
@EventHandler @EventHandler
public void checkSkill(SkillTriggerEvent event) public void checkSkill(SkillTriggerEvent event) {
{ if (contains(event.GetPlayer())) {
if (contains(event.GetPlayer()))
{
if (event.GetSkillName().toLowerCase().contains("bulls charge")) if (event.GetSkillName().toLowerCase().contains("bulls charge"))
finish(event.GetPlayer()); finish(event.GetPlayer());
} }
} }
} }

View File

@ -59,15 +59,12 @@ public class MineDiamondsGoal extends ObjectiveGoal<FieldsObjective>
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
public void onBlockBreak(BlockBreakEvent event) public void onBlockBreak(BlockBreakEvent event)
{ {
System.out.println("a");
if (!contains(event.getPlayer()) || event.getBlock().getType() != Material.DIAMOND_ORE) if (!contains(event.getPlayer()) || event.getBlock().getType() != Material.DIAMOND_ORE)
return; return;
System.out.println("b");
TutorialRegion region = getObjective().getPlugin().getRegion(event.getPlayer()); TutorialRegion region = getObjective().getPlugin().getRegion(event.getPlayer());
if (getObjective().getPlugin().isIn(event.getBlock().getLocation(), region, ClansMainTutorial.Bounds.FIELDS)) if (getObjective().getPlugin().isIn(event.getBlock().getLocation(), region, ClansMainTutorial.Bounds.FIELDS))
{ {
System.out.println("c");
event.setCancelled(true); event.setCancelled(true);
event.getBlock().getWorld().dropItemNaturally(event.getBlock().getLocation().add(0.5, 1.5, 0.5), new ItemStack(Material.DIAMOND)); event.getBlock().getWorld().dropItemNaturally(event.getBlock().getLocation().add(0.5, 1.5, 0.5), new ItemStack(Material.DIAMOND));
event.getBlock().setType(Material.COBBLESTONE); event.getBlock().setType(Material.COBBLESTONE);

View File

@ -13,7 +13,6 @@ import mineplex.game.clans.tutorial.objective.Objective;
import mineplex.game.clans.tutorial.objective.ObjectiveGoal; import mineplex.game.clans.tutorial.objective.ObjectiveGoal;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.game.clans.clans.event.ClansCommandExecutedEvent;
import mineplex.game.clans.tutorial.tutorials.clans.objective.FinalObjective; import mineplex.game.clans.tutorial.tutorials.clans.objective.FinalObjective;
public class TpClanHomeGoal extends ObjectiveGoal<FinalObjective> public class TpClanHomeGoal extends ObjectiveGoal<FinalObjective>