Commit Graph

15 Commits

Author SHA1 Message Date
Kevin Ludwig bd613987ce
Fix empty chunk encoding 2022-10-15 20:26:02 -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
RednedEpic bcc68ee4b5 Update to latest MCPL changes 2022-06-05 13:12:36 -05:00
Camotoy e43a143bf4
Remove obsolete chunk writing code 2022-05-29 20:39:14 -04:00
David Choo b33cc512b4
Add custom skull render distance (#2751)
* Add player skull render distance

* Improve updateVisibleSkulls a bit

Avoid rechecking visibility on small movements

* Periodically despawn unused skull entities

* Don't hide skull entity for position/rotation changes

Prevents flickering for skulls that are rotating

* Update visible skulls when a skull is removed

* Only update on removal if an entity is assigned

* No need to check for skull in ChunkUtils

Update copyright year

* Avoid rechecking all skulls when a skull is added/removed

* Allow skull render distance and number to be configured

Renamed some fields to better match their values

* Compare texture property directly from GameProfile

* Remove unnecessary blockState field from SkullPlayerEntity

* Use binarySearch for insertion

Wait for player movement before loading skulls

* Allow culling to be disabled by setting max-visible-custom-skulls to -1

* Only remove skulls in inRangeSkulls when culling is enabled

* Add suggestions from review

* Merge the for loops in updateVisibleSkulls

* Fix skulls being leaked on chunk unload
2022-05-14 15:12:18 -04:00
Camotoy e66014af9e
Fix lava and snow cauldrons looking wrong
Fixes #2955
2022-04-30 20:40:34 -04:00
Camotoy cf8114543e Bump version; drop 1.17.40; support 1.18.30 2022-04-17 19:53:06 -04:00
David Choo a39de7d7d2
Fix ArrayIndexOutOfBoundsException for worlds lower than -64 (#2759)
* Fix ArrayIndexOutOfBoundsException for worlds lower than -64

`chunkSize` is Java section count while `sectionCount` is the Bedrock section count

* Send biomes for air sections while also staying within limits

.-.

* Move protocol version check to variable
2022-01-14 14:57:59 -05:00
Tim203 3251d9010c
We're in 2022 now 2022-01-01 20:03:05 +01:00
Camotoy 75d1a6364c
Gracefully handle invalid block entity types 2021-11-30 15:06:47 -05:00
Camotoy ec34510417 Don't tie biome translation to Bedrock chunk section size
This allows biomes to be translated even if the block count is empty. Fixes some biome glitching.
2021-11-25 11:59:25 -05:00
Camotoy e7ecda64f0
Use new 1.18 chunk encoding features 2021-11-23 11:21:54 -05:00
Camotoy 966c2155ad
API: change player class to Connection 2021-11-22 14:52:26 -05:00
RednedEpic 83ddbd7d1a Initial api draft 2021-11-21 12:36:42 -06: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/java/level/JavaLevelChunkWithLightTranslator.java (Browse further)