Commit Graph

42 Commits

Author SHA1 Message Date
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 a0f8ab7bbb
Some cleanup 2023-11-20 19:56:48 +01:00
Nassim Jahnke faedf26b5b Clean up Particle 2023-10-21 13:00:39 +10:00
Nassim Jahnke e7d0b01eee
23w42a 2023-10-19 10:53:14 +10:00
Nassim Jahnke c211b10eaa
Rename NBT and NBT_ARRAY types, add TagType
In theory the nameless compound tag type doesn't exist as it is written as any tag, but in practice is almost always cast and checked for its type, so we keep the extra CompoundTagType (nameless) and add the proper TagType (nameless, any tag) used for components
2023-10-06 22:35:00 +10:00
Unoqwy 11cb113619
Fix disconnecting error for unknown mobs with metadata (#3443) 2023-10-03 09:46:02 +00:00
Nassim Jahnke c358245c0b Fix spawn tracker mapping data check 2023-08-10 17:14:01 +10:00
Nassim Jahnke 6586fc1436 More work on the snapshot 2023-08-03 18:36:30 +10:00
Nassim Jahnke 7edb43844c
Properly handle item display rotation change
Fixes #3354
2023-07-02 13:27:03 +02:00
Nassim Jahnke 1a46346789
Handle optional block state entity meta 2023-04-18 13:34:20 +02:00
Nassim Jahnke 712bbcdc02
More fixes to mapping data loading 2023-03-04 17:17:47 +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 98c645f7ed
Store tracked entity data a little differently 2023-02-10 12:00:20 +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
Nassim Jahnke 14b11bdd10
Start working on 22w42a 2022-10-19 21:58:08 +02:00
Nassim Jahnke c4fa3b0ff8
Fix worldDataTrackerHandlerByKey world index 2022-08-04 15:51:51 +02:00
Nassim Jahnke 3eba8ba922
More consistent client entity tracking 2022-05-20 09:53:39 +02:00
Nassim Jahnke 71a68bf36e
Fix the client entity being untracked on world changes
Fixes #2894 and probably other things
2022-05-19 23:04:18 +02:00
Nassim Jahnke 1d5ae0e3e0
Use mappings instead of hardcoding entity ids 2022-05-14 11:58:45 +02:00
Nassim Jahnke 7dc7b62cc9
22w19a (and a varying mix of removed and added dread) 2022-05-12 23:49:15 +02:00
Nassim Jahnke 4693b95bea
22w14a 2022-04-06 19:07:16 +02:00
Nassim Jahnke d5a568b3fc
Update copyright header 2022-01-09 22:36:07 +01:00
Nassim Jahnke 20e9723d21
Update Gradle, particles finally work everywhere™️
Fixes #2746
2021-12-02 10:54:32 +01:00
Nassim Jahnke a49c395486
Make changes in particles easier to handle 2021-11-10 11:35:44 +01:00
Nassim Jahnke 2f28b25af3
Add block marker id to ParticleMappings 2021-10-20 18:51:53 +02:00
Nassim Jahnke cc78180a6c
Merge remote-tracking branch 'origin/master' into dev 2021-10-07 12:27:21 +02:00
Connor Hartley e5338688bb
Replace use of concurrenthashmap in entity tracker and block storage (#2705) 2021-10-07 12:26:14 +02:00
Nassim Jahnke 73093c0ff2
Read/write palette based on block/biome size variables 2021-09-16 18:12:33 +02:00
Nassim Jahnke c264e639d6
Clear entity data on world change in world tracker 2021-09-14 17:35:27 +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
RK_01 e7a0b4cf04
Improve 1.8 -> 1.9 chunk translation and fix #2065 (#2669) 2021-08-28 10:02:27 +02:00
kennytv 7ffcff7a7b
Fix 1.15->1.16 wolf anger 2021-08-14 10:37:21 +02:00
KennyTV b940ecab9c
Fix meta warning 2021-06-10 08:42:52 +02:00
KennyTV 15cbc96697
Shorten metadata error message 2021-06-09 18:59:48 +02:00
KennyTV 2b8c5082ed
Make Item an interface, more OOP for the ItemRewriter 2021-06-04 12:15:14 +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 ff140c421a
Add/change comments 2021-05-29 11:50:07 +02:00
KennyTV bc89f57088
Slightly improve metadata iteration, remove redundant MetaHandlerEvent index
Lazily create the event if needed and share it with other filters when handling a metadata entry. Lastly, only add the additionally created meta once after the filter list, not once per filter.
2021-05-26 09:00: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