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