feat: remove some shit

This commit is contained in:
子沐呀
2024-10-10 02:03:10 +08:00
Unverified
parent ad8855e12e
commit fd672f675f
+4 -16
View File
@@ -2126,10 +2126,7 @@ class GMLIB_BinaryStream {
sendTo(player, free = true) { sendTo(player, free = true) {
if (this.#destroy) throw new Error("The BinaryStream has been destroyed"); if (this.#destroy) throw new Error("The BinaryStream has been destroyed");
GMLIB_BinaryStream_API.sendTo(this.#id, player, free); GMLIB_BinaryStream_API.sendTo(this.#id, player, free);
if (free) { if (free) this.destroy();
this.destroy();
this.#destroy = true;
}
} }
/** /**
@@ -2140,10 +2137,7 @@ class GMLIB_BinaryStream {
sendToPlayers(players, free = true) { sendToPlayers(players, free = true) {
if (this.#destroy) throw new Error("The BinaryStream has been destroyed"); if (this.#destroy) throw new Error("The BinaryStream has been destroyed");
players.forEach(player => this.sendTo(player, false)); players.forEach(player => this.sendTo(player, false));
if (free) { if (free) this.destroy();
this.destroy();
this.#destroy = true;
}
} }
/** /**
@@ -2153,10 +2147,7 @@ class GMLIB_BinaryStream {
sendToAll(free = true) { sendToAll(free = true) {
if (this.#destroy) throw new Error("The BinaryStream has been destroyed"); if (this.#destroy) throw new Error("The BinaryStream has been destroyed");
mc.getOnlinePlayers().forEach(player => this.sendTo(player, false)); mc.getOnlinePlayers().forEach(player => this.sendTo(player, false));
if (free) { if (free) this.destroy();
this.destroy();
this.#destroy = true;
}
} }
/** /**
@@ -2167,10 +2158,7 @@ class GMLIB_BinaryStream {
sendToDimension(dimid, free = true) { sendToDimension(dimid, free = true) {
if (this.#destroy) throw new Error("The BinaryStream has been destroyed"); if (this.#destroy) throw new Error("The BinaryStream has been destroyed");
mc.getOnlinePlayers().filter(player => player.pos.dimid === dimid).forEach(player => this.sendTo(player, false)); mc.getOnlinePlayers().filter(player => player.pos.dimid === dimid).forEach(player => this.sendTo(player, false));
if (free) { if (free) this.destroy();
this.destroy();
this.#destroy = true;
}
} }
/** /**