Stop lobbies being night
This commit is contained in:
parent
a577e645d2
commit
440ff7feeb
@ -5,6 +5,7 @@ import org.bukkit.FireworkEffect;
|
||||
import org.bukkit.FireworkEffect.Type;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilFirework;
|
||||
@ -27,13 +28,9 @@ public class MythicalRewardAnimation extends TreasureRewardAnimation
|
||||
.withFlicker()
|
||||
.build();
|
||||
|
||||
private long _currentTime;
|
||||
|
||||
public MythicalRewardAnimation(Treasure treasure, TreasureLocation treasureLocation, Location location, RewardData rewardData)
|
||||
{
|
||||
super(treasure, treasureLocation, location, rewardData);
|
||||
|
||||
_currentTime = location.getWorld().getTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -49,7 +46,10 @@ public class MythicalRewardAnimation extends TreasureRewardAnimation
|
||||
{
|
||||
if (getTicks() % 5 == 0)
|
||||
{
|
||||
getLocation().getWorld().setTime(getLocation().getWorld().getTime() + 12000);
|
||||
for (Player player : getLocation().getWorld().getPlayers())
|
||||
{
|
||||
player.setPlayerTime(player.getPlayerTime() + 12000, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (getTicks() % 2 == 0)
|
||||
@ -72,6 +72,9 @@ public class MythicalRewardAnimation extends TreasureRewardAnimation
|
||||
@Override
|
||||
protected void onFinish()
|
||||
{
|
||||
getLocation().getWorld().setTime(_currentTime);
|
||||
for (Player player : getLocation().getWorld().getPlayers())
|
||||
{
|
||||
player.resetPlayerTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user