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)
{
UtilTextMiddle.display(C.cAqua + "Tutorial", getName(player), player);
UtilTextMiddle.display(C.cAqua + "Tutorial", getName(player), 20, 60, 20, 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)

View File

@ -41,9 +41,7 @@ public class BlowUpWallGoal extends ObjectiveGoal<AttackEnemyObjective>
public void siegeWeaponExplode(SiegeWeaponExplodeEvent event)
{
Player shooter = event.getProjectile().getShooter();
System.out.println(shooter.getName());
if (!contains(shooter))
{
if (getObjective().getPlugin().isInTutorial(shooter))

View File

@ -69,7 +69,9 @@ public class BuildHouseGoal extends ObjectiveGoal<ClanObjective>
{
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<ClanObjective>
{
return;
}
event.setCancelled(false);
if (isInBuildArea(event.getPlayer(), event.getBlock()))
{
// 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;
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<ClassesObjective>
{
public UseBullsChargeGoal(ClassesObjective objective)
{
public class UseBullsChargeGoal extends ObjectiveGoal<ClassesObjective> {
public UseBullsChargeGoal(ClassesObjective objective) {
super(
objective,
"Use Bulls Charge",
@ -28,26 +31,20 @@ public class UseBullsChargeGoal extends ObjectiveGoal<ClassesObjective>
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());
}
}
}

View File

@ -59,15 +59,12 @@ public class MineDiamondsGoal extends ObjectiveGoal<FieldsObjective>
@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);

View File

@ -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<FinalObjective>