Add interval property for configurable tick rate in LagoonAddons

This commit is contained in:
2026-05-13 07:38:02 +02:00
parent 227c8a7c70
commit 48276881ea
4 changed files with 7 additions and 5 deletions

View File

@@ -2,7 +2,7 @@ import { system, world } from "@minecraft/server";
import utils from "utils";
import { websocket } from "@minecraft/server-net";
import { InitPlayer } from "entities/player";
import { roomCode } from "properties";
import { interval, roomCode } from "properties";
class LagoonAddons {
constructor() {
this.timer = 0;
@@ -42,7 +42,7 @@ class LagoonAddons {
async clock() {
this.timer++;
// 1 seconde
if (this.timer % 20 === 0) {
if (this.timer % interval === 0) {
if (this.ws.isOpen) {
const players = world.getAllPlayers().map((p) => {
return {