Skip to content

Commit

Permalink
🎉 First Support 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
Euphillya committed Jun 15, 2024
1 parent 8c78d10 commit c119d10
Show file tree
Hide file tree
Showing 11 changed files with 356 additions and 17 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
plugins {
id("java")
id("io.papermc.paperweight.userdev")
//id("io.papermc.paperweight.userdev")
}


dependencies {
paperweight.foliaDevBundle("1.20.4-R0.1-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.21-R0.1-SNAPSHOT")
implementation("com.github.Euphillya:SGBD-MariaDB:3827fafa25")
}

Expand All @@ -32,14 +32,14 @@ publishing {

tasks {
assemble {
dependsOn(reobfJar)
//dependsOn(reobfJar)
}
compileJava {
options.encoding = "UTF-8"
}
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dependencies {
implementation(project(":nms:v1_20_R2", "reobf"))
implementation(project(":nms:v1_20_R3", "reobf"))
implementation(project(":nms:v1_20_R4", "reobf"))
implementation(project(":nms:v1_21_R1", "reobf"))
}

allprojects {
Expand Down
1 change: 0 additions & 1 deletion nms/v1_20_R1/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ plugins {
dependencies {
paperweight.foliaDevBundle("1.20.1-R0.1-SNAPSHOT")
compileOnly(project(":api"))
compileOnly("com.github.Euphillya:Energie:1.2.0")
}

tasks {
Expand Down
4 changes: 2 additions & 2 deletions nms/v1_20_R3/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ tasks {
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
23 changes: 23 additions & 0 deletions nms/v1_21_R1/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
plugins {
id("java")
id("io.papermc.paperweight.userdev")
}

dependencies {
paperweight.paperDevBundle("1.21-R0.1-SNAPSHOT")
compileOnly(project(":api"))
}

tasks {
assemble {
dependsOn(reobfJar)
}
compileJava {
options.encoding = "UTF-8"
}
}

java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package fr.euphyllia.skyllia.utils.nms.v1_20_R4;

import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;

public class PlayerNMS extends fr.euphyllia.skyllia.api.utils.nms.PlayerNMS {

public void setOwnWorldBorder(JavaPlugin main, Player player, @NotNull Location centerBorder, double borderSize, int warningBlocks, int warningTime) {
player.getScheduler().execute(main, () -> {
final net.minecraft.world.level.border.WorldBorder worldBorderPlayer = new net.minecraft.world.level.border.WorldBorder();
worldBorderPlayer.world = ((org.bukkit.craftbukkit.CraftWorld) centerBorder.getWorld()).getHandle();
worldBorderPlayer.setCenter(centerBorder.getBlockX(), centerBorder.getBlockZ());
worldBorderPlayer.setSize(borderSize);
worldBorderPlayer.setWarningBlocks(warningBlocks);
worldBorderPlayer.setWarningTime(warningTime);
final net.minecraft.network.protocol.game.ClientboundInitializeBorderPacket updateWorldBorderPacket = new net.minecraft.network.protocol.game.ClientboundInitializeBorderPacket(worldBorderPlayer);
org.bukkit.craftbukkit.entity.CraftPlayer craftPlayer = ((org.bukkit.craftbukkit.entity.CraftPlayer) player);
craftPlayer.getHandle().connection.send(updateWorldBorderPacket);
}, null, 0L);
}


}
Loading

0 comments on commit c119d10

Please sign in to comment.