Skip to content
This repository was archived by the owner on Oct 12, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ repositories {
maven {
url = 'https://maven.enginehub.org/repo/'
}
maven { url = "https://repo.onarandombox.com/content/groups/public/" }
}

dependencies {
Expand Down Expand Up @@ -54,6 +55,8 @@ dependencies {

compileOnly 'com.sk89q.worldedit:worldedit-bukkit:7+' // WorldEdit
compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.10' // WorldGuard

compileOnly 'com.onarandombox.multiversecore:Multiverse-Core:4.3.+'
}

def targetJavaVersion = 21
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/fr/communaywen/core/AywenCraftPlugin.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package fr.communaywen.core;

import com.onarandombox.MultiverseCore.MultiverseCore;
import dev.xernas.menulib.Menu;
import dev.xernas.menulib.MenuLib;
import fr.communaywen.core.claim.ClaimConfigDataBase;
Expand Down Expand Up @@ -69,7 +70,7 @@ public final class AywenCraftPlugin extends JavaPlugin {
private BukkitCommandHandler handler;

public List<RegionManager> regions;

public MultiverseCore mvCore;
@SneakyThrows
@Override
public void onEnable() {
Expand All @@ -82,6 +83,8 @@ public void onEnable() {
managers.initConfig(this);
managers.init(this);

mvCore = (MultiverseCore) Bukkit.getServer().getPluginManager().getPlugin("Multiverse-Core");

LinkerAPI linkerAPI = new LinkerAPI(managers.getDatabaseManager());

OnPlayers onPlayers = new OnPlayers();
Expand Down Expand Up @@ -152,7 +155,8 @@ public void onEnable() {
new TradeAcceptCommand(this),
new QuestsCommands(),
new RewardCommand(this),
new FeatureCommand(managers.getFeatureManager())
new FeatureCommand(managers.getFeatureManager()),
new MineCommand()
);

/* -------- */
Expand Down
24 changes: 24 additions & 0 deletions src/main/java/fr/communaywen/core/commands/MineCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package fr.communaywen.core.commands;

import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import fr.communaywen.core.AywenCraftPlugin;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import revxrsal.commands.annotation.Command;
import revxrsal.commands.annotation.Description;

public class MineCommand {

@Command("mine")
@Description("Téléporte vers la mine")
public void tpMine(Player player) {
FileConfiguration config = AywenCraftPlugin.getInstance().getConfig();
MultiverseWorld mineWorld = AywenCraftPlugin.getInstance().mvCore.getMVWorldManager().getMVWorld(config.getString("mine.name"));

player.teleport(mineWorld.getSpawnLocation());
player.sendMessage("§aVous venez de vous téléporter à la mine.");
}

}
4 changes: 3 additions & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ deco_freeze_nombre_de_jours_ban: 30
discord:
webhookURL: https://discord.com/api/webhooks/1258553652868677802/u17NMB93chQrYf6V0MnbKPMbjoY6B_jN9e2nhK__uU8poc-d8a-aqaT_C0_ur4TSFMy_
webhookIconURL: https://media.discordapp.net/attachments/1161296445169741836/1258408047412383804/image.png?ex=66889812&is=66874692&hm=4bb38f7b6460952afc21811f7145a6b289d7210861d81d91b1ca8ee264f0ab0d&=&format=webp&quality=lossless&width=1131&height=662
webhookName: Annonce Serveur
webhookName: Annonce Serveur
mine:
name: mine