diff --git a/gradle.properties b/gradle.properties index ecb79e3..8b4d434 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ group=com.mineinabyss -version=0.20 -idofrontVersion=0.18.26 +version=0.21 +idofrontVersion=0.19.14 diff --git a/gradle/staminaLibs.versions.toml b/gradle/staminaLibs.versions.toml index 0e9c5a4..1435e50 100644 --- a/gradle/staminaLibs.versions.toml +++ b/gradle/staminaLibs.versions.toml @@ -1,6 +1,6 @@ [versions] -geary = "0.25-SNAPSHOT" -bonehurtingjuice = "1.9.2" +geary = "0.26.0" +bonehurtingjuice = "1.10.0" [libraries] geary-papermc = { module = "com.mineinabyss:geary-papermc", version.ref = "geary" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fae0804..e411586 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.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/kotlin/com/mineinabyss/staminaclimb/config/StaminaConfig.kt b/src/main/kotlin/com/mineinabyss/staminaclimb/config/StaminaConfig.kt index 3226768..e9c6c8d 100644 --- a/src/main/kotlin/com/mineinabyss/staminaclimb/config/StaminaConfig.kt +++ b/src/main/kotlin/com/mineinabyss/staminaclimb/config/StaminaConfig.kt @@ -7,25 +7,86 @@ import org.bukkit.Material @Serializable class StaminaConfig( - val airTime: Long, - val staminaRegen: Float, - val staminaRegenInAir: Float, - val staminaRemovePerTick: Float, - val staminaRemoveWhileMoving: Float, - val staminaRemoveWhileOnLadder: Float, - val baseBarColor: Color, - val baseOverlay: Overlay, - val barRed: Float, - val barBlink1: Float, - val barBlink2: Float, - val barBlinkSpeed1: Float, - val barBlinkSpeed2: Float, - val maxFallDist: Double, - val jumpCooldown: Long, - val roofClimbDifficulty: Float, - val walljumpCooldown: Long, - val climbBlacklist: List, - val climbBlacklistGeneral: List, - val climbDifficulty: Map = mapOf(), - val climbDifficultyGeneral: Map = mapOf() + val airTime: Long = 400, + val staminaRegen: Float = 0.01f, + val staminaRegenInAir: Float = 0.003f, + val staminaRemovePerTick: Float = 0.005f, + val staminaRemoveWhileMoving: Float = 0.005f, + val staminaRemoveWhileOnLadder: Float = 0.01f, + val baseBarColor: Color = Color.GREEN, + val baseOverlay: Overlay = Overlay.NOTCHED_10, + val barRed: Float = 0.02f, + val barBlink1: Float = 0.3f, + val barBlink2: Float = 0.1f, + val barBlinkSpeed1: Float = 120f, + val barBlinkSpeed2: Float = 20f, + val maxFallDist: Double = 5.0, + val jumpCooldown: Long = 300, + val walljumpCooldown: Long = 300, + val roofClimbDifficulty: Float = 7.0f, + val climbBlacklist: Set = setOf( + Material.BEACON, + Material.BARREL, + Material.CAMPFIRE, + Material.CARTOGRAPHY_TABLE, + Material.CAULDRON, + Material.COMMAND_BLOCK, + Material.COMPOSTER, + Material.CRAFTING_TABLE, + Material.BREWING_STAND, + Material.DAYLIGHT_DETECTOR, + Material.DISPENSER, + Material.DROPPER, + Material.ENCHANTING_TABLE, + Material.ENDER_CHEST, + Material.FARMLAND, + Material.GRINDSTONE, + Material.HOPPER, + Material.HOPPER_MINECART, + Material.ITEM_FRAME, + Material.LANTERN, + Material.LECTERN, + Material.LEVER, + Material.LOOM, + Material.NOTE_BLOCK, + Material.SCAFFOLDING, + Material.SMOKER, + Material.SMITHING_TABLE, + Material.STONECUTTER, + Material.SWEET_BERRY_BUSH, + Material.BEEHIVE, + Material.BEE_NEST, + Material.ANVIL, + Material.CHIPPED_ANVIL, + Material.DAMAGED_ANVIL + ), + val climbBlacklistGeneral: Set = setOf( + "DOOR", + "FENCE", + "FURNACE", + "_BED", + "BELL", + "CHEST", + "BUTTON", + "SIGN", + "SHULKER_BOX" + ), + val climbDifficulty: Map = mapOf( + Material.SAND to 2f, + Material.BARRIER to -1f, + Material.COBBLESTONE to 0.8f, + Material.ICE to 5f, + Material.PACKED_ICE to 4f, + Material.BLUE_ICE to 4f, + Material.SLIME_BLOCK to 0.5f, + Material.HONEY_BLOCK to -1f, + ), + val climbDifficultyGeneral: Map = mapOf( + "WOOD" to 0.3f, + "LOG" to 0.3f, + "SMOOTH" to 5f, + "FENCE" to 0.5f, + "DOOR" to -1f, + "GLASS" to -1f + ) ) diff --git a/src/main/kotlin/com/mineinabyss/staminaclimb/modules/StaminaPaperModule.kt b/src/main/kotlin/com/mineinabyss/staminaclimb/modules/StaminaPaperModule.kt index 5b7d60d..6145527 100644 --- a/src/main/kotlin/com/mineinabyss/staminaclimb/modules/StaminaPaperModule.kt +++ b/src/main/kotlin/com/mineinabyss/staminaclimb/modules/StaminaPaperModule.kt @@ -9,9 +9,8 @@ import com.mineinabyss.staminaclimb.nms.Tags class StaminaPaperModule( override val plugin: StaminaClimbPlugin ) : StaminaClimbModule { - override val configHolder: IdofrontConfig = config("config") { - plugin.fromPluginPath(loadDefault = true) - } + override val configHolder: IdofrontConfig = + config("config", plugin.dataFolder.toPath(), StaminaConfig()) override val config: StaminaConfig by configHolder override val emptyClimbableMap = Tags.createEmptyClimbableMap() override val normalClimbableMap = Tags.createNormalClimbableMap() diff --git a/src/main/kotlin/com/mineinabyss/staminaclimb/nms/Tags.kt b/src/main/kotlin/com/mineinabyss/staminaclimb/nms/Tags.kt index e1e7747..a32d89b 100644 --- a/src/main/kotlin/com/mineinabyss/staminaclimb/nms/Tags.kt +++ b/src/main/kotlin/com/mineinabyss/staminaclimb/nms/Tags.kt @@ -5,11 +5,11 @@ import it.unimi.dsi.fastutil.ints.IntArrayList import it.unimi.dsi.fastutil.ints.IntList import net.minecraft.core.registries.BuiltInRegistries import net.minecraft.core.registries.Registries -import net.minecraft.network.protocol.game.ClientboundUpdateTagsPacket +import net.minecraft.network.protocol.common.ClientboundUpdateTagsPacket import net.minecraft.resources.ResourceLocation import net.minecraft.tags.BlockTags import net.minecraft.tags.TagNetworkSerialization.NetworkPayload -import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer +import org.bukkit.craftbukkit.v1_20_R2.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 498570a..7b8e04f 100644 --- a/src/main/kotlin/com/mineinabyss/staminaclimb/stamina/StaminaBar.kt +++ b/src/main/kotlin/com/mineinabyss/staminaclimb/stamina/StaminaBar.kt @@ -11,12 +11,12 @@ import com.mineinabyss.staminaclimb.nms.Tags.createPayload import kotlinx.coroutines.delay import net.kyori.adventure.bossbar.BossBar import net.minecraft.core.registries.Registries -import net.minecraft.network.protocol.game.ClientboundUpdateTagsPacket +import net.minecraft.network.protocol.common.ClientboundUpdateTagsPacket import org.bukkit.Bukkit import org.bukkit.GameMode.ADVENTURE import org.bukkit.GameMode.SURVIVAL import org.bukkit.Location -import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer +import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer import org.bukkit.entity.Player import org.bukkit.event.EventHandler import org.bukkit.event.Listener diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml deleted file mode 100644 index 6f287e6..0000000 --- a/src/main/resources/config.yml +++ /dev/null @@ -1,78 +0,0 @@ -airTime: 400 -staminaRegen: 0.01 -staminaRegenInAir: 0.003 -staminaRemovePerTick: 0.005 -staminaRemoveWhileMoving: 0.005 -staminaRemoveWhileOnLadder: 0.01 -baseBarColor: GREEN -baseOverlay: NOTCHED_10 -barRed: 0.02 -barBlink1: 0.3 -barBlink2: 0.1 -barBlinkSpeed1: 120 -barBlinkSpeed2: 20 -maxFallDist: 5 -jumpCooldown: 300 -walljumpCooldown: 300 -roofClimbDifficulty: 7.0 -climbBlacklist: - - BEACON - - BARREL - - CAMPFIRE - - CARTOGRAPHY_TABLE - - CAULDRON - - COMMAND_BLOCK - - COMPOSTER - - CRAFTING_TABLE - - BREWING_STAND - - DAYLIGHT_DETECTOR - - DISPENSER - - DROPPER - - ENCHANTING_TABLE - - ENDER_CHEST - - FARMLAND - - GRINDSTONE - - HOPPER - - HOPPER_MINECART - - ITEM_FRAME - - LANTERN - - LECTERN - - LEVER - - LOOM - - NOTE_BLOCK - - SCAFFOLDING - - SMOKER - - SMITHING_TABLE - - STONECUTTER - - SWEET_BERRY_BUSH - - BEEHIVE - - BEE_NEST - - ANVIL - - CHIPPED_ANVIL - - DAMAGED_ANVIL -climbBlacklistGeneral: - - DOOR - - FENCE - - FURNACE - - _BED - - BELL - - CHEST - - BUTTON - - SIGN - - SHULKER_BOX -climbDifficulty: - SAND: 2 - BARRIER: -1 - COBBLESTONE: 0.8 - ICE: 5 - PACKED_ICE: 4 - BLUE_ICE: 4 - SLIME_BLOCK: 0.5 - HONEY_BLOCK: -1 -climbDifficultyGeneral: - WOOD: 0.3 - LOG: 0.3 - SMOOTH: 5 - FENCE: 0.5 - DOOR: -1 - GLASS: -1