From d0eb492b857ab92fa131472f409b04707ec94cad Mon Sep 17 00:00:00 2001 From: Cymaera <69355340+TheCymaera@users.noreply.github.com> Date: Mon, 14 Oct 2024 10:35:45 +0800 Subject: [PATCH] Added permissions and removed some options used for the video --- .../com/heledron/sky_torch/laser/Cloud.kt | 9 ++------- .../com/heledron/sky_torch/laser/burnWave.kt | 14 +------------ src/main/resources/plugin.yml | 20 ++++++++++++++++++- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/main/kotlin/com/heledron/sky_torch/laser/Cloud.kt b/src/main/kotlin/com/heledron/sky_torch/laser/Cloud.kt index b275841..9dfbd7a 100644 --- a/src/main/kotlin/com/heledron/sky_torch/laser/Cloud.kt +++ b/src/main/kotlin/com/heledron/sky_torch/laser/Cloud.kt @@ -18,7 +18,6 @@ class Cloud( val growth: Double, val maxAge: Int, val blocks: List, - var disableSmartRendering: Boolean = false, ): GameObject() { var age = 0 @@ -51,12 +50,8 @@ class Cloud( AppState.renderer.render(this, getModel()) } - private fun getSmartRenderLocation(): Location { - return if (disableSmartRendering) location else renderLocation - } - private fun getModel() = blockModel( - location = getSmartRenderLocation(), + location = renderLocation, init = { it.brightness = Display.Brightness(15, 15) it.teleportDuration = 1 @@ -67,7 +62,7 @@ class Cloud( val index = (age.toFloat() / maxAge * blocks.size).toInt().coerceAtMost(blocks.size - 1) // val location = location.clone().add(velocity.clone().normalize().multiply(size / 2)) - val diff = location.toVector().subtract(getSmartRenderLocation().toVector()) + val diff = location.toVector().subtract(renderLocation.toVector()) it.block = blocks[index] diff --git a/src/main/kotlin/com/heledron/sky_torch/laser/burnWave.kt b/src/main/kotlin/com/heledron/sky_torch/laser/burnWave.kt index ff10dd5..24bcdc5 100644 --- a/src/main/kotlin/com/heledron/sky_torch/laser/burnWave.kt +++ b/src/main/kotlin/com/heledron/sky_torch/laser/burnWave.kt @@ -30,8 +30,6 @@ class BurnWaveOptions { var airDragCoefficient = .005 - var disableRotation = false - var disableSmartRendering = false var disableHeat = false } @@ -62,17 +60,7 @@ private fun spawnBurnCloud(placement: BurnWavePlacement, options: BurnWaveOption maxAge = Random.nextInt(options.durationMin, options.durationMax), blocks = options.palette.burn.burnWave.random(), renderLocation = placement.render.toLocation(placement.world), - disableSmartRendering = options.disableSmartRendering, ).apply { - if (options.disableRotation) { - pitch = 0f - yaw = 0f - pitchVelocity = 0f - yawVelocity = 0f - } - - - // val affectedPlayers = mutableListOf() onUpdate = { @@ -102,7 +90,7 @@ private fun spawnBurnCloud(placement: BurnWavePlacement, options: BurnWaveOption val top = location.clone().add(.0,scanUpwards,.0) val ground = raycastGround(top, Vector(0, -1, 0), scanUpwards + scanDownwards)?.hitPosition?.toLocation(location.world!!) ?: location.clone() - if (location.block.type.isOccluding && !options.disableRotation) { + if (location.block.type.isOccluding) { location.y = location.y.lerp(ground.y + size / 2, .03) } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index c83c258..6c09b8c 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -7,12 +7,30 @@ commands: items: description: Open the items menu usage: /items + permission: sky_torch.items reload_config: description: Reload the configuration file usage: /reload_config + permission: sky_torch.reload_config preset: description: Select a preset usage: /preset + permission: sky_torch.preset scale: description: Scale the laser - usage: /scale \ No newline at end of file + usage: /scale + permission: sky_torch.scale + +permissions: + sky_torch.items: + description: Allows access to the items command + default: op + sky_torch.reload_config: + description: Allows access to the reload_config command + default: op + sky_torch.preset: + description: Allows access to the preset command + default: op + sky_torch.scale: + description: Allows access to the scale command + default: op \ No newline at end of file