Add ConfigManager and fix bugs(now it works)
Tested on 1.12.2 (may work on 1.9-1.12)
- Config files are in "plugins/SuperItem/configs' with the name "{ItemPackage} : {item}.json"
- Now Superitem Script(superitem.kts) works
//example as Flame_Axe.superitem.kts
import org.bukkit.Material
import org.bukkit.enchantments.Enchantment
import org.bukkit.entity.Player
import org.bukkit.event.EventHandler
import org.bukkit.event.EventPriority
import org.bukkit.event.entity.EntityDamageByEntityEvent
require(ItemInfo(Material.IRON_AXE, "§4FLAMES AXE", listOf("§3 Use wisely")) { im, _ ->
im.addEnchant(Enchantment.FIRE_ASPECT, 2, false)
im.addEnchant(Enchantment.DAMAGE_ALL, 4, false)
})
require(CoolDown(600))
require(Recipe("2@0;377;399;377;258;377;399;377;0"))
listen<EntityDamageByEntityEvent>(priority = EventPriority.HIGHEST){e->
if (e.damager is Player) {
val p = e.damager as Player
if (isItem(p.inventory.itemInMainHand)) {
if (get<Permission>().hasPermission(p) && get<CoolDown>().isCoolDownOK(p)) {
get<CoolDown>().add(p)
} else
e.damage = 1.0
}
}
}