Commit Graph

721 Commits

Author SHA1 Message Date
Camotoy 2d9baf1bfc
Send message to Java if command is Bedrock-only (#1834)
* Send message to Java if command is Bedrock-only

If a Java player attempts to use a Bedrock-only command, such as `geyser statistics`, they will get an error message stating that this command is only for Bedrock players.

This commit also cleans up Velocity Adventure dependency usage. Issues were caused because of the way relocation works and because Velocity also uses Adventure.

* Only look for a session if we have to

* Update languages submodule
2021-01-16 22:18:13 -05:00
YHDiamond fb283fcce8
Add advancements GUI (#1579)
Using /geyser advancements, Bedrock clients can get a visual on their progress.

Co-authored-by: yehudahrrs <47502993+yehudahrrs@users.noreply.github.com>
Co-authored-by: Olivia <chew@chew.pw>
Co-authored-by: rtm516 <rtm516@users.noreply.github.com>
Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
Co-authored-by: rtm516 <ryantmilner@hotmail.co.uk>
Co-authored-by: Camotoy <20743703+Camotoy@users.noreply.github.com>
2021-01-11 21:23:09 -05:00
rtm516 1c0cc4622a
Microsoft account authentication (#1808)
Microsoft accounts can now use Geyser, while maintaining full backwards compatibility with Mojang accounts.

Co-authored-by: Camotoy <20743703+Camotoy@users.noreply.github.com>
2021-01-11 15:52:02 -05:00
Camotoy ade4c14911
Block breaking refactors (#1336)
Client-side block animations and reach checks are now added.

This commit also includes cleanup in BlockChangeTranslator as well as proper Netherite tool support for calculating block breaking.

Co-authored-by: rtm516 <rtm516@users.noreply.github.com>
2021-01-07 22:43:36 -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 0641800be7
Add Tickable interface (#1790)
* Add Tickable interface

By having a tickable interface, we're only dedicating one thread to ticking entities and running tasks as opposed to several. This will also help with implementing world border support.

* removeEntity already clears tickableEntities for us

* Only tick the entity if it's not being ticked
2021-01-05 18:41:20 -05:00
Camotoy 50b80a64d3
Dimension switching cleanup (#1694)
* Dimension switching cleanup

Cleans up dimension switching logic that should no longer be needed. Also fixes above Nether Bedrock building dimension switching.

* Clear thunder on dimension switch too

* Clarify fake dimension switch function name

* Javadoc that
2021-01-03 19:06:20 -05:00
YHDiamond 1a08e1104d
Fix stopsound bug (#1771)
* Fix stopsound not working bug

* removed extra imports

* Update JavaPlayerStopSoundTranslator.java

* Update JavaPlayerStopSoundTranslator.java

* Update JavaPlayerStopSoundTranslator.java

* Fix packet names and fix specific sounds not stopping

Co-authored-by: YHDiamond <47502993+yehudahrrs@users.noreply.github.com>
Co-authored-by: Camotoy <20743703+Camotoy@users.noreply.github.com>
2021-01-02 18:51:41 -05:00
Camotoy 396d1b6b61
Fix items on campfires (#1779) 2021-01-01 18:33:21 -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 77153e6d4a
Work around there being a void floor in Bedrock (#1405)
* Work around there being a void floor in Bedrock

If the player's Y coordinate is -38 or below, we teleport the player below the void floor and they can safely die. :)

* Don't teleport if below Y -40

* sigh

* Have floorY be its own variable

* Add more comment

* More comments

* Finish my thought
2020-12-31 20:05:00 -05:00
David Choo fe63a7f7ab
Fix pick block (#1753)
* Use pick_item mappings

* Update mappings

* Update mappings and fix wording
2020-12-29 18:09:42 -05:00
Camotoy d1c571d710
Fix anvil renaming (#1744)
Turns out it *was* our fault. Oops.
2020-12-26 19:51:11 -05:00
Camotoy eb5e4d79bb
Add visual damage support with thorns (#1728) 2020-12-26 15:39:46 -05:00
Camotoy dbfdae63f1
Add precautions to prevent stack traces on incomplete/unknown place sounds (#1717) 2020-12-20 20:42:14 -05:00
Camotoy b490dcfcbb
Improve doDaylightCycle translation (#1711)
Previously, we wouldn't send the time if the server was sending the same time with doDaylightCycle on. However, this isn't vanilla behavior (for Bedrock nor Java) and can occasionally cause irregularities. The time is now always sent to Bedrock clients, and a daylightCycle field is added to GeyserSession to keep track of the doDaylightCycle gamerule we need to send to Bedrock. Removing the map we used to store the time may also improve memory usage since this was never cleaned up.
2020-12-20 20:41:07 -05:00
Camotoy d69896b381
Fix NPE when no item can be found from a block (#1718)
This commit also removes an old map previously used for block entity translators
2020-12-20 20:40:21 -05:00
Camotoy c92150013f
Allow /help to work even if command suggestions are disabled (#1703)
* Allow /help to work even if command suggestions are disabled

This sends a minimal available commands packet to permit /help sending to the server.

* Fix whitespace

* Just send an empty packet

* Change variable name
2020-12-17 14:10:58 -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 988fd66a85
Fix boat movement on land (#1668)
* Fix boat movement on land

1.16.100 appears to now take advantage of two newer entity metadata properties, IS_BUOYANT and BUOYANCY_DATA. Without the former, moving on land will not work properly. With the former and without the latter, moving in water no longer works.

* Use offset kind of
2020-12-15 13:09:40 -05:00
Camotoy aed1eef6e1
Update Adventure and fix some legacy hover events (#1681) 2020-12-15 11:24:02 -05:00
Camotoy 8b5ef7478c
Fix PS4 behavior with NetworkStackLatencyTranslator (#1678) 2020-12-14 15:47:17 -05:00
RednedEpic 70031c65e7 Handle keepalives better (Closes #965)
Bedrock cuts off the last 3 digits consistently every time, meaning that the keepalive returned from bedrock is never fully accurate. However, if we multiply the value by 1000, then divide by 1000 when sending back to java, the proper value is returned.
2020-12-12 00:45:41 -06:00
RednedEpic a60ab4e80e Fix colored particles (Closes #1627) 2020-12-11 17:15:49 -06:00
Camotoy 8e274daa75
Change default protocol version to 422 (#1640)
* Change default protocol version to 422

* Update Protocol

* Actually update to Protocol 2.6.1-SNAPSHOT

* Keep languages commit the same
2020-12-09 11:30:59 -05:00
D3ATHBRINGER13 3bcdf4cca1
Add map and banner cloning and map extending (#1623)
* Add all the crafting multi uuids

* Remove BANNER_ADD_PATTERN

* Remove TODO
2020-12-07 14:27:42 -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 f6a26410da
Supply a unique network ID for each recipe (#1615)
This fixes crashes in the Minecraft betas.
2020-12-02 15:39:24 -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
rtm516 eb687e6638
Add check to fix NONE team color causing an NPE (#1602) 2020-11-28 15:10:19 +00:00
rtm516 da2dc69441
Update MCProtocolLib to Adventure migration (#1572)
* Use raw message data instead of converting the message

* Update MCProtocolLib to Adventure

* Ignore MCProtocolLib Adventure depend

* Remove unused dependency

* Fix isMessage handling `null` wrong.

* Update to adventure 4.2.0

* Clean-up isMessage

* Fix tests

* Clean-up of catch statements
2020-11-27 18:28:08 -05:00
Camotoy 11d9d30050
Fix mounts being unmountable with cache chunks (#1576)
Teleports need to be confirmed before riding
2020-11-27 17:56:32 -05:00
rtm516 0268ef7d2b
Clean-up translation string implementation (#1567) 2020-11-21 00:44:33 +00:00
circuit10 a70d3e2150
Fix inconsistencies with movement and position (#699)
Movement is now significant better, especially on slabs, stairs, and other half-blocks.

Co-authored-by: RednedEpic <redned235@gmail.com>
Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
Co-authored-by: Tim203 <mctim203@gmail.com>
Co-authored-by: Camotoy <20743703+DoctorMacc@users.noreply.github.com>
2020-11-20 14:56:39 -05:00
rtm516 4297215420
More chat fixes (#1557)
* Fix positional translation arguments not being handled

* Fix locale fallback

* Fix command completion

* Remove the expensive call to `containsKey`

* Unify adventure versions

* Fix some more formatting issues due to parity

* Fix and update tests

* Update adventure

* Add Javadoc for getCommandNames

* Formatting

Co-authored-by: Camotoy <20743703+DoctorMacc@users.noreply.github.com>
2020-11-18 23:18:36 +00: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
RednedEpic 981ac3bf11 Move PlatformType to common module 2020-11-14 17:49:56 -06:00
Camotoy e748240a02
Add more interactive tags (mobile buttons) (#1443)
* Add more interactive tags (mobile buttons)

This expands our support for showing the interactive tags on touchscreen and console setups. This is not complete - specifically, the food compatibility of creatures needs to be expanded upon (I will work on this later and does not stop this PR from being mergable). This also includes:

- Creepers who are ignited with flint and steel now show up properly
- Zombie villagers now shake properly when converting and show their region outfits

* Add more food choices and add more panda entity metadata

* Re-add eating flag

* Remove debug line

* Refactor dimension usage, finish interactive tag usage, bees

* Print statements... ._.

* Don't make eating item packet data a non-constant

* Move BAMBOO to ItemRegistry

* Add missing break

* Make changes

* Minor final changes
2020-11-11 19:28:45 -05:00
rtm516 3676dd185f
Fix even more entity metadata flags (#1483)
* Fix even more entity metadata flags

* Add comment explaining magic value

* Fix horse flags and add more information

* Add more information about the Horse eating particles
2020-11-11 18:13:13 +00:00
David Choo 4237503d6d
Fix laying crash (#1510)
* Fix crash with GSit lay and use Java bed position data

* Fix GSit's lay position

* Move Bed Position metadata to the right class

* Actually fix lay for PosePlugin

* Revert "Actually fix lay for PosePlugin"

This reverts commit 3f21261162.

Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
2020-11-10 12:05:16 -05:00
Tim203 e00715ceab
Fixed some issues related to Scoreboards (#1446)
* Fixes some issues related to Scoreboard Teams

* The cached Score info should update no matter what kind of update the Team got.
* Team entities specified at the create Team packet should also be checked if they exist as Score in the registered Objectives

* Rewrote some Scoreboard code and fixed various issues

* Minor formatting changes
2020-11-09 10:34:27 +01: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 434a2e1500
Fix bell sound and visuals (#1502)
* Fix bell sound and visuals

The bell sound now correctly plays.

Bells will also visually ring when rung by another player.

* Compress elses

* Add more whitespace to new code
2020-11-05 14:59:01 -05:00
David Choo ce64dd2788
Fix sitting with armor stand and animal mount offsets (#1492)
* Fix sitting with armor stand and animal offsets

* Fix riding players

* Moved @Getter
2020-11-04 20:30:55 -05:00
Camotoy 69d4d9f0d6
Send position update every 3 seconds if idle (#1421)
* Send position update every 3 seconds if idle

Prevents timeouts in certain instances when AFK.

* Cancel position sending on dimension switching

* Remove debug lines

* Create function to centralize movement translation
2020-11-02 16:04:08 -05:00
Camotoy 3e0d898b6a
Update to 1.16.4 (#1487)
* 1.16.4-pre1 support

* Update to support ViaVersion 3.2.0 (#1358)

* Update to support ViaVersion 3.2.0

This commit updates ViaVersion integration to support their recent mappings changes. 

Co-authored-by: Nassim <jahnke.nassim@gmail.com>

* Send adventure settings on gamemode change after gamemode swap

* Update Velocity to 1.1.0 proper

* Update to 1.16.4

Co-authored-by: Nassim <jahnke.nassim@gmail.com>
2020-11-02 13:28:31 -06:00