Closed Chochaopik closed 12 months ago
which version is your server? (spigot or paper)? which version of the API are you using?
which version is your server? (spigot or paper)? which version of the API are you using?
I use "java -jar BuildTools.jar --rev 1.20.2 --remapped" to update (Bukkit 1.20.2 last version). 1.20.2-R0.1-SNAPSHOT of Spiggot server.
When i see "package net.minecraft.network.protocol.game;" have not "action, entry" for ClientboundPlayerInfoUpdatePacket (Minecraft 1.20.2)
public ClientboundPlayerInfoUpdatePacket(EnumSet<Action> var0, Collection<ServerPlayer> var1) { ... } public ClientboundPlayerInfoUpdatePacket(Action var0, ServerPlayer var1) { ... }
When i copy / paste the part myself (PlayerApi.class & FakePlayer.class in com.shanebeestudios.nms.world.entity), I add the missing functions recovered in the "utils" on the pages necessary to temporarily test in your source 1.20.2 - v1.4.0
I have this error:
Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.server.network.PlayerConnection.l()" because "var0.c" is null at net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket$b.<init>(SourceFile:145) ~[spigot-1.20.2-R0.1-SNAPSHOT.jar:3911-Spigot-e0e223f-71b0135] at net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket.<init>(SourceFile:32) ~[spigot-1.20.2-R0.1-SNAPSHOT.jar:3911-Spigot-e0e223f-71b0135] at fr.phylonia.mdbi.CreateCommand.spawnNPC(CreateCommand.java:48) ~[?:?] at fr.phylonia.mdbi.CreateCommand.onCommand(CreateCommand.java:29) ~[?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-api-1.20.2-R0.1-SNAPSHOT.jar:?] ... 23 more
Im user PaperWeight to make the actual API, so I think that may be a paper only method
Ah shame :( I manage to create my own player in NPC, it blocks me as a player but it's impossible to create a non-existent player in NPC...
However, your code also takes "net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket" It's strange that the game sources are different too
Hello Shane,
The API looks amazing but I'm having trouble understanding how bad code can work.
Let's start with this line :
connection.send(new ClientboundPlayerInfoUpdatePacket(EnumSet.of(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER), this.fakePlayerEntry)); connection.send(new ClientboundPlayerInfoUpdatePacket(EnumSet.of(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LISTED), this.fakePlayerEntry));
Because "ClientboundPlayerInfoUpdatePacket" don't accept "Enum" + "Entry". Don't accept Entry at all ...
It's Action + ServerPlayer or EnumSet of Action & Collection of ServerPlayer.
As a result, nothing works and if we correct this and replace the obsolete MinecraftServer.getServer() with Bukkit.getServer() this will create an error when calling SpawnFakePlayer, "var0 is null" (var0 is at ClientboundPlayerInfoUpdatePacket class).
I don't really understand how this could work...