Fix a very embarrassing mistake
This commit is contained in:
parent
f92328070c
commit
7375163685
3 changed files with 15 additions and 8 deletions
|
@ -14,18 +14,23 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
|
||||
public class GiantsPlugin extends MStatsPlugin implements CommandExecutor {
|
||||
private static GiantsPlugin INSTANCE;
|
||||
|
||||
private final File configFile = new File(getDataFolder(), "config.yml");
|
||||
|
||||
private static Configuration configuration;
|
||||
private final GiantProcessor giantProcessor = new GiantProcessor(this, configuration);
|
||||
private Configuration configuration;
|
||||
private GiantProcessor giantProcessor;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
INSTANCE = this;
|
||||
|
||||
if (!configFile.exists()) {
|
||||
saveResource("config.yml", false);
|
||||
}
|
||||
|
||||
configuration = Configuration.load(this, configFile);
|
||||
this.configuration = Configuration.load(this, configFile);
|
||||
this.giantProcessor = new GiantProcessor(this, configuration);
|
||||
|
||||
giantProcessor.start();
|
||||
|
||||
|
@ -61,11 +66,13 @@ public class GiantsPlugin extends MStatsPlugin implements CommandExecutor {
|
|||
mStats(3);
|
||||
}
|
||||
|
||||
public static Configuration getConfiguration() {
|
||||
return configuration;
|
||||
public static GiantsPlugin getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
// TODO api, untested
|
||||
public Configuration getConfiguration() {
|
||||
return configuration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a giant can be spawned at a location<br>
|
||||
|
|
|
@ -10,7 +10,7 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
|
||||
public class GiantJumper {
|
||||
private final Configuration configuration = GiantsPlugin.getConfiguration();
|
||||
private final Configuration configuration = GiantsPlugin.getInstance().getConfiguration();
|
||||
|
||||
private final Map<Entity, Long> giantLastJump = new HashMap<>();
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import java.util.Set;
|
|||
* Ticks giants
|
||||
*/
|
||||
public class GiantTicker extends BukkitRunnable {
|
||||
private final Configuration configuration = GiantsPlugin.getConfiguration();
|
||||
private final Configuration configuration = GiantsPlugin.getInstance().getConfiguration();
|
||||
private final GiantJumper jumper = new GiantJumper();
|
||||
|
||||
private final GiantProcessor giantProcessor;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue