Commit Graph

786 Commits

Author SHA1 Message Date
James Cahill 81f58ee9bf
Add Server Name config option (#1170)
* Add bedrock.server-name config option

* Fix spelling mistake oops!

* Remove trailing whitespace
2020-08-25 09:29:55 -04:00
Camotoy c1a70c7754
Translate client-computed recipes (#1181)
* Translate client-computed recipes

A handful of recipes are complex enough on Java Edition that the client simply calculates them after getting an assurance that they are valid recipes. This PR stores those recipes in a Bedrock-compatible format in mappings, then generates the CraftingData information on startup to send to the Bedrock client when called. This fixes firework rocket and star crafting, and fixes leather armor and shulker box dyeing.

The recipe information for everything except leather armor was taken right from the Bedrock server. The leather armor had to be created separately (see https://github.com/DoctorMacc/LeatherDyeingCreation). There will be a slight visual difference in the crafting result preview if the armor is not perfectly dyed to one of the sixteen colors, but this is a visual issue that will persist unless we calculate every single possbile combination.

* Revert other changes

* Register shulker box recipes properly

* Add break

* Update mappings
2020-08-24 21:14:44 -05:00
Camotoy 6e8106eeec
Add shulker box item tooltip translating (#1189)
* Add shulker box item tooltip translating

This commit adds support for previewing the items inside of a shulker box. This does not do a full translation, and only does enough to translate the item information to the client, so as to prevent any accidental item modifying/removing on creative mode.

* Swap values
2020-08-24 21:05:39 -05:00
Camotoy aaa3d7238d
BedrockEmoteTranslator: ensure sending player is valid for all other sessions (#1194) 2020-08-24 10:26:37 -04:00
Camotoy 8b7165a564
Implement (hopefully) temporary dimension switching fix (#1188)
This fixes rare (?) instances where dimension switching doesn't finish loading on the client. Ideally a proper fix would send the finishing packets in the correct order but I didn't get far in this regard.

Fixes #1154 and #1072.

Other miscellaeous chunk-related fixes have also been included here.
2020-08-24 09:31:21 -04:00
Jordie 2d6264d7c1
Add visual support for signs colored with dye (#1180)
* Fix dyed signs in Bedrock Edition

Add visual support (in Bedrock Edition) for signs colored with dye (in Java Edition)

* Javadoc for getBedrockSignColor(string)

* Simplified getBedrockSignColor(string)
2020-08-22 16:39:40 -04:00
Camotoy ee42067d87
Don't play a sound when falling onto a block (#1175) 2020-08-21 12:01:38 -05:00
Camotoy 7fcfa7d54d
Implement an enchantment table GUI (#1177)
Until 1.16, enchantment tables were impossible to implement properly in Geyser. When a user selects an enchantment in Bedrock, the client creates the book on its end and assumes the server is OK with it. Java requires a button to be pressed to select the enchantment. With 1.16, server authoritative inventories remove that on Bedrock. However, until our inventory rewrite is finished we are still stuck without enchantment table support. This commit serves as an alternative as we wait.

Enchantment table GUI support is still impossible since we are using the pre-1.16 inventory system. To solve this, this commit replaces the enchantment table GUI with a hopper GUI. The first slot serves as the spot you place the weapon. The second slot acts as the lapis slot - Geyser prevents any item from going in there that is not lapis. The final three slots act as the buttons; an enchanted book acts as each button, with the ability to show the translated text of each enchantment.

https://cdn.discordapp.com/attachments/613194828359925800/746164042359504927/unknown.png
2020-08-20 20:53:47 -04:00
James Cahill e7363b4e9f
Add 'passthrough-protocol-name' config option (#1124)
* Initial version (tested)

* Don't bump config version

* Misc changes

* Add punctuation to config
2020-08-17 22:36:15 -05:00
RednedEpic 80a36344eb Only one of the values here needs to be greater than 0 2020-08-17 20:46:03 -05:00
RednedEpic 44f521ed04 Set player motion when explosion takes place 2020-08-17 20:40:57 -05:00
Camotoy b07433698a
Translate specific messages (#1161) 2020-08-16 19:02:59 -04:00
Camotoy 1ead2900a3
Translate RAIN_STRENGTH to Bedrock client (#1151)
* Translate RAIN_STRENGTH to Bedrock client

Previously Geyser ignored RAIN_STRENGTH and instead relied on START_RAIN and STOP_RAIN only. This is unreliable on a vanilla server as these values are swapped around. This commit also implements thunder strength which was untranslated.

* Update rain code in JavaRespawnTranslator
2020-08-16 12:43:16 -05:00
Camotoy 4bcf44638e
ConnectorServerEventHandler: set default packet handler (#1148)
This allows disconnect packets to be sent and kick unsupported versions of the game.
2020-08-13 09:56:03 -05:00
DoctorMacc 8b691d22d5
Add v408 as the default protocol
smh mojang
2020-08-11 12:16:18 -04:00
DoctorMacc 6ccf629a8a
Update to 1.16.2-rc2; add multiversion support 2020-08-11 10:00:14 -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
rtm516 c7958af1db
Fix dust particles type (#1108) 2020-08-10 09:31:49 -05:00
DoctorMacc 6e80f22ee9
Update to 1.16.2-rc1 2020-08-09 22:43:57 -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
RednedEpic 04cf8b2a99 Fix javadoc errors 2020-08-08 17:56:15 -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
Camotoy 0fde30fc78
GeyserSession: always send naturalRegeneration=false gamerule (#1097)
This essentially gives the server full control over the health visual.
2020-08-08 16:50:49 -05:00
Camotoy 7df476183a
Implement proper mappings for pistons, dropper, dispenser (#1103)
This commit gets rid of the hacky workaround implemented for pistons, droppers and dispensers and actually implements the vanilla data values.
2020-08-08 16:50:32 -05:00
RednedEpic d951ee83b4 Initial plugin message and forum support for GeyserAddons 2020-08-08 16:37:01 -05:00
Camotoy d49856cd7f
Change scoreboard errors to debug only (#781)
Prevents errors from occuring that don't stop operation of Geyser.
2020-08-07 14:10:26 -04: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 61dbcb0c80
Update effects mappings (#949)
* Update effects mappings

* Use STOP_RECORD as the default record instead of null

* Add comments

* Update mappings submodule

* Update MCProtocolLib and effects

* Change level event used for EVAPORATE effect

The bedrock client plays an additional sound when using CAULDRON_EXPLODE.
The java client does not play any sound.

* Update mappings submodule
2020-08-03 13:42:43 -08:00
Camotoy 11c713dc6f
JavaEntityMetadataTranslator: replace stack trace with concise warning (#1086)
* JavaEntityMetadataTranslator: replace stack trace with concise warning

Removes the stack trace given when a ClassCastException occurs and replaces it with a friendlier message. Class cast errors will happen since some servers send incorrect values, and apparently it is default Minecraft behavior to ignore them.

* Update languages submodule
2020-08-03 16:29:52 -05:00
AJ Ferguson 86f18c9392
Remove Y pos workaround in BedrockItemFrameDropItemTranslator (#1037) 2020-08-01 14:41:59 -04:00
Camotoy 07f3d45cc4
Check for display tag when translating anvil contents (#1073) 2020-08-01 11:57:25 -05:00
Arktisfox 54bee1f868
Small entity metadata fix, other player bow implementation (#685)
* Move blocking case to LivingEntity, and make other players bows animate.

This moves metadata ID 7 to LivingEntity, it's proper place. It also sets the 'USING_ITEM' flag which animates other players bows.

* Add skeleton aiming support

Skeletons don't have support of pushing their bows back on Bedrock, but this allows them to hold their arms up

Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
2020-07-30 22:10:55 -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
Camotoy a4339be212
Only send metadata update once per Java metadata packet (#1022)
While this doesn't fix any bugs, it may be a slight performance enhancement as we aren't sending multiple packets per one Java entity metadata packet.
2020-07-30 15:15:07 -05:00
Camotoy 9097f8547b
Add rabbit jumping animation (#1027)
* Add rabbit jumping animation

This isn't perfect as Bedrock uses a duration and Java just sends the jumping animation. There may be something else missing from the puzzle piece.

* Remove debug line
2020-07-30 15:12:09 -05:00
bundabrg 784cb73301
Test if slot 50 used and under what conditions. (#1028) 2020-07-30 15:11:35 -05:00
bundabrg 11300254f0
Fix Anvil renames by trying a component first then fallback to plain text (#1052)
Closes #1039
2020-07-30 15:10:43 -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
Camotoy fe75320d6d
Add WORLD_IMMUTABLE flag to spectator mode (#1034)
Prevents the client from trying to interact with blocks
2020-07-27 18:18:22 -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
bundabrg d03f56e7e8
Fix Merchant Inventory Transaction (#1017) 2020-07-25 23:06:06 -04:00
bundabrg fffac8a552
Fix Spawn position not using offset. (#1015) 2020-07-25 10:38:00 -04:00
DoctorMacc 127bc39c53
Merge branch 'master' of https://github.com/GeyserMC/Geyser into feature/1.16.2 2020-07-24 15:45:28 -04:00
AJ Ferguson 5b1116b15a
Creative items (#1013) 2020-07-24 15:42:15 -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
Camotoy ad9184ad13
Update Adventure-Legacy dependency (#996) 2020-07-22 14:52:12 -04:00
Camotoy b211b9da2e
Update entity status mappings (#995)
- Add support for LIVING_BURN entity status
- Properly send sheep graze event
2020-07-22 11:03:09 -04:00
ForceUpdate1 765efe8a33
Fix anvil item rename (#992)
* fix anvil item rename

* fix anvil item rename
2020-07-21 15:01:55 -05: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 221e5bd103
Disconnect client if using an invalid Mojang account (#975)
This commit supresses the NPE that was previously sent when using an invalid Mojang account. Instead, the Bedrock client is disconnected with an error message.
2020-07-18 15:56:12 -05:00
rtm516 04e73efd94
Fix enchantment conversion (#920)
* Fix java to bedrock enchantments

* Fix NBT conversion and add Soul Speed enchantment

* Remove unused import
2020-07-14 02:18:11 -05:00
Camotoy c4db0e2e63
Manually disconnect client on LoginDisconnectPacket (#950)
The client will not get kicked on a LoginDisconnectPacket causing them to remain in an empty world perpetually.
2020-07-13 21:53:55 -04:00
RednedEpic e7657c7d07 Fix enchantments for servers that don't namespace them (Fixes #897) 2020-07-11 19:52:20 -05:00
RednedEpic 5ceb4145ac Fix fireworks (Closes #917) 2020-07-11 19:40:26 -05:00
rtm516 485ba1b8a7
Check the name tag exists for anvil renaming to prevent an NPE (#936)
* Check the name tag exists for anvil renaming to prevent an NPE

* Fix item names being empty if display tag exists with no name
2020-07-11 21:58:12 +01:00
Camotoy e942d7c553
Don't use player locale for outdated message. (#931)
Too early in the login cycle to grab it.

This commit also updates the languages submodule.
2020-07-11 12:51:10 -05:00
Camotoy 3e0cb28a63
Fix scoreboard prefix/suffix translation errors (#929)
Uses getTranslatedBedrockMessage() instead of getBedrockMessage().

Fixes #923.
2020-07-10 14:14:54 -04: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 21ea1f2408 Update MCProtocolLib to fix #836 2020-07-07 20:14:50 -04:00
DoctorMacc 0cea703b46 Save ItemEntry classes for items 2020-07-07 16:40:19 -04:00
rtm516 5f6566ad0e Move to dynamic item ID mapping in ItemRegistry 2020-07-07 16:23:21 +01:00
rtm516 c2be7a181d Fix Piglin bartering animation (Fixes #863) 2020-07-07 16:11:52 +01:00
rtm516 75f2891ec0 Fix map_uuid nbt type 2020-07-07 14:47:56 +01:00
rtm516 8807d5d9c6 Fix banner block patterns 2020-07-07 14:30:33 +01:00
DoctorMacc f9760b721c Don't process the display tag if it's empty 2020-07-07 08:30:11 -04:00
AJ Ferguson 50176e10a8 Fix inabilty to place items into brewing stand 2020-07-06 23:44:39 -08: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
RednedEpic 24f9651cc6 Convert map of players to list (may address #833) 2020-07-06 20:11:34 -05: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 ba736575f7 Fix RGB colors on signs causing chunk issues, fix items names not being displayed correctly 2020-07-06 23:36:04 +01:00
DoctorMacc 545dfa38f0 JavaUpdateTileEntityTranslator improvements
- Remove the use of deprecated functions
- Check for empty NBT (fixes errors on CubeCraft)
2020-07-06 16:22:07 -04:00
theminecoder 66570a623d
Fix scoreboards bleeding into other servers (#902) 2020-07-06 08:10:36 -05: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 d1e5960d69 Send a dimension change upon join game packet now sent by bungeecord on 1.16 2020-07-05 18:33:05 -05:00
RednedEpic da1674c8d6 Update to Cloudburst NBT 2.0 2020-07-05 15:59:44 -05:00
DoctorMacc 4062f1ee55 Fix flower pots and item frames 2020-07-05 00:03:51 -04:00
RednedEpic 8ac5d6e13d Fix memory leak in legacy ping passthrough (Fixes #674, #813) 2020-07-04 16:35:48 -05:00
rtm516 da96a5b19c Fix Strider cold state when riding and removing of the RIDING flag when a parent is killed 2020-07-03 22:55:54 +01:00
AJ Ferguson ab71bf0727 Fix bug when dropping items from an open inventory 2020-07-03 12:18:35 -08:00
DoctorMacc 699ae0b88e Set strider entity offset properly if not a player entity 2020-07-01 20:27:39 -04:00
DoctorMacc c17f21eedc Fix respawn bugs - hopefully for good
Thanks to @bundabrg for spotting this one.
2020-07-01 12:28:03 -04:00
DoctorMacc 51dfda1c91 Clean up formatting 2020-07-01 08:22:21 -04:00
DoctorMacc 81651cfac5 Add support for 3D biomes; fix Nether biome display 2020-06-30 20:39:21 -04:00
rtm516 c804a6edfb Fix respawning and death not being registered on the client 2020-06-30 17:08:22 +01:00
rtm516 a9bb8745f5 Fix Zombified Piglin fire flicker 2020-06-30 13:20:03 +01:00
DoctorMacc ba6adc988b Strider mounting fixes; update mappings
This commit refactors health visual logic to make it a global system for each living entity.
2020-06-29 21:34:01 -04:00
AJ Ferguson eb3bde15a7 Fix stored enchantments accidentally being dropped 2020-06-29 16:59:02 -08:00
AJ Ferguson 95144266d2 Handle int tag for enchantment level 2020-06-29 16:59:02 -08:00
rtm516 7710261b70 Add Loadstone Compass tracking 2020-06-30 00:52:32 +01:00
AJ Ferguson e77f2b5dbb Drop long array nbt tag when translating to bedrock 2020-06-29 10:59:51 -08:00
DoctorMacc f2f59e4e37 Fill in renamed villager trading values (villager trading UI now opens) 2020-06-28 23:44:38 -04:00
AJ Ferguson 12d5982c57 Anvil fixes 2020-06-28 16:14:57 -08:00
rtm516 f5da962f6f Fix disconnect message formatting 2020-06-28 23:38:27 +01:00