Commit graph

1708 commits

Author SHA1 Message Date
Camotoy
e0ae4c1b85
Fix disconnect message formatting 2021-09-21 14:58:35 -04:00
Camotoy
22b962731c
Implement proper non-sound particle for turtle eggs 2021-09-21 14:04:11 -04:00
RednedEpic
fdca9f9be6 Add support for 1.17.30 (v465) 2021-09-19 14:20:42 -05:00
Camotoy
58e00b2645
Add more sanity checks for shulker boxes
Also properly implements reading byte tags from Java Edition.
2021-09-18 10:35:49 -04:00
Camotoy
0537c04ef6
Handle invalid enchantment NBT
Fixes #2117
2021-09-14 11:18:26 -04:00
Camotoy
4196402105
Indicate when the en_US jar has finished downloading 2021-09-10 21:12:12 -04:00
Camotoy
c763939452
Use set for sticky pistons 2021-09-10 16:36:56 -04:00
Camotoy
3632ebda8b
Prevent concurrency issues with SkinProvider#requestedSkins
There is a small potential here to return null if containsKey runs before remove and then get is called.
2021-09-10 16:32:09 -04:00
Camotoy
f32e4725b8
Update world border in constructor
Prevents us from thinking the player is in the border before we get the packet.
2021-09-10 15:03:43 -04:00
Camotoy
9136e4b591
Remove deploying for now; fix LecternHasBookMap offset issue 2021-09-10 14:53:02 -04:00
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
Tim203
a1bdf6dbda
Implemented Floodgate's player transfer plugin message 2021-09-10 01:42:05 +02:00
Camotoy
1199d50338
Allow single quotes to appear in translations in chat 2021-09-08 19:24:30 -04:00
Camotoy
6dd4629fcd
Utilize multiple threads for Bedrock networking if possible 2021-09-08 13:59:32 -04:00
Camotoy
95ba2a10ad
Properly error if Microsoft authentication sends an error 2021-09-08 10:13:46 -04:00
Camotoy
d602d820dd
Re-use patterns in MinecraftTranslationRegistry 2021-09-07 11:56:23 -04:00
Redned
c1e66f306c Play sound when totem is used 2021-09-04 13:52:02 -05:00
Redned
9f77d47f14 Set int array directly for BlockMappings and change naming 2021-09-04 12:45:32 -05:00
Redned
64b0788012 Use an array for java blocks and replace rarely used map in BlockMappings 2021-09-04 12:36:09 -05:00
Camotoy
206368e448
JavaExplosionTranslator: clean up vector usage 2021-09-02 19:42:50 -04:00
Camotoy
0069566803
Dependency update; re-use Thread.MAX_PRIORITY for Spigot; other network optimizations 2021-08-31 19:57:56 -04:00
Camotoy
7fe7dc1d70
Remove debug code 2021-08-31 19:52:10 -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
Camotoy
3c18eb44aa
Use instance of ThreadLocalRandom for particle offsets
Random instances are synchronized meaning this was a potential deadlock situation.
2021-08-26 21:43:53 -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
77119316f5
Check for closed immediately before processing a packet 2021-08-24 09:31:19 -04:00
Camotoy
a1d167d5f1
Ensure skull operations are done on the player thread 2021-08-21 19:38:13 -04:00
Camotoy
ab540b1951
Ensure more entity tasks are run on the player session 2021-08-21 09:54:52 -04:00
Camotoy
89dde2aec3
Do a null check on downstream channel when sending packets 2021-08-19 12:37:14 -04:00
David Choo
57c0185b45
Prevent projectiles from blocking the player's vision (#2472)
Prevent Snowballs, Eggs, and other throwable projectiles from blocking the player's screen
2021-08-17 22:44:33 -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
76399881a3
Use legacy DefaultEventLoopGroup constructor; label Geyser <-> Spigot connection thread 2021-08-16 22:33:14 -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
f4437e45a8
Attempt to make Geyser build 2021-08-16 14:00:12 -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
ce748990a4
Javadoc fix and tiny teleport optimization 2021-08-15 14:57:02 -04:00
Camotoy
5d90ba91f7
Move LoginSuccessPacket handling to its own translator 2021-08-14 12:52:35 -04:00
Camotoy
9f4c2ce5fc
Fix rare StackOverflowError in DeclareCommands
This behavior is exhibited with the NanoLimbo software version 1.2.2.
2021-08-13 23:56:44 -04:00
Camotoy
1afa22d5cf
Fix NPE with area effect cloud particles 2021-08-13 13:42:35 -04:00
Camotoy
25ff3661e3
Update version strings to add 1.17.11
This version has been supported; let's make it clear that it is.
2021-08-13 13:37:06 -04:00
Camotoy
919e84c23f
Don't try to connect to the remote server with invalid credentials
Fixes #2458
2021-08-12 14:35:26 -04:00
Camotoy
b95cd8e0c1
Query improvements
- Improved detection of query packet
- Don't initialize the QueryPacketHandler class until we verified we have query data
- Encode strings like the vanilla Minecraft server
2021-08-12 10:42:58 -04:00
Camotoy
0c5b39f35b
Intern strings and other values
This should reduce memory usage at startup by preventing multiple identicals objects being present in memory.
2021-08-11 20:16:10 -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
3eb73a5634
Fix powder snow and fish buckets (#2437) 2021-08-01 22:20:15 -04:00
Camotoy
20b183ddda
Fix horse variant color
Our old method broke with the 1.17.10 update.
2021-08-01 19:14:01 -04:00
Camotoy
3d50155ee3
Handle the server sending invalid biome IDs in chunks
Should hopefully address #2400 - the Java client handles invalid biome IDs and simply complains in its logs.
2021-07-31 16:34:24 -04:00
Camotoy
a197f60446
Move use-direct-adapters to system property 2021-07-31 13:54:51 -04:00
Camotoy
002be32bb3
Connect Geyser players directly to the server for plugin versions (#2413)
- Faster loading times and improved latency; Geyser no longer creates a physical TCP connection to join the server
- Less configuration: remote address and port are now irrelevant
- Accurate IP addresses without needing Floodgate.

Co-authored-by: Redned <redned235@gmail.com>
2021-07-31 12:52:49 -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
Konicai
6f93bbfe21
Improvements to VillagerEntity (#2412)
* initial changes to villager

* touchup

* don't call getPos() twice

* whoops, better
2021-07-30 15:45:50 -05:00
Camotoy
8c95e26189
Fix experimental toggle'd biomes not accounting for chunk offset 2021-07-29 14:35:03 -04:00
Camotoy
7a99aa0ddf
Merge branch 'biomes' 2021-07-28 20:27:34 -04:00
Konicai
b86648332a
Auth type refactor in internal config (#2410) 2021-07-28 19:44:09 -04:00
Camotoy
5529a1cc1c
Fix spectator gamemode movement
- Don't allow the player to toggle flight status in spectator mode
- Fix weird flight movement when player was previously on the ground
- The player is always flying in spectator mode, no exceptions
2021-07-28 13:21:18 -04:00
Camotoy
4241b5463f
Fix mesa replacement biome 2021-07-27 23:01:38 -04:00
Camotoy
a5beebdffa
Add best-fit replacement biomes for custom biomes 2021-07-27 22:52:07 -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
David Choo
c6589136bf
Fix movement against spawners (#2409) 2021-07-24 10:35:23 -04:00
Camotoy
a93f3119f6
Map bamboo jungle [hills] to their Bedrock ID 2021-07-23 21:42:08 -04:00
Camotoy
da66a01a9a
Fix possible NullPointerException in handling CanBreak/CanDestroy items 2021-07-23 21:28:28 -04:00
Camotoy
e840828763
Update the outdated strings to be more concise 2021-07-23 20:11:50 -04:00
Camotoy
f16f91f469
Check for outdated Java versions older than 16 2021-07-23 19:51:46 -04:00
Camotoy
11f048a065
Better logic for item updating on item entities
Specifically created to address InteractionVisualizer updating all metadata properties when updating the nametag - this commit prevents the item from jumping on updating. It also prevents the entity from being respawned if just the stack size updated.
2021-07-22 09:16:19 -04:00
Redned
c3f65b176d Tweak README - Geyser is fine on production and has been for a while :) 2021-07-21 22:31:54 -05:00
Redned
0e30895302 More registry documentation, and remove unneeded clean identifiers registry 2021-07-21 22:18:31 -05:00
RednedEpic
9817dc932a Merge branch 'feature/optimizations' into master 2021-07-21 21:44:49 -05:00
Redned
ef7c673276 Properly use CompleteableFuture for MSA auth 2021-07-21 21:39:30 -05:00
Redned
4a8e598c62 Document the registry system (Closes #2387) 2021-07-21 21:14:00 -05:00
David Choo
8f98162c69
Fix Item drop animation (#2406) 2021-07-21 21:48:59 -04:00
Camotoy
6b84e07c34
Consolidate left/right parrot checks into one boolean
The 1.17 update missed a couple of updates. Address the problem by only checking once.

Fixes #2402
2021-07-21 13:44:11 -04:00
Camotoy
41d15f3ec3
Optimize squid packet sending
Don't send a full MoveEntityAbsolutePacket when we can send a smaller MoveEntityDeltaPacket that only has rotation information.
2021-07-20 18:41:09 -04:00
David Choo
d7fbdaf93d
Fix Squid Animation (#2398) 2021-07-20 12:08:48 -04:00
Redned
1a0ac26398 Move leak detector to standalone bootstrap class 2021-07-18 17:44:08 -05:00
Redned
39324ce95d Go back to normal thread for now using MSA auth, and only toggle leak detector on standalone 2021-07-18 17:41:47 -05:00
Redned
ae4e4397e3 Use a CompleteableFuture rather than constructing a new thread for logins 2021-07-18 17:04:16 -05:00
Redned
15863bdaef Disable netty's resource leak detector if no level is set 2021-07-18 16:24:55 -05:00
Redned
95a1cbfa24 Some more micro optimizations 2021-07-18 15:43:04 -05: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
Redned
fde36a2234 Fix check for missing item mapping and update mappings submodule 2021-07-18 12:47:02 -05:00
Camotoy
0e72952e0b
Merge branch 'master' of https://github.com/GeyserMC/Geyser 2021-07-18 11:13:37 -04:00
David Choo
2766038db9
Update player bounding box in more scenarios (#2377)
Co-authored-by: Camotoy <20743703+Camotoy@users.noreply.github.com>
2021-07-18 10:58:08 -04:00
Camotoy
697f35f657
Specify the first and last relevant block runtime IDs for items
Improves startup time and processing
2021-07-17 18:09:55 -04: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
80b8d18c31
Replace more instances of String#split with BlockUtils#getCleanIdentifier 2021-07-17 09:43:25 -04:00
David Choo
4e629feee8
Fix block unique Java IDs (#2390) 2021-07-17 09:33:38 -04:00
Camotoy
4844302883
Merge branch 'extended-world-height' 2021-07-16 20:21:43 -04:00