Skip to content

Commit

Permalink
🐛 fix(ClientHandler): 添加持续事件
Browse files Browse the repository at this point in the history
  • Loading branch information
wangziwenhk committed Aug 2, 2024
1 parent 2c40f0c commit b263128
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/main/kotlin/org/thirdTune/apex_extra/ApexExtra.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class ApexExtra {
companion object{
const val MOD_ID = "apex_extra"
const val MOD_NAME = "Apex Extra"
var nearPlayerHighLight = false
}
init{
init()
Expand Down
3 changes: 1 addition & 2 deletions src/main/kotlin/org/thirdTune/apex_extra/ClientHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ package org.thirdTune.apex_extra
import net.minecraft.client.Minecraft
import net.minecraft.world.entity.player.Player
import net.minecraftforge.event.TickEvent
import org.thirdTune.apex_extra.ApexExtra.Companion.nearPlayerHighLight

object ClientHandler {

var nearPlayerHighLight = false
fun onClientTick(event: TickEvent.ClientTickEvent) {
if(event.phase != TickEvent.Phase.START)return
val mc = Minecraft.getInstance()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.Item
import net.minecraft.world.item.ItemStack
import net.minecraft.world.level.Level
import org.thirdTune.apex_extra.ApexExtra
import org.thirdTune.apex_extra.ClientHandler

class AllfatherEye : Item(Properties()) {
// 持续时间 (秒)
Expand All @@ -31,7 +31,7 @@ class AllfatherEye : Item(Properties()) {
selectedIndex: Int
) {
if (showTime == 0) {
ApexExtra.nearPlayerHighLight = false
ClientHandler.nearPlayerHighLight = false
} else {
showTime--
}
Expand Down

0 comments on commit b263128

Please sign in to comment.