Skip to content

Commit

Permalink
update to 1.20.6
Browse files Browse the repository at this point in the history
  • Loading branch information
CJCrafter committed Jun 10, 2024
1 parent 52b0208 commit 025a8bf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

group = "com.cjcrafter"
version = "3.0.4"
version = "3.0.5"

plugins {
`java-library`
Expand Down Expand Up @@ -33,10 +33,10 @@ dependencies {
implementation("org.bstats:bstats-bukkit:3.0.1")
implementation("com.jeff_media:SpigotUpdateChecker:3.0.3")

compileOnly("org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT")
compileOnly("org.spigotmc:spigot-api:1.20.6-R0.1-SNAPSHOT")
compileOnly("io.lumine:Mythic-Dist:5.3.5")
compileOnly("com.cjcrafter:mechanicscore:3.3.0")
compileOnly("com.cjcrafter:weaponmechanics:3.3.0")
compileOnly("com.cjcrafter:mechanicscore:3.4.1")
compileOnly("com.cjcrafter:weaponmechanics:3.4.1")
}

tasks.shadowJar {
Expand All @@ -57,7 +57,7 @@ tasks.shadowJar {

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
languageVersion.set(JavaLanguageVersion.of(21))
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/cjcrafter/armormechanics/ArmorMechanics.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import me.deecaad.core.file.TaskChain
import me.deecaad.core.utils.Debugger
import me.deecaad.core.utils.FileUtil
import me.deecaad.core.utils.LogLevel
import me.deecaad.core.utils.MinecraftVersions
import me.deecaad.core.utils.ReflectionUtil
import org.bstats.bukkit.Metrics
import org.bstats.charts.SimplePie
Expand All @@ -39,12 +40,13 @@ class ArmorMechanics : JavaPlugin() {
val level = getConfig().getInt("Debug_Level", 2)
val printTraces = getConfig().getBoolean("Print_Traces", false)
debug = Debugger(logger, level, printTraces)
if (ReflectionUtil.getMCVersion() < 13) {
if (!MinecraftVersions.UPDATE_AQUATIC.isAtLeast()) {
debug.error(
" !!!!! ERROR !!!!!",
" !!!!! ERROR !!!!!",
" !!!!! ERROR !!!!!",
" Plugin only supports Minecraft 1.13 and higher"
" Plugin only supports Minecraft 1.13 and higher",
" Found version: ${MinecraftVersions.CURRENT}",
)
server.pluginManager.disablePlugin(this)
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ object ArmorMechanicsAPI {
EquipmentSlot.CHEST -> equipment.chestplate = item
EquipmentSlot.LEGS -> equipment.leggings = item
EquipmentSlot.FEET -> equipment.boots = item
EquipmentSlot.HAND, EquipmentSlot.OFF_HAND -> throw IllegalArgumentException("Invalid slot $slot")
else -> throw IllegalArgumentException("Invalid slot $slot")
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/cjcrafter/armormechanics/BonusEffect.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import me.deecaad.core.file.SerializerOptionsException
import me.deecaad.core.mechanics.CastData
import me.deecaad.core.mechanics.Mechanics
import me.deecaad.core.mechanics.defaultmechanics.PotionMechanic
import me.deecaad.core.utils.MinecraftVersions
import me.deecaad.core.utils.ReflectionUtil
import org.bukkit.entity.LivingEntity
import org.bukkit.event.entity.EntityDamageEvent
Expand Down Expand Up @@ -86,7 +87,7 @@ class BonusEffect : Serializer<BonusEffect> {
// TODO 1.20 has actual infinite instead of MAX_VALUE, check it out
val base: PotionEffect = (list[i] as PotionMechanic).potion
var effect = PotionEffect(base.type, Int.MAX_VALUE, base.amplifier, base.isAmbient, base.hasParticles())
if (ReflectionUtil.getMCVersion() > 13) {
if (MinecraftVersions.UPDATE_AQUATIC.isAtLeast()) {
effect = PotionEffect(
base.type,
Int.MAX_VALUE,
Expand Down

0 comments on commit 025a8bf

Please sign in to comment.