ProtocolLib

3M Downloads

1.16.4 - No suitable constructor could be found

Fuizziy opened this issue ยท 1 comments

commented

Describe the bug
When trying to instantiate a new WrapperPlayServerSpawnEntity on a Snowball, a No suitable constructor could be found is thrown. I am using the 1.16.4 from BuildTools and the 4.6 up to date ProtocolLib JAR for 1.16+

To Reproduce

        Snowball sb = (Snowball) p.getWorld().spawnEntity(p.getLocation().add(0, 2, 0), EntityType.SNOWBALL);
        sb.setGravity(false);
        sb.setGlowing(true);
        sb.setVelocity(new Vector(0, 0.2, 0));


        WrapperPlayServerSpawnEntity wrap = new WrapperPlayServerSpawnEntity(sb, WrapperPlayServerSpawnEntity.ObjectTypes.SNOWBALL_PROJECTILE, 0);

Entire class here : https://hastebin.com/domipehawi.swift

Error

org.bukkit.command.CommandException: Unhandled exception executing command 'vb' in plugin Vibes v1.0-SNAPSHOT
	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[spigot-1.16.1.jar:git-Spigot-9639cf7-4b9bc9d]
	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-1.16.1.jar:git-Spigot-9639cf7-4b9bc9d]
	at org.bukkit.craftbukkit.v1_16_R1.CraftServer.dispatchCommand(CraftServer.java:757) ~[spigot-1.16.1.jar:git-Spigot-9639cf7-4b9bc9d]
	at net.minecraft.server.v1_16_R1.PlayerConnection.handleCommand(PlayerConnection.java:1703) ~[spigot-1.16.1.jar:git-Spigot-9639cf7-4b9bc9d]
	at net.minecraft.server.v1_16_R1.PlayerConnection.a(PlayerConnection.java:1546) ~[spigot-1.16.1.jar:git-Spigot-9639cf7-4b9bc9d]
	at net.minecraft.server.v1_16_R1.PacketPlayInChat.a(PacketPlayInChat.java:47) ~[spigot-1.16.1.jar:git-Spigot-9639cf7-4b9bc9d]
	at net.minecraft.server.v1_16_R1.PacketPlayInChat.a(PacketPlayInChat.java:1) ~[spigot-1.16.1.jar:git-Spigot-9639cf7-4b9bc9d]
	at net.minecraft.server.v1_16_R1.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:19) ~[spigot-1.16.1.jar:git-Spigot-9639cf7-4b9bc9d]
	at net.minecraft.server.v1_16_R1.TickTask.run(SourceFile:18) ~[spigot-1.16.1.jar:git-Spigot-9639cf7-4b9bc9d]
	at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.executeTask(SourceFile:144) ~[spigot-1.16.1.jar:git-Spigot-9639cf7-4b9bc9d]
	at net.minecraft.server.v1_16_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[spigot-1.16.1.jar:git-Spigot-9639cf7-4b9bc9d]
	at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.executeNext(SourceFile:118) ~[spigot-1.16.1.jar:git-Spigot-9639cf7-4b9bc9d]
	at net.minecraft.server.v1_16_R1.MinecraftServer.aZ(MinecraftServer.java:943) ~[spigot-1.16.1.jar:git-Spigot-9639cf7-4b9bc9d]
	at net.minecraft.server.v1_16_R1.MinecraftServer.executeNext(MinecraftServer.java:936) ~[spigot-1.16.1.jar:git-Spigot-9639cf7-4b9bc9d]
	at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.awaitTasks(SourceFile:127) ~[spigot-1.16.1.jar:git-Spigot-9639cf7-4b9bc9d]
	at net.minecraft.server.v1_16_R1.MinecraftServer.sleepForTick(MinecraftServer.java:920) ~[spigot-1.16.1.jar:git-Spigot-9639cf7-4b9bc9d]
	at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:852) ~[spigot-1.16.1.jar:git-Spigot-9639cf7-4b9bc9d]
	at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot-1.16.1.jar:git-Spigot-9639cf7-4b9bc9d]
	at java.lang.Thread.run(Thread.java:835) [?:?]
Caused by: java.lang.IllegalArgumentException: No suitable constructor could be found.
	at com.comphenix.protocol.injector.PacketConstructor.withPacket(PacketConstructor.java:163) ~[?:?]
	at com.comphenix.protocol.injector.PacketFilterManager.createPacketConstructor(PacketFilterManager.java:831) ~[?:?]
	at blocaria.vibes.packets.WrapperPlayServerSpawnEntity.fromEntity(WrapperPlayServerSpawnEntity.java:86) ~[?:?]
	at blocaria.vibes.packets.WrapperPlayServerSpawnEntity.<init>(WrapperPlayServerSpawnEntity.java:77) ~[?:?]
	at blocaria.vibes.commands.vb.Help.execute(Help.java:35) ~[?:?]
	at blocaria.vibes.commands.VbCommand.onCommand(VbCommand.java:35) ~[?:?]
	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-1.16.1.jar:git-Spigot-9639cf7-4b9bc9d]
	... 18 more

Do I call the constructor wrongly?

Best regards

commented

Did you found a solution?
I have the same problem using paper 1.16.4, but I can't figure what is causing it...