Skip to content

Commit

Permalink
Remove EssentialX
Browse files Browse the repository at this point in the history
  • Loading branch information
Euphillya committed Mar 6, 2024
1 parent 7ea7528 commit 9989c2d
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 26 deletions.
2 changes: 0 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ 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 essentialsRepo = "https://repo.essentialsx.net/releases"
val jitpack = "https://jitpack.io";

dependencies {
Expand Down Expand Up @@ -45,7 +44,6 @@ allprojects {
maven(paperRepo)
maven(sonatypeRepo)
maven(engineHubRepo)
maven(essentialsRepo)
maven(jitpack)
}

Expand Down
2 changes: 0 additions & 2 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,4 @@ dependencies {
implementation("com.google.guava:guava:33.0.0-jre")
compileOnly("com.sk89q.worldedit:worldedit-bukkit:7.2.9") { isTransitive = false }
compileOnly("com.sk89q.worldedit:worldedit-core:7.2.0-SNAPSHOT") { isTransitive = false }
compileOnly("net.essentialsx:EssentialsXSpawn:2.19.7") { isTransitive = false }
compileOnly("net.essentialsx:EssentialsX:2.19.7") { isTransitive = false }
}
21 changes: 1 addition & 20 deletions plugin/src/main/java/fr/euphyllia/skyllia/utils/PlayerUtils.java
Original file line number Diff line number Diff line change
@@ -1,44 +1,25 @@
package fr.euphyllia.skyllia.utils;

import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.spawn.EssentialsSpawn;
import fr.euphyllia.skyllia.Main;
import fr.euphyllia.skyllia.api.SkylliaAPI;
import fr.euphyllia.skyllia.api.event.players.PlayerTeleportSpawnEvent;
import fr.euphyllia.skyllia.api.utils.scheduler.SchedulerTask;
import fr.euphyllia.skyllia.api.utils.scheduler.model.SchedulerType;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.jetbrains.annotations.Nullable;

public class PlayerUtils {

public static void teleportPlayerSpawn(Main main, Player player) {
SkylliaAPI.getSchedulerTask().getScheduler(SchedulerTask.SchedulerSoft.MINECRAFT)
.execute(SchedulerType.ENTITY, player, schedulerTask -> {
Location spawnLocation = getSpawnLocationEssentials(player); // Todo Sera supprimer à l'avenir, je veux utiliser le point de dépendance possible !
if (spawnLocation == null) {
spawnLocation = Bukkit.getWorlds().get(0).getSpawnLocation();
}
PlayerTeleportSpawnEvent playerTeleportSpawnEvent = new PlayerTeleportSpawnEvent(player, spawnLocation);
PlayerTeleportSpawnEvent playerTeleportSpawnEvent = new PlayerTeleportSpawnEvent(player, Bukkit.getWorlds().get(0).getSpawnLocation());
Bukkit.getPluginManager().callEvent(playerTeleportSpawnEvent);
if (playerTeleportSpawnEvent.isCancelled()) {
return;
}
player.teleportAsync(playerTeleportSpawnEvent.getFinalLocation(), PlayerTeleportEvent.TeleportCause.PLUGIN);
});
}

@Deprecated(forRemoval = true, since = "1.0-RC4")
private static @Nullable Location getSpawnLocationEssentials(Player player) {
EssentialsSpawn essentialsSpawn = (EssentialsSpawn) Bukkit.getPluginManager().getPlugin("EssentialsSpawn");
Essentials essentials = (Essentials) Bukkit.getPluginManager().getPlugin("Essentials");
if (essentialsSpawn != null && essentialsSpawn.isEnabled() && essentials != null && essentials.isEnabled()) {
return essentialsSpawn.getSpawn(essentials.getUser(player.getUniqueId()).getGroup());
} else {
return null;
}
}
}
2 changes: 0 additions & 2 deletions plugin/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ description: "Plugin Skyblock pour Folia / PaperMC"
folia-supported: true
depend:
- WorldEdit
softdepend:
- EssentialsX

commands:
skyllia:
Expand Down

0 comments on commit 9989c2d

Please sign in to comment.