Commit Graph

520 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
Camotoy f22d286ea1
Add world border translation (#1839)
As Bedrock does not have world border support, this PR translates what the Java server sends us for a world border into particles and fog, while also preventing the Bedrock client from moving outside of the world border.

Co-authored-by: Luke <32024335+lukeeey@users.noreply.github.com>
Co-authored-by: ofunny <play@ofunny.world>
2021-09-09 21:27:38 -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 b89cc1aef0
Refactor lodestones to be more memory efficient
- Most importantly, redesign lodestone caches to be per-player.
- Redesign lodestone caches with the expectation that a client will never re-request the same value.
- Re-use lodestone IDs in a WeakHashMap to be re-used but successfully garbage-collected.
2021-08-31 19:49:55 -04:00
Camotoy ab2f5b326f
Clear chunk on dimension switch
This should resolve chunks being leftover in instances such as server switches in proxies.
2021-08-31 11:32:58 +01:00
Camotoy b9541505af
Bump version to try and fix deploying; other nitpicks 2021-08-30 13:55:01 -04:00
Camotoy ea8f4b854b
Formatting fixes in the FireworkColor class 2021-08-29 10:36:34 -04:00
Camotoy e95d9d3b75
Use closest matching color for unmapped RGB fireworks
Also remove Bukkit-specific firework colors as those were pure workarounds.

Fixes #2505
2021-08-29 10:33:33 -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
rtm516 26a778fd77
Remove exact refrence to imported class in FileUtils (Thanks @Konicai) 2021-08-25 15:53:20 +01:00
rtm516 65e85eb853
Fix bungeecord dump logs after 9fb5090 2021-08-25 11:31:12 +01:00
rtm516 9fb509010a
Use more generic method for posting logs 2021-08-24 21:42:44 +01:00
Jens Collaert d26aed0a87
Allow uploading logs with mclo.gs link into dump (#2453) 2021-08-24 15:11:38 -04:00
Camotoy 3d04a957d0 Ensure that exceptions in player event loop are handled
Any stray exception means that the entire event loop comes crashing down.
2021-08-17 20:57:46 -04:00
Camotoy 7ae91a40ec
Ensure every packet is ran on the same thread per player (#2473)
This removes a lot of concurrency checking that needs to be done, because there should be no way two packets can be handled at the same time.
2021-08-16 20:39:29 -04:00
Camotoy ac17963baa
Player effect cache cleanup
Only cache effects and not their values unless we actually use the value.
2021-08-16 11:53:56 -04:00
Camotoy 1afa22d5cf
Fix NPE with area effect cloud particles 2021-08-13 13:42:35 -04:00
David Choo fb5449d0d1
Fix extended world height client crash with 32+ section chunks (#2441) 2021-08-03 00:08:47 -04:00
David Choo 1d04a61a46
Collision Registry (#2430)
* Fix trapdoor collision

* Add EqualsAndHashCode to all Collision subclasses and shift code around

EqualsAndHashCode are required on subclasses otherwise blocks will be assigned an incorrect collision instance. (Doors and trapdoors are mixed and ladder sometimes gets a DoorCollision instance).
Added protected constructor to BlockCollision to make boundingBoxes final.
Removed EmptyCollision because I don't think it is useful.
Moved conversion from ArrayNode to BoundingBoxes[] from OtherCollision to CollisionRegistryLoader
Removed regex from SnowCollision and use default bounding boxes.

* Deduplicate BlockCollision instances

* Create one set of bounding boxes for all BlockCollisions

* Don't depend on the player's block position in DoorCollision

* Fix dirt path position corrections

Grass paths were renamed to dirt path in 1.17
Fix position correction for y=1, y=2, y=255, and y=256

* Increase pushAwayTolerance depending on distance from origin

This should fix position corrections for blocks less than 1 unit in length/width at high coordinates.
This includes ladders after x 4096 or z 4096
Not too sure about the math here though

* Use ThreadLocal for position

Hopefully resolves concurrency issues

* Remove comment and add layer check to SnowCollision
2021-07-30 22:35:13 -04:00
Camotoy 8c95e26189
Fix experimental toggle'd biomes not accounting for chunk offset 2021-07-29 14:35:03 -04:00
Camotoy 8c96c3b11d
Biome reworkings
- Introduce biome mappings for having a constant reference between Java biome identifier and their Bedrock equivalents
- Don't assume biome IDs and instead listen to the server for biome IDs
- Ensure that only valid Bedrock biomes are sent. With the caves and cliffs experimental toggle, Bedrock will crash if an invalid biome ID is sent its way.
2021-07-27 20:29:27 -04:00
Camotoy 46cd26ffae
Don't cache non-locale assets in the LocaleUtils asset cache
Previously Geyser was storing a reference of every single asset hash provided by the server, including things like sound files. We never used this files, and their existence caused the amount of Asset classes present in Geyser to be over 3000. With this change, we only cache the 118 language files.
2021-07-25 10:11:53 -04:00
Camotoy a93f3119f6
Map bamboo jungle [hills] to their Bedrock ID 2021-07-23 21:42:08 -04:00
RednedEpic 9817dc932a Merge branch 'feature/optimizations' into master 2021-07-21 21:44:49 -05:00
David Choo d7fbdaf93d
Fix Squid Animation (#2398) 2021-07-20 12:08:48 -04:00
Redned 1ad952b581 Handle locale stuff downloading of main thread and add doc to Object2IntBiMap
Technically LocaleUtils is not thread safe and people running Geyser for the first time on slow internet connections may see some untranslated messages. However, we were seeing startup times of about 1+ minutes on these slow connections, and it's better that players see untranslated messages for a short period of time rather than having to wait over a minute for the program to start up.

Once the locale is installed, it doesn't need to be redownloaded again (unless there is a game update) and all translated messages will just work once this download is complete without clients needing to relog.
2021-07-18 15:20:40 -05:00
Redned b4921132e1 Replace BiMap with an Object2IntBiMap 2021-07-18 14:43:17 -05:00
RednedEpic ff280ef192 Replace Reflections usage with an annotation processor
Reduces jar size by about 1.5-2mb
2021-07-17 13:36:04 -05:00
Camotoy 4844302883
Merge branch 'extended-world-height' 2021-07-16 20:21:43 -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 143464b5a9
Respect Javadoc's wishes 2021-07-15 18:12:08 -04:00
Camotoy 25edf41329
Some optimizations
- Fix recipe registry not using an int key-based map
- Versioned registries now use Fastutil more effectively
- Replace uses of String#split for block identifier manipulation with #indexOf and #substring
- Reuse Patterns in collision loader
2021-07-15 18:03:41 -04:00
Camotoy 11874aaa9b
Merge branch 'master' of https://github.com/GeyserMC/Geyser into extended-world-height 2021-07-14 22:00:23 -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 ac9da9a5a0
Fix flower pot updating 2021-07-13 21:47:13 -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 32bbd8ae1c
Attribute rewrite
This commit solves a couple issues:
- Entities that don't implement LivingEntity don't need to bother with attributes
- We don't need to cache all attributes for every entity
- Mounted entities' hearts were inconsistent

No entity as of this commit caches their attributes except for the player entity.
2021-07-08 10:30:59 -04:00
Camotoy 8edf36e063
Actually mark the squid as leashable 2021-07-06 21:39:54 -04:00
Camotoy 2d85505351
Mark new 1.17 mobs and squids as leashable 2021-07-06 21:38:30 -04:00
Tim203 7bf4040308
Added new news types 2021-07-05 15:42:42 +02: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
David Choo 566394f798
Fix breaking animation while jumping (#2335)
* Update block break time after a CONTINUE_BREAK action

* Fix breaking animation time for some blocks

* Reuse Vector3f and add comment

Co-authored-by: Camotoy <20743703+Camotoy@users.noreply.github.com>
2021-06-28 19:26:02 -04:00
Camotoy 215ffc618f
Fix some SettingsUtils regressions
- Add the new 1.17 gamerules
- Don't hide exceptions in form responses
- Fix the settings form silently failing
- Fix some translation strings in the settings form
2021-06-27 19:57:53 -04:00