mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-09 04:13:00 +08:00
Fix game time locking
This commit is contained in:
parent
69fadff479
commit
18bc68774c
@ -723,6 +723,17 @@ public class Player implements PlayerHook {
|
||||
return playerProfile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a player's property.
|
||||
*
|
||||
* @param prop The property.
|
||||
* @param value The value as a boolean.
|
||||
* @return True if the property was set.
|
||||
*/
|
||||
public boolean setProperty(PlayerProperty prop, boolean value) {
|
||||
return setPropertyWithSanityCheck(prop, value ? 1 : 0, true);
|
||||
}
|
||||
|
||||
public boolean setProperty(PlayerProperty prop, int value) {
|
||||
return setPropertyWithSanityCheck(prop, value, true);
|
||||
}
|
||||
|
@ -1,13 +1,12 @@
|
||||
package emu.grasscutter.game.world;
|
||||
|
||||
import static emu.grasscutter.server.event.player.PlayerTeleportEvent.TeleportType.SCRIPT;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.excels.dungeon.DungeonData;
|
||||
import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.game.player.Player.SceneLoadState;
|
||||
import emu.grasscutter.game.props.EnterReason;
|
||||
import emu.grasscutter.game.props.EntityIdType;
|
||||
import emu.grasscutter.game.props.PlayerProperty;
|
||||
import emu.grasscutter.game.props.SceneType;
|
||||
import emu.grasscutter.game.quest.enums.QuestContent;
|
||||
import emu.grasscutter.game.world.data.TeleportProperties;
|
||||
@ -23,13 +22,16 @@ import emu.grasscutter.utils.Position;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMaps;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import lombok.Getter;
|
||||
import lombok.val;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.Getter;
|
||||
import lombok.val;
|
||||
|
||||
import static emu.grasscutter.server.event.player.PlayerTeleportEvent.TeleportType.SCRIPT;
|
||||
|
||||
public final class World implements Iterable<Player> {
|
||||
@Getter private final GameServer server;
|
||||
@ -532,6 +534,10 @@ public final class World implements Iterable<Player> {
|
||||
*/
|
||||
public void lockTime(boolean locked) {
|
||||
this.timeLocked = locked;
|
||||
|
||||
// Notify players of the locking.
|
||||
this.getPlayers().forEach(player ->
|
||||
player.setProperty(PlayerProperty.PROP_IS_GAME_TIME_LOCKED, locked));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user