Skip to content

Commit

Permalink
Add 1.21 support
Browse files Browse the repository at this point in the history
Updated gradle version
Fixed deprecated methods
  • Loading branch information
imDMK committed Jul 10, 2024
1 parent 9c66766 commit a74dd46
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
8 changes: 4 additions & 4 deletions doublejump-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@ repositories {
}

dependencies {
compileOnly("org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT")
compileOnly("org.spigotmc:spigot-api:1.21-R0.1-SNAPSHOT")
compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.0.9")

testImplementation(platform("org.junit:junit-bom:5.9.1"))
testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}

checkstyle {
Expand All @@ -41,6 +40,7 @@ tasks.test {
}

tasks.withType<JavaCompile> {
options.compilerArgs = listOf("-Xlint:deprecation", "-parameters")
options.encoding = "UTF-8"
options.compilerArgs.add("-parameters")
options.release = 17
}
15 changes: 8 additions & 7 deletions doublejump-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ repositories {
dependencies {
implementation(project(":doublejump-api"))

compileOnly("org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT")
compileOnly("org.spigotmc:spigot-api:1.21-R0.1-SNAPSHOT")
compileOnly("me.clip:placeholderapi:2.11.5")

implementation("dev.triumphteam:triumph-gui:3.1.7")
implementation("dev.triumphteam:triumph-gui:3.1.10")

implementation("eu.okaeri:okaeri-configs-yaml-snakeyaml:5.0.1")
implementation("eu.okaeri:okaeri-configs-serdes-commons:5.0.1")
implementation("eu.okaeri:okaeri-configs-serdes-bukkit:5.0.1")

implementation("net.kyori:adventure-platform-bukkit:4.3.2")
implementation("net.kyori:adventure-text-minimessage:4.16.0")
implementation("net.kyori:adventure-platform-bukkit:4.3.3")
implementation("net.kyori:adventure-text-minimessage:4.17.0")

implementation("dev.rollczi:litecommands-bukkit:3.4.0")
implementation("dev.rollczi:litecommands-bukkit:3.4.2")

implementation("com.eternalcode:gitcheck:1.0.0")
implementation("org.bstats:bstats-bukkit:3.0.2")
Expand All @@ -47,8 +47,7 @@ dependencies {
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}

bukkit {
Expand All @@ -73,7 +72,9 @@ tasks.test {
}

tasks.withType<JavaCompile> {
options.compilerArgs = listOf("-Xlint:deprecation", "-parameters")
options.encoding = "UTF-8"
options.release = 17
}

tasks.withType<ShadowJar> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import eu.okaeri.configs.serdes.BidirectionalTransformer;
import eu.okaeri.configs.serdes.SerdesContext;
import org.bukkit.NamespacedKey;
import org.bukkit.Registry;
import org.bukkit.enchantments.Enchantment;
import org.checkerframework.checker.nullness.qual.NonNull;

Expand All @@ -16,7 +17,7 @@ public GenericsPair<String, Enchantment> getPair() {

@Override
public Enchantment leftToRight(@NonNull String key, @NonNull SerdesContext serdesContext) {
return Enchantment.getByKey(NamespacedKey.minecraft(key));
return Registry.ENCHANTMENT.get(NamespacedKey.minecraft(key));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class JumpItemSettings extends OkaeriConfig {
.name(Component.text("<red>DOUBLE JUMP"))
.lore(Component.empty(), Component.text("<red>This is double jump item!"), Component.empty())
.flags(ItemFlag.HIDE_ATTRIBUTES)
.enchant(Enchantment.DURABILITY, 10)
.enchant(Enchantment.INFINITY, 10)
.build();

@Comment({"# ", "# Jump item usage settings", "# "})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class JumpParticleSettings extends OkaeriConfig {
})
public List<JumpParticle> particles = List.of(
new JumpParticle(Particle.NOTE, Color.WHITE, 20, 3, 2, 0, 0, 0),
new JumpParticle(Particle.REDSTONE, Color.WHITE, 40, 3, 2, 0, 0, 0)
new JumpParticle(Particle.BUBBLE, Color.WHITE, 40, 3, 2, 0, 0, 0)
);

}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists

0 comments on commit a74dd46

Please sign in to comment.