aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/features/debug/PowerUserTools.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/features/debug/PowerUserTools.kt')
-rw-r--r--src/main/kotlin/features/debug/PowerUserTools.kt18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/main/kotlin/features/debug/PowerUserTools.kt b/src/main/kotlin/features/debug/PowerUserTools.kt
index 7893eff..dccf8f7 100644
--- a/src/main/kotlin/features/debug/PowerUserTools.kt
+++ b/src/main/kotlin/features/debug/PowerUserTools.kt
@@ -4,6 +4,7 @@ package moe.nea.firmament.features.debug
import net.minecraft.block.SkullBlock
import net.minecraft.block.entity.SkullBlockEntity
+import net.minecraft.client.gui.screen.Screen
import net.minecraft.component.DataComponentTypes
import net.minecraft.entity.Entity
import net.minecraft.entity.LivingEntity
@@ -54,15 +55,16 @@ object PowerUserTools : FirmamentFeature {
}
var lastCopiedStackViewTime = false
- override fun onLoad() {
- TickEvent.subscribe {
- if (!lastCopiedStackViewTime)
- lastCopiedStack = null
- lastCopiedStackViewTime = false
- }
- ScreenChangeEvent.subscribe {
+ @Subscribe
+ fun resetLastCopiedStack(event: TickEvent) {
+ if (!lastCopiedStackViewTime)
lastCopiedStack = null
- }
+ lastCopiedStackViewTime = false
+ }
+
+ @Subscribe
+ fun resetLastCopiedStackOnScreenChange(event: ScreenChangeEvent) {
+ lastCopiedStack = null
}
fun debugFormat(itemStack: ItemStack): Text {