Skip to content

Commit

Permalink
Merge pull request #6 from TaleShenHua/master
Browse files Browse the repository at this point in the history
支持Pouvoir-1.6.5-4
  • Loading branch information
Glomzzz authored Dec 8, 2023
2 parents d766cba + 52f0049 commit bb73ae7
Show file tree
Hide file tree
Showing 106 changed files with 493 additions and 506 deletions.
16 changes: 10 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import java.net.URL
plugins {
`java-library`
`maven-publish`
id("io.izzel.taboolib") version "1.51"
id("org.jetbrains.kotlin.jvm") version "1.6.10"
id("org.jetbrains.dokka") version "1.6.10"
id("io.izzel.taboolib") version "1.56"
id("org.jetbrains.kotlin.jvm") version "1.7.20"
id("org.jetbrains.dokka") version "1.7.20"
}


Expand Down Expand Up @@ -71,7 +71,7 @@ taboolib {
install("platform-bukkit")
install("module-nms")
classifier = null
version = "6.0.10-38"
version = "6.0.12-34"
}

repositories {
Expand All @@ -82,8 +82,12 @@ repositories {

dependencies {
dokkaHtmlPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:1.6.10")
compileOnly("com.google.code.gson:gson:2.9.0")

compileOnly("ink.ptms:nms-all:1.0.0")
compileOnly("ink.ptms.core:v11900:11900:mapped")
compileOnly("ink.ptms.core:v11900:11900:universal")
compileOnly("ink.ptms.core:v11200:11200")

compileOnly("io.lumine:Mythic-Dist:5.0.3")
compileOnly("com.github.LoneDev6:api-itemsadder:3.0.0")

Expand Down Expand Up @@ -128,4 +132,4 @@ publishing {
groupId = project.group.toString()
}
}
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
group=com.skillw.itemsystem
version=1.0.4
version=2.0.0
Binary file removed libs/AttributeSystem-1.4.4-gamma-code.jar
Binary file not shown.
Binary file added libs/AttributeSystem-2.1.0-gamma-7-api.jar
Binary file not shown.
Binary file removed libs/BuffSystem-1.1.3-code.jar
Binary file not shown.
Binary file added libs/BuffSystem-1.2.0-alpha-3-api.jar
Binary file not shown.
Binary file removed libs/Pouvoir-1.6.0-A-api.jar
Binary file not shown.
Binary file added libs/Pouvoir-1.6.5-4-api.jar
Binary file not shown.
6 changes: 2 additions & 4 deletions src/main/kotlin/com/skillw/itemsystem/ItemSystem.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ package com.skillw.itemsystem

import com.skillw.itemsystem.api.manager.*
import com.skillw.itemsystem.internal.manager.ISConfig
import com.skillw.pouvoir.api.annotation.PouManager
import com.skillw.pouvoir.api.manager.ManagerData
import com.skillw.pouvoir.api.plugin.SubPouvoir
import com.skillw.pouvoir.api.thread.BasicThreadFactory
import com.skillw.pouvoir.api.plugin.annotation.PouManager
import org.bukkit.plugin.java.JavaPlugin
import taboolib.common.platform.Plugin
import taboolib.module.configuration.Config
import taboolib.module.configuration.ConfigFile
import taboolib.platform.BukkitPlugin
import java.util.concurrent.ScheduledThreadPoolExecutor

object ItemSystem : Plugin(), SubPouvoir {

Expand Down Expand Up @@ -74,4 +72,4 @@ object ItemSystem : Plugin(), SubPouvoir {
disable()
}

}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.skillw.itemsystem.api.action

import com.skillw.itemsystem.ItemSystem
import com.skillw.pouvoir.api.able.Registrable
import com.skillw.pouvoir.api.plugin.map.component.Registrable

class ActionType(override val key: String) : Registrable<String> {

override fun register() {
ItemSystem.actionTypeManager.register(this)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.skillw.itemsystem.api.builder

import com.skillw.itemsystem.internal.core.builder.ProcessData
import com.skillw.itemsystem.internal.core.meta.data.MetaData
import com.skillw.pouvoir.api.able.Registrable
import com.skillw.pouvoir.api.plugin.map.component.Registrable
import org.bukkit.configuration.serialization.ConfigurationSerializable
import org.bukkit.entity.LivingEntity
import org.bukkit.inventory.ItemStack
Expand Down Expand Up @@ -34,4 +34,4 @@ abstract class BaseItemBuilder(override val key: String) : Registrable<String>,
*/
abstract fun build(entity: LivingEntity? = null, processData: ProcessData = ProcessData(entity)): ItemStack

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ interface IProcessData {
* @return 结果
*/
fun result(receiver: ProcessData.() -> Unit): ItemStack
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ItemBuildEvent {
* @property data 过程数据
* @property entity 实体
*/
class Post(val builder: BaseItemBuilder, val data: ProcessData, val entity: LivingEntity?) : BukkitProxyEvent()
class Pre(val builder: BaseItemBuilder, val data: ProcessData, val entity: LivingEntity?) : BukkitProxyEvent()

/**
* 构建物品中,Meta已经运行完毕,下一步就是构建物品
Expand All @@ -38,7 +38,7 @@ class ItemBuildEvent {
* @property itemStack 结果物品
* @property entity 实体
*/
class After(
class Post(
val builder: BaseItemBuilder,
val data: ProcessData,
var itemStack: ItemStack,
Expand All @@ -58,4 +58,4 @@ class ItemBuildEvent {
var itemStack: ItemStack,
val entity: LivingEntity,
) : BukkitProxyEvent()
}
}
6 changes: 3 additions & 3 deletions src/main/kotlin/com/skillw/itemsystem/api/glow/GlowColor.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.skillw.itemsystem.api.glow

import com.skillw.itemsystem.util.nms.NMS
import com.skillw.pouvoir.api.able.Registrable
import com.skillw.pouvoir.api.map.KeyMap
import com.skillw.pouvoir.api.plugin.map.KeyMap
import com.skillw.pouvoir.api.plugin.map.component.Registrable
import org.bukkit.ChatColor
import org.bukkit.entity.Entity
import org.bukkit.entity.Player
Expand Down Expand Up @@ -76,4 +76,4 @@ class GlowColor(override val key: ChatColor) : Registrable<ChatColor> {
override fun register() {
glowColors.register(this)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.skillw.itemsystem.api.manager

import com.skillw.itemsystem.api.action.ActionType
import com.skillw.pouvoir.api.manager.Manager
import com.skillw.pouvoir.api.map.LowerKeyMap
import com.skillw.pouvoir.api.plugin.map.LowerKeyMap
import org.bukkit.entity.LivingEntity
import org.bukkit.inventory.ItemStack

Expand All @@ -28,4 +28,4 @@ abstract class ActionTypeManager : Manager, LowerKeyMap<ActionType>() {
itemStack: ItemStack,
receiver: MutableMap<String, Any>.() -> Unit,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.skillw.itemsystem.api.manager

import com.skillw.itemsystem.internal.core.meta.data.MetaData
import com.skillw.pouvoir.api.manager.Manager
import com.skillw.pouvoir.api.map.BaseMap
import com.skillw.pouvoir.api.plugin.map.BaseMap

/**
* @className GlobalManager
Expand All @@ -12,4 +12,4 @@ import com.skillw.pouvoir.api.map.BaseMap
* @author Glom
* @date 2022/8/7 7:20 Copyright 2022 user. All rights reserved.
*/
abstract class GlobalManager : Manager, BaseMap<String, MetaData>()
abstract class GlobalManager : Manager, BaseMap<String, MetaData>()
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.skillw.itemsystem.api.manager

import com.skillw.itemsystem.api.builder.BaseItemBuilder
import com.skillw.pouvoir.api.manager.Manager
import com.skillw.pouvoir.api.map.KeyMap
import com.skillw.pouvoir.api.plugin.map.KeyMap
import org.bukkit.configuration.ConfigurationSection
import java.io.File

Expand All @@ -18,4 +18,4 @@ abstract class ItemBuilderManager : Manager, KeyMap<String, BaseItemBuilder>() {
/** 物品构造器的Yaml文件 */
abstract val files: Set<File>
abstract val loading: MutableSet<ConfigurationSection>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.skillw.itemsystem.api.manager

import com.skillw.itemsystem.api.meta.BaseMeta
import com.skillw.pouvoir.api.manager.Manager
import com.skillw.pouvoir.api.map.KeyMap
import com.skillw.pouvoir.api.plugin.map.KeyMap

/**
* @className MetaManager
Expand All @@ -14,4 +14,4 @@ import com.skillw.pouvoir.api.map.KeyMap
*/
abstract class MetaManager : Manager, KeyMap<String, BaseMeta>() {
abstract val sortedMetas: List<BaseMeta>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package com.skillw.itemsystem.api.manager
import com.skillw.itemsystem.ItemSystem
import com.skillw.itemsystem.api.builder.BaseItemBuilder
import com.skillw.itemsystem.api.option.BaseOption
import com.skillw.itemsystem.internal.core.option.OptionType
import com.skillw.pouvoir.api.manager.Manager
import com.skillw.pouvoir.api.map.KeyMap
import com.skillw.pouvoir.api.plugin.SubPouvoir
import com.skillw.pouvoir.api.plugin.map.KeyMap
import org.bukkit.configuration.ConfigurationSection

/**
Expand All @@ -17,6 +18,7 @@ import org.bukkit.configuration.ConfigurationSection
* @date 2022/10/7 19:39 Copyright 2022 user. All rights reserved.
*/
object OptionManager : Manager, KeyMap<String, BaseOption>() {
private fun readResolve(): Any = OptionManager
override val key: String = "OptionManager"
override val priority: Int = 1
override val subPouvoir: SubPouvoir = ItemSystem
Expand All @@ -26,4 +28,9 @@ object OptionManager : Manager, KeyMap<String, BaseOption>() {
it.init(section, builder)
}
}
}

override fun onReload() {
OptionType.types.clear()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.skillw.itemsystem.api.manager
import com.skillw.itemsystem.api.meta.data.Memory
import com.skillw.itemsystem.api.vartype.VariableType
import com.skillw.pouvoir.api.manager.Manager
import com.skillw.pouvoir.api.map.KeyMap
import com.skillw.pouvoir.api.plugin.map.KeyMap
import java.util.function.Supplier

/**
Expand All @@ -25,4 +25,4 @@ abstract class VarTypeManager : Manager, KeyMap<String, VariableType>() {
* @return
*/
abstract fun createVar(memory: Memory): Supplier<Any>?
}
}
4 changes: 2 additions & 2 deletions src/main/kotlin/com/skillw/itemsystem/api/meta/BaseMeta.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.skillw.itemsystem.api.builder.ItemData
import com.skillw.itemsystem.api.meta.data.Memory
import com.skillw.itemsystem.internal.core.builder.ProcessData
import com.skillw.itemsystem.internal.core.meta.data.MetaData
import com.skillw.pouvoir.api.able.Registrable
import com.skillw.pouvoir.api.plugin.map.component.Registrable

/**
* @className BaseMeta
Expand Down Expand Up @@ -55,4 +55,4 @@ abstract class BaseMeta(override val key: String) : Registrable<String>, Compara
override fun register() {
ItemSystem.metaManager.register(this)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.skillw.itemsystem.api.meta.data

import com.skillw.itemsystem.api.meta.BaseMeta
import com.skillw.itemsystem.internal.core.meta.data.MetaData
import com.skillw.pouvoir.api.able.Keyable
import com.skillw.pouvoir.api.plugin.map.component.Keyable
import org.bukkit.configuration.serialization.ConfigurationSerializable

/**
Expand All @@ -19,4 +19,4 @@ interface IMetaData : Keyable<BaseMeta>, ConfigurationSerializable {
* @return 元数据
*/
fun clone(): MetaData
}
}
22 changes: 11 additions & 11 deletions src/main/kotlin/com/skillw/itemsystem/api/meta/data/Memory.kt
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ data class Memory(val metaData: MetaData, val processData: ProcessData) : IMetaD
* @return
*/
internal fun getAny(key: String, processData: ProcessData): Any? {
return (metaData.get(key) ?: processData[key])
return (metaData[key] ?: processData[key])
}

/**
Expand All @@ -273,7 +273,7 @@ data class Memory(val metaData: MetaData, val processData: ProcessData) : IMetaD
* @return
*/
internal fun getList(key: String, processData: ProcessData): List<Any>? {
return ((metaData.get(key) ?: processData[key]) as? List<Any>?)?.map { it.analysis() }
return ((metaData[key] ?: processData[key]) as? List<Any>?)?.map { it.analysis() }
}

/**
Expand All @@ -284,7 +284,7 @@ data class Memory(val metaData: MetaData, val processData: ProcessData) : IMetaD
* @return
*/
internal fun getShort(key: String, processData: ProcessData): Short? {
return Coerce.toShort((metaData.get(key) ?: processData[key] ?: return null).analysis())
return Coerce.toShort((metaData[key] ?: processData[key] ?: return null).analysis())
}

/**
Expand All @@ -295,7 +295,7 @@ data class Memory(val metaData: MetaData, val processData: ProcessData) : IMetaD
* @return
*/
internal fun getByte(key: String, processData: ProcessData): Byte? {
return Coerce.toByte((metaData.get(key) ?: processData[key] ?: return null).analysis())
return Coerce.toByte((metaData[key] ?: processData[key] ?: return null).analysis())
}

/**
Expand All @@ -306,7 +306,7 @@ data class Memory(val metaData: MetaData, val processData: ProcessData) : IMetaD
* @return
*/
internal fun getBoolean(key: String, processData: ProcessData): Boolean? {
return Coerce.toBoolean((metaData.get(key) ?: processData[key] ?: return null).analysis())
return Coerce.toBoolean((metaData[key] ?: processData[key] ?: return null).analysis())
}

/**
Expand All @@ -317,7 +317,7 @@ data class Memory(val metaData: MetaData, val processData: ProcessData) : IMetaD
* @return
*/
internal fun getDouble(key: String, processData: ProcessData): Double? {
return Coerce.toDouble((metaData.get(key) ?: processData[key] ?: return null).analysis())
return Coerce.toDouble((metaData[key] ?: processData[key] ?: return null).analysis())
}

/**
Expand All @@ -328,7 +328,7 @@ data class Memory(val metaData: MetaData, val processData: ProcessData) : IMetaD
* @return
*/
internal fun getFloat(key: String, processData: ProcessData): Float? {
return Coerce.toFloat((metaData.get(key) ?: processData[key] ?: return null).analysis())
return Coerce.toFloat((metaData[key] ?: processData[key] ?: return null).analysis())
}

/**
Expand All @@ -339,7 +339,7 @@ data class Memory(val metaData: MetaData, val processData: ProcessData) : IMetaD
* @return
*/
internal fun getLong(key: String, processData: ProcessData): Long? {
return Coerce.toLong((metaData.get(key) ?: processData[key] ?: return null).analysis())
return Coerce.toLong((metaData[key] ?: processData[key] ?: return null).analysis())
}

/**
Expand All @@ -350,7 +350,7 @@ data class Memory(val metaData: MetaData, val processData: ProcessData) : IMetaD
* @return
*/
internal fun getInt(key: String, processData: ProcessData): Int? {
return Coerce.toInteger((metaData.get(key) ?: processData[key] ?: return null).analysis())
return Coerce.toInteger((metaData[key] ?: processData[key] ?: return null).analysis())
}

/**
Expand All @@ -361,6 +361,6 @@ data class Memory(val metaData: MetaData, val processData: ProcessData) : IMetaD
* @return
*/
internal fun getString(key: String, processData: ProcessData): String? {
return (metaData.get(key) ?: processData[key] ?: return null).analysis().toString()
return (metaData[key] ?: processData[key] ?: return null).analysis().toString()
}
}
}
Loading

0 comments on commit bb73ae7

Please sign in to comment.