Commit Graph

786 Commits

Author SHA1 Message Date
DoctorMacc 269e72c943
Merge branch 'master' of https://github.com/GeyserMC/Geyser into feature/addons 2020-10-20 22:21:20 -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 b02bc33393
GeyserSession: Set a default value for attackSpeed (#1419)
Fixes cooldowns not showing on a fresh world.
2020-10-19 19:03:31 -04:00
David Choo 5c28eaca15
Fix mob mount positions (#1392)
* Fix mob mount positions

Uses offsets from Java Edition.

* Fix Boat mount pos for multiple passengers and Fix Ravager

Remove unnecessary horse metadata

* Fix Minecart & Boat Mount Pos, Fix Player Height Offset

* Use offset of EntityType.PLAYER

* Add back metadata
2020-10-17 23:50:41 -04:00
Camotoy ae70dbeece
JavaOpenWindowTranslator: Use MessageUtils for inventory name (#1416)
* JavaOpenWindowTranslator: Use MessageUtils for inventory name

* Remove important messaging
2020-10-17 23:13:04 -04:00
DaPorkchop_ 7d2745dee6
Faster chunk conversion (#1400)
* BlockStorage is never used concurrently, no need to synchronize

* initial, semi-functional, faster chunk conversion

* faster chunk conversion works well for every situation except spigot

* delete unused ChunkPosition class

* preallocate and pool chunk encoding buffers

* make it work correctly on spigot

* make field naming more consistent

* attempt to upgrade to latest MCProtocolLib

* remove debug code

* compile against my MCProtocolLib fork while i wait for my upstream PR to be accepted

* return to Steveice10 MCProtocolLib
2020-10-15 01:30:25 -05:00
RednedEpic 40de801eb0 Add sound when an arrow hits a player 2020-10-15 01:21:44 -05:00
Tim203 2ca2436cdc
Don't use the general thread pool to run an async method (#1397)
* Don't use the general thread pool for an async method

* Align nested class at the bottom
2020-10-14 23:34:24 -04:00
DaPorkchop_ 73bec588fa
fix some NPEs caused by race conditions in chunk conversion (#1396)
* fix some NPEs caused by race conditions in chunk conversion

tbh the whole session should be read-write locked for every operation

* fix code style issues
2020-10-13 11:11:52 -04:00
DaPorkchop_ 191777773c
Don't use wrapper objects for positions in ChunkCache (#1398)
* make ChunkPosition use a hashCode implementation with far better hash distribution

this should improve the performance when used as a hash table key

* ChunkCache no longer uses position wrapper objects

this yields a roughly 15-20% increase in performance when converting chunk data

* fix code style issues
2020-10-13 15:44:47 +01:00
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 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 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
Arktisfox 16eb2a491a
Area cloud fixes (#684)
* Fix NotNull error with particles, replace incorrect string meta with int meta.

* Add back newline

* Remove debug line

* Update Protocol and prepare for merge

Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
2020-10-08 18:33:36 -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 ba6f174058
Add support for fishing rods pulling Bedrock players (#1355)
Fishing rods pulling players is a clientside feature on Java. On Bedrock, a SetEntityMotionPacket is sent to the client. Therefore this PR implements the Java fishing rod pulling mechanics and sends it off to Bedrock, which sends MovePlayerPackets that are sent to the server.
2020-10-02 15:44:46 -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 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 aee9ccc7d2
DoorSoundInteractionHandler: ignore iron [trap]doors (#1343) 2020-09-29 13:21:43 -04:00
Camotoy 9bb52afc8a
BedrockRespawnTranslator: prevent some respawn bugs (#1346) 2020-09-29 13:21:25 -04:00
Camotoy a5b00e09a1
Villager trade fixes (#1350)
This commit mainly focuses on fixing the crashing of villagers that occurred pre-1.14.

Co-authored-by: AJ Ferguson <AJ-Ferguson@users.noreply.github.com>
2020-09-29 13:19:37 -04:00
rtm516 7c49391b9d
Fix gamemodes not fully applying on server switch (#1348)
* Fix gamemodes not fully applying on server switch

* Revert previous commit and move session flag updating to the adventure settings method
2020-09-28 17:43:50 -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 b4c7682130
Implement experience sounds (#1320)
Bedrock sends a level event for the experience sound around the same time as a Java entity collect item packet is sent.
2020-09-22 14:16:57 -04:00
Camotoy 2dc7dc10ff
Remove warning about slot 50 (#1325)
We know that it occurs with console crafting.
2020-09-22 14:15:59 -04:00
Camotoy 2db1d16f5c
Only send the client brand on game join (#1299)
* Only send the client brand on game join

* Apply suggested changes
2020-09-21 16:06:25 -04:00
rtm516 99e72f35b3
Add support for manually supplying Bedrock resource packs (#1076)
* send resource packs

A lot of this code is nukkit-credits in the classes

* send resource packs

A lot of this code is nukkit-credits in the classes

* Remove unnecessary code/debugs

* use separately generated hashes

* Updated mappings and added .mcpack support

* "packs" directory auto-create (#484)

* "packs" directory auto-create

* cleaned indentation in ResourcePack.java

* Cleaned ResourcePack.java

* Another cleanup

I hate editor on github.

* Yet another

* Another indentation cleanup

* Fix resource pack loading

(cherry picked from commit f93b07491e)

* Move back to internal sha256 hashing

(cherry picked from commit 812a3d82b2)

* Add resource pack loading back after merge

* Add comments, config option and removed unused files

* Fix packs folder location and cleanup code

* Move to better options for the client

* Fix typos in comments

* Fix pack loading

* Try to make it compile

* Final touches?

* Add Javadoc for MathUtils#constrain

Co-authored-by: EOT3000 <43685885+EOT3000@users.noreply.github.com>
Co-authored-by: Vesek <61123478+Vesek@users.noreply.github.com>
Co-authored-by: Heath123 <heath.mitchell27@gmail.com>
Co-authored-by: Camotoy <20743703+DoctorMacc@users.noreply.github.com>
2020-09-16 20:08:26 -04:00
Camotoy 3c1d4aae93
Fix inconsistencies with players and the player list (#1298)
* Fix inconsistencies with players and the player list

This commit makes the player list entry packet control the player cache, fixing inconsistencies that appeared when removing the override on despawning the player.

* Update comments
2020-09-16 00:18:18 -04:00
Camotoy f9c1d3f218
Remove Protocol v409 support (#1300)
* Remove Protocol v409 support

Protocol has dropped support for this version.

* Fix movement

* Use a static commit for Protocol
2020-09-16 00:11:56 -04: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 f5a9254fae
Disconnect player if Java sends disconnection (#1274) 2020-09-14 20:53:47 -04:00
Camotoy 9c8eb00cd5
JavaCollectItemTranslator: check null for entities (#1267) 2020-09-14 20:52:50 -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 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 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 d47360d6fb
GeyserSession: send command permission level OPERATOR if qualified (#1254)
Mobile clients have a GUI for commands that shows if CommandPermission.OPERATOR or higher is sent. The commands present all require OP permission 2 or higher; therefore we set that command permission if the server tells us we have a OP permission level of 2 or higher.
2020-09-05 16:22:31 -04:00
Camotoy 5b76a85895
Non-full-chunk support (#574)
This commit adds non-full chunk support if chunk caching is enabled.
2020-09-03 19:00:36 -04:00
Camotoy 4f761c5bde
Translate scoreboard nametag visibility (#1240)
This commit adds support for name tag visibility in teams. If a player is set to hide their nametag, it will be hidden from the Bedrock client. Notably, this fixes most NPC nametag hiding, including Citizens. This does not fix some NPC nametag hiding - there are several NPCs in Hypixel that still have a nametag show up, and they are not a part of any team.
2020-09-01 23:39:14 -05: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 6f161a380f
GeyserSession: Always set Keep Inventory to true (#1213)
* GeyserSession: Always set Keep Inventory to true

This prevents the client from removing items on death in creative mode if Keep Inventory is true, but doesn't break existing behavior. Essentially, this assures full server-side behavior of the inventory during death.

* Small comment update

* OK, it was fine before the last commit, but make it better
2020-09-01 23:37:24 -05:00
Camotoy d717085c6b
JaveNotifyClientTranslator: Translate invalid bed message (#1212)
This isn't sent as its own message but as a specific event.
2020-09-01 23:36:53 -05: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
RednedEpic 37c4192c12 Show the supported Bedrock versions in the version command rather than just the default codec 2020-08-28 19:11:32 -05: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
Tim203 1c84993853
Scoreboard improvements (#1166)
* Added a way to check if debug logging is enabled

* Improved scoreboard performance

* Include Teams in pps and return pending pps instead when higher then pps

Some servers have a huge amount of score packets when the player logs in, but before this commit, only after the first high pps (packets per second) the ScoreboardUpdater will be used (after pending packets per second have been moved to packets per second). But this commit fixes that the ScoreboardUpdater can be used on the second that the pps is getting high.

* Fixed team pre + suffix "null" issue and added threshold config option

Fixed team pre + suffix "null" issue.
When the prefix and/or suffix of a Team is null, "null" will be returned instead of null (Due to the way that MCProtocolLib is made and designed). This is fixed by simply checking if the prefix and/or suffix equal "null" and if that is the case, replace it with "".

Added threshold option.
Gave the person who is running Geyser an option to specify the first Scoreboard packets per second threshold to further improve performance by lowering the setting or decrease performance by relaxing the setting a bit. The value can't be higher then 250 (the second threshold), because it'll always choose the lowest threshold.

* Forgot to bump config version

* Small changes

* Reverted version bump, changed Sponge config, changed FloodgateKeyLoader

Reverted version bump
Camotoy said that you only need to bump the config version if the change is breaking, the config version bump has been reverted.

Changed Sponge config
The Sponge config has been modified to look like the other platform configurations.

Changed FloodgateKeyLoader

* Changed default-locale and (remote) address as requested by Camotoy

* Reduce bandwidth and a few final tweaks

* Made the scoreboard-packet-threshold a bit higher due to improvements
2020-08-28 10:47:52 -05:00