Skip to content

Commit 3d566c7

Browse files
committed
fix: set player health to zero if player attempts to use picksaw on disallowed worlds
1 parent 785c4d5 commit 3d566c7

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99
}
1010

1111
group = "net.azisaba"
12-
version = "6.20.6+1.15.2"
12+
version = "6.20.7+1.15.2"
1313

1414
java {
1515
toolchain.languageVersion.set(JavaLanguageVersion.of(11))

src/main/java/com/github/mori01231/lifecore/listener/item/PicksawItemListener.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ class PicksawItemListener(private val dataLoader: DataLoader) : Listener {
1717

1818
@EventHandler
1919
fun onPlayerInteract(e: PlayerInteractEvent) {
20-
if (e.player.world.name != "art" && !e.player.hasPermission("lifecore.picksaw")) return
20+
if (e.player.world.name != "art" && !e.player.hasPermission("lifecore.picksaw")) {
21+
e.player.health = 0.0
22+
return
23+
}
2124
if (e.hand != EquipmentSlot.HAND) return
2225
if (e.action != Action.LEFT_CLICK_BLOCK) return
2326
val item = e.player.inventory.itemInMainHand

0 commit comments

Comments
 (0)