Commit Graph

199 Commits

Author SHA1 Message Date
Camotoy 96db37c14c
Fix bucket interactions on creative mode (#1369)
* Fix bucket interactions on creative mode

Bedrock uses the BLOCK_INTERACT enum of BedrockActionTranslator to truly indicate if a bucket should be used or not. In order to hook into this, we need to delay the bucket placing by about 5 milliseconds - this gives us time to cancel the interaction if needed.

Bucket sounds will now not play in this case as well.
2020-10-12 20:02:41 -04:00
Camotoy 59f72d0e65
BedrockMobEquipmentTranslator: Don't change item slot if already on that slot (#1353)
* BedrockMobEquipmentTranslator: Don't change item slot if already on that slot

* Update comment
2020-10-09 01:07:50 +01:00
Camotoy 4514167835
Fix fire being punched in all directions (#1370)
Apply the fix we have for fire but for all block faces.
2020-10-08 18:44:15 -04:00
Camotoy 772cb246f0
Forward keep alive packets to the client (#1344)
* Forward keep alive packets to the client

Previously, MCProtocolLib (our Java protocol library) handled keep alive packets for us. This commit disables that option and 'forwards' the keep alive packets to the client, and sending the keep alive packet back once Bedrock sends us a ping response.

* Delete DataCache

* Update to latest MCProtocolLib

* Swap values around as a sanity check
2020-09-29 14:15:11 -04:00
Camotoy 9bb52afc8a
BedrockRespawnTranslator: prevent some respawn bugs (#1346) 2020-09-29 13:21:25 -04:00
Camotoy beae39e280
Prevent Bedrock from changing gamemode client-side (#1337)
In vanilla Bedrock, if you have operator status, the client sends a packet to change gamemode without confirmation from the server. Since we have a custom server option to request the gamemode, we just reset the gamemode and ignore this packet.
2020-09-25 20:09:02 +01:00
Camotoy fa0864b8a1
Fix picking up liquids with buckets (#1311)
* Fix picking up liquids with buckets

The last fix to prevent bucket placement upon interacting with an inventory had an oversight with empty buckets, making them unusable. This commit fixes that while keeping the previous fix.

* Remove debug line

* Fix milk drinking and visual bucket item apperance

* Comment elaboration

* Make indentiation better
2020-09-24 15:11:42 -04:00
Camotoy 1ec768d95d
Fix interaction spam bug (#1324)
* Fix interaction spam bug

This references the Nukkit 1.0 fix for the client bug of spamming to interact. Holding down still works.

* Remove interaction position set at action type 1

* Remove debug line
2020-09-24 12:54:18 -04:00
Redned 0cd43818f1
Use SERVER_READY in BedrockRespawnTranslator to fix respawn bug 2020-09-22 20:10:38 -05:00
Camotoy 6638c53029
Implement command block and jigsaw support (#1291)
* Implement command block and jigsaw support

- Command block UI is now fully implemented to match Java Edition.
- Command block minecarts are now supported.
- Command blocks now show the correct type of command block.
- Jigsaw blocks are translated.

Structure blocks can be implemented, but these will be trickier as there are significant GUI differences between Java and Bedrock.

* Add more detail about command block minecart color

* Set PlayerPermission.OPERATOR to allow command blocks to be destroyed
2020-09-14 20:54:19 -04:00
Camotoy 3b274ef9d1
Pick block improvements (#1265)
* Pick block improvements

- Creative block picking is now implemented. If the survival-styled block picking fails, then the item is created, following Java-style mechanics.
- Entity 'picking' is also implemented. The item is crafted using the same mechanics, and the same rules apply as normal block-picking (except it only works in creative mode, following Java.

* Switch some logic around
2020-09-14 20:52:16 -04:00
Camotoy 46c34842d8
BedrockInventoryTransactionTranslator: check to make sure bucket usage is on purpose (#1280)
Otherwise buckets can be activated when opening block inventories.
2020-09-12 09:47:43 -04:00
Camotoy b21f477366
Parrot mounting fixes (#1236)
* Parrot mounting fixes

- Fix duplicate parrots when a parrot leaves the player
- Fix rotation of parrots

* Remove critical debug information
2020-09-01 23:39:06 -05:00
Camotoy dcf1731d8a
Implement correct sign wrapping (#1228)
* Implement correct sign wrapping

This commit ensures that the auto-wrapping nature of Bedrock with signs is corrected. If a Bedrock player sends a sign that is auto-wrapped, it will now be interpreted by Geyser to fit on multiple lines. Additionally, Geyser will crop incoming sign text to prevent auto-wrapping.

* Don't wrap if it's the last line
2020-09-01 23:38:36 -05:00
Camotoy aaa3d7238d
BedrockEmoteTranslator: ensure sending player is valid for all other sessions (#1194) 2020-08-24 10:26:37 -04:00
DoctorMacc 2dc71382e7
Merge branch 'master' of https://github.com/GeyserMC/Geyser into feature/1.16.2 2020-08-11 09:07:23 -04:00
Savagetechguy 3ef7e30230 Fix fire not extinguishing on server side when on bedrock
Fixes #875
Fixes #906
2020-08-08 17:59:03 -05:00
rtm516 0a5048232f
Add support for client side settings (#1035)
* Port code from #486

Co-authored-by: Luke <32024335+lukeeey@users.noreply.github.com>

* Fix and clean code and add default gamemode changing

* Clean copyright

* Remove direct modification of server, clean up code and add player list xuid fetching.

* Move to custom settings menu

* Move sendAdventureSettings to GeyserSession

* Add javadoc comments

* Add translation support

* Remove updated copyright

* Clean up

* Clarify some javadoc comments

* Remove obsolete code

* Update languages submodule

* Fix javadoc comments

* Fix compile

Co-authored-by: Luke <32024335+lukeeey@users.noreply.github.com>
Co-authored-by: Redned <redned235@gmail.com>
2020-08-08 17:41:12 -05:00
bundabrg 0ca1096f45
Fix Skin Caching and Fix Skin Restorer (#680)
* Fix Skin Caching

Changes:
* Instead of caching a skin based upon the player we cached it based upon the textureURL. This means multiple players with the same skin will benefit from the cache and more importantly will mean a player changing their skin will not get a false cache hit.
* This should fix all issues with SkinRestorer and will now correctly show the skin both to the player themselves and to other players

Closes #518

* Remove duplicated code

* Minimize playerlist updates

Changes:
* All async skin stuff will now just update skins and not be involved with sending the session to the player. This eliminates issues where the player list changes whilst an async task is occuring plus it means no invisible players while retrieving skin.
* Fix bug when retrieving cached skin

* When sending PlayerList packets ensure the skins have appropriate skinIds so the Bedrock client will cache hit/miss as needed

* Make sure to add and remove player when setting skin if they do not belong on the playerlist

* Make use of AuthData UUID when removing the player

* Revert removal of checking if entity is valid when initialized

This section is supposed to send all spawned entities in the java world to a player only after they've initialized. By removing this check it would also be sending entities that exist but are not spawned.

* Optimizations

Changes:
* Check for duplicate requests based on textureURL instead of player ID
* Don't use the PlayerSkinPacket. It duplicates the data sent in the PlayerListPacket and without it the players still get skin updates.

* Support caching of skins to disk based on configuration variable

If a skin is downloaded it will be saved to `cache/skins` using a base64 encoded filename of the textureUrl, if allowed by setting a non 0 value for the configuration variable `cache-skins`

When reading a skin we try load it from a cache file first before trying to download it.

We don't yet expire them but do update their last modification so we know which ones have been accessed.

* Update `config.yml` with cache-skins directive, defaulting to disabled

* Merge Fixes

* Cache all images instead of just skins

Changes:
* Move the image caching from skins to where images may get downloaded so this also covers capes and anything else that uses the same method of image retrieval
* Updated config value from `cache-skins` to `cache-images`
* Updated cache location from `cache/skins` to `cache/images`
* Images are stored in png format with a uuid. This may make debugging easier as they can be directly opened.

* Implement cached image expiry

If `cache-images` is set to a value greater than 0 then a scheduled task will occur once a day that will remove images with a modification date older than the value in days.

* Force skin changes as trusted

* Resolve PR queries

* Fix signed int causing issues calculating expiry time for images

* Reset Defaults to 0 and implement Google Timed Eviction cache for Images

* Add memory cache for Capes

Co-authored-by: Brendan Grieve <brendan.grieve@zepli.com.au>
Co-authored-by: bundabrg <bundabrg@grieve.com.au>
2020-08-07 12:33:21 -04:00
DoctorMacc e8df81167b
Merge latest master 2020-08-05 11:20:25 -04:00
AJ Ferguson 86f18c9392
Remove Y pos workaround in BedrockItemFrameDropItemTranslator (#1037) 2020-08-01 14:41:59 -04:00
Camotoy 238a3a8df1
Support immediate respawn gamerule (#970)
* Support immediate respawn gamerule

This commit now supports immediate respawn if the server enables it - both on the setting being applied on join and the setting being modified in-game. This also refactors the respawning process to more closely match BDS behavior - nothing broke in my testing but more testing is needed.

* Reuse spawned variable instead of creating new variable
2020-07-30 15:31:12 -05:00
rtm516 b10e5d5af3
Clean copyright message and update all files (#1053) 2020-07-30 15:10:15 -05:00
DoctorMacc 43c062c23c
Update to latest master 2020-07-29 16:25:42 -04:00
AJ Ferguson b9846fe797
Small inventory fixes (#1029)
* Increase minimum delay between closing and opening a new window

* Fix potential crash when opening player inventory
2020-07-27 11:17:55 -04:00
DoctorMacc 9a3a7ef50f
Merge branch 'master' of https://github.com/GeyserMC/Geyser into feature/1.16.2 2020-07-24 10:48:00 -04:00
Camotoy b103d86ff9
Fix buckets on desktop survival (#1003) 2020-07-23 14:37:14 -04:00
rtm516 30c007d04b
Fix buckets not working on mobile (#767)
Desktop clients send an extra item use packet for buckets whereas mobile clients dont send the second use packet causing the issue as a ClientPlayerUseItemPacket doesn't get sent to the Java server.

Buckets on mobile may still be glitchy as the player must be directly facing the block they want to place liquid on.
2020-07-21 13:17:55 -04:00
DoctorMacc 3b8d1758b3
Initial update for 20w29a 2020-07-20 19:02:18 -04:00
Camotoy e5fc66d72f
Fix elytra flying in creative mode (#956)
Sending a ClientPlayerAbilitiesPacket allows the player to successfully fly.

This commit also removes the setting of the CAN_FLY entity flag on creative mode. This did not break anything in my testing.
2020-07-18 15:57:37 -05:00
Camotoy 9cc468cee9
Remove debug string 2020-07-08 12:42:20 -04:00
DoctorMacc bfdc452e3e Add emote support for Bedrock-to-Bedrock players 2020-07-08 12:38:54 -04:00
DoctorMacc 0cea703b46 Save ItemEntry classes for items 2020-07-07 16:40:19 -04:00
DoctorMacc f68632f433 Block-related updates
- Fix block breaking animation
- Fix block breaking particles
- Don't initialize Geyser's chunk cache if using Spigot
2020-07-06 21:38:10 -04:00
AJ Ferguson 699402e635 Fix bug with maps 2020-07-06 15:52:38 -08:00
rtm516 c454e443df Fix maps with negative IDs causing out of bounds errors 2020-07-06 23:36:31 +01:00
rtm516 cfaf4051b7
Add Translation support (#504)
Adds full multi-language support to any Bedrock-supported language.

Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
2020-07-05 19:35:51 -04:00
RednedEpic da1674c8d6 Update to Cloudburst NBT 2.0 2020-07-05 15:59:44 -05:00
DoctorMacc c17f21eedc Fix respawn bugs - hopefully for good
Thanks to @bundabrg for spotting this one.
2020-07-01 12:28:03 -04:00
rtm516 7710261b70 Add Loadstone Compass tracking 2020-06-30 00:52:32 +01:00
Tim203 8f763dfc5f
Move common stuff used only by connector and bootstrap to connector 2020-06-28 00:27:00 +02:00
AJ Ferguson ba9129129c Quick inventory fixes. WIP
Temporary. The inventory system will be rewritten very soon.
2020-06-26 18:51:09 -08:00
DoctorMacc 06fa0de793 Add translator for PacketViolationWarningPacket 2020-06-25 11:16:36 -04:00
DoctorMacc 0471fa89f4 Bedrock 1.16 updating part 2 (Doesn't work) 2020-06-22 21:21:42 -04:00
DoctorMacc ea1a9e5427 Bedrock 1.16 updating part 1 2020-06-22 20:11:09 -04:00
DoctorMacc 117cdf282d Begin updating Geyser. Requires manual MCProtocolLib compile 2020-06-20 22:24:45 -04:00
DoctorMacc 1015b830ce Merge branch 'master' of https://github.com/GeyserMC/Geyser into mcprotocollibupdate 2020-06-20 17:50:00 -04:00
Camotoy 100d7b7759
Add villager interactive tag (#788)
* Add villager interactive tag

This adds a button/controller guide for villager trading, if the villager is able to trade.

* Use a broader variable for metadata
2020-06-20 13:44:40 -04:00
DoctorMacc 65f61ec703 Finish block state changes 2020-06-19 09:06:29 -04:00
DoctorMacc d6119375b2 (Incomplete) Update MCProtocolLib 2020-06-18 21:44:50 -04:00