Skip to content

Commit

Permalink
Ver 1.0.3
Browse files Browse the repository at this point in the history
✅ New PluginReloadEvent API
🛠 Optimize the structure of codes
  • Loading branch information
L1-An committed Nov 30, 2023
1 parent f5120b2 commit e417dec
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 49 deletions.
41 changes: 12 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,31 @@
name: build
on:
push:
branches:
- main
name: Workflow Build
on: [ push ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v2
- name: cache gradle packages
uses: actions/cache@v2
with:
key: ${{ runner.os }}-build-${{ env.cache-name }}
path: |
~/.gradle/caches
~/.gradle/wrapper
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup jdk 8.0
- name: setup jdk 16.0
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 8.0
java-version: 16.0
- name: make gradle wrapper executable
run: chmod +x ./gradlew
# 第一次构建
- name: build
continue-on-error: true
id: build_1
run: ./gradlew build
# 第二次构建
- name: build (retry 1)
continue-on-error: true
id: build_2
if: steps.build_1.outcome == 'failure'
run: ./gradlew build
# 第三次构建
- name: build (retry 2)
continue-on-error: true
id: build_3
if: steps.build_2.outcome == 'failure'
run: ./gradlew build
# 第四次构建
- name: build (retry 3)
id: build_4
if: steps.build_3.outcome == 'failure'
run: ./gradlew build
# 上传构建文件
- name: capture build artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: build/libs/
path: build/libs/
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
}

configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_14
targetCompatibility = JavaVersion.VERSION_1_8
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
group=com.github.l1an.yuspawnerhologram
version=1.0.2
version=1.0.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.github.l1an.yuspawnerhologram.api.event

import taboolib.platform.type.BukkitProxyEvent

class PluginReloadEvent : BukkitProxyEvent()
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ package com.github.l1an.yuspawnerhologram.internal.command

import com.github.l1an.yuspawnerhologram.internal.command.subcommand.CommandRefresh
import com.github.l1an.yuspawnerhologram.internal.command.subcommand.CommandReload
import org.bukkit.Bukkit
import org.bukkit.entity.Player
import taboolib.common.platform.ProxyCommandSender
import taboolib.common.platform.ProxyPlayer
import taboolib.common.platform.command.CommandBody
import taboolib.common.platform.command.CommandHeader
import taboolib.common.platform.command.mainCommand
import taboolib.common.platform.command.subCommand
import taboolib.common.platform.function.onlinePlayers
import taboolib.common5.Mirror
import taboolib.common5.mirrorNow
import taboolib.expansion.createHelper
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.github.l1an.yuspawnerhologram.internal.command.subcommand

import com.github.l1an.yuspawnerhologram.internal.config.YuSpawnerHologramConfig.config
import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.AdyeshachHologram.refreshHologramByADY
import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.DecentHologram.refreshHologramByDH
import com.github.l1an.yuspawnerhologram.module.adyeshach.AdyeshachHologram.refreshHologramByADY
import com.github.l1an.yuspawnerhologram.module.decentholograms.DecentHologram.refreshHologramByDH
import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.HologramEnter.adyeshach
import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.HologramEnter.decentHolograms
import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.HologramEnter.holographicDisplays
import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.HolographicHologram.refreshHologramByHD
import com.github.l1an.yuspawnerhologram.module.holographicdisplays.HolographicHologram.refreshHologramByHD
import com.github.l1an.yuspawnerhologram.util.Utils
import org.bukkit.command.CommandSender
import taboolib.common.platform.command.subCommand
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.github.l1an.yuspawnerhologram.internal.command.subcommand

import com.github.l1an.yuspawnerhologram.api.event.PluginReloadEvent
import com.github.l1an.yuspawnerhologram.internal.config.YuSpawnerHologramConfig
import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.AdyeshachHologram
import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.DecentHologram
import com.github.l1an.yuspawnerhologram.module.adyeshach.AdyeshachHologram
import com.github.l1an.yuspawnerhologram.module.decentholograms.DecentHologram
import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.HologramEnter
import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.HolographicHologram
import com.github.l1an.yuspawnerhologram.module.holographicdisplays.HolographicHologram
import com.github.l1an.yuspawnerhologram.internal.manager.ConfigManager
import com.github.l1an.yuspawnerhologram.util.Utils
import org.bukkit.command.CommandSender
Expand All @@ -26,6 +27,7 @@ val CommandReload = subCommand {
}
sender.sendLang("command-reload")
ConfigManager.reload()
PluginReloadEvent().call()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ package com.github.l1an.yuspawnerhologram.internal.core

import com.github.l1an.yuspawnerhologram.internal.compat.hook.HookMythicMobs.getSpawnerManager
import com.github.l1an.yuspawnerhologram.internal.config.YuSpawnerHologramConfig.config
import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.AdyeshachHologram.refreshHologramTextByADY
import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.DecentHologram.refreshHologramByDH
import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.DecentHologram.refreshHologramTextByDH
import com.github.l1an.yuspawnerhologram.module.adyeshach.AdyeshachHologram.refreshHologramTextByADY
import com.github.l1an.yuspawnerhologram.module.decentholograms.DecentHologram.refreshHologramTextByDH
import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.HologramEnter.adyeshach
import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.HologramEnter.decentHolograms
import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.HologramEnter.holographicDisplays
import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.HolographicHologram.getHologramTextWithInfo
import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.HolographicHologram.holograms
import com.github.l1an.yuspawnerhologram.module.holographicdisplays.HolographicHologram.getHologramTextWithInfo
import com.github.l1an.yuspawnerhologram.module.holographicdisplays.HolographicHologram.holograms
import com.github.l1an.yuspawnerhologram.internal.util.MythicHologramUtils.getDisplayNameFromConfigs
import com.github.l1an.yuspawnerhologram.util.TimeUtils.secondToFormat
import com.github.l1an.yuspawnerhologram.internal.manager.HologramType.*
Expand All @@ -36,6 +35,9 @@ object HologramUpdateSubmit {
mirrorNow("Refresh HologramText") {
for ((name, hologram) in holograms.entries) {
// 获取刷怪管理器
if (getSpawnerManager(name) == null) {
return@mirrorNow
}
val spawnerManager = getSpawnerManager(name)!!

// 获取所有行
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.github.l1an.yuspawnerhologram.internal.core.mythichologram

import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.AdyeshachHologram.createAllHologramByADY
import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.DecentHologram.createAllHologramByDH
import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.HolographicHologram.createAllHologramByHD
import me.filoghost.holographicdisplays.api.hologram.Hologram
import com.github.l1an.yuspawnerhologram.module.adyeshach.AdyeshachHologram.createAllHologramByADY
import com.github.l1an.yuspawnerhologram.module.decentholograms.DecentHologram.createAllHologramByDH
import com.github.l1an.yuspawnerhologram.module.holographicdisplays.HolographicHologram.createAllHologramByHD
import org.bukkit.Bukkit
import org.bukkit.plugin.Plugin
import taboolib.common.LifeCycle
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.l1an.yuspawnerhologram.internal.core.mythichologram
package com.github.l1an.yuspawnerhologram.module.adyeshach

import com.github.l1an.yuspawnerhologram.internal.compat.hook.HookMythicMobs.getSpawnerManager
import com.github.l1an.yuspawnerhologram.internal.config.YuSpawnerHologramConfig.config
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.l1an.yuspawnerhologram.internal.core.mythichologram
package com.github.l1an.yuspawnerhologram.module.decentholograms

import com.github.l1an.yuspawnerhologram.internal.compat.hook.HookMythicMobs.getSpawnerManager
import com.github.l1an.yuspawnerhologram.internal.config.YuSpawnerHologramConfig.config
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.github.l1an.yuspawnerhologram.internal.core.mythichologram
package com.github.l1an.yuspawnerhologram.module.holographicdisplays

import com.github.l1an.yuspawnerhologram.internal.compat.hook.HookMythicMobs.getSpawnerManager
import com.github.l1an.yuspawnerhologram.internal.config.YuSpawnerHologramConfig.config
import com.github.l1an.yuspawnerhologram.internal.core.mythichologram.HologramEnter
import com.github.l1an.yuspawnerhologram.internal.manager.HologramTextContainer
import com.github.l1an.yuspawnerhologram.internal.manager.HologramType
import com.github.l1an.yuspawnerhologram.internal.util.MythicHologramUtils.getDisplayNameFromConfigs
Expand Down

0 comments on commit e417dec

Please sign in to comment.