dmulloy2 / ProtocolLib

Provides read and write access to the Minecraft protocol with Bukkit.
GNU General Public License v2.0
1.04k stars 257 forks source link

Spawning a Entity in 1.11 #277

Closed Ste3et closed 8 years ago

Ste3et commented 8 years ago

I become this error then i want to spawn a armorstand: http://hastebin.com/obaquhodap.md I know my armorstand spawning code is reale complex but i find not the problem, that have been changed soon 1.10 at the wiki.vg website it says the EntityType have been changed from Unsigned Byte to VarInt but i think this make no problems ?

Here is my entity.class: https://github.com/Ste3et/FurnitureLib/blob/master/src/de/Ste3et_C0st/FurnitureLib/main/entity/fEntity.java

I hope you can help me.

dmulloy2 commented 8 years ago

You should be fine with the VarInt so long as you're writing the entity id as an int. Minecraft will take care of writing it properly to the data stream. Otherwise it would appear that you're sending a malformed packet somehow and the client is crashing as a result. Do you have the client crash logs?

Ste3et commented 8 years ago

I cannot localize the problem and i don't know if you can me help, my first try was spawn the mob without inventory and pessanger packet i does work for a short time but after x ticks i become a client kick the minecraft output deos me not help this is the kick message:

https://dl.dropboxusercontent.com/u/79646035/Neuer%20Ordner/1.png

and this is after a reconnect:

https://dl.dropboxusercontent.com/u/79646035/Neuer%20Ordner/2.png

the Armorstands are created but i become the kicks i deosnt know why and this is my try with the Inventory packets:

https://dl.dropboxusercontent.com/u/79646035/Neuer%20Ordner/3.png

my inventory packet is:

http://hastebin.com/apepovowin.cpp

and this is my entity spawn packet:

https://github.com/Ste3et/FurnitureLib/blob/master/src/de/Ste3et_C0st/FurnitureLib/main/entity/fEntity.java#L42

i hope you can help me.

dmulloy2 commented 8 years ago

One change I know was made in 1.11 was that ItemStacks can no longer be null. Make sure you aren't using null ItemStacks.

dmulloy2 commented 8 years ago

I've updated ProtocolLib's ItemStack handling here: https://github.com/dmulloy2/ProtocolLib/commit/684b687e42f639d7efff397f3851ea0a17efb7a5

Ste3et commented 8 years ago

Oh ok i will look at this tommorow

Ste3et commented 8 years ago

I have test your new Dev-Build and rewrite my getSlot(int slot) function this deos not more return null the function return a new ItemStack(Material.Air, 1) and this works very well but i become kicks again i deosn't know why this is the error message: http://pastebin.com/6y8iDHWc but i deos not find any error what are generated from my plugin here is a very small demo: https://youtu.be/pJKGXrM2_3Y

Ste3et commented 8 years ago

It was a intern Minecraft Error what have been generated from the internal java i have fix it for me by deactivate the Firewall and restart minecraft sorry for that