Commit Graph

52 Commits

Author SHA1 Message Date
Camotoy 86b2901f02
1.16.220 support (#2105)
This update does not break compatibility with any other currently supported version of Bedrock.

Co-authored-by: Redned <redned235@gmail.com>
2021-04-06 00:14:06 -04:00
Camotoy 2f058e05bd
Allow dyed horse leather armor to translate (#2016) 2021-03-14 12:52:09 -04:00
Camotoy 6be71fc045
Merge branch 'master' of https://github.com/GeyserMC/Geyser into server-inventory 2021-02-26 00:46:44 -05:00
Camotoy ae3f50a79c
Firework star item translation (#1968)
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.
2021-02-25 13:13:24 -05:00
Camotoy 4db9ec92bf
Merge branch 'master' of https://github.com/GeyserMC/Geyser into server-inventory 2021-01-11 19:46:39 -05:00
Camotoy fe23c79053
Implement book editing (#1117)
* 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>
2021-01-07 19:40:34 -05:00
Camotoy c8016647f2
Clean up and add mobile button for horse opening 2021-01-05 19:08:54 -05:00
Camotoy a88678a5c1
Add manual recipes as Recipe classes for future usage 2021-01-04 22:15:55 -05:00
Camotoy 8317961340
Merge branch 'master' of https://github.com/GeyserMC/Geyser into server-inventory 2021-01-01 14:20:52 -05:00
Camotoy 186d94917a
Update copyright to 2021 (#1772)
* Update copyright to 2021

Free commit!

* These don't need a copyright

* Don't downgrade the mappings
2021-01-01 10:10:36 -05:00
Camotoy 7c4e95625a
Cleanup and delete FilterTextPacket - PRing to the main branch 2020-12-26 19:16:35 -05:00
Camotoy 3d0b0a1076
Stonecutter fixed; Loom improved 2020-12-24 18:29:25 -05:00
Camotoy 82179797ab
Add proper ominous banner translation (#1692)
The ominous banner is a separate banner type in Bedrock. If we detect the ominous banner pattern, then we set the ominous banner type in NBT. This process is also checked vice-versa, allowing the ominous banner to be pulled from the Bedrock creative menu.
2020-12-16 12:50:16 -05:00
Camotoy 2f294c9466
Fix player heads with a custom name (#1625) 2020-12-04 17:48:33 -05:00
OnlyBMan 2c0f3ec84d
Custom skull block support (#683)
Custom skulls are now implemented within the world when placed as a block. This is achieved by placing a fake player entity in the same spot.

Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
Co-authored-by: bundabrg <brendan@grieve.com.au>
Co-authored-by: bundabrg <bundabrg@grieve.com.au>
Co-authored-by: Camotoy <20743703+DoctorMacc@users.noreply.github.com>
2020-12-04 16:55:24 -05:00
Camotoy 199778faea
Fix regressions from 1.16.100 (#1558)
* Fix regressions from 1.16.100

- Update mappings to fix recipe regressions and item differences
- Villager trading NBT now prefers the String identifier and not the integer ID

* Fix lodestone compass breaking
2020-11-18 01:10:49 -05:00
Camotoy 123b074cc7
Update to Bedrock 1.16.100 (#1552)
* Initial work on 1.16.100 - currently crashes the client

* Update runtime item states

* Use new Bedrock runtime IDs

Bedrock now hardcodes block runtime IDs in alphabetical order of the identifiers. This commit updates Geyser to accomodate.

- Remove runtime_block_states.dat and replace it with blockpalette.nbt
- Calculate the block runtime ID based on the order of the block palette
- Separate BlockTranslator.AIR into Bedrock and Java values
- Update the second layer of chunks to use air when not waterlogged
- Don't send item palette for now, as that's what crashes the game (will look into for v415)
- Other misc. changes

* Improve second layer chunk translation

* v415 support

- Add a message warning people they are on a beta version of Geyser

* Update to protocol v417

There are still some mappings changes that need to be gone through.

* Update runtime item states and clean up item frames

* Future-proof enchanment table

* Update for v418

* Update to v419

* Apply proper air ID to waterlogged chunk layer

* Fix missing import

* Remove beta warning

* Update mappings

* Manually patch runtime_item_states and send the ITEMS registry

* Update README

* Disable grindstone and smithing inventories (since they're broken)

* Use artifactory jenkins plugin (#1548)

* Use artifactory jenkins plugin

* Bump version to 1.2.0-SNAPSHOT

Co-authored-by: SupremeMortal <6178101+SupremeMortal@users.noreply.github.com>
2020-11-17 11:03:12 -06:00
rtm516 512f8cd6c2
Rewrite message handling in MessageUtils to use Adventure (#1498)
* Rewrite message handling in MessageUtils to use Adventure

* Move to static Adventure commit to fix a bug

* Initial test implementation

* Add RGB downgrade test

* Move MessageUtils and rename

* Clean-up and fix tests

* Fixed sign and book content handling

* Fix blank signs causing NPEs

* Fix reset before message being stripped

* Add comment about the reset character

* Fix legacy style server motds

* Fix more messages being handled wrong

* Fix title packets being handled wrong

* Fix trailing formatting characters on the end of sign lines

* Add auto updating of Java locale files

* Add en_us locale updating and hash caching

* Changes to hash determining

Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
2020-11-16 23:57:57 +00:00
Camotoy 47f25f1205
BannerTranslator: fix NPE when no block entity data (#1543) 2020-11-15 18:48:11 -05:00
Tim203 c64d57439f
Block entity performance improvements (#1481)
* BlockEntity performance improvements

* Use chunk cache if possible for block caching

* Get new block state from ViaVersion if block entity

* Add Javadoc for FlowerPotBlockEntityTranslator.isFlowerBlock

* Remove debug line

* Don't add all RequiresBlockState instances if cache chunks is enabled

* Double chest map get optimization

* Last changes

Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
2020-11-05 22:36:22 +01:00
Camotoy ca1f87d464
MapItemTranslator: support map tag being of short value (#1475)
GSigns sends this as a short. Who knows why.
2020-10-31 22:38:56 -04:00
Camotoy 7f5fac38c6
Update to Adventure 4.1.1 (#1410)
* Update to Adventure 4.0.0

* Update to 4.0.1

* Update again, I guess.
2020-10-19 19:09:16 -04:00
Camotoy ec609fa868
Make crossbows prettier (#1359)
- Fix crossbow NBT translation - now crossbows will show as loaded
- Pillagers now more closely resemble Java Edition pose behavior
2020-10-08 20:40:50 -04:00
Camotoy 3c4cde9677
Tipped arrow translation (#1331)
* Tipped arrow translation

- Tipped arrow items are now properly translated both ways
- Tipped arrow particle effects are also translated, by having a list of all colors Java could send us and their Bedrock ID

* Remove a whitespace
2020-09-29 13:30:37 -04:00
Camotoy 26802e6dab
Translate CanPlaceOn/CanDestroy NBT (#1253)
* Translate CanPlaceOn/CanDestroy NBT

This commit adds support for the translation of the CanPlaceOn/CanDestroy NBT for Bedrock clients.

* Remove debug line
2020-09-14 20:50:07 -04:00
Camotoy 2f9ff0c622
ShulkerBoxItemTranslator: Ensure Items ListTag is present (#1221)
* ShulkerBoxItemTranslator: Ensure Items ListTag is present

* Compile
2020-08-30 00:18:23 -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 ad9184ad13
Update Adventure-Legacy dependency (#996) 2020-07-22 14:52:12 -04:00
RednedEpic 5ceb4145ac Fix fireworks (Closes #917) 2020-07-11 19:40:26 -05:00
rtm516 75f2891ec0 Fix map_uuid nbt type 2020-07-07 14:47:56 +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
RednedEpic da1674c8d6 Update to Cloudburst NBT 2.0 2020-07-05 15:59:44 -05: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
DoctorMacc ea1a9e5427 Bedrock 1.16 updating part 1 2020-06-22 20:11:09 -04:00
rtm516 a6f91d5e15
Fix maps not loading in sometimes (#758)
* Fix maps not loading in sometimes
Adds a default map ID so the map item isnt invisible on bedrock.
Respond to the MapInfoRequestPacket so the image loads on first join.

* Remove debug log

* Add comments
2020-06-15 14:24:52 -04:00
rtm516 1a92f6974c
Add byte conversion to allow int NBT values for Fireworks (#681)
Firework NBT data might be either an int or byte and bedrock only takes it as a byte.

Co-authored-by: Arktisfox <65837019+Arktisfox@users.noreply.github.com>
2020-05-28 11:38:23 -04:00
Arktisfox 0178492b59
Fix some book translation failures (#661)
Book pages can be sent as plain text rather than JSON. The text library doesn't use lenient parsing, so this fails, and the book isn't visible in the inventory.

This will convert the text into JSON if it's not already, before feeding it to the text library.
2020-05-25 21:19:37 -04:00
RednedEpic 6b68bbb413 Large refactoring to item translator and registry/util classes
- Merged ItemTranslator and ItemStackTranslator together.
- Split ItemTranslator into two classes: ItemTranslator and ItemRegistry. The registry is where items are registered, and the translator class is where item translation takes place.
- Made most of ItemTranslator's methods static and removed the initialization in Toolbox.
- Moved a handful of registry classes previously ending with 'Utils' to a 'Registry' class to be more fitting for the term.
- Moved inventory and block entity registration out of Translators.
- Renamed Translators to PacketTranslatorRegistry.
- Yeeted Toolbox.
- Minor cleanups and small refactors.
2020-05-24 20:07:05 -05:00
rtm516 3a39e9afee
Added Crossbow nbt translator (#590)
They still infinitely reload but they correctly track if they have data in now.
2020-05-24 15:51:30 -04:00
RednedEpic 56d84c24d3 Reduce nesting in item nbt translators 2020-05-24 14:21:06 -05:00
RednedEpic 6dabc22d22 Add null check for fireworks tag (Closes #636) 2020-05-24 13:20:38 -05:00
Camotoy fe6257bb38
Check if firework item explosions tag is null (#626) 2020-05-23 21:16:11 -04:00
rtm516 d8d9fb7190
Fireworks! (#579)
* Fixed firework entity

* Added firework item translator

* Fixed mappings submodule
2020-05-23 16:33:39 -05:00
rtm516 95b7055c10
Added map icons (#572)
* Added map icons

* Cleaned up and moved to enum
2020-05-16 23:58:00 -05:00
rtm516 919af5203d
Fix banner items loosing patterns in inventory (#560) 2020-05-14 19:41:42 -05:00
ForceUpdate1 87be8c378e
Fix Item Name and Lore (#443)
* add basic item translator

* add licence
remove debugs

* fix default lore
2020-04-29 10:58:29 -05:00
RednedEpic 59b2805a4a Fix NPE for unknown enchantments/enchantments not in bedrock 2020-04-23 02:09:40 -05:00