Fixed startup crash
This commit is contained in:
parent
098614f4b4
commit
5817a74c67
@ -1,5 +1,5 @@
|
|||||||
# HerobrineAI
|
# HerobrineAI
|
||||||
[](http://jenkins.logicshard.com/job/HerobrineAI/1/)
|
[](http://jenkins.logicshard.com/job/HerobrineAI/)
|
||||||
|
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
8
pom.xml
8
pom.xml
@ -131,6 +131,12 @@
|
|||||||
<include>plugin.yml</include>
|
<include>plugin.yml</include>
|
||||||
</includes>
|
</includes>
|
||||||
</resource>
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>${project.basedir}</directory>
|
||||||
|
<includes>
|
||||||
|
<include>res/*.*</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
@ -141,7 +147,7 @@
|
|||||||
<source>1.6</source>
|
<source>1.6</source>
|
||||||
<target>1.6</target>
|
<target>1.6</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<description>
|
<description>
|
||||||
|
@ -81,13 +81,15 @@ public class HerobrineAI extends JavaPlugin implements Listener {
|
|||||||
isInitDone = false;
|
isInitDone = false;
|
||||||
}
|
}
|
||||||
if (errorCheck) {
|
if (errorCheck) {
|
||||||
|
|
||||||
isInitDone = true;
|
isInitDone = true;
|
||||||
|
|
||||||
HerobrineAI.pluginCore = this;
|
HerobrineAI.pluginCore = this;
|
||||||
|
|
||||||
NPCman = new NPCCore(this);
|
|
||||||
|
|
||||||
this.configdb = new ConfigDB(log);
|
this.configdb = new ConfigDB(log);
|
||||||
|
|
||||||
|
this.NPCman = new NPCCore(this);
|
||||||
|
|
||||||
getServer().getPluginManager().registerEvents(new EntityListener(this), this);
|
getServer().getPluginManager().registerEvents(new EntityListener(this), this);
|
||||||
getServer().getPluginManager().registerEvents(new BlockListener(), this);
|
getServer().getPluginManager().registerEvents(new BlockListener(), this);
|
||||||
getServer().getPluginManager().registerEvents(new InventoryListener(), this);
|
getServer().getPluginManager().registerEvents(new InventoryListener(), this);
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
package org.jakub1221.herobrineai.NPC;
|
package org.jakub1221.herobrineai.NPC;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@ -40,9 +38,9 @@ public class NPCCore {
|
|||||||
public boolean isInLoaded = false;
|
public boolean isInLoaded = false;
|
||||||
private int lastID = 0;
|
private int lastID = 0;
|
||||||
|
|
||||||
private static final GameProfile HEROBRINE_GAME_PROFILE = getHerobrineGameProfile();
|
private GameProfile HerobrineGameProfile = getHerobrineGameProfile();
|
||||||
|
|
||||||
private static GameProfile getHerobrineGameProfile() {
|
private GameProfile getHerobrineGameProfile() {
|
||||||
GameProfile profile = new GameProfile(
|
GameProfile profile = new GameProfile(
|
||||||
UUID.fromString(HerobrineAI.getPluginCore().getConfigDB().HerobrineUUID),
|
UUID.fromString(HerobrineAI.getPluginCore().getConfigDB().HerobrineUUID),
|
||||||
HerobrineAI.getPluginCore().getConfigDB().HerobrineName
|
HerobrineAI.getPluginCore().getConfigDB().HerobrineName
|
||||||
@ -58,6 +56,12 @@ public class NPCCore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public NPCCore(JavaPlugin plugin) {
|
public NPCCore(JavaPlugin plugin) {
|
||||||
|
|
||||||
|
server = BServer.getInstance();
|
||||||
|
|
||||||
|
networkCore = new NetworkCore();
|
||||||
|
|
||||||
|
|
||||||
Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(HerobrineAI.getPluginCore(), new Runnable() {
|
Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(HerobrineAI.getPluginCore(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -73,6 +77,8 @@ public class NPCCore {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 1L, 1L);
|
}, 1L, 1L);
|
||||||
|
|
||||||
|
this.HerobrineGameProfile = getHerobrineGameProfile();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeAll() {
|
public void removeAll() {
|
||||||
@ -136,7 +142,7 @@ public class NPCCore {
|
|||||||
public HumanNPC spawnHumanNPC(String name, Location l, int id) {
|
public HumanNPC spawnHumanNPC(String name, Location l, int id) {
|
||||||
|
|
||||||
final BWorld world = server.getWorld(l.getWorld().getName());
|
final BWorld world = server.getWorld(l.getWorld().getName());
|
||||||
final HumanEntity humanEntity = new HumanEntity(this, world, HEROBRINE_GAME_PROFILE, new PlayerInteractManager(world.getWorldServer()));
|
final HumanEntity humanEntity = new HumanEntity(this, world, HerobrineGameProfile, new PlayerInteractManager(world.getWorldServer()));
|
||||||
humanEntity.setLocation(l.getX(), l.getY(), l.getZ(), l.getYaw(), l.getPitch());
|
humanEntity.setLocation(l.getX(), l.getY(), l.getZ(), l.getYaw(), l.getPitch());
|
||||||
world.getWorldServer().addEntity(humanEntity);
|
world.getWorldServer().addEntity(humanEntity);
|
||||||
final HumanNPC humannpc = new HumanNPC(humanEntity, id);
|
final HumanNPC humannpc = new HumanNPC(humanEntity, id);
|
||||||
|
Loading…
Reference in New Issue
Block a user