Commit Graph

2816 Commits

Author SHA1 Message Date
KennyTV
57769c5671
Make metadata (almost) fail-safe
This could mean life and death, see
`new Metadata(17, MetaType1_14.Float, event.meta()).value()`
vs.
`new Metadata(17, MetaType1_14.Float, event.meta().value())`
2021-05-25 16:27:55 +02:00
LemonCaramel
a6b4b16fd3
Add Missing Translation Mapping (#2484) 2021-05-25 16:27:19 +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
Jason
03638028cd
Make proper sources jar (#2495) 2021-05-25 09:44:57 +02:00
jmp
d5f56784e2 Silence doclint 2021-05-25 09:07:06 +02:00
jmp
cbf71e2289 Only add javadoc jar to common and api 2021-05-25 09:07:06 +02:00
jmp
e2d9e44be3 Build script improvements 2021-05-25 09:07:06 +02:00
KennyTV
2d2a5fa79c
Fill "needs tool" tags
Fixes #2493
2021-05-24 09:21:32 +02:00
RK_01
605331963d
Fix typo in DumpSubCmd (#2492) 2021-05-23 19:42:01 +02:00
KennyTV
15a5d51248
Don't cast ChannelInitializer type to SocketChannel 2021-05-22 19:41:07 +02:00
KennyTV
8bcd8fd995
Add apiVersion to ViaAPI, some jd 2021-05-22 19:39:26 +02:00
Kamillaova
9484526d39
Fix README build command (gradlew) (#2489) 2021-05-22 13:37:53 +02:00
KennyTV
ab1cc791b7
Fix enchantment parsing or lvl integers 2021-05-21 09:17:40 +02:00
KennyTV
1fe76dbb77
Add more jd to Chunk, ChunkSection, and ChunkSectionLight 2021-05-20 19:23:29 +02:00
KennyTV
cf2adab728
Make ChunkSection an interface, don't allocate light arrays if not needed 2021-05-20 18:32:28 +02:00
KennyTV
04fedd2892
Add comments 2021-05-20 16:56:39 +02:00
KennyTV
c172091944
21w20a 2021-05-19 18:54:38 +02:00
creeper123123321
16ba5aa4f9
Run some optipng (#2482) 2021-05-18 20:46:35 +02:00
KennyTV
5fa2c788e0
Add missing mineable tag entries
Fixes #2481
2021-05-18 17:07:57 +02:00
creeper123123321
c5a338137e
Update fabric.mod.json (#2480) 2021-05-18 13:49:58 +02:00
KennyTV
01d79e2681
Fix non-full chunk sending to 1.17 clients 2021-05-17 17:31:42 +02:00
KennyTV
576682ef9f
Handle invalid uuid int array
Closes #2475
2021-05-15 16:42:38 +02:00
KennyTV
54b0345017
Fix PS compatibility on Java 8 💩 2021-05-15 10:11:19 +02:00
KennyTV
4f9f3254be
Fix PS compatibility on Java 16 2021-05-15 09:28:18 +02:00
KennyTV
1538ff5201
Expand unsupported software checks 2021-05-14 16:59:12 +02:00
creeper123123321
f17fb833a0
add internal getInputBuffer() (#2472) 2021-05-14 11:19:02 +02:00
KennyTV
84c064fc11
Fix legacy hover deserialization, add snapshot suffix to version 2021-05-14 10:59:43 +02:00
KennyTV
7b5b79f510
Update Gradle to 7.0.1 2021-05-12 16:00:42 +02:00
KennyTV
2588c6ecc8
21w19a (probably) 2021-05-12 15:19:33 +02:00
KennyTV
2df57bc37c
Fix 1.14->1.15 meta ordering issue
Closes #2467
2021-05-10 13:27:12 +02:00
KennyTV
efeaef3e4e
Update shadow plugin 2021-05-09 10:25:57 +02:00
KennyTV
cb7a7254a6
Make UnsupportedSoftware hold a list of class names 2021-05-08 10:05:43 +02:00
KennyTV
fe3f247eb1
21w18a 2021-05-05 18:28:39 +02:00
Juan Cruz Linsalata
096415cf8e
Don't inject if inactive (#2461) 2021-05-02 15:52:07 +02:00
KennyTV
af0cf1d3f2
Rename PacketType methods
Just in case a packet with some magic id is going to be added, since the enum ordinal and name methods cannot be overridden
2021-05-02 11:14:38 +02:00
KennyTV
d183d76c47
Remove platform bulk chunk transformers 2021-05-02 10:12:37 +02:00
KennyTV
44e928d53c
Update copyright scopes 2021-04-30 19:05:07 +02:00
KennyTV
89127cad8a
If possible, user Paper internal injection method 2021-04-29 23:32:13 +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
9e59ef4c4a
Hold the rest of the primitive Type instances under their actual class
This brings no improvement now, but if primitive read/write methods for manual calls were implemented later, a signature break will have been prevented by this (aka breaking it now)
2021-04-28 21:12:19 +02:00
KennyTV
00746833ac
ProtocolInfo is not a StoredObject
You can't actually call UserConnection#get with ProtocolInfo.class since the ProtocolInfo interface is not a StoredObject
2021-04-28 18:57:08 +02:00
KennyTV
8e15b6d42b
21w17a 2021-04-28 17:40:57 +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
cadb5ec64c
Rename abstract Protocol to AbstractProtocol
This prevents confusion around the previously equally named interface and abstract class
2021-04-27 18:21:51 +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
d4bc31d11e
Always create ProtocolInfo, store mappings as int[] 2021-04-27 10:29:30 +02:00