Renamed "HerobrineAI.java" to "Herobrine.java" and replaced "HerobrineAI" branding with "Herobrine"
This commit is contained in:
parent
686cfc75e4
commit
e4a8ca3b81
@ -1,5 +1,5 @@
|
|||||||
name: Herobrine
|
name: Herobrine
|
||||||
main: net.theprogrammersworld.herobrine.HerobrineAI
|
main: net.theprogrammersworld.herobrine.Herobrine
|
||||||
version: 2.0.0
|
version: 2.0.0
|
||||||
description: "Bring Herobrine to your Spigot-based Minecraft server!"
|
description: "Bring Herobrine to your Spigot-based Minecraft server!"
|
||||||
website: https://www.theprogrammersworld.net
|
website: https://www.theprogrammersworld.net
|
||||||
|
@ -16,7 +16,7 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import net.minecraft.server.v1_15_R1.EntityPlayer;
|
import net.minecraft.server.v1_15_R1.EntityPlayer;
|
||||||
import net.minecraft.server.v1_15_R1.PacketPlayOutPlayerInfo;
|
import net.minecraft.server.v1_15_R1.PacketPlayOutPlayerInfo;
|
||||||
import net.minecraft.server.v1_15_R1.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
|
import net.minecraft.server.v1_15_R1.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.Utils;
|
import net.theprogrammersworld.herobrine.Utils;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
||||||
import net.theprogrammersworld.herobrine.AI.cores.Attack;
|
import net.theprogrammersworld.herobrine.AI.cores.Attack;
|
||||||
@ -46,7 +46,7 @@ public class AICore {
|
|||||||
|
|
||||||
private ArrayList<Core> AllCores = new ArrayList<Core>();
|
private ArrayList<Core> AllCores = new ArrayList<Core>();
|
||||||
private CoreType CoreNow = CoreType.ANY;
|
private CoreType CoreNow = CoreType.ANY;
|
||||||
public static HerobrineAI plugin;
|
public static Herobrine plugin;
|
||||||
public static Player PlayerTarget;
|
public static Player PlayerTarget;
|
||||||
public static boolean isTarget = false;
|
public static boolean isTarget = false;
|
||||||
public static int ticksToEnd = 0;
|
public static int ticksToEnd = 0;
|
||||||
@ -103,8 +103,8 @@ public class AICore {
|
|||||||
|
|
||||||
resetLimits = new ResetLimits();
|
resetLimits = new ResetLimits();
|
||||||
|
|
||||||
plugin = HerobrineAI.getPluginCore();
|
plugin = Herobrine.getPluginCore();
|
||||||
log.info("[HerobrineAI] Debug mode enabled!");
|
log.info("[Herobrine] Debug mode enabled!");
|
||||||
FindPlayer();
|
FindPlayer();
|
||||||
StartIntervals();
|
StartIntervals();
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ public class AICore {
|
|||||||
|
|
||||||
String result = "";
|
String result = "";
|
||||||
|
|
||||||
if (HerobrineAI.getPluginCore().getAICore().getCoreTypeNow() == CoreType.RANDOM_POSITION) {
|
if (Herobrine.getPluginCore().getAICore().getCoreTypeNow() == CoreType.RANDOM_POSITION) {
|
||||||
result = "Yes";
|
result = "Yes";
|
||||||
} else {
|
} else {
|
||||||
result = "No";
|
result = "No";
|
||||||
@ -157,41 +157,41 @@ public class AICore {
|
|||||||
} else if (chance < 50) {
|
} else if (chance < 50) {
|
||||||
setHauntTarget(player);
|
setHauntTarget(player);
|
||||||
} else {
|
} else {
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().UseNPC_Demon && !HerobrineAI.isNPCDisabled) {
|
if (Herobrine.getPluginCore().getConfigDB().UseNPC_Demon && !Herobrine.isNPCDisabled) {
|
||||||
HerobrineAI.getPluginCore().getEntityManager().spawnCustomSkeleton(player.getLocation(), MobType.DEMON);
|
Herobrine.getPluginCore().getEntityManager().spawnCustomSkeleton(player.getLocation(), MobType.DEMON);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FindPlayer() {
|
public void FindPlayer() {
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().OnlyWalkingMode == false) {
|
if (Herobrine.getPluginCore().getConfigDB().OnlyWalkingMode == false) {
|
||||||
|
|
||||||
if (isTarget == false) {
|
if (isTarget == false) {
|
||||||
|
|
||||||
int att_chance = Utils.getRandomGen().nextInt(100);
|
int att_chance = Utils.getRandomGen().nextInt(100);
|
||||||
log.info("[HerobrineAI] Generating find chance...");
|
log.info("[Herobrine] Generating find chance...");
|
||||||
|
|
||||||
if (att_chance - (HerobrineAI.getPluginCore().getConfigDB().ShowRate * 4) < 55) {
|
if (att_chance - (Herobrine.getPluginCore().getConfigDB().ShowRate * 4) < 55) {
|
||||||
|
|
||||||
if (Bukkit.getServer().getOnlinePlayers().size() > 0) {
|
if (Bukkit.getServer().getOnlinePlayers().size() > 0) {
|
||||||
|
|
||||||
log.info("[HerobrineAI] Finding target...");
|
log.info("[Herobrine] Finding target...");
|
||||||
Player targetPlayer = Utils.getRandomPlayer();
|
Player targetPlayer = Utils.getRandomPlayer();
|
||||||
|
|
||||||
if (targetPlayer.getEntityId() != HerobrineAI.getPluginCore().HerobrineEntityID) {
|
if (targetPlayer.getEntityId() != Herobrine.getPluginCore().HerobrineEntityID) {
|
||||||
|
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().useWorlds
|
if (Herobrine.getPluginCore().getConfigDB().useWorlds
|
||||||
.contains(targetPlayer.getLocation().getWorld().getName())
|
.contains(targetPlayer.getLocation().getWorld().getName())
|
||||||
&& HerobrineAI.getPluginCore().canAttackPlayerNoMSG(targetPlayer)) {
|
&& Herobrine.getPluginCore().canAttackPlayerNoMSG(targetPlayer)) {
|
||||||
|
|
||||||
CancelTarget(CoreType.ANY);
|
CancelTarget(CoreType.ANY);
|
||||||
isTarget = true;
|
isTarget = true;
|
||||||
log.info("[HerobrineAI] Target founded, starting AI now! (" + targetPlayer.getName()+ ")");
|
log.info("[Herobrine] Target founded, starting AI now! (" + targetPlayer.getName()+ ")");
|
||||||
setCoreTypeNow(CoreType.START);
|
setCoreTypeNow(CoreType.START);
|
||||||
StartAI();
|
StartAI();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
log.info("[HerobrineAI] Target is in the safe world! ("+ targetPlayer.getLocation().getWorld().getName() + ")");
|
log.info("[Herobrine] Target is in the safe world! ("+ targetPlayer.getLocation().getWorld().getName() + ")");
|
||||||
FindPlayer();
|
FindPlayer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -218,9 +218,9 @@ public class AICore {
|
|||||||
nowloc.setYaw(1.f);
|
nowloc.setYaw(1.f);
|
||||||
nowloc.setPitch(1.f);
|
nowloc.setPitch(1.f);
|
||||||
|
|
||||||
HerobrineAI.getPluginCore().HerobrineNPC.moveTo(nowloc);
|
Herobrine.getPluginCore().HerobrineNPC.moveTo(nowloc);
|
||||||
CoreNow = CoreType.ANY;
|
CoreNow = CoreType.ANY;
|
||||||
HerobrineAI.getPluginCore().getPathManager().setPath(null);
|
Herobrine.getPluginCore().getPathManager().setPath(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isTarget == true) {
|
if (isTarget == true) {
|
||||||
@ -233,21 +233,21 @@ public class AICore {
|
|||||||
|
|
||||||
_ticks = 0;
|
_ticks = 0;
|
||||||
isTarget = false;
|
isTarget = false;
|
||||||
HerobrineAI.HerobrineHP = HerobrineAI.HerobrineMaxHP;
|
Herobrine.HerobrineHP = Herobrine.HerobrineMaxHP;
|
||||||
|
|
||||||
log.info("[HerobrineAI] Target cancelled.");
|
log.info("[Herobrine] Target cancelled.");
|
||||||
Location nowloc = new Location((World) Bukkit.getServer().getWorlds().get(0), 0, -20.f, 0);
|
Location nowloc = new Location((World) Bukkit.getServer().getWorlds().get(0), 0, -20.f, 0);
|
||||||
|
|
||||||
nowloc.setYaw(1.f);
|
nowloc.setYaw(1.f);
|
||||||
nowloc.setPitch(1.f);
|
nowloc.setPitch(1.f);
|
||||||
|
|
||||||
HerobrineAI.getPluginCore().HerobrineNPC.moveTo(nowloc);
|
Herobrine.getPluginCore().HerobrineNPC.moveTo(nowloc);
|
||||||
CoreNow = CoreType.ANY;
|
CoreNow = CoreType.ANY;
|
||||||
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(AICore.plugin, new Runnable() {
|
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(AICore.plugin, new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
FindPlayer();
|
FindPlayer();
|
||||||
}
|
}
|
||||||
}, (6 / HerobrineAI.getPluginCore().getConfigDB().ShowRate) * (HerobrineAI.getPluginCore().getConfigDB().ShowInterval * 1L));
|
}, (6 / Herobrine.getPluginCore().getConfigDB().ShowRate) * (Herobrine.getPluginCore().getConfigDB().ShowInterval * 1L));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -259,8 +259,8 @@ public class AICore {
|
|||||||
Object[] data = { PlayerTarget };
|
Object[] data = { PlayerTarget };
|
||||||
int chance = Utils.getRandomGen().nextInt(100);
|
int chance = Utils.getRandomGen().nextInt(100);
|
||||||
if (chance <= 10) {
|
if (chance <= 10) {
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().UseGraveyardWorld == true) {
|
if (Herobrine.getPluginCore().getConfigDB().UseGraveyardWorld == true) {
|
||||||
log.info("[HerobrineAI] Teleporting target to Graveyard world.");
|
log.info("[Herobrine] Teleporting target to Graveyard world.");
|
||||||
|
|
||||||
getCore(CoreType.GRAVEYARD).RunCore(data);
|
getCore(CoreType.GRAVEYARD).RunCore(data);
|
||||||
|
|
||||||
@ -322,10 +322,10 @@ public class AICore {
|
|||||||
private void RandomPositionInterval() {
|
private void RandomPositionInterval() {
|
||||||
if (CoreNow == CoreType.ANY) {
|
if (CoreNow == CoreType.ANY) {
|
||||||
((RandomPosition) getCore(CoreType.RANDOM_POSITION)).setRandomTicks(0);
|
((RandomPosition) getCore(CoreType.RANDOM_POSITION)).setRandomTicks(0);
|
||||||
int count = HerobrineAI.getPluginCore().getConfigDB().useWorlds.size();
|
int count = Herobrine.getPluginCore().getConfigDB().useWorlds.size();
|
||||||
int chance = Utils.getRandomGen().nextInt(count);
|
int chance = Utils.getRandomGen().nextInt(count);
|
||||||
Object[] data = {
|
Object[] data = {
|
||||||
Bukkit.getServer().getWorld(HerobrineAI.getPluginCore().getConfigDB().useWorlds.get(chance)) };
|
Bukkit.getServer().getWorld(Herobrine.getPluginCore().getConfigDB().useWorlds.get(chance)) };
|
||||||
getCore(CoreType.RANDOM_POSITION).RunCore(data);
|
getCore(CoreType.RANDOM_POSITION).RunCore(data);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -354,24 +354,24 @@ public class AICore {
|
|||||||
|
|
||||||
if (Utils.getRandomGen().nextBoolean()) {
|
if (Utils.getRandomGen().nextBoolean()) {
|
||||||
if (Bukkit.getServer().getOnlinePlayers().size() > 0) {
|
if (Bukkit.getServer().getOnlinePlayers().size() > 0) {
|
||||||
log.info("[HerobrineAI] Finding pyramid target...");
|
log.info("[Herobrine] Finding pyramid target...");
|
||||||
|
|
||||||
Player player = Utils.getRandomPlayer();
|
Player player = Utils.getRandomPlayer();
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().useWorlds.contains(player.getLocation().getWorld().getName())) {
|
if (Herobrine.getPluginCore().getConfigDB().useWorlds.contains(player.getLocation().getWorld().getName())) {
|
||||||
|
|
||||||
int chance2 = Utils.getRandomGen().nextInt(100);
|
int chance2 = Utils.getRandomGen().nextInt(100);
|
||||||
if (chance2 < 30) {
|
if (chance2 < 30) {
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().BuildPyramids == true) {
|
if (Herobrine.getPluginCore().getConfigDB().BuildPyramids == true) {
|
||||||
Object[] data = { player };
|
Object[] data = { player };
|
||||||
getCore(CoreType.PYRAMID).RunCore(data);
|
getCore(CoreType.PYRAMID).RunCore(data);
|
||||||
}
|
}
|
||||||
} else if (chance2 < 70) {
|
} else if (chance2 < 70) {
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().BuryPlayers) {
|
if (Herobrine.getPluginCore().getConfigDB().BuryPlayers) {
|
||||||
Object[] data = { player };
|
Object[] data = { player };
|
||||||
getCore(CoreType.BURY_PLAYER).RunCore(data);
|
getCore(CoreType.BURY_PLAYER).RunCore(data);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().UseHeads) {
|
if (Herobrine.getPluginCore().getConfigDB().UseHeads) {
|
||||||
Object[] data = { player.getName() };
|
Object[] data = { player.getName() };
|
||||||
getCore(CoreType.HEADS).RunCore(data);
|
getCore(CoreType.HEADS).RunCore(data);
|
||||||
}
|
}
|
||||||
@ -384,14 +384,14 @@ public class AICore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void TempleInterval() {
|
private void TempleInterval() {
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().BuildTemples == true) {
|
if (Herobrine.getPluginCore().getConfigDB().BuildTemples == true) {
|
||||||
if (Utils.getRandomGen().nextBoolean()) {
|
if (Utils.getRandomGen().nextBoolean()) {
|
||||||
if (Bukkit.getServer().getOnlinePlayers().size() > 0) {
|
if (Bukkit.getServer().getOnlinePlayers().size() > 0) {
|
||||||
log.info("[HerobrineAI] Finding temple target...");
|
log.info("[Herobrine] Finding temple target...");
|
||||||
|
|
||||||
Player player = Utils.getRandomPlayer();
|
Player player = Utils.getRandomPlayer();
|
||||||
|
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().useWorlds.contains(player.getLocation().getWorld().getName())) {
|
if (Herobrine.getPluginCore().getConfigDB().useWorlds.contains(player.getLocation().getWorld().getName())) {
|
||||||
if (Utils.getRandomGen().nextBoolean()) {
|
if (Utils.getRandomGen().nextBoolean()) {
|
||||||
Object[] data = { player };
|
Object[] data = { player };
|
||||||
getCore(CoreType.TEMPLE).RunCore(data);
|
getCore(CoreType.TEMPLE).RunCore(data);
|
||||||
@ -405,13 +405,13 @@ public class AICore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void BuildCave() {
|
private void BuildCave() {
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().BuildStuff == true) {
|
if (Herobrine.getPluginCore().getConfigDB().BuildStuff == true) {
|
||||||
if (Utils.getRandomGen().nextBoolean()) {
|
if (Utils.getRandomGen().nextBoolean()) {
|
||||||
if (Bukkit.getServer().getOnlinePlayers().size() > 0) {
|
if (Bukkit.getServer().getOnlinePlayers().size() > 0) {
|
||||||
|
|
||||||
Player player = Utils.getRandomPlayer();
|
Player player = Utils.getRandomPlayer();
|
||||||
|
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().useWorlds
|
if (Herobrine.getPluginCore().getConfigDB().useWorlds
|
||||||
.contains(player.getLocation().getWorld().getName())) {
|
.contains(player.getLocation().getWorld().getName())) {
|
||||||
|
|
||||||
if (Utils.getRandomGen().nextBoolean()) {
|
if (Utils.getRandomGen().nextBoolean()) {
|
||||||
@ -440,20 +440,20 @@ public class AICore {
|
|||||||
|
|
||||||
Player player = Utils.getRandomPlayer();
|
Player player = Utils.getRandomPlayer();
|
||||||
|
|
||||||
if (player.getEntityId() != HerobrineAI.getPluginCore().HerobrineEntityID) {
|
if (player.getEntityId() != Herobrine.getPluginCore().HerobrineEntityID) {
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().useWorlds
|
if (Herobrine.getPluginCore().getConfigDB().useWorlds
|
||||||
.contains(player.getLocation().getWorld().getName())) {
|
.contains(player.getLocation().getWorld().getName())) {
|
||||||
Object[] data = { player };
|
Object[] data = { player };
|
||||||
if (HerobrineAI.getPluginCore().canAttackPlayerNoMSG(player)) {
|
if (Herobrine.getPluginCore().canAttackPlayerNoMSG(player)) {
|
||||||
if (Utils.getRandomGen().nextInt(100) < 30) {
|
if (Utils.getRandomGen().nextInt(100) < 30) {
|
||||||
|
|
||||||
getCore(CoreType.RANDOM_SOUND).RunCore(data);
|
getCore(CoreType.RANDOM_SOUND).RunCore(data);
|
||||||
} else if (Utils.getRandomGen().nextInt(100) < 60) {
|
} else if (Utils.getRandomGen().nextInt(100) < 60) {
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().Burn) {
|
if (Herobrine.getPluginCore().getConfigDB().Burn) {
|
||||||
getCore(CoreType.BURN).RunCore(data);
|
getCore(CoreType.BURN).RunCore(data);
|
||||||
}
|
}
|
||||||
} else if (Utils.getRandomGen().nextInt(100) < 80) {
|
} else if (Utils.getRandomGen().nextInt(100) < 80) {
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().Curse) {
|
if (Herobrine.getPluginCore().getConfigDB().Curse) {
|
||||||
getCore(CoreType.CURSE).RunCore(data);
|
getCore(CoreType.CURSE).RunCore(data);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -473,14 +473,14 @@ public class AICore {
|
|||||||
|
|
||||||
for(int i=0; i < 5; i++){
|
for(int i=0; i < 5; i++){
|
||||||
for(float j=0; j < 2; j+= 0.5f){
|
for(float j=0; j < 2; j+= 0.5f){
|
||||||
Location hbloc = (Location) HerobrineAI.getPluginCore().HerobrineNPC.getBukkitEntity().getLocation();
|
Location hbloc = (Location) Herobrine.getPluginCore().HerobrineNPC.getBukkitEntity().getLocation();
|
||||||
hbloc.setY(hbloc.getY() + j);
|
hbloc.setY(hbloc.getY() + j);
|
||||||
hbloc.getWorld().playEffect(hbloc, Effect.SMOKE, 80);
|
hbloc.getWorld().playEffect(hbloc, Effect.SMOKE, 80);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ploc.setY(-20);
|
ploc.setY(-20);
|
||||||
HerobrineAI.getPluginCore().HerobrineNPC.moveTo(ploc);
|
Herobrine.getPluginCore().HerobrineNPC.moveTo(ploc);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -523,8 +523,8 @@ public class AICore {
|
|||||||
public void run() {
|
public void run() {
|
||||||
BuildInterval();
|
BuildInterval();
|
||||||
}
|
}
|
||||||
}, 1 * 1L * HerobrineAI.getPluginCore().getConfigDB().BuildInterval,
|
}, 1 * 1L * Herobrine.getPluginCore().getConfigDB().BuildInterval,
|
||||||
1 * 1L * HerobrineAI.getPluginCore().getConfigDB().BuildInterval);
|
1 * 1L * Herobrine.getPluginCore().getConfigDB().BuildInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Start_MAIN() {
|
public void Start_MAIN() {
|
||||||
@ -534,10 +534,10 @@ public class AICore {
|
|||||||
FindPlayer();
|
FindPlayer();
|
||||||
|
|
||||||
}
|
}
|
||||||
}, (6 / HerobrineAI.getPluginCore().getConfigDB().ShowRate)
|
}, (6 / Herobrine.getPluginCore().getConfigDB().ShowRate)
|
||||||
* (HerobrineAI.getPluginCore().getConfigDB().ShowInterval * 1L),
|
* (Herobrine.getPluginCore().getConfigDB().ShowInterval * 1L),
|
||||||
(6 / HerobrineAI.getPluginCore().getConfigDB().ShowRate)
|
(6 / Herobrine.getPluginCore().getConfigDB().ShowRate)
|
||||||
* (HerobrineAI.getPluginCore().getConfigDB().ShowInterval * 1L));
|
* (Herobrine.getPluginCore().getConfigDB().ShowInterval * 1L));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Start_RM() {
|
public void Start_RM() {
|
||||||
@ -566,8 +566,8 @@ public class AICore {
|
|||||||
public void run() {
|
public void run() {
|
||||||
RandomCoreINT();
|
RandomCoreINT();
|
||||||
}
|
}
|
||||||
}, (long) (HerobrineAI.getPluginCore().getConfigDB().ShowInterval / 1.5),
|
}, (long) (Herobrine.getPluginCore().getConfigDB().ShowInterval / 1.5),
|
||||||
(long) (HerobrineAI.getPluginCore().getConfigDB().ShowInterval / 1.5));
|
(long) (Herobrine.getPluginCore().getConfigDB().ShowInterval / 1.5));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Start_CG() {
|
public void Start_CG() {
|
||||||
@ -676,18 +676,18 @@ public class AICore {
|
|||||||
public boolean toggleHerobrinePlayerVisibilityNoTeleport(Player p) {
|
public boolean toggleHerobrinePlayerVisibilityNoTeleport(Player p) {
|
||||||
// Toggles the visibility of Herobrine for the given player. This function does not perform the "visibility activation teleport".
|
// Toggles the visibility of Herobrine for the given player. This function does not perform the "visibility activation teleport".
|
||||||
// If an activiation teleport should be performed, returns true, otherwise, false.
|
// If an activiation teleport should be performed, returns true, otherwise, false.
|
||||||
boolean playerCanSeeHerobrine = p.hasLineOfSight(HerobrineAI.getPluginCore().HerobrineNPC.getBukkitEntity());
|
boolean playerCanSeeHerobrine = p.hasLineOfSight(Herobrine.getPluginCore().HerobrineNPC.getBukkitEntity());
|
||||||
if(playerCanSeeHerobrine && !visibilityList.contains(p)) {
|
if(playerCanSeeHerobrine && !visibilityList.contains(p)) {
|
||||||
// If player p can see Herobrine but visibilty is not already enabled, then enable it.
|
// If player p can see Herobrine but visibilty is not already enabled, then enable it.
|
||||||
EntityPlayer pcon = ((CraftPlayer) p).getHandle();
|
EntityPlayer pcon = ((CraftPlayer) p).getHandle();
|
||||||
pcon.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.ADD_PLAYER, HerobrineAI.getPluginCore().HerobrineNPC.getEntity()));
|
pcon.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.ADD_PLAYER, Herobrine.getPluginCore().HerobrineNPC.getEntity()));
|
||||||
visibilityList.add(p);
|
visibilityList.add(p);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if(!playerCanSeeHerobrine && visibilityList.contains(p)) {
|
else if(!playerCanSeeHerobrine && visibilityList.contains(p)) {
|
||||||
// If player p cannot see Herobrine but visibility is still enabled, then disable it.
|
// If player p cannot see Herobrine but visibility is still enabled, then disable it.
|
||||||
EntityPlayer pcon = ((CraftPlayer) p).getHandle();
|
EntityPlayer pcon = ((CraftPlayer) p).getHandle();
|
||||||
pcon.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.REMOVE_PLAYER, HerobrineAI.getPluginCore().HerobrineNPC.getEntity()));
|
pcon.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.REMOVE_PLAYER, Herobrine.getPluginCore().HerobrineNPC.getEntity()));
|
||||||
visibilityList.remove(p);
|
visibilityList.remove(p);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -695,9 +695,9 @@ public class AICore {
|
|||||||
|
|
||||||
public void visibilityActivationTeleport() {
|
public void visibilityActivationTeleport() {
|
||||||
// Makes Herobrine visible to players that should be able to see him by quickly teleporting him out of the map and back to where he previously was.
|
// Makes Herobrine visible to players that should be able to see him by quickly teleporting him out of the map and back to where he previously was.
|
||||||
Location original = HerobrineAI.getPluginCore().HerobrineNPC.getBukkitEntity().getLocation();
|
Location original = Herobrine.getPluginCore().HerobrineNPC.getBukkitEntity().getLocation();
|
||||||
HerobrineAI.getPluginCore().HerobrineNPC.getBukkitEntity().teleport(new Location(Bukkit.getServer().getWorlds().get(0), 0, -20, 0));
|
Herobrine.getPluginCore().HerobrineNPC.getBukkitEntity().teleport(new Location(Bukkit.getServer().getWorlds().get(0), 0, -20, 0));
|
||||||
HerobrineAI.getPluginCore().HerobrineNPC.getBukkitEntity().teleport(original);
|
Herobrine.getPluginCore().HerobrineNPC.getBukkitEntity().teleport(original);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void toggleHerobrinePlayerVisibility(Player p) {
|
public void toggleHerobrinePlayerVisibility(Player p) {
|
||||||
|
@ -2,14 +2,14 @@ package net.theprogrammersworld.herobrine.AI;
|
|||||||
|
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
|
|
||||||
public class ConsoleLogger {
|
public class ConsoleLogger {
|
||||||
|
|
||||||
static Logger log = Logger.getLogger("Minecraft");
|
static Logger log = Logger.getLogger("Minecraft");
|
||||||
|
|
||||||
public void info(String text){
|
public void info(String text){
|
||||||
if (HerobrineAI.isDebugging){
|
if (Herobrine.isDebugging){
|
||||||
log.info(text);
|
log.info(text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
package net.theprogrammersworld.herobrine.AI;
|
package net.theprogrammersworld.herobrine.AI;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
|
|
||||||
public abstract class Core {
|
public abstract class Core {
|
||||||
|
|
||||||
private final AppearType Appear;
|
private final AppearType Appear;
|
||||||
private final CoreType coreType;
|
private final CoreType coreType;
|
||||||
private CoreResult nowData = null;
|
private CoreResult nowData = null;
|
||||||
protected HerobrineAI PluginCore = null;
|
protected Herobrine PluginCore = null;
|
||||||
|
|
||||||
public Core(CoreType cp,AppearType ap, HerobrineAI hb){
|
public Core(CoreType cp,AppearType ap, Herobrine hb){
|
||||||
this.coreType=cp;
|
this.coreType=cp;
|
||||||
this.Appear=ap;
|
this.Appear=ap;
|
||||||
this.PluginCore = hb;
|
this.PluginCore = hb;
|
||||||
@ -29,7 +29,7 @@ public abstract class Core {
|
|||||||
|
|
||||||
nowData=this.CallCore(data);
|
nowData=this.CallCore(data);
|
||||||
if (nowData.getResult() && Appear == AppearType.APPEAR){
|
if (nowData.getResult() && Appear == AppearType.APPEAR){
|
||||||
HerobrineAI.getPluginCore().getAICore().setCoreTypeNow(this.coreType);
|
Herobrine.getPluginCore().getAICore().setCoreTypeNow(this.coreType);
|
||||||
|
|
||||||
}
|
}
|
||||||
return nowData;
|
return nowData;
|
||||||
|
@ -4,19 +4,19 @@ import java.util.Random;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
|
|
||||||
public class Message {
|
public class Message {
|
||||||
|
|
||||||
public static void SendMessage(Player player) {
|
public static void SendMessage(Player player) {
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().SendMessages == true) {
|
if (Herobrine.getPluginCore().getConfigDB().SendMessages == true) {
|
||||||
|
|
||||||
int count = HerobrineAI.getPluginCore().getConfigDB().useMessages.size();
|
int count = Herobrine.getPluginCore().getConfigDB().useMessages.size();
|
||||||
|
|
||||||
Random randgen = new Random();
|
Random randgen = new Random();
|
||||||
int randmsg = randgen.nextInt(count);
|
int randmsg = randgen.nextInt(count);
|
||||||
|
|
||||||
player.sendMessage("<Herobrine> " + HerobrineAI.getPluginCore().getConfigDB().useMessages.get(randmsg));
|
player.sendMessage("<Herobrine> " + Herobrine.getPluginCore().getConfigDB().useMessages.get(randmsg));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ package net.theprogrammersworld.herobrine.AI;
|
|||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
|
|
||||||
public class ResetLimits {
|
public class ResetLimits {
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ public class ResetLimits {
|
|||||||
|
|
||||||
public ResetLimits() {
|
public ResetLimits() {
|
||||||
|
|
||||||
taskID = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(HerobrineAI.getPluginCore(),
|
taskID = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(Herobrine.getPluginCore(),
|
||||||
new Runnable() {
|
new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
resetAll();
|
resetAll();
|
||||||
@ -65,9 +65,9 @@ public class ResetLimits {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void updateFromConfig() {
|
public void updateFromConfig() {
|
||||||
maxBooks = HerobrineAI.getPluginCore().getConfigDB().maxBooks;
|
maxBooks = Herobrine.getPluginCore().getConfigDB().maxBooks;
|
||||||
maxSigns = HerobrineAI.getPluginCore().getConfigDB().maxSigns;
|
maxSigns = Herobrine.getPluginCore().getConfigDB().maxSigns;
|
||||||
maxHeads = HerobrineAI.getPluginCore().getConfigDB().maxHeads;
|
maxHeads = Herobrine.getPluginCore().getConfigDB().maxHeads;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.Utils;
|
import net.theprogrammersworld.herobrine.Utils;
|
||||||
import net.theprogrammersworld.herobrine.AI.AICore;
|
import net.theprogrammersworld.herobrine.AI.AICore;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core;
|
import net.theprogrammersworld.herobrine.AI.Core;
|
||||||
@ -24,7 +24,7 @@ public class Attack extends Core {
|
|||||||
private boolean isHandler = false;
|
private boolean isHandler = false;
|
||||||
|
|
||||||
public Attack() {
|
public Attack() {
|
||||||
super(CoreType.ATTACK, AppearType.APPEAR, HerobrineAI.getPluginCore());
|
super(CoreType.ATTACK, AppearType.APPEAR, Herobrine.getPluginCore());
|
||||||
}
|
}
|
||||||
|
|
||||||
public CoreResult CallCore(Object[] data) {
|
public CoreResult CallCore(Object[] data) {
|
||||||
@ -38,11 +38,11 @@ public class Attack extends Core {
|
|||||||
return new CoreResult(false, "This player is protected.");
|
return new CoreResult(false, "This player is protected.");
|
||||||
}
|
}
|
||||||
|
|
||||||
HerobrineAI.HerobrineHP = HerobrineAI.HerobrineMaxHP;
|
Herobrine.HerobrineHP = Herobrine.HerobrineMaxHP;
|
||||||
ticksToEnd = 0;
|
ticksToEnd = 0;
|
||||||
AICore.PlayerTarget = player;
|
AICore.PlayerTarget = player;
|
||||||
AICore.isTarget = true;
|
AICore.isTarget = true;
|
||||||
AICore.log.info("[HerobrineAI] Teleporting to target. (" + AICore.PlayerTarget.getName() + ")");
|
AICore.log.info("[Herobrine] Teleporting to target. (" + AICore.PlayerTarget.getName() + ")");
|
||||||
Location ploc = (Location) AICore.PlayerTarget.getLocation();
|
Location ploc = (Location) AICore.PlayerTarget.getLocation();
|
||||||
Object[] data = { ploc };
|
Object[] data = { ploc };
|
||||||
PluginCore.getAICore().getCore(CoreType.DESTROY_TORCHES).RunCore(data);
|
PluginCore.getAICore().getCore(CoreType.DESTROY_TORCHES).RunCore(data);
|
||||||
|
@ -8,7 +8,7 @@ import org.bukkit.inventory.Inventory;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.BookMeta;
|
import org.bukkit.inventory.meta.BookMeta;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.Utils;
|
import net.theprogrammersworld.herobrine.Utils;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core;
|
import net.theprogrammersworld.herobrine.AI.Core;
|
||||||
import net.theprogrammersworld.herobrine.AI.CoreResult;
|
import net.theprogrammersworld.herobrine.AI.CoreResult;
|
||||||
@ -16,22 +16,22 @@ import net.theprogrammersworld.herobrine.AI.CoreResult;
|
|||||||
public class Book extends Core {
|
public class Book extends Core {
|
||||||
|
|
||||||
public Book() {
|
public Book() {
|
||||||
super(CoreType.BOOK, AppearType.NORMAL, HerobrineAI.getPluginCore());
|
super(CoreType.BOOK, AppearType.NORMAL, Herobrine.getPluginCore());
|
||||||
}
|
}
|
||||||
|
|
||||||
public CoreResult CallCore(Object[] data) {
|
public CoreResult CallCore(Object[] data) {
|
||||||
Player player = (Player) data[0];
|
Player player = (Player) data[0];
|
||||||
|
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().useWorlds.contains(player.getLocation().getWorld().getName())) {
|
if (Herobrine.getPluginCore().getConfigDB().useWorlds.contains(player.getLocation().getWorld().getName())) {
|
||||||
|
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().WriteBooks == true
|
if (Herobrine.getPluginCore().getConfigDB().WriteBooks == true
|
||||||
&& HerobrineAI.getPluginCore().getSupport().checkBooks(player.getLocation())) {
|
&& Herobrine.getPluginCore().getSupport().checkBooks(player.getLocation())) {
|
||||||
|
|
||||||
int chance = Utils.getRandomGen().nextInt(100);
|
int chance = Utils.getRandomGen().nextInt(100);
|
||||||
if (chance > (100 - HerobrineAI.getPluginCore().getConfigDB().BookChance)) {
|
if (chance > (100 - Herobrine.getPluginCore().getConfigDB().BookChance)) {
|
||||||
Inventory chest = (Inventory) data[1];
|
Inventory chest = (Inventory) data[1];
|
||||||
if (chest.firstEmpty() != -1) {
|
if (chest.firstEmpty() != -1) {
|
||||||
if (HerobrineAI.getPluginCore().getAICore().getResetLimits().isBook()) {
|
if (Herobrine.getPluginCore().getAICore().getResetLimits().isBook()) {
|
||||||
chest.setItem(chest.firstEmpty(), newBook());
|
chest.setItem(chest.firstEmpty(), newBook());
|
||||||
return new CoreResult(true, "Book created!");
|
return new CoreResult(true, "Book created!");
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ public class Book extends Core {
|
|||||||
|
|
||||||
public ItemStack newBook() {
|
public ItemStack newBook() {
|
||||||
|
|
||||||
int count = HerobrineAI.getPluginCore().getConfigDB().useBookMessages.size();
|
int count = Herobrine.getPluginCore().getConfigDB().useBookMessages.size();
|
||||||
|
|
||||||
int chance = Utils.getRandomGen().nextInt(count);
|
int chance = Utils.getRandomGen().nextInt(count);
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ public class Book extends Core {
|
|||||||
meta.setTitle("");
|
meta.setTitle("");
|
||||||
meta.setAuthor("");
|
meta.setAuthor("");
|
||||||
|
|
||||||
list.add(0, (String) HerobrineAI.getPluginCore().getConfigDB().useBookMessages.get(chance));
|
list.add(0, (String) Herobrine.getPluginCore().getConfigDB().useBookMessages.get(chance));
|
||||||
|
|
||||||
meta.setPages(list);
|
meta.setPages(list);
|
||||||
|
|
||||||
|
@ -7,14 +7,14 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.Utils;
|
import net.theprogrammersworld.herobrine.Utils;
|
||||||
import net.theprogrammersworld.herobrine.AI.*;
|
import net.theprogrammersworld.herobrine.AI.*;
|
||||||
|
|
||||||
public class BuildCave extends Core {
|
public class BuildCave extends Core {
|
||||||
|
|
||||||
public BuildCave() {
|
public BuildCave() {
|
||||||
super(CoreType.BUILD_CAVE, AppearType.NORMAL, HerobrineAI.getPluginCore());
|
super(CoreType.BUILD_CAVE, AppearType.NORMAL, Herobrine.getPluginCore());
|
||||||
}
|
}
|
||||||
|
|
||||||
public CoreResult CallCore(Object[] data) {
|
public CoreResult CallCore(Object[] data) {
|
||||||
@ -26,12 +26,12 @@ public class BuildCave extends Core {
|
|||||||
|
|
||||||
public CoreResult buildCave(Location loc) {
|
public CoreResult buildCave(Location loc) {
|
||||||
|
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().BuildStuff == true) {
|
if (Herobrine.getPluginCore().getConfigDB().BuildStuff == true) {
|
||||||
if (HerobrineAI.getPluginCore().getSupport().checkBuild(loc)) {
|
if (Herobrine.getPluginCore().getSupport().checkBuild(loc)) {
|
||||||
if (loc.getBlockY() < 60) {
|
if (loc.getBlockY() < 60) {
|
||||||
|
|
||||||
int chance = Utils.getRandomGen().nextInt(100);
|
int chance = Utils.getRandomGen().nextInt(100);
|
||||||
if (chance > (100 - HerobrineAI.getPluginCore().getConfigDB().CaveChance)) {
|
if (chance > (100 - Herobrine.getPluginCore().getConfigDB().CaveChance)) {
|
||||||
AICore.log.info("Creating cave...");
|
AICore.log.info("Creating cave...");
|
||||||
|
|
||||||
GenerateCave(loc);
|
GenerateCave(loc);
|
||||||
@ -55,7 +55,7 @@ public class BuildCave extends Core {
|
|||||||
|
|
||||||
public CoreResult buildCave(Location loc, boolean cmd) {
|
public CoreResult buildCave(Location loc, boolean cmd) {
|
||||||
|
|
||||||
if (HerobrineAI.getPluginCore().getSupport().checkBuild(loc)) {
|
if (Herobrine.getPluginCore().getSupport().checkBuild(loc)) {
|
||||||
if (loc.getBlockY() < 60) {
|
if (loc.getBlockY() < 60) {
|
||||||
|
|
||||||
AICore.log.info("Creating cave...");
|
AICore.log.info("Creating cave...");
|
||||||
@ -75,7 +75,7 @@ public class BuildCave extends Core {
|
|||||||
|
|
||||||
public void GenerateCave(Location loc) {
|
public void GenerateCave(Location loc) {
|
||||||
|
|
||||||
if (HerobrineAI.getPluginCore().getSupport().checkBuild(loc)) {
|
if (Herobrine.getPluginCore().getSupport().checkBuild(loc)) {
|
||||||
|
|
||||||
ArrayList<Location> redstoneTorchList = new ArrayList<Location>();
|
ArrayList<Location> redstoneTorchList = new ArrayList<Location>();
|
||||||
|
|
||||||
|
@ -2,14 +2,14 @@ package net.theprogrammersworld.herobrine.AI.cores;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core;
|
import net.theprogrammersworld.herobrine.AI.Core;
|
||||||
import net.theprogrammersworld.herobrine.AI.CoreResult;
|
import net.theprogrammersworld.herobrine.AI.CoreResult;
|
||||||
|
|
||||||
public class Burn extends Core {
|
public class Burn extends Core {
|
||||||
|
|
||||||
public Burn() {
|
public Burn() {
|
||||||
super(CoreType.BURN, AppearType.NORMAL, HerobrineAI.getPluginCore());
|
super(CoreType.BURN, AppearType.NORMAL, Herobrine.getPluginCore());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -7,7 +7,7 @@ import org.bukkit.block.Block;
|
|||||||
import org.bukkit.block.Sign;
|
import org.bukkit.block.Sign;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core;
|
import net.theprogrammersworld.herobrine.AI.Core;
|
||||||
import net.theprogrammersworld.herobrine.AI.CoreResult;
|
import net.theprogrammersworld.herobrine.AI.CoreResult;
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ public class BuryPlayer extends Core {
|
|||||||
public Block savedBlock2 = null;
|
public Block savedBlock2 = null;
|
||||||
|
|
||||||
public BuryPlayer() {
|
public BuryPlayer() {
|
||||||
super(CoreType.BURY_PLAYER, AppearType.NORMAL, HerobrineAI.getPluginCore());
|
super(CoreType.BURY_PLAYER, AppearType.NORMAL, Herobrine.getPluginCore());
|
||||||
}
|
}
|
||||||
|
|
||||||
public CoreResult CallCore(Object[] data) {
|
public CoreResult CallCore(Object[] data) {
|
||||||
@ -25,7 +25,7 @@ public class BuryPlayer extends Core {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CoreResult FindPlace(Player player){
|
public CoreResult FindPlace(Player player){
|
||||||
if(HerobrineAI.getPluginCore().getSupport().checkBuild(player.getLocation())){
|
if(Herobrine.getPluginCore().getSupport().checkBuild(player.getLocation())){
|
||||||
Location loc = (Location) player.getLocation();
|
Location loc = (Location) player.getLocation();
|
||||||
|
|
||||||
int[][] blocks = {
|
int[][] blocks = {
|
||||||
|
@ -6,14 +6,14 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core;
|
import net.theprogrammersworld.herobrine.AI.Core;
|
||||||
import net.theprogrammersworld.herobrine.AI.CoreResult;
|
import net.theprogrammersworld.herobrine.AI.CoreResult;
|
||||||
|
|
||||||
public class Curse extends Core {
|
public class Curse extends Core {
|
||||||
|
|
||||||
public Curse() {
|
public Curse() {
|
||||||
super(CoreType.CURSE, AppearType.NORMAL, HerobrineAI.getPluginCore());
|
super(CoreType.CURSE, AppearType.NORMAL, Herobrine.getPluginCore());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -28,7 +28,7 @@ public class Curse extends Core {
|
|||||||
player.addPotionEffect(new PotionEffect(PotionEffectType.WEAKNESS, 1000, 1));
|
player.addPotionEffect(new PotionEffect(PotionEffectType.WEAKNESS, 1000, 1));
|
||||||
|
|
||||||
for (int i=0; i< 3 ; i++) {
|
for (int i=0; i< 3 ; i++) {
|
||||||
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(HerobrineAI.getPluginCore(), new Runnable() {
|
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Herobrine.getPluginCore(), new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -4,14 +4,14 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core;
|
import net.theprogrammersworld.herobrine.AI.Core;
|
||||||
import net.theprogrammersworld.herobrine.AI.CoreResult;
|
import net.theprogrammersworld.herobrine.AI.CoreResult;
|
||||||
|
|
||||||
public class DestroyTorches extends Core {
|
public class DestroyTorches extends Core {
|
||||||
|
|
||||||
public DestroyTorches() {
|
public DestroyTorches() {
|
||||||
super(CoreType.DESTROY_TORCHES, AppearType.NORMAL, HerobrineAI.getPluginCore());
|
super(CoreType.DESTROY_TORCHES, AppearType.NORMAL, Herobrine.getPluginCore());
|
||||||
}
|
}
|
||||||
|
|
||||||
public CoreResult CallCore(Object[] data) {
|
public CoreResult CallCore(Object[] data) {
|
||||||
@ -19,22 +19,22 @@ public class DestroyTorches extends Core {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CoreResult destroyTorches(Location loc) {
|
public CoreResult destroyTorches(Location loc) {
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().DestroyTorches == true) {
|
if (Herobrine.getPluginCore().getConfigDB().DestroyTorches == true) {
|
||||||
|
|
||||||
int x = loc.getBlockX();
|
int x = loc.getBlockX();
|
||||||
int y = loc.getBlockY();
|
int y = loc.getBlockY();
|
||||||
int z = loc.getBlockZ();
|
int z = loc.getBlockZ();
|
||||||
World world = loc.getWorld();
|
World world = loc.getWorld();
|
||||||
|
|
||||||
int i = -(HerobrineAI.getPluginCore().getConfigDB().DestroyTorchesRadius); // Y
|
int i = -(Herobrine.getPluginCore().getConfigDB().DestroyTorchesRadius); // Y
|
||||||
int ii = -(HerobrineAI.getPluginCore().getConfigDB().DestroyTorchesRadius); // X
|
int ii = -(Herobrine.getPluginCore().getConfigDB().DestroyTorchesRadius); // X
|
||||||
int iii = -(HerobrineAI.getPluginCore().getConfigDB().DestroyTorchesRadius); // Z
|
int iii = -(Herobrine.getPluginCore().getConfigDB().DestroyTorchesRadius); // Z
|
||||||
|
|
||||||
for (i = -(HerobrineAI.getPluginCore().getConfigDB().DestroyTorchesRadius); i <= HerobrineAI.getPluginCore()
|
for (i = -(Herobrine.getPluginCore().getConfigDB().DestroyTorchesRadius); i <= Herobrine.getPluginCore()
|
||||||
.getConfigDB().DestroyTorchesRadius; i++) {
|
.getConfigDB().DestroyTorchesRadius; i++) {
|
||||||
for (ii = -(HerobrineAI.getPluginCore().getConfigDB().DestroyTorchesRadius); ii <= HerobrineAI
|
for (ii = -(Herobrine.getPluginCore().getConfigDB().DestroyTorchesRadius); ii <= Herobrine
|
||||||
.getPluginCore().getConfigDB().DestroyTorchesRadius; ii++) {
|
.getPluginCore().getConfigDB().DestroyTorchesRadius; ii++) {
|
||||||
for (iii = -(HerobrineAI.getPluginCore().getConfigDB().DestroyTorchesRadius); iii <= HerobrineAI
|
for (iii = -(Herobrine.getPluginCore().getConfigDB().DestroyTorchesRadius); iii <= Herobrine
|
||||||
.getPluginCore().getConfigDB().DestroyTorchesRadius; iii++) {
|
.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();
|
||||||
|
@ -9,7 +9,7 @@ import org.bukkit.World;
|
|||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.Utils;
|
import net.theprogrammersworld.herobrine.Utils;
|
||||||
import net.theprogrammersworld.herobrine.AI.AICore;
|
import net.theprogrammersworld.herobrine.AI.AICore;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core;
|
import net.theprogrammersworld.herobrine.AI.Core;
|
||||||
@ -26,7 +26,7 @@ public class Graveyard extends Core {
|
|||||||
private Player savedPlayer = null;
|
private Player savedPlayer = null;
|
||||||
|
|
||||||
public Graveyard() {
|
public Graveyard() {
|
||||||
super(CoreType.GRAVEYARD, AppearType.APPEAR, HerobrineAI.getPluginCore());
|
super(CoreType.GRAVEYARD, AppearType.APPEAR, Herobrine.getPluginCore());
|
||||||
}
|
}
|
||||||
|
|
||||||
public CoreResult CallCore(Object[] data) {
|
public CoreResult CallCore(Object[] data) {
|
||||||
@ -34,8 +34,8 @@ public class Graveyard extends Core {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CoreResult Teleport(Player player) {
|
public CoreResult Teleport(Player player) {
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().UseGraveyardWorld == true) {
|
if (Herobrine.getPluginCore().getConfigDB().UseGraveyardWorld == true) {
|
||||||
if (!HerobrineAI.getPluginCore().getAICore().checkAncientSword(player.getInventory())) {
|
if (!Herobrine.getPluginCore().getAICore().checkAncientSword(player.getInventory())) {
|
||||||
LivingEntities = Bukkit.getServer().getWorld("world_herobrineai_graveyard").getLivingEntities();
|
LivingEntities = Bukkit.getServer().getWorld("world_herobrineai_graveyard").getLivingEntities();
|
||||||
for (int i = 0; i <= LivingEntities.size() - 1; i++) {
|
for (int i = 0; i <= LivingEntities.size() - 1; i++) {
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ public class Graveyard extends Core {
|
|||||||
|| this.ticks == 90 || AICore.isTarget == false) {
|
|| this.ticks == 90 || AICore.isTarget == false) {
|
||||||
|
|
||||||
if (AICore.PlayerTarget == savedPlayer) {
|
if (AICore.PlayerTarget == savedPlayer) {
|
||||||
HerobrineAI.getPluginCore().getAICore().CancelTarget(CoreType.GRAVEYARD);
|
Herobrine.getPluginCore().getAICore().CancelTarget(CoreType.GRAVEYARD);
|
||||||
}
|
}
|
||||||
|
|
||||||
savedPlayer.teleport(new Location(savedWorld, savedX, savedY, savedZ));
|
savedPlayer.teleport(new Location(savedWorld, savedX, savedY, savedZ));
|
||||||
|
@ -10,7 +10,7 @@ import org.bukkit.entity.EntityType;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Wolf;
|
import org.bukkit.entity.Wolf;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.Utils;
|
import net.theprogrammersworld.herobrine.Utils;
|
||||||
import net.theprogrammersworld.herobrine.AI.AICore;
|
import net.theprogrammersworld.herobrine.AI.AICore;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core;
|
import net.theprogrammersworld.herobrine.AI.Core;
|
||||||
@ -27,7 +27,7 @@ public class Haunt extends Core {
|
|||||||
private boolean isFirst = true;
|
private boolean isFirst = true;
|
||||||
|
|
||||||
public Haunt() {
|
public Haunt() {
|
||||||
super(CoreType.HAUNT, AppearType.APPEAR, HerobrineAI.getPluginCore());
|
super(CoreType.HAUNT, AppearType.APPEAR, Herobrine.getPluginCore());
|
||||||
}
|
}
|
||||||
|
|
||||||
public CoreResult CallCore(Object[] data) {
|
public CoreResult CallCore(Object[] data) {
|
||||||
@ -45,7 +45,7 @@ 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("[Herobrine] Hauntig player!");
|
||||||
Location loc = (Location) PluginCore.HerobrineNPC.getBukkitEntity().getLocation();
|
Location loc = (Location) PluginCore.HerobrineNPC.getBukkitEntity().getLocation();
|
||||||
loc.setY(-20);
|
loc.setY(-20);
|
||||||
PluginCore.HerobrineNPC.moveTo(loc);
|
PluginCore.HerobrineNPC.moveTo(loc);
|
||||||
@ -182,7 +182,7 @@ public class Haunt extends Core {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HerobrineAI.HerobrineHP = HerobrineAI.HerobrineMaxHP;
|
Herobrine.HerobrineHP = Herobrine.HerobrineMaxHP;
|
||||||
loc = AICore.PlayerTarget.getLocation();
|
loc = AICore.PlayerTarget.getLocation();
|
||||||
loc.setY(loc.getY() + 1.5);
|
loc.setY(loc.getY() + 1.5);
|
||||||
PluginCore.HerobrineNPC.lookAtPoint(loc);
|
PluginCore.HerobrineNPC.lookAtPoint(loc);
|
||||||
|
@ -11,7 +11,7 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.Utils;
|
import net.theprogrammersworld.herobrine.Utils;
|
||||||
import net.theprogrammersworld.herobrine.AI.AICore;
|
import net.theprogrammersworld.herobrine.AI.AICore;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core;
|
import net.theprogrammersworld.herobrine.AI.Core;
|
||||||
@ -24,7 +24,7 @@ public class Heads extends Core {
|
|||||||
private List<Block> headList = new ArrayList<Block>();
|
private List<Block> headList = new ArrayList<Block>();
|
||||||
|
|
||||||
public Heads() {
|
public Heads() {
|
||||||
super(CoreType.HEADS, AppearType.NORMAL, HerobrineAI.getPluginCore());
|
super(CoreType.HEADS, AppearType.NORMAL, Herobrine.getPluginCore());
|
||||||
}
|
}
|
||||||
|
|
||||||
public CoreResult CallCore(Object[] data) {
|
public CoreResult CallCore(Object[] data) {
|
||||||
|
@ -6,7 +6,7 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.Utils;
|
import net.theprogrammersworld.herobrine.Utils;
|
||||||
import net.theprogrammersworld.herobrine.AI.AICore;
|
import net.theprogrammersworld.herobrine.AI.AICore;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core;
|
import net.theprogrammersworld.herobrine.AI.Core;
|
||||||
@ -15,7 +15,7 @@ import net.theprogrammersworld.herobrine.AI.CoreResult;
|
|||||||
public class Pyramid extends Core {
|
public class Pyramid extends Core {
|
||||||
|
|
||||||
public Pyramid() {
|
public Pyramid() {
|
||||||
super(CoreType.PYRAMID, AppearType.NORMAL, HerobrineAI.getPluginCore());
|
super(CoreType.PYRAMID, AppearType.NORMAL, Herobrine.getPluginCore());
|
||||||
}
|
}
|
||||||
|
|
||||||
public CoreResult CallCore(Object[] data) {
|
public CoreResult CallCore(Object[] data) {
|
||||||
@ -165,7 +165,7 @@ public class Pyramid extends Core {
|
|||||||
|
|
||||||
public void BuildPyramid(World world, int X, int Y, int Z) {
|
public void BuildPyramid(World world, int X, int Y, int Z) {
|
||||||
|
|
||||||
if (HerobrineAI.getPluginCore().getSupport().checkBuild(new Location(world, X, Y, Z))) {
|
if (Herobrine.getPluginCore().getSupport().checkBuild(new Location(world, X, Y, Z))) {
|
||||||
|
|
||||||
AICore.log.info("Creating pyramid at " + X + "," + Y + "," + Z);
|
AICore.log.info("Creating pyramid at " + X + "," + Y + "," + Z);
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ package net.theprogrammersworld.herobrine.AI.cores;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.Utils;
|
import net.theprogrammersworld.herobrine.Utils;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core;
|
import net.theprogrammersworld.herobrine.AI.Core;
|
||||||
import net.theprogrammersworld.herobrine.AI.CoreResult;
|
import net.theprogrammersworld.herobrine.AI.CoreResult;
|
||||||
@ -11,7 +11,7 @@ import net.theprogrammersworld.herobrine.AI.CoreResult;
|
|||||||
public class RandomExplosion extends Core {
|
public class RandomExplosion extends Core {
|
||||||
|
|
||||||
public RandomExplosion() {
|
public RandomExplosion() {
|
||||||
super(CoreType.RANDOM_EXPLOSION, AppearType.NORMAL, HerobrineAI.getPluginCore());
|
super(CoreType.RANDOM_EXPLOSION, AppearType.NORMAL, Herobrine.getPluginCore());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -9,7 +9,7 @@ import org.bukkit.World;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.ConfigDB;
|
import net.theprogrammersworld.herobrine.ConfigDB;
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.Utils;
|
import net.theprogrammersworld.herobrine.Utils;
|
||||||
import net.theprogrammersworld.herobrine.AI.AICore;
|
import net.theprogrammersworld.herobrine.AI.AICore;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core;
|
import net.theprogrammersworld.herobrine.AI.Core;
|
||||||
@ -23,7 +23,7 @@ public class RandomPosition extends Core {
|
|||||||
private boolean RandomMoveIsPlayer = false;
|
private boolean RandomMoveIsPlayer = false;
|
||||||
|
|
||||||
public RandomPosition() {
|
public RandomPosition() {
|
||||||
super(CoreType.RANDOM_POSITION, AppearType.APPEAR, HerobrineAI.getPluginCore());
|
super(CoreType.RANDOM_POSITION, AppearType.APPEAR, Herobrine.getPluginCore());
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getRandomTicks() {
|
public int getRandomTicks() {
|
||||||
@ -59,14 +59,14 @@ public class RandomPosition extends Core {
|
|||||||
newloc.setY(newloc.getY() + 1.5);
|
newloc.setY(newloc.getY() + 1.5);
|
||||||
PluginCore.HerobrineNPC.lookAtPoint(newloc);
|
PluginCore.HerobrineNPC.lookAtPoint(newloc);
|
||||||
randomTicks = 0;
|
randomTicks = 0;
|
||||||
AICore.log.info("[HerobrineAI] Herobrine is now in RandomLocation mode.");
|
AICore.log.info("[Herobrine] Herobrine is now in RandomLocation mode.");
|
||||||
PluginCore.getAICore().Start_RM();
|
PluginCore.getAICore().Start_RM();
|
||||||
PluginCore.getAICore().Start_RS();
|
PluginCore.getAICore().Start_RS();
|
||||||
PluginCore.getAICore().Start_CG();
|
PluginCore.getAICore().Start_CG();
|
||||||
RandomMoveIsPlayer = false;
|
RandomMoveIsPlayer = false;
|
||||||
return new CoreResult(true, "Herobrine is now in WalkingMode.");
|
return new CoreResult(true, "Herobrine is now in WalkingMode.");
|
||||||
} else {
|
} else {
|
||||||
AICore.log.info("[HerobrineAI] RandomPosition Failed!");
|
AICore.log.info("[Herobrine] RandomPosition Failed!");
|
||||||
return setRandomPosition(world);
|
return setRandomPosition(world);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -138,7 +138,7 @@ public class RandomPosition extends Core {
|
|||||||
&& world.getBlockAt(randx, randy - 1, randz).getType() != Material.REDSTONE_TORCH
|
&& world.getBlockAt(randx, randy - 1, randz).getType() != Material.REDSTONE_TORCH
|
||||||
&& world.getBlockAt(randx, randy - 1, randz).getType() != Material.REDSTONE) {
|
&& world.getBlockAt(randx, randy - 1, randz).getType() != Material.REDSTONE) {
|
||||||
|
|
||||||
AICore.log.info("[HerobrineAI] RandomLocation "
|
AICore.log.info("[Herobrine] RandomLocation "
|
||||||
+ world.getBlockAt(randx, randy - 1, randz).getType().toString() + " is X:" + randx + " Y:"
|
+ world.getBlockAt(randx, randy - 1, randz).getType().toString() + " is X:" + randx + " Y:"
|
||||||
+ randy + " Z:" + randz);
|
+ randy + " Z:" + randz);
|
||||||
return new Location(world, (float) randx + 0.5, (float) randy, (float) randz);
|
return new Location(world, (float) randx + 0.5, (float) randy, (float) randz);
|
||||||
@ -154,7 +154,7 @@ public class RandomPosition extends Core {
|
|||||||
public void RandomMove() {
|
public void RandomMove() {
|
||||||
if (PluginCore.getAICore().getCoreTypeNow() == CoreType.RANDOM_POSITION && AICore.isTarget == false
|
if (PluginCore.getAICore().getCoreTypeNow() == CoreType.RANDOM_POSITION && AICore.isTarget == false
|
||||||
&& RandomMoveIsPlayer == false) {
|
&& RandomMoveIsPlayer == false) {
|
||||||
HerobrineAI.HerobrineHP = HerobrineAI.HerobrineMaxHP;
|
Herobrine.HerobrineHP = Herobrine.HerobrineMaxHP;
|
||||||
|
|
||||||
if (Utils.getRandomGen().nextInt(5) == 3) {
|
if (Utils.getRandomGen().nextInt(5) == 3) {
|
||||||
Location loc = PluginCore.HerobrineNPC.getBukkitEntity().getLocation();
|
Location loc = PluginCore.HerobrineNPC.getBukkitEntity().getLocation();
|
||||||
|
@ -2,14 +2,14 @@ package net.theprogrammersworld.herobrine.AI.cores;
|
|||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core;
|
import net.theprogrammersworld.herobrine.AI.Core;
|
||||||
import net.theprogrammersworld.herobrine.AI.CoreResult;
|
import net.theprogrammersworld.herobrine.AI.CoreResult;
|
||||||
|
|
||||||
public class RandomSound extends Core {
|
public class RandomSound extends Core {
|
||||||
|
|
||||||
public RandomSound() {
|
public RandomSound() {
|
||||||
super(CoreType.RANDOM_SOUND, AppearType.NORMAL, HerobrineAI.getPluginCore());
|
super(CoreType.RANDOM_SOUND, AppearType.NORMAL, Herobrine.getPluginCore());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -18,12 +18,12 @@ public class RandomSound extends Core {
|
|||||||
int multip = 1;
|
int multip = 1;
|
||||||
|
|
||||||
while (multip != 7) {
|
while (multip != 7) {
|
||||||
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(HerobrineAI.getPluginCore(), new Runnable() {
|
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Herobrine.getPluginCore(), new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
HerobrineAI.getPluginCore().getAICore().getCore(CoreType.SOUNDF).RunCore(data);
|
Herobrine.getPluginCore().getAICore().getCore(CoreType.SOUNDF).RunCore(data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import org.bukkit.block.Sign;
|
|||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
import org.bukkit.block.data.Directional;
|
import org.bukkit.block.data.Directional;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.Utils;
|
import net.theprogrammersworld.herobrine.Utils;
|
||||||
import net.theprogrammersworld.herobrine.AI.ConsoleLogger;
|
import net.theprogrammersworld.herobrine.AI.ConsoleLogger;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core;
|
import net.theprogrammersworld.herobrine.AI.Core;
|
||||||
@ -19,7 +19,7 @@ import net.theprogrammersworld.herobrine.misc.BlockChanger;
|
|||||||
public class Signs extends Core {
|
public class Signs extends Core {
|
||||||
|
|
||||||
public Signs() {
|
public Signs() {
|
||||||
super(CoreType.SIGNS, AppearType.NORMAL, HerobrineAI.getPluginCore());
|
super(CoreType.SIGNS, AppearType.NORMAL, Herobrine.getPluginCore());
|
||||||
}
|
}
|
||||||
|
|
||||||
public CoreResult CallCore(Object[] data) {
|
public CoreResult CallCore(Object[] data) {
|
||||||
@ -72,9 +72,9 @@ public class Signs extends Core {
|
|||||||
|
|
||||||
Random randcgen = Utils.getRandomGen();
|
Random randcgen = Utils.getRandomGen();
|
||||||
int chance = randcgen.nextInt(100);
|
int chance = randcgen.nextInt(100);
|
||||||
if (chance > (100 - HerobrineAI.getPluginCore().getConfigDB().SignChance)) {
|
if (chance > (100 - Herobrine.getPluginCore().getConfigDB().SignChance)) {
|
||||||
Random randgen = Utils.getRandomGen();
|
Random randgen = Utils.getRandomGen();
|
||||||
int count = HerobrineAI.getPluginCore().getConfigDB().useSignMessages.size();
|
int count = Herobrine.getPluginCore().getConfigDB().useSignMessages.size();
|
||||||
int randmsg = randgen.nextInt(count);
|
int randmsg = randgen.nextInt(count);
|
||||||
|
|
||||||
Block signblock = loc.add(0, 0D, 0).getBlock();
|
Block signblock = loc.add(0, 0D, 0).getBlock();
|
||||||
@ -88,7 +88,7 @@ public class Signs extends Core {
|
|||||||
((Directional) blockData).setFacing(BlockChanger.getPlayerBlockFace(ploc));
|
((Directional) blockData).setFacing(BlockChanger.getPlayerBlockFace(ploc));
|
||||||
sign.setBlockData(blockData);
|
sign.setBlockData(blockData);
|
||||||
|
|
||||||
sign.setLine(1, HerobrineAI.getPluginCore().getConfigDB().useSignMessages.get(randmsg));
|
sign.setLine(1, Herobrine.getPluginCore().getConfigDB().useSignMessages.get(randmsg));
|
||||||
sign.update();
|
sign.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ package net.theprogrammersworld.herobrine.AI.cores;
|
|||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.Utils;
|
import net.theprogrammersworld.herobrine.Utils;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core;
|
import net.theprogrammersworld.herobrine.AI.Core;
|
||||||
import net.theprogrammersworld.herobrine.AI.CoreResult;
|
import net.theprogrammersworld.herobrine.AI.CoreResult;
|
||||||
@ -11,7 +11,7 @@ import net.theprogrammersworld.herobrine.AI.CoreResult;
|
|||||||
public class SoundF extends Core{
|
public class SoundF extends Core{
|
||||||
|
|
||||||
public SoundF(){
|
public SoundF(){
|
||||||
super(CoreType.SOUNDF,AppearType.NORMAL, HerobrineAI.getPluginCore());
|
super(CoreType.SOUNDF,AppearType.NORMAL, Herobrine.getPluginCore());
|
||||||
}
|
}
|
||||||
|
|
||||||
public CoreResult CallCore(Object[] data){
|
public CoreResult CallCore(Object[] data){
|
||||||
|
@ -12,7 +12,7 @@ import org.bukkit.enchantments.Enchantment;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.Utils;
|
import net.theprogrammersworld.herobrine.Utils;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core;
|
import net.theprogrammersworld.herobrine.AI.Core;
|
||||||
import net.theprogrammersworld.herobrine.AI.CoreResult;
|
import net.theprogrammersworld.herobrine.AI.CoreResult;
|
||||||
@ -23,7 +23,7 @@ import net.theprogrammersworld.herobrine.misc.StructureLoader;
|
|||||||
public class Temple extends Core {
|
public class Temple extends Core {
|
||||||
|
|
||||||
public Temple() {
|
public Temple() {
|
||||||
super(CoreType.TEMPLE, AppearType.NORMAL, HerobrineAI.getPluginCore());
|
super(CoreType.TEMPLE, AppearType.NORMAL, Herobrine.getPluginCore());
|
||||||
}
|
}
|
||||||
|
|
||||||
public CoreResult CallCore(Object[] data) {
|
public CoreResult CallCore(Object[] data) {
|
||||||
@ -168,7 +168,7 @@ public class Temple extends Core {
|
|||||||
|
|
||||||
Location loc = new Location(world, X, Y, Z);
|
Location loc = new Location(world, X, Y, Z);
|
||||||
|
|
||||||
if (HerobrineAI.getPluginCore().getSupport().checkBuild(new Location(world, X, Y, Z))) {
|
if (Herobrine.getPluginCore().getSupport().checkBuild(new Location(world, X, Y, Z))) {
|
||||||
|
|
||||||
int MainX = loc.getBlockX();
|
int MainX = loc.getBlockX();
|
||||||
int MainY = loc.getBlockY();
|
int MainY = loc.getBlockY();
|
||||||
@ -176,15 +176,15 @@ public class Temple extends Core {
|
|||||||
|
|
||||||
// Main blocks
|
// Main blocks
|
||||||
|
|
||||||
new StructureLoader(HerobrineAI.getPluginCore().getInputStreamData("/res/temple.yml")).Build(loc.getWorld(),
|
new StructureLoader(Herobrine.getPluginCore().getInputStreamData("/res/temple.yml")).Build(loc.getWorld(),
|
||||||
MainX, MainY, MainZ);
|
MainX, MainY, MainZ);
|
||||||
loc.getWorld().getBlockAt(MainX + 6, MainY + 0, MainZ + 2).setType(Material.CHEST);
|
loc.getWorld().getBlockAt(MainX + 6, MainY + 0, MainZ + 2).setType(Material.CHEST);
|
||||||
// Mob spawn
|
// Mob spawn
|
||||||
if (!HerobrineAI.isNPCDisabled) {
|
if (!Herobrine.isNPCDisabled) {
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().UseNPC_Guardian) {
|
if (Herobrine.getPluginCore().getConfigDB().UseNPC_Guardian) {
|
||||||
Location mobloc = new Location(loc.getWorld(), MainX + 6, MainY + 0, MainZ + 4);
|
Location mobloc = new Location(loc.getWorld(), MainX + 6, MainY + 0, MainZ + 4);
|
||||||
for (int i = 1; i <= HerobrineAI.getPluginCore().getConfigDB().npc.getInt("npc.Guardian.SpawnCount"); i++) {
|
for (int i = 1; i <= Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Guardian.SpawnCount"); i++) {
|
||||||
HerobrineAI.getPluginCore().getEntityManager().spawnCustomZombie(mobloc, MobType.ARTIFACT_GUARDIAN);
|
Herobrine.getPluginCore().getEntityManager().spawnCustomZombie(mobloc, MobType.ARTIFACT_GUARDIAN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -194,7 +194,7 @@ public class Temple extends Core {
|
|||||||
ItemStack item = null;
|
ItemStack item = null;
|
||||||
ArrayList<String> newLore = new ArrayList<String>();
|
ArrayList<String> newLore = new ArrayList<String>();
|
||||||
|
|
||||||
if (chance < 4 && HerobrineAI.getPluginCore().getConfigDB().UseArtifactBow) {
|
if (chance < 4 && Herobrine.getPluginCore().getConfigDB().UseArtifactBow) {
|
||||||
|
|
||||||
item = new ItemStack(Material.BOW);
|
item = new ItemStack(Material.BOW);
|
||||||
newLore.add("Herobrine<EFBFBD>s artifact");
|
newLore.add("Herobrine<EFBFBD>s artifact");
|
||||||
@ -203,7 +203,7 @@ public class Temple extends Core {
|
|||||||
item.addEnchantment(Enchantment.ARROW_FIRE, 1);
|
item.addEnchantment(Enchantment.ARROW_FIRE, 1);
|
||||||
item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 1);
|
item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 1);
|
||||||
|
|
||||||
} else if (chance < 8 && HerobrineAI.getPluginCore().getConfigDB().UseArtifactSword) {
|
} else if (chance < 8 && Herobrine.getPluginCore().getConfigDB().UseArtifactSword) {
|
||||||
|
|
||||||
item = new ItemStack(Material.DIAMOND_SWORD);
|
item = new ItemStack(Material.DIAMOND_SWORD);
|
||||||
newLore.add("Herobrine<EFBFBD>s artifact");
|
newLore.add("Herobrine<EFBFBD>s artifact");
|
||||||
@ -213,7 +213,7 @@ public class Temple extends Core {
|
|||||||
item.addEnchantment(Enchantment.DAMAGE_ALL, 2);
|
item.addEnchantment(Enchantment.DAMAGE_ALL, 2);
|
||||||
item.addEnchantment(Enchantment.DURABILITY, 3);
|
item.addEnchantment(Enchantment.DURABILITY, 3);
|
||||||
|
|
||||||
} else if (chance < 12 && HerobrineAI.getPluginCore().getConfigDB().UseArtifactApple) {
|
} else if (chance < 12 && Herobrine.getPluginCore().getConfigDB().UseArtifactApple) {
|
||||||
|
|
||||||
item = new ItemStack(Material.GOLDEN_APPLE);
|
item = new ItemStack(Material.GOLDEN_APPLE);
|
||||||
newLore.add("Herobrine<EFBFBD>s artifact");
|
newLore.add("Herobrine<EFBFBD>s artifact");
|
||||||
@ -221,8 +221,8 @@ public class Temple extends Core {
|
|||||||
item = ItemName.setNameAndLore(item, "Apple of Death", newLore);
|
item = ItemName.setNameAndLore(item, "Apple of Death", newLore);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().UseAncientSword) {
|
if (Herobrine.getPluginCore().getConfigDB().UseAncientSword) {
|
||||||
item = HerobrineAI.getPluginCore().getAICore().createAncientSword();
|
item = Herobrine.getPluginCore().getAICore().createAncientSword();
|
||||||
item.addEnchantment(Enchantment.KNOCKBACK, 2);
|
item.addEnchantment(Enchantment.KNOCKBACK, 2);
|
||||||
item.addEnchantment(Enchantment.DAMAGE_ALL, 2);
|
item.addEnchantment(Enchantment.DAMAGE_ALL, 2);
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.AICore;
|
import net.theprogrammersworld.herobrine.AI.AICore;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core;
|
import net.theprogrammersworld.herobrine.AI.Core;
|
||||||
import net.theprogrammersworld.herobrine.AI.CoreResult;
|
import net.theprogrammersworld.herobrine.AI.CoreResult;
|
||||||
@ -17,7 +17,7 @@ import net.theprogrammersworld.herobrine.AI.Message;
|
|||||||
public class Totem extends Core {
|
public class Totem extends Core {
|
||||||
|
|
||||||
public Totem() {
|
public Totem() {
|
||||||
super(CoreType.TOTEM, AppearType.APPEAR, HerobrineAI.getPluginCore());
|
super(CoreType.TOTEM, AppearType.APPEAR, Herobrine.getPluginCore());
|
||||||
}
|
}
|
||||||
|
|
||||||
public CoreResult CallCore(Object[] data) {
|
public CoreResult CallCore(Object[] data) {
|
||||||
|
@ -4,7 +4,7 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.misc.StructureLoader;
|
import net.theprogrammersworld.herobrine.misc.StructureLoader;
|
||||||
|
|
||||||
public class GraveyardWorld {
|
public class GraveyardWorld {
|
||||||
@ -25,7 +25,7 @@ public class GraveyardWorld {
|
|||||||
int MainY = 3;
|
int MainY = 3;
|
||||||
int MainZ = -10;
|
int MainZ = -10;
|
||||||
|
|
||||||
StructureLoader structLoader = new StructureLoader(HerobrineAI.getPluginCore().getInputStreamData("/res/graveyard_world.yml"));
|
StructureLoader structLoader = new StructureLoader(Herobrine.getPluginCore().getInputStreamData("/res/graveyard_world.yml"));
|
||||||
structLoader.Build(loc.getWorld(), MainX, MainY, MainZ);
|
structLoader.Build(loc.getWorld(), MainX, MainY, MainZ);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ public class ConfigDB {
|
|||||||
useBookMessages.add("... before i was dead.");
|
useBookMessages.add("... before i was dead.");
|
||||||
UseCustomItemsList.add("ItemExample");
|
UseCustomItemsList.add("ItemExample");
|
||||||
|
|
||||||
log.info("[HerobrineAI] Creating new Config ...");
|
log.info("[Herobrine] Creating new Config ...");
|
||||||
config.set("config.ShowInterval", 144000);
|
config.set("config.ShowInterval", 144000);
|
||||||
config.set("config.ShowRate", 2);
|
config.set("config.ShowRate", 2);
|
||||||
config.set("config.HitPlayer", true);
|
config.set("config.HitPlayer", true);
|
||||||
@ -334,37 +334,37 @@ public class ConfigDB {
|
|||||||
HerobrineUUID = config.getString("config.HerobrineUUID");
|
HerobrineUUID = config.getString("config.HerobrineUUID");
|
||||||
HerobrineName = config.getString("config.HerobrineName");
|
HerobrineName = config.getString("config.HerobrineName");
|
||||||
|
|
||||||
HerobrineAI.HerobrineMaxHP = HerobrineHP;
|
Herobrine.HerobrineMaxHP = HerobrineHP;
|
||||||
HerobrineAI.getPluginCore().getAICore().Stop_MAIN();
|
Herobrine.getPluginCore().getAICore().Stop_MAIN();
|
||||||
HerobrineAI.getPluginCore().getAICore().Start_MAIN();
|
Herobrine.getPluginCore().getAICore().Start_MAIN();
|
||||||
HerobrineAI.getPluginCore().getAICore().Stop_BD();
|
Herobrine.getPluginCore().getAICore().Stop_BD();
|
||||||
HerobrineAI.getPluginCore().getAICore().Start_BD();
|
Herobrine.getPluginCore().getAICore().Start_BD();
|
||||||
HerobrineAI.getPluginCore().getAICore().Stop_RC();
|
Herobrine.getPluginCore().getAICore().Stop_RC();
|
||||||
HerobrineAI.getPluginCore().getAICore().Start_RC();
|
Herobrine.getPluginCore().getAICore().Start_RC();
|
||||||
HerobrineAI.AvailableWorld = false;
|
Herobrine.AvailableWorld = false;
|
||||||
HerobrineAI.getPluginCore().getAICore().getResetLimits().updateFromConfig();
|
Herobrine.getPluginCore().getAICore().getResetLimits().updateFromConfig();
|
||||||
|
|
||||||
if (HerobrineAI.getPluginCore().HerobrineNPC != null) {
|
if (Herobrine.getPluginCore().HerobrineNPC != null) {
|
||||||
HerobrineAI.getPluginCore().HerobrineNPC.setItemInHand(ItemInHand.getItemStack());
|
Herobrine.getPluginCore().HerobrineNPC.setItemInHand(ItemInHand.getItemStack());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isStartupDone) {
|
if (isStartupDone) {
|
||||||
|
|
||||||
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(HerobrineAI.getPluginCore(), new Runnable() {
|
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Herobrine.getPluginCore(), new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
for (int i = 0; i <= useWorlds.size() - 1; i++) {
|
for (int i = 0; i <= useWorlds.size() - 1; i++) {
|
||||||
if (Bukkit.getServer().getWorlds().contains(Bukkit.getServer().getWorld(useWorlds.get(i)))) {
|
if (Bukkit.getServer().getWorlds().contains(Bukkit.getServer().getWorld(useWorlds.get(i)))) {
|
||||||
HerobrineAI.AvailableWorld = true;
|
Herobrine.AvailableWorld = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HerobrineAI.AvailableWorld == false) {
|
if (Herobrine.AvailableWorld == false) {
|
||||||
log.warning("**********************************************************");
|
log.warning("**********************************************************");
|
||||||
log.warning("[HerobrineAI] There are no available worlds for Herobrine!");
|
log.warning("[Herobrine] There are no available worlds for Herobrine!");
|
||||||
log.warning("**********************************************************");
|
log.warning("**********************************************************");
|
||||||
} else {
|
} else {
|
||||||
log.info("**********************************************************");
|
log.info("**********************************************************");
|
||||||
log.info("[HerobrineAI] No problems detected.");
|
log.info("[Herobrine] No problems detected.");
|
||||||
log.info("**********************************************************");
|
log.info("**********************************************************");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,9 +43,9 @@ import net.theprogrammersworld.herobrine.listeners.InventoryListener;
|
|||||||
import net.theprogrammersworld.herobrine.listeners.PlayerListener;
|
import net.theprogrammersworld.herobrine.listeners.PlayerListener;
|
||||||
import net.theprogrammersworld.herobrine.listeners.WorldListener;
|
import net.theprogrammersworld.herobrine.listeners.WorldListener;
|
||||||
|
|
||||||
public class HerobrineAI extends JavaPlugin implements Listener {
|
public class Herobrine extends JavaPlugin implements Listener {
|
||||||
|
|
||||||
private static HerobrineAI pluginCore;
|
private static Herobrine pluginCore;
|
||||||
private AICore aicore;
|
private AICore aicore;
|
||||||
private ConfigDB configdb;
|
private ConfigDB configdb;
|
||||||
private Support support;
|
private Support support;
|
||||||
@ -82,7 +82,7 @@ public class HerobrineAI extends JavaPlugin implements Listener {
|
|||||||
this.setEnabled(false);
|
this.setEnabled(false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.warning("[HerobrineAI] Custom NPCs have been disabled. (Incompatibility error!)");
|
log.warning("[Herobrine] Custom NPCs have been disabled. (Incompatibility error!)");
|
||||||
}
|
}
|
||||||
|
|
||||||
getServer().getPluginManager().registerEvents(this, this);
|
getServer().getPluginManager().registerEvents(this, this);
|
||||||
@ -95,7 +95,7 @@ public class HerobrineAI extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
isInitDone = true;
|
isInitDone = true;
|
||||||
|
|
||||||
HerobrineAI.pluginCore = this;
|
Herobrine.pluginCore = this;
|
||||||
|
|
||||||
this.configdb = new ConfigDB(log);
|
this.configdb = new ConfigDB(log);
|
||||||
|
|
||||||
@ -137,7 +137,7 @@ public class HerobrineAI extends JavaPlugin implements Listener {
|
|||||||
// Graveyard World
|
// Graveyard World
|
||||||
|
|
||||||
if (this.configdb.UseGraveyardWorld == true && Bukkit.getServer().getWorld("world_herobrineai_graveyard") == null) {
|
if (this.configdb.UseGraveyardWorld == true && Bukkit.getServer().getWorld("world_herobrineai_graveyard") == null) {
|
||||||
log.info("[HerobrineAI] Creating Graveyard world...");
|
log.info("[Herobrine] Creating Graveyard world...");
|
||||||
|
|
||||||
WorldCreator wc = new WorldCreator("world_herobrineai_graveyard");
|
WorldCreator wc = new WorldCreator("world_herobrineai_graveyard");
|
||||||
wc.generateStructures(false);
|
wc.generateStructures(false);
|
||||||
@ -147,7 +147,7 @@ public class HerobrineAI extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
GraveyardWorld.Create();
|
GraveyardWorld.Create();
|
||||||
}
|
}
|
||||||
log.info("[HerobrineAI] Plugin loaded! Version: ");
|
log.info("[Herobrine] Plugin loaded! Version: ");
|
||||||
|
|
||||||
// Init Block Types
|
// Init Block Types
|
||||||
|
|
||||||
@ -179,9 +179,9 @@ public class HerobrineAI extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
pathUpdateINT = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
|
pathUpdateINT = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
if (Utils.getRandomGen().nextInt(4) == 2 && HerobrineAI.getPluginCore().getAICore().getCoreTypeNow()
|
if (Utils.getRandomGen().nextInt(4) == 2 && Herobrine.getPluginCore().getAICore().getCoreTypeNow()
|
||||||
.equals(CoreType.RANDOM_POSITION)) {
|
.equals(CoreType.RANDOM_POSITION)) {
|
||||||
pathMng.setPath(new Path(Utils.getRandomGen().nextInt(15) - 7f, Utils.getRandomGen().nextInt(15) - 7f, HerobrineAI.getPluginCore()));
|
pathMng.setPath(new Path(Utils.getRandomGen().nextInt(15) - 7f, Utils.getRandomGen().nextInt(15) - 7f, Herobrine.getPluginCore()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 1 * 200L, 1 * 200L);
|
}, 1 * 200L, 1 * 200L);
|
||||||
@ -216,13 +216,13 @@ public class HerobrineAI extends JavaPlugin implements Listener {
|
|||||||
aicore.Stop_RP();
|
aicore.Stop_RP();
|
||||||
aicore.Stop_RS();
|
aicore.Stop_RS();
|
||||||
aicore.disableAll();
|
aicore.disableAll();
|
||||||
log.info("[HerobrineAI] Plugin disabled!");
|
log.info("[Herobrine] Plugin disabled!");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public java.io.InputStream getInputStreamData(String src) {
|
public java.io.InputStream getInputStreamData(String src) {
|
||||||
return HerobrineAI.class.getResourceAsStream(src);
|
return Herobrine.class.getResourceAsStream(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AICore getAICore() {
|
public AICore getAICore() {
|
||||||
@ -235,9 +235,9 @@ public class HerobrineAI extends JavaPlugin implements Listener {
|
|||||||
return this.entMng;
|
return this.entMng;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HerobrineAI getPluginCore() {
|
public static Herobrine getPluginCore() {
|
||||||
|
|
||||||
return HerobrineAI.pluginCore;
|
return Herobrine.pluginCore;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -297,18 +297,18 @@ public class HerobrineAI extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
if(sender == null){
|
if(sender == null){
|
||||||
if (!opCheck)
|
if (!opCheck)
|
||||||
log.info("[HerobrineAI] Player is an OP.");
|
log.info("[Herobrine] Player is an OP.");
|
||||||
else if (!creativeCheck)
|
else if (!creativeCheck)
|
||||||
log.info("[HerobrineAI] Player is in creative mode.");
|
log.info("[Herobrine] Player is in creative mode.");
|
||||||
else if (!ignoreCheck)
|
else if (!ignoreCheck)
|
||||||
log.info("[HerobrineAI] Player has ignore permission.");
|
log.info("[Herobrine] Player has ignore permission.");
|
||||||
}else{
|
}else{
|
||||||
if (!opCheck)
|
if (!opCheck)
|
||||||
sender.sendMessage(ChatColor.RED + "[HerobrineAI] Player is an OP.");
|
sender.sendMessage(ChatColor.RED + "[Herobrine] Player is an OP.");
|
||||||
else if (!creativeCheck)
|
else if (!creativeCheck)
|
||||||
sender.sendMessage(ChatColor.RED + "[HerobrineAI] Player is in creative mode.");
|
sender.sendMessage(ChatColor.RED + "[Herobrine] Player is in creative mode.");
|
||||||
else if (!ignoreCheck)
|
else if (!ignoreCheck)
|
||||||
sender.sendMessage(ChatColor.RED + "[HerobrineAI] Player has ignore permission.");
|
sender.sendMessage(ChatColor.RED + "[Herobrine] Player has ignore permission.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
@ -5,7 +5,7 @@ import java.util.Random;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.Utils;
|
import net.theprogrammersworld.herobrine.Utils;
|
||||||
|
|
||||||
public class Path {
|
public class Path {
|
||||||
@ -19,9 +19,9 @@ public class Path {
|
|||||||
private int stepNow = 0;
|
private int stepNow = 0;
|
||||||
private int maxSteps = Utils.getRandomGen().nextInt(3) + 3;
|
private int maxSteps = Utils.getRandomGen().nextInt(3) + 3;
|
||||||
|
|
||||||
protected HerobrineAI PluginCore;
|
protected Herobrine PluginCore;
|
||||||
|
|
||||||
public Path(float _x, float _z, HerobrineAI plugin) {
|
public Path(float _x, float _z, Herobrine plugin) {
|
||||||
|
|
||||||
PluginCore = plugin;
|
PluginCore = plugin;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package net.theprogrammersworld.herobrine.NPC.AI;
|
package net.theprogrammersworld.herobrine.NPC.AI;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
||||||
|
|
||||||
public class PathManager {
|
public class PathManager {
|
||||||
@ -12,7 +12,7 @@ public class PathManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void update() {
|
public void update() {
|
||||||
if (pathNow != null && HerobrineAI.getPluginCore().getAICore().getCoreTypeNow().equals(CoreType.RANDOM_POSITION)) {
|
if (pathNow != null && Herobrine.getPluginCore().getAICore().getCoreTypeNow().equals(CoreType.RANDOM_POSITION)) {
|
||||||
pathNow.update();
|
pathNow.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import net.minecraft.server.v1_15_R1.EnumHand;
|
|||||||
import net.minecraft.server.v1_15_R1.PacketPlayInArmAnimation;
|
import net.minecraft.server.v1_15_R1.PacketPlayInArmAnimation;
|
||||||
import net.minecraft.server.v1_15_R1.PlayerChunkMap;
|
import net.minecraft.server.v1_15_R1.PlayerChunkMap;
|
||||||
import net.minecraft.server.v1_15_R1.WorldServer;
|
import net.minecraft.server.v1_15_R1.WorldServer;
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -74,9 +74,9 @@ public class HumanNPC {
|
|||||||
// After Herobrine moves, check if any players are in Herobrine's line of sight.
|
// After Herobrine moves, check if any players are in Herobrine's line of sight.
|
||||||
boolean doActivationTeleport = false;
|
boolean doActivationTeleport = false;
|
||||||
for(Player p : Bukkit.getOnlinePlayers())
|
for(Player p : Bukkit.getOnlinePlayers())
|
||||||
doActivationTeleport = doActivationTeleport || HerobrineAI.getPluginCore().getAICore().toggleHerobrinePlayerVisibilityNoTeleport(p);
|
doActivationTeleport = doActivationTeleport || Herobrine.getPluginCore().getAICore().toggleHerobrinePlayerVisibilityNoTeleport(p);
|
||||||
if(doActivationTeleport)
|
if(doActivationTeleport)
|
||||||
HerobrineAI.getPluginCore().getAICore().visibilityActivationTeleport();
|
Herobrine.getPluginCore().getAICore().visibilityActivationTeleport();
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlayerInventory getInventory() {
|
public PlayerInventory getInventory() {
|
||||||
|
@ -7,7 +7,7 @@ import java.util.UUID;
|
|||||||
|
|
||||||
import net.minecraft.server.v1_15_R1.Entity;
|
import net.minecraft.server.v1_15_R1.Entity;
|
||||||
import net.minecraft.server.v1_15_R1.PlayerInteractManager;
|
import net.minecraft.server.v1_15_R1.PlayerInteractManager;
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.NPC.Entity.HumanEntity;
|
import net.theprogrammersworld.herobrine.NPC.Entity.HumanEntity;
|
||||||
import net.theprogrammersworld.herobrine.NPC.Entity.HumanNPC;
|
import net.theprogrammersworld.herobrine.NPC.Entity.HumanNPC;
|
||||||
import net.theprogrammersworld.herobrine.NPC.NMS.BServer;
|
import net.theprogrammersworld.herobrine.NPC.NMS.BServer;
|
||||||
@ -37,8 +37,8 @@ public class NPCCore {
|
|||||||
|
|
||||||
private GameProfile getHerobrineGameProfile() {
|
private GameProfile getHerobrineGameProfile() {
|
||||||
GameProfile profile = new GameProfile(
|
GameProfile profile = new GameProfile(
|
||||||
UUID.fromString(HerobrineAI.getPluginCore().getConfigDB().HerobrineUUID),
|
UUID.fromString(Herobrine.getPluginCore().getConfigDB().HerobrineUUID),
|
||||||
HerobrineAI.getPluginCore().getConfigDB().HerobrineName
|
Herobrine.getPluginCore().getConfigDB().HerobrineName
|
||||||
);
|
);
|
||||||
|
|
||||||
Property textures = new Property("textures",
|
Property textures = new Property("textures",
|
||||||
@ -57,7 +57,7 @@ public class NPCCore {
|
|||||||
networkCore = new NetworkCore();
|
networkCore = new NetworkCore();
|
||||||
|
|
||||||
|
|
||||||
Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(HerobrineAI.getPluginCore(), new Runnable() {
|
Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(Herobrine.getPluginCore(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
final ArrayList<HumanNPC> toRemove = new ArrayList<HumanNPC>();
|
final ArrayList<HumanNPC> toRemove = new ArrayList<HumanNPC>();
|
||||||
|
@ -33,7 +33,7 @@ public class Support {
|
|||||||
PreciousStones = new PreciousStonesHook();
|
PreciousStones = new PreciousStonesHook();
|
||||||
Factions = new FactionsHook();
|
Factions = new FactionsHook();
|
||||||
|
|
||||||
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(HerobrineAI.getPluginCore(), new Runnable() {
|
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Herobrine.getPluginCore(), new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
CheckForPlugins();
|
CheckForPlugins();
|
||||||
}
|
}
|
||||||
@ -67,27 +67,27 @@ public class Support {
|
|||||||
public void CheckForPlugins() {
|
public void CheckForPlugins() {
|
||||||
if (ResidenceCore.Check()) {
|
if (ResidenceCore.Check()) {
|
||||||
B_Residence = true;
|
B_Residence = true;
|
||||||
HerobrineAI.log.info("[HerobrineAI] Residence plugin detected!");
|
Herobrine.log.info("[Herobrine] Residence plugin detected!");
|
||||||
}
|
}
|
||||||
if (GriefPreventionCore.Check()) {
|
if (GriefPreventionCore.Check()) {
|
||||||
B_GriefPrevention = true;
|
B_GriefPrevention = true;
|
||||||
HerobrineAI.log.info("[HerobrineAI] GriefPrevention plugin detected!");
|
Herobrine.log.info("[Herobrine] GriefPrevention plugin detected!");
|
||||||
}
|
}
|
||||||
if (TownyCore.Check()) {
|
if (TownyCore.Check()) {
|
||||||
B_Towny = true;
|
B_Towny = true;
|
||||||
HerobrineAI.log.info("[HerobrineAI] Towny plugin detected!");
|
Herobrine.log.info("[Herobrine] Towny plugin detected!");
|
||||||
}
|
}
|
||||||
if (WorldGuard.Check()) {
|
if (WorldGuard.Check()) {
|
||||||
B_WorldGuard = true;
|
B_WorldGuard = true;
|
||||||
HerobrineAI.log.info("[HerobrineAI] WorldGuard plugin detected!");
|
Herobrine.log.info("[Herobrine] WorldGuard plugin detected!");
|
||||||
}
|
}
|
||||||
if (PreciousStones.Check()) {
|
if (PreciousStones.Check()) {
|
||||||
B_PreciousStones = true;
|
B_PreciousStones = true;
|
||||||
HerobrineAI.log.info("[HerobrineAI] PreciousStones plugin detected!");
|
Herobrine.log.info("[Herobrine] PreciousStones plugin detected!");
|
||||||
}
|
}
|
||||||
if (Factions.Check()) {
|
if (Factions.Check()) {
|
||||||
B_Factions = true;
|
B_Factions = true;
|
||||||
HerobrineAI.log.info("[HerobrineAI] Factions plugin detected!");
|
Herobrine.log.info("[Herobrine] Factions plugin detected!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,23 +109,23 @@ public class Support {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean checkBuild(final Location loc) {
|
public boolean checkBuild(final Location loc) {
|
||||||
return HerobrineAI.getPluginCore().getConfigDB().SecuredArea_Build || !isSecuredArea(loc);
|
return Herobrine.getPluginCore().getConfigDB().SecuredArea_Build || !isSecuredArea(loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean checkAttack(final Location loc) {
|
public boolean checkAttack(final Location loc) {
|
||||||
return HerobrineAI.getPluginCore().getConfigDB().SecuredArea_Attack || !isSecuredArea(loc);
|
return Herobrine.getPluginCore().getConfigDB().SecuredArea_Attack || !isSecuredArea(loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean checkHaunt(final Location loc) {
|
public boolean checkHaunt(final Location loc) {
|
||||||
return HerobrineAI.getPluginCore().getConfigDB().SecuredArea_Haunt || !isSecuredArea(loc);
|
return Herobrine.getPluginCore().getConfigDB().SecuredArea_Haunt || !isSecuredArea(loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean checkSigns(final Location loc) {
|
public boolean checkSigns(final Location loc) {
|
||||||
return HerobrineAI.getPluginCore().getConfigDB().SecuredArea_Signs || !isSecuredArea(loc);
|
return Herobrine.getPluginCore().getConfigDB().SecuredArea_Signs || !isSecuredArea(loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean checkBooks(final Location loc) {
|
public boolean checkBooks(final Location loc) {
|
||||||
return HerobrineAI.getPluginCore().getConfigDB().SecuredArea_Books || !isSecuredArea(loc);
|
return Herobrine.getPluginCore().getConfigDB().SecuredArea_Books || !isSecuredArea(loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,14 +17,14 @@ public class Utils {
|
|||||||
public static Player getRandomPlayer() {
|
public static Player getRandomPlayer() {
|
||||||
Collection<? extends Player> playersOnline = Bukkit.getServer().getOnlinePlayers();
|
Collection<? extends Player> playersOnline = Bukkit.getServer().getOnlinePlayers();
|
||||||
|
|
||||||
if(playersOnline.size() == 1 && ((Player)playersOnline.toArray()[0]).getEntityId() == HerobrineAI.getPluginCore().HerobrineEntityID)
|
if(playersOnline.size() == 1 && ((Player)playersOnline.toArray()[0]).getEntityId() == Herobrine.getPluginCore().HerobrineEntityID)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
int player_rolled = new Random().nextInt(playersOnline.size());
|
int player_rolled = new Random().nextInt(playersOnline.size());
|
||||||
|
|
||||||
Player p = (Player) playersOnline.toArray()[player_rolled];
|
Player p = (Player) playersOnline.toArray()[player_rolled];
|
||||||
|
|
||||||
if (p.getEntityId() == HerobrineAI.getPluginCore().HerobrineEntityID)
|
if (p.getEntityId() == Herobrine.getPluginCore().HerobrineEntityID)
|
||||||
return getRandomPlayer();
|
return getRandomPlayer();
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
|
@ -5,11 +5,11 @@ import java.util.logging.Logger;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
|
|
||||||
public class CmdAllWorlds extends SubCommand {
|
public class CmdAllWorlds extends SubCommand {
|
||||||
|
|
||||||
public CmdAllWorlds(HerobrineAI plugin, Logger log) {
|
public CmdAllWorlds(Herobrine plugin, Logger log) {
|
||||||
super(plugin, log);
|
super(plugin, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17,8 +17,8 @@ public class CmdAllWorlds extends SubCommand {
|
|||||||
public boolean execute(Player player, String[] args) {
|
public boolean execute(Player player, String[] args) {
|
||||||
|
|
||||||
plugin.getConfigDB().addAllWorlds();
|
plugin.getConfigDB().addAllWorlds();
|
||||||
sendMessage(player, ChatColor.GREEN + "[HerobrineAI] All worlds have been added to config.");
|
sendMessage(player, ChatColor.GREEN + "[Herobrine] All worlds have been added to config.");
|
||||||
sendMessage(player, ChatColor.YELLOW + "[HerobrineAI] Note: Worlds with blank spaces can cause problems!");
|
sendMessage(player, ChatColor.YELLOW + "[Herobrine] Note: Worlds with blank spaces can cause problems!");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,12 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.AICore;
|
import net.theprogrammersworld.herobrine.AI.AICore;
|
||||||
|
|
||||||
public class CmdAttack extends SubCommand {
|
public class CmdAttack extends SubCommand {
|
||||||
|
|
||||||
public CmdAttack(HerobrineAI plugin, Logger log) {
|
public CmdAttack(Herobrine plugin, Logger log) {
|
||||||
super(plugin, log);
|
super(plugin, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,12 +23,12 @@ public class CmdAttack extends SubCommand {
|
|||||||
Player target = Bukkit.getServer().getPlayer(args[1]);
|
Player target = Bukkit.getServer().getPlayer(args[1]);
|
||||||
|
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is offline.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is offline.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!target.isOnline()) {
|
if (!target.isOnline()) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is offline.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is offline.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,18 +37,18 @@ public class CmdAttack extends SubCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!plugin.getSupport().checkAttack(target.getLocation())) {
|
if (!plugin.getSupport().checkAttack(target.getLocation())) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is in secure area.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is in secure area.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AICore.isTarget == false) {
|
if (AICore.isTarget == false) {
|
||||||
|
|
||||||
plugin.getAICore().setAttackTarget(target);
|
plugin.getAICore().setAttackTarget(target);
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Herobrine is now attacking the " + args[1] + "!");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Herobrine is now attacking the " + args[1] + "!");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
sendMessage(player,ChatColor.RED
|
sendMessage(player,ChatColor.RED
|
||||||
+ "[HerobrineAI] Herobrine already has target! Use "
|
+ "[Herobrine] Herobrine already has target! Use "
|
||||||
+ ChatColor.GREEN + "/hb-ai cancel" + ChatColor.RED
|
+ ChatColor.GREEN + "/hb-ai cancel" + ChatColor.RED
|
||||||
+ " to cancel current target");
|
+ " to cancel current target");
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,12 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
||||||
|
|
||||||
public class CmdBurn extends SubCommand {
|
public class CmdBurn extends SubCommand {
|
||||||
|
|
||||||
public CmdBurn(HerobrineAI plugin, Logger log) {
|
public CmdBurn(Herobrine plugin, Logger log) {
|
||||||
super(plugin, log);
|
super(plugin, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,17 +24,17 @@ public class CmdBurn extends SubCommand {
|
|||||||
Player target = Bukkit.getServer().getPlayer(args[1]);
|
Player target = Bukkit.getServer().getPlayer(args[1]);
|
||||||
|
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is offline.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is offline.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!target.isOnline()) {
|
if (!target.isOnline()) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is offline.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is offline.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object[] data = { target };
|
Object[] data = { target };
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] " + plugin.getAICore().getCore(CoreType.BURN).RunCore(data).getResultString());
|
sendMessage(player, ChatColor.RED + "[Herobrine] " + plugin.getAICore().getCore(CoreType.BURN).RunCore(data).getResultString());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,12 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
||||||
|
|
||||||
public class CmdBury extends SubCommand {
|
public class CmdBury extends SubCommand {
|
||||||
|
|
||||||
public CmdBury(HerobrineAI plugin, Logger log) {
|
public CmdBury(Herobrine plugin, Logger log) {
|
||||||
super(plugin, log);
|
super(plugin, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,17 +23,17 @@ public class CmdBury extends SubCommand {
|
|||||||
Player target = Bukkit.getServer().getPlayer(args[1]);
|
Player target = Bukkit.getServer().getPlayer(args[1]);
|
||||||
|
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is offline.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is offline.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!target.isOnline()) {
|
if (!target.isOnline()) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is offline.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is offline.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!plugin.getSupport().checkHaunt(target.getLocation())) {
|
if (!plugin.getSupport().checkHaunt(target.getLocation())) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is in secure area.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is in secure area.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,9 +41,9 @@ public class CmdBury extends SubCommand {
|
|||||||
Object[] data = { target };
|
Object[] data = { target };
|
||||||
|
|
||||||
if (plugin.getAICore().getCore(CoreType.BURY_PLAYER).RunCore(data).getResult())
|
if (plugin.getAICore().getCore(CoreType.BURY_PLAYER).RunCore(data).getResult())
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Buried " + args[1] + "!");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Buried " + args[1] + "!");
|
||||||
else
|
else
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Cannot find good place!");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Cannot find good place!");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -5,12 +5,12 @@ import java.util.logging.Logger;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
||||||
|
|
||||||
public class CmdCancel extends SubCommand {
|
public class CmdCancel extends SubCommand {
|
||||||
|
|
||||||
public CmdCancel(HerobrineAI plugin, Logger log) {
|
public CmdCancel(Herobrine plugin, Logger log) {
|
||||||
super(plugin, log);
|
super(plugin, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ public class CmdCancel extends SubCommand {
|
|||||||
public boolean execute(Player player, String[] args) {
|
public boolean execute(Player player, String[] args) {
|
||||||
|
|
||||||
plugin.getAICore().CancelTarget(CoreType.ANY);
|
plugin.getAICore().CancelTarget(CoreType.ANY);
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Target cancelled!");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Target cancelled!");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,12 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
||||||
|
|
||||||
public class CmdCave extends SubCommand {
|
public class CmdCave extends SubCommand {
|
||||||
|
|
||||||
public CmdCave(HerobrineAI plugin, Logger log) {
|
public CmdCave(Herobrine plugin, Logger log) {
|
||||||
super(plugin, log);
|
super(plugin, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,22 +23,22 @@ public class CmdCave extends SubCommand {
|
|||||||
Player target = Bukkit.getServer().getPlayer(args[1]);
|
Player target = Bukkit.getServer().getPlayer(args[1]);
|
||||||
|
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is offline.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is offline.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!target.isOnline()) {
|
if (!target.isOnline()) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is offline.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is offline.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!plugin.getSupport().checkBuild(target.getLocation())) {
|
if (!plugin.getSupport().checkBuild(target.getLocation())) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is in secure area.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is in secure area.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object[] data = { target.getLocation(), true };
|
Object[] data = { target.getLocation(), true };
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] " + plugin.getAICore().getCore(CoreType.BUILD_CAVE).RunCore(data).getResultString());
|
sendMessage(player, ChatColor.RED + "[Herobrine] " + plugin.getAICore().getCore(CoreType.BUILD_CAVE).RunCore(data).getResultString());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,12 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
||||||
|
|
||||||
public class CmdCurse extends SubCommand {
|
public class CmdCurse extends SubCommand {
|
||||||
|
|
||||||
public CmdCurse(HerobrineAI plugin, Logger log) {
|
public CmdCurse(Herobrine plugin, Logger log) {
|
||||||
super(plugin, log);
|
super(plugin, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,17 +24,17 @@ public class CmdCurse extends SubCommand {
|
|||||||
Player target = Bukkit.getServer().getPlayer(args[1]);
|
Player target = Bukkit.getServer().getPlayer(args[1]);
|
||||||
|
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is offline.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is offline.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!target.isOnline()) {
|
if (!target.isOnline()) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is offline.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is offline.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object[] data = { target };
|
Object[] data = { target };
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] " + plugin.getAICore().getCore(CoreType.CURSE).RunCore(data).getResultString());
|
sendMessage(player, ChatColor.RED + "[Herobrine] " + plugin.getAICore().getCore(CoreType.CURSE).RunCore(data).getResultString());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
|
|
||||||
public class CmdExecutor implements CommandExecutor {
|
public class CmdExecutor implements CommandExecutor {
|
||||||
|
|
||||||
@ -20,8 +20,8 @@ public class CmdExecutor implements CommandExecutor {
|
|||||||
"reload", "cancel", "allworlds", "position", "attack", "haunt", "heads",
|
"reload", "cancel", "allworlds", "position", "attack", "haunt", "heads",
|
||||||
"bury", "curse", "burn", "pyramid", "cave", "temple", "graveyard" };
|
"bury", "curse", "burn", "pyramid", "cave", "temple", "graveyard" };
|
||||||
|
|
||||||
public CmdExecutor(HerobrineAI p) {
|
public CmdExecutor(Herobrine p) {
|
||||||
log = HerobrineAI.log;
|
log = Herobrine.log;
|
||||||
|
|
||||||
subCommands.put("reload", new CmdReload(p, log));
|
subCommands.put("reload", new CmdReload(p, log));
|
||||||
subCommands.put("cancel", new CmdCancel(p, log));
|
subCommands.put("cancel", new CmdCancel(p, log));
|
||||||
@ -43,7 +43,7 @@ public class CmdExecutor implements CommandExecutor {
|
|||||||
|
|
||||||
ArrayList<String> helpMessage = new ArrayList<String>();
|
ArrayList<String> helpMessage = new ArrayList<String>();
|
||||||
|
|
||||||
helpMessage.add(ChatColor.GREEN + "[HerobrineAI] Command list");
|
helpMessage.add(ChatColor.GREEN + "[Herobrine] Command list");
|
||||||
helpMessage.add(ChatColor.GREEN + "/hb-ai help - shows all commands");
|
helpMessage.add(ChatColor.GREEN + "/hb-ai help - shows all commands");
|
||||||
|
|
||||||
for (String v : helpCommandOrder)
|
for (String v : helpCommandOrder)
|
||||||
|
@ -6,12 +6,12 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.AICore;
|
import net.theprogrammersworld.herobrine.AI.AICore;
|
||||||
|
|
||||||
public class CmdGraveyard extends SubCommand {
|
public class CmdGraveyard extends SubCommand {
|
||||||
|
|
||||||
public CmdGraveyard(HerobrineAI plugin, Logger log) {
|
public CmdGraveyard(Herobrine plugin, Logger log) {
|
||||||
super(plugin, log);
|
super(plugin, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,21 +23,21 @@ public class CmdGraveyard extends SubCommand {
|
|||||||
Player target = Bukkit.getServer().getPlayer(args[1]);
|
Player target = Bukkit.getServer().getPlayer(args[1]);
|
||||||
|
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is offline.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is offline.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!target.isOnline()) {
|
if (!target.isOnline()) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is offline.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is offline.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AICore.isTarget == false) {
|
if (AICore.isTarget == false) {
|
||||||
plugin.getAICore().GraveyardTeleport(Bukkit.getServer().getPlayer(args[1]));
|
plugin.getAICore().GraveyardTeleport(Bukkit.getServer().getPlayer(args[1]));
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] " + args[1] + " is now in the Graveyard world!");
|
sendMessage(player, ChatColor.RED + "[Herobrine] " + args[1] + " is now in the Graveyard world!");
|
||||||
} else {
|
} else {
|
||||||
sendMessage(player,ChatColor.RED
|
sendMessage(player,ChatColor.RED
|
||||||
+ "[HerobrineAI] Herobrine already has target! Use "
|
+ "[Herobrine] Herobrine already has target! Use "
|
||||||
+ ChatColor.GREEN + "/hb-ai cancel" + ChatColor.RED
|
+ ChatColor.GREEN + "/hb-ai cancel" + ChatColor.RED
|
||||||
+ " to cancel current target");
|
+ " to cancel current target");
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,12 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.AICore;
|
import net.theprogrammersworld.herobrine.AI.AICore;
|
||||||
|
|
||||||
public class CmdHaunt extends SubCommand {
|
public class CmdHaunt extends SubCommand {
|
||||||
|
|
||||||
public CmdHaunt(HerobrineAI plugin, Logger log) {
|
public CmdHaunt(Herobrine plugin, Logger log) {
|
||||||
super(plugin, log);
|
super(plugin, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,26 +23,26 @@ public class CmdHaunt extends SubCommand {
|
|||||||
Player target = Bukkit.getServer().getPlayer(args[1]);
|
Player target = Bukkit.getServer().getPlayer(args[1]);
|
||||||
|
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is offline.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is offline.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!target.isOnline()) {
|
if (!target.isOnline()) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is offline.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is offline.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!plugin.getSupport().checkHaunt(target.getLocation())) {
|
if (!plugin.getSupport().checkHaunt(target.getLocation())) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is in secure area.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is in secure area.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AICore.isTarget == false) {
|
if (AICore.isTarget == false) {
|
||||||
plugin.getAICore().setHauntTarget(target);
|
plugin.getAICore().setHauntTarget(target);
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Herobrine is now haunting " + args[1] + "!");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Herobrine is now haunting " + args[1] + "!");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
sendMessage(player,ChatColor.RED + "[HerobrineAI] Herobrine already has target! Use "
|
sendMessage(player,ChatColor.RED + "[Herobrine] Herobrine already has target! Use "
|
||||||
+ ChatColor.GREEN + "/hb-ai cancel" + ChatColor.RED
|
+ ChatColor.GREEN + "/hb-ai cancel" + ChatColor.RED
|
||||||
+ " to cancel current target.");
|
+ " to cancel current target.");
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,12 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
||||||
|
|
||||||
public class CmdHeads extends SubCommand {
|
public class CmdHeads extends SubCommand {
|
||||||
|
|
||||||
public CmdHeads(HerobrineAI plugin, Logger log) {
|
public CmdHeads(Herobrine plugin, Logger log) {
|
||||||
super(plugin, log);
|
super(plugin, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,22 +23,22 @@ public class CmdHeads extends SubCommand {
|
|||||||
Player target = Bukkit.getServer().getPlayer(args[1]);
|
Player target = Bukkit.getServer().getPlayer(args[1]);
|
||||||
|
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is offline.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is offline.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!target.isOnline()) {
|
if (!target.isOnline()) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is offline.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is offline.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!plugin.getSupport().checkBuild(target.getLocation())) {
|
if (!plugin.getSupport().checkBuild(target.getLocation())) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is in secure area.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is in secure area.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object[] data = { args[1] };
|
Object[] data = { args[1] };
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] " + plugin.getAICore().getCore(CoreType.HEADS).RunCore(data).getResultString());
|
sendMessage(player, ChatColor.RED + "[Herobrine] " + plugin.getAICore().getCore(CoreType.HEADS).RunCore(data).getResultString());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -6,19 +6,19 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.AICore;
|
import net.theprogrammersworld.herobrine.AI.AICore;
|
||||||
|
|
||||||
public class CmdPosition extends SubCommand {
|
public class CmdPosition extends SubCommand {
|
||||||
|
|
||||||
public CmdPosition(HerobrineAI plugin, Logger log) {
|
public CmdPosition(Herobrine plugin, Logger log) {
|
||||||
super(plugin, log);
|
super(plugin, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(Player player, String[] args) {
|
public boolean execute(Player player, String[] args) {
|
||||||
|
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Position");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Position");
|
||||||
|
|
||||||
Location loc = plugin.HerobrineNPC.getBukkitEntity().getLocation();
|
Location loc = plugin.HerobrineNPC.getBukkitEntity().getLocation();
|
||||||
|
|
||||||
|
@ -6,12 +6,12 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
||||||
|
|
||||||
public class CmdPyramid extends SubCommand {
|
public class CmdPyramid extends SubCommand {
|
||||||
|
|
||||||
public CmdPyramid(HerobrineAI plugin, Logger log) {
|
public CmdPyramid(Herobrine plugin, Logger log) {
|
||||||
super(plugin, log);
|
super(plugin, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,26 +23,26 @@ public class CmdPyramid extends SubCommand {
|
|||||||
Player target = Bukkit.getServer().getPlayer(args[1]);
|
Player target = Bukkit.getServer().getPlayer(args[1]);
|
||||||
|
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is offline.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is offline.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!target.isOnline()) {
|
if (!target.isOnline()) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is offline.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is offline.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!plugin.getSupport().checkBuild(target.getLocation())) {
|
if (!plugin.getSupport().checkBuild(target.getLocation())) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is in secure area.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is in secure area.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object[] data = { target };
|
Object[] data = { target };
|
||||||
|
|
||||||
if (plugin.getAICore().getCore(CoreType.PYRAMID).RunCore(data).getResult())
|
if (plugin.getAICore().getCore(CoreType.PYRAMID).RunCore(data).getResult())
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Creating pyramind near "+ args[1] + "!");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Creating pyramind near "+ args[1] + "!");
|
||||||
else
|
else
|
||||||
sendMessage(player, ChatColor.RED+ "[HerobrineAI] Cannot find good place for a pyramid!");
|
sendMessage(player, ChatColor.RED+ "[Herobrine] Cannot find good place for a pyramid!");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -5,11 +5,11 @@ import java.util.logging.Logger;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
|
|
||||||
public class CmdReload extends SubCommand {
|
public class CmdReload extends SubCommand {
|
||||||
|
|
||||||
public CmdReload(HerobrineAI plugin, Logger log) {
|
public CmdReload(Herobrine plugin, Logger log) {
|
||||||
super(plugin, log);
|
super(plugin, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ public class CmdReload extends SubCommand {
|
|||||||
public boolean execute(Player player, String[] args) {
|
public boolean execute(Player player, String[] args) {
|
||||||
|
|
||||||
plugin.getConfigDB().Reload();
|
plugin.getConfigDB().Reload();
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Config reloaded!");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Config reloaded!");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,12 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
||||||
|
|
||||||
public class CmdTemple extends SubCommand {
|
public class CmdTemple extends SubCommand {
|
||||||
|
|
||||||
public CmdTemple(HerobrineAI plugin, Logger log) {
|
public CmdTemple(Herobrine plugin, Logger log) {
|
||||||
super(plugin, log);
|
super(plugin, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,26 +23,26 @@ public class CmdTemple extends SubCommand {
|
|||||||
Player target = Bukkit.getServer().getPlayer(args[1]);
|
Player target = Bukkit.getServer().getPlayer(args[1]);
|
||||||
|
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is offline.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is offline.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!target.isOnline()) {
|
if (!target.isOnline()) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is offline.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is offline.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!plugin.getSupport().checkBuild(target.getLocation())) {
|
if (!plugin.getSupport().checkBuild(target.getLocation())) {
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Player is in secure area.");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Player is in secure area.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object[] data = { target };
|
Object[] data = { target };
|
||||||
|
|
||||||
if (plugin.getAICore().getCore(CoreType.TEMPLE).RunCore(data).getResult())
|
if (plugin.getAICore().getCore(CoreType.TEMPLE).RunCore(data).getResult())
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Creating temple near " + args[1] + "!");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Creating temple near " + args[1] + "!");
|
||||||
else
|
else
|
||||||
sendMessage(player, ChatColor.RED + "[HerobrineAI] Cannot find good place for temple!");
|
sendMessage(player, ChatColor.RED + "[Herobrine] Cannot find good place for temple!");
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -5,14 +5,14 @@ import java.util.logging.Logger;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
|
|
||||||
public abstract class SubCommand {
|
public abstract class SubCommand {
|
||||||
|
|
||||||
protected HerobrineAI plugin;
|
protected Herobrine plugin;
|
||||||
protected Logger logger;
|
protected Logger logger;
|
||||||
|
|
||||||
public SubCommand(HerobrineAI plugin, Logger log){
|
public SubCommand(Herobrine plugin, Logger log){
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.logger = log;
|
this.logger = log;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ import net.minecraft.server.v1_15_R1.Entity;
|
|||||||
import net.minecraft.server.v1_15_R1.EntityTypes;
|
import net.minecraft.server.v1_15_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_15_R1.GenericAttributes;
|
import net.minecraft.server.v1_15_R1.GenericAttributes;
|
||||||
import net.minecraft.server.v1_15_R1.World;
|
import net.minecraft.server.v1_15_R1.World;
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.misc.ItemName;
|
import net.theprogrammersworld.herobrine.misc.ItemName;
|
||||||
|
|
||||||
public class CustomSkeleton extends net.minecraft.server.v1_15_R1.EntitySkeleton implements CustomEntity {
|
public class CustomSkeleton extends net.minecraft.server.v1_15_R1.EntitySkeleton implements CustomEntity {
|
||||||
@ -35,9 +35,9 @@ public class CustomSkeleton extends net.minecraft.server.v1_15_R1.EntitySkeleton
|
|||||||
|
|
||||||
public void spawnDemon(Location loc) {
|
public void spawnDemon(Location loc) {
|
||||||
|
|
||||||
this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(HerobrineAI.getPluginCore().getConfigDB().npc.getDouble("npc.Demon.Speed"));
|
this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(Herobrine.getPluginCore().getConfigDB().npc.getDouble("npc.Demon.Speed"));
|
||||||
this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(HerobrineAI.getPluginCore().getConfigDB().npc.getInt("npc.Demon.HP"));
|
this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Demon.HP"));
|
||||||
this.setHealth(HerobrineAI.getPluginCore().getConfigDB().npc.getInt("npc.Demon.HP"));
|
this.setHealth(Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Demon.HP"));
|
||||||
this.setCustomName(new ChatComponentText("Demon"));
|
this.setCustomName(new ChatComponentText("Demon"));
|
||||||
|
|
||||||
Skeleton entityCast = (Skeleton) this.getBukkitEntity();
|
Skeleton entityCast = (Skeleton) this.getBukkitEntity();
|
||||||
@ -57,14 +57,14 @@ public class CustomSkeleton extends net.minecraft.server.v1_15_R1.EntitySkeleton
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Kill() {
|
public void Kill() {
|
||||||
Object[] items = HerobrineAI.getPluginCore().getConfigDB().npc.getConfigurationSection("npc.Demon.Drops")
|
Object[] items = Herobrine.getPluginCore().getConfigDB().npc.getConfigurationSection("npc.Demon.Drops")
|
||||||
.getKeys(false).toArray();
|
.getKeys(false).toArray();
|
||||||
for (Object itemObj : items) {
|
for (Object itemObj : items) {
|
||||||
final String item = itemObj.toString();
|
final String item = itemObj.toString();
|
||||||
final int chance = new Random().nextInt(100);
|
final int chance = new Random().nextInt(100);
|
||||||
if (chance <= HerobrineAI.getPluginCore().getConfigDB().npc.getInt("npc.Demon.Drops." + item + ".Chance")) {
|
if (chance <= Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Demon.Drops." + item + ".Chance")) {
|
||||||
getBukkitEntity().getLocation().getWorld().dropItemNaturally(getBukkitEntity().getLocation(),
|
getBukkitEntity().getLocation().getWorld().dropItemNaturally(getBukkitEntity().getLocation(),
|
||||||
new ItemStack(Material.matchMaterial(item), HerobrineAI.getPluginCore().getConfigDB().npc
|
new ItemStack(Material.matchMaterial(item), Herobrine.getPluginCore().getConfigDB().npc
|
||||||
.getInt("npc.Demon.Drops." + item + ".Count")));
|
.getInt("npc.Demon.Drops." + item + ".Count")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import net.minecraft.server.v1_15_R1.Entity;
|
|||||||
import net.minecraft.server.v1_15_R1.EntityTypes;
|
import net.minecraft.server.v1_15_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_15_R1.GenericAttributes;
|
import net.minecraft.server.v1_15_R1.GenericAttributes;
|
||||||
import net.minecraft.server.v1_15_R1.World;
|
import net.minecraft.server.v1_15_R1.World;
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
|
|
||||||
public class CustomZombie extends net.minecraft.server.v1_15_R1.EntityZombie implements CustomEntity {
|
public class CustomZombie extends net.minecraft.server.v1_15_R1.EntityZombie implements CustomEntity {
|
||||||
|
|
||||||
@ -34,9 +34,9 @@ public class CustomZombie extends net.minecraft.server.v1_15_R1.EntityZombie imp
|
|||||||
|
|
||||||
private void spawnArtifactGuardian(Location loc) {
|
private void spawnArtifactGuardian(Location loc) {
|
||||||
|
|
||||||
this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(HerobrineAI.getPluginCore().getConfigDB().npc.getDouble("npc.Guardian.Speed"));
|
this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(Herobrine.getPluginCore().getConfigDB().npc.getDouble("npc.Guardian.Speed"));
|
||||||
this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(HerobrineAI.getPluginCore().getConfigDB().npc.getInt("npc.Guardian.HP"));
|
this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Guardian.HP"));
|
||||||
this.setHealth(HerobrineAI.getPluginCore().getConfigDB().npc.getInt("npc.Guardian.HP"));
|
this.setHealth(Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Guardian.HP"));
|
||||||
|
|
||||||
this.setCustomName(new ChatComponentText("Artifact Guardian"));
|
this.setCustomName(new ChatComponentText("Artifact Guardian"));
|
||||||
|
|
||||||
@ -54,9 +54,9 @@ public class CustomZombie extends net.minecraft.server.v1_15_R1.EntityZombie imp
|
|||||||
|
|
||||||
private void spawnHerobrineWarrior(Location loc) {
|
private void spawnHerobrineWarrior(Location loc) {
|
||||||
|
|
||||||
this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(HerobrineAI.getPluginCore().getConfigDB().npc.getDouble("npc.Warrior.Speed"));
|
this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(Herobrine.getPluginCore().getConfigDB().npc.getDouble("npc.Warrior.Speed"));
|
||||||
this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(HerobrineAI.getPluginCore().getConfigDB().npc.getInt("npc.Warrior.HP"));
|
this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Warrior.HP"));
|
||||||
this.setHealth(HerobrineAI.getPluginCore().getConfigDB().npc.getInt("npc.Warrior.HP"));
|
this.setHealth(Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Warrior.HP"));
|
||||||
|
|
||||||
this.setCustomName(new ChatComponentText("Herobrine Warrior"));
|
this.setCustomName(new ChatComponentText("Herobrine Warrior"));
|
||||||
|
|
||||||
@ -85,14 +85,14 @@ public class CustomZombie extends net.minecraft.server.v1_15_R1.EntityZombie imp
|
|||||||
else
|
else
|
||||||
mobS = "Warrior";
|
mobS = "Warrior";
|
||||||
|
|
||||||
Object[] items = HerobrineAI.getPluginCore().getConfigDB().npc.getConfigurationSection("npc." + mobS + ".Drops")
|
Object[] items = Herobrine.getPluginCore().getConfigDB().npc.getConfigurationSection("npc." + mobS + ".Drops")
|
||||||
.getKeys(false).toArray();
|
.getKeys(false).toArray();
|
||||||
for (Object itemObj : items) {
|
for (Object itemObj : items) {
|
||||||
final String item = itemObj.toString();
|
final String item = itemObj.toString();
|
||||||
final int chance = new Random().nextInt(100);
|
final int chance = new Random().nextInt(100);
|
||||||
if (chance <= HerobrineAI.getPluginCore().getConfigDB().npc.getInt("npc." + mobS + ".Drops." + item + ".Chance")) {
|
if (chance <= Herobrine.getPluginCore().getConfigDB().npc.getInt("npc." + mobS + ".Drops." + item + ".Chance")) {
|
||||||
getBukkitEntity().getLocation().getWorld().dropItemNaturally(getBukkitEntity().getLocation(),
|
getBukkitEntity().getLocation().getWorld().dropItemNaturally(getBukkitEntity().getLocation(),
|
||||||
new ItemStack(Material.matchMaterial(item), HerobrineAI.getPluginCore().getConfigDB().npc
|
new ItemStack(Material.matchMaterial(item), Herobrine.getPluginCore().getConfigDB().npc
|
||||||
.getInt("npc." + mobS + ".Drops." + item + ".Count")));
|
.getInt("npc." + mobS + ".Drops." + item + ".Count")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ import org.bukkit.event.block.BlockBreakEvent;
|
|||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.*;
|
import net.theprogrammersworld.herobrine.AI.*;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
||||||
import net.theprogrammersworld.herobrine.AI.cores.Heads;
|
import net.theprogrammersworld.herobrine.AI.cores.Heads;
|
||||||
@ -65,8 +65,8 @@ public class BlockListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (checkListCorrect && HerobrineAI.getPluginCore().getConfigDB().UseTotem && !AICore.isTotemCalled) {
|
if (checkListCorrect && Herobrine.getPluginCore().getConfigDB().UseTotem && !AICore.isTotemCalled) {
|
||||||
HerobrineAI.getPluginCore().getAICore().PlayerCallTotem(event.getPlayer());
|
Herobrine.getPluginCore().getAICore().PlayerCallTotem(event.getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -86,7 +86,7 @@ public class BlockListener implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Heads h = (Heads) HerobrineAI.getPluginCore().getAICore().getCore(CoreType.HEADS);
|
Heads h = (Heads) Herobrine.getPluginCore().getAICore().getCore(CoreType.HEADS);
|
||||||
ArrayList<Block> list = h.getHeadList();
|
ArrayList<Block> list = h.getHeadList();
|
||||||
if (list.contains(event.getBlock())) {
|
if (list.contains(event.getBlock())) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
@ -25,7 +25,7 @@ import org.bukkit.event.entity.EntityDeathEvent;
|
|||||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.Utils;
|
import net.theprogrammersworld.herobrine.Utils;
|
||||||
import net.theprogrammersworld.herobrine.AI.*;
|
import net.theprogrammersworld.herobrine.AI.*;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
||||||
@ -40,9 +40,9 @@ public class EntityListener implements Listener {
|
|||||||
private ArrayList<String> equalsLore = new ArrayList<String>();
|
private ArrayList<String> equalsLore = new ArrayList<String>();
|
||||||
private ArrayList<String> equalsLoreS = new ArrayList<String>();
|
private ArrayList<String> equalsLoreS = new ArrayList<String>();
|
||||||
private ArrayList<String> getLore = new ArrayList<String>();
|
private ArrayList<String> getLore = new ArrayList<String>();
|
||||||
private HerobrineAI PluginCore = null;
|
private Herobrine PluginCore = null;
|
||||||
|
|
||||||
public EntityListener(HerobrineAI plugin) {
|
public EntityListener(Herobrine plugin) {
|
||||||
equalsLore.add("Herobrine artifact");
|
equalsLore.add("Herobrine artifact");
|
||||||
equalsLore.add("Bow of Teleporting");
|
equalsLore.add("Bow of Teleporting");
|
||||||
equalsLoreS.add("Herobrine artifact");
|
equalsLoreS.add("Herobrine artifact");
|
||||||
@ -52,7 +52,7 @@ public class EntityListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onCreatureSpawn(CreatureSpawnEvent event) {
|
public void onCreatureSpawn(CreatureSpawnEvent event) {
|
||||||
if (!HerobrineAI.isNPCDisabled) {
|
if (!Herobrine.isNPCDisabled) {
|
||||||
if (PluginCore.getConfigDB().useWorlds.contains(event.getEntity().getLocation().getWorld().getName())) {
|
if (PluginCore.getConfigDB().useWorlds.contains(event.getEntity().getLocation().getWorld().getName())) {
|
||||||
|
|
||||||
Entity entity = event.getEntity();
|
Entity entity = event.getEntity();
|
||||||
@ -167,17 +167,17 @@ public class EntityListener implements Listener {
|
|||||||
&& PluginCore.getAICore().getCoreTypeNow() != CoreType.GRAVEYARD) {
|
&& PluginCore.getAICore().getCoreTypeNow() != CoreType.GRAVEYARD) {
|
||||||
|
|
||||||
if (dEvent.getDamager() instanceof Player) {
|
if (dEvent.getDamager() instanceof Player) {
|
||||||
if (event.getDamage() >= HerobrineAI.HerobrineHP) {
|
if (event.getDamage() >= Herobrine.HerobrineHP) {
|
||||||
|
|
||||||
HerobrineDropItems();
|
HerobrineDropItems();
|
||||||
|
|
||||||
PluginCore.getAICore().CancelTarget(CoreType.ANY);
|
PluginCore.getAICore().CancelTarget(CoreType.ANY);
|
||||||
HerobrineAI.HerobrineHP = HerobrineAI.HerobrineMaxHP;
|
Herobrine.HerobrineHP = Herobrine.HerobrineMaxHP;
|
||||||
Player player = (Player) dEvent.getDamager();
|
Player player = (Player) dEvent.getDamager();
|
||||||
player.sendMessage("<Herobrine> " + PluginCore.getConfigDB().DeathMessage);
|
player.sendMessage("<Herobrine> " + PluginCore.getConfigDB().DeathMessage);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
HerobrineAI.HerobrineHP -= event.getDamage();
|
Herobrine.HerobrineHP -= event.getDamage();
|
||||||
PluginCore.HerobrineNPC.HurtAnimation();
|
PluginCore.HerobrineNPC.HurtAnimation();
|
||||||
AICore.log.info("HIT: " + event.getDamage());
|
AICore.log.info("HIT: " + event.getDamage());
|
||||||
}
|
}
|
||||||
@ -190,17 +190,17 @@ public class EntityListener implements Listener {
|
|||||||
PluginCore.getAICore().setAttackTarget((Player) arrow.getShooter());
|
PluginCore.getAICore().setAttackTarget((Player) arrow.getShooter());
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (event.getDamage() >= HerobrineAI.HerobrineHP) {
|
if (event.getDamage() >= Herobrine.HerobrineHP) {
|
||||||
|
|
||||||
HerobrineDropItems();
|
HerobrineDropItems();
|
||||||
|
|
||||||
PluginCore.getAICore().CancelTarget(CoreType.ANY);
|
PluginCore.getAICore().CancelTarget(CoreType.ANY);
|
||||||
HerobrineAI.HerobrineHP = HerobrineAI.HerobrineMaxHP;
|
Herobrine.HerobrineHP = Herobrine.HerobrineMaxHP;
|
||||||
Player player = (Player) arrow.getShooter();
|
Player player = (Player) arrow.getShooter();
|
||||||
player.sendMessage("<Herobrine> " + PluginCore.getConfigDB().DeathMessage);
|
player.sendMessage("<Herobrine> " + PluginCore.getConfigDB().DeathMessage);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
HerobrineAI.HerobrineHP -= event.getDamage();
|
Herobrine.HerobrineHP -= event.getDamage();
|
||||||
PluginCore.HerobrineNPC.HurtAnimation();
|
PluginCore.HerobrineNPC.HurtAnimation();
|
||||||
AICore.log.info("HIT: " + event.getDamage());
|
AICore.log.info("HIT: " + event.getDamage());
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ import org.bukkit.event.inventory.InventoryCloseEvent;
|
|||||||
import org.bukkit.event.inventory.InventoryOpenEvent;
|
import org.bukkit.event.inventory.InventoryOpenEvent;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
||||||
import net.theprogrammersworld.herobrine.misc.ItemName;
|
import net.theprogrammersworld.herobrine.misc.ItemName;
|
||||||
|
|
||||||
@ -23,13 +23,13 @@ public class InventoryListener implements Listener {
|
|||||||
|
|
||||||
Object[] data = { event.getPlayer(), event.getInventory() };
|
Object[] data = { event.getPlayer(), event.getInventory() };
|
||||||
|
|
||||||
HerobrineAI.getPluginCore().getAICore().getCore(CoreType.BOOK).RunCore(data);
|
Herobrine.getPluginCore().getAICore().getCore(CoreType.BOOK).RunCore(data);
|
||||||
|
|
||||||
if (new Random().nextInt(100) > 97) {
|
if (new Random().nextInt(100) > 97) {
|
||||||
|
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().UseHeads) {
|
if (Herobrine.getPluginCore().getConfigDB().UseHeads) {
|
||||||
if (event.getInventory().firstEmpty() != -1) {
|
if (event.getInventory().firstEmpty() != -1) {
|
||||||
if (HerobrineAI.getPluginCore().getAICore().getResetLimits().isHead()) {
|
if (Herobrine.getPluginCore().getAICore().getResetLimits().isHead()) {
|
||||||
event.getInventory().setItem(event.getInventory().firstEmpty(),
|
event.getInventory().setItem(event.getInventory().firstEmpty(),
|
||||||
ItemName.CreateSkull(event.getPlayer().getUniqueId(), event.getPlayer().getName()));
|
ItemName.CreateSkull(event.getPlayer().getUniqueId(), event.getPlayer().getName()));
|
||||||
}
|
}
|
||||||
@ -46,14 +46,14 @@ public class InventoryListener implements Listener {
|
|||||||
|| event.getInventory().getType() == InventoryType.FURNACE
|
|| event.getInventory().getType() == InventoryType.FURNACE
|
||||||
|| event.getInventory().getType() == InventoryType.WORKBENCH) {
|
|| event.getInventory().getType() == InventoryType.WORKBENCH) {
|
||||||
|
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().useWorlds.contains(event.getPlayer().getLocation().getWorld().getName())) {
|
if (Herobrine.getPluginCore().getConfigDB().useWorlds.contains(event.getPlayer().getLocation().getWorld().getName())) {
|
||||||
|
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().PlaceSigns == true
|
if (Herobrine.getPluginCore().getConfigDB().PlaceSigns == true
|
||||||
&& HerobrineAI.getPluginCore().getSupport().checkSigns(event.getPlayer().getLocation())) {
|
&& Herobrine.getPluginCore().getSupport().checkSigns(event.getPlayer().getLocation())) {
|
||||||
|
|
||||||
if (HerobrineAI.getPluginCore().getAICore().getResetLimits().isSign()) {
|
if (Herobrine.getPluginCore().getAICore().getResetLimits().isSign()) {
|
||||||
Object[] data = { event.getPlayer().getLocation(), event.getPlayer().getLocation() };
|
Object[] data = { event.getPlayer().getLocation(), event.getPlayer().getLocation() };
|
||||||
HerobrineAI.getPluginCore().getAICore().getCore(CoreType.SIGNS).RunCore(data);
|
Herobrine.getPluginCore().getAICore().getCore(CoreType.SIGNS).RunCore(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ import org.bukkit.event.player.PlayerQuitEvent;
|
|||||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.Utils;
|
import net.theprogrammersworld.herobrine.Utils;
|
||||||
import net.theprogrammersworld.herobrine.AI.AICore;
|
import net.theprogrammersworld.herobrine.AI.AICore;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
||||||
@ -38,9 +38,9 @@ public class PlayerListener implements Listener {
|
|||||||
private Location p_loc = null;
|
private Location p_loc = null;
|
||||||
private long timestamp = 0;
|
private long timestamp = 0;
|
||||||
private boolean canUse = false;
|
private boolean canUse = false;
|
||||||
private HerobrineAI PluginCore = null;
|
private Herobrine PluginCore = null;
|
||||||
|
|
||||||
public PlayerListener(HerobrineAI plugin) {
|
public PlayerListener(Herobrine plugin) {
|
||||||
equalsLoreS.add("Herobrine artifact");
|
equalsLoreS.add("Herobrine artifact");
|
||||||
equalsLoreS.add("Sword of Lighting");
|
equalsLoreS.add("Sword of Lighting");
|
||||||
equalsLoreA.add("Herobrine artifact");
|
equalsLoreA.add("Herobrine artifact");
|
||||||
|
@ -7,7 +7,7 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.world.ChunkLoadEvent;
|
import org.bukkit.event.world.ChunkLoadEvent;
|
||||||
|
|
||||||
import net.theprogrammersworld.herobrine.HerobrineAI;
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
import net.theprogrammersworld.herobrine.AI.Core.CoreType;
|
||||||
|
|
||||||
public class WorldListener implements Listener{
|
public class WorldListener implements Listener{
|
||||||
@ -18,23 +18,23 @@ public class WorldListener implements Listener{
|
|||||||
|
|
||||||
World world = event.getWorld();
|
World world = event.getWorld();
|
||||||
|
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().useWorlds.contains(world.getName())){
|
if (Herobrine.getPluginCore().getConfigDB().useWorlds.contains(world.getName())){
|
||||||
|
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().BuildTemples==true){
|
if (Herobrine.getPluginCore().getConfigDB().BuildTemples==true){
|
||||||
|
|
||||||
if (new Random().nextInt(2)==1){
|
if (new Random().nextInt(2)==1){
|
||||||
Object[] data = {event.getChunk()};
|
Object[] data = {event.getChunk()};
|
||||||
|
|
||||||
HerobrineAI.getPluginCore().getAICore().getCore(CoreType.TEMPLE).RunCore(data);
|
Herobrine.getPluginCore().getAICore().getCore(CoreType.TEMPLE).RunCore(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HerobrineAI.getPluginCore().getConfigDB().BuildPyramids==true){
|
if (Herobrine.getPluginCore().getConfigDB().BuildPyramids==true){
|
||||||
|
|
||||||
if (new Random().nextInt(30)==4){
|
if (new Random().nextInt(30)==4){
|
||||||
Object[] data = {event.getChunk()};
|
Object[] data = {event.getChunk()};
|
||||||
HerobrineAI.getPluginCore().getAICore().getCore(CoreType.PYRAMID).RunCore(data);
|
Herobrine.getPluginCore().getAICore().getCore(CoreType.PYRAMID).RunCore(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user