Commit Graph

97 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 93f5298ee3
Introduce specialized maps for block state operations
By introducing fixed maps, we are able to reduce the overhead of needing to store arbitrary numbers; fixed maps start at one number and must be sequential. This commit also reduces some overhead of lecterns in block updating as we are able to utilize our own maps to reduce object boxing and removing the function of Map#compute of trying to re-insert a value.
2021-09-09 21:33:48 -04:00
David Choo 8461cf76b7
Smooth Pistons (#1542)
With proper piston collision for players as well.
2021-09-09 21:20:25 -04:00
Camotoy bb92c89273
Small optimizations; use array for Java -> Bedrock block mappings
Java runtime IDs are in order starting from 0; an array is all that is needed to map Java IDs to Bedrock IDs.
2021-08-27 20:10:01 -04:00
David Choo fb5449d0d1
Fix extended world height client crash with 32+ section chunks (#2441) 2021-08-03 00:08:47 -04:00
Camotoy 8c95e26189
Fix experimental toggle'd biomes not accounting for chunk offset 2021-07-29 14:35:03 -04:00
Camotoy a93f3119f6
Map bamboo jungle [hills] to their Bedrock ID 2021-07-23 21:42:08 -04:00
Camotoy 01873ea566
Change some comments 2021-07-16 20:18:13 -04:00
Camotoy 8e593a55a3
Adjust language strings for new options 2021-07-16 20:06:09 -04:00
Camotoy 7972f089d9
Oops 2021-07-15 20:51:35 -04:00
Camotoy db1563aa79
Better estimate for new biome data size 2021-07-15 20:51:13 -04:00
Camotoy e5cb122db3
Use normal biome data for non-extended world height 2021-07-14 21:59:10 -04:00
Camotoy d19ff657de
Ensure overworld constraints are used everywhere 2021-07-14 21:46:56 -04:00
Camotoy feb64e08df
Fix biomes crashing and more (huge thanks to @dktapps 2021-07-14 21:14:53 -04:00
Camotoy c7d4130a44
Start of extended world height support 2021-07-13 20:48:45 -04: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 afc1f48d5e
Use custom class for caching chunk data
Right now, our chunk cache stores the heightmap and biome data that the server sends, which we never use. This commit saves that data in a custom GeyserColumn class that only stores chunk data. In the future, it may also store NBT data.
2021-06-29 10:09:47 -04:00
Camotoy f9f74a0da8
Determine chunk Y offset on Java packet processing thread
Should stop NullPointerExceptions if the session closes before chunks are processed
2021-06-25 13:51:52 -04:00
Camotoy bb20afb123
Warn if server is using high/low dimension heights and remove translations on some strings 2021-06-07 23:09:42 -04:00
Camotoy 1fe179c6d2
Implement glow item frames 2021-06-03 19:04:28 -04:00
Camotoy f5c5d0cd39
Support 1.17-pre3 and Bedrock 1.17.0.58 2021-06-01 21:12:58 -04:00
Camotoy ebf726ce9e
Yeet cache chunks
So many features require this config option, and we don't intend on supporting it being both disabled and enabled.
2021-06-01 15:36:33 -04:00
Camotoy b5307ab3ed
21w20a support 2021-05-19 22:24:11 -04:00
Camotoy 024655f008
Merge branch 'master' of https://github.com/GeyserMC/Geyser into feature/1.17 2021-05-19 17:53:06 -04:00
Camotoy 0691bb67b4
Item frame optimization and block picking support (#2203)
Geyser now supports block picking for item frames. It checks to see if the item frame has an item in it - if so, it attempts the same block picking process with the item inside (NBT included). Otherwise, it attempts to pick for an item frame item.

This commit also improves item frames by having the internal map store the entity and not the ID - in many situations, this prevents two maps from having to be searched. Additionally, item frames are no longer despawned if an item is placed on them - rather, it waits until the server tells us to despawn the entity.
2021-05-09 15:44:41 -04:00
Camotoy e692b53c3f
Initial update for 21w17a 2021-05-01 23:19:49 -04:00
Camotoy 1d8961c498
Allow GeyserWorldManager to be overwritten while still holding a cache (#2036) 2021-03-14 12:26:47 -04:00
Camotoy 370f3c18ba
Use compute for determining if a lectern if present
Reduces having to call both containsKey and get.
2021-03-10 13:54:09 -05: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 6775d88704
Handle no-NBT lecterns 2021-02-26 21:53:24 -05:00
Camotoy 8317961340
Merge branch 'master' of https://github.com/GeyserMC/Geyser into server-inventory 2021-01-01 14:20:52 -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 2265de3ae9
lecterns 2020-12-28 00:29:27 -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 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
Camotoy 445444204f
Fix GlobalPalette translation (#1528)
* Fix GlobalPalette translation

Global palettes don't have their own internal palette, which cannot be iterated through to create a Bedrock palette. Therefore we simply iterate over the whole palette one time. This commit also fixes a regression with flowers/pistons being on multiple chunk sections.

* Don't declare bedrockPalette until after global palette check
2020-11-14 12:05:33 -06: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
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
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 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 8b7165a564
Implement (hopefully) temporary dimension switching fix (#1188)
This fixes rare (?) instances where dimension switching doesn't finish loading on the client. Ideally a proper fix would send the finishing packets in the correct order but I didn't get far in this regard.

Fixes #1154 and #1072.

Other miscellaeous chunk-related fixes have also been included here.
2020-08-24 09:31:21 -04:00
RednedEpic da1674c8d6 Update to Cloudburst NBT 2.0 2020-07-05 15:59:44 -05:00
DoctorMacc fc4a87a9c9 Fix blocks not updating 2020-06-29 16:46:29 -04:00
DoctorMacc d6119375b2 (Incomplete) Update MCProtocolLib 2020-06-18 21:44:50 -04:00
Camotoy 7fcd8f2daf
Fix block entities on older versions (#756)
* Fix block entities on older versions

This commit solves two problems related to block entities on older versions:

- Occasionally, tags would contain the ID under a StringTag with an empty value, and not the ID tag.
- The block entity regex did not account for block entity tags that were already in a Bedrock-compatible format (BlockEntity)

* Move BLOCK_ENTITY_TRANSLATIONS to BlockEntityTranslator
2020-06-10 18:02:29 -05: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 f11bae0bf0
Fix signs (#439)
* Fix signs on everything except Paper

* Fix sign line placement

* Update shulker box block entity

Co-authored-by: James Harrison <james@fasttortoise.co.uk>
2020-05-06 16:52:57 -05:00
Luke 7195d20fae
Implement helper methods for sending packets (#487)
* Implement helper methods for sending packets, fixes an NPE when chatting before connecting to the remote server

* Change method names

* Add a space between doc comment lines

* Add debug messages
2020-05-05 10:51:43 -05:00
Camotoy b49004ddaf
Add block entity translators for Bedrock-only block entities (#478)
* Initial work on flower pots

* Flowers work in-game, not yet chunk load

* Don't overwrite my code before merge

* Finish up flower pots; add piston support on chunk load

* Clean up

* Remove debug line; update mappings
2020-05-04 21:32:02 -05:00