Commit Graph

17 Commits

Author SHA1 Message Date
Nassim Jahnke
32a84f24ef
Nicer getters in Pair and Triple 2021-09-14 11:13:39 +02:00
Nassim Jahnke
f2147179c2
Small fixes, add majorVersion method, nicer getter names in some classes
None of the deprecated methods will be removed anytime soon.
2021-08-28 22:15:28 +02:00
kennytv
2094397bca
Allow bypassing of packet type restriction in Protocol, amend packet creator 2021-08-01 12:05:04 +02:00
kennytv
b81109f512
Semi force packet types in PacketWrapper at creation and transformation 2021-07-31 15:08:45 +02:00
kennytv
874dbafe26
More packet sending API
Allows for easy packet sending from a specific version to or from any client version supported by Via.
For example, you can send packets in the 1.17.1 format to both client and server, and it will be transformed accordingly if executed on another server version or sent to a different client version.
2021-07-30 12:26:15 +02:00
KennyTV
d32a4541a9
1.17.1-pre1 2021-06-20 16:16:07 +02:00
KennyTV
24efb48004
Add method to load extra tags from diff files 2021-06-06 17:17:51 +02:00
KennyTV
fc1450fe38
Slightly more OOP, move registerPackets out of Protocol constructor
registerPackets being called within the constructor made it impossible to create instance objects then used in registerPackets (vs. having to then create the objects in registerPackets).
2021-06-03 17:28:02 +02:00
KennyTV
104fa4e29f
Optimize protocol path finding
Not perfect, but better. This prevents the path checks from exponentially increasing (if it weren't for the maxProtocolPathSize fail safe).

By default, a path will never go to a protocol version that puts it farther from the desired server protocol version, even if a path existed.
Otherwise as well as previously, *all* possible paths will be checked until a fitting one is found.

Negative examples if the new boolean is set to true:
    A possible path from 3 to 5 in order of 3->10->5 will be dismissed.
    A possible path from 5 to 3 in order of 5->0->3 will be dismissed.

Negative examples if set to false:
    While searching for a path from 3 to 5, 3->2->1 could be checked first before 3->4->5 is found.
    While searching for a path from 5 to 3, 5->6->7 could be checked first before 5->4->3 is found.

Assuming custom platforms like Bedrock protocol use the normal registering methods, they will have to change the boolean to false to revert to previous behavior (tho still somewhat better optimized).
2021-06-01 18:54:36 +02:00
KennyTV
3618914ce9
Add method to get Protocol by supported versions, some cleanup 2021-05-29 22:21:29 +02:00
KennyTV
1538ff5201
Expand unsupported software checks 2021-05-14 16:59:12 +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
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
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
deec4b521e
Move some packages and classes around 2021-04-26 21:27:59 +02:00