LTDV10Test/packet/kubejs/client_scripts/network.js
3944Realms 67a395b765
Some checks failed
Deploy to Remote Server / deploy (push) Failing after 1m11s
初始化
2026-04-14 18:20:56 +08:00

30 lines
1.1 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const $FluidFX = Java.loadClass("com.simibubi.create.content.fluids.FluidFX")
const $HoloGui = Java.loadClass("se.mickelus.tetra.items.modular.impl.holo.gui.HoloGui")
NetworkEvents.dataReceived("kubejs_player_playsound", e => {
e.player.playSound(e.data.get("soundEvent").getAsString())
})
NetworkEvents.dataReceived("spawn_create_particle", e => {
const {fluid, x, y, z, vx, vy, vz, count, speed} = e.data
let particle = $FluidFX.getFluidParticle(Fluid.of(fluid).fluidStack)
e.player.level.spawnParticles(particle, true, x, y, z, vx, vy, vz, count, speed)
})
NetworkEvents.dataReceived("openholo", e => {
let gui = $HoloGui.getInstance()
Client.setScreen(gui)
gui.onShow()
})
// 发送玩家是否按下了Alt键用于 批量套壳 server_scripts/Custom/encase.js
let playerAltDown = false
let playerAltDown1 = false
PlayerEvents.tick(event => {
playerAltDown = Client.isAltDown()
if (playerAltDown1 != playerAltDown) {
event.player.sendData("isPlayerAltDown", { "Alt": playerAltDown })
playerAltDown1 = playerAltDown
}
})