Skip to content

Commit

Permalink
Merge pull request #36 from Euphillya/ver/1.20.6 + 1.0 !
Browse files Browse the repository at this point in the history
Ver/1.20.6
  • Loading branch information
Euphillya authored May 26, 2024
2 parents d43bb41 + e954520 commit 0afa61b
Show file tree
Hide file tree
Showing 69 changed files with 562 additions and 1,061 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
steps:
- name: Checkout Git Repository
uses: actions/checkout@v4
- name: Setup Java 17
- name: Setup Java 21
uses: actions/setup-java@v4
with:
java-version: "17"
java-version: "21"
cache: "gradle"
distribution: "temurin"
- name: Configure Git User
Expand Down
7 changes: 1 addition & 6 deletions .idea/gradle.xml

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

2 changes: 1 addition & 1 deletion .idea/misc.xml

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

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


dependencies {
compileOnly("dev.folia:folia-api:1.20.4-R0.1-SNAPSHOT")
compileOnly("org.apache.logging.log4j:log4j-api:2.22.1")
compileOnly("org.apache.logging.log4j:log4j-core:2.22.1")
compileOnly("org.mariadb.jdbc:mariadb-java-client:3.3.2")
compileOnly("com.zaxxer:HikariCP:5.1.0")
paperweight.foliaDevBundle("1.20.4-R0.1-SNAPSHOT")
compileOnly("com.github.Euphillya:SGBD-MariaDB:3827fafa25")
}

group = "fr.euphyllia.skyllia";
version = "1.0-RC7.1";
version = "1.0";

publishing {
repositories {
Expand All @@ -27,6 +30,15 @@ publishing {
}
}

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

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
Expand Down
35 changes: 22 additions & 13 deletions api/src/main/java/fr/euphyllia/skyllia/api/SkylliaAPI.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package fr.euphyllia.skyllia.api;

import fr.euphyllia.energie.Energie;
import fr.euphyllia.energie.model.Scheduler;
import fr.euphyllia.skyllia.api.skyblock.Island;
import fr.euphyllia.skyllia.api.skyblock.model.Position;
import org.bukkit.Chunk;
Expand All @@ -15,12 +13,18 @@

public final class SkylliaAPI {

private static final boolean IS_FOLIA;
private static Plugin PLUGIN;
private static SkylliaImplementation implementation;
private static Energie energie;

static {
IS_FOLIA = hasClass("io.papermc.paper.threadedregions.RegionizedServer");
}


public static void setImplementation(Plugin plugin, SkylliaImplementation skylliaImplementation) {
PLUGIN = plugin;
implementation = skylliaImplementation;
energie = new Energie(plugin);
}

public static CompletableFuture<@Nullable Island> getIslandByPlayerId(UUID playerUniqueId) {
Expand All @@ -39,16 +43,8 @@ public static void setImplementation(Plugin plugin, SkylliaImplementation skylli
return implementation.getIslandByChunk(chunk);
}

public static Scheduler getScheduler() {
return energie.getMinecraftScheduler();
}

public static Scheduler getNativeScheduler() {
return energie.getNativeScheduler();
}

public static boolean isFolia() {
return Energie.isFolia();
return IS_FOLIA;
}

public static @NotNull Boolean isWorldSkyblock(String name) {
Expand All @@ -58,4 +54,17 @@ public static boolean isFolia() {
public static @NotNull Boolean isWorldSkyblock(World world) {
return implementation.isWorldSkyblock(world);
}

public static Plugin getPlugin() {
return PLUGIN;
}

private static boolean hasClass(String className) {
try {
Class.forName(className);
return true;
} catch (ClassNotFoundException var2) {
return false;
}
}
}
12 changes: 12 additions & 0 deletions api/src/main/java/fr/euphyllia/skyllia/api/entity/PlayerFolia.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package fr.euphyllia.skyllia.api.entity;

import fr.euphyllia.skyllia.api.SkylliaAPI;
import org.bukkit.GameMode;
import org.bukkit.entity.Player;

public class PlayerFolia {

public static void setGameMode(Player player, GameMode gameMode) {
player.getScheduler().execute(SkylliaAPI.getPlugin(), () -> player.setGameMode(gameMode), null, 0L);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ public abstract class Island {

public abstract boolean updateMember(Players member);

@Deprecated(forRemoval = true)
public abstract boolean updatePermissionIsland(PermissionsType permissionsType, RoleType roleType, long permissions);

public abstract boolean updatePermission(PermissionsType permissionsType, RoleType roleType, long permissions);

public abstract Position getPosition();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package fr.euphyllia.skyllia.api.utils;

import fr.euphyllia.skyllia.api.SkylliaAPI;
import org.bukkit.Bukkit;

public class VersionUtils {

Expand Down
40 changes: 20 additions & 20 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,35 @@ plugins {
id("java-library")
id("java")
id("maven-publish")
id("com.github.johnrengelman.shadow") version "8.1.1"
id("io.github.goooler.shadow") version "8.1.7"
id("io.papermc.paperweight.userdev") version "1.7.1" apply false
}

group = "fr.euphyllia";
version = "1.0-RC7-" + System.getenv("GITHUB_RUN_NUMBER");
description = "Plugin Skyblock pour Folia / PaperMC";

val paperRepo = "https://repo.papermc.io/repository/maven-public/";
val sonatypeRepo = "https://oss.sonatype.org/content/groups/public/";
val engineHubRepo = "https://maven.enginehub.org/repo/";
val jitpack = "https://jitpack.io";

dependencies {
implementation(project(":nms:v1_17_R1", "reobf"))
implementation(project(":nms:v1_18_R1", "reobf"))
implementation(project(":nms:v1_18_R2", "reobf"))
implementation(project(":nms:v1_19_R1", "reobf"))
implementation(project(":nms:v1_19_R2", "reobf"))
implementation(project(":nms:v1_19_R3", "reobf"))
implementation(project(":nms:v1_19_R3", "reobf"))
implementation(project(":api"))
implementation(project(":plugin"))
implementation(project(":nms:v1_20_R1", "reobf"))
implementation(project(":nms:v1_20_R2", "reobf"))
implementation(project(":nms:v1_20_R3", "reobf"))
implementation(project(":plugin"))

testImplementation(platform("org.junit:junit-bom:5.9.2"))
testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")
implementation(project(":nms:v1_20_R4", "reobf"))
}

allprojects {
apply(plugin = "java")
group = "fr.euphyllia";
version = "1.0-" + System.getenv("GITHUB_RUN_NUMBER");
description = "Plugin Skyblock pour Folia / PaperMC";

apply(plugin = "java-library")
apply(plugin = "com.github.johnrengelman.shadow")
apply(plugin = "io.github.goooler.shadow")
apply(plugin = "maven-publish")

repositories {
mavenLocal()
mavenCentral()
maven(paperRepo)
maven(sonatypeRepo)
Expand All @@ -48,12 +41,19 @@ allprojects {
}

dependencies {
implementation("com.github.Euphillya:Energie:1.2.0")
implementation("com.github.Euphillya:SGBD-MariaDB:3827fafa25")

compileOnly("org.apache.logging.log4j:log4j-api:2.22.1")
compileOnly("org.apache.logging.log4j:log4j-core:2.22.1")
compileOnly("org.mariadb.jdbc:mariadb-java-client:3.3.2")
compileOnly("com.zaxxer:HikariCP:5.1.0")
compileOnly("net.kyori:adventure-text-minimessage:4.15.0")
compileOnly("com.electronwill.night-config:toml:3.6.7")
compileOnly("com.google.guava:guava:33.0.0-jre")
compileOnly("net.md-5:bungeecord-api:1.20-R0.2")
}

tasks.withType<ShadowJar> {
relocate("fr.euphyllia.energie", "fr.euphyllia.skyllia.dependency.energie")
relocate("fr.euphyllia.sgbd", "fr.euphyllia.skyllia.dependency.sgbd")
}

Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.gradle.parallel=true
22 changes: 0 additions & 22 deletions nms/v1_17_R1/build.gradle.kts

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 0afa61b

Please sign in to comment.