Commit Graph

168 Commits

Author SHA1 Message Date
Kas-tle a9467cf150
Temporary bad fix for command crashing (#4490)
Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>
2024-03-13 02:54:39 -07:00
chris 0ad7c4325d
Fix: Workaround for recipes involving custom items to show up in the recipe book (#4484)
* Allow adding custom items to the creative inventory in order for recipes outputting said custom items to work

* yeet includeInCreativeInventory as it would break existing nonvanilla extensions - and is pretty pointless anyways

* rename mappings to `creative_group` and `creative_category`

* delete outdated comment
2024-03-10 23:38:38 +01:00
Kas-tle 527eab0b58
Cap render distance at 96 (#3530)
Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>
Co-authored-by: onebeastchris <github@onechris.mozmail.com>
2024-03-09 04:51:32 +01:00
chris 79154f3d0c
Fix: Lecterns not opening when there is no lectern cache (#4476)
... the LecternCache doesn't always exist. Oops.
2024-03-04 00:39:57 +01:00
chris 5d95bf65a6
Fix lecterns on 1.20.60, add support for virtual books (#4471)
* Fix lecterns on 1.20.60, start on virtual lecterns

* Fix: virtual books & actual books opening twice, resolve other issues, remove debug

* undo some unnecessary diff

* Don't try to send virtual books to pre 1.20.60 clients

* address review by camotoy
2024-03-02 03:21:31 +01:00
chris f555dc0a92
Feature: Camera/Input locking API (#4332)
Adds API methods to control player cameras - including fancy transitions,  color fades, or simple input locks.
2024-01-31 11:21:06 +01:00
rtm516 07150db592
Fix language key typo when floodgate encryption fails (#4412) 2024-01-28 22:49:47 +00:00
chris 46bde0c019
Fix: protocol being null during online mode login (#4369)
* fix: protocol being null during online mode login

* gimme more space

* add debug logging for too early downstream packet sending
2023-12-31 02:24:44 +01:00
Konicai 701e567818 Enable 1.21 experimental features 2023-12-14 21:31:14 -05:00
Konicai f38d82c19c Drop <1.20.50 2023-12-14 21:31:14 -05:00
chris 95d65350e4
Project wide syntax/annotation cleanup (#4238)
Co-authored-by: Konicai <71294714+Konicai@users.noreply.github.com>
2023-12-05 18:54:42 -05:00
chris 119fbc86bc
Don't send an awkward "null" when a exeption disconnect cause doesn't have a message (#4306)
* Don't send an awkward "null" when a cause doesn't have a message

* Fix accidental regression leading to unhandled "CraftingEventPackets"
2023-11-22 21:03:24 +00:00
chris 0ebb7232f9
Add SessionDisconnectEvent (#4052)
* Add SessionDisconnectEvent

* Move disconnect event calling to UpstreamSession, debug double calling issues

* Prevent duplicate disconnect calling

* Tidy up disconnection logic, ensure SessionDisconnectEvent is always fired - but only once. Fix /geyser reload command
2023-11-10 23:44:38 +01:00
chris 9dad1acfe5
Feature: Add recipe unlocking on Bedrock edition (#4016)
* Start on 1.20.10+ recipe unlocking system

* Keeping track of multiple Bedrock recipes to unlock for a single Java recipe

* Unlock stonecutter recipes

* Stonecutter recipes

* Unlock tipped arrows/shulker box recipes even when Java doesnt (why..?), and dont send trims if Java doesn't

* Translate FurnaceDataRecipes

* Revert FurnaceRecipe translation, revert stone cutter recipe identifier caching - Bedrock does not need the smelting recipe, and doesn't (un)lock stonecutter recipes (yet...?)

* Remove debug message

* Make decorated pot crafting just a little bit smoother :p

* formatting

* Use itemTag descriptors to fix https://github.com/GeyserMC/Geyser/issues/3784

* Use hashmap instead to store item tag overrides

* remove unnecessary comment

* Address review by @Konicai

* Support for 1.20.30

* undo add whitespace

* Merge upstream, use FastUtil maps, rename a few methods

* Address Camotoy's review

* Fix formatting
2023-11-10 20:45:15 +01:00
Kas-tle 3fa35b2cb9
Restrict game packets to state; Closes #4191 (#4210)
Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>
2023-10-12 06:02:57 -07:00
chris 7983448ce6
Remove Mojang account sign-in option (#4147)
* Remove Mojang auth

* Yeet Connector wrapper, ensure that empty config arrays (e.g. saved user logins) are empty lists instead of null to avoid NPE exceptions
2023-10-03 01:12:54 +02:00
Konicai c2cd99c829
Support Java 1.20.2 (#4112)
* Initial pass for 1.20.2, compiling
* Remove unused level events
* handle null GameProfile in ClientboundPlayerInfoUpdatePacket
* Handle level events BRUSH_BLOCK_COMPLETE and EGG_CRACK
* Account for null tag in DecoratedPotBlockEntityTranslator
* Explicitly show that 1.20.31 is supported
2023-09-29 17:14:49 -04:00
chris 3ec591509c
Fix forced zoom issue when switching into spectator mode (#4093)
* init: spectator mode support

* properly set second abilitylayer for spectator mode

* Fixes https://github.com/GeyserMC/Geyser/issues/3318 by not sending changed flags in spectator mode
2023-09-06 18:13:19 -04:00
Konicai d4ae428225
Drop support for 1.19.80 (#4091)
* Initial removal of any 1.19.80 logic
* Re-add isPre1_20_1 method
2023-08-29 16:58:51 -04:00
rtm516 48ecde0f19
Allow srv resolving to be set per remote server (#4076)
* Allow srv resolving to be set per remote server

* Remove resolve-srv as a config option
2023-08-26 22:51:30 +01:00
Kas-tle 9ddfdf9374
Add support for custom blocks and skulls (#3505)
* Super cursed custom skulls custom block

* Rename some stuff

* Attempt to clean up some code

* Remove skull translation events and define custom blocks for custom skulls

Clean up skull block translation a bit

* Auto generate skull resource pack

Change `davchoo` to `geyser` in geometry

* Add config options for custom blocks and custom skull blocks

* Fix formatting and names for player skulls

* Use block states more efficiently for custom skulls

21 block states vs 48 block states

* Clean up custom block api a bit

* Apply some suggestions from Camotoy

* Move custom skull config stuff to its own file

Custom skulls can now be added by username, uuid, and textures

Move skull nbt stuff from requestTexturesFromUsername to
SkullBlockEntityTranslator
Add requestTexturesFromUUID

* Update custom block nbt for v534

* Disable collision box & selection box when box is empty

Fix incorrect collision names used in CustomBlockComponentsBuilder

* Add custom block stuff to provider registry loader

* More API changes

Convert CustomBlockPermutation into a record
Change materialInstances in CustomBlockComponents Builder to
materialInstance
Reuse box components in CustomSkull

* Convert skull floor geometries into a template

Should be easier to modify in needed in the future.

* Crop and reorder skull textures to eliminate unused space

Should reduce memory & storage usage for Bedrock clients

* Revert "Crop and reorder skull textures to eliminate unused space"

This reverts commit 15fd5353e1.

* Use identifier from CustomBlockData in SkullResourcePackManager

* Fix isIncorrectHeldItem check for custom skull blocks

Add defaultBlockState to CustomBlockData

* Fix adding duplicate block states for custom blocks with 0 properties

Remove defaultBlockState CustomBlockState field from
GeyserCustomBlockData since it creates a circular reference

* Add basis for overriding Bedrock block states

Fix missing providers when used in GeyserDefineCustomBlocksEvent

* Fix custom blocks in 1.19.50

* Decouple mappings from items

* Decouple mappings from items

* Null check

* Move to CustomBlockRegistryPopulator

* Remove name_hash from blocksTag/vanillaBlockStates

Fixes creative inventory contents with custom blocks registered

* Limit Bedrock versions to 1.19.40+

Custom blocks were released in 1.19.40

* Un-revert Crop and reorder skull textures to eliminate unused space

Should reduce memory & storage usage for Bedrock clients

Bug with top face flipping + per-face uv's was fixed in 1.19.40+
https://bugs.mojang.com/browse/MCPE-160073
Geometry is still offset by 0.5 to prevent lighting bugs

* Add validation custom block components and s/lightFilter/lightDampening/

Also validate custom block names

* Add display name component and add toggle for client block placing

The display name component allows blocks to use other locale keys.
placeAir will prevent the client from placing the default block state.

* Begin parsing block mappings (still much to do!)

* CustomBlockMapping stores block w/ all states

* Mappings almost :/

* Ok now they work at least

* Read most mapping components

* Block mappings mostly done

* Translate block item

* Add docs for custom blocks

* Add tags

* More docs

* Accidentally added name comp.

* Fix collide box and warn for >16 props

* add registerBlockItemOverride event + refactor

* Inventory overrides for multistate bedrock blocks

* Implement all remaining block components

* Minor cleanup and javadocs

* Update custom skull config example

* Address @Camotoy's review

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Fix light_emission and light_dampening components

* Remove redundant populate method and remove BLOCKS_JSON after last use

* Fix inventories with block state overrides not opening

* API event for skull blocks & let register via URL

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Use skin hash instead of URL

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Address @davchoo's review

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Rework MappingsReader_v1 to avoid passing maps around

* Treat all properties as string properties

There isn't a real need to check for boolean and int properties

* Fix block registry scan in MappingsReader

* Skin hashes can have less than 64 characters?

* Include entry when logging exceptions from block mappings

* Submodule

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Fix block break speeds thanks to @Camotoy

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Temporarily fix build on eclipse so I may work...

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Custom tool breakspeed by server; Closes #3348

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Account for if custom skulls are added on 1st run

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Initial framework for extended collision boxes

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Add some notes for the extended collision box impl

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* We have our extended collision registry

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Notes for me

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Extended collision boxes almost work

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Extended collision boxes actually work

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Consider all hitboxes in calculation

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* X is mirrored...

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Extended collision boxes are much improved

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Upstream fallout

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Address @Redned235's review

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Oops my bad that makes no sense :)

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Ext collision box chunk translation optimization

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Trunc skinhash to 32 chars due to 80 char limit

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Use new transformation cmpnt vs legacy rotation

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* keep arr null on get extcolstor

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Properly handle if extended collision box is below

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Less ugly (realized it can go here)

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Prevent 2x placement due to extended collision box

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Properly build on eclipse via indra

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Ensure enough bits in bedrockData for paletteIDs

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Fix not needed whitespace

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Update license headers to 2023

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Use release indra over snapshot

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Revert "Update license headers to 2023"

This reverts commit f750059e8e.

* Account for collisions in chunk section y0 layer

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Fix extended collision @ air section bottom

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Address @davchoo's review

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Address @rtm516's review

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* More @rtm516's review

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Address @Camotoy's review

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Update javadocs

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Address @davchoo's review

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Lock extended collision to section

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Clear ext col even when air

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Let override vanilla items in creative inventory

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Avoid creating 12 HashSets for every overrided block state

* Super minor nitpicks + Custom Skull NBT fix

* Check custom skull is within Bedrock bounds

Fixes NPE with custom skulls above y=320 or below y=-64

* Add static builder methods to match CustomItemData API

* Upstream

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Initial API setup for modded blocks (no impl yet)

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* More work on nonvanilla blocks (nonfunctional)

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Fix compile

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Update submodules

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Modded reg so far (not done)

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Add non-vanilla registration and fix a few bugs

* Fixes for non-vanilla blocks

* Remove import

* CustomRegPop. go1st for now; must split for modded

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Address silent change to geo component for blocks

Co-Authored-By: Unoqwy <pm@unoqwy.dev>
Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Seperate bedrock, vanilla, & nonvanilla block reg

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Single event

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Impl MaterialInstance as builder per @Redned235

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Added creative category enum & added some missing overrides (#7)

* Add material instance to provider registry

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* oops

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Fix case of correctBedrockIdentifier not found

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Fix docs

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Address @Camotoy's review

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Address review from @davchoo

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Set namespace of custom blocks vs ident direct

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Address review from @rtm516

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* One more

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Remove rogue space

* Geo component as builder

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* use super name

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Bump version

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

---------

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>
Signed-off-by: GitHub <noreply@github.com>
Co-authored-by: davchoo <davchoo@users.noreply.github.com>
Co-authored-by: davchoo <4722249+davchoo@users.noreply.github.com>
Co-authored-by: Unoqwy <pm@unoqwy.dev>
Co-authored-by: RednedEpic <redned235@gmail.com>
Co-authored-by: ImDaBigBoss <67973871+ImDaBigBoss@users.noreply.github.com>
Co-authored-by: rtm516 <rtm516@users.noreply.github.com>
2023-08-21 16:04:08 -07:00
chris 706d1b9627
Fix smithing tables on pre-1.20 servers (#4056) 2023-08-16 22:42:17 -04:00
chris 2361f587da
Don't send softEnumPackets when command suggestions are false (#4037)
* Don't send SoftEnums if command suggestions are set to false, add system property to not send team suggestions

* address review
2023-08-06 17:39:27 -07:00
Konicai 7b409fd55b
Cache the Keep Alive timestamp for forwarding ping (#4002)
* Cache the (clientbound) Keep Alive timestamp and use that for forwarding ping
* Use a Queue of keep alive IDs to handle KeepAlive packets sent in succession
* Don't force NetworkStackLatencyTranslator on the session's event loop
* Send clientbound NetworkStackLatencyPacket immediately
* Avoid sending negative NetworkStackLatencyPackets that are not from the form-image-hack in FormCache
* Downsize timestamps that would lead to overflow on the client
2023-08-01 10:58:59 -04:00
Konicai ff05c98690
Camera shake and fog effect api (#3931) 2023-07-02 17:00:46 -04:00
Tim203 99671960d0
Merge remote-tracking branch 'origin/master' into jwt-changes
# Conflicts:
#	core/src/main/java/org/geysermc/geyser/registry/populator/BlockRegistryPopulator.java
#	core/src/main/java/org/geysermc/geyser/registry/populator/ItemRegistryPopulator.java
#	core/src/main/java/org/geysermc/geyser/util/LoginEncryptionUtils.java
2023-06-27 12:12:31 +02:00
rtm516 f272ed9383
Move PlatformType to API and expose it for extensions (#3798)
* Move PlatformType to API and expose it for extensions

* Move to a record
2023-06-17 02:56:50 +01:00
chris 8d068ee28f
Add SessionJoinEvent and SessionLoginEvent (#3840) 2023-06-16 20:46:32 -05:00
Konicai 53d002656f
Update EmotePacket creation for 1.20 (#3841)
Include xuid and platformId in EmotePacket
2023-06-08 23:43:45 -04:00
Tim203 c5d4b86564
Prepare for changes made in CloudburstMC/Protocol#205 2023-06-03 11:47:50 +02:00
Konicai c2285e018b Merge remote-tracking branch 'upstream/master' into feature/1.20 2023-05-15 14:05:23 -04:00
蒟蒻 ea136b269c
Add Spectator mode ability layer (#3770)
Fixes #3769
2023-05-13 17:29:30 -04:00
Camotoy cc856b84b1
Initial sniffer code 2023-05-11 13:23:27 -04:00
Camotoy 48b796d75e
Expose emote stuff in API; different secure chat checking
This should fix false flags from secure chat disablers doing funky things.
2023-04-15 12:54:30 -04:00
RednedEpic 37c936e177 Chunk biome optimizations 2023-04-09 14:11:46 -05:00
Camotoy 05a88f7693 Fix compiling probably 2023-04-08 16:19:42 -04:00
Camotoy 5eb8bec76e Commands work again I guess 2023-04-07 00:17:20 -04:00
Camotoy d9811d08e3 Merge remote-tracking branch 'origin/master' into feature/protocol-3.0 2023-04-06 13:26:28 -04:00
Camotoy e2535108e6
Folia support and preparations for future changes 2023-03-30 15:44:55 -04:00
Camotoy 323394d2b5
Clean up jar file classes a bit 2023-03-26 13:20:53 -04:00
Camotoy a330c9a5db
Fix lecterns
Huge thanks to Dylan from PocketMine for the idea here.

Fixes #3138
2023-03-18 17:40:51 -04:00
Camotoy 9609686eb3 Version out potion registry
The ID of (for example) redstone dust has shifted, meaning that our hack of re-using IDs no longer works.

Fixes #3620
2023-03-17 19:07:31 -04:00
Camotoy 03c0767965 Finish 1.19.4 support and add Bedrock 1.19.70 support 2023-03-14 15:37:57 -04:00
Camotoy 2436b2b1be Damage will now show again. 2023-03-12 23:51:51 -04:00
Camotoy e50226132f
Fix more issues of chunks not appearing 2023-02-23 13:11:18 -05:00
Camotoy ee754c529b
Add implementation for ClientEmoteEvent
Also, a few random changes I've stored since forever.
2023-02-15 00:17:14 -05:00
SupremeMortal 1769f2a85c
Merge branch 'master' into feature/protocol-3.0 2023-02-14 22:09:48 +00:00
Camotoy af5d03f5dd
Show teams in command suggestions 2023-01-25 11:05:04 -05:00
Kas-tle b8040a1d98
Fix some instances of chunks not appearing (#3498) 2023-01-20 10:02:20 -05:00
Camotoy b5e1ddc3c8
Guess when the client is clicking air on mobile
Should address #2113
2023-01-03 19:28:43 -05:00