Code Monkey home page Code Monkey logo

Comments (6)

Matsv avatar Matsv commented on June 7, 2024

I think USE_ITEM causes this. It's not sending any cursor position

http://wiki.vg/Protocol#Player_Block_Placement
https://github.com/MylesIsCool/ViaVersion/blob/master/src/main/java/us/myles/ViaVersion/transformers/IncomingTransformer.java#L206-L219

from viaversion.

hugokerstens avatar hugokerstens commented on June 7, 2024

It's really strange, because the bow is actually fired. You can damage other entities.
However, from the wiki.vg about the slot item: "A value of -1 signifies that the slot is empty, and no further data follows." So this would indicate that the server would think that the packet is finished,while it isn't.

from viaversion.

Matsv avatar Matsv commented on June 7, 2024

Same problem with buckets & potions

from viaversion.

hugokerstens avatar hugokerstens commented on June 7, 2024

I Investigated the arrows further, and it seems there is sent a "Spawn Object" packet with velocity (0,0,0). Afterwards there is never sent any "Entity Velocity" packet for that arrow.
This results in the client drawing an arrow which has been shot, but as soon as it receives the "Spawn Object" packet from the server it will stop the arrow mid-air.

from viaversion.

hugokerstens avatar hugokerstens commented on June 7, 2024

It turns out when you fire a bow in 1.8, it will send this to the server: (ProtocolLib)

[17:15:08 INFO]: [ProtocolLib] Received PacketPlayInBlockDig[7, legacy: 14] from HugoDaBosss:
{ a = { a = 0, c = 0, d = 0 }, b = { g = 0, h = 1, i = -1, j = "down", k = { e = "y", f = "VERTICAL", name = "Y", ordinal = 1 }, l = { c = -1, d = "Towards negative", name = "NEGATIVE", ordinal = 1 }, m = { a = 0, c = -1, d = 0 }, name = "DOWN", ordinal = 0 }, c = { name = "RELEASE_USE_ITEM", ordinal = 5 } }

And it answers with this:

[17:15:08 INFO]: [ProtocolLib] Sent PacketPlayOutSpawnEntity[14, legacy: 23] to HugoDaBosss:
{ a = 509, b = 4353, c = 2272, d = -5426, e = 21589, f = 10548, g = -271, h = 18, i = 64, j = 60, k = 79 }

So what I'm thinking is that when firing a bow, we should use the Block Dig packet, not the Block Placement. Using this will result in an SpawnEntity packet with velocity.

from viaversion.

hugokerstens avatar hugokerstens commented on June 7, 2024

This is fixed now, don't know how.
Probably a combination of things:
0db43e6
153a68b

from viaversion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.