Initial commit: MBedwars 5.5.9.1 reconstructed Maven & IDEA-ready codebase

This commit is contained in:
xoo0524tw committed 2026-12-01 23:06:30 +08:00
commit a8fad81ea0
1609 files changed
+239964

No files matched your search

@@ -0,0 +1,58 @@
package de.marcely.bedwars.api;
import de.marcely.bedwars.api.command.CommandsCollection;
import de.marcely.bedwars.api.unsafe.BedwarsAPILayer;
import de.marcely.bedwars.libraries.org.jetbrains.annotations.Nullable;
import de.marcely.bedwars.tools.Helper;
import java.io.File;
import org.bukkit.plugin.Plugin;
public abstract class BedwarsAddon {
private final Plugin plugin;
private CommandsCollection commandsCollection;
public BedwarsAddon(Plugin var1) {
this.plugin = var1;
}
public final Plugin getPlugin() {
return this.plugin;
}
public String getName() {
return Helper.get().replaceFirst(this.plugin.getName(), "MBedwars_", "");
}
public String getVersion() {
return this.plugin.getDescription().getVersion();
}
public String[] getAuthors() {
return this.plugin.getDescription().getAuthors().stream().toArray(String[]::new);
}
@Nullable
public CommandsCollection getCommandsRoot() {
if (this.commandsCollection == null) {
return this.commandsCollection = BedwarsAPILayer.INSTANCE.getAddonCommandsCollection(this);
} else {
return this.isRegistered() ? this.commandsCollection : null;
}
}
public File getDataFolder() {
return BedwarsAPILayer.INSTANCE.getAddonDataFolder(this);
}
public final boolean register() {
return BedwarsAPILayer.INSTANCE.registerAddon(this);
}
public final boolean unregister() {
return BedwarsAPILayer.INSTANCE.unregisterAddon(this);
}
public final boolean isRegistered() {
return BedwarsAPILayer.INSTANCE.isRegisteredAddon(this);
}
}