Commit Graph

17 Commits

Author SHA1 Message Date
chris 5d95bf65a6
Fix lecterns on 1.20.60, add support for virtual books (#4471)
* Fix lecterns on 1.20.60, start on virtual lecterns

* Fix: virtual books & actual books opening twice, resolve other issues, remove debug

* undo some unnecessary diff

* Don't try to send virtual books to pre 1.20.60 clients

* address review by camotoy
2024-03-02 03:21:31 +01:00
chris 95d65350e4
Project wide syntax/annotation cleanup (#4238)
Co-authored-by: Konicai <71294714+Konicai@users.noreply.github.com>
2023-12-05 18:54:42 -05:00
chris 706d1b9627
Fix smithing tables on pre-1.20 servers (#4056) 2023-08-16 22:42:17 -04:00
Amberichu 811aba3339
Validate written_book tags and fix writable book losing changes (#3894)
* Validate NBT tags of written_book like Java edition

* Update page count and character count limits

The maximum number of characters allowed in Java's book edit screen is
1024 for each page and 16 for the title. However, the packet itself has
a limit of 8192 * 3 bytes for each page and 128 * 3 bytes for the title.

* Fix writable book losing changes when signing

Bedrock sends a 3 action InventoryTransactionPacket after the player
changes a page. This causes Geyser to send a ServerboundEditBookPacket
with an outdated NBT. The Java responses with a
ClientboundContainerSetSlotPacket that overwrites any NBT Changes from
BedrockBookEditTranslator.

* Add a comment for the title length check

* Specify color in Component.translatable
2023-06-18 20:02:27 -04:00
Camotoy 60de3187c6 Yeet NbtItemStackTranslator 2023-04-08 12:45:13 -04:00
Camotoy 3f4ed67597
Add Item classes to partially replace ItemMapping. Part 1? 2022-12-29 15:10:40 -05:00
RednedEpic a133308f51 It compiles! 2022-10-29 22:02:11 -05:00
RednedEpic 18e7db8c30 Start on update to Protocol 3.0 2022-10-29 19:23:21 -05:00
Camotoy 4163de9314
Translate allay dancing 2022-07-28 17:45:38 -04:00
Camotoy 2ea50116cf
Forward cooldowns for shields and goats
These are server-controlled as of 1.19. Ender pearls and chorus fruit still appear to be client-controlled.
2022-06-24 23:13:35 -04:00
David Choo 9ea22042eb
Fix some item interactions (#3083)
* Remove Bedrock only banner patterns from the creative inventory

* Add sound for tadpole bucket

* Fix lily pad and frogspawn placing on mobile/single stacks

* Workaround? Fix? for bucket usage on mobile

* Simplify math and update position+rotation whenever ServerboundUseItemPacket is sent

* Rotate the player back after using an item and fix glass bottles

* ITEM_USE actionType 1 does not need the rotation fix

Increase delay for look back

* Add some checks

* Prevent buckets and spawn eggs from being unintentionally placed when interacting with special blocks

As of 1.19 Bedrock no longer sends a PlayerActionPacket with action=BLOCK_INTERACT. Bedrock now sends action=ITEM_USE_ON_START before and action=ITEM_USE_ON_STOP after using an item on a block. However, this is not useful as it is sent for all block interactions.

* Fix inventory transactions being rejected after restoreCorrectBlock

The held item's netId is always 0 in the InventoryTransactionPacket.

* Touch ups

* Fix lookAt for different poses and sneaking + cauldron + bucket interactions

Fix boat items being desynced when placing them very close to collision
Fix bottles being desynced when tapping above water

Resend the held item if we do encounter a desync

* Avoid getting blockstate twice and fix comment

* Use generated interaction data

* Fix glass bottles being double filled and phantom water bottles/water buckets

* Don't update the entire inventory on useItem

* Use Geyser's inventory copy for check

* Use ItemTranslator#getBedrockItemMapping to avoid NBT translation

* mappings

Co-authored-by: Camotoy <20743703+Camotoy@users.noreply.github.com>
2022-06-24 16:48:28 -04:00
Camotoy 85800eb32b
Tadpole 2022-05-26 18:52:04 -04:00
Camotoy d6cb5bd52d
ItemMappings: use array for ItemMapping class 2022-04-04 14:08:35 -04:00
Camotoy 7d1ec5c41a
Support offhand interactions with entities 2022-02-24 22:49:10 -05:00
Tim203 3251d9010c
We're in 2022 now 2022-01-01 20:03:05 +01:00
Camotoy 41ecb885bd
Merge branch 'master' of https://github.com/GeyserMC/Geyser into feature/1.18 2021-11-22 22:47:58 -05:00
RednedEpic 2c663e0ee5 The Great Refactor Part 3 - Entire project restructure 2021-11-20 17:29:46 -06:00
Renamed from core/src/main/java/org/geysermc/geyser/network/translators/item/StoredItemMappings.java (Browse further)