Finished removing all traces of Herobrine AI branding. Improved plug-in output so that it is more useful and easier to understand.
This commit is contained in:
parent
36240343f9
commit
f3693d54d6
@ -28,33 +28,33 @@ public class BuildStuff extends Core {
|
|||||||
|
|
||||||
public CoreResult BuildCave(final Location loc) {
|
public CoreResult BuildCave(final Location loc) {
|
||||||
if (!HerobrineAI.getPluginCore().getConfigDB().buildStuff) {
|
if (!HerobrineAI.getPluginCore().getConfigDB().buildStuff) {
|
||||||
return new CoreResult(false, "Player is in secure location.");
|
return new CoreResult(false, "A cave cannot be created here because it is a protected area.");
|
||||||
}
|
}
|
||||||
if (!HerobrineAI.getPluginCore().getSupport().checkBuild(loc)) {
|
if (!HerobrineAI.getPluginCore().getSupport().checkBuild(loc)) {
|
||||||
return new CoreResult(false, "Cannot build stuff.");
|
return new CoreResult(false, "Cannot build stuff.");
|
||||||
}
|
}
|
||||||
if (loc.getBlockY() >= 60) {
|
if (loc.getBlockY() >= 60) {
|
||||||
return new CoreResult(false, "Location must be under 60 of Y.");
|
return new CoreResult(false, "Caves can only be generated in locations where the Y coordinate is less than or equal to 60.");
|
||||||
}
|
}
|
||||||
final int chance = new Random().nextInt(100);
|
final int chance = new Random().nextInt(100);
|
||||||
if (chance > (100 - HerobrineAI.getPluginCore().getConfigDB().caveChance)) {
|
if (chance > (100 - HerobrineAI.getPluginCore().getConfigDB().caveChance)) {
|
||||||
AICore.log.info("Creating cave...");
|
AICore.log.info("Creating cave...");
|
||||||
GenerateCave(loc);
|
GenerateCave(loc);
|
||||||
return new CoreResult(false, "Cave created!");
|
return new CoreResult(false, "Cave created.");
|
||||||
}
|
}
|
||||||
return new CoreResult(false, "Roll failed!");
|
return new CoreResult(false, "Cave generation failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public CoreResult BuildCave(final Location loc, final boolean cmd) {
|
public CoreResult BuildCave(final Location loc, final boolean cmd) {
|
||||||
if (!HerobrineAI.getPluginCore().getSupport().checkBuild(loc)) {
|
if (!HerobrineAI.getPluginCore().getSupport().checkBuild(loc)) {
|
||||||
return new CoreResult(false, "Player is in secure location.");
|
return new CoreResult(false, "A cave cannot be created here because it is a protected area.");
|
||||||
}
|
}
|
||||||
if (loc.getBlockY() < 60) {
|
if (loc.getBlockY() < 60) {
|
||||||
AICore.log.info("Creating cave...");
|
AICore.log.info("Creating cave...");
|
||||||
GenerateCave(loc);
|
GenerateCave(loc);
|
||||||
return new CoreResult(false, "Cave created!");
|
return new CoreResult(false, "Cave created.");
|
||||||
}
|
}
|
||||||
return new CoreResult(false, "Location must be under 60 of Y.");
|
return new CoreResult(false, "Caves can only be generated in locations where the Y coordinate is less than or equal to 60.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GenerateCave(final Location loc) {
|
public void GenerateCave(final Location loc) {
|
||||||
@ -101,7 +101,7 @@ public class BuildStuff extends Core {
|
|||||||
for (final Location _loc : redstoneTorchList) {
|
for (final Location _loc : redstoneTorchList) {
|
||||||
PlaceRedstoneTorch(_loc.getWorld(), _loc.getBlockX(), _loc.getBlockY(), _loc.getBlockZ());
|
PlaceRedstoneTorch(_loc.getWorld(), _loc.getBlockX(), _loc.getBlockY(), _loc.getBlockZ());
|
||||||
}
|
}
|
||||||
AICore.log.info("Cave created!");
|
AICore.log.info("Cave created.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ public class Burn extends Core {
|
|||||||
public CoreResult callCore(final Object[] data) {
|
public CoreResult callCore(final Object[] data) {
|
||||||
final Player player = (Player) data[0];
|
final Player player = (Player) data[0];
|
||||||
player.setFireTicks(800);
|
player.setFireTicks(800);
|
||||||
return new CoreResult(true, "Player burned!");
|
return new CoreResult(true, player.getDisplayName() + " was burned by Herobrine.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -40,10 +40,10 @@ public class BuryPlayer extends Core {
|
|||||||
&& HerobrineAI.isSolidBlock(loc.getWorld().getBlockAt(loc.getBlockX(), loc.getBlockY() - 1, loc.getBlockZ() - 2).getType())
|
&& HerobrineAI.isSolidBlock(loc.getWorld().getBlockAt(loc.getBlockX(), loc.getBlockY() - 1, loc.getBlockZ() - 2).getType())
|
||||||
&& !HerobrineAI.isAllowedBlock(loc.getWorld().getBlockAt(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ() - 2).getType())) {
|
&& !HerobrineAI.isAllowedBlock(loc.getWorld().getBlockAt(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ() - 2).getType())) {
|
||||||
Bury(loc.getWorld(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), player);
|
Bury(loc.getWorld(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), player);
|
||||||
return new CoreResult(true, "Player buried!");
|
return new CoreResult(true, player.getDisplayName() + " was buried by Herobrine.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new CoreResult(false, "Cannot find a good location!");
|
return new CoreResult(false, player.getDisplayName() + " could not be buried because a good burial location could not be found.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Bury(final World world, final int X, final int Y, final int Z, final Player player) {
|
public void Bury(final World world, final int X, final int Y, final int Z, final Player player) {
|
||||||
|
@ -35,7 +35,7 @@ public class Curse extends Core {
|
|||||||
}
|
}
|
||||||
}, i * 150L);
|
}, i * 150L);
|
||||||
}
|
}
|
||||||
return new CoreResult(true, "Player cursed!");
|
return new CoreResult(true, player.getDisplayName() + " has been cursed by Herobrine.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -32,13 +32,13 @@ public class DestroyTorches extends Core {
|
|||||||
for (iii = -HerobrineAI.getPluginCore().getConfigDB().destroyTorchesRadius; iii <= HerobrineAI.getPluginCore().getConfigDB().destroyTorchesRadius; ++iii) {
|
for (iii = -HerobrineAI.getPluginCore().getConfigDB().destroyTorchesRadius; iii <= HerobrineAI.getPluginCore().getConfigDB().destroyTorchesRadius; ++iii) {
|
||||||
if (world.getBlockAt(x + ii, y + i, z + iii).getType() == Material.TORCH) {
|
if (world.getBlockAt(x + ii, y + i, z + iii).getType() == Material.TORCH) {
|
||||||
world.getBlockAt(x + ii, y + i, z + iii).breakNaturally();
|
world.getBlockAt(x + ii, y + i, z + iii).breakNaturally();
|
||||||
return new CoreResult(true, "Torches destroyed!");
|
return new CoreResult(true, "Torches successfully destroyed by Herobrine.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new CoreResult(false, "Cannot destroy torches.");
|
return new CoreResult(false, "Herobrine could not destroy the torches.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -40,15 +40,15 @@ public class Graveyard extends Core {
|
|||||||
|
|
||||||
public CoreResult Teleport(final Player player) {
|
public CoreResult Teleport(final Player player) {
|
||||||
if (!HerobrineAI.getPluginCore().getConfigDB().useGraveyardWorld) {
|
if (!HerobrineAI.getPluginCore().getConfigDB().useGraveyardWorld) {
|
||||||
return new CoreResult(false, "Graveyard world is not allowed!");
|
return new CoreResult(false, "Herobrine's Graveyard is disabled on this server.");
|
||||||
}
|
}
|
||||||
LivingEntities = Bukkit.getServer().getWorld("world_herobrineai_graveyard").getLivingEntities();
|
LivingEntities = Bukkit.getServer().getWorld("world_herobrine_graveyard").getLivingEntities();
|
||||||
for (int i = 0; i <= (LivingEntities.size() - 1); ++i) {
|
for (int i = 0; i <= (LivingEntities.size() - 1); ++i) {
|
||||||
if (!(LivingEntities.get(i) instanceof Player) && (LivingEntities.get(i).getEntityId() != HerobrineAI.herobrineEntityID)) {
|
if (!(LivingEntities.get(i) instanceof Player) && (LivingEntities.get(i).getEntityId() != HerobrineAI.herobrineEntityID)) {
|
||||||
LivingEntities.get(i).remove();
|
LivingEntities.get(i).remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Bukkit.getServer().getWorld("world_herobrineai_graveyard").setTime(15000L);
|
Bukkit.getServer().getWorld("world_herobrine_graveyard").setTime(15000L);
|
||||||
HerobrineAI.getPluginCore().getAICore();
|
HerobrineAI.getPluginCore().getAICore();
|
||||||
AICore.PlayerTarget = player;
|
AICore.PlayerTarget = player;
|
||||||
final Location loc = player.getLocation();
|
final Location loc = player.getLocation();
|
||||||
@ -57,7 +57,7 @@ public class Graveyard extends Core {
|
|||||||
savedZ = loc.getZ();
|
savedZ = loc.getZ();
|
||||||
savedWorld = loc.getWorld();
|
savedWorld = loc.getWorld();
|
||||||
savedPlayer = player;
|
savedPlayer = player;
|
||||||
loc.setWorld(Bukkit.getServer().getWorld("world_herobrineai_graveyard"));
|
loc.setWorld(Bukkit.getServer().getWorld("world_herobrine_graveyard"));
|
||||||
loc.setX(-2.49);
|
loc.setX(-2.49);
|
||||||
loc.setY(4.0);
|
loc.setY(4.0);
|
||||||
loc.setZ(10.69);
|
loc.setZ(10.69);
|
||||||
@ -67,13 +67,13 @@ public class Graveyard extends Core {
|
|||||||
Start();
|
Start();
|
||||||
HerobrineAI.getPluginCore().getAICore();
|
HerobrineAI.getPluginCore().getAICore();
|
||||||
AICore.isTarget = true;
|
AICore.isTarget = true;
|
||||||
Bukkit.getServer().getWorld("world_herobrineai_graveyard").setStorm(false);
|
Bukkit.getServer().getWorld("world_herobrine_graveyard").setStorm(false);
|
||||||
return new CoreResult(true, "Player successfully teleported!");
|
return new CoreResult(true, player.getDisplayName() + " has been teleported to Herobrine's Graveyard.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Start() {
|
public void Start() {
|
||||||
ticks = 0;
|
ticks = 0;
|
||||||
HerobrineAI.herobrineNPC.moveTo(new Location(Bukkit.getServer().getWorld("world_herobrineai_graveyard"), -2.49, 4.0, -4.12));
|
HerobrineAI.herobrineNPC.moveTo(new Location(Bukkit.getServer().getWorld("world_herobrine_graveyard"), -2.49, 4.0, -4.12));
|
||||||
HandlerInterval();
|
HandlerInterval();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,31 +87,31 @@ public class Graveyard extends Core {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void Handler() {
|
public void Handler() {
|
||||||
LivingEntities = Bukkit.getServer().getWorld("world_herobrineai_graveyard").getLivingEntities();
|
LivingEntities = Bukkit.getServer().getWorld("world_herobrine_graveyard").getLivingEntities();
|
||||||
for (int i = 0; i <= (LivingEntities.size() - 1); ++i) {
|
for (int i = 0; i <= (LivingEntities.size() - 1); ++i) {
|
||||||
if (!(LivingEntities.get(i) instanceof Player) && (LivingEntities.get(i).getEntityId() != HerobrineAI.herobrineEntityID)) {
|
if (!(LivingEntities.get(i) instanceof Player) && (LivingEntities.get(i).getEntityId() != HerobrineAI.herobrineEntityID)) {
|
||||||
LivingEntities.get(i).remove();
|
LivingEntities.get(i).remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!savedPlayer.isDead() && savedPlayer.isOnline() && (savedPlayer.getLocation().getWorld() == Bukkit.getServer().getWorld("world_herobrineai_graveyard")) && (ticks != 90)) {
|
if (!savedPlayer.isDead() && savedPlayer.isOnline() && (savedPlayer.getLocation().getWorld() == Bukkit.getServer().getWorld("world_herobrine_graveyard")) && (ticks != 90)) {
|
||||||
HerobrineAI.getPluginCore().getAICore();
|
HerobrineAI.getPluginCore().getAICore();
|
||||||
if (AICore.isTarget) {
|
if (AICore.isTarget) {
|
||||||
final Location ploc = savedPlayer.getLocation();
|
final Location ploc = savedPlayer.getLocation();
|
||||||
ploc.setY(ploc.getY() + 1.5);
|
ploc.setY(ploc.getY() + 1.5);
|
||||||
HerobrineAI.herobrineNPC.lookAtPoint(ploc);
|
HerobrineAI.herobrineNPC.lookAtPoint(ploc);
|
||||||
if (ticks == 1) {
|
if (ticks == 1) {
|
||||||
HerobrineAI.herobrineNPC.moveTo(new Location(Bukkit.getServer().getWorld("world_herobrineai_graveyard"), -2.49, 4.0, -4.12));
|
HerobrineAI.herobrineNPC.moveTo(new Location(Bukkit.getServer().getWorld("world_herobrine_graveyard"), -2.49, 4.0, -4.12));
|
||||||
} else if (ticks == 40) {
|
} else if (ticks == 40) {
|
||||||
HerobrineAI.herobrineNPC.moveTo(new Location(Bukkit.getServer().getWorld("world_herobrineai_graveyard"), -2.49, 4.0, -0.5));
|
HerobrineAI.herobrineNPC.moveTo(new Location(Bukkit.getServer().getWorld("world_herobrine_graveyard"), -2.49, 4.0, -0.5));
|
||||||
} else if (ticks == 60) {
|
} else if (ticks == 60) {
|
||||||
HerobrineAI.herobrineNPC.moveTo(new Location(Bukkit.getServer().getWorld("world_herobrineai_graveyard"), -2.49, 4.0, 5.1));
|
HerobrineAI.herobrineNPC.moveTo(new Location(Bukkit.getServer().getWorld("world_herobrine_graveyard"), -2.49, 4.0, 5.1));
|
||||||
} else if (ticks == 84) {
|
} else if (ticks == 84) {
|
||||||
HerobrineAI.herobrineNPC.moveTo(new Location(Bukkit.getServer().getWorld("world_herobrineai_graveyard"), -2.49, 4.0, 7.5));
|
HerobrineAI.herobrineNPC.moveTo(new Location(Bukkit.getServer().getWorld("world_herobrine_graveyard"), -2.49, 4.0, 7.5));
|
||||||
}
|
}
|
||||||
if (new Random().nextInt(4) == 1) {
|
if (new Random().nextInt(4) == 1) {
|
||||||
final Location newloc = new Location(Bukkit.getServer().getWorld("world_herobrineai_graveyard"), new Random().nextInt(400), new Random().nextInt(20) + 20.0,
|
final Location newloc = new Location(Bukkit.getServer().getWorld("world_herobrine_graveyard"), new Random().nextInt(400), new Random().nextInt(20) + 20.0,
|
||||||
new Random().nextInt(400));
|
new Random().nextInt(400));
|
||||||
Bukkit.getServer().getWorld("world_herobrineai_graveyard").strikeLightning(newloc);
|
Bukkit.getServer().getWorld("world_herobrine_graveyard").strikeLightning(newloc);
|
||||||
}
|
}
|
||||||
++ticks;
|
++ticks;
|
||||||
HandlerInterval();
|
HandlerInterval();
|
||||||
|
@ -41,10 +41,10 @@ public class Haunt extends Core {
|
|||||||
|
|
||||||
public CoreResult setHauntTarget(final Player player) {
|
public CoreResult setHauntTarget(final Player player) {
|
||||||
if (!HerobrineAI.getPluginCore().getSupport().checkHaunt(player.getLocation())) {
|
if (!HerobrineAI.getPluginCore().getSupport().checkHaunt(player.getLocation())) {
|
||||||
return new CoreResult(false, "Player is in secure area!");
|
return new CoreResult(false, player.getDisplayName() + " cannot be haunted because they are in a protected area.");
|
||||||
}
|
}
|
||||||
if (!HerobrineAI.getPluginCore().canAttackPlayerNoMSG(player)) {
|
if (!HerobrineAI.getPluginCore().canAttackPlayerNoMSG(player)) {
|
||||||
return new CoreResult(false, "This player is protected.");
|
return new CoreResult(false, player.getDisplayName() + " is protected from being haunted by Herobrine.");
|
||||||
}
|
}
|
||||||
spawnedWolves = 0;
|
spawnedWolves = 0;
|
||||||
spawnedBats = 0;
|
spawnedBats = 0;
|
||||||
@ -52,12 +52,12 @@ public class Haunt extends Core {
|
|||||||
isFirst = true;
|
isFirst = true;
|
||||||
AICore.isTarget = true;
|
AICore.isTarget = true;
|
||||||
AICore.PlayerTarget = player;
|
AICore.PlayerTarget = player;
|
||||||
AICore.log.info("[HerobrineAI] Hauntig player!");
|
AICore.log.info("[HerobrineAI] Herobrine is now haunting " + player.getDisplayName() + ".");
|
||||||
final Location loc = HerobrineAI.herobrineNPC.getBukkitEntity().getLocation();
|
final Location loc = HerobrineAI.herobrineNPC.getBukkitEntity().getLocation();
|
||||||
loc.setY(-20.0);
|
loc.setY(-20.0);
|
||||||
HerobrineAI.herobrineNPC.moveTo(loc);
|
HerobrineAI.herobrineNPC.moveTo(loc);
|
||||||
StartHandler();
|
StartHandler();
|
||||||
return new CoreResult(true, "Herobrine haunts " + player.getName() + "!");
|
return new CoreResult(true, "Herobrine is now haunting " + player.getDisplayName() + ".");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PlaySounds() {
|
public void PlaySounds() {
|
||||||
|
@ -29,14 +29,14 @@ public class Heads extends Core {
|
|||||||
@Override
|
@Override
|
||||||
public CoreResult callCore(final Object[] data) {
|
public CoreResult callCore(final Object[] data) {
|
||||||
if (isCalled) {
|
if (isCalled) {
|
||||||
return new CoreResult(false, "There are already heads! Wait until they disappear.");
|
return new CoreResult(false, "This player is already being haunted by heads. Please wait until they disappear.");
|
||||||
}
|
}
|
||||||
if (!Bukkit.getPlayer((String) data[0]).isOnline()) {
|
if (!Bukkit.getPlayer((String) data[0]).isOnline()) {
|
||||||
return new CoreResult(false, "Player is offline.");
|
return new CoreResult(false, "This player cannot be haunted by heads because they are not online.");
|
||||||
}
|
}
|
||||||
final Player player = Bukkit.getServer().getPlayer((String) data[0]);
|
final Player player = Bukkit.getServer().getPlayer((String) data[0]);
|
||||||
if (!HerobrineAI.getPluginCore().getSupport().checkBuild(player.getLocation())) {
|
if (!HerobrineAI.getPluginCore().getSupport().checkBuild(player.getLocation())) {
|
||||||
return new CoreResult(false, "Player is in secure area!");
|
return new CoreResult(false, player.getDisplayName() + " cannot be haunted by heads because they are in a protected area.");
|
||||||
}
|
}
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().useHeads) {
|
if (HerobrineAI.getPluginCore().getConfigDB().useHeads) {
|
||||||
final Location loc = player.getLocation();
|
final Location loc = player.getLocation();
|
||||||
@ -66,9 +66,9 @@ public class Heads extends Core {
|
|||||||
Heads.this.RemoveHeads();
|
Heads.this.RemoveHeads();
|
||||||
}
|
}
|
||||||
}, 100L);
|
}, 100L);
|
||||||
return new CoreResult(true, "Spawned some heads near " + player.getName() + "!");
|
return new CoreResult(true, player.getName() + " is now being haunted by heads.");
|
||||||
}
|
}
|
||||||
return new CoreResult(false, "Heads are disabled!");
|
return new CoreResult(false, "Head haunting is disabled on this server.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveHeads() {
|
public void RemoveHeads() {
|
||||||
|
@ -57,11 +57,11 @@ public class Pyramid extends Core {
|
|||||||
}
|
}
|
||||||
if (canBuild) {
|
if (canBuild) {
|
||||||
BuildPyramid(loc.getWorld(), i2 + loc.getBlockX(), i1 + loc.getBlockY(), i3 + loc.getBlockZ());
|
BuildPyramid(loc.getWorld(), i2 + loc.getBlockX(), i1 + loc.getBlockY(), i3 + loc.getBlockZ());
|
||||||
return new CoreResult(true, "Creating a pyramid!");
|
return new CoreResult(true, "Creating pyramid...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new CoreResult(false, "Cannot create a pyramid!");
|
return new CoreResult(false, "Pyramid generation failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public CoreResult FindPlace(final Player player) {
|
public CoreResult FindPlace(final Player player) {
|
||||||
@ -99,13 +99,13 @@ public class Pyramid extends Core {
|
|||||||
}
|
}
|
||||||
if (canBuild) {
|
if (canBuild) {
|
||||||
BuildPyramid(loc.getWorld(), i2 + loc.getBlockX(), i1 + loc.getBlockY(), i3 + loc.getBlockZ());
|
BuildPyramid(loc.getWorld(), i2 + loc.getBlockX(), i1 + loc.getBlockY(), i3 + loc.getBlockZ());
|
||||||
return new CoreResult(true, "Creating a pyramid!");
|
return new CoreResult(true, "Creating a pyramid...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new CoreResult(false, "Cannot create a pyramid!");
|
return new CoreResult(false, "Pyramid generation failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BuildPyramid(final World world, final int X, final int Y, final int Z) {
|
public void BuildPyramid(final World world, final int X, final int Y, final int Z) {
|
||||||
|
@ -18,7 +18,7 @@ public class RandomExplosion extends Core {
|
|||||||
public CoreResult callCore(final Object[] data) {
|
public CoreResult callCore(final Object[] data) {
|
||||||
final Player player = (Player) data[0];
|
final Player player = (Player) data[0];
|
||||||
if (!HerobrineAI.getPluginCore().getConfigDB().explosions) {
|
if (!HerobrineAI.getPluginCore().getConfigDB().explosions) {
|
||||||
return new CoreResult(true, "Explosions are not allowed!");
|
return new CoreResult(true, "Herobrine-caused explosions are disabled on this server.");
|
||||||
}
|
}
|
||||||
if (HerobrineAI.getPluginCore().getSupport().checkBuild(player.getLocation())) {
|
if (HerobrineAI.getPluginCore().getSupport().checkBuild(player.getLocation())) {
|
||||||
final Location loc = player.getLocation();
|
final Location loc = player.getLocation();
|
||||||
@ -26,9 +26,10 @@ public class RandomExplosion extends Core {
|
|||||||
final int y = loc.getBlockY();
|
final int y = loc.getBlockY();
|
||||||
final int z = loc.getBlockZ() + (new Random().nextInt(16) - 8);
|
final int z = loc.getBlockZ() + (new Random().nextInt(16) - 8);
|
||||||
loc.getWorld().createExplosion(new Location(loc.getWorld(), x, y, z), 1.0f);
|
loc.getWorld().createExplosion(new Location(loc.getWorld(), x, y, z), 1.0f);
|
||||||
return new CoreResult(true, "Explosion near the player!");
|
return new CoreResult(true, "A Herobrine-caused explosion was set off near " + player.getDisplayName());
|
||||||
}
|
}
|
||||||
return new CoreResult(true, "Player is in secure area!");
|
return new CoreResult(true, "A Herobrine-caused explosion cannot be set off near " + player.getDisplayName() + " because " +
|
||||||
|
"they are in a protected area.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -21,7 +21,7 @@ public class RandomSound extends Core {
|
|||||||
}
|
}
|
||||||
}, multip * 30L);
|
}, multip * 30L);
|
||||||
}
|
}
|
||||||
return new CoreResult(true, "Starting sound play to target!");
|
return new CoreResult(true, "Herobrine haunted the target with sound.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -25,7 +25,7 @@ public class Signs extends Core {
|
|||||||
|
|
||||||
public CoreResult placeSign(final Location loc, final Location ploc) {
|
public CoreResult placeSign(final Location loc, final Location ploc) {
|
||||||
boolean status = false;
|
boolean status = false;
|
||||||
AICore.log.info("Generating sign location...");
|
AICore.log.info("Generating sign...");
|
||||||
if ((loc.getWorld().getBlockAt(loc.getBlockX() + 2, loc.getBlockY(), loc.getBlockZ()).getType() == Material.AIR)
|
if ((loc.getWorld().getBlockAt(loc.getBlockX() + 2, loc.getBlockY(), loc.getBlockZ()).getType() == Material.AIR)
|
||||||
&& (loc.getWorld().getBlockAt(loc.getBlockX() + 2, loc.getBlockY() - 1, loc.getBlockZ()).getType() != Material.AIR)) {
|
&& (loc.getWorld().getBlockAt(loc.getBlockX() + 2, loc.getBlockY() - 1, loc.getBlockZ()).getType() != Material.AIR)) {
|
||||||
loc.setX(loc.getBlockX() + 2);
|
loc.setX(loc.getBlockX() + 2);
|
||||||
@ -48,9 +48,9 @@ public class Signs extends Core {
|
|||||||
status = true;
|
status = true;
|
||||||
}
|
}
|
||||||
if (status) {
|
if (status) {
|
||||||
return new CoreResult(true, "Sign placed!");
|
return new CoreResult(true, "Sign generated successfully.");
|
||||||
}
|
}
|
||||||
return new CoreResult(false, "Cannot place a sign!");
|
return new CoreResult(false, "Sign generation failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
|
@ -21,7 +21,7 @@ public class SoundF extends Core {
|
|||||||
|
|
||||||
public CoreResult playRandom(final Player player) {
|
public CoreResult playRandom(final Player player) {
|
||||||
if (!HerobrineAI.getPluginCore().getConfigDB().useSound) {
|
if (!HerobrineAI.getPluginCore().getConfigDB().useSound) {
|
||||||
return new CoreResult(false, "Sound is disabled!");
|
return new CoreResult(false, "Herobrine-caused sound is disabled on this server.");
|
||||||
}
|
}
|
||||||
final Sound[] sounds = { Sound.STEP_STONE, Sound.STEP_WOOD, Sound.STEP_GRASS, Sound.STEP_SAND, Sound.STEP_GRAVEL, Sound.WITHER_HURT, Sound.WITHER_HURT, Sound.WITHER_HURT, Sound.WITHER_HURT,
|
final Sound[] sounds = { Sound.STEP_STONE, Sound.STEP_WOOD, Sound.STEP_GRASS, Sound.STEP_SAND, Sound.STEP_GRAVEL, Sound.WITHER_HURT, Sound.WITHER_HURT, Sound.WITHER_HURT, Sound.WITHER_HURT,
|
||||||
Sound.DOOR_OPEN, Sound.DOOR_CLOSE, Sound.GHAST_SCREAM, Sound.GHAST_SCREAM2, Sound.WITHER_DEATH, Sound.WITHER_HURT };
|
Sound.DOOR_OPEN, Sound.DOOR_CLOSE, Sound.GHAST_SCREAM, Sound.GHAST_SCREAM2, Sound.WITHER_DEATH, Sound.WITHER_HURT };
|
||||||
@ -37,7 +37,7 @@ public class SoundF extends Core {
|
|||||||
randz = -randz;
|
randz = -randz;
|
||||||
}
|
}
|
||||||
player.playSound(player.getLocation(), sounds[chance], 0.75f, 0.75f);
|
player.playSound(player.getLocation(), sounds[chance], 0.75f, 0.75f);
|
||||||
return new CoreResult(true, "SoundF is starting!");
|
return new CoreResult(true, "SoundF is starting.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -109,7 +109,7 @@ public class Totem extends Core {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new CoreResult(false, "Totem called!");
|
return new CoreResult(false, "Totem called.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -9,7 +9,7 @@ import org.jakub1221.herobrineai.misc.StructureLoader;
|
|||||||
public class GraveyardWorld {
|
public class GraveyardWorld {
|
||||||
|
|
||||||
public static void create() {
|
public static void create() {
|
||||||
final Location loc = new Location(Bukkit.getServer().getWorld("world_herobrineai_graveyard"), 0.0, 3.0, 0.0);
|
final Location loc = new Location(Bukkit.getServer().getWorld("world_herobrine_graveyard"), 0.0, 3.0, 0.0);
|
||||||
for (int x = -50; x <= 50; ++x) {
|
for (int x = -50; x <= 50; ++x) {
|
||||||
for (int z = -50; z <= 50; ++z) {
|
for (int z = -50; z <= 50; ++z) {
|
||||||
loc.getWorld().getBlockAt(x, 3, z).setType(Material.MYCEL);
|
loc.getWorld().getBlockAt(x, 3, z).setType(Material.MYCEL);
|
||||||
|
@ -63,7 +63,7 @@ public class HerobrineAI extends JavaPlugin implements Listener {
|
|||||||
entMng = new EntityManager();
|
entMng = new EntityManager();
|
||||||
NPCCore = new NPCCore();
|
NPCCore = new NPCCore();
|
||||||
configdb.reload();
|
configdb.reload();
|
||||||
getCommand("hb-ai").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);
|
||||||
getServer().getPluginManager().registerEvents(new InventoryListener(), this);
|
getServer().getPluginManager().registerEvents(new InventoryListener(), this);
|
||||||
|
@ -33,250 +33,284 @@ public class CmdExecutor implements CommandExecutor {
|
|||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
if (args[0].equalsIgnoreCase("attack")) {
|
if (args[0].equalsIgnoreCase("attack")) {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
if (player.hasPermission("hb-ai.attack")) {
|
if (player.hasPermission("herobrine.attack")) {
|
||||||
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
||||||
if (Bukkit.getServer().getPlayer(args[1]).isOnline()) {
|
if (Bukkit.getServer().getPlayer(args[1]).isOnline()) {
|
||||||
if (P_Core.getSupport().checkAttack(Bukkit.getServer().getPlayer(args[1]).getLocation())) {
|
if (P_Core.getSupport().checkAttack(Bukkit.getServer().getPlayer(args[1]).getLocation())) {
|
||||||
if (P_Core.canAttackPlayer(Bukkit.getServer().getPlayer(args[1]), player)) {
|
if (P_Core.canAttackPlayer(Bukkit.getServer().getPlayer(args[1]), player)) {
|
||||||
if (!AICore.isTarget) {
|
if (!AICore.isTarget) {
|
||||||
P_Core.getAICore().setAttackTarget(Bukkit.getServer().getPlayer(args[1]));
|
P_Core.getAICore().setAttackTarget(Bukkit.getServer().getPlayer(args[1]));
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Herobrine is now attacking the " + args[1] + "!");
|
player.sendMessage(ChatColor.RED + "[Herobrine] Herobrine is now attacking " + args[1] + ".");
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Herobrine already has target! Use " + ChatColor.GREEN + "/hb-ai cancel" + ChatColor.RED
|
player.sendMessage(ChatColor.RED + "[Herobrine] Herobrine is already attacking " +
|
||||||
+ " to cancel actual target");
|
args[1] + ". Use " + ChatColor.GREEN + "/herobrine cancel" + ChatColor.RED
|
||||||
|
+ " to stop the attack.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Player is in secure area.");
|
player.sendMessage(ChatColor.RED + "[Herobrine] " + args[1] + " cannot be attacked because " +
|
||||||
|
"they are in a secure area.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Player is offline.");
|
player.sendMessage(ChatColor.RED + "[Herobrine] " + args[1] + " cannot be attacked because they " +
|
||||||
|
"are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Player is offline.");
|
player.sendMessage(ChatColor.RED + "[Herobrine] " + args[1] + " cannot be attacked because they " +
|
||||||
|
"are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "You don?t have permissions to do that.");
|
player.sendMessage(ChatColor.RED + "You do not have the necessary permissions to initiate Herobrine " +
|
||||||
|
"attacks against other players.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "Usage: " + ChatColor.GREEN + "/hb-ai attack <player name>");
|
player.sendMessage(ChatColor.RED + "Usage: " + ChatColor.GREEN + "/herobrine attack <player name>");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("pyramid")) {
|
} else if (args[0].equalsIgnoreCase("pyramid")) {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
if (player.hasPermission("hb-ai.pyramid")) {
|
if (player.hasPermission("herobrine.pyramid")) {
|
||||||
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
||||||
if (Bukkit.getServer().getPlayer(args[1]).isOnline()) {
|
if (Bukkit.getServer().getPlayer(args[1]).isOnline()) {
|
||||||
if (P_Core.getSupport().checkBuild(Bukkit.getServer().getPlayer(args[1]).getLocation())) {
|
if (P_Core.getSupport().checkBuild(Bukkit.getServer().getPlayer(args[1]).getLocation())) {
|
||||||
final Object[] data = { Bukkit.getServer().getPlayer(args[1]) };
|
final Object[] data = { Bukkit.getServer().getPlayer(args[1]) };
|
||||||
if (P_Core.getAICore().getCore(Core.CoreType.PYRAMID).runCore(data).getResult()) {
|
if (P_Core.getAICore().getCore(Core.CoreType.PYRAMID).runCore(data).getResult()) {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Creating pyramind near " + args[1] + "!");
|
player.sendMessage(ChatColor.RED + "[Herobrine] Generating a pyramind near " + args[1] +
|
||||||
|
".");
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Cannot find good place for pyramid!");
|
player.sendMessage(ChatColor.RED + "[Herobrine] A pyramid could not be generated near " +
|
||||||
|
args[1] + " because there is no good place for it near them.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Player is in secure area.");
|
player.sendMessage(ChatColor.RED + "[Herobrine] A pyramid could not be generated near " +
|
||||||
|
args[1] + " because they are in a protected area.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Player is offline.");
|
player.sendMessage(ChatColor.RED + "[Herobrine] A pyramid could not be generated near " + args[1] +
|
||||||
|
" because they are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Player is offline.");
|
player.sendMessage(ChatColor.RED + "[Herobrine] A pyramid could not be generated near " + args[1] +
|
||||||
|
" because they are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "You don?t have permissions to do that.");
|
player.sendMessage(ChatColor.RED + "You do not have the necessary permissions to create Herobrine-" +
|
||||||
|
"built pyramids near players.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "Usage: " + ChatColor.GREEN + "/hb-ai pyramid <player name>");
|
player.sendMessage(ChatColor.RED + "Usage: " + ChatColor.GREEN + "/herobrine pyramid <player name>");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("bury")) {
|
} else if (args[0].equalsIgnoreCase("bury")) {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
if (player.hasPermission("hb-ai.bury")) {
|
if (player.hasPermission("herobrine.bury")) {
|
||||||
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
||||||
if (Bukkit.getServer().getPlayer(args[1]).isOnline()) {
|
if (Bukkit.getServer().getPlayer(args[1]).isOnline()) {
|
||||||
if (P_Core.getSupport().checkBuild(Bukkit.getServer().getPlayer(args[1]).getLocation())) {
|
if (P_Core.getSupport().checkBuild(Bukkit.getServer().getPlayer(args[1]).getLocation())) {
|
||||||
final Object[] data = { Bukkit.getServer().getPlayer(args[1]) };
|
final Object[] data = { Bukkit.getServer().getPlayer(args[1]) };
|
||||||
if (P_Core.getAICore().getCore(Core.CoreType.BURY_PLAYER).runCore(data).getResult()) {
|
if (P_Core.getAICore().getCore(Core.CoreType.BURY_PLAYER).runCore(data).getResult()) {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Buried " + args[1] + "!");
|
player.sendMessage(ChatColor.RED + "[Herobrine] Herobrine has buried " + args[1] + ".");
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Cannot find good place!");
|
player.sendMessage(ChatColor.RED + "[Herobrine] " + args[1] + " could not be buried " +
|
||||||
|
"because there is no good place to bury them.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Player is in secure area.");
|
player.sendMessage(ChatColor.RED + "[Herobrine] " + args[1] + " could not be buried " +
|
||||||
|
"because they are are in a protected area.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Player is offline.");
|
player.sendMessage(ChatColor.RED + "[Herobrine] " + args[1] + " could not be buried because " +
|
||||||
|
"they are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Player is offline.");
|
player.sendMessage(ChatColor.RED + "[Herobrine] " + args[1] + " could not be buried because " +
|
||||||
|
"they are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "You don?t have permissions to do that.");
|
player.sendMessage(ChatColor.RED + "You do not have the necessary permissions to bury players.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "Usage: " + ChatColor.GREEN + "/hb-ai bury <player name>");
|
player.sendMessage(ChatColor.RED + "Usage: " + ChatColor.GREEN + "/herobrine bury <player name>");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("cave")) {
|
} else if (args[0].equalsIgnoreCase("cave")) {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
if (player.hasPermission("hb-ai.cave")) {
|
if (player.hasPermission("herobrine.cave")) {
|
||||||
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
||||||
final Object[] data = { Bukkit.getServer().getPlayer(args[1]).getLocation(), true };
|
final Object[] data = { Bukkit.getServer().getPlayer(args[1]).getLocation(), true };
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] " + P_Core.getAICore().getCore(Core.CoreType.BUILD_STUFF).runCore(data).getResultString());
|
player.sendMessage(ChatColor.RED + "[Herobrine] " + P_Core.getAICore().getCore(Core.CoreType.BUILD_STUFF).runCore(data).getResultString());
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Player is offline.");
|
player.sendMessage(ChatColor.RED + "[Herobrine] A cave could not be created near " + args[1] +
|
||||||
|
" because they are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "You don?t have permissions to do that.");
|
player.sendMessage(ChatColor.RED + "You do not have the necessary permissions to create caves near " +
|
||||||
|
"players.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "Usage: " + ChatColor.GREEN + "/hb-ai cave <player name>");
|
player.sendMessage(ChatColor.RED + "Usage: " + ChatColor.GREEN + "/herobrine cave <player name>");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("burn")) {
|
} else if (args[0].equalsIgnoreCase("burn")) {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
if (player.hasPermission("hb-ai.burn")) {
|
if (player.hasPermission("herobrine.burn")) {
|
||||||
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
||||||
final Object[] data = { Bukkit.getServer().getPlayer(args[1]) };
|
final Object[] data = { Bukkit.getServer().getPlayer(args[1]) };
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] " + P_Core.getAICore().getCore(Core.CoreType.BURN).runCore(data).getResultString());
|
player.sendMessage(ChatColor.RED + "[Herobrine] " + P_Core.getAICore().getCore(Core.CoreType.BURN).runCore(data).getResultString());
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Player is offline.");
|
player.sendMessage(ChatColor.RED + "[Herobrine] " + args[1] + " could not be burned because they " +
|
||||||
|
"not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "You don?t have permissions to do that.");
|
player.sendMessage(ChatColor.RED + "You do not have the necessary permissions to tell Herobrine " +
|
||||||
|
"to burn players.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "Usage: " + ChatColor.GREEN + "/hb-ai burn <player name>");
|
player.sendMessage(ChatColor.RED + "Usage: " + ChatColor.GREEN + "/herobrine burn <player name>");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("curse")) {
|
} else if (args[0].equalsIgnoreCase("curse")) {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
if (player.hasPermission("hb-ai.curse")) {
|
if (player.hasPermission("herobrine.curse")) {
|
||||||
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
||||||
final Object[] data = { Bukkit.getServer().getPlayer(args[1]) };
|
final Object[] data = { Bukkit.getServer().getPlayer(args[1]) };
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] " + P_Core.getAICore().getCore(Core.CoreType.CURSE).runCore(data).getResultString());
|
player.sendMessage(ChatColor.RED + "[Herobrine] " + P_Core.getAICore().getCore(Core.CoreType.CURSE).runCore(data).getResultString());
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Player is offline.");
|
player.sendMessage(ChatColor.RED + "[Herobrine] " + args[1] + " cannot be cursed because they " +
|
||||||
|
"are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "You don?t have permissions to do that.");
|
player.sendMessage(ChatColor.RED + "You do not have the necessary permissions to tell Herobrine " +
|
||||||
|
"to curse players.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "Usage: " + ChatColor.GREEN + "/hb-ai curse <player name>");
|
player.sendMessage(ChatColor.RED + "Usage: " + ChatColor.GREEN + "/herobrine curse <player name>");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("heads")) {
|
} else if (args[0].equalsIgnoreCase("heads")) {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
if (player.hasPermission("hb-ai.heads")) {
|
if (player.hasPermission("herobrine.heads")) {
|
||||||
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
||||||
final Object[] data = { args[1] };
|
final Object[] data = { args[1] };
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] " + P_Core.getAICore().getCore(Core.CoreType.HEADS).runCore(data).getResultString());
|
player.sendMessage(ChatColor.RED + "[Herobrine] " + P_Core.getAICore().getCore(Core.CoreType.HEADS).runCore(data).getResultString());
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Player is offline.");
|
player.sendMessage(ChatColor.RED + "[Herobrine] " + args[1] + " cannot be haunted by heads because " +
|
||||||
|
"they are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "You don?t have permissions to do that.");
|
player.sendMessage(ChatColor.RED + "You do not have the necessary permissions to haunt players " +
|
||||||
|
"with heads.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "Usage: " + ChatColor.GREEN + "/hb-ai heads <player name>");
|
player.sendMessage(ChatColor.RED + "Usage: " + ChatColor.GREEN + "/herobrine heads <player name>");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("graveyard")) {
|
} else if (args[0].equalsIgnoreCase("graveyard")) {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
if (player.hasPermission("hb-ai.graveyard")) {
|
if (player.hasPermission("herobrine.graveyard")) {
|
||||||
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
||||||
if (Bukkit.getServer().getPlayer(args[1]).isOnline()) {
|
if (Bukkit.getServer().getPlayer(args[1]).isOnline()) {
|
||||||
if (!AICore.isTarget) {
|
if (!AICore.isTarget) {
|
||||||
P_Core.getAICore().graveyardTeleport(Bukkit.getServer().getPlayer(args[1]));
|
P_Core.getAICore().graveyardTeleport(Bukkit.getServer().getPlayer(args[1]));
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] " + args[1] + " is now in the Graveyard world!");
|
player.sendMessage(ChatColor.RED + "[Herobrine] " + args[1] + " has been teleported to " +
|
||||||
|
"Herobrine's Graveyard.");
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Herobrine already has target! Use " + ChatColor.GREEN + "/hb-ai cancel" + ChatColor.RED
|
player.sendMessage(ChatColor.RED + "[Herobrine] Another player is already in Herobrine's " +
|
||||||
+ " to cancel actual target");
|
"Graveyard. Use " + ChatColor.GREEN + "/herobrine cancel" + ChatColor.RED
|
||||||
|
+ " to teleport the current player out of the graveyard.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Player is offline.");
|
player.sendMessage(ChatColor.RED + "[Herobrine] " + args[1] + " cannot be teleported to " +
|
||||||
|
"Herobrine's Graveyard because they are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Player is offline.");
|
player.sendMessage(ChatColor.RED + "[Herobrine] " + args[1] + " cannot be teleported to " +
|
||||||
|
"Herobrine's Graveyard because they are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "You don?t have permissions to do that.");
|
player.sendMessage(ChatColor.RED + "You do not have the permissions necessary to teleport players " +
|
||||||
|
"to Herobrine's Graveyard.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "Usage: " + ChatColor.GREEN + "/hb-ai graveyard <player name>");
|
player.sendMessage(ChatColor.RED + "Usage: " + ChatColor.GREEN + "/herobrine graveyard <player name>");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("haunt")) {
|
} else if (args[0].equalsIgnoreCase("haunt")) {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
if (player.hasPermission("hb-ai.haunt")) {
|
if (player.hasPermission("herobrine.haunt")) {
|
||||||
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
||||||
if (Bukkit.getServer().getPlayer(args[1]).isOnline()) {
|
if (Bukkit.getServer().getPlayer(args[1]).isOnline()) {
|
||||||
if (P_Core.getSupport().checkHaunt(Bukkit.getServer().getPlayer(args[1]).getLocation())) {
|
if (P_Core.getSupport().checkHaunt(Bukkit.getServer().getPlayer(args[1]).getLocation())) {
|
||||||
if (P_Core.canAttackPlayer(Bukkit.getServer().getPlayer(args[1]), player)) {
|
if (P_Core.canAttackPlayer(Bukkit.getServer().getPlayer(args[1]), player)) {
|
||||||
if (!AICore.isTarget) {
|
if (!AICore.isTarget) {
|
||||||
P_Core.getAICore().setHauntTarget(Bukkit.getServer().getPlayer(args[1]));
|
P_Core.getAICore().setHauntTarget(Bukkit.getServer().getPlayer(args[1]));
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Herobrine now haunts the " + args[1] + "!");
|
player.sendMessage(ChatColor.RED + "[Herobrine] Herobrine is now haunting " + args[1] + ".");
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Herobrine already has target! Use " + ChatColor.GREEN + "/hb-ai cancel" + ChatColor.RED
|
player.sendMessage(ChatColor.RED + "[Herobrine] Herobrine is already haunting another player. Use " +
|
||||||
+ " to cancel actual target.");
|
ChatColor.GREEN + "/herobrine cancel" + ChatColor.RED + " to cancel the current haunting.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Player is in secure area.");
|
player.sendMessage(ChatColor.RED + "[Herobrine] " + args[1] + " cannot be haunted because they" +
|
||||||
|
" are currently in a protected area.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Player is offline.");
|
player.sendMessage(ChatColor.RED + "[Herobrine] " + args[1] + " cannot be haunted because they " +
|
||||||
|
"are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Player is offline.");
|
player.sendMessage(ChatColor.RED + "[Herobrine] " + args[1] + " cannot be haunted because they " +
|
||||||
|
"are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "You don?t have permissions to do that.");
|
player.sendMessage(ChatColor.RED + "You do not have the necessary permissions to initiate Herobrine " +
|
||||||
|
"hauntings.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "Usage: " + ChatColor.GREEN + "/hb-ai haunt <player name>");
|
player.sendMessage(ChatColor.RED + "Usage: " + ChatColor.GREEN + "/herobrine haunt <player name>");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("cancel")) {
|
} else if (args[0].equalsIgnoreCase("cancel")) {
|
||||||
if (player.hasPermission("hb-ai.cancel")) {
|
if (player.hasPermission("herobrine.cancel")) {
|
||||||
P_Core.getAICore().cancelTarget(Core.CoreType.ANY);
|
P_Core.getAICore().cancelTarget(Core.CoreType.ANY);
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Target cancelled!");
|
player.sendMessage(ChatColor.RED + "[Herobrine] The current Herobrine victim has been saved.");
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "You don?t have permissions to do that.");
|
player.sendMessage(ChatColor.RED + "You do not have the necessary permissions to cancel Herobrine's " +
|
||||||
|
"actions.");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("reload")) {
|
} else if (args[0].equalsIgnoreCase("reload")) {
|
||||||
if (player.hasPermission("hb-ai.reload")) {
|
if (player.hasPermission("herobrine.reload")) {
|
||||||
P_Core.getConfigDB().reload();
|
P_Core.getConfigDB().reload();
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Config reloaded!");
|
player.sendMessage(ChatColor.RED + "[Herobrine] Herobrine configuration file reloaded.");
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "You don?t have permissions to do that.");
|
player.sendMessage(ChatColor.RED + "You do not have the necessary permissions to reload Herobrine's " +
|
||||||
|
"configuration file.");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("help")) {
|
} else if (args[0].equalsIgnoreCase("help")) {
|
||||||
if (player.hasPermission("hb-ai.help")) {
|
if (player.hasPermission("herobrine.help")) {
|
||||||
player.sendMessage(ChatColor.RED + "[HerobrineAI] Command list");
|
player.sendMessage(ChatColor.RED + "[Herobrine] Command List");
|
||||||
player.sendMessage(ChatColor.GREEN + "/hb-ai help - shows all commands");
|
player.sendMessage(ChatColor.GREEN + "/herobrine help - Shows this list of Herobrine commands");
|
||||||
player.sendMessage(ChatColor.GREEN + "/hb-ai attack <player name> - herobrine attacks the player");
|
player.sendMessage(ChatColor.GREEN + "/herobrine attack <player name> - Sends Herobrine to attack the specified player");
|
||||||
player.sendMessage(ChatColor.GREEN + "/hb-ai haunt <player name> - herobrine haunts the player");
|
player.sendMessage(ChatColor.GREEN + "/herobrine haunt <player name> - Sends Herobrine to haunt the specified player");
|
||||||
player.sendMessage(ChatColor.GREEN + "/hb-ai cancel - cancel herobrine?s actual target");
|
player.sendMessage(ChatColor.GREEN + "/herobrine cancel - Cancel's Herobrine's current actions against his current target");
|
||||||
player.sendMessage(ChatColor.GREEN + "/hb-ai reload - reload config");
|
player.sendMessage(ChatColor.GREEN + "/herobrine reload - Reloads the Herobrine configuration file");
|
||||||
player.sendMessage(ChatColor.GREEN + "/hb-ai position - gets actual position of Herobrine");
|
player.sendMessage(ChatColor.GREEN + "/herobrine position - Displays the coordinates of Herobrine's current location");
|
||||||
player.sendMessage(ChatColor.GREEN + "/hb-ai pyramid <player name> - build pyramid near the player");
|
player.sendMessage(ChatColor.GREEN + "/herobrine pyramid <player name> - Builds a pyramid near the specified player");
|
||||||
player.sendMessage(ChatColor.GREEN + "/hb-ai bury <player name> - bury player");
|
player.sendMessage(ChatColor.GREEN + "/herobrine bury <player name> - Buries the specified player");
|
||||||
player.sendMessage(ChatColor.GREEN + "/hb-ai graveyard <player name> - teleport player to the Graveyard world");
|
player.sendMessage(ChatColor.GREEN + "/herobrine graveyard <player name> - Teleports the specified player to Herobrine's Graveyard");
|
||||||
player.sendMessage(ChatColor.GREEN + "/hb-ai temple <player name> - build temple near the player");
|
player.sendMessage(ChatColor.GREEN + "/herobrine temple <player name> - Builds a temple near the specified player");
|
||||||
player.sendMessage(ChatColor.GREEN + "/hb-ai heads <player name> - place heads near the player");
|
player.sendMessage(ChatColor.GREEN + "/herobrine heads <player name> - Spawns heads near the specified player");
|
||||||
player.sendMessage(ChatColor.GREEN + "/hb-ai cave <player name> - create cave near the player");
|
player.sendMessage(ChatColor.GREEN + "/herobrine cave <player name> - Creates a cave near the specified player");
|
||||||
player.sendMessage(ChatColor.GREEN + "/hb-ai burn <player name> - burn player");
|
player.sendMessage(ChatColor.GREEN + "/herobrine burn <player name> - Burns the specified player");
|
||||||
player.sendMessage(ChatColor.GREEN + "/hb-ai curse <player name> - curse player");
|
player.sendMessage(ChatColor.GREEN + "/herobrine curse <player name> - Places Herobine's curse on the specified player");
|
||||||
player.sendMessage(ChatColor.GREEN + "/hb-ai allworlds - add all worlds to config");
|
player.sendMessage(ChatColor.GREEN + "/herobrine allworlds - Adds all server worlds to the list of worlds Herobrine is allowed in");
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "You don?t have permissions to do that.");
|
player.sendMessage(ChatColor.RED + "You do not have the necessary permissions to view the Herobrine command documentation.");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("allworlds")) {
|
} else if (args[0].equalsIgnoreCase("allworlds")) {
|
||||||
if (player.hasPermission("hb-ai.allworlds")) {
|
if (player.hasPermission("herobrine.allworlds")) {
|
||||||
HerobrineAI.getPluginCore().getConfigDB().addAllWorlds();
|
HerobrineAI.getPluginCore().getConfigDB().addAllWorlds();
|
||||||
player.sendMessage(ChatColor.GREEN + "[HerobrineAI] All worlds have been added to config.");
|
player.sendMessage(ChatColor.GREEN + "[Herobrine] All server worlds have been added to the configuration file. Herobrine can now access all of the server's worlds.");
|
||||||
player.sendMessage(ChatColor.YELLOW + "[HerobrineAI] Note: Worlds with blank spaces can cause problems!");
|
player.sendMessage(ChatColor.YELLOW + "[Herobrine] WARNING! - One or more server worlds was determined to have a space in its name. Please be aware that worlds with spaces in their name may cause problems.");
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "You don?t have permissions to do that.");
|
player.sendMessage(ChatColor.RED + "You do no have the necessary permissions to add all server worlds to the configuration file.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "Usage: /hb-ai help");
|
player.sendMessage(ChatColor.RED + "Usage: /herobrine help");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + "Usage: /hb-ai help");
|
player.sendMessage(ChatColor.RED + "Usage: /herobrine help");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -289,22 +323,22 @@ public class CmdExecutor implements CommandExecutor {
|
|||||||
if (P_Core.canAttackPlayerConsole(Bukkit.getServer().getPlayer(args[1]))) {
|
if (P_Core.canAttackPlayerConsole(Bukkit.getServer().getPlayer(args[1]))) {
|
||||||
if (!AICore.isTarget) {
|
if (!AICore.isTarget) {
|
||||||
P_Core.getAICore().setAttackTarget(Bukkit.getServer().getPlayer(args[1]));
|
P_Core.getAICore().setAttackTarget(Bukkit.getServer().getPlayer(args[1]));
|
||||||
log.info("[HerobrineAI] Herobrine is now attacking the " + args[1] + "!");
|
log.info("[Herobrine] Herobrine is now attacking " + args[1] + ".");
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Herobrine already has target! Use /hb-ai cancel to cancel actual target");
|
log.info("[Herobrine] Herobrine is already attacking " + args[1] + ". Use /herobrine cancel to stop the attack.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Player is in secured area.");
|
log.info("[Herobrine] " + args[1] + " cannot be attacked because they are in a secure area.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Player is offline.");
|
log.info("[Herobrine] " + args[1] + " cannot be attacked because they are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Player is offline.");
|
log.info("[Herobrine] " + args[1] + " cannot be attacked because they are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("Usage: /hb-ai attack <player name>");
|
log.info("Usage: /herobrine attack <player name>");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("pyramid")) {
|
} else if (args[0].equalsIgnoreCase("pyramid")) {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
@ -313,21 +347,23 @@ public class CmdExecutor implements CommandExecutor {
|
|||||||
if (P_Core.getSupport().checkBuild(Bukkit.getServer().getPlayer(args[1]).getLocation())) {
|
if (P_Core.getSupport().checkBuild(Bukkit.getServer().getPlayer(args[1]).getLocation())) {
|
||||||
final Object[] data2 = { Bukkit.getServer().getPlayer(args[1]) };
|
final Object[] data2 = { Bukkit.getServer().getPlayer(args[1]) };
|
||||||
if (P_Core.getAICore().getCore(Core.CoreType.PYRAMID).runCore(data2).getResult()) {
|
if (P_Core.getAICore().getCore(Core.CoreType.PYRAMID).runCore(data2).getResult()) {
|
||||||
log.info("[HerobrineAI] Creating pyramind near " + args[1] + "!");
|
log.info("[Herobrine] Generating a pyramind near " + args[1] + ".");
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Cannot find good place for pyramid!");
|
log.info("[Herobrine] A pyramid could not be generated near " + args[1] +
|
||||||
|
" because there is no good place for it near them.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Player is in secure area.");
|
log.info("[Herobrine] A pyramid could not be generated near " + args[1] + " because they are in" +
|
||||||
|
" a protected area.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Player is offline.");
|
log.info("[Herobrine] A pyramid could not be generated near " + args[1] + " because they are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Player is offline.");
|
log.info("[Herobrine] A pyramid could not be generated near " + args[1] + " because they are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("Usage: " + ChatColor.GREEN + "/hb-ai pyramid <player name>");
|
log.info("Usage: " + ChatColor.GREEN + "/herobrine pyramid <player name>");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("bury")) {
|
} else if (args[0].equalsIgnoreCase("bury")) {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
@ -336,65 +372,67 @@ public class CmdExecutor implements CommandExecutor {
|
|||||||
if (P_Core.getSupport().checkBuild(Bukkit.getServer().getPlayer(args[1]).getLocation())) {
|
if (P_Core.getSupport().checkBuild(Bukkit.getServer().getPlayer(args[1]).getLocation())) {
|
||||||
final Object[] data2 = { Bukkit.getServer().getPlayer(args[1]) };
|
final Object[] data2 = { Bukkit.getServer().getPlayer(args[1]) };
|
||||||
if (P_Core.getAICore().getCore(Core.CoreType.BURY_PLAYER).runCore(data2).getResult()) {
|
if (P_Core.getAICore().getCore(Core.CoreType.BURY_PLAYER).runCore(data2).getResult()) {
|
||||||
log.info("[HerobrineAI] Buried " + args[1] + "!");
|
log.info("[Herobrine] Herobrine has buried " + args[1] + ".");
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Cannot find good place!");
|
log.info("[Herobrine] " + args[1] + " could not be buried " + "because there is no good place to " +
|
||||||
|
"bury them.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Player is in secure area.");
|
log.info("[Herobrine] " + args[1] + " could not be buried " + "because they are are in a protected area.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Player is offline.");
|
log.info("[Herobrine] " + args[1] + " could not be buried because " + "they are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Player is offline.");
|
log.info("[Herobrine] " + args[1] + " could not be buried because " + "they are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("Usage: /hb-ai bury <player name>");
|
log.info("Usage: /herobrine bury <player name>");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("cave")) {
|
} else if (args[0].equalsIgnoreCase("cave")) {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
||||||
final Object[] data2 = { Bukkit.getServer().getPlayer(args[1]).getLocation(), true };
|
final Object[] data2 = { Bukkit.getServer().getPlayer(args[1]).getLocation(), true };
|
||||||
log.info(ChatColor.RED + "[HerobrineAI] " + P_Core.getAICore().getCore(Core.CoreType.BUILD_STUFF).runCore(data2).getResultString());
|
log.info(ChatColor.RED + "[Herobrine] " + P_Core.getAICore().getCore(Core.CoreType.BUILD_STUFF).runCore(data2).getResultString());
|
||||||
} else {
|
} else {
|
||||||
log.info(ChatColor.RED + "[HerobrineAI] Player is offline.");
|
log.info(ChatColor.RED + "[Herobrine] A cave could not be created near " + args[1] +
|
||||||
|
" because they are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("Usage: /hb-ai cave <player name>");
|
log.info("Usage: /herobrine cave <player name>");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("burn")) {
|
} else if (args[0].equalsIgnoreCase("burn")) {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
||||||
final Object[] data2 = { Bukkit.getServer().getPlayer(args[1]) };
|
final Object[] data2 = { Bukkit.getServer().getPlayer(args[1]) };
|
||||||
log.info("[HerobrineAI] " + P_Core.getAICore().getCore(Core.CoreType.BURN).runCore(data2).getResultString());
|
log.info("[Herobrine] " + P_Core.getAICore().getCore(Core.CoreType.BURN).runCore(data2).getResultString());
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Player is offline.");
|
log.info("[Herobrine] " + args[1] + " could not be burned because they " + "not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("Usage: /hb-ai burn <player name>");
|
log.info("Usage: /herobrine burn <player name>");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("curse")) {
|
} else if (args[0].equalsIgnoreCase("curse")) {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
||||||
final Object[] data2 = { Bukkit.getServer().getPlayer(args[1]) };
|
final Object[] data2 = { Bukkit.getServer().getPlayer(args[1]) };
|
||||||
log.info("[HerobrineAI] " + P_Core.getAICore().getCore(Core.CoreType.CURSE).runCore(data2).getResultString());
|
log.info("[Herobrine] " + P_Core.getAICore().getCore(Core.CoreType.CURSE).runCore(data2).getResultString());
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Player is offline.");
|
log.info("[Herobrine] " + args[1] + " cannot be cursed because they " + "are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("Usage: /hb-ai curse <player name>");
|
log.info("Usage: /herobrine curse <player name>");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("heads")) {
|
} else if (args[0].equalsIgnoreCase("heads")) {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
if (Bukkit.getServer().getPlayer(args[1]) != null) {
|
||||||
final Object[] data2 = { args[1] };
|
final Object[] data2 = { args[1] };
|
||||||
log.info("[HerobrineAI] " + P_Core.getAICore().getCore(Core.CoreType.HEADS).runCore(data2).getResultString());
|
log.info("[Herobrine] " + P_Core.getAICore().getCore(Core.CoreType.HEADS).runCore(data2).getResultString());
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Player is offline.");
|
log.info("[Herobrine] " + args[1] + " cannot be haunted by heads because they are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("Usage: " + ChatColor.GREEN + "/hb-ai heads <player name>");
|
log.info("Usage: " + ChatColor.GREEN + "/herobrine heads <player name>");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("graveyard")) {
|
} else if (args[0].equalsIgnoreCase("graveyard")) {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
@ -402,18 +440,22 @@ public class CmdExecutor implements CommandExecutor {
|
|||||||
if (Bukkit.getServer().getPlayer(args[1]).isOnline()) {
|
if (Bukkit.getServer().getPlayer(args[1]).isOnline()) {
|
||||||
if (!AICore.isTarget) {
|
if (!AICore.isTarget) {
|
||||||
P_Core.getAICore().graveyardTeleport(Bukkit.getServer().getPlayer(args[1]));
|
P_Core.getAICore().graveyardTeleport(Bukkit.getServer().getPlayer(args[1]));
|
||||||
log.info("[HerobrineAI] " + args[1] + " is now in the Graveyard world!");
|
log.info("[Herobrine] " + args[1] + " is now in the Graveyard world!");
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Herobrine already has target! Use " + ChatColor.GREEN + "/hb-ai cancel" + ChatColor.RED + " to cancel actual target");
|
log.info(ChatColor.RED + "[Herobrine] Another player is already in Herobrine's " +
|
||||||
|
"Graveyard. Use " + ChatColor.GREEN + "/herobrine cancel" + ChatColor.RED
|
||||||
|
+ " to teleport the current player out of the graveyard.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Player is offline.");
|
log.info("[Herobrine] " + args[1] + " cannot be teleported to Herobrine's Graveyard because they are " +
|
||||||
|
"not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Player is offline.");
|
log.info("[Herobrine] " + args[1] + " cannot be teleported to Herobrine's Graveyard because they are " +
|
||||||
|
"not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("Usage: /hb-ai graveyard <player name>");
|
log.info("Usage: /herobrine graveyard <player name>");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("haunt")) {
|
} else if (args[0].equalsIgnoreCase("haunt")) {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
@ -423,54 +465,56 @@ public class CmdExecutor implements CommandExecutor {
|
|||||||
if (P_Core.canAttackPlayerConsole(Bukkit.getServer().getPlayer(args[1]))) {
|
if (P_Core.canAttackPlayerConsole(Bukkit.getServer().getPlayer(args[1]))) {
|
||||||
if (!AICore.isTarget) {
|
if (!AICore.isTarget) {
|
||||||
P_Core.getAICore().setHauntTarget(Bukkit.getServer().getPlayer(args[1]));
|
P_Core.getAICore().setHauntTarget(Bukkit.getServer().getPlayer(args[1]));
|
||||||
log.info("[HerobrineAI] Herobrine now haunts the " + args[1] + "!");
|
log.info("[Herobrine] Herobrine is now haunting " + args[1] + ".");
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Herobrine already has target! Use /hb-ai cancel to cancel actual target.");
|
log.info("[Herobrine] Herobrine is already haunting another player. Use /herobrine cancel to" +
|
||||||
|
" cancel the current haunting.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Player is in secure area.");
|
log.info("[Herobrine] " + args[1] + " cannot be haunted because they are currently in a protected area.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Player is offline.");
|
log.info("[Herobrine] " + args[1] + " cannot be haunted because they are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Player is offline.");
|
log.info("[Herobrine] " + args[1] + " cannot be haunted because they are not online.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("Usage: /hb-ai haunt <player name>");
|
log.info("Usage: /herobrine haunt <player name>");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("cancel")) {
|
} else if (args[0].equalsIgnoreCase("cancel")) {
|
||||||
P_Core.getAICore().cancelTarget(Core.CoreType.ANY);
|
P_Core.getAICore().cancelTarget(Core.CoreType.ANY);
|
||||||
log.info(ChatColor.RED + "[HerobrineAI] Target cancelled!");
|
log.info(ChatColor.RED + "[Herobrine] The current Herobrine victim has been saved.");
|
||||||
} else if (args[0].equalsIgnoreCase("reload")) {
|
} else if (args[0].equalsIgnoreCase("reload")) {
|
||||||
P_Core.getConfigDB().reload();
|
P_Core.getConfigDB().reload();
|
||||||
log.info("[HerobrineAI] Config reloaded!");
|
log.info("[Herobrine] Herobrine configuration file reloaded.");
|
||||||
} else if (args[0].equalsIgnoreCase("help")) {
|
} else if (args[0].equalsIgnoreCase("help")) {
|
||||||
log.info("[HerobrineAI] Command list");
|
log.info("[Herobrine] Command List");
|
||||||
log.info("/hb-ai help - shows all commands");
|
log.info("/herobrine help - Shows this list of Herobrine commands");
|
||||||
log.info("/hb-ai attack <player name> - herobrine attacks the player");
|
log.info("/herobrine attack <player name> - Sends Herobrine to attack the specified player");
|
||||||
log.info("/hb-ai haunt <player name> - herobrine haunts the player");
|
log.info("/herobrine haunt <player name> - Sends Herobrine to haunt the specified player");
|
||||||
log.info("/hb-ai cancel - cancel herobrine?s actual target");
|
log.info("/herobrine cancel - Cancel's Herobrine's current actions against his current target");
|
||||||
log.info("/hb-ai reload - reload config");
|
log.info("/herobrine reload - Reloads the Herobrine configuration file");
|
||||||
log.info("/hb-ai position - gets actual position of Herobrine");
|
log.info("/herobrine position - Displays the coordinates of Herobrine's current location");
|
||||||
log.info("/hb-ai pyramid <player name> - build pyramid near the player");
|
log.info("/herobrine pyramid <player name> - Builds a pyramid near the specified player");
|
||||||
log.info("/hb-ai bury <player name> - bury player");
|
log.info("/herobrine bury <player name> - Buries the specified player");
|
||||||
log.info("/hb-ai graveyard <player name> - teleport player to the Graveyard world");
|
log.info("/herobrine graveyard <player name> - Teleports the specified player to Herobrine's Graveyard");
|
||||||
log.info("/hb-ai heads <player name> - place heads near the player");
|
log.info("/herobrine temple <player name> - Builds a temple near the specified player");
|
||||||
log.info("/hb-ai cave <player name> - create cave near the player");
|
log.info("/herobrine heads <player name> - Spawns heads near the specified player");
|
||||||
log.info("/hb-ai burn <player name> - burn player");
|
log.info("/herobrine cave <player name> - Creates a cave near the specified player");
|
||||||
log.info("/hb-ai curse <player name> - curse player");
|
log.info("/herobrine burn <player name> - Burns the specified player");
|
||||||
log.info("/hb-ai allworlds - add all worlds to config");
|
log.info("/herobrine curse <player name> - Places Herobine's curse on the specified player");
|
||||||
|
log.info("/herobrine allworlds - Adds all server worlds to the list of worlds Herobrine is allowed in");
|
||||||
} if (args[0].equalsIgnoreCase("allworlds")) {
|
} if (args[0].equalsIgnoreCase("allworlds")) {
|
||||||
HerobrineAI.getPluginCore().getConfigDB().addAllWorlds();
|
HerobrineAI.getPluginCore().getConfigDB().addAllWorlds();
|
||||||
log.info("[HerobrineAI] All worlds have been added to config.");
|
log.info("[Herobrine] All server worlds have been added to the configuration file. Herobrine can now access all of the server's worlds.");
|
||||||
log.info("[HerobrineAI] Note: Worlds with blank spaces can cause problems!");
|
log.info("[Herobrine] WARNING! - One or more server worlds was determined to have a space in its name. Please be aware that worlds with spaces in their name may cause problems.");
|
||||||
} else {
|
} else {
|
||||||
log.info("Usage: /hb-ai help");
|
log.info("Usage: /herobrine help");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("Usage: /hb-ai help");
|
log.info("Usage: /herobrine help");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -44,14 +44,14 @@ public class BlockListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (event.getBlock().getWorld() == Bukkit.getServer().getWorld("world_herobrineai_graveyard")) {
|
if (event.getBlock().getWorld() == Bukkit.getServer().getWorld("world_herobrine_graveyard")) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBlockBreak(final BlockBreakEvent event) {
|
public void onBlockBreak(final BlockBreakEvent event) {
|
||||||
if (event.getBlock().getWorld() == Bukkit.getServer().getWorld("world_herobrineai_graveyard")) {
|
if (event.getBlock().getWorld() == Bukkit.getServer().getWorld("world_herobrine_graveyard")) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -64,7 +64,7 @@ public class BlockListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBlockPlace(final BlockPlaceEvent event) {
|
public void onBlockPlace(final BlockPlaceEvent event) {
|
||||||
if (event.getBlock().getWorld() == Bukkit.getServer().getWorld("world_herobrineai_graveyard")) {
|
if (event.getBlock().getWorld() == Bukkit.getServer().getWorld("world_herobrine_graveyard")) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ public class PlayerListener implements Listener {
|
|||||||
public void onPlayerQuit(final PlayerQuitEvent event) {
|
public void onPlayerQuit(final PlayerQuitEvent event) {
|
||||||
if (event.getPlayer().getEntityId() != HerobrineAI.herobrineEntityID) {
|
if (event.getPlayer().getEntityId() != HerobrineAI.herobrineEntityID) {
|
||||||
HerobrineAI.getPluginCore().getAICore();
|
HerobrineAI.getPluginCore().getAICore();
|
||||||
if ((AICore.PlayerTarget == event.getPlayer()) && (HerobrineAI.getPluginCore().getAICore().getCoreTypeNow() == Core.CoreType.GRAVEYARD) && (event.getPlayer().getLocation().getWorld() == Bukkit.getServer().getWorld("world_herobrineai_graveyard"))) {
|
if ((AICore.PlayerTarget == event.getPlayer()) && (HerobrineAI.getPluginCore().getAICore().getCoreTypeNow() == Core.CoreType.GRAVEYARD) && (event.getPlayer().getLocation().getWorld() == Bukkit.getServer().getWorld("world_herobrine_graveyard"))) {
|
||||||
HerobrineAI.getPluginCore().getAICore();
|
HerobrineAI.getPluginCore().getAICore();
|
||||||
if (AICore.isTarget) {
|
if (AICore.isTarget) {
|
||||||
event.getPlayer().teleport(HerobrineAI.getPluginCore().getAICore().getGraveyard().getSavedLocation());
|
event.getPlayer().teleport(HerobrineAI.getPluginCore().getAICore().getGraveyard().getSavedLocation());
|
||||||
@ -97,7 +97,7 @@ public class PlayerListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerCommand(final PlayerCommandPreprocessEvent event) {
|
public void onPlayerCommand(final PlayerCommandPreprocessEvent event) {
|
||||||
if (event.getPlayer().getWorld() == Bukkit.getServer().getWorld("world_herobrineai_graveyard") && !event.getPlayer().hasPermission("hb-ai.cmdblockbypass")) {
|
if (event.getPlayer().getWorld() == Bukkit.getServer().getWorld("world_herobrine_graveyard") && !event.getPlayer().hasPermission("hb-ai.cmdblockbypass")) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -116,9 +116,9 @@ public class PlayerListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerMoveEvent(final PlayerMoveEvent event) {
|
public void onPlayerMoveEvent(final PlayerMoveEvent event) {
|
||||||
if ((event.getPlayer().getEntityId() != HerobrineAI.herobrineEntityID) && (event.getPlayer().getWorld() == Bukkit.getServer().getWorld("world_herobrineai_graveyard"))) {
|
if ((event.getPlayer().getEntityId() != HerobrineAI.herobrineEntityID) && (event.getPlayer().getWorld() == Bukkit.getServer().getWorld("world_herobrine_graveyard"))) {
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
player.teleport(new Location(Bukkit.getServer().getWorld("world_herobrineai_graveyard"), -2.49, 4.0, 10.69, -179.85f, 0.44999f));
|
player.teleport(new Location(Bukkit.getServer().getWorld("world_herobrine_graveyard"), -2.49, 4.0, 10.69, -179.85f, 0.44999f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ public class EntityInjector {
|
|||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
t.printStackTrace();
|
t.printStackTrace();
|
||||||
HerobrineAI.isNPCDisabled = true;
|
HerobrineAI.isNPCDisabled = true;
|
||||||
HerobrineAI.log.warning("[HerobrineAI] Custom NPCs have been disabled. (Incompatibility error!)");
|
HerobrineAI.log.warning("[Herobrine] Custom NPCs have been disabled due to a compatibility issue.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
name: HerobrineAI
|
name: Herobrine for Bukkit or Spigot
|
||||||
main: org.jakub1221.herobrineai.HerobrineAI
|
main: org.jakub1221.herobrineai.HerobrineAI
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
commands:
|
commands:
|
||||||
|
Reference in New Issue
Block a user