Commit Graph

150 Commits

Author SHA1 Message Date
Konicai
2a1e82ac6d
Initial update to api-8 2022-01-09 16:17:41 +01:00
Nassim Jahnke
427b0a68d0
Cleanup Bukkit/Sponge injectors 2021-10-01 12:17:55 +02:00
Nassim Jahnke
32a84f24ef
Nicer getters in Pair and Triple 2021-09-14 11:13:39 +02:00
kennytv
b81109f512
Semi force packet types in PacketWrapper at creation and transformation 2021-07-31 15:08:45 +02:00
kennytv
d7966567e7
Lowercase gang 2021-07-07 20:43:27 +02:00
KennyTV
2b8c5082ed
Make Item an interface, more OOP for the ItemRewriter 2021-06-04 12:15:14 +02:00
KennyTV
37fd69fa86
Make packet send methods use the current thread by default
Defaulting to submitting to the netty event loop caused issues more often than not - this also removes the `currentThread` flag and instead provides new scheduleSend methods so it is always obvious whether the packet is sent immediately.
2021-06-01 10:13:49 +02:00
KennyTV
3a1e364d4a
Refactor entity tracking and meta handling
This essentially merges the two approaches to the metadata handling from ViaVersion and ViaBackwards and improves on both designs.

ViaVersion did not track every single entity, but only those needed (at least in theory) and can work with untracked entities' metadata. It had a very simple method overridden by metadata rewriter implementations, directly operating on the full metadata list and manually handling meta index changes as well as item/block/particle id changes.

ViaBackwards on the other hand had to track *every single* entity and threw warnings otherwise - while less prone to errors due to giving obvious warnings in the console, it unnecessarily tracks a lot of entities, and those warnings also annoys users when encountering virtual entity plugins (operating asynchronously and sending update packets while already untracked or not yet tracked). Dedicated MetaHandlers made id changes and filtering a lot easier to read and write. However, the actual metadata list handling and its distribution to handlers was not very well implemented and required a lot of list copying and creation as well as exception throws to cancel individual metadata entries.

This version has MetaFilters built with a Builder containing multiple helper functions, and the entity tracking is properly given its own map, hashed by a Protocol's class, to be easily and generically accessible from anywhere with only a Protocol class from the UserConnection, along with more optimized metadata list iteration. The entity tracking is largely unchanged, keeping ViaVersion's approach to not having to track *all* entities (and being able to handle null types in meta handlers).

All of this is by no means absolutely perfect, but is much less prone to errors than both previous systems and takes a lot less effort to actually write. A last possible change would be to use a primitive int to object map that is built to be concurrency save for the EntityTracker, tho that would have to be chosen carefully.
2021-05-25 15:37:07 +02:00
creeper123123321
16ba5aa4f9
Run some optipng (#2482) 2021-05-18 20:46:35 +02:00
KennyTV
d183d76c47
Remove platform bulk chunk transformers 2021-05-02 10:12:37 +02:00
KennyTV
ab93e0877c
Rename platform task implementations 2021-04-29 17:46:29 +02:00
KennyTV
96b5051c75
Use primitive long in task methods 2021-04-29 17:31:16 +02:00
KennyTV
cad358322d
Rename outgoing->clientbound, incoming->serverbound
Via can both be used on servers and clients, making a direction like "incoming" ambiguous
2021-04-28 16:30:34 +02:00
KennyTV
a2b3906c9e
Move bossbar to new legacy package, since it only works on <1.9
The newly created LegacyViaAPI is safe to use, but should hold methods that cannot be universally used on every version
2021-04-28 11:10:16 +02:00
KennyTV
95e20677fd
Clean up ProtocolPipeline
The filter functionality isn't something that's likely to be used again, so move out its usage and only check on <1.9 servers
2021-04-27 15:59:06 +02:00
KennyTV
f1c8d271b1
Reformat imports
The package rename wasn't done through refactoring but through simple replaces to not make git choke on diffs
2021-04-27 13:42:36 +02:00
KennyTV
318c49cf30
More interfaces, keep ProtocolRegistry.SERVER_PROTOCOL legacy api 2021-04-27 13:25:18 +02:00
KennyTV
30d122e7fa
Create some fancy interfaces 2021-04-26 23:01:55 +02:00
KennyTV
49d386063d
Add ProtocolVersion to legacy api 2021-04-26 21:45:27 +02:00
KennyTV
deec4b521e
Move some packages and classes around 2021-04-26 21:27:59 +02:00
KennyTV
a25a5634de
Change package/imports in classes and build configs 2021-04-26 20:52:34 +02:00
KennyTV
a3b1ce817e
Repackage to com.viaversion
This process will be split into multiple commits for git not to choke on.
2021-04-26 20:46:30 +02:00
KennyTV
144c24c276
Move packet tracking methods out of UserConnectionn 2021-04-20 13:24:10 +02:00
KennyTV
7300a69817
Use Paper method to get server protocol version if possible 2021-04-12 20:11:13 +02:00
KennyTV
070c7f5808
Move to checker qual nullability annotations 2021-04-02 14:15:30 +02:00
KennyTV
a63f2ab6fe
Improve server version API 2021-03-26 12:51:38 +01:00
KennyTV
63356207a3
ProtocolRegistry -> ProtocolManager interface 2021-03-24 15:30:03 +01:00
KennyTV
0ab2c626aa
Split parts of common into api; We are now GPL, api is MIT
This does not affect any previous states of this project; only future modifications as well as the project as a whole will be under the GNU General Public License from now on. The newly introduced api directory, partly split from common, is an exception to this, still being licensed under the MIT license.

See the README for details.
2021-03-24 14:02:37 +01:00
KennyTV
ec188db247 Shade relocated adventure without breaking native platform usage 2021-03-04 16:11:09 +01:00
KennyTV
cf8d11d530 Let's go on an <insert title card> 2021-03-04 16:11:09 +01:00
KennyTV
c0dabfe097
*cries in elephant* 2021-02-25 09:18:51 +01:00
Myles
d1a0d629df Merge branch 'master' into dev 2021-02-09 16:32:44 +00:00
Myles
50bfc86706 Revert "The bytebuf doesn't need to be rewritten"
This reverts commit ac877d0b1a.
2021-02-09 16:32:31 +00:00
Myles
628979f923 Merge branch 'master' into dev 2021-02-09 10:36:54 +00:00
Myles
ac877d0b1a The bytebuf doesn't need to be rewritten 2021-02-06 15:29:36 +00:00
KennyTV
e09c3b0159
Merge remote-tracking branch 'origin/master' into dev 2021-02-06 15:38:06 +01:00
Myles
22793dbac4
Re-add a semicolon
🥇
2021-02-06 14:30:18 +00:00
creeper123123321
100ae1c680
Update SpongeEncodeHandler.java 2021-02-06 11:18:51 -03:00
creeper123123321
6941b48038 fixed pending #2291 changes 2021-02-06 10:21:34 -03:00
KennyTV
4cc8a3f092
Return -1 in getPlayerVersion if the player is not connected 2021-01-17 13:59:26 +01:00
creeper123123321
4813cc3077
inject into velocity backend (currently broken)
Add client-side mode for UserConnection

remove unused code

fix duplicate method on rebase
2020-10-28 19:51:01 +01:00
KennyTV
7d96efc645
Minor ProtocolVersion refactor 2020-10-16 18:21:45 +02:00
KennyTV
a981adf7a3
Fix VB check on Velocity/Sponge 2020-07-16 19:43:54 +02:00
KennyTV
029f399a14
Rename ViaCodecException to CancelCodecException 2020-06-10 08:58:40 +02:00
KennyTV
7588609c56
Fix cancelexception printing 2020-06-09 21:29:19 +02:00
KennyTV
aa59ed112a
Fixup docs, remove ConcurrentList 2020-06-09 17:53:31 +02:00
KennyTV
529da10615
Move ProtocolInfo into its own field 2020-06-07 12:19:36 +02:00
creeper123123321
a8a1e9448e
Netty handler tidy 2020-06-07 10:41:29 +02:00
KennyTV
baf1b851c4
1.8 packet enum, add a small number of nullable annotations 2020-06-06 10:55:35 +02:00
KennyTV
762c66ff42
Farewell, lombok! 2020-04-23 21:07:12 +02:00