Commit Graph

27 Commits

Author SHA1 Message Date
EnZaXD c113e19d41
Convert plain to json instead of doing component conversion in DeathListener (#3821)
Closes https://github.com/ViaVersion/ViaVersion/issues/3817
2024-05-02 17:09:27 +02:00
EnZaXD 1ed22327f6
Replace string->component conversion in 1.8->1.9 (#3794) 2024-04-21 16:00:30 +02:00
Nassim Jahnke feefe6f278
Merge branch 'master' into dev
# Conflicts:
#	bukkit-legacy/src/main/java/com/viaversion/viaversion/bukkit/util/ProtocolSupportUtil.java
#	bukkit/src/main/java/com/viaversion/viaversion/bukkit/platform/BukkitViaInjector.java
#	bungee/src/main/java/com/viaversion/viaversion/bungee/handlers/BungeeServerHandler.java
#	bungee/src/main/java/com/viaversion/viaversion/bungee/providers/BungeeVersionProvider.java
#	common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/storage/EntityTracker1_9.java
#	common/src/main/java/com/viaversion/viaversion/update/UpdateUtil.java
#	velocity/src/main/java/com/viaversion/viaversion/velocity/platform/VelocityViaInjector.java
#	velocity/src/main/java/com/viaversion/viaversion/velocity/service/ProtocolDetectorService.java
2024-03-22 20:54:44 +01:00
EnZaXD 7b0c2fb51a
Replace printStackTrace usages with proper logging (#3741) 2024-03-09 13:57:41 +01:00
EnZaXD c7baa27fd0
Some code cleanup (#3698) 2024-02-14 22:53:50 +01:00
EnZaXD 302716054d
Port of internals and API to ProtocolVersion (#3694) 2024-02-14 17:56:28 +01:00
Nassim Jahnke cfc048ba53
Small random cleanup 2024-02-11 10:46:08 +01:00
Nassim Jahnke bd2c4c8a16
Update license headers 2024-01-01 12:39:45 +01:00
Pablo Herrera d8007dc73c
Fix valid block placements being prevented (#3407) 2023-10-11 23:29:45 +10:00
Nassim Jahnke 5850a9852d More spring cleaning 2023-10-11 23:14:41 +10:00
Nassim Jahnke 4e844a0095
Small startup time improvements 2023-03-16 12:48:39 +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 088f654159
Remove some deprecated api usage, small cleanup 2023-02-04 19:42:26 +01:00
Nassim Jahnke 4fb95581ce
Update copyright headers 2023-01-12 12:45:53 +01:00
Nassim Jahnke ec740476da
Check world in BukkitBlockConnectionProvider
ignoring all of that still being unsafe
2022-03-19 09:37:34 +01:00
Nassim Jahnke d5a568b3fc
Update copyright header 2022-01-09 22:36:07 +01:00
kennytv b81109f512
Semi force packet types in PacketWrapper at creation and transformation 2021-07-31 15:08:45 +02:00
_tomcraft 8e1da82793
Use a more fork-proof approach to enable Paper block place patch (#2561) 2021-06-20 22:49:59 +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
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 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