diff --git a/src/main/kotlin/com/bytedice/bde_particles/Bde_particles.kt b/src/main/kotlin/com/bytedice/bde_particles/Bde_particles.kt index 8c148f2..9af7b4b 100644 --- a/src/main/kotlin/com/bytedice/bde_particles/Bde_particles.kt +++ b/src/main/kotlin/com/bytedice/bde_particles/Bde_particles.kt @@ -48,9 +48,6 @@ import kotlin.reflect.full.declaredMemberProperties // TODO: (future additions) -// Allowing the use of regular Minecraft particles instead of just BDEs. - // Will basically require a whole new system. - // Most likely wont ever happen. // Cylinder and cone force field shape. // Copying particle params in-game. // Custom curve equation command args (parse from strings). diff --git a/src/main/kotlin/com/bytedice/bde_particles/DisplayEntity.kt b/src/main/kotlin/com/bytedice/bde_particles/DisplayEntity.kt index ce4695f..ce6604a 100644 --- a/src/main/kotlin/com/bytedice/bde_particles/DisplayEntity.kt +++ b/src/main/kotlin/com/bytedice/bde_particles/DisplayEntity.kt @@ -25,21 +25,6 @@ class DisplayEntity(private var properties: DisplayEntityProperties?) { fun updateProperties(properties: DisplayEntityProperties) { - val customModelRegex = "^([^/]+)(?:/([0-9]+))?$".toRegex() - val matchResult = customModelRegex.find(properties.model) - - val modelName: String - val customModelNum: Int - - if (matchResult != null) { - modelName = matchResult.groupValues[1] - customModelNum = matchResult.groupValues[2].toIntOrNull() ?: 0 - } - else { - modelName = properties.model - customModelNum = 0 - } - val nbt = NbtCompound().apply { val tagList = NbtList() @@ -49,11 +34,11 @@ class DisplayEntity(private var properties: DisplayEntityProperties?) { put("Tags", tagList) - if (modelName != "none") { + if (properties.model != "none") { put("item", NbtCompound().apply { - putString("id", modelName) + putString("id", properties.model) putInt("count", 1) - put("components", NbtCompound().apply { putInt("minecraft:custom_model_data", customModelNum) }) + put("components", NbtCompound().apply { putInt("minecraft:custom_model_data", properties.customModel) }) }) } @@ -89,10 +74,18 @@ class DisplayEntity(private var properties: DisplayEntityProperties?) { putFloat("view_range", properties.viewRange) - if (properties.name != null) { - putString("CustomName", properties.name) + putString("billboard", properties.billboard) + + if (properties.customName != null) { + putString("CustomName", properties.customName) putByte("CustomNameVisible", 1) } + + if (properties.brightnessOverride != null) { + put("brightness", NbtCompound().apply { + putInt("block", properties.brightnessOverride!!) + }) + } } entity?.readNbt(nbt) diff --git a/src/main/kotlin/com/bytedice/bde_particles/DisplayEntityProperties.kt b/src/main/kotlin/com/bytedice/bde_particles/DisplayEntityProperties.kt index bfd984e..be92dfe 100644 --- a/src/main/kotlin/com/bytedice/bde_particles/DisplayEntityProperties.kt +++ b/src/main/kotlin/com/bytedice/bde_particles/DisplayEntityProperties.kt @@ -9,14 +9,25 @@ data class DisplayEntityProperties ( val pos: Vec3d = Vec3d(0.0, 0.0, 0.0), val rot: Vector2f = Vector2f(0.0f, 0.0f), - val model: String = "minecraft:purple_concrete", // end with "/{num}" for custom model - val tags: Array = emptyArray(), + val model: String = "minecraft:purple_concrete", + val customModel: Int = 0, + val tags: Array = emptyArray(), + val viewRange: Float = 2.0f, + var customName: String? = null, + var brightnessOverride: Int? = null, + var billboard: String = Billboard.FIXED, - val translation: Vector3f = Vector3f(-0.5f, -0.5f, -0.5f), + val translation: Vector3f = Vector3f(0.0f, 0.0f, 0.0f), val leftRotation: Vector4f = Vector4f(0.0f, 0.0f, 0.0f, 1.0f), val scale: Vector3f = Vector3f(1.0f, 1.0f, 1.0f), - val rightRotation: Vector4f = Vector4f(0.0f, 0.0f, 0.0f, 1.0f), - - val viewRange: Float = 2.0f, - var name: String? = null + val rightRotation: Vector4f = Vector4f(0.0f, 0.0f, 0.0f, 1.0f) ) + +class Billboard () { + companion object { + const val FIXED: String = "fixed" + const val VERTICAL: String = "vertical" + const val HORIZONTAL: String = "horizontal" + const val CENTER: String = "center" + } +} \ No newline at end of file diff --git a/src/main/kotlin/com/bytedice/bde_particles/particles/ParticleDebug.kt b/src/main/kotlin/com/bytedice/bde_particles/particles/ParticleDebug.kt new file mode 100644 index 0000000..4d21cc3 --- /dev/null +++ b/src/main/kotlin/com/bytedice/bde_particles/particles/ParticleDebug.kt @@ -0,0 +1,4 @@ +package com.bytedice.bde_particles.particles + +class ParticleDebug { +} \ No newline at end of file