Let's not eagerly delete clans
This commit is contained in:
parent
5564b07a36
commit
18d7eba9db
@ -209,7 +209,8 @@ public class ClansMainTutorial extends Tutorial
|
|||||||
ClanInfo clan = ClansManager.getInstance().getClan(player);
|
ClanInfo clan = ClansManager.getInstance().getClan(player);
|
||||||
if (clan != null)
|
if (clan != null)
|
||||||
{
|
{
|
||||||
ClansManager.getInstance().getClanDataAccess().delete(clan, null);
|
UtilPlayer.message(player, F.main("Clans", "You are part of a clan - please leave or disband the clan before doing the tutorial"));
|
||||||
|
ClansManager.getInstance().getTutorial().finishTutorial(player); //nopenopenopenopenope
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -465,7 +466,15 @@ public class ClansMainTutorial extends Tutorial
|
|||||||
|
|
||||||
if (!_taskManager.hasCompletedTask(event.getPlayer(), getTaskIdentifier()))
|
if (!_taskManager.hasCompletedTask(event.getPlayer(), getTaskIdentifier()))
|
||||||
{
|
{
|
||||||
start(event.getPlayer());
|
ClanInfo clan = ClansManager.getInstance().getClan(event.getPlayer());
|
||||||
|
if (clan == null)
|
||||||
|
{
|
||||||
|
start(event.getPlayer());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UtilPlayer.message(event.getPlayer(), F.main("Clans", "It seems you already have a clan here, so we can skip the tutorial"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (!event.getPlayer().hasPlayedBefore() || !event.getPlayer().getLocation().getWorld().equals(Spawn.getSpawnWorld()))
|
else if (!event.getPlayer().hasPlayedBefore() || !event.getPlayer().getLocation().getWorld().equals(Spawn.getSpawnWorld()))
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan;
|
package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan;
|
||||||
|
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.game.clans.clans.event.ClanCreatedEvent;
|
||||||
import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent;
|
import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -42,6 +43,15 @@ public class CreateClanGoal extends ObjectiveGoal<ClanObjective>
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onClanPreCreate(ClanCreatedEvent event)
|
||||||
|
{
|
||||||
|
if (contains(event.getFounder()))
|
||||||
|
{
|
||||||
|
event.setName("TUTORIAL-" + event.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onClanCreate(ClanCreationCompleteEvent event)
|
public void onClanCreate(ClanCreationCompleteEvent event)
|
||||||
{
|
{
|
||||||
|
@ -47,6 +47,11 @@ public class DisbandClanGoal extends ObjectiveGoal<FinalObjective>
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!event.getClan().getName().startsWith("TUTORIAL-")) // How???
|
||||||
|
{
|
||||||
|
UtilPlayer.message(event.getDisbander(), F.main("Clans", "Something has gone terribly wrong while disbanding your clan"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
||||||
UtilPlayer.message(event.getDisbander(), F.main("Clans", "You have disbanded your Tutorial Clan."));
|
UtilPlayer.message(event.getDisbander(), F.main("Clans", "You have disbanded your Tutorial Clan."));
|
||||||
|
Loading…
Reference in New Issue
Block a user