Bedrock Edition allows you to swap out armor by right-clicking an item in your inventory, even when armor in that slot is already equipped. This PR prevents Bedrock from performing this action if both slots are occupied (which Java Edition will not do).
Items such as wall torch blocks currently do not have a place sound on standalone, as their block identifier differs from their item identifier. This commit uses the pick item logic in order to fix place sounds for such blocks.
Java Edition has a tags system that allows for some server-side control of certain properties. This PR allows for piglin trading items, wool, and flowers to be determined from the server.
For the InteractAt type of packet of the PlayerInteractEntityPacket, Java sends a diff between the entity's current position and the hit result of its cursor. Bedrock sends the full vector location in its interaction. Therefore, we just do the diff ourselves.
This fixes taking armor off of armor stands.
Java plays a client-side-only effect when feeding animals. This commit abstracts out the feeding code we already have for interactive tag and checks it when right-clicking any animal that is a baby.
* Fix some raid entities up
- Show axe when vindicator is attacking
- Show arm movement and spell color when evoker summons
* Reduce the amount of casting
Because apparently it's not just a constant; it makes a new array every time.
Also, GeyserSession#tick() does not need to be public and I made enchantments in commands use the Java list.
If the server spams the window property update packet, then the network ID assigned for each enchanting slot will update too quickly, essentially disabling enchanting. This commit remedies this by only updating the network ID of each slot if a property changed.
* Fix horse health display
* Fix horses warping back when damaged
* Fix horse jumping animation
* Fix horses not taking damage while standing on magma
* Allow mules and donkeys to jump
This commit brings full support for crawling, sneaking under 1.5-block-tall spaces, and swimming in one-block areas. There is a check in place that decreases the player's speed to something comparable to Java if they are in a situation where they would otherwise go at normal walking speed (for example: without the check, a Bedrock player would go at full walking speed while crawling).
On Bedrock, a banner must be placed in the chestplate slot in order to be visible. On Java Edition, banners are placed in the helmet slot. This commit fixes the issue by migrating banners to the chestplate spot if the chestplate spot is empty.
This commit also fixes pillager poses if they're not holding a crossbow, along with a couple other optimizations.
Conveniently enough, the minecart furnace icon still exists in the vanilla Bedrock Edition game (thanks to Kastle for this discovery). With this and the translation string still being present, we can add the item into the game with only minor issues.
- If GeyserConnector.getPlayerByUuid is given null, it will return null
- Never set a session's UUID to null if possible - but have precautions if for some reason it is
Note that this needs to be revisited to see if it's even needed, or perhaps some sort of Guava cache.
- `getCachedPlayerEntityLink` now removes the entry if found
- Skulls will not have player entity links so we shouldn't bother checking
- Clear the entity link cache on dimension switch
- Shield code is now down as the player is sneaking - it doesn't wait for the server to update our sneaking status
- Shield is now applied correctly when sneaking and then moving to the shield item
* Update Adventure from 4.5.0 to 4.7.0
* Fix test failure due to changes in Adventure color mapping
Co-authored-by: rtm516 <rtm516@users.noreply.github.com>
For whatever reason, item frames use the PlayerActionPacket in any non-creative gamemode, but creative mode keeps existing behavior. This has the benefit of fixing adventure mode item frame item dropping.
This commit implements 1.16.210 support while still keeping 1.16.100 and 1.16.210 compatibility.
Co-authored-by: AJ Ferguson <AJ-Ferguson@users.noreply.github.com>
Co-authored-by: rtm516 <rtm516@users.noreply.github.com>
* Fix logging into a server with Fabric Networking API
Turns out we prevented the response to LoginPluginRequestPacket. Fabric API 0.28 and later will not let a client join without this response.
* Switch back to Jitpack just for Protocol to prevent weird errors
* Re-add sub protocol check
* Simplify check
* Update protocol lib and fastutil
Move away from jitpack since we store each unique snapshot build in the opencollab repo.
Also, trove hasn't existed in the network repo for quite some time so the exclusion isn't needed anymore.
* Store fastutil version in a property
* Store adventure version in a property
Firework stars, unsurprisingly, share some code with fireworks. This commit adds a new FireworkBaseTranslator abstract class that both firework items extend from, in order to use the explosion translation code. Firework stars also show color.
Armor stands now show armor if invisible. This allows both names and armor to show on an armor stand, and should allow for custom models that use armor stands to show, to an extent.
Barrels are a bit more complicated to lump in with chests for the time being. It *can* be fixed, but it requires workarounds.
This reverts commit 07f36affb9.
Merge commands with the same parameters (thanks Supreme)
Add more suggestion types (blocks, items, entities)
More optimizations
Co-authored-by: SupremeMortal <6178101+SupremeMortal@users.noreply.github.com>
Co-authored-by: rtm516 <rtm516@users.noreply.github.com>
As of 1.16.210.59, the sub-MOTD cannot be blank: https://bugs.mojang.com/browse/MCPE-117979
This workaround will be implemented now so the widest range of Geyser versions will properly show a ping in 1.16.210 - better an 'outdated server' message than 'unable to connect to world.'
* Skin and skull fixes
- Handle the occasional greater-than-128-px skin
- Remove unused Jackson dependency
- Update used Jackson dependency
- Handle skin downloading on another thread
* Other small touchups
* Flush after rescaling
- Don't schedule for setting jumping on and off if cache chunks is enabled, since we don't need to know that
- Add a new setting to disable player ping forwarding. Hopefully this helps with timeouts.
With this commit, debug messages in Netty and Protocol will now show if debug mode is enabled in the Geyser standalone config.
There is also some small tuning to the PacketTranslatorRegistry for cleanliness and maybe some minor performance.
- Add the Java version being used
- Add the Minecraft server version being used, alongside the platform type that is using that version. Not used for proxies as those have to be on latest to support the latest Minecraft version
* Fix EndGateway translation issue.
* Change contains check to instanceof LongTag as requested.
* Add space after if as requested.
Co-authored-by: Brave_Chicken <bravechickengamer@gmail.com>
- Fix self-assigned player skins getting overwritten
- Fix players with no skin silently throwing an exception, and properly handle it instead
- CRITICAL bug fix of handling Deadmau5's skin - it's not handled by his UUID but by his username
* Send message to Java if command is Bedrock-only
If a Java player attempts to use a Bedrock-only command, such as `geyser statistics`, they will get an error message stating that this command is only for Bedrock players.
This commit also cleans up Velocity Adventure dependency usage. Issues were caused because of the way relocation works and because Velocity also uses Adventure.
* Only look for a session if we have to
* Update languages submodule
Using /geyser advancements, Bedrock clients can get a visual on their progress.
Co-authored-by: yehudahrrs <47502993+yehudahrrs@users.noreply.github.com>
Co-authored-by: Olivia <chew@chew.pw>
Co-authored-by: rtm516 <rtm516@users.noreply.github.com>
Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
Co-authored-by: rtm516 <ryantmilner@hotmail.co.uk>
Co-authored-by: Camotoy <20743703+Camotoy@users.noreply.github.com>
Microsoft accounts can now use Geyser, while maintaining full backwards compatibility with Mojang accounts.
Co-authored-by: Camotoy <20743703+Camotoy@users.noreply.github.com>
* Prevent server pong from appearing if MOTDs are too long
If the server MOTDs are 340 characters or longer, they will not appear. If this is the case, we trim each.
* Implement a more exact fix
* Add Ender Dragon effects and sounds
* Add proper death effect and clean up
* Add Ender Dragon respawn sound
* Possibly fix dragon breath direction?
* Update mappings
* Fix death animation triggering at low health
* Trigger death event when health is 0 and add explosions back
* Add comment
Client-side block animations and reach checks are now added.
This commit also includes cleanup in BlockChangeTranslator as well as proper Netherite tool support for calculating block breaking.
Co-authored-by: rtm516 <rtm516@users.noreply.github.com>
* Implement book editing
Updates the PR created by @ForceUpdate1 for 1.16 support. Seems to work fine now that hand support is in MCProtocolLib.
Co-authored-by: Camotoy <20743703+DoctorMacc@users.noreply.github.com>
* Remove debug line
* Simplify code
Currently still borked for creative mode.
* Fix books on creative
* Bug fixes
* Fix NPE?
* Blind fixes
* Send Book update before any player actions
* Remove debug prints
* Fix out of bounds for page replace and add
* Fix editing desync and remove empty pages from the end
* Send edit packet after signing
* Refactor
* Clean up and fix creative
* Apply suggestions from code review
Co-authored-by: rtm516 <rtm516@users.noreply.github.com>
Co-authored-by: ForceUpdate1 <mneuhaus44@gmail.com>
Co-authored-by: Camotoy <20743703+DoctorMacc@users.noreply.github.com>
Co-authored-by: David Choo <davchoo3@gmail.com>
Co-authored-by: rtm516 <rtm516@users.noreply.github.com>
* Add Tickable interface
By having a tickable interface, we're only dedicating one thread to ticking entities and running tasks as opposed to several. This will also help with implementing world border support.
* removeEntity already clears tickableEntities for us
* Only tick the entity if it's not being ticked
* Dimension switching cleanup
Cleans up dimension switching logic that should no longer be needed. Also fixes above Nether Bedrock building dimension switching.
* Clear thunder on dimension switch too
* Clarify fake dimension switch function name
* Javadoc that
* Work around there being a void floor in Bedrock
If the player's Y coordinate is -38 or below, we teleport the player below the void floor and they can safely die. :)
* Don't teleport if below Y -40
* sigh
* Have floorY be its own variable
* Add more comment
* More comments
* Finish my thought
Having an incongruency between the server render distance and the client render distance appears to cause issues, and I have not been able to encounter such a crash.