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;
|
import java.io.InputStream;
|
||||||
|
|
||||||
public class GiantsPlugin extends MStatsPlugin implements CommandExecutor {
|
public class GiantsPlugin extends MStatsPlugin implements CommandExecutor {
|
||||||
|
private static GiantsPlugin INSTANCE;
|
||||||
|
|
||||||
private final File configFile = new File(getDataFolder(), "config.yml");
|
private final File configFile = new File(getDataFolder(), "config.yml");
|
||||||
|
|
||||||
private static Configuration configuration;
|
private Configuration configuration;
|
||||||
private final GiantProcessor giantProcessor = new GiantProcessor(this, configuration);
|
private GiantProcessor giantProcessor;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
|
INSTANCE = this;
|
||||||
|
|
||||||
if (!configFile.exists()) {
|
if (!configFile.exists()) {
|
||||||
saveResource("config.yml", false);
|
saveResource("config.yml", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
configuration = Configuration.load(this, configFile);
|
this.configuration = Configuration.load(this, configFile);
|
||||||
|
this.giantProcessor = new GiantProcessor(this, configuration);
|
||||||
|
|
||||||
giantProcessor.start();
|
giantProcessor.start();
|
||||||
|
|
||||||
|
|
@ -61,11 +66,13 @@ public class GiantsPlugin extends MStatsPlugin implements CommandExecutor {
|
||||||
mStats(3);
|
mStats(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Configuration getConfiguration() {
|
public static GiantsPlugin getInstance() {
|
||||||
return configuration;
|
return INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO api, untested
|
public Configuration getConfiguration() {
|
||||||
|
return configuration;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if a giant can be spawned at a location<br>
|
* Checks if a giant can be spawned at a location<br>
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class GiantJumper {
|
public class GiantJumper {
|
||||||
private final Configuration configuration = GiantsPlugin.getConfiguration();
|
private final Configuration configuration = GiantsPlugin.getInstance().getConfiguration();
|
||||||
|
|
||||||
private final Map<Entity, Long> giantLastJump = new HashMap<>();
|
private final Map<Entity, Long> giantLastJump = new HashMap<>();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import java.util.Set;
|
||||||
* Ticks giants
|
* Ticks giants
|
||||||
*/
|
*/
|
||||||
public class GiantTicker extends BukkitRunnable {
|
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 GiantJumper jumper = new GiantJumper();
|
||||||
|
|
||||||
private final GiantProcessor giantProcessor;
|
private final GiantProcessor giantProcessor;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue