From fd672f675fc7f7dff1c0875e3172c826e13a1d2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=90=E6=B2=90=E5=91=80?= <163636894+zimuya4153@users.noreply.github.com> Date: Thu, 10 Oct 2024 02:03:10 +0800 Subject: [PATCH] feat: remove some shit --- lib/GMLIB_API-JS.js | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/lib/GMLIB_API-JS.js b/lib/GMLIB_API-JS.js index b1b5e3e..d7720e5 100644 --- a/lib/GMLIB_API-JS.js +++ b/lib/GMLIB_API-JS.js @@ -2126,10 +2126,7 @@ class GMLIB_BinaryStream { sendTo(player, free = true) { if (this.#destroy) throw new Error("The BinaryStream has been destroyed"); GMLIB_BinaryStream_API.sendTo(this.#id, player, free); - if (free) { - this.destroy(); - this.#destroy = true; - } + if (free) this.destroy(); } /** @@ -2140,10 +2137,7 @@ class GMLIB_BinaryStream { sendToPlayers(players, free = true) { if (this.#destroy) throw new Error("The BinaryStream has been destroyed"); players.forEach(player => this.sendTo(player, false)); - if (free) { - this.destroy(); - this.#destroy = true; - } + if (free) this.destroy(); } /** @@ -2153,10 +2147,7 @@ class GMLIB_BinaryStream { sendToAll(free = true) { if (this.#destroy) throw new Error("The BinaryStream has been destroyed"); mc.getOnlinePlayers().forEach(player => this.sendTo(player, false)); - if (free) { - this.destroy(); - this.#destroy = true; - } + if (free) this.destroy(); } /** @@ -2167,10 +2158,7 @@ class GMLIB_BinaryStream { sendToDimension(dimid, free = true) { 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)); - if (free) { - this.destroy(); - this.#destroy = true; - } + if (free) this.destroy(); } /**