KotLib
0.2.12A kotlin libraries which included stdlib, reflect, coroutine, exposed and some of my apis
0.2.12latestUpdated Data Configuration with Foreign keyOct 24, 2020 Added Foreign Object Updated config.yml Code (YAML): yaml_warn_if_foreign_key_unknown : false foreign_key_unchangeable : false foreign_key_mode : NULLABLE # or DELETE debug_enabled : false debug_plugins : - KotLib Data Configuration with Foreign Key (NEW EXAMPLE) Code (Kotlin): class KotLibTester : BukkitPlugin ( ) { @DataResource (folder = "Address" ) data class Address ( @PrimaryKey val name : String, val address : String ) : DataFile @DataResource (folder = "School" ) data class School ( @PrimaryKey val name : String, @ForeignKey (Address :: class ) var locate : String ?, @ForeignObject var address : Address ? = null ) : DataFile class AddressController (dao : Dao <Address, String > ) : Dao <Address, String > by dao class SchoolController (dao : Dao <School, String > ) : Dao <School, String > by dao override fun enable ( ) { val manager = KotLib. getConfigFactory ( this ) . registerDao (Address :: class, AddressController :: class ) . registerDao (School :: class, SchoolController :: class ) . dump ( ) val addressController = manager. getDao (AddressController :: class ) val schoolController = manager. getDao (SchoolController :: class ) addressController. save { Address ( "A", "city A, HK" ) } addressController. save { Address ( "B", "city B, HK" ) } addressController. save { Address ( "C", "city C HK" ) } schoolController. save { School ( "A school", "A" ) } schoolController. save { School ( "B school", "B" ) } schoolController. save { School ( "C school", "C" ) } // Normal kLogger. info ( "=== Test 1 ===" ) schoolController. findAll ( ). forEach { s -> kLogger. info (s. toString ( ) ) } schoolController. update ( "A school" ) { locate = "C" } // Changed foreign key kLogger. info ( "=== Test 2 ===" ) schoolController. findAll ( ). forEach { s -> kLogger. info (s. toString ( ) ) } addressController. delete ( "B" ) // Removed address B kLogger. info ( "=== Test 3 ===" ) schoolController. findAll ( ). forEach { s -> kLogger. info (s. toString ( ) ) } schoolController. update ( "C school" ) { locate = null } // Removed foreign key kLogger. info ( "=== Test 4 ===" ) schoolController. findAll ( ). forEach { s -> kLogger. info (s. toString ( ) ) } } } Result:0.2.11Added notifyUnpaid methodSep 29, 2020 - Added notifyUnpaid method Code (Kotlin): notifyUnPaid ( "you haven't paid the {0} version {1} plugin !", "click the text to check author github!", "https://github.com/mygithub" ) - stopped 1.12 support - update jackson core version to 2.11.20.2.9.1Added asyncTransection and runAsyncSep 1, 2020 Code (Kotlin): runAsync { println ( "hello world" ) }. thenSync { println ( "finished" ) }. catch { e -> e. printStackTrace ( ) }. finally { println ( "done" ) }0.2.9-kotlin-updateKotlin libraries version updated to 1.4.0Aug 29, 2020 Kotlin libraries version updated to 1.4.00.2.9Added Support 1.12 ~ 1.14Jul 25, 2020 Added Support for 1.12 ~ 1.140.2.8Upgrade as belowJul 19, 2020 1. upgrade kotlin version to v1.3.72 2. upgrade jackson-databind to v2.11.00.2.7.9An Interim version fixing a lots of bugsApr 16, 2020 - Fixed the mostly DAO problems - Fixed the string format problem - And more0.2.6Kotlin libraries updated to 1.3.70Mar 15, 2020 Kotlin libraries updated to 1.3.700.2.4Update as belowFeb 24, 2020 1. deleted old api version 2. added null handling for map/collection to empty list / map 3. now the config can access all fields now (including private/protected)0.2.3Support 1.12 itemstackFeb 19, 2020 Support 1.12 itemstack library0.2.2Fixed CommandSender in BigCommand cannot cast to PlayerFeb 17, 2020 Fixed CommandSender in BigCommand cannot cast to Player0.2.1added as followingFeb 7, 2020 · added Foreign Key for data linkage · debug utils · config.yml for some settings Data Configuration with Foreign Key Code (Kotlin): override fun enable ( ) { val manager = KotLib. getConfigFactory ( this ) . registerDao (kClassOf ( ), StudentController :: class ) . registerDao (kClassOf ( ), SchoolController :: class ) . registerDao (kClassOf ( ), AddressController :: class ) . dump ( ) val studentController : StudentController = manager. getDao (kClassOf ( ) ) val schoolController : SchoolController = manager. getDao (kClassOf ( ) ) val addressController : AddressController = manager. getDao (kClassOf ( ) ) debug ( "This is a debug message!!!!!!" ) val testCommands = object : BukkitCommand ( name = "test", description = "test commands", child = arrayOf ( BukkitCommand ( name = "student", description = "student commands", child = arrayOf ( BukkitCommand ( name = "add", description = "add student", placeholders = arrayOf ( "name", "school", "address" ) ) { commandSender, strings -> val id = studentController. save { Student (UUID. randomUUID ( ), strings [ 0 ], strings [ 1 ], strings [ 2 ] ) } commandSender. sendMessage ( "saved id: $id" ) }, BukkitCommand ( name = "remove", description = "remove student", placeholders = arrayOf ( "name" ) ) {commandSender, strings -> val list = studentController. deleteSome { name == strings [ 0 ] } commandSender. sendMessage ( "Deleted: $list" ) } ) ), BukkitCommand ( name = "address", description = "address commands", child = arrayOf ( BukkitCommand ( name = "add", description = "add address", placeholders = arrayOf ( "name", "population" ) ) {commandSender, strings -> val population = strings [ 1 ]. toIntOrNull ( ) ?: return@BukkitCommand val id = addressController. save { Address (strings [ 0 ], population ) } commandSender. sendMessage ( "saved id: $id" ) }, BukkitCommand ( name = "remove", description = "remove address", placeholders = arrayOf ( "name" ) ) {commandSender, strings -> val b = addressController. delete (strings [ 0 ] ) commandSender. sendMessage ( "deleted: $b" ) } ) ), BukkitCommand ( name = "school", description = "school commands", child = arrayOf ( BukkitCommand ( name = "add", description = "add school", placeholders = arrayOf ( "name", "band", "address" ) ) {commandSender, strings -> val band = strings [ 1 ]. toIntOrNull ( ) ?: return@BukkitCommand val id = schoolController. save { School (strings [ 0 ], band, strings [ 2 ] ) } commandSender. sendMessage ( "saved id: $id" ) }, BukkitCommand ( name = "remove", description = "remove school", placeholders = arrayOf ( "name" ) ) { commandSender, strings -> val b = schoolController. delete (strings [ 0 ] ) commandSender. sendMessage ( "deleted: $b" ) } ) ) ) ) { } registerCmd (testCommands ) } @DataResource (folder = "Students" ) data class Student (@PrimaryKey val id : UUID, var name : String, @ForeignKey (School :: class ) val school : String, @ForeignKey (Address :: class ) val address : String ) : DataFile @DataResource (folder = "Schools" ) data class School (@PrimaryKey val name : String, var band : Int, @ForeignKey (Address :: class0.2.0Fixed plugin cannot run in bungeecordFeb 2, 2020 Fixed plugin cannot run in bungeecord0.1.9update bungeecommand that child is not optional parameterFeb 1, 2020 update bungeecommand that child is not optional parameter0.1.8update followingJan 30, 2020 · added exposed SQL syntax: insertUpdate · added some small utils in extension0.1.7Update as belowJan 18, 2020 · Added optional placeholders for BigCommand · Now parent permission will affect for sub commands0.1.6Changed single pool sql datasource to hikariCPJan 13, 2020 Changed single pool sql datasource to hikariCP latest sql.yml Code (YAML): single_pool_enable : false data_source : "mysql" driver : "com.mysql.jdbc.Driver" host : "localhost" port : 3306 database : "database" username : "username" password : "password" use_ssl : false pool: name : KotLib min_size : 5 max_size : 10 connection_timeout : 30000 idle_timeout : 60000 max_life_time : 600000 # jdbc:mysql://localhost:3306/database the api version is still 0.1.50.1.5Added consume event and click event from itemStack(), removed continueEditJan 11, 2020 feature as below0.1.4New Features about createUIJan 11, 2020 new features as below · fills feature · (row 0 ~ 6) row (slot 1 ~ 9) function · CHANGED SLOTS TO ROWS, SO 54 SHOULD BE 60.1.3fix linkJan 11, 2020 fix link0.1.2DAO pattern finishedJan 10, 2020 You can check the example usage from overview0.1.1Added DAO which can access from data poolJan 10, 2020 Added DAO which can access from data pool Code (Kotlin): interface Dao < out T : DataFile, in V : Comparable <V >> { fun findAll ( ) : List <T > fun findById (id : V ) : T ? fun find (filter : T. ( ) -> Boolean ) : List <T > fun update (id : V, update : T. ( ) -> Unit ) : T ? fun delete (id : V ) }0.1.0Fixed the followingJan 9, 2020 · fixed plugin enabling error · ConfigORM now can work with kotlin data class, all features same as ConfigDTOunstableUNSTABLE VERSION, PLZ WAIT FOR FUTHER UPDATEJan 9, 2020 UNSTABLE VERSION, PLZ WAIT FOR FUTHER UPDATE0.0.9Restructure my apis, other libraries unchangedJan 9, 2020 · Added APIs from CondigDTO (edition for support both bungee and spigot) · Removed old config api which using delegate · change the logic of Command Api · added getConfigFactory but removed getConfigSection · ALL INBUILT CONFIG PATH REPLACE "-" TO "_"0.0.7Fixed bigcommand invoke problemJan 9, 2020 Fixed bigcommand invoke problem0.0.6fixed missed linkJan 8, 2020 fixed missed link0.0.5Added more APIJan 8, 2020 · ItemStack utils · Inventory utils · BigCommand utils · now this plugin can both run on bungee and spigot0.0.4See the followingJan 8, 2020 · Restructured the module · Added single pool transaction (initialize pool from sql.yml) · Added KBoolean and KPrimitive0.0.3Jan 8, 2020
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta