Added Startup() to loader to create files and configuration!
This commit is contained in:
parent
93af0f0e39
commit
3296007d06
@ -57,12 +57,13 @@ public class HerobrineAI extends JavaPlugin implements Listener {
|
||||
@Override
|
||||
public void onEnable() {
|
||||
HerobrineAI.pluginCore = this;
|
||||
configdb = new ConfigDB();
|
||||
configdb = new ConfigDB(getLogger());
|
||||
aicore = new AICore();
|
||||
support = new Support();
|
||||
entMng = new EntityManager();
|
||||
NPCCore = new NPCCore();
|
||||
configdb.reload();
|
||||
configdb.Startup();
|
||||
configdb.Reload();
|
||||
getCommand("herobrine").setExecutor(new CmdExecutor(this));
|
||||
getServer().getPluginManager().registerEvents(new EntityListener(), this);
|
||||
getServer().getPluginManager().registerEvents(new BlockListener(), this);
|
||||
@ -73,7 +74,7 @@ public class HerobrineAI extends JavaPlugin implements Listener {
|
||||
}
|
||||
|
||||
private void initHerobrine() {
|
||||
if (configdb.useGraveyardWorld && (Bukkit.getServer().getWorld("world_herobrine_graveyard") == null)) {
|
||||
if (configdb.UseGraveyardWorld && (Bukkit.getServer().getWorld("world_herobrine_graveyard") == null)) {
|
||||
HerobrineAI.log.info("[Herobrine] Creating Herobrine Graveyard world");
|
||||
final WorldCreator wc = new WorldCreator("world_herobrine_graveyard");
|
||||
wc.generateStructures(false);
|
||||
@ -96,7 +97,7 @@ public class HerobrineAI extends JavaPlugin implements Listener {
|
||||
nowloc.setYaw(1.0f);
|
||||
nowloc.setPitch(1.0f);
|
||||
spawnHerobrine(nowloc);
|
||||
HerobrineAI.herobrineNPC.setItemInHand(configdb.itemInHand.getItemStack());
|
||||
HerobrineAI.herobrineNPC.setItemInHand(configdb.ItemInHand.getItemStack());
|
||||
EntityInjector.inject();
|
||||
}
|
||||
|
||||
@ -151,13 +152,13 @@ public class HerobrineAI extends JavaPlugin implements Listener {
|
||||
boolean opCheck = true;
|
||||
boolean creativeCheck = true;
|
||||
boolean ignoreCheck = true;
|
||||
if (!configdb.attackOP && player.isOp()) {
|
||||
if (!configdb.AttackOP && player.isOp()) {
|
||||
opCheck = false;
|
||||
}
|
||||
if (!configdb.attackCreative && (player.getGameMode() == GameMode.CREATIVE)) {
|
||||
if (!configdb.AttackCreative && (player.getGameMode() == GameMode.CREATIVE)) {
|
||||
creativeCheck = false;
|
||||
}
|
||||
if (configdb.useIgnorePermission && player.hasPermission("herobrine.ignore")) {
|
||||
if (configdb.UseIgnorePermission && player.hasPermission("herobrine.ignore")) {
|
||||
ignoreCheck = false;
|
||||
}
|
||||
if (opCheck && creativeCheck && ignoreCheck) {
|
||||
@ -177,13 +178,13 @@ public class HerobrineAI extends JavaPlugin implements Listener {
|
||||
boolean opCheck = true;
|
||||
boolean creativeCheck = true;
|
||||
boolean ignoreCheck = true;
|
||||
if (!configdb.attackOP && player.isOp()) {
|
||||
if (!configdb.AttackOP && player.isOp()) {
|
||||
opCheck = false;
|
||||
}
|
||||
if (!configdb.attackCreative && (player.getGameMode() == GameMode.CREATIVE)) {
|
||||
if (!configdb.AttackCreative && (player.getGameMode() == GameMode.CREATIVE)) {
|
||||
creativeCheck = false;
|
||||
}
|
||||
if (configdb.useIgnorePermission && player.hasPermission("herobrine.ignore")) {
|
||||
if (configdb.UseIgnorePermission && player.hasPermission("herobrine.ignore")) {
|
||||
ignoreCheck = false;
|
||||
}
|
||||
if (opCheck && creativeCheck && ignoreCheck) {
|
||||
@ -203,13 +204,13 @@ public class HerobrineAI extends JavaPlugin implements Listener {
|
||||
boolean opCheck = true;
|
||||
boolean creativeCheck = true;
|
||||
boolean ignoreCheck = true;
|
||||
if (!configdb.attackOP && player.isOp()) {
|
||||
if (!configdb.AttackOP && player.isOp()) {
|
||||
opCheck = false;
|
||||
}
|
||||
if (!configdb.attackCreative && (player.getGameMode() == GameMode.CREATIVE)) {
|
||||
if (!configdb.AttackCreative && (player.getGameMode() == GameMode.CREATIVE)) {
|
||||
creativeCheck = false;
|
||||
}
|
||||
if (configdb.useIgnorePermission && player.hasPermission("herobrine.ignore")) {
|
||||
if (configdb.UseIgnorePermission && player.hasPermission("herobrine.ignore")) {
|
||||
ignoreCheck = false;
|
||||
}
|
||||
return opCheck && creativeCheck && ignoreCheck;
|
||||
|
Reference in New Issue
Block a user