diff --git a/build.gradle.kts b/build.gradle.kts index f0fb580..6ff54b7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,7 +25,6 @@ dependencies { compileOnly(idofrontLibs.kotlinx.coroutines) compileOnly(idofrontLibs.minecraft.mccoroutine) compileOnly(libs.geary.papermc) - compileOnly(libs.bonehurtingjuice) implementation(idofrontLibs.bundles.idofront.core) implementation(idofrontLibs.idofront.nms) diff --git a/gradle.properties b/gradle.properties index cc15a56..40232d0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ group=com.mineinabyss version=0.22 -idofrontVersion=0.23.0 +idofrontVersion=0.24.0-dev.8 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5d6c43a..937cd01 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -geary = "0.29.0" +geary = "0.30.1-dev.10" bonehurtingjuice = "1.10.1" [libraries] diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e411586..48c0a02 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index eaecede..dce2f3c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -2,7 +2,9 @@ pluginManagement { repositories { gradlePluginPortal() maven("https://repo.mineinabyss.com/releases") + maven("https://repo.mineinabyss.com/snapshots") maven("https://repo.papermc.io/repository/maven-public/") + mavenLocal() google() } @@ -19,8 +21,9 @@ dependencyResolutionManagement { val idofrontVersion: String by settings repositories { - mavenLocal() maven("https://repo.mineinabyss.com/releases") + maven("https://repo.mineinabyss.com/snapshots") + mavenLocal() } versionCatalogs { diff --git a/src/main/kotlin/com/mineinabyss/staminaclimb/climbing/ClimbBehaviour.kt b/src/main/kotlin/com/mineinabyss/staminaclimb/climbing/ClimbBehaviour.kt index aff3893..8953cb7 100644 --- a/src/main/kotlin/com/mineinabyss/staminaclimb/climbing/ClimbBehaviour.kt +++ b/src/main/kotlin/com/mineinabyss/staminaclimb/climbing/ClimbBehaviour.kt @@ -1,28 +1,21 @@ package com.mineinabyss.staminaclimb.climbing -import com.mineinabyss.idofront.messaging.broadcast import com.mineinabyss.staminaclimb.* import com.mineinabyss.staminaclimb.modules.stamina import com.mineinabyss.staminaclimb.stamina.StaminaBar import com.mineinabyss.staminaclimb.stamina.removeProgress import org.bukkit.GameMode import org.bukkit.Material -import org.bukkit.Tag -import org.bukkit.block.BlockFace import org.bukkit.entity.Player import org.bukkit.event.EventHandler -import org.bukkit.event.EventPriority import org.bukkit.event.Listener import org.bukkit.event.block.Action import org.bukkit.event.block.BlockBreakEvent import org.bukkit.event.block.BlockPlaceEvent -import org.bukkit.event.entity.EntityDamageEvent import org.bukkit.event.player.PlayerAnimationEvent import org.bukkit.event.player.PlayerInteractEvent -import org.bukkit.event.player.PlayerMoveEvent import org.bukkit.inventory.EquipmentSlot import org.bukkit.util.Vector -import org.cultofclang.bonehurtingjuice.hurtBones import java.util.* import java.util.concurrent.ConcurrentHashMap @@ -42,18 +35,18 @@ object ClimbBehaviour : Listener { isClimbing.remove(uuid) } - private val climbableMap = mutableMapOf() - @EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST) - fun PlayerMoveEvent.onScaleDownClimbable() { - if (!hasExplicitlyChangedBlock() || !player.isInClimbableBlock) return - - val block = player.location.block - val increase = if (block.type == Material.SCAFFOLDING || !player.climbEnabled || !player.uniqueId.canClimb) 1 else 0 - climbableMap.compute(player.uniqueId) { _, v -> (v ?: 0).toFloat() + increase } - if (block.getRelative(BlockFace.DOWN).type in Tag.CLIMBABLE.values) return - player.hurtBones(climbableMap[player.uniqueId] ?: 0f) - climbableMap.remove(player.uniqueId) - } +// private val climbableMap = mutableMapOf() +// @EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST) +// fun PlayerMoveEvent.onScaleDownClimbable() { +// if (!hasExplicitlyChangedBlock() || !player.isInClimbableBlock) return +// +// val block = player.location.block +// val increase = if (block.type == Material.SCAFFOLDING || !player.climbEnabled || !player.uniqueId.canClimb) 1 else 0 +// climbableMap.compute(player.uniqueId) { _, v -> (v ?: 0).toFloat() + increase } +// if (block.getRelative(BlockFace.DOWN).type in Tag.CLIMBABLE.values) return +// player.hurtBones(climbableMap[player.uniqueId] ?: 0f) +// climbableMap.remove(player.uniqueId) +// } @EventHandler fun BlockPlaceEvent.onBlockPlace() { diff --git a/src/main/kotlin/com/mineinabyss/staminaclimb/nms/Tags.kt b/src/main/kotlin/com/mineinabyss/staminaclimb/nms/Tags.kt index e6fc713..e3442da 100644 --- a/src/main/kotlin/com/mineinabyss/staminaclimb/nms/Tags.kt +++ b/src/main/kotlin/com/mineinabyss/staminaclimb/nms/Tags.kt @@ -6,11 +6,10 @@ import it.unimi.dsi.fastutil.ints.IntList import net.minecraft.core.registries.BuiltInRegistries import net.minecraft.core.registries.Registries import net.minecraft.network.protocol.common.ClientboundUpdateTagsPacket -import net.minecraft.network.protocol.game.ServerboundEntityTagQuery import net.minecraft.resources.ResourceLocation import net.minecraft.tags.BlockTags import net.minecraft.tags.TagNetworkSerialization.NetworkPayload -import org.bukkit.craftbukkit.v1_20_R3.entity.CraftPlayer +import org.bukkit.craftbukkit.entity.CraftPlayer import org.bukkit.entity.Player object Tags { diff --git a/src/main/kotlin/com/mineinabyss/staminaclimb/stamina/StaminaBar.kt b/src/main/kotlin/com/mineinabyss/staminaclimb/stamina/StaminaBar.kt index f523045..f627d62 100644 --- a/src/main/kotlin/com/mineinabyss/staminaclimb/stamina/StaminaBar.kt +++ b/src/main/kotlin/com/mineinabyss/staminaclimb/stamina/StaminaBar.kt @@ -16,7 +16,7 @@ import org.bukkit.Bukkit import org.bukkit.GameMode.ADVENTURE import org.bukkit.GameMode.SURVIVAL import org.bukkit.Location -import org.bukkit.craftbukkit.v1_20_R3.entity.CraftPlayer +import org.bukkit.craftbukkit.entity.CraftPlayer import org.bukkit.entity.Player import org.bukkit.event.EventHandler import org.bukkit.event.Listener diff --git a/src/main/kotlin/com/mineinabyss/staminaclimb/stamina/StaminaTask.kt b/src/main/kotlin/com/mineinabyss/staminaclimb/stamina/StaminaTask.kt index 680b0c4..65d2586 100644 --- a/src/main/kotlin/com/mineinabyss/staminaclimb/stamina/StaminaTask.kt +++ b/src/main/kotlin/com/mineinabyss/staminaclimb/stamina/StaminaTask.kt @@ -56,7 +56,7 @@ class StaminaTask : BukkitRunnable() { uuid.canClimb = false //If player reaches red zone, they can't climb until they get back in green zone - player.addPotionEffect(PotionEffect(PotionEffectType.SLOW, 110, 2, false, false)) + player.addPotionEffect(PotionEffect(PotionEffectType.SLOWNESS, 110, 2, false, false)) player.addPotionEffect(PotionEffect(PotionEffectType.WEAKNESS, 110, 2, false, false)) }