From 36240343f915864cf056cab7d3084f9ff79d48de Mon Sep 17 00:00:00 2001 From: David Berdik Date: Fri, 6 Feb 2015 22:29:49 -0500 Subject: [PATCH] Worked on replacing HerobrineAI branding as well as improving improving plugin output. Work will continue with doing this in the BuildStuff.java file. --- src/org/jakub1221/herobrineai/AI/AICore.java | 8 +++---- .../herobrineai/AI/cores/Attack.java | 6 ++--- .../jakub1221/herobrineai/AI/cores/Book.java | 10 ++++----- src/org/jakub1221/herobrineai/ConfigDB.java | 6 ++--- .../jakub1221/herobrineai/HerobrineAI.java | 22 +++++++++---------- src/org/jakub1221/herobrineai/Support.java | 12 +++++----- src/plugin.yml | 6 ++--- 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/org/jakub1221/herobrineai/AI/AICore.java b/src/org/jakub1221/herobrineai/AI/AICore.java index 81759a2..f2e3083 100644 --- a/src/org/jakub1221/herobrineai/AI/AICore.java +++ b/src/org/jakub1221/herobrineai/AI/AICore.java @@ -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())) { diff --git a/src/org/jakub1221/herobrineai/AI/cores/Attack.java b/src/org/jakub1221/herobrineai/AI/cores/Attack.java index 6ac5c25..e7142a9 100644 --- a/src/org/jakub1221/herobrineai/AI/cores/Attack.java +++ b/src/org/jakub1221/herobrineai/AI/cores/Attack.java @@ -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() { diff --git a/src/org/jakub1221/herobrineai/AI/cores/Book.java b/src/org/jakub1221/herobrineai/AI/cores/Book.java index 301a398..7d9be67 100644 --- a/src/org/jakub1221/herobrineai/AI/cores/Book.java +++ b/src/org/jakub1221/herobrineai/AI/cores/Book.java @@ -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() { diff --git a/src/org/jakub1221/herobrineai/ConfigDB.java b/src/org/jakub1221/herobrineai/ConfigDB.java index efec2cc..134f26d 100644 --- a/src/org/jakub1221/herobrineai/ConfigDB.java +++ b/src/org/jakub1221/herobrineai/ConfigDB.java @@ -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 allWorlds = new ArrayList(); final List 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()); } } diff --git a/src/org/jakub1221/herobrineai/HerobrineAI.java b/src/org/jakub1221/herobrineai/HerobrineAI.java index 649bfdd..3b70f35 100644 --- a/src/org/jakub1221/herobrineai/HerobrineAI.java +++ b/src/org/jakub1221/herobrineai/HerobrineAI.java @@ -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; diff --git a/src/org/jakub1221/herobrineai/Support.java b/src/org/jakub1221/herobrineai/Support.java index 9035023..87855f1 100644 --- a/src/org/jakub1221/herobrineai/Support.java +++ b/src/org/jakub1221/herobrineai/Support.java @@ -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."); } } diff --git a/src/plugin.yml b/src/plugin.yml index 4c6bc7c..e251c65 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -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 \ No newline at end of file + usage: /herobrine help \ No newline at end of file