Skip to content

Commit

Permalink
* Fixed bug relating to negative coordinate rounding
Browse files Browse the repository at this point in the history
* Remove requirement for coordinate rounding (now defaults to ~ ~0.15 ~)
  • Loading branch information
ixnoahlive committed Jun 17, 2024
1 parent 587892f commit 254eeb7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ org.gradle.jvmargs=-Xmx2g
baseGroup = live.ixnoah.tapactions
mcVersion = 1.8.9
modid = tapactions
version = 0.2.0
version = 0.2.1
2 changes: 1 addition & 1 deletion src/main/kotlin/live/ixnoah/tapactions/TapActions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import java.net.URL
class TapActions {
companion object ModInfo {
const val MOD_ID = "tapactions"
val MOD_VER = Version("0.2.0")
val MOD_VER = Version("0.2.1")

var outdated = false
var newerVersion = MOD_VER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import live.ixnoah.tapactions.wrappers.Coordinates
import net.minecraft.client.Minecraft
import net.minecraft.util.EnumParticleTypes
import kotlin.math.floor
import kotlin.math.sign

object WorldActions {
var particlesRendered = 0
Expand All @@ -14,8 +15,8 @@ object WorldActions {

val particleType = EnumParticleTypes.valueOf(params["type"]!!.uppercase())

var pos = Coordinates.parseCoordinates(params["pos"]!!, Minecraft.getMinecraft().thePlayer)
if (params["round"] != null) pos = pos.mapValues { (floor(it.value) + 0.5) }
var pos = Coordinates.parseCoordinates(params["pos"] ?: "~ ~0.15 ~", Minecraft.getMinecraft().thePlayer)
if (params["round"] != null) pos = pos.mapValues { (floor(it.value) + 0.5 * it.value.sign) }

Minecraft.getMinecraft().theWorld.spawnParticle(
particleType,
Expand All @@ -27,6 +28,6 @@ object WorldActions {
}

fun deploy() {
ActionManager.registerAction("tap:particle", ::actionParticle, mutableListOf("type", "pos" ))
ActionManager.registerAction("tap:particle", ::actionParticle, mutableListOf("type"))
}
}

0 comments on commit 254eeb7

Please sign in to comment.