diff --git a/src/main/kotlin/com/lop/devtools/monstera/addon/entity/behaviour/components/OverwriteComponents.kt b/src/main/kotlin/com/lop/devtools/monstera/addon/entity/behaviour/components/OverwriteComponents.kt index c895168..a96c12b 100644 --- a/src/main/kotlin/com/lop/devtools/monstera/addon/entity/behaviour/components/OverwriteComponents.kt +++ b/src/main/kotlin/com/lop/devtools/monstera/addon/entity/behaviour/components/OverwriteComponents.kt @@ -5,6 +5,7 @@ import com.lop.devtools.monstera.addon.sound.Sound import com.lop.devtools.monstera.files.beh.entitiy.BehEntityComponents import com.lop.devtools.monstera.files.beh.entitiy.components.ComponentInventory import com.lop.devtools.monstera.files.beh.entitiy.components.ComponentLoot +import com.lop.devtools.monstera.files.beh.entitiy.components.ComponentRideable import com.lop.devtools.monstera.files.beh.entitiy.events.BehEntityEvent import com.lop.devtools.monstera.files.beh.tables.loot.BehLootTables @@ -13,6 +14,16 @@ interface OverwriteComponents { fun ComponentLoot.table(tableName: String, table: BehLootTables.() -> Unit) + fun ComponentRideable.interactText( + displayName: String? = null, + key: String = "action.interact." + displayName?.replace(" ", "_")?.lowercase() + ) + + fun ComponentRideable.exitText( + displayText: String, + key: String + ) + /** * add a sound to a component * diff --git a/src/main/kotlin/com/lop/devtools/monstera/addon/entity/behaviour/components/OverwriteComponentsImpl.kt b/src/main/kotlin/com/lop/devtools/monstera/addon/entity/behaviour/components/OverwriteComponentsImpl.kt index d4c53c3..036e33e 100644 --- a/src/main/kotlin/com/lop/devtools/monstera/addon/entity/behaviour/components/OverwriteComponentsImpl.kt +++ b/src/main/kotlin/com/lop/devtools/monstera/addon/entity/behaviour/components/OverwriteComponentsImpl.kt @@ -6,6 +6,7 @@ import com.lop.devtools.monstera.addon.sound.SoundData import com.lop.devtools.monstera.files.beh.entitiy.BehEntityComponents import com.lop.devtools.monstera.files.beh.entitiy.components.ComponentInventory import com.lop.devtools.monstera.files.beh.entitiy.components.ComponentLoot +import com.lop.devtools.monstera.files.beh.entitiy.components.ComponentRideable import com.lop.devtools.monstera.files.beh.entitiy.events.BehEntityEvent import com.lop.devtools.monstera.files.beh.tables.loot.BehLootTables import com.lop.devtools.monstera.files.res.sounds.CategorySound @@ -17,6 +18,14 @@ abstract class OverwriteComponentsImpl(override val unsafeParent: Entity) : Over genTable(tableName, unsafeParent.addon, table) } + override fun ComponentRideable.exitText(displayText: String, key: String) { + exitText(displayText, key, unsafeParent.addon.config) + } + + override fun ComponentRideable.interactText(displayName: String?, key: String) { + interactText(displayName, key, unsafeParent.addon.config) + } + override fun BehEntityComponents.sound(data: Sound.() -> Unit): String { val soundData = SoundData(unsafeParent.addon) soundData.category = SoundCategory.NEUTRAL diff --git a/src/main/kotlin/com/lop/devtools/monstera/files/beh/entitiy/components/ComponentRideable.kt b/src/main/kotlin/com/lop/devtools/monstera/files/beh/entitiy/components/ComponentRideable.kt index 13d9fdb..19ddda6 100644 --- a/src/main/kotlin/com/lop/devtools/monstera/files/beh/entitiy/components/ComponentRideable.kt +++ b/src/main/kotlin/com/lop/devtools/monstera/files/beh/entitiy/components/ComponentRideable.kt @@ -72,7 +72,7 @@ class ComponentRideable : MonsteraFile { fun interactText( displayName: String? = null, key: String = "action.interact." + displayName?.replace(" ", "_")?.lowercase(), - config: Config? = null + config: Config? ) { unsafe.general["interact_text"] = key if (displayName != null) @@ -89,7 +89,7 @@ class ComponentRideable : MonsteraFile { fun exitText( displayText: String, key: String, - config: Config? = null + config: Config? ) { setExitText = true config?.langFileBuilder?.addonRes?.add(key, displayText) @@ -117,8 +117,6 @@ class CompSeats { } class CompSeat : MonsteraFile { - val general = mutableMapOf() - override val unsafe = Unsafe() inner class Unsafe : MonsteraUnsafeMap { @@ -142,6 +140,6 @@ class CompSeat : MonsteraFile { var lockRiderRotation: Number? = null fun position(x: Float, y: Float, z: Float) { - general["position"] = arrayListOf(x, y, z) + unsafe.general["position"] = arrayListOf(x, y, z) } } \ No newline at end of file