Closed DevSnx closed 3 days ago
my code: protected void loadNpcPool() { npcPool = NPCPool.builder(this) .spawnDistance(getConfig().getInt("Settings.SpawnDistance")) .actionDistance(getConfig().getInt("Settings.ActionDistance")) .tabListRemoveTicks(getConfig().getInt("Settings.TabListRemoveTicks")) .build(); }
error ;
` [Lobby-1][23:57:24 INFO]: [SimpleCloudNPC] Enabling SimpleCloudNPC v1.0-SNAPSHOT
[Lobby-1][23:57:24 ERROR]: Error occurred while enabling SimpleCloudNPC v1.0-SNAPSHOT (Is it up to date?)
[Lobby-1]java.lang.NoClassDefFoundError: com/github/juliarn/npc/NPCPool
[Lobby-1] at de.devsnx.simplecloudnpc.SimpleCloudNPC.loadNpcPool(SimpleCloudNPC.java:75) ~[original-simplecloudnpc-1.0-SNAPSHOT.jar:?]
[Lobby-1] at de.devsnx.simplecloudnpc.SimpleCloudNPC.onEnable(SimpleCloudNPC.java:40) ~[original-simplecloudnpc-1.0-SNAPSHOT.jar:?]
[Lobby-1] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
[Lobby-1] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
[Lobby-1] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:542) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
[Lobby-1] at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:565) ~[paper-1.19.2.jar:git-Paper-307]
[Lobby-1] at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:479) ~[paper-1.19.2.jar:git-Paper-307]
[Lobby-1] at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:636) ~[paper-1.19.2.jar:git-Paper-307]
[Lobby-1] at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:422) ~[paper-1.19.2.jar:git-Paper-307]
[Lobby-1] at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:306) ~[paper-1.19.2.jar:git-Paper-307]
[Lobby-1] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1100) ~[paper-1.19.2.jar:git-Paper-307]
[Lobby-1] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305) ~[paper-1.19.2.jar:git-Paper-307]
[Lobby-1] at java.lang.Thread.run(Thread.java:833) ~[?:?]
[Lobby-1]Caused by: java.lang.ClassNotFoundException: com.github.juliarn.npc.NPCPool
[Lobby-1] at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:177) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
[Lobby-1] at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:124) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
[Lobby-1] at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
[Lobby-1] ... 13 more
[Lobby-1][23:57:24 INFO]: [SimpleCloudNPC] Disabling SimpleCloudNPC v1.0-SNAPSHOT`
My old class with NPC-lib-2.6 `package de.devsnx.simplecloudnpc.npc;
import com.github.juliarn.npclib.api.Npc; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.inventory.ItemStack;
import java.util.UUID;
public class SimpleNPCBuilder {
private NPC npc;
private Location location;
private boolean imitate, lookClose;
private boolean renderSkinPlayers = true;
private Material itemInHand;
private String displayName;
private UUID skinUUID;
public SimpleNPCBuilder(Location location) {
this.location = location;
}
public SimpleNPCBuilder setLocation(Location location) {
this.location = location;
return this;
}
public SimpleNPCBuilder setShouldImitate(boolean imitate) {
this.imitate = imitate;
return this;
}
public SimpleNPCBuilder setShouldLookClose(boolean lookClose) {
this.lookClose = lookClose;
return this;
}
public SimpleNPCBuilder renderSkinLayers(boolean renderSkinPlayers) {
this.renderSkinPlayers = renderSkinPlayers;
return this;
}
public SimpleNPCBuilder setItemInHand(Material material) {
this.itemInHand = material;
return this;
}
public SimpleNPCBuilder setSkinUUID(UUID skinUUID) {
this.skinUUID = skinUUID;
return this;
}
public SimpleNPCBuilder setDisplayName(String displayName) {
this.displayName = displayName;
return this;
}
public NPC build() {
npc = NPC.builder()
.profile(SimpleCloudNPC.getInstance().getNpcUtil().createProfile(this.skinUUID, this.displayName))
.location(this.location)
.imitatePlayer(this.imitate)
.lookAtPlayer(this.lookClose)
.build(SimpleCloudNPC.getInstance().getNpcPool());
npc.metadata()
.queue(MetadataModifier.EntityMetadata.SKIN_LAYERS, this.renderSkinPlayers);
npc.equipment()
.queue(EquipmentModifier.MAINHAND, new ItemStack(this.itemInHand, 1));
return npc;
}
} `
v2 has no support for 1.19, use v3 instead.
Example Code for the old NPC variable?
@derklaro you have other examples?
You can take a look at the cloudnet npc module. Creating the platform (like the npc pool before) https://github.com/CloudNetService/CloudNet-v3/blob/837bf8f14753361006d0ae77978272ae4cbff06c/modules/npcs/src/main/java/eu/cloudnetservice/modules/npc/platform/bukkit/BukkitPlatformNPCManagement.java#L92
Testet on spigot 1.19. and Paper 1.19.2 not working