Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.19 Support? #99

Open
DevSnx opened this issue Feb 23, 2023 · 6 comments
Open

1.19 Support? #99

DevSnx opened this issue Feb 23, 2023 · 6 comments

Comments

@DevSnx
Copy link

DevSnx commented Feb 23, 2023

Testet on spigot 1.19. and Paper 1.19.2 not working

@DevSnx
Copy link
Author

DevSnx commented Feb 23, 2023

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`

@DevSnx
Copy link
Author

DevSnx commented Feb 23, 2023

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;
}

}
`

@derklaro
Copy link
Collaborator

v2 has no support for 1.19, use v3 instead.

@DevSnx
Copy link
Author

DevSnx commented Feb 24, 2023

Example Code for the old NPC variable?

@DevSnx
Copy link
Author

DevSnx commented Feb 24, 2023

@derklaro you have other examples?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants