59 @Getter
private UUID worldUUID;
69 @Setter
private Difficulty difficultyLock;
74 @Setter
private GameMode gameModeLock;
79 @Setter
private Integer heartLock;
84 @Setter
private Integer hungerLock;
89 @Setter
private Integer saturationLock;
96 this.worldUUID = worldUUID;
108 var world = Bukkit.getWorld(worldUUID);
122 if (world ==
null)
return;
124 TickDifficultyLock(world);
125 for (var player : Bukkit.getOnlinePlayers()){
126 if (!player.getWorld().getUID().equals(worldUUID))
continue;
127 TickGameModeLock(player);
128 TickHeartLock(player);
129 TickHungerLock(player);
130 TickSaturationLock(player);
138 private void TickTimeLock(World world){
139 if (timeLock ==
null)
return;
140 world.setTime(timeLock.time);
147 private void TickDifficultyLock(World world){
148 if (difficultyLock ==
null)
return;
149 world.setDifficulty(difficultyLock);
156 private void TickGameModeLock(Player player){
157 if (gameModeLock ==
null)
return;
158 player.setGameMode(gameModeLock);
165 private void TickHeartLock(Player player){
166 if (heartLock ==
null)
return;
167 player.setHealth(heartLock);
174 private void TickHungerLock(Player player){
175 if (hungerLock ==
null)
return;
176 player.setFoodLevel(hungerLock);
183 private void TickSaturationLock(Player player){
184 if (saturationLock ==
null)
return;
185 player.setSaturation(saturationLock);