Skip to content

Commit

Permalink
[A.0.0.2.7] Update
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFloodDragon committed Aug 22, 2023
1 parent 7dcc143 commit 2ca6b21
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Configuration.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import java.text.SimpleDateFormat

const val rootName = "FDUtilities"
const val rootGroup = "cn.fd.utilities"
const val rootVersion = "A.0.0.2.6"
const val rootVersion = "A.0.0.2.7"

const val kotlinVersion = "1.8.20"
const val shadowJarVersion = "8.1.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,19 @@ class ElementRegister : ClassVisitor(0) {
if (clazz.isAnnotationPresent(NewElement::class.java) && ElementHandler::class.java.isAssignableFrom(clazz)) {
val anno = clazz.getAnnotation(NewElement::class.java)
try {
/**
* 处理器
*/
val handler =
if (instance == null)
clazz.asSubclass(ElementHandler::class.java).getInstance(true)!!.get()
else instance.get() as ElementHandler
/**
* 注册
*/
ElementService.registerElementType(
space = anno.space,
name = anno.name,
alias = anno.alias.toSet(),
handler = handler
/**
* 处理器
*/
handler = if (instance == null)
clazz.asSubclass(ElementHandler::class.java).getInstance(true)!!.get()
else instance.get() as ElementHandler
)
} catch (e: Exception) {
e.printStackTrace()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ open class HashMapMemory<K, V> : Memory {
/**
* 加入到容器
*/
protected fun addToMemory(key: K, value: V) {
fun addToMemory(key: K, value: V) {
memory[key] = value
}

/**
* 从容器中删除
*/
protected fun removeFromMemory(key: K) {
fun removeFromMemory(key: K) {
memory.remove(key)
}

/**
* 清空容器
*/
protected fun clearMemory() {
fun clearMemory() {
memory.clear()
}

Expand Down

0 comments on commit 2ca6b21

Please sign in to comment.