Commit Graph

88 Commits

Author SHA1 Message Date
Camotoy bc0cfde8f9
Set the minimum Java version to 16; drop Bedrock 1.17.0 (#2477) 2021-09-10 14:10:56 -04:00
Camotoy da66a01a9a
Fix possible NullPointerException in handling CanBreak/CanDestroy items 2021-07-23 21:28:28 -04:00
Camotoy 11f048a065
Better logic for item updating on item entities
Specifically created to address InteractionVisualizer updating all metadata properties when updating the nametag - this commit prevents the item from jumping on updating. It also prevents the entity from being respawned if just the stack size updated.
2021-07-22 09:16:19 -04:00
RednedEpic ff280ef192 Replace Reflections usage with an annotation processor
Reduces jar size by about 1.5-2mb
2021-07-17 13:36:04 -05:00
Redned f7ef90278b
Implement a new registry system (#2306)
Co-authored-by: Camotoy <20743703+Camotoy@users.noreply.github.com>
2021-07-12 21:19:40 -04:00
Camotoy 65c52f9ff0
Fix fishing rod durability (fixes #1964) 2021-06-21 18:51:43 -04:00
Camotoy 3a2cff7864
Clean up a bunch
Mostly checked with IntelliJ, but manually performed. The only issue I possibly anticipate is item name/lore issues, but the new method should be technically better.
2021-06-20 21:42:22 -04:00
Camotoy fc4f2b7890
Remove usage of translation strings for code-related errors
These should never ever be seen by a normal user, and if so, developers need to see the proper error message
2021-06-06 09:35:56 -04:00
Camotoy e7f933ba6c
Show proper names for Java-only items (#2159)
Spectral arrows and knowledge books, if unnamed, will now show their correct, translated names.
2021-04-26 14:44:16 -04:00
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 ded00dfd97
Merge branch 'master' of https://github.com/GeyserMC/Geyser into server-inventory 2021-03-09 14:45:04 -05:00
Camotoy 9ae7c1de25
1.16.210 support (#2019)
This commit implements 1.16.210 support while still keeping 1.16.100 and 1.16.210 compatibility.

Co-authored-by: AJ Ferguson <AJ-Ferguson@users.noreply.github.com>
Co-authored-by: rtm516 <rtm516@users.noreply.github.com>
2021-03-09 12:51:48 -05:00
Camotoy 7e773c9970
Quietly handle unmappable Java items
If vanilla can handle them, so can we.
2021-03-02 19:10:17 -05:00
Camotoy e0bd5a62a7
Fix up some SpotBugs suggestions (#1911)
This is a manual go-through of some bugs SpotBugs pointed out.
2021-02-16 16:25:46 -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 ffd0c211fc
Fix villagers accepting books (#1605)
* Hopefully fix villagers accepting books

Fixes a couple of inconsistencies getting books from the creative menu.

* Fix fake news
2020-11-30 10:55:35 -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
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
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 045c0e0637
Introduce CommandSender.getLocale() (#1431)
* Introduce CommandSender.getLocale()

This allows Geyser-specific commands (e.g. `/geyser help`) to be displayed in the (Java or Bedrock) player's default language, which stops those commands from simply being displayed in the default locale.

* Tweak Javadoc

* Set CommandManager's GeyserConnector to final

* Clean up
2020-10-29 18:30:52 -04:00
Camotoy 172a5a6db8
Add Fabric as a platform type (#1376)
* PlatformType: Add Fabric as a platform

* Don't use XML reflections on Fabric
2020-10-07 18:51:36 -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
rtm516 79bf56a75c
Tweaks to support Android (#1206)
* Downgrade reflections to 0.9.11

* Add comment explaining downgrade

* Move to pre-build reflections

* Update skins to use https and relative cache dir

* Move to https OptiFine cape url

* Add javadoc to isProduction

* Add ANDROID as a platform type

* Re-ordered PlatformType

* Change stop command to call onDisable
2020-08-28 19:36:24 +01: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
rtm516 b10e5d5af3
Clean copyright message and update all files (#1053) 2020-07-30 15:10:15 -05:00
Camotoy ad9184ad13
Update Adventure-Legacy dependency (#996) 2020-07-22 14:52:12 -04: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
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
DoctorMacc f9760b721c Don't process the display tag if it's empty 2020-07-07 08:30:11 -04: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
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
AJ Ferguson e77f2b5dbb Drop long array nbt tag when translating to bedrock 2020-06-29 10:59:51 -08:00
DoctorMacc ea1a9e5427 Bedrock 1.16 updating part 1 2020-06-22 20:11:09 -04:00
rtm516 ad4c1ff0c7 Update Message system 2020-06-19 11:57:34 +01: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
DoctorMacc 4c5d80e2e9 Update to latest master 2020-06-05 22:52:11 -04:00
rtm516 a91eaa7821
Add item name translation (#559)
* Added item name translation

* Change to more appropriate NPE catch

* Remove whitespace

* Switch from try/catch to null checking

* Update mappings

Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
2020-06-02 16:33: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
Camotoy 59da87a10f
Merge entity mounts branch to master (#589)
* Initial support for entity mounts*

* This only works for viewing other players on mounts/vehicles. Currently, mounting on vehicles through Geyser with bedrock does not work at all, though, you can see other Java players on mounts just fine.

* Fix Bedrock player mounting; add minecart offset

* Remove debug code

* Fix boat animation

* Remove debug code

* Add notice of possible steering flip

* Add translator for PlayerInputPacket

* Upload WIP code for BoatEntity.java

* Add animation for rowing on Bedrock side

* Clean up debug code, start on boat movement

* Add notice about flying horses

* Rename BedrockPlayerInputPacket.java to BedrockPlayerInputTranslator.java

* Delete BedrockPlayerInputPacket.java

* Use Translator Annotation again; Thanks to LegacyGamerHD

* Upload ineffective mount-on-login code

* Upload current changes with no debug code

* Change case where applicable

* Change Integer[] to int[]; Change schedule() to execute()

* Don't use Thread.Sleep() and instead call itself again

* Fix players not being linked on login/chunk load

* Little changes

* Minor improvements/fixes to boats

* Remove empty file

* Fix horse flying.

* Various entity mounting fixes

* Add mounting offsets for skeleton and zombie horses

* Another round of entity mount-related fixes

- Add offsets for skeleton and zombie horses (Thanks to tester DirtNasty)
- Boats can now be placed in survival (Thanks again to tester DirtNasty)
- Boats and minecarts can now shake

* Add translating for ServerVehicleMovePacket

* Cleaning up

* More cleaning up

* Add interactive tag support for mountable entities

* Boats move far more nicely

* Add horse heart visuals

* Update interactive tags

Co-authored-by: RednedEpic <redned235@gmail.com>
2020-05-23 16:39:17 -05:00
RednedEpic 30e38b3a2f Add basic villager trading support (incomplete)
This commit implements basic functionality for villager trading. This is still incomplete and is buggy in areas such as with villager trades that have more than one input and trade inputs and outputs containing NBT.

Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
2020-05-16 23:52:39 -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
OnlyBMan e82adf2cf9
Implement shield blocking (#395)
* basic shield blocking

* Offhand works

* Add Shield as id in BlockTranslator

* Change Block Translator to Item Translator

* Fix formatting

Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
Co-authored-by: Redned <redned235@gmail.com>
2020-04-24 22:11:28 -05:00
ForceUpdate1 733ec2a0ec
Implement Updated Item Translator (#388)
* add item translator

* add item translator

* add nbt item translator

* fix empty list tags

* formatting code

* use Int2ObjectMap
remove session

* rename annotation
2020-04-22 16:26:16 -05:00
DoctorMacc d7b8f08899 Fix piston/sticky piston (among others) not being able to be retrieved in creative 2020-04-15 15:24:57 -04:00
RednedEpic 1cb2e658e0 Merge branch 'master' into inventory 2020-04-14 23:40:50 -05:00
rtm516 76e29af6b8
Fixed map name 2020-04-12 01:45:31 +01:00
MrPowerGamerBR d635939c5b Add map item translators 2020-04-05 00:48:53 -05:00
MrPowerGamerBR de37046466 Add map item translators 2020-04-04 17:23:02 -03:00