Commit Graph

42 Commits

Author SHA1 Message Date
Nassim Jahnke
f868dfa125
Update ViaNBT 2024-03-07 13:30:33 +01:00
Nassim Jahnke
8a485db580
Replace tag instanceof checks/unchecked casts with helper methods 2024-02-10 23:28:36 +01:00
EnZaXD
0d788b0d7a
Clean up more item type usage in ItemRewriter (#3674) 2024-01-29 17:21:59 +01:00
Nassim Jahnke
5991ac5633
Update old metadata handlers, some cleanup 2024-01-09 20:43:43 +01:00
Nassim Jahnke
bd2c4c8a16
Update license headers 2024-01-01 12:39:45 +01:00
Nassim Jahnke
f6c49555bf
Update ViaNBT 2023-12-31 13:38:14 +01:00
Nassim Jahnke
c62a8274ed
Use mcstructs for component conversion 2023-12-26 23:38:02 +01:00
Nassim Jahnke
dccac81286 Fix Bungee pipeline clearing, some cleanup 2023-10-31 13:00:35 +10:00
RK_01
78c7f03923
Fix and improved custom payload handling (#3497) 2023-10-24 10:01:33 +10:00
Nassim Jahnke
8ebc8c34f3
Reuse old chunk type instances, more type cleanup 2023-10-20 12:30:03 +10:00
Nassim Jahnke
50e55529d9
Rename old position type 2023-10-19 21:15:26 +10:00
Nassim Jahnke
a30d62a995
Move and rename chunk types 2023-10-19 21:03:00 +10:00
Nassim Jahnke
fdfc528a9a
Cleanup and renames around types 2023-10-19 09:28:21 +10:00
Nassim Jahnke
ec26bafd53
Update ComponentRewriter with nbt methods 2023-10-18 13:26:09 +10:00
Nassim Jahnke
1faf1f3f49
Reduce RecipeRewriter extends chain 2023-02-16 12:27:31 +01:00
Nassim Jahnke
cb2165eb93
Greatly reduce the number of (anonymous) inner classes
Reduces code complexity, and much more importantly, reduces the number of classes loaded at runtime by *hundreds*
2023-02-12 11:46:48 +01:00
Nassim Jahnke
de5b7bf828
Allow registration of simple packet handlers over extending an abstract class 2023-02-12 10:54:47 +01:00
Nassim Jahnke
088f654159
Remove some deprecated api usage, small cleanup 2023-02-04 19:42:26 +01:00
Nassim Jahnke
1a5f83619d
Ensure correct packet types are used on rewriters 2023-02-04 18:29:22 +01:00
Nassim Jahnke
4fb95581ce
Update copyright headers 2023-01-12 12:45:53 +01:00
RK_01
464a85c52b
Replaced hardcoded chunk section out of bounds check (#3136) 2022-10-07 23:07:50 +02:00
Gero
7698ee7683
Some minor performance improvements and cleanups (#3134) 2022-10-04 13:25:55 +02:00
Nassim Jahnke
3eba8ba922
More consistent client entity tracking 2022-05-20 09:53:39 +02:00
Nassim Jahnke
d5a568b3fc
Update copyright header 2022-01-09 22:36:07 +01:00
Nassim Jahnke
a49c395486
Make changes in particles easier to handle 2021-11-10 11:35:44 +01:00
Nassim Jahnke
d80735e248
Read player digging action as var int
Does not matter for small numbers, but properly reflects Vanilla's reading/writing type
2021-10-23 09:58:11 +02:00
MrMicky
e64a0fb62e
Prevent kick when signing empty book (#2700) 2021-10-03 10:11:34 +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
46ca469a4a
Add author tag to constructed book nbt
Fixes #2640
2021-07-27 11:58:24 +02:00
KennyTV
2b8c5082ed
Make Item an interface, more OOP for the ItemRewriter 2021-06-04 12:15:14 +02:00
KennyTV
7b1f9c199a
Produce less overhead in packet handler registering
Instead of creating a void type reader for every single PacketHandler registered, this just directly uses the consumer-like PacketHandler.

The distinction between ValueCreator and the normal PacketHandler was unnecessary given you could also just read something in a ValueCreator instance, effectively just being a consumer of a PacketWrapper instance.
2021-06-02 22:00:20 +02:00
KennyTV
d7e3aa7143
Whoops 2021-06-01 23:28:32 +02:00
KennyTV
48436e7caf
Go through the rest of the send usages 2021-06-01 23:27:33 +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
0d31054903
Fix view distance update packet in 1.13->1.14
The client world is initialized during the join packet, but the view distance packet was created during/before the join handling.
Fixes #2502
2021-05-28 10:02:26 +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
KennyTV
cf2adab728
Make ChunkSection an interface, don't allocate light arrays if not needed 2021-05-20 18:32:28 +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
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
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