Closed Ariouz closed 4 years ago
https://github.com/JitseB/NPCLib/tree/master/nms/v1_8_R3/src/main/java/net/jitse/npclib/nms/v1_8_R3 Not sure what you mean by not supported?
I have an error in console that says it's not supported
You probably tried to integrate it directly in your plugin without changing this line: https://github.com/JitseB/NPCLib/blob/a6667129c9e28a57a55e7ca9818697511f099964/api/src/main/java/net/jitse/npclib/NPCLib.java#L34 It should match your classpath
HI there, sorry for the long wait!
Could you please post more information on the issue your having? There's a provided issue template I created for bug reports.
On the top of my head though, I think the issue you're having has to do with which binary file you're using for your plugin (and shading).
Closed due to inactivity, ticket may be reopened any time.
Hi, sorry for inactivity. I've this error when player join the server.
[19:29:21 ERROR]: Could not pass event PlayerJoinEvent to CsLobby v1.0.1
org.bukkit.event.EventException
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot.jar:git-Spigot-21fe707-e1ebe52]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-21fe707-e1ebe52]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.PlayerList.onPlayerJoin(PlayerList.java:298) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.PlayerList.a(PlayerList.java:157) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.LoginListener.b(LoginListener.java:144) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.LoginListener.c(LoginListener.java:54) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.NetworkManager.a(NetworkManager.java:231) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.ServerConnection.c(ServerConnection.java:148) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:814) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
Caused by: java.lang.NoSuchFieldError: hasTeamRegistered
at net.jitse.npclib.nms.v1_8_R3.NPC_v1_8_R3.sendShowPackets(NPC_v1_8_R3.java:67) ~[?:?]
at net.jitse.npclib.internal.NPCBase.show(NPCBase.java:179) ~[?:?]
at net.jitse.npclib.internal.NPCBase.show(NPCBase.java:143) ~[?:?]
at fr.cloudsky.lobby.events.PlayerJoin.onJoin(PlayerJoin.java:70) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_242]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_242]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_242]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_242]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot.jar:git-Spigot-21fe707-e1ebe52]
... 14 more
My code is
ArrayList<String> lines = new ArrayList<>();
lines.add("test");
lines.add("oui");
NPC npc = Main.getInstance().getNpcLib().createNPC(lines);
npc.setLocation(new Location(Bukkit.getWorld("world"), 136.5, 134, 642.5, -180f, 0f));
npc.create();
npc.show(p);
And there is the instance in the Main class
Are you using any other method from NPCLib that you didn't put in your code snippet? What version of Spigot are you using?
(this would have be a lot easier if you followed the issue ticket guidelines...)
Yes i registered the NpcLib instance in my Main class I do same as this youtube video: https://www.youtube.com/watch?v=TcdlURxXhP0 I'm using spigot 1.8_r3
Edit: I re-wrote all my code, here is the new code:
private Main main;
private NPCLib npcLib;
private NPC testNpc;
public NpcManager(Main main) {
this.main = main;
this.npcLib = new NPCLib(main);
load();
Bukkit.getPluginManager().registerEvents(this, main);
}
private void load(){
int skinId = 277513;
MineSkinFetcher.fetchSkinFromIdAsync(skinId, skin -> {
testNpc = npcLib.createNPC(Arrays.asList("Test", "Oui"));
testNpc.setLocation(new Location(Bukkit.getWorld("world"), 139.5, 134.1, 635.5, 0f, 0f));
testNpc.setItem(NPCSlot.HELMET, new ItemStack(Material.IRON_HELMET));
testNpc.setSkin(skin);
testNpc.create();
});
}
@EventHandler
public void onInteract(NPCInteractEvent e){
Player player = e.getWhoClicked();
if(e.getNPC() == testNpc){
player.sendMessage(e.getClickType().toString());
}
}
@EventHandler
public void onJoin(PlayerJoinEvent e){
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Main.getInstance(), () -> {
Bukkit.getScheduler().runTask(Main.getInstance(), () -> testNpc.show(e.getPlayer()));
}, 60L);
}
I've the same error:
Could not pass event PlayerMoveEvent to CsLobby v1.0.1
org.bukkit.event.EventException
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot.jar:git-Spigot-21fe707-e1ebe52]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-21fe707-e1ebe52]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:270) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.PacketPlayInFlying.a(SourceFile:126) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.PacketPlayInFlying$PacketPlayInPositionLook.a(SourceFile:18) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_242]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_242]
at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot.jar:git-Spigot-21fe707-e1ebe52]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
Caused by: java.lang.NoSuchFieldError: hasTeamRegistered
at net.jitse.npclib.nms.v1_8_R3.NPC_v1_8_R3.sendShowPackets(NPC_v1_8_R3.java:67) ~[?:?]
at net.jitse.npclib.internal.NPCBase.show(NPCBase.java:163) ~[?:?]
at net.jitse.npclib.listeners.PlayerListener.handleMove(PlayerListener.java:98) ~[?:?]
at net.jitse.npclib.listeners.PlayerListener.onPlayerMove(PlayerListener.java:68) ~[?:?]
at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_242]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_242]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot.jar:git-Spigot-21fe707-e1ebe52]
... 15 more
I'm using spigot1.8_r3
I've shade the plugin in my code and add the NpcManager npcManager = new NpcManager(this);
Is there anyone?
Hi, sorry I’ve been busy with work for university. I’ll try to reproduce your issue tomorrow.
Could not pass event PlayerMoveEvent to CsLobby v1.0.1
The issue you're having is about an exception that is thown by a PlayerMoveEvent. There's no PlayerMoveEvent in the code you have provided. What are you doing in this method?
The field that is requested by the code (hasTeamRegistered
) is one that is inherited from its super class. It's near impossible for the system to mess this up.
EDIT: It seems to be in the NPCLib's PlayerMoveEvent method. 🤦♂️
Code of Move class
public class PlayerMove implements Listener {
@EventHandler
public void onMove(PlayerMoveEvent e){
Player player = e.getPlayer();
// FREEZE
if(Main.getInstance().frozenPlayers.contains(player)){
player.sendMessage("§c§lVous êtes freeze !Veuillez suivre les instructions que le staff vous donne. Toute déconnection sera sanctionnée immédiatement");
}
// PARTICLES
if(Main.getInstance().playerParticle.containsKey(player)){
String particle = Main.getInstance().playerParticle.get(player);
if(particle == "redstone"){
ParticleEffect.REDSTONE.send(Bukkit.getOnlinePlayers(), player.getLocation(), 0, 0, 0, 0, 1);
}else if(particle == "orange"){
ParticleEffect.REDSTONE.sendColor(Bukkit.getOnlinePlayers(), player.getLocation(), Color.ORANGE);
}else if(particle == "glowstone"){
ParticleEffect.REDSTONE.sendColor(Bukkit.getOnlinePlayers(), player.getLocation(), Color.YELLOW);
}else if(particle == "lime"){
ParticleEffect.REDSTONE.sendColor(Bukkit.getOnlinePlayers(), player.getLocation(), Color.LIME);
}else if(particle == "cyan"){
ParticleEffect.REDSTONE.sendColor(Bukkit.getOnlinePlayers(), player.getLocation(), Color.TEAL);
}else if(particle == "lapis"){
ParticleEffect.REDSTONE.sendColor(Bukkit.getOnlinePlayers(), player.getLocation(), Color.BLUE);
}else if(particle == "magenta"){
ParticleEffect.REDSTONE.sendColor(Bukkit.getOnlinePlayers(), player.getLocation(), Color.FUCHSIA);
}else if(particle == "heart"){
ParticleEffect.HEART.send(Bukkit.getOnlinePlayers(), player.getLocation(), 0, 0, 0, 0, 1);
}
}
// BOUCEPADS
/*Location loc = player.getLocation();
Block block = Bukkit.getWorld(loc.getWorld().getName()).getBlockAt(loc.subtract(0, 1, 0));
if(loc.getBlock().getType() == Material.GOLD_BLOCK){
Vector vector = new Vector(0, 1, 0);
if((block.getX() == 139 && block.getY() == 132 && block.getZ() == 644)
|| (block.getX() == 148 && block.getY() == 132 && block.getZ() == 635)
|| (block.getX() == 139 && block .getY() == 132 && block.getZ() == 626)
|| (block.getX() == 130 && block.getY() == 132 && block.getZ() == 635)){
}
player.setVelocity(vector);
player.playSound(loc, Sound.EXPLODE, 30, 30);
}*/
}
}
Sorry about that, it seems to be thrown by NPCLib after all. However, it still doesn't make sense to as to why it's throwing a FieldNotFoundException on something that's just inherited from the super class. Anyway, what version of Java are you running your server on? And what version of NPCLib are you currently using?
I'm Running Java8, I use npclib-plugin-2.4.1-SNAPSHOT and spigot 1.8 with maven
I have setup a local clean linux server to try to find your error and I still can’t reproduce it. The field that is requested is accessible for all child classes. One final suggestion I have is to reinstall your Java runtime on your server. (another would be to use another version of NPCLib to see whether it’s just a bad binary, which would be strange because you’re the only one with this issue).
I use scoreboard teams, can it be that?
It should not result to any problems I think. But you can always try to see what happens if you disable that part of the plugin.
I'll try to remake the code in another plugin wich will be alone in plugins folder, to see if it works. Thanks for your support. You can close the ticket, i'll reopen another if i have another error :)
Alright. Best of luck with your plugin! Closing issue.
Hey, why spigot 1.8 r3 is not supported ? Can you make an update for this version ?