Worked on replacing HerobrineAI branding as well as improving improving plugin output. Work will continue with doing this in the BuildStuff.java file.
This commit is contained in:
parent
e9b4b7c2b9
commit
36240343f9
@ -65,7 +65,7 @@ public class AICore {
|
||||
public AICore() {
|
||||
AICore.plugin = HerobrineAI.getPluginCore();
|
||||
resetLimits = new ResetLimits();
|
||||
AICore.log.info("[HerobrineAI] Debug mode enabled!");
|
||||
AICore.log.info("[Herobrine] Herobrine is now running in debug mode.");
|
||||
findPlayer();
|
||||
startIntervals();
|
||||
}
|
||||
@ -132,7 +132,7 @@ public class AICore {
|
||||
AICore._ticks = 0;
|
||||
AICore.isTarget = false;
|
||||
HerobrineAI.HerobrineHP = HerobrineAI.HerobrineMaxHP;
|
||||
AICore.log.info("[HerobrineAI] Target cancelled.");
|
||||
AICore.log.info("[HerobrineAI] Cancelled teleporting of " + PlayerTarget.getDisplayName() + " to Herobrine's Graveyard.");
|
||||
final Location nowloc = new Location(Bukkit.getServer().getWorlds().get(0), 0.0, -20.0, 0.0);
|
||||
nowloc.setYaw(1.0f);
|
||||
nowloc.setPitch(1.0f);
|
||||
@ -154,7 +154,7 @@ public class AICore {
|
||||
final int chance = new Random().nextInt(100);
|
||||
if (chance <= 5) {
|
||||
if (HerobrineAI.getPluginCore().getConfigDB().useGraveyardWorld) {
|
||||
AICore.log.info("[HerobrineAI] Teleporting target to Graveyard world.");
|
||||
AICore.log.info("[Herobrine] Teleporting " + PlayerTarget.getDisplayName() + " to Herobrine's Graveyard.");
|
||||
getCore(Core.CoreType.GRAVEYARD).runCore(data);
|
||||
}
|
||||
} else if (chance <= 20) {
|
||||
@ -207,7 +207,7 @@ public class AICore {
|
||||
|
||||
private void pyramidInterval() {
|
||||
if (new Random().nextBoolean() && (Bukkit.getServer().getOnlinePlayers().size() > 0)) {
|
||||
AICore.log.info("[HerobrineAI] Finding pyramid target...");
|
||||
AICore.log.info("[Herobrine] Finding pyramid target...");
|
||||
final Player[] allOnPlayers = Bukkit.getServer().getOnlinePlayers().toArray(new Player[0]);
|
||||
final int playerRolled = Util.getRandomPlayerNum(allOnPlayers);
|
||||
if (HerobrineAI.getPluginCore().getConfigDB().useWorlds.contains(allOnPlayers[playerRolled].getLocation().getWorld().getName())) {
|
||||
|
@ -40,7 +40,7 @@ public class Attack extends Core {
|
||||
ticksToEnd = 0;
|
||||
AICore.PlayerTarget = player;
|
||||
AICore.isTarget = true;
|
||||
AICore.log.info("[HerobrineAI] Teleporting to target. (" + AICore.PlayerTarget.getName() + ")");
|
||||
AICore.log.info("[Herobrine] Teleporting Herobrine to " + AICore.PlayerTarget.getName() + ".");
|
||||
final Location ploc = AICore.PlayerTarget.getLocation();
|
||||
final Object[] data = { ploc };
|
||||
HerobrineAI.getPluginCore().getAICore().getCore(CoreType.DESTROY_TORCHES).runCore(data);
|
||||
@ -53,9 +53,9 @@ public class Attack extends Core {
|
||||
HerobrineAI.herobrineNPC.moveTo(tploc);
|
||||
Message.sendMessage(AICore.PlayerTarget);
|
||||
StartHandler();
|
||||
return new CoreResult(true, "Herobrine attacks " + player.getName() + "!");
|
||||
return new CoreResult(true, "Herobrine is currently attacking " + player.getName() + ".");
|
||||
}
|
||||
return new CoreResult(false, "Player is in secure area.");
|
||||
return new CoreResult(false, AICore.PlayerTarget.getName() + " cannot be attacked because they are in a protected area.");
|
||||
}
|
||||
|
||||
public void StopHandler() {
|
||||
|
@ -23,22 +23,22 @@ public class Book extends Core {
|
||||
final Player player = (Player) data[0];
|
||||
if (HerobrineAI.getPluginCore().getConfigDB().useWorlds.contains(player.getLocation().getWorld().getName())) {
|
||||
if (!HerobrineAI.getPluginCore().getConfigDB().writeBooks || !HerobrineAI.getPluginCore().getSupport().checkBooks(player.getLocation())) {
|
||||
return new CoreResult(false, "Player is not in allowed world!");
|
||||
return new CoreResult(false, player.getDisplayName() + " is in a world that Herobrine cannot haunt.");
|
||||
}
|
||||
final int chance = new Random().nextInt(100);
|
||||
if (chance <= (100 - HerobrineAI.getPluginCore().getConfigDB().bookChance)) {
|
||||
return new CoreResult(false, "Books are not allowed!");
|
||||
return new CoreResult(false, "Herobrine books are prohibited.");
|
||||
}
|
||||
final Inventory chest = (Inventory) data[1];
|
||||
if (chest.firstEmpty() == -1) {
|
||||
return new CoreResult(false, "Book create failed!");
|
||||
return new CoreResult(false, "Herobrine failed to create a book.");
|
||||
}
|
||||
if (HerobrineAI.getPluginCore().getAICore().getResetLimits().isBook()) {
|
||||
chest.setItem(chest.firstEmpty(), newBook());
|
||||
return new CoreResult(true, "Book created!");
|
||||
return new CoreResult(true, "Herobrine has created a book.");
|
||||
}
|
||||
}
|
||||
return new CoreResult(false, "Book create failed!");
|
||||
return new CoreResult(false, "Herobrine failed to create a book.");
|
||||
}
|
||||
|
||||
public ItemStack newBook() {
|
||||
|
@ -66,8 +66,8 @@ public class ConfigDB {
|
||||
public int maxHeads = 1;
|
||||
public boolean useIgnorePermission = true;
|
||||
public boolean useSound = true;
|
||||
public File configF = new File("plugins/HerobrineAI/config.yml");
|
||||
public File npcF = new File("plugins/HerobrineAI/npc.yml");
|
||||
public File configF = new File("plugins/Herobrine/config.yml");
|
||||
public File npcF = new File("plugins/Herobrine/npc.yml");
|
||||
|
||||
public void reload() {
|
||||
try {
|
||||
@ -143,7 +143,7 @@ public class ConfigDB {
|
||||
final ArrayList<String> allWorlds = new ArrayList<String>();
|
||||
final List<World> worlds_ = Bukkit.getWorlds();
|
||||
for (int i = 0; i <= (worlds_.size() - 1); ++i) {
|
||||
if (!worlds_.get(i).getName().equalsIgnoreCase("world_herobrineai_graveyard")) {
|
||||
if (!worlds_.get(i).getName().equalsIgnoreCase("world_herobrine_graveyard")) {
|
||||
allWorlds.add(worlds_.get(i).getName());
|
||||
}
|
||||
}
|
||||
|
@ -73,9 +73,9 @@ public class HerobrineAI extends JavaPlugin implements Listener {
|
||||
}
|
||||
|
||||
private void initHerobrine() {
|
||||
if (configdb.useGraveyardWorld && (Bukkit.getServer().getWorld("world_herobrineai_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_herobrineai_graveyard");
|
||||
final WorldCreator wc = new WorldCreator("world_herobrine_graveyard");
|
||||
wc.generateStructures(false);
|
||||
final WorldType type = WorldType.FLAT;
|
||||
wc.type(type);
|
||||
@ -157,18 +157,18 @@ public class HerobrineAI extends JavaPlugin implements Listener {
|
||||
if (!configdb.attackCreative && (player.getGameMode() == GameMode.CREATIVE)) {
|
||||
creativeCheck = false;
|
||||
}
|
||||
if (configdb.useIgnorePermission && player.hasPermission("hb-ai.ignore")) {
|
||||
if (configdb.useIgnorePermission && player.hasPermission("herobrine.ignore")) {
|
||||
ignoreCheck = false;
|
||||
}
|
||||
if (opCheck && creativeCheck && ignoreCheck) {
|
||||
return true;
|
||||
}
|
||||
if (!opCheck) {
|
||||
sender.sendMessage(ChatColor.RED + "[HerobrineAI] Player is OP.");
|
||||
sender.sendMessage(ChatColor.RED + "[Herobrine] " + player.getDisplayName() + " is an OP.");
|
||||
} else if (!creativeCheck) {
|
||||
sender.sendMessage(ChatColor.RED + "[HerobrineAI] Player is in Creative mode.");
|
||||
sender.sendMessage(ChatColor.RED + "[Herobrine] " + player.getDisplayName() + " is in creative mode.");
|
||||
} else if (!ignoreCheck) {
|
||||
sender.sendMessage(ChatColor.RED + "[HerobrineAI] Player has ignore permission.");
|
||||
sender.sendMessage(ChatColor.RED + "[Herobrine] " + player.getDisplayName() + " has ignore permissions.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -183,18 +183,18 @@ public class HerobrineAI extends JavaPlugin implements Listener {
|
||||
if (!configdb.attackCreative && (player.getGameMode() == GameMode.CREATIVE)) {
|
||||
creativeCheck = false;
|
||||
}
|
||||
if (configdb.useIgnorePermission && player.hasPermission("hb-ai.ignore")) {
|
||||
if (configdb.useIgnorePermission && player.hasPermission("herobrine.ignore")) {
|
||||
ignoreCheck = false;
|
||||
}
|
||||
if (opCheck && creativeCheck && ignoreCheck) {
|
||||
return true;
|
||||
}
|
||||
if (!opCheck) {
|
||||
HerobrineAI.log.info("[HerobrineAI] Player is OP.");
|
||||
HerobrineAI.log.info("[Herobrine] " + player.getDisplayName() + " is an OP.");
|
||||
} else if (!creativeCheck) {
|
||||
HerobrineAI.log.info("[HerobrineAI] Player is in Creative mode.");
|
||||
HerobrineAI.log.info("[Herobrine] " + player.getDisplayName() + " is in creative mode.");
|
||||
} else if (!ignoreCheck) {
|
||||
HerobrineAI.log.info("[HerobrineAI] Player has ignore permission.");
|
||||
HerobrineAI.log.info("[Herobrine] " + player.getDisplayName() + " has ignore permissions.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -209,7 +209,7 @@ public class HerobrineAI extends JavaPlugin implements Listener {
|
||||
if (!configdb.attackCreative && (player.getGameMode() == GameMode.CREATIVE)) {
|
||||
creativeCheck = false;
|
||||
}
|
||||
if (configdb.useIgnorePermission && player.hasPermission("hb-ai.ignore")) {
|
||||
if (configdb.useIgnorePermission && player.hasPermission("herobrine.ignore")) {
|
||||
ignoreCheck = false;
|
||||
}
|
||||
return opCheck && creativeCheck && ignoreCheck;
|
||||
|
@ -65,27 +65,27 @@ public class Support {
|
||||
public void CheckForPlugins() {
|
||||
if (ResidenceCore.Check()) {
|
||||
B_Residence = true;
|
||||
HerobrineAI.log.info("[HerobrineAI] Residence plugin detected!");
|
||||
HerobrineAI.log.info("[Herobrine] Residence plugin detected on server.");
|
||||
}
|
||||
if (GriefPreventionCore.Check()) {
|
||||
B_GriefPrevention = true;
|
||||
HerobrineAI.log.info("[HerobrineAI] GriefPrevention plugin detected!");
|
||||
HerobrineAI.log.info("[Herobrine] GriefPrevention plugin detected on server.");
|
||||
}
|
||||
if (TownyCore.Check()) {
|
||||
B_Towny = true;
|
||||
HerobrineAI.log.info("[HerobrineAI] Towny plugin detected!");
|
||||
HerobrineAI.log.info("[Herobrine] Towny plugin detected on server.");
|
||||
}
|
||||
if (WorldGuard.Check()) {
|
||||
B_WorldGuard = true;
|
||||
HerobrineAI.log.info("[HerobrineAI] WorldGuard plugin detected!");
|
||||
HerobrineAI.log.info("[Herobrine] WorldGuard plugin detected on server.");
|
||||
}
|
||||
if (PreciousStones.Check()) {
|
||||
B_PreciousStones = true;
|
||||
HerobrineAI.log.info("[HerobrineAI] PreciousStones plugin detected!");
|
||||
HerobrineAI.log.info("[Herobrine] PreciousStones plugin detected on server.");
|
||||
}
|
||||
if (Factions.Check()) {
|
||||
B_Factions = true;
|
||||
HerobrineAI.log.info("[HerobrineAI] Factions plugin detected!");
|
||||
HerobrineAI.log.info("[Herobrine] Factions plugin detected on server.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
name: HerobrineAI
|
||||
main: org.jakub1221.herobrineai.HerobrineAI
|
||||
version: 4.0
|
||||
version: 1.0.0
|
||||
commands:
|
||||
hb-ai:
|
||||
herobrine:
|
||||
description: Main command.
|
||||
usage: /hb-ai help
|
||||
usage: /herobrine help
|
Reference in New Issue
Block a user