This repository was archived by the owner on Feb 8, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
src/VectorNetworkProject/TheMix Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -16,15 +16,19 @@ class PhaseTimeUpdateEvent extends Event implements Cancellable
16
16
{
17
17
/** @var int $time */
18
18
private $ time ;
19
+ /** @var int $phase */
20
+ private $ phase ;
19
21
20
22
/**
21
23
* PhaseTimeUpdateEvent constructor.
22
24
*
23
25
* @param int $time
26
+ * @param int $phase
24
27
*/
25
- public function __construct (int $ time )
28
+ public function __construct (int $ time, int $ phase )
26
29
{
27
30
$ this ->time = $ time ;
31
+ $ this ->phase = $ phase ;
28
32
}
29
33
30
34
/**
@@ -34,4 +38,12 @@ public function getTime(): int
34
38
{
35
39
return $ this ->time ;
36
40
}
41
+
42
+ /**
43
+ * @return int
44
+ */
45
+ public function getPhase (): int
46
+ {
47
+ return $ this ->phase ;
48
+ }
37
49
}
Original file line number Diff line number Diff line change 9
9
namespace VectorNetworkProject \TheMix \task ;
10
10
11
11
use pocketmine \scheduler \Task ;
12
+ use VectorNetworkProject \TheMix \game \corepvp \PhaseManager ;
12
13
use VectorNetworkProject \TheMix \game \event \game \PhaseTimeUpdateEvent ;
13
14
14
15
class PhaseTask extends Task
@@ -33,7 +34,7 @@ public function __construct(int $time = 600)
33
34
*/
34
35
public function onRun (int $ currentTick )
35
36
{
36
- $ event = new PhaseTimeUpdateEvent ($ this ->getTime () - 1 );
37
+ $ event = new PhaseTimeUpdateEvent ($ this ->getTime () - 1 , PhaseManager:: getPhase () );
37
38
$ event ->call ();
38
39
if (!$ event ->isCancelled ()) {
39
40
$ this ->setTime ($ this ->getTime () - 1 );
You can’t perform that action at this time.
0 commit comments