mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-22 02:35:21 +01:00
AddonsAPI - Added #getFolder() in BSModule
This commit is contained in:
parent
6178b768bb
commit
1c3b3a2c56
@ -20,6 +20,8 @@ import us.tastybento.bskyblock.managers.LocalesManager;
|
||||
import us.tastybento.bskyblock.util.Util;
|
||||
import us.tastybento.bskyblock.util.nms.NMSAbstraction;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Main BSkyBlock class - provides an island minigame in the sky
|
||||
* @author Tastybento
|
||||
@ -222,4 +224,9 @@ public class BSkyBlock extends JavaPlugin implements BSModule {
|
||||
public boolean isAddon() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getFolder() {
|
||||
return getDataFolder();
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,10 @@
|
||||
package us.tastybento.bskyblock.api;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public interface BSModule {
|
||||
|
||||
String getIdentifier();
|
||||
boolean isAddon();
|
||||
File getFolder();
|
||||
}
|
||||
|
@ -5,8 +5,11 @@ import us.tastybento.bskyblock.api.BSModule;
|
||||
import us.tastybento.bskyblock.managers.CommandsManager;
|
||||
import us.tastybento.bskyblock.managers.LocalesManager;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public abstract class BSAddon implements BSModule {
|
||||
|
||||
private File folder;
|
||||
private AddonDescription description;
|
||||
private AddonState state;
|
||||
|
||||
@ -41,4 +44,12 @@ public abstract class BSAddon implements BSModule {
|
||||
public boolean isAddon() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getFolder() {
|
||||
if (folder == null) {
|
||||
folder = new File(BSkyBlock.getPlugin().getFolder() + "/addons/" + getIdentifier());
|
||||
}
|
||||
return folder;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user