Commit Graph

119 Commits

Author SHA1 Message Date
ImDaBigBoss 36c49a7256
Custom item support for extensions (#2822)
Co-authored-by: Camotoy <20743703+Camotoy@users.noreply.github.com>
2022-07-02 12:50:16 -04:00
David Choo 9ea22042eb
Fix some item interactions (#3083)
* Remove Bedrock only banner patterns from the creative inventory

* Add sound for tadpole bucket

* Fix lily pad and frogspawn placing on mobile/single stacks

* Workaround? Fix? for bucket usage on mobile

* Simplify math and update position+rotation whenever ServerboundUseItemPacket is sent

* Rotate the player back after using an item and fix glass bottles

* ITEM_USE actionType 1 does not need the rotation fix

Increase delay for look back

* Add some checks

* Prevent buckets and spawn eggs from being unintentionally placed when interacting with special blocks

As of 1.19 Bedrock no longer sends a PlayerActionPacket with action=BLOCK_INTERACT. Bedrock now sends action=ITEM_USE_ON_START before and action=ITEM_USE_ON_STOP after using an item on a block. However, this is not useful as it is sent for all block interactions.

* Fix inventory transactions being rejected after restoreCorrectBlock

The held item's netId is always 0 in the InventoryTransactionPacket.

* Touch ups

* Fix lookAt for different poses and sneaking + cauldron + bucket interactions

Fix boat items being desynced when placing them very close to collision
Fix bottles being desynced when tapping above water

Resend the held item if we do encounter a desync

* Avoid getting blockstate twice and fix comment

* Use generated interaction data

* Fix glass bottles being double filled and phantom water bottles/water buckets

* Don't update the entire inventory on useItem

* Use Geyser's inventory copy for check

* Use ItemTranslator#getBedrockItemMapping to avoid NBT translation

* mappings

Co-authored-by: Camotoy <20743703+Camotoy@users.noreply.github.com>
2022-06-24 16:48:28 -04:00
Camotoy ddd2262380
Custom chat types at login are valid
Fixes https://github.com/GeyserMC/Geyser-Fabric/issues/55
2022-06-15 18:32:27 -04:00
ImDaBigBoss db003293e9 Merge master 2022-06-12 10:33:32 +02:00
Camotoy 162aff4978
Better handle chat packets sent before login 2022-06-10 10:27:07 -04:00
Camotoy 72a9df58e0
Properly support differently setup chat registries
ViaVersion has two entries in its fake chat registry that are not in the same order as Java. This commit supports that properly and renders subtitled text correctly.

Resolves #3023
2022-06-08 22:30:34 -04:00
ImDaBigBoss 4e2f74481b Updated to 1.19 2022-06-08 14:09:14 +02:00
Tim203 5fe24ac867
Merge remote-tracking branch 'origin/feature/1.19-bedrock' into feature/cumulus-1.1
# Conflicts:
#	core/src/main/java/org/geysermc/geyser/session/cache/AdvancementsCache.java
2022-06-07 00:14:43 +02:00
Tim203 86d0200960
Re-added the old sendForm methods 2022-06-06 10:03:39 +02:00
Camotoy 09fb6bf3ba
Fix direct connection and ensure connecting doesn't block 2022-06-05 18:38:29 -04:00
Tim203 94445a5222
Re-added the old sendForm methods 2022-06-06 00:25:45 +02:00
RednedEpic bcc68ee4b5 Update to latest MCPL changes 2022-06-05 13:12:36 -05:00
Camotoy 7a0a6795d0
Remove now-obsolete sign workaround. Yay. 2022-05-29 20:31:54 -04:00
Tim203 bd1cc26bf3
Use new Cumulus methods 2022-05-29 23:39:40 +02:00
Tim203 d4ecd2bd72
Merge remote-tracking branch 'origin/master' into feature/cumulus-1.1
# Conflicts:
#	ap/pom.xml
#	api/base/pom.xml
#	api/geyser/pom.xml
#	api/pom.xml
#	bootstrap/bungeecord/pom.xml
#	bootstrap/pom.xml
#	bootstrap/spigot/pom.xml
#	bootstrap/sponge/pom.xml
#	bootstrap/standalone/pom.xml
#	bootstrap/velocity/pom.xml
#	common/pom.xml
#	core/pom.xml
#	core/src/main/java/org/geysermc/geyser/session/cache/AdvancementsCache.java
#	core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaCustomPayloadTranslator.java
#	core/src/main/java/org/geysermc/geyser/util/LoginEncryptionUtils.java
#	pom.xml
2022-05-28 17:09:20 +02:00
Camotoy b10ce16506
The wild update experiment is no longer necessary 2022-05-27 22:44:03 -04:00
davchoo c5de293373 Allow 1.19.0 to join and use new block mappings 2022-05-25 21:50:50 -04:00
Camotoy 1a7b57018e
Chat messages now show up correctly. 2022-05-25 21:48:38 -04:00
Camotoy ebf18cfb28
Switch all Position instances to Vector3i 2022-05-25 19:17:49 -04:00
Camotoy bbf45b6a4c
Compiles; provide your own mappings for now 2022-05-25 15:55:15 -04:00
Camotoy 5339127105 Start work on 1.19 2022-05-24 16:16:40 -07:00
Camotoy b885e22fa3
Always show the world border at least five blocks away
Previously, no indication that the world border exists would show if warning blocks was set to 0.
2022-05-15 13:52:18 -04:00
David Choo b33cc512b4
Add custom skull render distance (#2751)
* Add player skull render distance

* Improve updateVisibleSkulls a bit

Avoid rechecking visibility on small movements

* Periodically despawn unused skull entities

* Don't hide skull entity for position/rotation changes

Prevents flickering for skulls that are rotating

* Update visible skulls when a skull is removed

* Only update on removal if an entity is assigned

* No need to check for skull in ChunkUtils

Update copyright year

* Avoid rechecking all skulls when a skull is added/removed

* Allow skull render distance and number to be configured

Renamed some fields to better match their values

* Compare texture property directly from GameProfile

* Remove unnecessary blockState field from SkullPlayerEntity

* Use binarySearch for insertion

Wait for player movement before loading skulls

* Allow culling to be disabled by setting max-visible-custom-skulls to -1

* Only remove skulls in inRangeSkulls when culling is enabled

* Add suggestions from review

* Merge the for loops in updateVisibleSkulls

* Fix skulls being leaked on chunk unload
2022-05-14 15:12:18 -04:00
RednedEpic fbaa6c1f5f Remove entity work from main extension branch for now 2022-05-07 10:11:21 -05:00
RednedEpic 59d5a6469c Add support for modifying identifiers through the AvailableEntityIdentifiersPacket
This is the first of many commits that address adding support for custom entities through the Geyser API.
2022-05-01 12:25:24 -05:00
RednedEpic f2e606c0f3 Rename HYBRID AuthType back to FLOODGATE 2022-04-24 11:42:17 -05:00
RednedEpic 43f23674d6 Merge branch 'master' into feature/extensions
# Conflicts:
#	ap/pom.xml
#	api/base/pom.xml
#	api/geyser/pom.xml
#	api/pom.xml
#	bootstrap/bungeecord/pom.xml
#	bootstrap/pom.xml
#	bootstrap/spigot/pom.xml
#	bootstrap/sponge/pom.xml
#	bootstrap/standalone/pom.xml
#	bootstrap/velocity/pom.xml
#	common/pom.xml
#	core/pom.xml
#	core/src/main/java/org/geysermc/geyser/configuration/GeyserJacksonConfiguration.java
#	core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java
#	core/src/main/java/org/geysermc/geyser/session/GeyserSession.java
#	core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockFilterTextTranslator.java
#	pom.xml
2022-04-24 11:23:26 -05:00
Konicai 03b067e23e
Merge master into extensions (#2941)
* Don't always store cert/client data used for skin uploaded

This takes up a decent 30K of memory that we don't use after the skin is uploaded. The GameProfileTranslator cannot be run more than once per session.

* Make all moon phases visible

The fix to prevent integer overflows also prevented moon phases from being visible until now.

Fixes #2927

* SetTimeTranslator: cast from long on the entire modulus

This should fix some inaccuracies with time on older worlds.

* Bump version; drop 1.17.40; support 1.18.30

* Actually bump to 2.0.3-SNAPSHOT

* Fix message being sent still if a single escape character is sent

* Replace instances of configs using `generateduuid` for Metrics

* Fix some merge mistakes

Co-authored-by: Camotoy <20743703+Camotoy@users.noreply.github.com>
2022-04-20 21:37:50 -04:00
Camotoy e923325246
Fix stonecutters for Bedrock 1.18.30
Also add an option in debug mode to not log pings in the event they're spammy.
2022-04-20 21:22:02 -04:00
Camotoy cf8114543e Bump version; drop 1.17.40; support 1.18.30 2022-04-17 19:53:06 -04:00
Camotoy cb8858fc42
Don't always store cert/client data used for skin uploaded
This takes up a decent 30K of memory that we don't use after the skin is uploaded. The GameProfileTranslator cannot be run more than once per session.
2022-04-11 15:44:15 -04:00
RednedEpic 9939a26a5b Add RemoteServer API 2022-03-19 21:55:29 -05:00
RednedEpic 02cda38259 Merge remote-tracking branch 'origin/master' into feature/extensions-gradle 2022-03-19 20:48:14 -05:00
Konicai f8e983887e
Add method in Connection API for transferring connections (#2891) 2022-03-18 18:59:32 -04:00
Camotoy 607e97f988
More descriptive disconnect messages for outdated Java servers 2022-03-18 10:51:22 -04:00
Camotoy 0829b5cd4e
Replicate Bedrock shield behavior more accurately
If the player swings, then they cannot be holding their shield at the same time.

Also fixes an animation edge case with other players.
2022-03-15 13:34:56 -04:00
Camotoy d0d01714aa Remove unlockedRecipes storage
This has been unused, and for the time being we aren't going the packet route that would use these.
2022-03-09 23:09:48 -05:00
Camotoy 9154a4571c Merge branch 'master' of https://github.com/GeyserMC/Geyser into feature/extensions 2022-03-06 20:35:04 -05:00
Camotoy 8388a4830e Simplify disconnection logging
A disconnect message will always be printed, but not more than once.
CLOSED_BY_REMOTE_PEER -> Bedrock client disconnected (hopefully slightly less vague)
If a message is sent from the server, the log will now indicate their disconnection reason.
2022-03-05 22:32:38 -05:00
Camotoy c977e36368
Deprecate userAuths in favor of a saved token system 2022-03-03 18:52:26 -05:00
turikhay d0220a9b71
Allow single-device Microsoft authentication (#2688)
By default, there is a two-minute delay if you disconnect so you can authenticate your Microsoft account.

Co-authored-by: rtm516 <rtm516@users.noreply.github.com>
Co-authored-by: Camotoy <20743703+Camotoy@users.noreply.github.com>
2022-02-26 15:45:56 -05:00
Camotoy 7d1ec5c41a
Support offhand interactions with entities 2022-02-24 22:49:10 -05:00
Camotoy 811ae178c9
Store recipes in a more compact GeyserRecipe type
This prevents us from storing some unnecessary data.

Also removes some 1.11 recipe compatibility code that is essentially unusable.
2022-02-21 16:11:51 -05:00
Camotoy 746cd94dd1
Fix villagers for 1.18.10
Includes working around pre-1.14 ONLY on pre-1.14 by checking the tags packet.

Fixes #2828
2022-02-10 20:14:52 -05:00
Camotoy 354e87b747
Merge branch 'master' of https://github.com/GeyserMC/Geyser into feature/extensions 2022-02-10 09:17:27 -05:00
Camotoy 2d28ba0cb5
Several inventory and parity improvements
These changes fix up things that were missed with Java Edition inventory changes in 1.17 and 1.17.1. Working with the inventory in modern versions should be much nicer.
2022-01-30 11:15:07 -05:00
Tim203 5ce2c113ae
Remove IPv6 scope if present 2022-01-28 13:08:10 +01:00
Tim203 3011d89db6
Update Geyser to use the latest features of Cumulus 1.1 2022-01-22 12:20:52 +01:00
RednedEpic 30303d5f16 Implement support for adding Geyser subcommands 2022-01-16 15:09:53 -06:00
Camotoy 8a93f6a116
Send the client render distance to the server
Previously we've had discussions on if the render distance math should be tweaked like we do server -> client, but for now this is better than nothing and can be tweaked further in the future.
2022-01-15 20:29:00 -05:00
Tim203 3251d9010c
We're in 2022 now 2022-01-01 20:03:05 +01:00
Camotoy 68c13c08fa
Fix some regressions in swim handling 2021-12-25 22:46:16 -05:00
David Choo 65aaa07493
Fix sneaking speed adjustment and bounding box (#2728)
* Fix sneaking speed adjustment and bounding box

Also remove redundant session variable in SessionPlayerEntity

* Add comment to valid field

* Hopefully fix crawling after swimming in water
2021-12-23 19:49:58 -05:00
Camotoy 4c409f98f3 Properly implement piglin/hoglin dimension safety
Whether they shake or not is now controlled by the server, as implemented in Java Edition.
2021-12-20 22:54:34 -05:00
David Choo 754bb42c19
Fix some mount offsets and strange behaviors with GSit (#2701)
* Prevent boats from floating when a Bedrock player rides in the back

* Update llama and shulker mount height offset

* Fix Trader llama mount offset

* Change passengers to an IntList

Also move rotation lock stuff to EntityUtils

* Allow EntityCache.getEntityByJavaId to return the session's player

Removes many checks from several translators.

* Fix mount offset on armorstands and area effect clouds

Also prevent area effect clouds from despawning when used as an invisible entity (used in GSit to offset players riding on other players)

* Update mount offsets on height changes

TODO test this

* Actually update vehicleId and optimize StriderEntity metadata update

* Don't hide marker armor stands and properly update mount offsets

* What?

* Remove y offset for Shulkers riding other entities

* Confirm teleports in the order received

This allows Bedrock players to move after standing up when using GSit

* Fix mount offset for riders on baby zoglins

* Cache only the latest teleport and confirm teleports immediately

* Fix crawling with GSit

* Inline var and undo respawn method

* Use Entity reference for vehicles

* Remove ridingVehicleEntity from GeyserSession

* Use Entity references for passengers and drop cachedPlayerEntityLinks

* Reuse variable and remove setVehicle(null)
2021-12-18 11:43:57 -05:00
Luke 8c7a3d1822
Show the nether fog when using the nether height workaround (#2663) 2021-12-08 13:23:05 -05:00
David Choo ad5a98c859
Improve Statistics Form (#2667)
* Improve statistics form

Fix furnace minecart java identifier
Use clean Java identifier in times mined
Fix icons for statistic form

Show all generic statistics by initializing them to zero
Color every other line grey
Format numbers like on Java Edition

* Update for Java 16 and MCProtocolLib changes

* Sort all statistics alphabetically and color them.

* Update for MCProtocolLib changes

* Re-add clean java identifiers registry and properly fix block break statistics

Also translate before sorting >.>

* Use toLowerCase(Locale.ROOT)

* Use the format provided by MCProtocolLib

* Simplify condition

* Move statistics init and bump MCProtocolLib version
2021-12-07 20:05:44 -05:00
Camotoy 9084c59003
Fix regressions in player movement handling 2021-12-02 19:56:12 -05:00
Camotoy d1f3032249
Remove extra println 2021-11-30 11:20:48 -05:00
Camotoy 7df013daf9
Merge remote-tracking branch 'origin/feature/floodgate-data-version' into feature/1.18 2021-11-30 11:09:16 -05:00
Tim203 091664e000
Removed time checker and added a header version system 2021-11-30 16:32:44 +01:00
Camotoy 51330b8cda
Some changes for GeyserConnect 2021-11-29 22:04:02 -05:00
Camotoy 404613520f Merge branch 'master' of https://github.com/GeyserMC/Geyser into feature/1.18 2021-11-26 11:13:33 -05:00
Camotoy cef803af36 Update for PacketLib changes 2021-11-24 23:38:21 -05:00
Camotoy 41ecb885bd
Merge branch 'master' of https://github.com/GeyserMC/Geyser into feature/1.18 2021-11-22 22:47:58 -05:00
Camotoy 5acd9cd2c5
Some missed name changes 2021-11-22 22:14:41 -05:00
Camotoy 966c2155ad
API: change player class to Connection 2021-11-22 14:52:26 -05:00
RednedEpic 83ddbd7d1a Initial api draft 2021-11-21 12:36:42 -06:00
RednedEpic 2c663e0ee5 The Great Refactor Part 3 - Entire project restructure 2021-11-20 17:29:46 -06:00
Renamed from core/src/main/java/org/geysermc/geyser/network/session/GeyserSession.java (Browse further)