Tutorial/Phase Time.
This commit is contained in:
parent
19254fc4a0
commit
1bb40b21d3
@ -28,6 +28,8 @@ public abstract class GameTutorial
|
||||
private boolean _hasStarted;
|
||||
|
||||
private int _tick;
|
||||
|
||||
private long _started;
|
||||
|
||||
public boolean SetTutorialPositions = true;
|
||||
public boolean TeleportOnEnd = true;
|
||||
@ -54,6 +56,7 @@ public abstract class GameTutorial
|
||||
|
||||
Manager.GetGame().PrepareTime = 60000;
|
||||
Manager.GetChat().Silence(60000, false);
|
||||
_started = System.currentTimeMillis();
|
||||
Manager.getPluginManager().callEvent(new GameTutorialStartEvent(this));
|
||||
onStart();
|
||||
preparePlayers();
|
||||
@ -194,4 +197,14 @@ public abstract class GameTutorial
|
||||
_tick++;
|
||||
return _tick;
|
||||
}
|
||||
|
||||
public long getTutorialStart()
|
||||
{
|
||||
return _started;
|
||||
}
|
||||
|
||||
public long getPhaseTime()
|
||||
{
|
||||
return _currentPhase.getPhaseTime();
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilTextMiddle;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@ -19,6 +18,8 @@ public abstract class TutorialPhase
|
||||
private Location _target;
|
||||
private boolean _hasEnded;
|
||||
|
||||
private long _started;
|
||||
|
||||
private TutorialText _currentText;
|
||||
|
||||
public TutorialPhase(TutorialText[] text)
|
||||
@ -29,6 +30,7 @@ public abstract class TutorialPhase
|
||||
final public void start(boolean phaseOne)
|
||||
{
|
||||
_hasEnded = false;
|
||||
_started = System.currentTimeMillis();
|
||||
onStart();
|
||||
if(!phaseOne)
|
||||
{
|
||||
@ -218,6 +220,11 @@ public abstract class TutorialPhase
|
||||
return _target;
|
||||
}
|
||||
|
||||
public long getPhaseTime()
|
||||
{
|
||||
return _started;
|
||||
}
|
||||
|
||||
public void onStart(){}
|
||||
|
||||
public void onMessageDisplay(TutorialText text){}
|
||||
|
Loading…
Reference in New Issue
Block a user