com.lop.devtools.monstera.files.beh.entitiy.description.BehEntityDescScripts.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of monstera Show documentation
Show all versions of monstera Show documentation
A library and environment designed to streamline the development of Minecraft addons.
package com.lop.devtools.monstera.files.beh.entitiy.description
import com.lop.devtools.monstera.addon.api.MonsteraFile
import com.lop.devtools.monstera.addon.api.MonsteraUnsafeMap
import com.lop.devtools.monstera.addon.molang.Molang
import com.lop.devtools.monstera.addon.molang.Query
class BehEntityDescScripts: MonsteraFile {
/**
* unsafe to use variables, used for plugins/ libraries
*/
override val unsafe = Unsafe()
inner class Unsafe: MonsteraUnsafeMap {
/**
* access to all defined data
*/
val general = mutableMapOf()
val animations = arrayListOf()
override fun getData(): MutableMap {
if(unsafe.animations.isNotEmpty()) unsafe.general["animate"] = unsafe.animations
return unsafe.general
}
}
/**
* 0..1
*
* @param anim: List of Strings that activate Animations defined in animations
* @ sample animate(listOf("...","..."))
*/
fun animate(anim: ArrayList) {
unsafe.animations.addAll(anim)
}
fun animate(animation: String, query: Molang = Query.True) {
if(query == Query.True)
unsafe.animations.add(animation)
else
unsafe.animations.add(mutableMapOf(animation to query))
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy