Compare commits

..
2451 Commits
Author SHA1 Message Date
NotAlexNoyle c09fa331c6 Exclude CODEOWNERS from language statistics 2026-10-28 08:31:40 -04:00
NotAlexNoyle 0088f657e7 Add CODEOWNERS (one staff approval) 2026-10-28 08:31:40 -04:00
NotAlexNoyle 0f95f7cbaf Merge branch 'ViaVersion:master' into master 2026-06-17 12:51:33 -04:00
NotAlexNoyle e607988751 Suppress jdk17 warning 2026-06-17 04:00:23 -04:00
itslilscorp d05985fdb3 Add effect blending to nausea in 1.21.4->1.21.5 (#4964) 2026-06-09 12:01:03 +02:00
itslilscorp 2bb90d32da Preserve legacy stained glass pane falling dust appearance in 1.12->1.13 (#4955)
Map stained glass pane falling dust particles to the corresponding
stained glass block state when translating from 1.12.2 to 1.13.

Legacy clients render stained glass and stained glass pane falling dust
identically. Modern clients render stained glass pane falling dust with
an incorrect dark tint. Preserve the legacy appearance while leaving
other block-backed particles unchanged.
2026-06-07 12:07:03 +02:00
trassert e59c12cf62 Add the_end clock (#4961) 2026-06-05 19:21:32 +02:00
NotAlexNoyle 1f6103aa9b Fix network protocol error on 1.21.5+ clients 2026-06-05 12:25:14 -04:00
NotAlexNoyle 00bb773c4a TrueOG fork patches
Cumulative customizations on top of upstream ViaVersion master:
- build.gradle.kts: enable Eclipse gradle plugin
- common/.../config.yml: TrueOG network 1.19.4 production config,
  disallow clients above 1.21.11, rely on Scoreboard-OG to hide
  scoreboard numbers, suppress warnings
- common/.../v1_19_4to1_20 EntityPacketRewriter1_20: cancel Purpur
  Rainglow non-vanilla GLOW_SQUID metadata (placeholder index, fixed
  in the follow-up commit)

Squashes: Add eclipse gradle plugin (47af35dfa), Use live TrueOG
Network 1.19.4/main config files (f44d281a8, 47e67a1b9), Suppress
warnings (17d367bd9), Rely on Scoreboard-OG to hide scoreboard
numbers (e69efcc39), Disallow clients above 1.21.11 (7cfbe8b94),
Bee anger field iterations (dd95e81c3, 38746d70e), Fix packets
(57f9f1016).
2026-06-05 12:25:09 -04:00
LeonTG b4d8fe6ba1 Display infinite potion effect duration for 1.19.4+, if it would display infinite on 1.19.2 and below (#4953) 2026-05-31 20:58:12 +02:00
itslilscorp cab919bfaf Fix legacy skull rotation overflow in 1.12.2->1.13 (#4952) 2026-05-31 11:51:49 +02:00
Frederik van der Els 9d9fe03317 Add rewrite for commands.locatebiome.success (#4949) 2026-05-28 18:49:43 +02:00
AmirAli Mollaei 8fd09c8ba4 Fix registry key tracking for adding missing keys (#4946) 2026-05-25 09:34:14 +02:00
Florian Reuth 4802926441 Add missing locate command translation to 1.16->1.17 (#4947) 2026-05-25 08:58:45 +02:00
Nassim Jahnke 5628bcbb83 Fix ponder_goat_horn key 2026-05-23 21:56:37 +02:00
Florian Reuth 33062af729 Fix blocks attacks bypassed_by hashing (#4942) 2026-05-21 20:02:56 +02:00
RK_01 f32dca9b56 Make OptionalType non-abstract (#4939)
This allows it to be used like ArrayType without having to create new classes
2026-05-15 18:53:52 +02:00
Nassim Jahnke a09fa97f42 Send new entries for fully missing registries 2026-05-09 10:04:26 +02:00
Nassim Jahnke 08100010c7 Track gamemode in 1.20.5+ already 2026-05-08 18:55:50 +02:00
Nassim Jahnke 9a8a01b753 Make config limits configurable via system properties 2026-05-08 18:24:17 +02:00
Nassim Jahnke c95c839bb0 5.9.1 Release 2026-05-04 20:29:40 +02:00
Nassim Jahnke 3e8682f948 Limit config phase packet queue 2026-05-04 20:27:30 +02:00
Nassim Jahnke 1e2c5dbb7a Run full item hashing only once per pipeline
By only hashing the original item in the first clientbound item rewriter, repeated expensive item hashing (mostly thanks to big text components) in every protocol can be avoided. It is eventually cached in the last clientbound/first serverbound protocol, to be restored immediately and then passed along to the end unchanged.
2026-05-03 15:59:56 +02:00
Nassim Jahnke a11d7eb783 Improve nbt I/O stream performance
A disgusting lot of micro optimization, but stuff that ends up being worth the troubles given how much data nbt tags make up with registry data, block entities and text components.

This generally reduces allocations and work done in reading due to how often the tag keys and values will be ASCII-only characters.

Writing fully drops the additional array allocation as well as extra iterations for length counting
2026-05-03 12:17:33 +02:00
RK_01 40554ef505 Add default implementation for DataPalette#replaceId (#4931) 2026-05-03 09:49:59 +02:00
Florian Reuth 6ce21135fb Make AbstractProtocol#registerFinishConfiguration obsolete (#4853) 2026-05-02 09:46:49 +02:00
RK_01 315a987f4f Fix edge case in DataPaletteImpl#replaceIds (#4930) 2026-05-01 22:31:07 +02:00
RK_01 333a373fcc Add default implementation for DataPalette#replaceIds (#4927) 2026-05-01 22:30:41 +02:00
Nassim Jahnke 8c57534432 Improve chunk rewriting performance 2026-05-01 15:43:26 +02:00
Nassim Jahnke 686e6902fd Improve performance of palette I/O 2026-05-01 15:00:59 +02:00
Nassim Jahnke e15fc5953e Trim slightly more fastutil, use its interfaces for the long collections 2026-05-01 10:58:03 +02:00
Pablo Herrera c611a34e76 Migrate chunk-key maps to fast util (#4923) 2026-05-01 08:46:24 +02:00
Kichura 567ef33f6f [ci skip] Update action files (#4917) 2026-04-26 16:19:23 +02:00
Nassim Jahnke bc0fc7884d [ci skip] Add agents.md file 2026-04-26 15:17:03 +02:00
Nassim Jahnke b3d560bd3a Track tags for adventure mode preciates again in 1.20.3->1.20.5 2026-04-22 12:08:20 +02:00
Nassim Jahnke 4738945a7a 5.9.0 Release 2026-04-19 15:36:05 +02:00
Florian Reuth 4c55ef9cab Remove rewriter overrides in AbstractProtocol (#4913) 2026-04-19 08:30:13 +02:00
Niko a66dbf77aa Fix profile with multiple properties of the same key in 1.20.5->1.20.3 (#4909) 2026-04-17 22:33:28 +02:00
Nassim Jahnke c6cc380c3c Fix fluid block counting
Fixes #4912
2026-04-17 14:44:57 +02:00
Acrylic Style cd3f146781 Fix block state translation in falling block (#4910)
Fixes #4908
2026-04-15 20:31:15 +02:00
Florian Reuth d0da13edd8 Add missing tags for client-interaction in 1.21.11->26.1 (#4906)
Fixes swing animation when placing plants and some container-specific interactions
2026-04-10 14:57:50 +02:00
Nassim Jahnke ec1f570f4b Update 26.1 protocol version range 2026-04-09 13:38:39 +02:00
Nassim Jahnke e41e216903 Fix jukebox_song registry key in 1.21.11->26.1 2026-04-07 21:03:59 +02:00
Nassim Jahnke 43ee417e20 [ci skip] Update template protocol, clean up imports and indents 2026-04-06 15:47:22 +02:00
Nassim Jahnke 4dc57e3d53 Make entity data type id mapping less manual 2026-04-06 13:34:19 +02:00
Nassim Jahnke 31f257fee1 Register empty handlers for transient data components in 1.20.5->1.20.3 2026-04-05 18:58:03 +02:00
Nassim Jahnke cda72574fc Change tag type in 1.20.2 block entity 2026-04-04 17:42:05 +02:00
Nassim Jahnke ef1b6a10ea Fix ocelot parent entity type 2026-04-04 14:59:32 +02:00
Nassim Jahnke c45c700301 Fix 1.21 player chat read type 2026-04-02 16:13:39 +02:00
Nassim Jahnke c43de2b88d Move 26.1 container empty item handling into proper upgrade/downgrade methods 2026-04-02 15:10:19 +02:00
Drex 898b6c8774 Improve enchantment term conversion (#4879) 2026-04-02 14:32:48 +02:00
Florian Reuth 2e3c47d292 Track sneaking state for secondary action in 1.21.11->26.1 (#4890) 2026-04-02 13:23:16 +02:00
Florian Reuth 7974d1a570 [ci skip] Update missing year references (#4786) 2026-04-02 11:56:51 +02:00
Florian Reuth cf2c1c5b76 Update time command translations in 1.21.11->26.1 (#4891) 2026-04-02 11:47:55 +02:00
Florian Reuth d75c54cc70 Fix kick when opening "edit game rules" screen (#4882) 2026-04-02 11:44:50 +02:00
Florian Reuth ead13b2bb9 Deprecate packet register methods with override boolean (#4881)
Replaced by Protocol#registerClientbound & Protocol#registerServerbound
2026-04-01 17:24:33 +02:00
Nassim Jahnke 2e91b841b0 Automatically call mapTypes in entity rewriter 2026-04-01 17:21:53 +02:00
Nassim Jahnke 50486fa43a Don't apply shared registrations to differing version types 2026-04-01 17:05:07 +02:00
Nassim Jahnke 31d4cd453d Add 26.1.1 to version string 2026-04-01 13:02:29 +02:00
Nassim Jahnke c5482b99bf [ci skip] Update error message 2026-03-31 21:15:01 +02:00
Nassim Jahnke 98ef806887 Fix baby wolf assets 2026-03-31 15:21:48 +02:00
Florian Reuth a26745862f Handle show_dialog click events (#4878) 2026-03-31 14:36:09 +02:00
Florian ReuthandNassim Jahnke 6bd081cefd Handle in-depth components in dialogs (#4876)
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
2026-03-31 11:25:47 +02:00
Nassim Jahnke bb9aa8b31c Fix adventure mode predicate index check in 1.20.4->1.20.5 2026-03-31 11:07:01 +02:00
Nassim Jahnke 572f7a2677 Fix hashing of attribute_modifiers with override text 2026-03-30 23:29:20 +02:00
Nassim Jahnke 11a5c9e32c Fix block entity tag read type 2026-03-30 23:09:37 +02:00
Nassim Jahnke 02b65dcb36 Fix command rewriter check being too early 2026-03-30 22:32:08 +02:00
Nassim Jahnke 0121534e7e Deduplicate particle type fillers 2026-03-30 21:53:47 +02:00
Florian Reuth 941e6f6df4 Null check block entity tag in 1.20->1.20.2 (#4872) 2026-03-30 20:40:26 +02:00
Nassim Jahnke fe6e18845b Make tests fail if error occurs during platform 2026-03-30 20:40:26 +02:00
Nassim Jahnke 8f8f5e72c0 Default rewriter registrations across protocols
In total it doesn't (yet) reduce the lines of code (though there is also some other changes adding code here), but makes adding single rewriter calls to a range of protocols much easier than having to individually check an ever increasing number of classes. This also moved Protocol#registerPackets until after mappings have been loaded (which makes onMappingDataLoaded redundant for now, but will become relevant later again)
2026-03-30 20:40:25 +02:00
Nassim Jahnke a6c35c6519 5.8.1 Release 2026-03-30 20:28:09 +02:00
Nassim Jahnke 8b115c7fde Fix attack_range and provides_banner_pattern hashing 2026-03-30 20:22:40 +02:00
Florian Reuth e2d3874f6d Add debug command usage help (#4874) 2026-03-30 15:25:21 +02:00
Florian Reuth 26d8190b23 Send empty tags packet in 1.21.11->26.1 (#4871) 2026-03-29 21:37:32 +02:00
RK_01 d508b6cec1 Add missing fluid block states for kelp, seagrass, and bubble columns (#4870)
Fixes water physics in 26.1
2026-03-29 17:36:08 +02:00
Nassim Jahnke 916ef8c5ac Fix removal of recipe displays 2026-03-29 15:07:44 +02:00
Nassim Jahnke 6b74116ff1 Handle item changes in dialog packets 2026-03-28 17:09:25 +01:00
Nassim Jahnke 5ead6805b9 Distinguish items of different ids for hashing 2026-03-28 11:25:22 +01:00
Nassim Jahnke a6eedfdf0b Bump version to 5.8.1-SNAPSHOT 2026-03-28 11:18:20 +01:00
Nassim Jahnke 38ecd65ee8 5.8.0 Release 2026-03-27 16:12:18 +01:00
Nassim Jahnke 788c1d1b1f Set hashed item amount from click packet
Preserves the amount the player actually had/saw at the end
2026-03-26 20:44:52 +01:00
Nassim Jahnke 0519184da2 Replace 0 count in item hovers 2026-03-25 16:21:55 +01:00
Florian Reuth fd13912295 Fix EntityDataTypes1_21_11#villagerDataType typo 2026-03-25 16:21:23 +01:00
Nassim Jahnke 8d3c36de06 Send empty tags packet if not sent early enough when leaving config stage
Some tags are required before the client finalizes its registries, this lets Via fill them up early enough in later protocols
2026-03-25 16:21:09 +01:00
Nassim Jahnke 219d374d7c Fix item particle type 2026-03-25 16:21:09 +01:00
Nassim Jahnke 9b163e70c3 Remove snapshot bit 2026-03-25 16:21:09 +01:00
Nassim Jahnke 9ed00904f9 26.1-rc-3 2026-03-25 16:21:09 +01:00
Nassim Jahnke e56abf5cac Update identifier files 2026-03-25 16:21:09 +01:00
Florian Reuth 1bf7274dc8 Add empty damage type & banner pattern tags
Signed-off-by: Florian Reuth <git@florianreuth.de>
2026-03-25 16:21:09 +01:00
Nassim Jahnke d218451418 26.1-rc-2 2026-03-25 16:21:08 +01:00
Nassim Jahnke 7d8dcce307 Fix pausing daylight cycle 2026-03-25 16:21:08 +01:00
Nassim Jahnke 2f5d527a38 Fix blocks attacks conversion and banner pattern hashing 2026-03-25 16:21:08 +01:00
Nassim Jahnke a16c5a9fc5 26.1-rc-1 2026-03-25 16:21:08 +01:00
Nassim Jahnke 318608b9cd Auto remove new registries from tags too 2026-03-25 16:21:08 +01:00
Nassim Jahnke ae7496fbad 26.1-pre-3 2026-03-25 16:21:07 +01:00
Nassim Jahnke 32a1dfe74f 26.1-pre-2 2026-03-25 16:21:07 +01:00
Nassim Jahnke 815ec24af1 Remove removed registries from command arguments 2026-03-25 16:21:07 +01:00
Nassim Jahnke 8ee0b66eed Always send interact_at 2026-03-25 16:21:07 +01:00
Nassim Jahnke ab2385b975 26.1-pre1 2026-03-25 16:21:07 +01:00
Nassim Jahnke 5a9ccf7c17 Update villager entity data id 2026-03-25 16:21:07 +01:00
Nassim Jahnke 22877d06a7 Replace remaining either holders 2026-03-25 16:21:06 +01:00
Nassim Jahnke 35d85d08a7 Update sound variants 2026-03-25 16:21:06 +01:00
Nassim Jahnke f5bb1c42db 26.1-snapshot-11 2026-03-25 16:21:06 +01:00
Nassim Jahnke cfb8519ae2 26.1-snapshot-10 2026-03-25 16:21:06 +01:00
Nassim Jahnke 4d1fa925ff Add new ambient light colors 2026-03-25 16:21:06 +01:00
Nassim Jahnke fa410b704a Fix cat variant asset change 2026-03-25 16:21:06 +01:00
Nassim Jahnke 483628f1f2 26.1-snapshot-9 2026-03-25 16:21:05 +01:00
Nassim Jahnke 7930e66676 26.1-snapshot-8 (maybe) 2026-03-25 16:21:05 +01:00
Nassim Jahnke 5b547a303a 26.1-snapshot-7 2026-03-25 16:21:05 +01:00
Nassim Jahnke 497d8e17da 26.1-snapshot-6 2026-03-25 16:21:05 +01:00
Nassim Jahnke efbd5d23cd 26.1-snapshot-5 2026-03-25 16:21:05 +01:00
Nassim Jahnke 592b8c8d47 26.1-snapshot-4 2026-03-25 16:21:04 +01:00
Nassim Jahnke 5393edc35b Handle null template items, fix asset id change 2026-03-25 16:21:04 +01:00
Nassim Jahnke 97aff00ced Fill registries used by delayed item loading 2026-03-25 16:21:04 +01:00
Nassim Jahnke 69121c5722 26.1-snapshot-3 2026-03-25 16:21:04 +01:00
Nassim Jahnke ba57197552 26.1-snapshot-2 2026-03-25 16:21:04 +01:00
Nassim Jahnke 7ca372dca4 Update template protocol 2026-03-25 16:21:04 +01:00
Nassim Jahnke e9fb10b63c 26.1-snapshot-1 2026-03-25 16:21:03 +01:00
Florian Reuth ca7696ce12 Allow platforms to append data to connection details protocols (#4859) 2026-03-24 23:17:48 +01:00
Florian Reuth e63c806d64 Fix custom potion effects translation in 1.20.3->1.20.5 (#4858) 2026-03-22 08:34:30 +01:00
Florian Reuth e470ca0002 [ci skip] Update README (#4856) 2026-03-21 19:07:32 +01:00
Florian Reuth 80e90a4401 Fix flower pot block storage 1.12.2->1.13 memory leak (#4852) 2026-03-18 15:05:30 +01:00
Florian Reuth 1d35f2ec35 Produce inlined string in 1.8->1.9 sign update (#4851) 2026-03-16 19:17:21 +01:00
Nassim Jahnke e639eb763a Update ViaNBT 2026-03-13 20:51:32 +01:00
Nassim Jahnke d8343d278d Use var int type in holder set type 2026-03-12 15:12:09 +01:00
Nassim Jahnke 833f49fff3 Swap end and overworld background tracks 2026-03-02 17:33:52 +01:00
Nassim Jahnke cd45a6e7ce 5.7.2 Release 2026-03-01 16:28:28 +01:00
Nassim Jahnke 271362da78 Update dependencies 2026-03-01 16:28:16 +01:00
Nassim Jahnke 05562c27c1 Fix nether biome sky colors, add missing dimension ambient sounds 2026-02-22 13:47:24 +01:00
Nassim Jahnke 5b4ed02748 Handle number format in set_score packet 2026-02-21 16:03:13 +01:00
Nassim Jahnke fe4e407520 Add gradle to dependabot config 2026-02-20 22:17:25 +01:00
Nassim Jahnke f003b6b84a Only do compression handler reorder on old servers after compression is enabled 2026-02-20 21:58:25 +01:00
Nassim Jahnke 207e085120 Add breath_of_the_nautilus to mob effects enum type 2026-02-20 19:18:19 +01:00
Nassim Jahnke 0a155651a1 Handle 1.21.9->1.21.11 biome sounds and particles 2026-02-20 13:56:19 +01:00
Florian Reuth d061083a8a Handle nested lore components in item_hover handling again (#4830) 2026-02-12 21:31:33 +01:00
Nassim Jahnke ad4c8e42f2 Add system property to disable legacy compression reorder 2026-02-09 17:56:19 +01:00
Florian Reuth b8b13f5831 [ci skip] Update my donation URL (#4826) 2026-02-05 17:09:38 +01:00
FlorianMichael 4dc533506f Don't register a cooldown rewriter in 1.17->1.17.1 (#4824) 2026-02-02 16:16:20 +01:00
dependabot[bot] a166b70996 [ci skip] Bump actions/checkout from 6.0.1 to 6.0.2 (#4822)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/8e8c483db84b4bee98b60c0593521ed34d9990e8...de0fac2e4500dabe0009e67214ff5f5447ce83dd)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-02 14:07:37 +01:00
dependabot[bot] 639e8c454d [ci skip] Bump actions/setup-java from 5.1.0 to 5.2.0 (#4823)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/f2beeb24e141e01a676f977032f5a29d81c9e27e...be666c2fcd27ec809703dec50e508c2fdc7f6654)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: 5.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-02 14:07:23 +01:00
FlorianMichael 61fc96ee11 Allow platforms to change compression names (#4821) 2026-01-31 21:08:01 +01:00
Nassim Jahnke 56259c8318 Update supported Velocity versions 2026-01-31 12:02:24 +01:00
FlorianMichael a8637d9a06 Fix play state compression when already set during login in 1.8->1.9 (#4820) 2026-01-30 22:02:40 +01:00
FlorianMichael ce607b5cc7 Use compression handler names instead for utility method (#4818) 2026-01-30 21:28:37 +01:00
FlorianMichael aa9a615c6b [ci skip] Small code cleanups (#4819) 2026-01-30 21:25:40 +01:00
FlorianMichael 8febef07c3 Add ViaChannelInitializer#reorderPipeline (#4817) 2026-01-29 17:09:42 +01:00
Nassim Jahnke 13fcce6059 Use right method for sub 1.21.5 item_name/custom_name item_hover handling 2026-01-28 17:12:34 +01:00
FlorianMichael cf6427325c Call component rewriter for component item components (#4812) 2026-01-28 12:10:47 +01:00
ValapheeandFlorianMichael 2c30a2748c Display out of bounds enchantments in item lore in 1.17->1.17.1 (#4743)
Co-authored-by: FlorianMichael <git@florianmichael.de>
2026-01-25 20:29:38 +01:00
Nassim Jahnke 1ca5b33304 Fix trusted tag limiting 2026-01-25 13:13:55 +01:00
Nassim Jahnke 265859bdae Re-use byte array in hash builder 2026-01-25 10:59:39 +01:00
FlorianMichael 93e29ac832 Use BlockRewriter1_21_5 in 1.21.7->1.21.9 & 1.21.9->1.21.11 (#4807) 2026-01-24 19:35:27 +01:00
FlorianMichael 4735795323 [ci skip] Remove Gradle wrapper update action (#4805) 2026-01-24 19:25:39 +01:00
FlorianMichael fe5732b616 Make Config#originalRootSection consistent (#4798) 2026-01-21 17:18:27 +01:00
RK_01 b0d9b747de Add ProtocolVersionRange#getMin and ProtocolVersionRange#getMax (#4797) 2026-01-19 21:08:30 +01:00
Nassim Jahnke 3f0f973fac Use synchronized map for config to preserve correct order on late saves 2026-01-19 19:33:00 +01:00
RK_01 1fa3f15d91 Handle 1.21->1.21.2 empty food component split fully (#4796) 2026-01-18 21:39:40 +01:00
FlorianMichael 2979b9d63d Also send version type; always send player details (#4795) 2026-01-18 21:00:52 +01:00
FlorianMichael a734a4a9d1 Make UserConnectionViaVersionPlatform a proxy platform by default (#4794) 2026-01-18 21:00:25 +01:00
Nassim Jahnke 30d44db111 5.7.1 Release 2026-01-18 16:05:53 +01:00
FlorianMichael 6b80f9bab2 Add config option for player details protocol (#4793) 2026-01-18 15:56:27 +01:00
FlorianMichael 5743d1da0b Add server details protocol & make player details protocol consistent (#4781) 2026-01-18 11:56:42 +01:00
FlorianMichael 80b8393a89 [ci skip] ViaLoader archival (#4789)
Signed-off-by: FlorianMichael <git@florianmichael.de>
2026-01-17 17:41:49 +01:00
FlorianMichael 4e83c361bd Only register update checker on platforms that have it (#4787)
Signed-off-by: FlorianMichael <git@florianmichael.de>
2026-01-17 17:21:38 +01:00
FlorianMichael dcfeda181c Add codec handler (#4788)
Signed-off-by: FlorianMichael <git@florianmichael.de>
2026-01-17 16:40:22 +01:00
FlorianMichaelandNassim Jahnke bae320a338 Make more parts of base platform impl optional
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
2026-01-17 14:15:09 +01:00
FlorianMichael 1b9b748bb9 Add ProtocolVersion#getReversedProtocols and ProtocolVersionRange#add with another ProtocolVersionRange
Signed-off-by: FlorianMichael <git@florianmichael.de>
2026-01-17 14:13:47 +01:00
Nassim Jahnke 64c557a7a8 Allow base config, command, and task class use 2026-01-16 20:18:35 +01:00
Nassim Jahnke 16a2a3a671 Add interface to get UserConnection from netty pipeline
+ a little bit of code deduplication
Closes #3162
2026-01-16 17:08:46 +01:00
Nassim Jahnke 509edfd987 Correctly compare namespaces in registry rewriter additions 2026-01-16 12:49:05 +01:00
FlorianMichael 32551f00e0 Handle legacy bucket variant tag in 1.21.4->1.21.5 (#4783)
Signed-off-by: FlorianMichael <git@florianmichael.de>
2026-01-15 21:55:53 +01:00
Nassim Jahnke bfaf7a58e5 Move block entity handling to block rewriter
Also fixes passing on the new instance if the type id changed
2026-01-10 13:12:11 +01:00
FlorianMichaelandNassim Jahnke 42761437cd Update deps (#4777)
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
2026-01-07 16:15:35 +01:00
Nassim Jahnke cff9a87156 [ci skip] Update copyright header 2026-01-04 15:36:39 +01:00
benniofficialdev 44f6b6c9be Update dontbugme command feedback colors (#4774) 2026-01-04 15:15:41 +01:00
Nassim Jahnke 755a8aa22e Fix sustained limiter increasing warnings too fast 2026-01-04 15:10:59 +01:00
Nassim Jahnke 1d566100fb 5.7.0 Release 2025-12-29 12:46:28 +01:00
Nassim Jahnke 212cca1d65 Add null check to uuid in Velocity kick method 2025-12-27 21:45:35 +01:00
Nassim Jahnke 1f40811877 Track merchant offer items for hashing 2025-12-27 12:48:32 +01:00
Nassim Jahnke f45d2f8567 Fix UUID hashing
Fixes #4727
2025-12-26 20:24:34 +01:00
Nassim Jahnke 9b19bfc6df Move logging config options to new section and update defaults 2025-12-25 21:37:43 +01:00
FlorianMichael c2a8400751 Update block connection mapping file (#4759) 2025-12-25 09:11:02 +01:00
David Lüdtke 3cbfbd3b9f Fix world border lerp size set in ticks instead of millis (#4755) (#4757) 2025-12-23 09:54:43 +01:00
Nassim Jahnke ea6808b697 Update sprite atlas in 1.21.9->1.21.11
Fixes #4734
2025-12-21 18:00:08 +01:00
Nassim Jahnke 85f868c37e Put set_objective and set_score packets through component rewriter 2025-12-21 15:39:35 +01:00
Rocco f6e036df76 Restore 1.8 hitbox margin for 1.21.11+ clients (#4733) 2025-12-21 10:52:34 +01:00
FlorianMichael 55ed56668e Fix alignment of pre/post packet debug (#4754) 2025-12-20 20:42:35 +01:00
FlorianMichael 705509489a Support packet types with different states in debug handling (#4751) 2025-12-20 16:33:57 +01:00
Nassim Jahnke 57a42e1156 Handle block_state_property enchantment terms
Fixes #4750
2025-12-20 11:54:41 +01:00
FlorianMichael 7181f485eb Fix pps sub command not working (#4749) 2025-12-19 09:43:26 +01:00
Kichura 5f3dc1be53 [ci skip] Error on absent artifacts, set CI timeout to 30 mins (#4745) 2025-12-19 09:42:26 +01:00
booky 4f06afc2bd Cancel serverbound stab packets (#4744) 2025-12-15 16:05:10 +01:00
RK_01 c267a754e7 Always send extra attributes in 1.20.5 (#4742) 2025-12-15 09:27:42 +01:00
RK_01 7657a59b07 Add step_height and version dependent interaction range 1.20.5 attributes (#4741) 2025-12-14 22:15:03 +01:00
Nassim Jahnke f95ec49d6f Properly pass on packet type in PacketWrapper.create 2025-12-14 20:20:12 +01:00
FlorianMichael 1be574bc21 Handle lit_furnace as furnace in 1.8->1.9 (#4739) 2025-12-14 13:48:22 +01:00
Nassim Jahnke 0640e2468c Don't auto-split long lines when dumping config
Fixes #4740
2025-12-14 10:43:18 +01:00
FlorianMichael 2adfee3b60 [ci skip] Include the newest ViaProxy version from 3.0.0 to 4.0.0 (#4738) 2025-12-13 19:59:00 +01:00
riku6460 b65d7af793 Fix default dripstone particle in 1.21.9->1.21.11 (#4735) 2025-12-13 11:18:06 +01:00
Nassim Jahnke 8f7fd34fa4 Add max-error-length config option 2025-12-13 11:17:41 +01:00
Nassim Jahnke 5bf0e9b22a Bump version to 5.6.1-SNAPSHOT 2025-12-13 10:49:22 +01:00
Nassim Jahnke 808605e06a 5.6.0 Release 2025-12-12 15:59:10 +01:00
Nassim Jahnke fb387bf9c5 Add missing particle readers 2025-12-12 15:59:10 +01:00
Nassim Jahnke a3ff540cb3 Remove empty mapped data component types in tooltip display 2025-12-12 15:59:10 +01:00
Nassim Jahnke 1cafd08326 Fix kinetic weapon condition reading 2025-12-12 15:59:10 +01:00
Nassim Jahnke d5458145a0 Remove snapshot bit 2025-12-12 15:59:10 +01:00
Nassim Jahnke 316e6ac1ba 1.21.11-rc3 2025-12-12 15:59:10 +01:00
Nassim Jahnke 6b66611810 Add new dimension and biome fields to nether and end 2025-12-12 15:59:09 +01:00
Nassim Jahnke 89176f4f11 1.21.11-rc2 2025-12-12 15:59:09 +01:00
Nassim Jahnke 0808c52317 1.21.11-rc1 2025-12-12 15:59:09 +01:00
Nassim Jahnke e93199fcfe 1.21.11-pre5 2025-12-12 15:59:09 +01:00
Nassim Jahnke 04e5dfdc4e 1.21.11-pre4 2025-12-12 15:59:09 +01:00
Nassim Jahnke cba704fe3d 1.21.11-pre3 2025-12-12 15:59:09 +01:00
Nassim Jahnke f2ef57673c 1.21.11-pre2 2025-12-12 15:59:09 +01:00
Nassim Jahnke 6f7e24ac9e 1.21.11-pre1 2025-12-12 15:59:08 +01:00
Nassim Jahnke 54bd8fb5f7 25w46a 2025-12-12 15:59:08 +01:00
Nassim Jahnke 22c0ddc5de Fix avatar arm type 2025-12-12 15:59:08 +01:00
Nassim Jahnke 43bb38f4cf Rename RESOURCE_LOCATION Type to IDENTIFIER
Includes method and local variable names of cross-version code. Key stays unchanged, as it's quite clear what it represents (and is shorter)
2025-12-12 15:59:08 +01:00
Nassim Jahnke b9f110219e 25w45a 2025-12-12 15:59:08 +01:00
Nassim Jahnke 4fc70ad603 25w44a 2025-12-12 15:59:08 +01:00
Nassim Jahnke 8c33faa4f5 Move around environment attributes 2025-12-12 15:59:07 +01:00
Nassim Jahnke 6375718b10 25w43a 2025-12-12 15:59:07 +01:00
Nassim Jahnke e51ea0eeb6 25w42a 2025-12-12 15:59:07 +01:00
Nassim Jahnke 5ce209e0e9 25w41a 2025-12-12 15:59:07 +01:00
github-actions[bot]andgradle-update-robot d232242997 Update Gradle Wrapper from 9.2.0 to 9.2.1 (#4718)
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2025-12-12 15:58:01 +01:00
Kichura 3e6d17274d Update workflow configs (#4725) 2025-12-06 20:33:13 +01:00
dependabot[bot] 4350c7f614 Bump actions/checkout from 5 to 6 (#4721)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-24 21:58:40 +01:00
Nassim Jahnke aea0c6c76f Put set_player_team packets through component rewriter 2025-11-23 19:25:22 +01:00
Lumine1909 5b8b8f5e10 Fix 1.21.9->1.21.7 item entity_data id mapping (#4716) 2025-11-23 12:11:12 +01:00
Nassim Jahnke b46f771103 [ci skip] Update issue template
The "Expected Behavior" field is almost always unneeded and has only really been filled with "not get kicked" or the alike, so this simplifies reporting
2025-11-18 19:48:42 +01:00
Nassim Jahnke fb8430518b Implement painting variant key getter
Fixes #4705
2025-11-03 18:55:52 +01:00
github-actions[bot]andgradle-update-robot 9a686ee527 Update Gradle Wrapper from 9.1.0 to 9.2.0 (#4704)
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2025-11-03 16:52:06 +01:00
Nassim Jahnke cb3dd89c78 Implement more data hashing 2025-11-02 09:20:43 +01:00
FlorianMichael 5689389f3a Implement wolf sound & chicken variants hashing (#4698) 2025-11-01 22:20:36 +01:00
FlorianMichael ed07809c84 Fix typo in entity data types (#4697) 2025-10-30 16:57:31 +01:00
dependabot[bot] 081fc0db41 [ci skip] Bump actions/upload-artifact from 4 to 5 (#4695)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-27 21:10:36 +01:00
Nassim Jahnke 74d60c2126 Implement simple variants and instrument hashing 2025-10-20 15:45:58 +02:00
Nassim Jahnke d45f2cdd64 Implement more item data hashing 2025-10-20 13:58:15 +02:00
FlorianMichael 09898c8c1e Implement PROVIDES_TRIM_MATERIAL & TRIM item component hashing (#4691) 2025-10-20 11:38:48 +02:00
Nassim Jahnke 131660d89f Handle entity type changes in enchantment predicates
Fixes #4692
2025-10-20 11:26:33 +02:00
FlorianMichael 1c066873fd Fix InformativeException message (#4690) 2025-10-17 22:38:51 +02:00
Nassim Jahnke 8429689837 Fix test 2025-10-14 17:41:51 +02:00
FlorianMichael 19c8a1ce1b Remove deprecation on PacketTracker#getIntervalPackets & PacketTracker#setIntervalPackets (#4687) 2025-10-14 17:40:27 +02:00
木葉 Scarlet c6fdaf507f Improve mapping loader executor (#4660)
This should result in less thread spam on machines that are fast enough anyways
2025-10-14 17:40:08 +02:00
FlorianMichael 7b097b3e54 Strip trailing on chat messages in 1.10->1.11 (#4686)
Fixes https://github.com/ViaVersion/ViaVersion/issues/4683
2025-10-14 17:39:14 +02:00
Nassim Jahnke c14928defa Implement more item data hashing 2025-10-14 17:36:19 +02:00
Nassim Jahnke 6b4e74abe9 Bump version to 5.5.2-SNAPSHOT 2025-10-14 16:17:29 +02:00
Nassim Jahnke 1fb3aa8c7a 5.5.1 Release 2025-10-12 18:44:11 +02:00
木葉 Scarlet f175a903a3 Improve some collection usages (#4659) 2025-10-12 18:21:13 +02:00
FlorianMichael 7c80e37e3a Rewrite item ids in 1.12.2->1.13 show_item hover events (#4671) 2025-10-12 18:16:10 +02:00
FlorianMichael ff61e1d897 [ci skip] Update README.md (#4681) 2025-10-12 17:44:30 +02:00
AmirAli Mollaei d49272a41f Fix error when wolf_variant registry data isn't sent in 1.20.5->1.21 (#4655) 2025-10-11 13:01:19 +02:00
Nassim Jahnke bea6df1174 Add april fools snapshot identifiers 2025-10-07 19:44:27 +02:00
Nassim Jahnke 4ca84f6001 Fix <1.13 sounds for VB/VR
Technically unused in VV for now, but may also replace some in-code sound mappings later
2025-10-07 17:42:16 +02:00
Nassim Jahnke 61c079af19 Add 1.21.10 to 1.21.9 version string
No protocol changes
2025-10-07 16:06:55 +02:00
Nassim Jahnke e0b9deb128 Handle repairable item id changes 2025-10-07 15:38:09 +02:00
Nassim Jahnke 1d89bc7f95 Handle deeper lock component changes 2025-10-07 15:23:25 +02:00
dependabot[bot] 28c18c33fa Bump gradle/actions from 4 to 5 (#4678)
Bumps [gradle/actions](https://github.com/gradle/actions) from 4 to 5.
- [Release notes](https://github.com/gradle/actions/releases)
- [Commits](https://github.com/gradle/actions/compare/v4...v5)

---
updated-dependencies:
- dependency-name: gradle/actions
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-06 23:37:44 +02:00
Nassim Jahnke d08cb1b743 Handle debug sticks with changed blocks/properties 2025-10-06 20:31:14 +02:00
Nassim Jahnke fb18f69a0b Fix world border scale in 1.21.7->1.21.9 2025-10-05 22:05:44 +02:00
Nassim Jahnke 56e1d32aa0 Implement equippable item data hashing 2025-10-05 21:35:35 +02:00
FlorianMichael d4aa5a2fb3 More fixes to team packet filtering in 1.20.3->1.20.5 (#4674) 2025-10-05 21:23:25 +02:00
Nassim Jahnke b54a87f465 Re-shuffle mapping files to reduce size, include sound identifiers 2025-10-05 15:27:32 +02:00
RK_01 5acfa9faf7 Implement 1.21.7 -> 1.21.9 debug sample subscription translation (#4668) 2025-10-05 08:48:42 +02:00
LeonTG 638f4cd19a Fix player team tracking in 1.20.3->1.20.5 packet filtering (#4673) 2025-10-05 03:41:41 +02:00
Nassim Jahnke baf12dd516 Handle particles in biome effects
Fixes #4666
2025-10-04 10:36:17 +02:00
Nassim Jahnke 4b6b26fbba Allow empty block entity mappings in item data 2025-10-03 20:02:06 +02:00
Nassim Jahnke 5c5784795d Bump version to 5.5.1-SNAPSHOT 2025-10-03 20:01:35 +02:00
Nassim Jahnke 1f8e7515b1 5.5.0 Release 2025-10-03 13:46:23 +02:00
Nassim Jahnke 3778698018 Fix resolvable profile type order 2025-10-03 13:46:23 +02:00
Nassim Jahnke 40dd2be139 Prepare for the release later 2025-10-03 13:46:23 +02:00
FlorianMichael edbe2c92ce Add entity identifier when downgrading entity data components 2025-10-03 13:46:23 +02:00
Nassim Jahnke b9ae1ef43e Handle unknown block entity/entity types 2025-10-03 13:46:23 +02:00
Nassim Jahnke 4631fd1977 Remove unhandled compound tag entity data from bad packets 2025-10-03 13:46:22 +02:00
Nassim Jahnke 3d25686745 Handle key changes in item_model 2025-10-03 13:46:22 +02:00
Nassim Jahnke 18b5b2626a Remove snapshot bit 2025-10-03 13:46:22 +02:00
Nassim Jahnke 219ad4737a 1.21.9-rc1 2025-10-03 13:46:22 +02:00
riku6460 b9368ae80a Fix lighting in the end dimension in 1.21.7->1.21.9 2025-10-03 13:46:22 +02:00
Nassim Jahnke 03c80ccff8 1.21.9-pre4 2025-10-03 13:46:22 +02:00
Nassim Jahnke f6aed5578f 1.21.9-pre3 2025-10-03 13:46:21 +02:00
Nassim Jahnke 646de0b1af Handle changed bees data 2025-10-03 13:46:21 +02:00
Nassim Jahnke 4e33a40ede 1.21.9-pre2 2025-10-03 13:46:21 +02:00
Nassim Jahnke 21b0ac7a43 1.21.9-pre1 2025-10-03 13:46:21 +02:00
Nassim Jahnke 15d3944700 Fix mannequin entity data reading 2025-10-03 13:46:21 +02:00
Nassim Jahnke acd9a6f57c 25w37a 2025-10-03 13:46:20 +02:00
Nassim Jahnke d5fe4e22b4 25w36a/b 2025-10-03 13:46:20 +02:00
Nassim Jahnke 9f0c38915a 25w35a 2025-10-03 13:46:20 +02:00
Nassim Jahnke bc7f081b3a I figured out the magic numbers 2025-10-03 13:46:20 +02:00
Nassim Jahnke 46b6627f9f 25w34b
Minus some dynamic player profile stuff
2025-10-03 13:46:20 +02:00
Nassim Jahnke 51cc1843ad 25w33a 2025-10-03 13:46:19 +02:00
Nassim Jahnke 98d1d2cb49 25w32a 2025-10-03 13:46:19 +02:00
Nassim Jahnke 556560a0f3 25w31a 2025-10-03 13:46:19 +02:00
FlorianMichael be2534c6e6 Add missing game test payload sanitize in 1.20->1.20.2 (#4661) 2025-10-02 16:14:50 +02:00
RaynLegends d40d1bd232 Fix system messages sent during config state hidden on <= 1.12.2 servers (#4650)
Fixes ViaVersion/issues#4478
2025-09-21 18:32:14 +02:00
Nassim Jahnke 6143f78ccf Update dependencies 2025-09-20 22:36:43 +02:00
EnZaXD 52cdebc3d3 Execute stored object clear call inside the event loop (#4652)
This fixes NPE exceptions when players disconnect. A packet goes through the pipeline after setActive(false) was called causing NPE exceptions.
2025-09-20 22:35:47 +02:00
EnZaXD cdccae95e0 Remove serialize versions from item hasher (#4651) 2025-09-16 21:24:42 +02:00
EnZaXD b0c45e3ed3 Fix wrong shulker box mapping in 1.12.2->1.13 (#4641)
Closes https://github.com/ViaVersion/ViaVersion/issues/4636
2025-09-14 18:53:16 +02:00
EnZaXD 3ba518650c Filter invalid remove teams packets in 1.20.3->1.20.5 (#4643)
Closes https://github.com/ViaVersion/ViaVersion/issues/4564
2025-09-13 11:23:18 +02:00
Nassim Jahnke 5a303996a1 Cleanup and fixes to storable object task 2025-09-05 19:35:04 +02:00
FlorianMichael 695534e8a8 Don't run movement transmitter provider in netty thread 2025-09-05 19:02:51 +02:00
EnZaXD 16ba011243 Rename ProtocolRunnable, always submit tick logic into event loop (#4644) 2025-09-03 17:05:53 +02:00
Nassim Jahnke 0ea7271157 Update deps 2025-09-03 07:42:12 +02:00
EnZaXD dc2b2f1407 Rename RedirectProtocolVersion (#4642) 2025-09-01 21:01:30 +02:00
Nassim Jahnke 85baefc69b Log channel close outside of event loop when debug is enabled 2025-08-31 22:39:15 +02:00
riku6460andFlorianMichael 41e0fdc20f Add EntityTracker#clear and clear entities on entering configuration state (#4638)
Co-authored-by: FlorianMichael <florian.michael07@gmail.com>
2025-08-29 17:15:39 +02:00
dependabot[bot] 5c328fba33 Bump actions/setup-java from 4 to 5 (#4637)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 4 to 5.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-26 15:35:43 +02:00
EnZaXD 91b11878fb Fix ViaAPI#getConnection javadoc and remove not needed code (#4635) 2025-08-20 17:38:19 +02:00
Nassim Jahnke 0ea5e07d63 Don't replace velocity servers section when merging with default config 2025-08-19 16:14:03 +02:00
Nassim Jahnke 152e4e77a8 Handle custom name in banner etc. in 1.21.4->1.21.5
Newer clients handle errors gracefully and will parse them okay, but this'll make sure they are properly set
2025-08-17 16:41:26 +02:00
Nassim Jahnke cf20c6397d Fix spawn_particles key 2025-08-15 08:35:34 +02:00
Nassim Jahnke 981672e2cf Update particle types in enchantments 2025-08-14 18:22:55 +02:00
dependabot[bot] d10b600e72 [ci skip] Bump actions/checkout from 4 to 5 (#4627)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-12 08:23:33 +02:00
Nassim Jahnke de9cec36c7 Don't hash empty items in container 2025-08-10 15:39:45 +02:00
Nassim Jahnke 6eb561607c Fix bad reference 2025-08-10 15:12:22 +02:00
Nassim Jahnke db3e1f605a Fix hashing of maps in lists 2025-08-10 15:04:39 +02:00
Nassim Jahnke 31583fc2d3 Update deps 2025-08-09 18:43:37 +02:00
Nassim Jahnke 6096ce4eea Add option to log blocked joins
Closes #4613
2025-08-09 18:21:15 +02:00
Nassim Jahnke 873da12233 Check if custom_name lock data is actually present in 1.21.2
Fixes #4622
2025-08-09 17:50:04 +02:00
EnZaXD 78191ea366 [ci skip] Gradle & Shadow 9.0.0; Rewrite .gitignore file (#4606) 2025-08-09 14:18:03 +02:00
EnZaXD f8d7c5c193 [ci skip] Fix packet id comments (#4621) 2025-08-09 13:11:52 +02:00
EnZaXD bc9c979e7d Don't make the protocol pipeline depend on simple protocol (#4619) 2025-08-08 18:59:19 +02:00
EnZaXD d686a9ddf0 Move protocol logger creation to AbstractProtocol#createLogger (#4620)
Allows VB to delegate the used logger to the VB platform logger
2025-08-08 15:36:25 +02:00
EnZaXD 9dd610605f Don't put legacy show_text value through json conversion in 1.21.1->.5 (#4611) 2025-08-05 09:19:31 +02:00
EnZaXD 219e163ac2 Add statistic mappings for 1.21.5->1.21.6 (#4609) 2025-08-03 09:33:56 +02:00
EnZaXD 925e7b4664 Add some backwards compatibility functions to PacketTracker (#4607) 2025-08-02 15:09:46 +02:00
criticalcynical 5a9f040af8 Fix wrong connections being removed when switching servers on proxy platforms (#4576) 2025-07-29 20:35:20 +02:00
Nassim Jahnke 992ad7f35a Fix max packet size check 2025-07-29 20:28:37 +02:00
EnZaXD bb93ac011c Null check original root section (#4604) 2025-07-29 19:38:13 +02:00
Nassim Jahnke 4070ea9f02 Revamp max-pps config
Add a config section for setting max packet size, add a toggle for disabling each tracker fully
2025-07-29 12:27:51 +02:00
EnZaXD 499efa1608 Convert HIDE_ADDITIONAL_TOOLTIP in both directions in 1.21.4->1.21.5 (#4600) 2025-07-29 12:19:10 +02:00
Nassim Jahnke 0196d9c83e Bump version to 5.5.0-SNAPSHOT 2025-07-29 12:11:59 +02:00
Nassim Jahnke 4c316de042 5.4.2 Release 2025-07-23 23:03:10 +02:00
EnZaXD 8ee5d7e680 Add missing biome name translations in 1.17.1->1.18 (#4597) 2025-07-22 20:50:33 +02:00
Nassim Jahnke 64c128d414 Fix 1.8/1.9 thrown potion entity data handling
Fixes #4596
2025-07-21 23:55:03 +02:00
Nassim Jahnke 77d11fc593 Update attribute modifier types in show item hovers
Fixes #4593
2025-07-18 20:50:46 +02:00
Nassim Jahnke 2c72a09809 Strip namespace from custom attribute id when getting names 2025-07-18 11:01:52 +02:00
Nassim Jahnke 3dbd81da76 [ci skip] Split up publishing steps
Putting them into the same step meant if one publish action failed, the second one wouldn't run. Before this change, Modrinth would often block Hangar from publishing
2025-07-17 16:10:15 +02:00
Nassim Jahnke a0116c7ea7 Add 1.21.8 version string to 1.21.7 2025-07-17 14:33:58 +02:00
Nassim Jahnke fd5dadbe01 [ci skip] Clean up imports 2025-07-14 12:36:56 +02:00
Kai df87a02c38 Update ViaNBT (#4585) 2025-07-14 12:25:59 +02:00
EnZaXD bb293b3e5d Add cancel-swing-in-inventory option for 1.15.2->1.16 inventory swing fix (#4587) 2025-07-14 12:24:53 +02:00
EnZaXDanddewgs ff03892b25 Fix some directions not being included in chunk-border-fix; Reduce packets sent by checking for needed chunks (#4586)
Co-authored-by: dewgs <23721849+dewgs@users.noreply.github.com>
2025-07-14 12:21:28 +02:00
EnZaXD eb51306d82 Fix ItemFactory#getSpawnEgg NoSuchMethodError on older Paper builds (#4582) 2025-07-13 08:40:09 +02:00
EnZaXD 81eb3362f3 [ci skip] Add Java resolving plugin (#4577) 2025-07-12 10:31:23 +02:00
EnZaXD 7f06b03453 Remove StorableObject#clearOnServerSwitch (#4583) 2025-07-12 10:30:30 +02:00
RK_01 c16432de2a Fix anticheat flags when respawning with 1.21.2+ clients on older servers (#4573)
Fixes #4572
2025-07-07 21:40:01 +02:00
Nassim Jahnke b162dbdff0 Add missing null check to allowed_entities rewrite
Fixes #4568
2025-07-05 13:55:55 +02:00
Nassim Jahnke dfbe57e304 Rewrite Equippable allowed_entities
Fixes #4567
2025-07-04 17:17:05 +02:00
Nassim Jahnke 6f6dc2c641 Rewrite attribute modifiers automatically via interface
An id change in 1.21.5->1.21.6 was missed
2025-06-30 21:27:00 +02:00
Nassim Jahnke 06990ec0c9 Bump version to 5.4.2-SNAPSHOT 2025-06-30 21:26:14 +02:00
Nassim Jahnke 351b42b5e5 5.4.1 Release 2025-06-30 09:56:25 +02:00
Nassim Jahnke 20e3c832fb 1.21.7-rc2 2025-06-30 09:49:48 +02:00
Nassim Jahnke ec9c121da2 1.21.7-rc1 2025-06-30 09:49:47 +02:00
FlorianMichael 12c773edea Add missing translatable mappings (#4542)
Fixes #3331
Fixes #4273
2025-06-30 09:47:33 +02:00
Nassim Jahnke 97b411aa6d Manually handle text component boolean entries
Fixes #4558
2025-06-29 16:36:12 +02:00
Nassim Jahnke 24f6c4f0fd Implement hashing for potion contents 2025-06-29 15:50:56 +02:00
FlorianMichael 9409c7d22a [ci skip] Add SECURITY.md (#4520) 2025-06-29 15:36:49 +02:00
FlorianMichael 17d94a17f0 Always write length in LengthPrefixedTagType 2025-06-29 11:51:38 +02:00
riku6460andFlorianMichael a1cb4d3691 Add Types#CUSTOM_CLICK_ACTION_TAG for VB (#4557)
* Add LengthPrefixedTagType for CUSTOM_CLICK_ACTION

* Move type into own class, add instance into Types

---------

Co-authored-by: FlorianMichael <florian.michael07@gmail.com>
2025-06-29 07:21:48 +02:00
Nassim Jahnke 1d5070a480 Allow mapping sound event holders to empty sounds 2025-06-27 10:24:34 +02:00
FlorianMichaelanddewgs f612adbd0a Rewrite player & display name in player info packet in 1.12.2->1.13 (#4550)
Fixes Tablist plugins on some servers breaking since the game profile name sent is used to determine the scoreboard team which name we rewrite in other packets, also adds missing component rewriter calls to the display names (Not that important given its only translation keys, but we are already here).

Co-authored-by: dewgs <23721849+dewgs@users.noreply.github.com>
2025-06-25 13:31:17 +02:00
FlorianMichael 6716beec5a Remove arbitrary chat-nbt-fix config option in 1.11.1->1.12 (#4551) 2025-06-25 13:28:23 +02:00
Nassim Jahnke d22b00e4a6 Add helper methods for registry entry rewriting 2025-06-22 22:53:08 +02:00
Nassim Jahnke fe9ca49920 Update mcstructs 2025-06-22 10:38:33 +02:00
PacksoliteandNassim Jahnke e1837dc578 Fix legacy block picking on some Paper forks (#4496)
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
2025-06-21 11:22:22 +02:00
booky 66eead2927 Fix missing clouds in 1.21.5->1.21.6 (#4538) 2025-06-21 11:00:19 +02:00
booky 937a2a2532 Fix server links button not visible in 1.21.5->1.21.6 (#4536)
The Minecraft 1.21.6 client will only show the server links if the the server_links dialog has been sent
2025-06-21 01:47:34 +02:00
Nassim Jahnke bee45ef9ef Use Cache get instead of Map compute
This may or may not fix concurrency issues from... somewhere (bad plugins/old guava impl?)
2025-06-20 21:40:37 +02:00
FlorianMichael 1946a65ab2 Add MathUtil#ceil 2025-06-20 21:36:44 +02:00
Nassim Jahnke f594a946d4 Bump version to 5.4.1-SNAPSHOT 2025-06-20 21:36:33 +02:00
Nassim Jahnke 7a0ec492d1 5.4.0 Release 2025-06-20 19:26:25 +02:00
Nassim Jahnke b4fac61eb9 Fix tinted leaves particle reading in 1.21.6 type 2025-06-20 19:26:19 +02:00
Nassim Jahnke 7817b7a422 Remove snapshot version 2025-06-17 02:14:13 +02:00
Nassim Jahnke ed266d296e 1.21.6-rc1 2025-06-17 02:13:06 +02:00
Nassim Jahnke 3ce324c1e1 1.21.6-pre4 2025-06-17 02:13:06 +02:00
Nassim Jahnke 835dc4733d 1.21.6-pre3 2025-06-17 02:13:06 +02:00
Nassim Jahnke aa66a6b482 1.21.6-pre2 2025-06-17 02:13:05 +02:00
Nassim Jahnke 406855d427 1.21.6-pre1 2025-06-17 02:13:05 +02:00
Nassim Jahnke fe5ba84f7a 25w21a 2025-06-17 02:13:05 +02:00
Nassim Jahnke f49495162b Use updated versioned types 2025-06-17 02:13:05 +02:00
Nassim Jahnke be5c451f42 25w20a 2025-06-17 02:13:05 +02:00
Nassim Jahnke 1517596a9f Add hashed item handling 2025-06-17 02:13:05 +02:00
Nassim Jahnke 6a89b84879 Fix attribute modifier writing 2025-06-17 02:13:05 +02:00
Nassim Jahnke c414458f1c 25w19a 2025-06-17 02:13:05 +02:00
Nassim Jahnke ec9086abc4 25w18a 2025-06-17 02:13:05 +02:00
Nassim Jahnke d6c16677fc 25w17a 2025-06-17 02:13:05 +02:00
Nassim Jahnke 7cd3a75ef8 Handle player_command change 2025-06-17 02:13:05 +02:00
Nassim Jahnke 0677cbaa3c 25w16a 2025-06-17 02:13:05 +02:00
Nassim Jahnke ab8b5abc48 25w15a
Is it 1.22? Is it 1.21.6? Who knows
2025-06-17 02:13:05 +02:00
FlorianMichael 60c67659d0 Filter invalid characters in command click events in 1.21.4->.5 (#4528)
Minecraft versions prior to 1.21.4 filter out invalid characters when handling the click event on the clientside while 1.21.5+ validates and throws in the network codec per ExtraCodecs#CHAT_STRING
2025-06-15 12:28:08 +02:00
dewgsandFlorianMichael 814190c2df Add missing dimension change checks for entity tracking (#4527)
Co-authored-by: FlorianMichael <florian.michael07@gmail.com>
2025-06-14 17:29:40 +02:00
RK_01 04d647bfef Fix respawning with 1.21.2+ clients on older vanilla servers (#4509) 2025-06-12 18:18:37 +02:00
FlorianMichael 930bf67229 Don't always send player inputs on Fabric servers in 1.21->1.21.2 (#4523) 2025-06-11 02:52:21 +02:00
FlorianMichael 51c3085180 Validate tag identifiers in block predicates in 1.20.3->1.20.5 (#4522)
As usual, versions <= 1.20.4 have the entire parsing code in a try catch block while 1.20.5+ needs valid data.

Closes https://github.com/ViaVersion/ViaVersion/issues/4515
2025-06-09 15:08:00 +02:00
FlorianMichael b981223e0a Make workflows manual runnable (#4521) 2025-06-08 23:56:14 +02:00
FlorianMichael 3951cff03a Cancel out unmapped (block) ids in HolderSetImpl (#4512)
In VB, mapping data will return -1 for missing block ids (which is for almost all blocks the case). This is made so that VV rewriters can cancel these blocks away nicely (as mostly used in places where it's better to show the user nothing rather than wrong blocks, such as statistics).

Fixes https://github.com/ViaVersion/ViaVersion/issues/4510
2025-05-28 07:41:21 +02:00
Nassim Jahnke 77a6ae37c0 Fix game profile null id hashing
Fixes #4506
2025-05-27 15:28:35 +02:00
Nassim Jahnke 12e201633f Fix rabbit variant hashing 2025-05-27 14:28:04 +02:00
Nassim Jahnke 8eb005e775 Fix tropical fish pattern hashing 2025-05-27 14:05:40 +02:00
RK_01 4d39c0007f Add QoL API for GameProfile (#4505) 2025-05-27 08:39:08 +02:00
FlorianMichael d9609e60b8 Don't fail on book pages rewrite in 1.8->1.9 as per Vanilla behaviour (#4504) 2025-05-26 20:22:29 +02:00
Nassim Jahnke ab3927dff7 Implement our own hash writing
This avoids a lot of indirection, wrapping/boxing and data copying while also making sure we can immediately implement them on new snapshots without waiting for a separate (also ever-growing) library.

The HashBuilder is partially copied from MCStructs, everything else was built anew to intentionally stay away from Vanilla's Codec design
2025-05-26 12:37:58 +02:00
FlorianMichael 1a60c52fa3 Don't convert creative-slot-lock/map-post-processing in 1.20.3->.5 (#4500) 2025-05-22 21:38:18 +02:00
github-actions[bot]andgradle-update-robot f88dae1828 Update Gradle Wrapper from 8.14 to 8.14.1 (#4501)
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2025-05-22 17:35:05 +02:00
Nassim JahnkeandFlorianMichael 2626773267 Refactor 1.20.5+ versioned types
Co-authored-by: FlorianMichael <florian.michael07@gmail.com>
2025-05-17 15:12:52 +02:00
Nassim Jahnke f16f1905b7 Move container handling into handleShowItem directly
Fixes ViaVersion/ViaBackwards#1010
2025-05-15 11:08:44 +02:00
Nassim Jahnke cc435b2b02 Move item id setter below backup method 2025-05-14 14:01:03 +02:00
Nassim Jahnke eb2d603aae Add protected handleRewritablesToServer method 2025-05-14 13:29:40 +02:00
Nassim Jahnke c30e0f45bc Split up item rewriter methods even more
Item backups and its restoration processes have to be more carefully placed around Rewritable handling, so the original/restored data stays untouched
2025-05-14 13:22:32 +02:00
Nassim Jahnke ebb24c73a2 Don't call super handleItemToClient with custom item hasher 2025-05-13 23:12:06 +02:00
Nassim Jahnke 575c5b9abf Move restoreBackupData call up 2025-05-13 22:55:46 +02:00
Nassim Jahnke 812694d74d Split updateItemDataComponents in two 2025-05-13 22:45:25 +02:00
Nassim Jahnke 1efaffbc7d Implement more data conversion
Most importantly attributes
2025-05-12 18:59:41 +02:00
FlorianMichael b03b5f7da7 [ci skip] Make the runViaProxy task work with Gradle's configuration cache (#4483) 2025-05-12 17:53:54 +02:00
Nassim Jahnke 3554db9e3a Prepare for hashed item rewriting 2025-05-11 23:10:20 +02:00
Nassim Jahnke a6d58fc02b Only track item when necessary, cleanup 2025-05-11 23:10:18 +02:00
RaphiMC e2045295a0 Hash item data components in 1.21.4->1.21.5 2025-05-11 23:10:17 +02:00
FlorianMichael a6b219c0df [ci skip] Allow build if Git is not installed or the project is downloaded as code zip (#4477) 2025-05-11 22:26:35 +02:00
FlorianMichael 0b5721d81e Check for non-negative value for damage & repair cost in 1.20.3->.5 (#4491)
In 1.20.5, codecs introduced the non-negative int type which will fail if a value <= 0 is present. In 1.20.4, Mojang gracefully handled negative values

Fixes https://github.com/ViaVersion/ViaFabricPlus/issues/763
2025-05-11 22:05:59 +02:00
FlorianMichael 5bad61e210 Don't perform length validation on zero bit storage in 1.18 palette type (#4479)
Minecraft has its own ZeroBitStorage type for this case so we don't need to perform the validation, also removed the comments as this is just how our code should work to match Vanilla behaviour (at least for the first one; I did not verify the readValues code)

Closes https://github.com/ViaVersion/ViaVersion/issues/4476
2025-05-05 21:06:37 +02:00
FlorianMichael e597d8faaa [ci skip] Include platform launcher runtime dependency for tests (#4474) 2025-04-29 10:21:30 +02:00
FelixandFlorianMichael d9eb7109bd Add missing PLAYER_CHAT handlers in 1.20/1.21 versions (#4472)
Co-authored-by: FlorianMichael <florian.michael07@gmail.com>
2025-04-28 11:57:10 +02:00
github-actions[bot]andgradle-update-robot 77d68306b6 Update Gradle Wrapper from 8.13 to 8.14 (#4471)
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2025-04-26 16:33:53 +02:00
FlorianMichael 16aec9c0a1 Fix legacy item/entity hover event + potion id in 1.21.4->1.21.5 (#4469) 2025-04-23 20:52:53 +02:00
FlorianMichael c6cde5fc10 Cancel unknown block entities in BlockRewriter#registerBlockEntityData (#4466) 2025-04-22 16:05:44 +02:00
Nassim Jahnke bf84eb0141 Add separate config option for text component conversion errors 2025-04-20 15:57:22 +02:00
Nassim Jahnke 4dfc3bd2be Make parts of item data component rewriting more generic via an interface 2025-04-16 10:59:20 +02:00
Nassim Jahnke b0c53ffdd3 Make helper method in Copyable static 2025-04-15 21:20:57 +02:00
Nassim Jahnke d65b2abc46 Ignore invalid data in signs 2025-04-15 20:46:13 +02:00
Nassim Jahnke 03313a1681 Catch text conversion errors 2025-04-15 10:02:00 +02:00
Nassim Jahnke 78c5e2c8e3 Convert hover events to legacy deep 2025-04-14 08:57:04 +02:00
FlorianMichael e467c7c03f Set correct data types in 1.8->1.9 CONTAINER_CLICK (#4460) 2025-04-14 08:55:45 +02:00
Nassim Jahnke 0c01425641 5.3.2 Release 2025-04-13 15:45:15 +02:00
Nassim Jahnke 01d26e7ac5 Make trimStrings public 2025-04-12 15:37:19 +02:00
Nassim Jahnke 99ea6c32ad Add client and server protocol to informative exception data 2025-04-11 22:20:38 +02:00
Nassim Jahnke cf231d92b1 Update mcstructs
Fixes ViaVersion/ViaBackwards#988
2025-04-10 18:58:23 +02:00
FlorianMichael f555188428 [ci skip] Print correct max read length in StringType sanity checks (#4456) 2025-04-10 16:16:46 +02:00
FlorianMichael 93d6fa2e78 Only add (block) entity id if needed for tooltips in 1.20.3->.5 2025-04-09 17:22:33 +02:00
Nassim Jahnke 162fcafb36 Ignore unknown entity data too in 1.20.3->1.20.5
Fixes #4433
Closes #4451
2025-04-09 16:24:03 +02:00
FlorianMichael 3d0a0fe590 Send player input every tick when in boat in 1.21->1.21.2 (#4449) 2025-04-09 16:14:07 +02:00
bookyandFlorianMichael b06556a84e Fix advancement menu background keys (#4454)
Co-authored-by: FlorianMichael <florian.michael07@gmail.com>
2025-04-09 15:56:06 +02:00
Nassim Jahnke ac8bb104b3 Fix primitive array copying 2025-04-08 15:54:02 +02:00
FlorianMichael 4b85ca7691 Fix handling of removed item components in 1.20.3->.5 component rewriter (#4452)
Only relevant for VB though as VV will never put empty structured data through it.
2025-04-08 15:34:30 +02:00
FlorianMichael ebd8eb79c1 Use correct version in json to tag conversion in 1.21.4->.5 (#4450) 2025-04-08 15:32:07 +02:00
Nassim Jahnke 09cffbfb33 Null check connection in Velocity connect listener 2025-04-05 18:35:24 +02:00
FlorianMichael 49a1bffc98 Only send the connection details if ViaVersion is active (#4434) 2025-04-05 11:54:06 +02:00
FlorianMichael da022a0b63 [ci skip] Fix ItemRewriter#registerContainerClick1_21_5 data order (#4435) 2025-04-05 11:53:36 +02:00
Nassim Jahnke 3beddaf522 Move show item container contents conversion to the right place
Fixes #4444
2025-04-05 11:53:08 +02:00
Nassim Jahnke 70139c6838 Bump version to 5.3.2-SNAPSHOT 2025-04-05 11:52:24 +02:00
Nassim Jahnke f040077c13 5.3.1 Release 2025-03-30 21:07:54 +02:00
Nassim Jahnke 1f404820b7 Track it on 1.21.4 servers already 2025-03-30 18:51:03 +02:00
Nassim Jahnke 742e70fff6 Small cleanup, track gamemode 2025-03-30 18:26:05 +02:00
Nassim Jahnke dd6a1a7f6e Update old version warning to <1.16 servers
The original <1.13 warning was added almost 5 years ago, since then more small issues have come up from newer clients having fundamental changes and server stats on those old versions have dropped even more. That said, ViaVersion will keep working on these servers presumably forever
2025-03-30 16:02:27 +02:00
Nassim Jahnke 08ef7c2f35 Add back legacy hover event conversion 2025-03-30 15:05:03 +02:00
Gero e128469313 Fix missing mapping of CHUNKS_BIOMES for 1.21.5 (#4425) 2025-03-30 11:56:29 +02:00
FlorianMichael cbb753271e [ci skip] Update repository declaration in GH workflow (#4424) 2025-03-29 20:28:41 +01:00
FlorianMichael 29f299d882 Update MCStructs to 3.0.0 (#4422) 2025-03-29 14:30:06 +01:00
Pablo Herrera 41138aabd1 Implement pick-block for legacy servers (#4412) 2025-03-29 13:07:44 +01:00
Nassim Jahnke b90f20cfeb Fix 1.20.3 disguised chat handler 2025-03-29 10:15:21 +01:00
Nassim Jahnke 585028beb7 Bump version to 5.3.1-SNAPSHOT 2025-03-29 10:14:45 +01:00
Nassim Jahnke 160eaa35aa 5.3.0 Release 2025-03-28 17:06:08 +01:00
Nassim Jahnke 9fb02581a6 Also check for hanging sign block entities 2025-03-28 17:04:59 +01:00
FlorianMichael 7d01d5363b Add TagUtil#getNamespacedTagKey and simplify code in component rewriter 2025-03-28 14:37:00 +01:00
Nassim Jahnke 8a549d7f11 And for disguised chat params 2025-03-28 14:12:41 +01:00
Nassim Jahnke 50e2db93b4 Also update name and target name 2025-03-28 14:12:41 +01:00
Nassim Jahnke 2d80c9526a Also process unsigned signed player chat 2025-03-28 14:12:41 +01:00
Nassim Jahnke 80d72121cf Check for horse saddles in entity data too 2025-03-28 14:12:41 +01:00
Nassim Jahnke ba11b3c214 Remove show_in_tooltip 2025-03-28 14:12:41 +01:00
Nassim Jahnke 2ee4c86dcb Remote snapshot version 2025-03-28 14:12:41 +01:00
Nassim Jahnke 97b8cbbc6f 1.21.5-rc2 2025-03-28 14:12:40 +01:00
riku6460 1a1ae41a7b Fix blockEntityHandler not being called when mappedId == id 2025-03-28 14:12:40 +01:00
Nassim Jahnke 2b7a86bc55 Play shield break and block sounds from entity events 2025-03-28 14:12:40 +01:00
Nassim Jahnke 175c320389 Simplify server container desync check with Paper API if present
Fixes desyncs on item drags due to missing item data for 1.21.5+ clients
2025-03-28 14:12:40 +01:00
RK_01 b22430a923 Moved hashed item conversion code into method (#16)
Allows for easy injection in platforms like ViaProxy or ViaFabricPlus
2025-03-28 14:12:40 +01:00
Nassim Jahnke c9f9e88ebe 1.21.5-rc1 2025-03-28 14:12:40 +01:00
Nassim Jahnke 7f0b3fc241 1.21.5-pre3 2025-03-28 14:12:39 +01:00
RK_01 e13b99e73a Use new blocks_attacks component for 1.8 sword blocking (#15) 2025-03-28 14:12:39 +01:00
Nassim Jahnke 304d9f04ec Send saddle equipment for pigs and striders 2025-03-28 14:12:39 +01:00
Nassim Jahnke 92b59fd904 Update dependencies 2025-03-28 14:12:39 +01:00
Nassim Jahnke 7e42ce2a5c 1.21.5-pre2 2025-03-28 14:12:39 +01:00
Nassim Jahnke d3475dc751 Fix pig saddle index 2025-03-28 14:12:39 +01:00
Nassim Jahnke cd6e5a3d7a 1.21.5-pre1 2025-03-28 14:12:38 +01:00
Nassim Jahnke 67e50ed6f4 Add missing provides_banner_patterns item data, fix entity variants 2025-03-28 14:12:38 +01:00
Nassim Jahnke 097ad1c721 Add helper methods for removing data components 2025-03-28 14:12:38 +01:00
FlorianMichael 6a4f5732e2 Handle show_in_tooltip values in chat item components 2025-03-28 14:12:38 +01:00
Nassim Jahnke 000769e7c5 Adventure mode predicate changes
🫠
2025-03-28 14:12:38 +01:00
Nassim Jahnke c725242713 Fix block entity removal OOB 2025-03-28 14:12:37 +01:00
Nassim Jahnke fd9d7d674b 25w10a 2025-03-28 14:12:37 +01:00
Nassim Jahnke 5c87388353 Update mappings 2025-03-28 14:12:37 +01:00
Nassim Jahnke 3b65720d04 Update ViaNBT 2025-03-28 14:12:37 +01:00
Nassim Jahnke 44af621c12 25w09b 2025-03-28 14:12:37 +01:00
Nassim Jahnke 4e33615d9e Update sign text 2025-03-28 14:12:37 +01:00
Nassim Jahnke a5b34b9fac 25w09a 2025-03-28 14:12:37 +01:00
Nassim Jahnke 674b81a5ce 25w08a 2025-03-28 14:12:36 +01:00
Nassim Jahnke 36a3a7bd32 Fix read of single value storage 2025-03-28 14:12:36 +01:00
Nassim Jahnke d2b2f56438 25w07a 2025-03-28 14:12:36 +01:00
Nassim Jahnke 5cb147f8c5 25w06a 2025-03-28 14:12:36 +01:00
Nassim Jahnke c1c6d7378d Fix optional holder type 2025-03-28 14:12:36 +01:00
Nassim Jahnke 3cd9d8c20b 25w05a 2025-03-28 14:12:35 +01:00
Nassim Jahnke 8faa00af14 Finish up things 2025-03-28 14:12:35 +01:00
Nassim Jahnke 2aa02cfc20 Mostly finished 25w04a 2025-03-28 14:12:35 +01:00
Nassim Jahnke 1071e68e6e Update show_text value key 2025-03-28 14:12:35 +01:00
Nassim Jahnke bcf4efacc5 Remove block entities if mapped to nothing 2025-03-28 14:12:35 +01:00
Nassim Jahnke 4ab3148dd9 25w03a 2025-03-28 14:12:34 +01:00
Nassim Jahnke b0269b53b7 Offset pig variant entity data type 2025-03-28 14:12:34 +01:00
Nassim Jahnke 5df2ffe6a8 Handle hover and click event changes
Changes to the component rewriter will be done in the public branch
2025-03-28 14:12:34 +01:00
Nassim Jahnke 0e8e58dc5c WIP 25w02a 2025-03-28 14:12:34 +01:00
FlorianMichael d1e27617a9 Update warning when no working pipe is found (#4416) 2025-03-26 21:24:19 +01:00
FlorianMichael 5ab4f49148 Add Copyable interface and unify copy() methods (#4413) 2025-03-25 16:37:00 +01:00
FlorianMichael 494da63b66 Rewrite ConnectionManager to track client/server connections (#4410) 2025-03-12 16:51:34 +01:00
Nassim Jahnke a0b0ed4b68 Make <1.21.2 container id types consistent with Vanilla again
... that's to say, to make them inconsistent thanks to special ids:
Byte:
- CONTAINER_SET_SLOT
- CONTAINER_CLICK
- PLACE_GHOST_RECIPE
- PLACE_RECIPE
- CONTAINER_BUTTON_CLICK
- CONTAINER_CLOSE (serverbound)
- CONTAINER_ACK (serverbound)
Unsigned byte (unchanged):
- OPEN_SCREEN
- CONTAINER_SET_CONTENT
- CONTAINER_SET_DATA
- HORSE_SCREEN_OPEN
- CONTAINER_CLOSE (clientbound)
- CONTAINER_ACK (clientbound)
Short (unchanged):
- SET_CREATIVE_MODE_SLOT

This doesn't change much in practice, but means it matches the Vanilla reading
2025-03-11 10:36:49 +01:00
FlorianMichael e9ec29a217 Javadoc fixes (#4391) 2025-03-08 15:21:24 +01:00
FlorianMichaelandNassim Jahnke fb5bc8254a Add connection details protocol implementation (#4371)
Adds an optional custom payload protocol which platforms can use to communicate the native version of users across backend servers, the current implementation supports Velocity by sending the player's native version to the backend servers. Platforms may call ConnectionDetails#sendConnectionDetails themselves to ensure the packet getting handled by the server.

Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
2025-03-04 15:54:37 +01:00
FlorianMichael a7bc03f6a9 Treat changes in client bound base protocol handlers as separate protocols (#4400) 2025-02-27 22:31:35 +01:00
github-actions[bot]andgradle-update-robot d1bea0326c Update Gradle Wrapper from 8.12.1 to 8.13 (#4396)
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2025-02-25 18:40:57 +01:00
Nassim Jahnke d3512c9e7f Check overrides too when removing item data 2025-02-25 13:42:52 +01:00
Nassim Jahnke 2f1f7538e5 Ignore invalid ingredients in registry data 2025-02-23 11:10:04 +01:00
FlorianMichael ac3362f950 Don't add damage types twice in 1.19.4->1.20 (#4389)
Closes https://github.com/ViaVersion/ViaFabricPlus/issues/652
2025-02-19 14:13:52 +01:00
FlorianMichael 74e510b056 Fix clientEntityId check in MovementTransmitterProvider (#4390) 2025-02-19 14:13:24 +01:00
FlorianMichael fdd263b806 Make functions optional which are not always required in ViaPlatform (#4370) 2025-02-16 13:56:32 +01:00
FlorianMichael a764cec4a9 Add DebugHandler#logPrePacketTransform/setLogPacketTransform (#4386) 2025-02-16 13:55:20 +01:00
FlorianMichael 764861e29b [ci skip] Migrate the user wiki to GitHub (#4382) 2025-02-10 15:37:14 +01:00
EnZaXD 3e946ff67e Add user feedback to /viaversion list & player if no players are found (#4369) 2025-01-31 22:36:39 +01:00
Nassim Jahnke dca45ceb0e Simplify read error 2025-01-30 17:13:12 +01:00
Florian 327ec23ae9 Add PacketTypeMap#ofUnsequenced helper function (#4368) 2025-01-30 13:51:10 +01:00
Florian 9cf7737502 Fix container hover event deserialization (#4365) 2025-01-29 15:37:38 +01:00
Florian 0c5fa1b00a Add ProtocolRunnable internal API (#4364) 2025-01-29 15:36:57 +01:00
EnZaXD 1ca075fe89 Only add minecraft:spit damage type if not sent by the server in 1.20.3->1.20.5 (#4361) 2025-01-27 22:03:12 +01:00
EnZaXD d7c50a0c06 Remove newly added registry entries when already sent be the server (#4352)
Closes https://github.com/ViaVersion/ViaFabricPlus/issues/683
2025-01-26 22:15:48 +01:00
github-actions[bot]andgradle-update-robot 0e98839cee Update Gradle Wrapper from 8.12 to 8.12.1 (#4359)
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2025-01-26 20:01:35 +01:00
EnZaXD 512ceeb401 Rewrite sound event in consumable/equippable components (#4358) 2025-01-25 22:15:55 +01:00
lowercasebtwandEnZaXD 1bf04b4769 Use "intentionally_empty" sound event for 1.8 blocking (#4357)
* Use "intentionally_empty" sound event for 1.8 blocking

* Rather use the sound identifier

---------

Co-authored-by: EnZaXD <florian.michael07@gmail.com>
2025-01-24 22:31:35 +01:00
Nassim Jahnke e24981031b Fix optional explosions hover event deserialization
Fixes ViaVersion/ViaBackwards#952
2025-01-17 12:29:20 +01:00
Nassim Jahnke 261188569d Update custom model data in items in block entities 2025-01-16 13:15:22 +01:00
EnZaXD d2f35708ed Add tag->component handlers in 1.20.5->1.21 component rewriter (#4172)
Used for hover event handling in ViaBackwards
2025-01-15 11:51:44 +01:00
EnZaXD d282f37483 Fix tracking of falling blocks (#4344)
* Fix tracking of falling blocks

Since they use the data int, we have to try get() without taking it in as it will otherwise always fail.

* Prevent server from sending bad data

* Null check
2025-01-11 23:04:22 +01:00
Nassim Jahnke b244776cc9 Move up method to ComponentRewriter interface 2025-01-10 21:25:38 +01:00
Nassim Jahnke 3418e2c21a Prepare ComponentRewriter for 1.21.5 changes 2025-01-10 20:56:36 +01:00
EnZaXD d05bdd9eda Keep empty items in CONTAINER in 1.20.3->1.20.5 (#4338) 2025-01-10 17:43:12 +01:00
EnZaXD a92e75b8cc Properly track minecart object entity types in <= 1.12.2 (#4339) 2025-01-10 17:07:09 +01:00
Nassim Jahnke 280b1476ed 5.2.1 Release 2025-01-01 21:18:54 +01:00
Nassim Jahnke 9f6e7fa4e5 [ci skip] Update copyright header 2025-01-01 12:31:22 +01:00
Nassim Jahnke 7ea38a9447 Mark publish tasks as not compatible with config cache for now 2024-12-29 13:47:53 +01:00
Nassim Jahnke 30df64b4d4 Enable configuration cache 2024-12-29 12:52:05 +01:00
EnZaXD 73286fd946 Send op permission level 4 in 1.8->1.9 (#4328) 2024-12-23 14:41:09 +01:00
EnZaXD 82373acf44 Add ComponentRewriter#convertLegacyEntityContents, cleanup 1.20.5 rewriter class (#4311)
Moves the value->contents transition for entities to the common rewriter class for VB and cleans up the ComponentRewriter1_20_5 class to use the new handleShowItem
2024-12-22 11:40:05 +01:00
github-actions[bot]andgradle-update-robot 3aa3e3d2f9 Update Gradle Wrapper from 8.11.1 to 8.12 (#4327)
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2024-12-22 03:25:07 +01:00
EnZaXD 33d2376e5c Upload artifacts to GitHub on the dev repository (#4325) 2024-12-21 20:08:31 +01:00
EnZaXD 5aae4ab10a Reuse sound rewriter instance in 1.21->1.21.2 (#4323) 2024-12-21 10:19:56 +01:00
Kichura c17b6c5099 [ci skip] Migrate to the setup-gradle action (#4318) 2024-12-17 00:46:05 +01:00
RK_01 e41e8dfd63 Fix handshake packet transfer handling (#4317) 2024-12-16 19:31:05 +01:00
Kichura ce26107730 [ci skip] Do not persist credentials in checkout action (#4315) 2024-12-15 18:30:01 +01:00
EnZaXD 60dd68184d Don't rewrite and track entity data if unnecessary (#4314) 2024-12-15 18:23:01 +01:00
EnZaXD 08b921729d Fix entity defaults across all protocols (#4312)
Minecraft <= 1.13.2 silently ignores unknown entity type ids and doesn't print any warning, while we currently still track them. Minecraft 1.14+ will spawn a pig if the entity type is invalid while we track ENTITY as wrong type. Both cases can cause various entity data issues where the server sends wrong data for non-existing entities while we still handle it.
2024-12-15 10:12:05 +01:00
EnZaXD 3b27af0964 Mark ViaPlatform#isPluginEnabled as deprecated (#4313) 2024-12-15 10:06:57 +01:00
Nassim Jahnke 742911a679 Use correct entity data types class in Types1_21_4
Fixes painting variants on dropped items
2024-12-15 10:06:20 +01:00
Nassim Jahnke 4773ba41cf Replace wiki.vg links 2024-12-10 15:50:38 +01:00
Nassim Jahnke f2456abd5b Handle supported/primary items in registry data
Fixes ViaVersion/ViaBackwards#928
2024-12-10 11:30:03 +01:00
Nassim Jahnke 366675f7f8 Make pick item provider Folia-compatible 2024-12-09 15:47:42 +01:00
Nassim Jahnke bccbf80446 [ci skip] Update bug report template 2024-12-09 11:22:22 +01:00
Rocco 75c6662665 Sword blocking: consumables for 1.21.4+, back to shields for 1.20.5-1.21.3 (#4299) 2024-12-09 11:08:51 +01:00
riku6460 813cf813cf Fix method checks in BukkitPickItemProvider (#4301) 2024-12-07 14:02:15 +01:00
booky10 037410d405 Fix item meta not being saved when including block state data (#4298) 2024-12-06 18:53:53 +01:00
riku6460 c9d5632143 Fix slot index check (#4296) 2024-12-06 17:04:30 +01:00
Nassim Jahnke fd164d20e7 Bump version to 5.2.1-SNAPSHOT 2024-12-06 17:03:29 +01:00
Nassim Jahnke 488a6b6919 5.2.0 Release 2024-12-06 13:12:43 +01:00
Nassim Jahnke 3cd01978df Implement block and entity picking 2024-12-06 13:02:22 +01:00
Nassim Jahnke 0c4dbbe0bb Warn when not using Java 21+ 2024-12-06 10:56:14 +01:00
Nassim Jahnke 1750131831 Update FUNDING.yml 2024-12-04 22:04:55 +01:00
FlorianMichael 5ac7aaccb7 Add snapshot support section to README 2024-12-04 20:42:40 +01:00
Nassim Jahnke ae60e2f28d Update template protocol 2024-12-04 15:38:24 +01:00
Nassim Jahnke 17a73dff82 Handle set_player_inventory 2024-12-04 15:23:56 +01:00
Nassim Jahnke 5e9d213082 Remove snapshot version 2024-12-02 10:12:41 +01:00
Nassim Jahnke 210b0a6f0e 1.21.4-rc3 2024-12-01 09:38:29 +01:00
Nassim Jahnke f0f87b26d7 Fix 1.21.2 trim material override transition 2024-11-30 13:55:45 +01:00
Nassim Jahnke 45a55a81c7 1.21.4-rc2 2024-11-30 13:55:45 +01:00
Nassim Jahnke b2ec9eab50 1.21.4-rc1 2024-11-30 13:55:45 +01:00
Nassim Jahnke 2f08f0d58c Set max capacity for remaining buf
This allows the returned buffer to be a cached empty buf if the original buffer was already fully read
2024-11-30 13:55:45 +01:00
Nassim Jahnke d3f92ce9b8 Don't swap teleport accept and move packets for 1.21.4 clients
They changed it again. Probably missing the same swap in 1.21.4<->1.21.2 now
2024-11-30 13:55:45 +01:00
Nassim Jahnke cfa20ba418 1.21.4-pre3 2024-11-30 13:55:44 +01:00
Nassim Jahnke de6ac47a2f 1.21.4-pre2 2024-11-30 13:55:44 +01:00
Nassim Jahnke b41733bdf6 1.21.4-pre1 2024-11-30 13:55:44 +01:00
Nassim Jahnke 8f8bc55bd0 24w46a 2024-11-30 13:55:44 +01:00
Nassim Jahnke 81d92a728d Add old custom model data to new float list 2024-11-30 13:55:44 +01:00
Nassim Jahnke 68666d2d44 24w45a 2024-11-30 13:55:44 +01:00
RK_01 e539375143 Only apply chunk loading fix for 1.21.2 clients (#14) 2024-11-30 13:55:43 +01:00
FlorianMichael 0acec719b1 Small cleanup 2024-11-30 13:55:43 +01:00
Nassim Jahnke 93e92ffc82 Handle item name changes in trim material registry 2024-11-30 13:55:43 +01:00
Nassim Jahnke 82c55b1d78 24w44a 2024-11-30 13:55:43 +01:00
Nassim Jahnke dd660a2de0 Add missing UUID to attribute in 1.20.5->1.20.4
Fixes #4293
2024-11-30 13:54:15 +01:00
nwayo 96c12ef483 Use global region scheduler in runSync methods on Folia (#4292) 2024-11-30 13:42:59 +01:00
EnZaXD 1653de70c8 Update block connections file (#4291) 2024-11-29 17:14:43 +01:00
EnZaXD b57265e64f Send full position update packet in 1.20.5->1.21 placement rotation fix (#4290) 2024-11-29 16:02:47 +01:00
lowercasebtw 9d4af84872 Fix footstep particle causing null kick (#4287) 2024-11-28 12:05:22 +01:00
Valaphee The Meerkat 40665782e7 Rewrite ingredient items in 1.20.5 recipe rewriter (#4285) 2024-11-26 17:20:06 +01:00
Valaphee The Meerkat 2d663db53f Fix 1.12 recipes containing stone as placeholder, improve empty handling in 1.20.5/1.21.2 (#4284) 2024-11-26 17:04:50 +01:00
Nassim Jahnke 896c6accfb Fix 1.13 recipe ingredient writing 2024-11-26 16:29:44 +01:00
Valaphee The Meerkat 1785677901 Fix BlockRewriter block event handling (#4282) 2024-11-26 15:53:44 +01:00
Nassim Jahnke e32205ddaf Fix 1.21 food using_converts_to handling
Fixes #4280
2024-11-25 10:14:12 +01:00
Pablo Herrera f93c64d6aa Improve 1.21 client enchantments on legacy servers (#4255)
Signed-off-by: Pablo Herrera <pabloherrerapalacio@gmail.com>
2024-11-24 11:19:05 +01:00
github-actions[bot]andgradle-update-robot b5eb568515 Update Gradle Wrapper from 8.11 to 8.11.1 (#4279)
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2024-11-24 02:09:07 +01:00
EnZaXD 7897fca5be Add config option for 1.20.4->1.20.5 sword blocking fix (#4276) 2024-11-21 19:26:25 +01:00
EnZaXD 3ba86741f9 Send default entity data for items in 1.10->1.11 (#4265) 2024-11-18 15:05:25 +01:00
Nassim Jahnke 5515011644 Address Gradle deprecation warnings 2024-11-17 13:43:10 +01:00
DavyCraft648 f59e2a2de4 Fix Equippable allowed entities reading (#4267) 2024-11-17 12:21:02 +01:00
github-actions[bot]andgradle-update-robot 88c103c0a5 Update Gradle Wrapper from 8.10.2 to 8.11 (#4266)
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2024-11-17 12:19:47 +01:00
Nassim Jahnke 5772ee4a93 Only send tags early for 1.20.5+ clients, track early send properly in 1.20->1.20.2 2024-11-17 11:47:33 +01:00
Nassim Jahnke c525575d37 Revert hard limit in 1.17 book size check 2024-11-11 14:54:38 +01:00
Nassim Jahnke b8a170873d Add more info to missing light data warning 2024-11-11 14:38:10 +01:00
Nassim Jahnke 04e936d487 Some more pre-sizing 2024-11-11 14:33:29 +01:00
EnZaXD 6553fc9ae9 Only print invalid custom payload channel warnings in debug mode (#4257)
We previously had people complaining about this being an error and not understanding what it means + servers can't do anything about these errors anyway.
2024-11-10 21:45:06 +01:00
EnZaXD ddbe8ef0fb Apply page network limit when converting book pages in 1.17->1.17.1 (#4256) 2024-11-10 21:44:10 +01:00
EnZaXD 8e4da81022 Move config option check for placement fix into packet handlers (#4248)
Fixes the config option breaking when using the reload command, also changes the message when using the /reload sub command.
2024-11-06 15:46:11 +01:00
Pro 1620fc35f5 Change "fix-1_21-placement-rotation" to true by default (#4245) 2024-11-06 15:32:15 +01:00
Nassim Jahnke e878d77959 Trim override materials are string to string 2024-11-06 10:42:18 +01:00
Nassim Jahnke deab6a0cac Don't allocate bufs in 1.18/1.20 chunk types
Unlike Mojang, we don't sneak a byte array of data outside of the actual packet reading, so there's no reason to not just use the original buffer.
Slicing doesn't allocate anything while also setting the reader index correctly, as also used in the previous types
2024-11-05 13:43:54 +01:00
Nassim Jahnke 77f0826ec8 Skip extra buf copying entirely if wrapper had no changes 2024-11-04 22:55:40 +01:00
Nassim Jahnke 76db43cab3 Don't copy full transformed buf during every transform
The resulting modified buf is the exact same as before
2024-11-04 22:12:39 +01:00
Nassim Jahnke f0eab71644 Pre-size most allocated byte buffers
Also avoids the default allocation size of 256 bytes for bufs that are much smaller than that
2024-11-04 21:27:09 +01:00
Nassim Jahnke e9985adafc Update mcstructs 2024-11-04 20:34:03 +01:00
Nassim Jahnke 157a1fe249 Small cleanup here and there 2024-11-03 17:12:29 +01:00
Nassim Jahnke d48d0a21db Prettify error messages 2024-11-02 23:13:56 +01:00
Nassim Jahnke 908078becb Bump version to 5.1.2-SNAPSHOT 2024-11-02 22:52:47 +01:00
Nassim Jahnke d0815baac7 5.1.1 Release 2024-11-01 19:00:29 +01:00
EnZaXD bc6ad16d40 Properly remove custom_data component if we created it in 1.20.5+ protocols (#4229) 2024-11-01 18:50:54 +01:00
EnZaXD 33aecef7b3 Handle custom name in block entities in 1.12->1.13 (#4232)
Fixes https://github.com/ViaVersion/ViaFabricPlus/issues/592
2024-11-01 18:18:31 +01:00
Nassim Jahnke b7d37b16ae Correctly convert lock code to json instead
The normal codec doesn't serialize components to nbt, but to json strings in a string tag...
2024-10-31 20:01:36 +01:00
FlorianMichael 2b840abfef Check if blank, not empty 2024-10-31 19:31:34 +01:00
Valaphee The MeerkatandFlorianMichael bc4ad7faa3 Remove empty lock item components in 1.21->1.21.2 (#4228)
* Fix protocol error when an empty lock is sent

* Cleanup code

---------

Co-authored-by: FlorianMichael <florian.michael07@gmail.com>
2024-10-31 19:27:49 +01:00
EnZaXD f08a412db5 Drop idle packets where only horizontal collision changed in 1.21->1.21.2 (#4220) 2024-10-31 10:22:57 +01:00
Nassim Jahnke dcf050a604 Remove unneeded optional item type from Types1_21_2
Was only used in food properties up until 1.21.2 (luckily)
2024-10-31 09:57:04 +01:00
Nassim Jahnke 1f8d1339f5 Fix painting entity data in 1.21->1.21.2
Fixes #4227
2024-10-31 09:38:24 +01:00
Nassim Jahnke 5278f8ba65 Remove enchantments with level 0 in 1.21->1.21.2 2024-10-30 21:40:15 +01:00
RK_01 8fdae33333 Add auto start option to runViaProxy task (#4225) 2024-10-30 20:48:31 +01:00
RK_01 4054e83ffe Skip ViaProxy update check in runViaProxy gradle task (#4224) 2024-10-30 19:40:05 +01:00
RK_01 10f2cad8fd Change the consume animation of swords to block (#4223) 2024-10-30 18:21:00 +01:00
Nassim Jahnke 74b9eb9f45 Fix boat entity type check
As per usual plugins sending data for untracked entities
Fixes #4222
2024-10-30 16:47:34 +01:00
EnZaXD dde599c128 Fix boat colors not visible in 1.21->1.21.2 (#4200) 2024-10-30 10:42:27 +01:00
EnZaXD af8cbaf439 Add item fixes to component rewriter in 1.21.x protocols as well (#4217)
Adds the rarity fix in 1.20.5->1.21 and the item/custom name fix in 1.21->1.21.2 to the component rewriters / chat items.
2024-10-30 10:31:45 +01:00
Nassim Jahnke ad83d01fad Creaking transient extends creaking 2024-10-30 10:18:18 +01:00
EnZaXD 7eb3632144 Fix written_book_content and potion_contents data to tag conversion (#4218) 2024-10-30 09:40:39 +01:00
EnZaXD 1ac668d9f2 Add URL of ViaProxy to runViaProxy task (#4215) 2024-10-30 09:39:15 +01:00
EnZaXD f5033342c9 Use correct tag name for 1.21->1.21.2 item name fix (#4214) 2024-10-29 14:55:28 +01:00
RK_01 a0c0b7eff2 Add gradle task to quickly test/debug code changes (#4211) 2024-10-29 14:00:55 +01:00
Nassim Jahnke 7985b39ed5 Fix trail particle reading 2024-10-29 13:32:54 +01:00
Nassim Jahnke f26e370a49 Handle 1.21.2 block_crumble particle 2024-10-29 13:15:40 +01:00
RK_01 cb0c301baf Fix 1.21.1 -> 1.21.2 chunk loading edge case (#4212)
Will usually happen on 1.8 servers or older
2024-10-29 12:51:47 +01:00
RK_01 3858a83972 Small code cleanup (#4213) 2024-10-29 12:50:36 +01:00
EnZaXD 82ff0bae49 Fix item_name<->default name priority for items in 1.21->1.21.2 (#4208) 2024-10-29 11:56:23 +01:00
Nassim Jahnke ee16d7af28 Fix two area effect cloud item particle issues 2024-10-28 12:10:36 +01:00
Nassim Jahnke f914d57678 Small cleanup 2024-10-28 11:23:27 +01:00
EnZaXDandNassim Jahnke c13b40a373 Add ParticleRewriter base (#4203)
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
2024-10-28 11:23:02 +01:00
Nassim Jahnke d60a37f7e6 Flatten some PacketHandlers in rewriters 2024-10-27 23:07:13 +01:00
Nassim Jahnke 3caaed00dc Write enabled features as string array 2024-10-27 16:02:37 +01:00
Nassim Jahnke f56bfbebb5 Update some deps 2024-10-27 14:59:46 +01:00
EnZaXD 3eec520ebd Send enable features packet after the play login packet in 1.19.1->1.19.3 (#4205) 2024-10-27 08:42:03 +01:00
Nassim Jahnke df69f1f344 Fix InformativeException value shuffling 2024-10-26 18:55:32 +02:00
EnZaXD 009b6c810c Fix and add missing javadocs in MappingData interface (#4202) 2024-10-26 18:55:08 +02:00
EnZaXD 65b76d53ef Fix MappingDataBase#getOldBlockId implementation (#4201) 2024-10-26 17:24:34 +02:00
Nassim Jahnke 7be7139241 Handle entity type changes in show_entity hover events
Fixes #4199
2024-10-25 20:45:42 +02:00
Nassim Jahnke 9bc943ea67 Bump version to 5.1.1-SNAPSHOT 2024-10-25 20:34:55 +02:00
Nassim Jahnke f880adced2 5.1.0 Release 2024-10-25 09:24:29 +02:00
Nassim Jahnke fc07601f24 Fix glow squid index shift 2024-10-24 16:55:24 +02:00
Nassim Jahnke ecb241c187 Exclude error prone annotations
Recently added to gson, can be safely excluded
2024-10-24 12:50:36 +02:00
Nassim Jahnke 46040b1f5d Mark fallback return value in getProtocol as unknown 2024-10-23 17:04:54 +02:00
FlorianMichael 54daa11ce4 Fix ProtocolVersion#isKnown javadoc to make difference with isRegistered more clear 2024-10-23 17:02:45 +02:00
RaphiMC c556420870 Add option to construct ChunkSectionLightImpl without block light 2024-10-23 16:42:21 +02:00
FlorianMichael 84d928ebe7 Update version ranges in gradle.properties 2024-10-23 16:25:52 +02:00
FlorianMichael fa6eab5cc3 1.21.3 2024-10-23 15:42:16 +02:00
FlorianMichael 94b26a903c Check for suppress conversion warnings option in ComponentUtil functions 2024-10-22 22:31:17 +02:00
Nassim Jahnke c242456c30 Remove snapshot version 2024-10-22 17:02:14 +02:00
Nassim Jahnke 8391e9d924 Fix consumable writing 2024-10-22 13:23:06 +02:00
RK_01 f5aac9b1ab Convert all data from food component (#13) 2024-10-22 13:21:44 +02:00
RK_01 a6850392e1 Add failsafe handling to ACCEPT_TELEPORTATION packet order fix (#12) 2024-10-22 13:03:43 +02:00
RK_01 2b37178482 Fix ACCEPT_TELEPORTATION packet order (#11) 2024-10-22 11:13:45 +02:00
Nassim Jahnke 82199d9f39 1.21.2-rc2 2024-10-21 18:36:50 +02:00
FlorianMichael c2d2c6d067 Explain SerializerVersion terminology 2024-10-19 14:50:09 +02:00
FlorianMichael 4066a7b5b6 Mark serializer versions in ComponentRewriter as nullable 2024-10-19 14:43:43 +02:00
Nassim Jahnke 4a7624fef4 Update profile actions enum type 2024-10-19 13:18:14 +02:00
EnZaXD e38b3f3824 Add new PROFILE_ACTIONS_ENUM type in Types for 1.21.2+ 2024-10-19 11:45:51 +02:00
Nassim Jahnke 4573035aab 1.21.2-rc1 2024-10-17 15:28:15 +02:00
Nassim Jahnke 393a5ee973 1.21.2-pre5 2024-10-16 16:06:39 +02:00
Nassim Jahnke 080dc18165 1.21.2-pre4 2024-10-15 15:08:36 +02:00
Nassim Jahnke 6fd421d36e Fix finish configuration state change 2024-10-15 15:08:36 +02:00
Nassim Jahnke 84bd1d0782 Use recipe inputs from old recipe packet 2024-10-15 15:08:36 +02:00
Nassim Jahnke cff2303c62 1.21.2-pre3 2024-10-15 15:08:36 +02:00
Nassim Jahnke f5733c2cb8 They fixed the typo 2024-10-15 15:08:36 +02:00
Nassim Jahnke 21fec0e263 1.21.2-pre2 2024-10-15 15:08:36 +02:00
RK_01 093acc519e Fix CONTAINER_SET_SLOT translation (#9) 2024-10-15 15:08:35 +02:00
RK_01 886be3161e Fix EXPLODE knockback check and affected blocks (#8) 2024-10-15 15:08:35 +02:00
RK_01 dc7b708556 Fix PLAYER_POSITION delta movement (#7) 2024-10-15 15:08:35 +02:00
Nassim Jahnke e82f28c1ac Rewrite particles 2024-10-15 15:08:35 +02:00
Nassim Jahnke 7c7239a70d 1.21.2-pre1 2024-10-15 15:08:35 +02:00
Nassim Jahnke 3e3dad9e33 Show notification on recipe add 2024-10-15 15:08:35 +02:00
Nassim Jahnke 4871977681 Fix recipe removal array index 2024-10-15 15:08:34 +02:00
Nassim Jahnke 0a56e57aec Send stonecutter recipes 2024-10-15 15:08:34 +02:00
Nassim Jahnke a6ff477b8a Implement clientbound ghost recipe, fix null recipe groups 2024-10-15 15:08:34 +02:00
Nassim Jahnke ddad0384f3 Make recipes mostly work again 2024-10-15 15:08:34 +02:00
Nassim Jahnke aabe47f8bc Start working on recipe rewriting 2024-10-15 15:08:34 +02:00
Nassim Jahnke 354a5f1b75 Update packet id comments 2024-10-15 15:08:34 +02:00
Nassim Jahnke f58afd434d WIP 24w40a 2024-10-15 15:08:34 +02:00
Nassim Jahnke 57d5652cd5 Remove SetWrapper, moved to addon 2024-10-15 15:08:33 +02:00
Nassim Jahnke 25b521dfcf Rewrite lock nbt 2024-10-15 15:08:33 +02:00
Nassim Jahnke ce655d0679 Use absolute day time value 2024-10-15 15:08:33 +02:00
Nassim Jahnke e4e8297a82 24w39a 2024-10-15 15:08:33 +02:00
Nassim Jahnke 8357fd01aa Update attributes in item hover events 2024-10-15 15:08:33 +02:00
Nassim Jahnke 12b420d3e7 Send instrument registry, handle duration change from ticks to seconds 2024-10-15 15:08:33 +02:00
Nassim Jahnke db20bc0ae4 24w38a 2024-10-15 15:08:33 +02:00
Nassim Jahnke 2a2afa3821 Register component rewriter 2024-10-15 15:08:32 +02:00
Nassim Jahnke f0b2d9aafe 24w37a 2024-10-15 15:08:32 +02:00
Nassim Jahnke cd427a2a39 Don't use -1 to indicate no vehicle 2024-10-15 15:08:32 +02:00
Nassim Jahnke 75537d3f85 Cancel player input if not in a vehicle, fix shift/sprint input 2024-10-15 15:08:32 +02:00
Nassim Jahnke a88e2f3fb5 Set impulse to 0.98 instead of 1 as per vanilla value 2024-10-15 15:08:32 +02:00
Nassim Jahnke 8a41e7add6 Remove new item data from serverbound items 2024-10-15 15:08:32 +02:00
Nassim Jahnke 9c35228287 24w36a 2024-10-15 15:08:32 +02:00
Nassim Jahnke f9ec6b9d03 Split holder implementation 2024-10-15 15:08:31 +02:00
Nassim Jahnke 22d396d909 Add item hover event handling 2024-10-15 15:08:31 +02:00
Nassim Jahnke 39b28e21ca 24w35a, including missed change from 33a 2024-10-15 15:08:31 +02:00
Nassim Jahnke 0488cb7fbe Fix item type in 1.21.2 entity data 2024-10-15 15:08:31 +02:00
Nassim Jahnke ec4aa0637e 24w34a 2024-10-15 15:08:31 +02:00
Nassim Jahnke ffc5584b1c Null check component rewriter 2024-10-15 15:08:31 +02:00
Nassim Jahnke 45c6cfedb0 Update mappings 2024-10-15 15:08:30 +02:00
Nassim Jahnke c150e50636 Store attribute mappings in full 2024-10-15 15:08:30 +02:00
Nassim Jahnke 16e32a62e5 Bump version to 5.1.0-SNAPSHOT 2024-10-15 15:08:27 +02:00
Nassim Jahnke 1d18f2e45e Fix container id conversion and itemrewriter explosion method 2024-10-15 15:08:20 +02:00
Nassim Jahnke e46b38e58a Remove outdated todos 2024-10-15 15:08:20 +02:00
Nassim Jahnke 033741d292 WIP 24w33a 2024-10-15 15:08:20 +02:00
Nassim Jahnke 7a3ef1e0b7 5.0.5 Release 2024-10-15 10:44:03 +02:00
Nassim Jahnke 5be41ed3e9 Use stripped key in tag getting
Fixes #4182
2024-10-14 21:35:10 +02:00
Nassim Jahnke 83e44641d0 5.0.4 Release 2024-10-14 17:24:05 +02:00
Nassim Jahnke 50084c112d Fix tag related issues to prepare for 1.21.2
- Inline tag values in 1.21 enchantments
- Fix TagRewriter addTags if the server doesn't send values for a registry
- Send the tags packet in 1.12->1.13 before the play login packet to fix tracking in 1.20->1.20.2
2024-10-14 17:16:01 +02:00
EnZaXD 81682f4921 Change description of dump sub command to be more generic (#4180) 2024-10-13 10:33:58 +02:00
Nassim Jahnke 1c339e8b54 Null check input serializer version
Fixes ViaVersion/ViaBackwards#896
2024-10-11 19:37:35 +02:00
EnZaXD 1a9cda0579 Handle WRITTEN_BOOK_CONTENT component in rewriters as well (#4175)
Closes https://github.com/ViaVersion/ViaVersion/issues/4144
2024-10-10 22:42:21 +02:00
EnZaXD 6ad9a71907 Print book conversion errors to default logger in 1.20.2->1.20.3 (#4158) 2024-10-10 22:37:21 +02:00
Nassim Jahnke 9f24576ba7 Update some dependencies 2024-10-10 21:21:54 +02:00
EnZaXD 8661bbc1fc Update required ViaFabric version, don't require fabric-loader (#4174) 2024-10-10 12:26:32 +02:00
EnZaXD 0b5fa37f96 Put title directly into component in 1.8->1.9 bossbar emulation (#4173)
The JsonParser#parseString detection in CommonBoss will detect " " as valid json (JsonNull) and won't wrap it around ComponentUtil#plainToJson like it should, at some point in the future I would like CommonBoss to only accept a JsonElement instance and not raw strings anymore.

Closes https://github.com/ViaVersion/ViaFabricPlus/issues/494
2024-10-10 12:25:27 +02:00
EnZaXD dab32bafa1 Write correct on ground state in 1.20.5->1.21 placement rotation fix (#4170) 2024-10-09 16:37:30 +02:00
Nassim Jahnke 9e5c541f79 Disable placement rotation fix for now
Closes #4168
2024-10-07 21:43:20 +02:00
EnZaXD 9674c617ca Add option to fix wrong block placement rotation in 1.20.5->1.21 (#4166) 2024-10-06 15:19:05 +02:00
EnZaXD 9df1704357 Fix holder set direct id conversion in 1.20.3->1.20.5 component rewriter (#4164) 2024-10-05 21:34:34 +02:00
EnZaXD c0821de2e2 Define as Sponge plugin for ViaSponge (#4163) 2024-10-02 10:41:59 +02:00
Nassim Jahnke c358c39027 Make clearer distinction between filled and empty data component patch, simplify direct value getting 2024-09-29 13:34:32 +02:00
github-actions[bot]andgradle-update-robot 451b3a2637 Update Gradle Wrapper from 8.10.1 to 8.10.2 (#4161)
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2024-09-29 04:19:11 +02:00
Nassim Jahnke 619eecacf8 Don't add block entity tag if the id is missing 2024-09-26 12:16:06 +02:00
RK_01 6bae039d52 Update mcstructs (#4159) 2024-09-24 19:09:32 +02:00
dependabot[bot] b321029886 Bump gradle-update/update-gradle-wrapper-action from 1 to 2 (#4157)
Bumps [gradle-update/update-gradle-wrapper-action](https://github.com/gradle-update/update-gradle-wrapper-action) from 1 to 2.
- [Release notes](https://github.com/gradle-update/update-gradle-wrapper-action/releases)
- [Changelog](https://github.com/gradle-update/update-gradle-wrapper-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/gradle-update/update-gradle-wrapper-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: gradle-update/update-gradle-wrapper-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 19:44:27 +02:00
EnZaXD 5287d4fb4f Fix enchantment glint behaviour in 1.10->1.11 (#4156) 2024-09-23 19:24:46 +02:00
EnZaXD a0a2794291 Change player parent to living entity base in 1.9/1.12 entity enums (#4154) 2024-09-20 13:35:58 +02:00
EnZaXD 9e354e956e Update MCStructs (#4153) 2024-09-20 13:35:48 +02:00
EnZaXD 27033e9096 Remove transaction tracking (and cancelling) in 1.16.4->1.17 (#4140) 2024-09-15 21:52:32 +02:00
EnZaXD e436bbe375 Refactor dimension switch handling across all protocols (#4146) 2024-09-15 21:51:29 +02:00
EnZaXD 050a1dbacb Fix set equipment body slot in 1.20.3->.5 if value is not the last (#4149) 2024-09-15 19:14:42 +02:00
github-actions[bot]andgradle-update-robot ae1838d78a Update Gradle Wrapper from 8.10 to 8.10.1. (#4148)
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2024-09-15 09:51:02 +02:00
EnZaXD 7235485802 Cleanup enchantment conversion in 1.12->1.13 to match vanilla (#4147)
Closes https://github.com/ViaVersion/ViaFabricPlus/issues/560
2024-09-14 21:33:18 +02:00
EnZaXD fcb472347e Add EntityTrackerBase#hasClientEntityId and don't use -1 as not set indicator (#4143) 2024-09-14 10:45:19 +02:00
EnZaXD e0ce8cc715 Make EntityTrackerBase#clearEntities call removeEntity for all entries (#4142) 2024-09-12 22:09:52 +02:00
EnZaXD ebc0e61be8 Fix invalid book view not visible in 1.20.3->.5 (#4139) 2024-09-07 10:45:10 +02:00
Nassim Jahnke 95581a6fa5 Fix mapping reading of changed_id type 2024-09-05 10:02:55 +02:00
EnZaXD d0b49009e5 Rewrite display name component in player info packet in 1.20.3->.5 (#4136) 2024-09-04 20:27:38 +02:00
Nassim Jahnke 369b076cad Null check channel in player join listener
Fixes #3390
2024-09-03 16:43:55 +02:00
Nassim Jahnke 6555bcda74 Small cleanup to mapping file loading 2024-09-02 23:21:29 +02:00
Nassim Jahnke e537dbb024 Clean up StructuredItemRewriter, also handle sound events 2024-08-30 19:10:43 +02:00
Nassim Jahnke f92dbb655d Also cache missing protocol paths, don't reverse base protocols 2024-08-30 11:19:32 +02:00
RK_01 0b2dac9056 Copy item in Particle#copy (#4130) 2024-08-29 23:28:39 +02:00
EnZaXD 7cd5514b90 Add PacketWrapper#sendFutureRaw, cleanup login disconnect handling. (#4129)
Removes the special handling in Protocol1_8To1_9 and always send the correct/expected data by the client in ServerboundBaseProtocol1_7 itself. Also prevent sending the packet through the protocol pipeline since packet/format changes should also be handled inside the base protocol.
2024-08-29 21:46:43 +02:00
RK_01 5017d4bbb3 Add Particle#copy (#4126) 2024-08-29 15:32:28 +02:00
EnZaXD 32e51b52aa Cleanup LOGIN/STATUS packet handlers (#4113) 2024-08-28 15:52:28 +02:00
Nassim Jahnke 4f66fd793b Go back to fast entity data list iteration and mutation
This is a fairly hot method and the array list cannot be modified outside of the already managed event cancellation and provided extra list
2024-08-25 18:59:48 +02:00
Nassim Jahnke 2a71612aea Small cleanup of a few rewriters 2024-08-25 18:42:21 +02:00
Nassim Jahnke a993a08b8d Only map between different primitive types when explicitly requested
This would otherwise only happen with unsafe type usage
2024-08-24 18:00:06 +02:00
Nassim Jahnke a9c947517c Don't unnecessarily re-wrap objects in passthrough 2024-08-24 17:10:20 +02:00
Pablo Herrera 2841bf3040 Add option to hide scoreboard numbers (#4122) 2024-08-24 15:49:09 +02:00
RK_01 7edddda36e Split base protocols list (#4118) 2024-08-23 14:09:14 +02:00
RK_01 33de12ceb1 Reset reader before passing packet through protocols (#4117) 2024-08-23 09:42:50 +02:00
RK_01 f8eb57cdbb Fix 1.8->1.9 click sound mappings (#4116) 2024-08-22 19:39:09 +02:00
EnZaXD b2d523f5c0 Add more API for base protocols and skip manually added ones. (#4115) 2024-08-22 17:15:29 +02:00
EnZaXD b586b0d361 Allow client intention packet to be cancelled (#4114) 2024-08-22 10:59:35 +02:00
EnZaXD c6381e7f4d Allow protocols to handle client intention packet (#4112) 2024-08-21 19:58:32 +02:00
EnZaXD 10ee7e1930 Deprecate StoredObject#getUser (#4104) 2024-08-21 19:14:40 +02:00
EnZaXD 78abf8be00 Use RedirectProtocolVersion#getOrigin in InitialBaseProtocol if possible (#4110)
This way, we should be able to get rid of manually adding the base protocol in projects like ViaAprilFools:
https://github.com/ViaVersion/ViaAprilFools/blob/main/common/src/main/java/net/raphimc/viaaprilfools/protocol/s3d_sharewaretov1_14/Protocol3D_SharewareTo1_14.java#L87
2024-08-21 16:56:20 +02:00
EnZaXD 1dde24bb68 [ci skip] Remove outdated comments (#4111) 2024-08-21 16:56:09 +02:00
EnZaXD bc57512ca2 Allow for multiple base protocols per version (#4106) 2024-08-21 14:35:19 +02:00
github-actions[bot]andgradle-update-robot 6ad3beca76 Update Gradle Wrapper from 8.9 to 8.10. (#4105)
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2024-08-18 11:04:12 +02:00
EnZaXD 9d75125e41 Make EntityTrackerBase#entities protected (#4103) 2024-08-18 11:03:57 +02:00
RK_01 8ce4112e86 Improve/Fix 1.8->1.9 sound mappings (#4099) 2024-08-14 18:04:37 +02:00
EnZaXD 7d542d5667 Fix ComponentRewriter1_20_5#convertFood behaviour (#4095)
Closes https://github.com/ViaVersion/ViaFabricPlus/issues/517
2024-08-14 15:26:22 +02:00
EnZaXD 7d6599b90e [ci skip] Setup dependabot for GH Actions and add workflow for updating the Gradle Wrapper (#4097) 2024-08-14 15:01:57 +02:00
EnZaXD 1b03e24160 Move VV specific item handling out of component<->nbt conversion in 1.20.3->1.20.5 (#4094)
The current code backups the tag in CUSTOM_DATA inside the toStructuredItem function which in VB is used for to server packets which causes bad data, this PR moves the backup logic out to the VV specific handler and also prevents toOldItem logic for using the backup to ever get executed in VB. The counterpart PR will add proper handling for CUSTOM_DATA.

Fixes https://github.com/ViaVersion/ViaVersion/issues/4092
2024-08-14 09:31:27 +02:00
Nassim Jahnke fcd91bb855 Add item cost and particle types to item rewriter 2024-08-13 12:45:36 +02:00
Nassim Jahnke bda4ea9fd0 [ci skip] Move template protocol into common module
Had to move the rewriter classes into the flattened package to make them package private, but this is nicer than having a separate module just for those
2024-08-13 10:24:20 +02:00
FlorianMichael cbd26ce9d9 [ci skip] Link to our new website instead 2024-08-13 10:14:22 +02:00
Nassim Jahnke 8d53f4aa5a Update mcstructs 2024-08-13 09:59:59 +02:00
EnZaXD 1438f1f68d [ci skip] Update README.md (#4088) 2024-08-11 11:33:12 +02:00
RK_01 61fcf6f895 Update 1.21 version range (#4082) 2024-08-08 17:27:38 +02:00
Nassim Jahnke 736834441d [ci skip] Update shadow 2024-08-08 10:55:56 +02:00
Nassim Jahnke 3f5417be97 5.0.3 Release 2024-08-07 17:56:01 +02:00
Nassim Jahnke cc1c88001f Hotfix item id changes in item hover events 2024-08-07 17:36:42 +02:00
Nassim Jahnke 274f98c24e Fix double remapping of area effect cloud particle in 1.20.2->.3
Fixes #4042
2024-08-07 15:37:14 +02:00
Kichura f39b466ac0 Update Ubuntu, Change wrapper-validation in publish. (#4081) 2024-08-07 15:27:03 +02:00
EnZaXD aa22ca1d56 Handle pitch/yaw->data item frame rotation change in 1.16.4->1.17 (#4064)
See https://github.com/ViaVersion/ViaBackwards/pull/848
2024-08-07 13:02:51 +02:00
Nassim Jahnke 802e868b2e Track sent armor trim registries in 1.20.3->1.20.5 2024-08-07 12:36:51 +02:00
Nassim Jahnke 02442a9775 Only resend attribute modifiers when necessary
Fixes #3973
2024-08-07 11:59:13 +02:00
EnZaXD 5349de91c5 Rename CI workflow and update gradle wrapper validation (#4079) 2024-08-07 11:32:16 +02:00
Nassim Jahnke a8ef3c890a Only add dummy enchantment once 2024-08-06 15:21:18 +02:00
EnZaXD b556e6528a Rename remaining packages in bukkit modules to new format (#4074) 2024-08-05 09:48:01 +02:00
EnZaXD 434b32cad8 Fix typo in ViaManagerImpl#destroy log message (#4073) 2024-08-05 09:30:48 +02:00
EnZaXD 60b3ba6bb7 Include snakeyaml into final jar, delete compat layers (#4070)
Snakeyaml is an untypical library which most Via platforms don't have and also broke in the past with V2, having it directly in the jar like Gson cleans up the build scripts massively, reduces the build time and also doesn't break in the future if they release V3 or any other breaking changes.
2024-08-05 09:30:34 +02:00
EnZaXD 864beef341 Regenerate toString() functions and remove them from protocol internals (#4072) 2024-08-05 09:09:34 +02:00
EnZaXD 7b21df2c12 Use GH repository description in platforms (#4071) 2024-08-05 09:09:09 +02:00
Nassim Jahnke 462a10363c Only print reload info when needed, add additional log message after shutdown
Thanks to its name and dependency order, ViaVersion will generally be the last plugin to be disabled and has occasionally been blamed for other plugins stalling server shutdown
2024-08-03 20:35:22 +02:00
EnZaXD 040f85659d Fix enchantment emulation in 1.20.5->1.21 on non Paper servers (#4060) 2024-08-02 11:05:17 +02:00
Nassim Jahnke 48d5aaf8fa 5.0.2 Release 2024-07-28 14:37:59 +02:00
EnZaXD 41b0d95d70 Fix horse/llama's armor/carpet not visible in 1.20.3->1.20.5 (#4052) 2024-07-27 20:26:53 +02:00
EnZaXD b599399c48 Cleanup 1.20->1.20.2 item and recipe rewriter (#4050) 2024-07-27 19:53:59 +02:00
EnZaXD 721e27eb39 Rewrite show_item in translation components in 1.11.1->1.12 (#4053)
Fixes https://github.com/ViaVersion/ViaVersion/issues/4051
2024-07-27 19:53:44 +02:00
EnZaXD c9d6fbfcd0 Add VersionProvider#getServerProtocol (#4049)
Most platforms won't ever throw an error and usually ViaVersion shouldn't even load when the server version can't be found. Therefore, I added this bouncer function, so I don't need to try catch my code in ViaLoader/VFP where an exception is never thrown
2024-07-27 19:53:33 +02:00
RK_01 b1f64fd081 Use enhanced switches in more places (#4043) 2024-07-24 14:32:36 +02:00
EnZaXD 2b508567db Move damage types 1.20.3 into nbt file (#4026) 2024-07-24 13:13:36 +02:00
EnZaXD 24d0ae7607 Add ViaManager#addPostEnableListener (#4038) 2024-07-22 18:24:06 +02:00
EnZaXD 40a44d5dc5 Remove version type from dump (#4036) 2024-07-22 17:45:21 +02:00
EnZaXD b5a06181d4 Fix item projectile hierarchy in 1.14+ (#4034) 2024-07-22 17:44:07 +02:00
EnZaXD 35fa7e78a0 Handle attribute_modifiers inside container components in 1.21->1.20.5 (#4035)
Closes https://github.com/ViaVersion/ViaVersion/issues/3968
2024-07-22 17:42:25 +02:00
EnZaXD 7f4faab4ab Add 1.21 to the version table (#4037) 2024-07-22 17:40:37 +02:00
EnZaXD 3906b47654 Apply required changes for ViaAprilFools (#4033)
1. Allow the version provider to get the client version sent through the handshake packet
2. Allow platform to override provider instead
2024-07-21 17:45:13 +02:00
Nassim Jahnke 1476adb281 Slightly improve logging on config loading errors 2024-07-21 12:12:06 +02:00
EnZaXD 6fb072120b Removes VFP as well and recommends ViaBackwards/ViaRewind on both platforms (#4032) 2024-07-21 09:43:40 +02:00
EnZaXD f2f0be0581 Allow base protocols to set client version (#4029) 2024-07-20 09:15:15 +02:00
EnZaXD 5ec30ef18a Expose origin version in RedirectProtocolVersion (#4030) 2024-07-20 09:12:44 +02:00
Nassim Jahnke 0915afe43b Handle 1.21 attribute id changes
Fixes #4005
2024-07-19 11:26:28 +02:00
EnZaXD 87b041bf3a Fix block predicate conversion in 1.20.3->1.20.5 (#4025) 2024-07-19 11:00:00 +02:00
EnZaXD 275b09bdbb Use SerializerVersion#toTag when converting 1.20.5->1.20.3 block predicates (#4024) 2024-07-19 10:54:40 +02:00
Nassim Jahnke cc87c02020 Add shulker box block entity id if missing 2024-07-17 18:48:07 +02:00
EnZaXD a45985ed58 Validate index when reading structured data type (#4020) 2024-07-16 09:59:33 +02:00
Nassim Jahnke 92dedfb950 Update Gradle wrapper 2024-07-14 21:31:38 +02:00
RK_01 6bbcf7d784 Fix respawn "keep data" translation (#4015) 2024-07-13 11:00:12 +02:00
EnZaXD 465a2354c0 Call component rewriter in pre 1.20.3 advancement handler (#4014)
Required for ViaBackwards where we need to rewrite the translation key (and it also doesn't hurt to have this in forward protocols).

Closes https://github.com/ViaVersion/ViaBackwards/issues/819
2024-07-13 11:00:00 +02:00
EnZaXD c59c15d6f3 [ci skip] Fix player combat packet value comments (#4013) 2024-07-13 10:59:47 +02:00
EnZaXD 20f7738f08 Add cancel-block-sounds option for 1.8->1.9 place/break fix (#4011) 2024-07-12 00:11:11 +02:00
EnZaXD 323f0fa087 Remove minimize-cooldown config option (#4009) 2024-07-07 18:03:35 +02:00
RK_01 3138d667a6 Fix crossbow max damage and 1.8 sword blocking using item data components (#4010) 2024-07-07 18:02:51 +02:00
EnZaXD 365040f59d Handle rarity changes in trident/banner pattern item in 1.20.5->1.21 (#4001) 2024-07-07 17:39:30 +02:00
lowercasebtwandEnZaXD 303d9ecf51 Hide cooldown indicator completely in 1.8->1.9 (#4006)
* Change 1.8 to 1.9 Attack Speed

* Fix The Attack Speed Value Type

* Change Attack Speed to 20

Requested/Suggested change from FlorianMichael

Co-authored-by: EnZaXD <florian.michael07@gmail.com>

---------

Co-authored-by: EnZaXD <florian.michael07@gmail.com>
2024-07-06 23:12:01 +02:00
EnZaXD 463381b84e Rename missing metadata references to entity data (#4007) 2024-07-06 21:05:40 +02:00
Nassim Jahnke 7fef96d77e Remove unneeded 1.13 enchantment translatable mappings 2024-07-03 11:32:25 +02:00
Gegy 17358120cd Fix: delay chat acknowledgements instead of spoofing (#3997)
An easy reproduction case is to mute a player using the Social Interactions screen, let them chat, and then send a message. As ViaVersion produces its own acknowledgements, this now does not match with what the client produced and signed its messages with - so the signature will fail verification.

As an alternative, we *always* pass through the same acknowledgement bit set - and for 'spoofed' messages, we reuse the last one that we received. In the case of the chat ack packet with just an offset, we need to hold back the window by at least 20 messages to ensure we don't start making claims about whether the client saw a message that ViaVersion cannot yet make a judgement on.
2024-07-03 10:52:01 +02:00
EnZaXD e6da77cf47 Handle Slot tag inside CONTAINER tag in 1.20.3->1.20.5 (#3995)
Fixes shulker box tooltips not showing all items for 1.20.3 clients on 1.20.5+ servers
2024-07-02 11:53:34 +02:00
EnZaXD dc503cd613 Update legacy Minecraft version warning (#3989) 2024-06-30 11:30:54 +02:00
Nassim Jahnke 8aa2f4be46 Handle show item hovers in more component packets
Because servers do weird things
2024-06-30 11:10:44 +02:00
Nassim Jahnke c5dc5b2bf8 Actually restrict velocity change to fishing hooks 2024-06-28 15:29:06 +02:00
EnZaXD f4d6659760 Only print broken json in component type when debug mode is enabled (#3990) 2024-06-28 13:44:31 +02:00
EnZaXD bfbb80f708 Update unsupported java version warning (#3988)
Now links to the release which contains a guide on how to update
2024-06-27 14:56:15 +02:00
EnZaXD 248da118a9 Move bukkit-only settings into BukkitViaConfig (#3985) 2024-06-27 09:56:50 +02:00
EnZaXD a987882132 Rework unsupported config options in AbstractViaConfig (#3986) 2024-06-27 09:54:44 +02:00
EnZaXD bca25d4744 Rewrite filtered_pages in 1.20.2->1.20.3 (#3983) 2024-06-26 10:58:50 +02:00
EnZaXD 2417ffe483 Fixup horse inventory translation in 1.20.5->1.21 (#3980)
Fixes #3978
2024-06-25 15:27:02 +02:00
EnZaXD 8606e5d663 Handle both json and plain text in CommonBoss (#3981) 2024-06-25 15:21:34 +02:00
EnZaXD 5a0ca55b97 Add test command handler to DummyInitializer test (#3970) 2024-06-25 15:21:26 +02:00
Nassim Jahnke ceb1cffb00 Cancel "message not delivered" messages
Fixes #3438
2024-06-25 15:19:03 +02:00
Nassim Jahnke 1ff3035bc0 Make 1.10->1.11 fishing hook position desync slightly less bad 2024-06-25 15:17:29 +02:00
Nassim Jahnke 1f221ea828 Bump version to 5.0.2-SNAPSHOT 2024-06-25 15:16:36 +02:00
Nassim Jahnke dd1fad2dd7 5.0.1 Release 2024-06-22 15:53:57 +02:00
EnZaXD 245f7e24e4 Fix DummyInitializer unit test to bootstrap without errors (#3965) 2024-06-22 11:04:11 +02:00
EnZaXD 9d3db4cf97 Improve performance in ProtocolVersionRange#contains (#3964) 2024-06-22 11:02:16 +02:00
EnZaXD b67ebecce8 [ci skip] Advertise ViaLoader in README file (#3966) 2024-06-22 11:01:55 +02:00
EnZaXD d03207289e Backup original book pages for creative mode clients in 1.8->1.9 (#3952) 2024-06-21 14:38:00 +02:00
Nassim Jahnke 64497b305a Fix enchantment order 2024-06-20 17:42:27 +02:00
Nassim Jahnke f5b3799db9 Use default dimension data for defaulted registry entry 2024-06-20 17:32:19 +02:00
Nassim Jahnke 00fedc7656 Also handle aqua affinity 2024-06-20 16:08:46 +02:00
Nassim Jahnke 05aa05c5b4 Disable soul speed check for now 2024-06-20 15:31:18 +02:00
Nassim Jahnke 5243c1800e entity effect magic
Fixes #3927
2024-06-20 12:51:35 +02:00
Nassim Jahnke 77d702bc9b Also handle movement related enchantments
Fixes #3960
2024-06-20 12:12:29 +02:00
RK_01 c098e24c4f Return generic Item array in StructuredItem#emptyArray (#3955) 2024-06-17 20:08:34 +02:00
EnZaXD 3d083cf463 Add handleMenuType function to ItemRewriter (#3953) 2024-06-17 16:39:01 +02:00
Nassim Jahnke 2ab62a8f4f Protected 2024-06-17 12:48:52 +02:00
Nassim Jahnke 296f42086f Also handle item_name item data for component rewriting 2024-06-17 12:43:18 +02:00
Nassim Jahnke e9f547f7ba Add ArrayUtil 2024-06-17 11:48:21 +02:00
CamotoyandAJ Ferguson b7f388b9ee 1.20.5 -> 1.20.3: nullify empty tags (#3949)
Co-authored-by: AJ Ferguson <AJ-Ferguson@users.noreply.github.com>
2024-06-17 09:42:09 +02:00
EnZaXD 824ff375d4 Fix GameMode#getById behaviour in 1.8->1.9 (#3947)
Vanilla fallbacks to SURVIVAL and doesn't throw any errors,
also NOT_SET was missing previously.
2024-06-16 22:28:50 +02:00
Leon 8bec05ed38 Fixup hardcore handling on join in 1.8->1.9 (#3946)
* Fix players crashing when logging into a 1.8 server on hardcore mode, Fixes #3944

* Requested change to #3944 fix
2024-06-16 22:06:39 +02:00
Nassim Jahnke b367caa4b2 Add Charged item tag if there's charged projectiles
Closes ViaVersion/ViaBackwards#787
2024-06-16 21:58:07 +02:00
Nassim Jahnke 1c281abf65 Bump version to 5.0.1-SNAPSHOT 2024-06-16 21:38:32 +02:00
Nassim Jahnke 0a55311e1c 5.0.0 Release 2024-06-16 15:46:27 +02:00
Nassim Jahnke d1d279cfea Don't send the attribute packet if the login packet hasn't been sent yet 2024-06-16 15:44:02 +02:00
Nassim Jahnke 4b44ecf6fa Fix missed null item return value 2024-06-16 15:00:23 +02:00
Nassim Jahnke b9474335e8 Fix container item type 2024-06-16 10:48:53 +02:00
Nassim Jahnke f0c26d5967 Make sure we actually have block mappings before trying to apply them 2024-06-16 10:19:50 +02:00
Nassim Jahnke aa312f7332 Merge branch 'refs/heads/dev' into preview 2024-06-16 10:19:43 +02:00
Nassim Jahnke 4210463505 Don't return null item in compound tag reading 2024-06-15 22:56:19 +02:00
EnZaXD ec976dfb6c Add method to remove sub commands from command handler (#3941) 2024-06-15 20:51:24 +02:00
Nassim Jahnke 7e60300e2e Merge branch 'refs/heads/dev' into preview 2024-06-15 16:11:04 +02:00
EnZaXD 9a9ca9676d Cleanup /viaversion list and pps command (#3933) 2024-06-15 15:53:09 +02:00
EnZaXD c68915b261 Add /viaversion player <name|*> command (#3932) 2024-06-15 15:05:26 +02:00
Nassim Jahnke 524e053327 Don't add tags if they're already in there 2024-06-14 17:04:22 +02:00
EnZaXD 9e523c353a Fix book signing in 1.8->1.9 (#3939) 2024-06-14 10:17:42 +02:00
Nassim Jahnke 00088a90fd Keep data component types fully immutable 2024-06-14 00:27:56 +02:00
Nassim Jahnke ddf6df8097 Add new keys for item data types containing item arrays 2024-06-14 00:21:30 +02:00
Nassim Jahnke 794683ef75 Don't use ItemStack.empty()
This is a fairly new method
2024-06-13 23:22:18 +02:00
Nassim Jahnke cc6f789334 Handle block ids in tool and adventure more predicate data 2024-06-13 23:10:25 +02:00
EnZaXD 4a70e0ea2a Fixup command registration once again (#3937) 2024-06-13 19:21:52 +02:00
EnZaXD 72cc9e9968 Add ability to detection level in /viaversion displayleaks (#3934) 2024-06-13 18:36:08 +02:00
EnZaXD 1039b8556b Add remaining item types to item rewriter implementations (#3931) 2024-06-13 18:34:55 +02:00
Nassim Jahnke e977e8db90 Write sound in explosion as proper sound event in 1.20.3->1.20.5 2024-06-13 18:30:28 +02:00
Nassim Jahnke 877053c471 Send mining efficiency attribute on item switch
For some reason, mining efficiency is not calculated by the client anymore, but by the server, then sending the current value to the client every time the item changes. This roughly emulates that behavior (without tracking any inventory state beyond events).
2024-06-13 18:21:55 +02:00
Nassim Jahnke 67a349d74b Add tooltip_order and manually add curse enchantment tags 2024-06-12 23:22:46 +02:00
RK_01 009e2deed1 Add important 1.21 tags (#4) 2024-06-12 20:36:15 +02:00
Nassim Jahnke bb59149fbd Remove snapshot version for 1.21 2024-06-12 18:10:45 +02:00
Nassim Jahnke 089df6517e 1.21-rc1 2024-06-12 18:03:51 +02:00
Nassim Jahnke d007beaeec 1.21-pre4 2024-06-12 18:03:51 +02:00
Nassim Jahnke 3d656d411d 1.21-pre3 2024-06-12 18:03:51 +02:00
Nassim Jahnke 2c44c275bc 1.21-pre2 2024-06-12 18:03:51 +02:00
Nassim Jahnke d062229e0f Fix item type in 1.21 entity data types 2024-06-12 18:03:51 +02:00
Nassim Jahnke 8bc22a1bad Handle item changes in show item components 2024-06-12 18:03:50 +02:00
Nassim Jahnke 5d0846abe2 Handle chat and horse container changes 2024-06-12 18:03:50 +02:00
Nassim Jahnke 23dd8c55ad 1.21-pre1 2024-06-12 18:03:50 +02:00
Nassim Jahnke 5edb6ff411 Handle jukebox songs 2024-06-12 18:03:50 +02:00
Nassim Jahnke 251ab42c14 Update data component ids 2024-06-12 18:03:50 +02:00
Nassim Jahnke 134c3559bf WIP 24w21b 2024-06-12 18:03:49 +02:00
Nassim Jahnke 832dbdf493 24w20a 2024-06-12 18:03:49 +02:00
Nassim Jahnke ccc509432b Rebase onto 5.0.0 2024-06-12 18:03:49 +02:00
Nassim Jahnke cf2168aa95 24w19b, they couldn't have done that 10 seconds faster 2024-06-12 18:03:49 +02:00
Nassim Jahnke 58d7dc7ca6 24w19a 2024-06-12 18:03:49 +02:00
FlorianMichael 1fe6f72aec Fix typo 2024-06-12 18:03:48 +02:00
Nassim Jahnke e3312b1c80 Add basic handling for items within item components
No changes so far, but will most likely be needed rather sooner than later
2024-06-12 18:03:48 +02:00
Nassim Jahnke 182148dbe8 Some cleanup 2024-06-12 18:03:48 +02:00
Nassim Jahnke b5c718098d 24w18a
Abstract item rewriters still need additional handling for once there are actual item changes, but this works as is for now
2024-06-12 18:03:39 +02:00
EnZaXD 01ea51e8ee Add armor stand entity id to ENTITY_DATA in 1.20.3->.5 (#3930)
Closes https://github.com/ViaVersion/ViaVersion/issues/3929
2024-06-12 18:02:24 +02:00
EnZaXD ae3042074e Add trade list rewriter functions to ItemRewriter (#3926) 2024-06-11 15:02:04 +02:00
EnZaXD d0ed528788 Save negative item amounts in 1.10->1.11 (#3921) 2024-06-09 17:07:29 +02:00
EnZaXD 2fba2c1e65 Don't send empty items in 1.8->1.9 hand item provider (#3920) 2024-06-09 15:52:08 +02:00
Nassim Jahnke b77d0fedd9 Remove no longer needed empty item check in entity data
Also fixes bad null values being set there
2024-06-09 13:05:52 +02:00
RK_01 c07adfddb2 Add StructuredItem#emptyArray (#3915) 2024-06-07 22:34:45 +02:00
Nassim Jahnke 1e244a126d Handle optional item cost nullability 2024-06-07 13:51:28 +02:00
Nassim Jahnke 842cb8dac5 Change items to not be nullable in 1.20.5+
With the server and client actually having empty checks in many places now, this simplifies empty checks going forward
2024-06-07 13:34:46 +02:00
Nassim Jahnke 5053d739c0 Handle empty items in some thrown projectiles
Fixes #3909, #3910
2024-06-07 12:24:02 +02:00
EnZaXD d43ad37663 Add missing conditions to 1.20.5 item type writing (#3913) 2024-06-06 19:30:03 +02:00
EnZaXD bb48dc90f9 Add EntityRewriter#registerBlockStateHandler (#3912) 2024-06-06 11:00:18 +02:00
EnZaXD 1ea27f1077 Improve some grammar and rename update checker setting (#3900) 2024-06-04 12:41:12 +02:00
EnZaXD 3f72e9ea47 Don't publish extra modules (#3901) 2024-06-03 15:22:59 +02:00
EnZaXD 8a826b88fb Move firework flight length appending into VB protocol (#3902) 2024-06-02 09:04:24 +02:00
EnZaXD 82452dbdfe Remove bungee options from config.yml (#3898) 2024-06-01 20:37:38 +02:00
Nassim Jahnke e439d040a7 Update Gradle wrapper 2024-06-01 16:59:26 +02:00
Nassim Jahnke 2f41d09e23 Remove deprecated codec handler 2024-06-01 16:49:50 +02:00
Nassim Jahnke 0f73304a1d Fix trim pattern 2024-05-31 15:17:04 +02:00
EnZaXD 2dad770d67 Include website url in plugin.yml (#3897) 2024-05-31 09:40:12 +02:00
EnZaXD 2a088c08ed Handle edge cases when converting legacy components (#3896) 2024-05-30 22:55:03 +02:00
Nassim Jahnke d4034792c4 Update publication metadata 2024-05-30 22:37:20 +02:00
Nassim Jahnke 7bdcf9a456 Replace other Bungee references 2024-05-30 21:55:10 +02:00
Nassim Jahnke a48c3a6ec2 Move Bungee and Sponge platforms to separate plugins
Bungee support is half broken due to not having the same injection points as Velocity and has become less and less stable with every update. The Sponge plugin has been almost entirely unused
2024-05-30 21:52:34 +02:00
EnZaXD 5245a7ef2e Replace DataItem constructor usages (#3893) 2024-05-30 10:42:55 +02:00
EnZaXD 03e8eec12e Wrap BASE_COLOR, CONTAINER_LOOT and CONTAINER inside block entity tag in 1.20.5->.3 (#3892)
Closes https://github.com/ViaVersion/ViaBackwards/issues/763
2024-05-29 16:47:53 +02:00
EnZaXD 76abe4432f Handle items with invalid amount in 1.20.3->.5 (#3889) 2024-05-29 16:46:25 +02:00
EnZaXD af393c564f Fixup ComponentUtil#trimStrings detection (#3888) 2024-05-29 10:21:50 +02:00
EnZaXD d8aa3c4b39 Add DataItem constructor without data short (#3884) 2024-05-28 10:52:57 +02:00
EnZaXD d9446eed07 Improve block break/place detection in 1.8->1.9 (#3886)
Servers can send sound packets where the positions have a slight offset. This PR aims to improve the detection to account for that.

Closes https://github.com/ViaVersion/ViaFabricPlus/issues/333
2024-05-28 08:43:21 +02:00
Nassim Jahnke 3f7d286606 Gracefully handle empty first input item in trades
Fixes #3885
2024-05-27 22:15:40 +02:00
RK_01 869755ec4a Perform deep copy in DataItem#copy (#3883) 2024-05-27 13:28:39 +02:00
Nassim Jahnke e26f63c703 Clean up 1.12 recipe data handling
Supersedes #3880
2024-05-26 20:38:27 +02:00
Nassim Jahnke 792f52e637 Fix firework flight show item conversion
Fixes #3877
2024-05-26 13:02:38 +02:00
EnZaXD e886aca8be Remove outdated dependencies/plugins from plugin.yml (#3874) 2024-05-25 18:50:38 +02:00
Nassim Jahnke 94e853e5cf Add entity id to painting items 2024-05-22 10:42:38 +02:00
EnZaXD 9b1c97919c Only soft fail CUSTOM_PAYLOAD content reading (#3873)
Reading of the channel shouldn't be soft failed as the game code only try catches content reading
2024-05-22 09:44:38 +02:00
Nassim Jahnke 01589b3c49 Always throw on serverbound custom payload errors
Old server versions did suppress exceptions, but that doesn't matter for us
2024-05-21 20:47:48 +02:00
Nassim Jahnke c5756fe45c Rename Position to BlockPosition 2024-05-21 13:05:15 +02:00
EnZaXD 9547cf160d Fixup ComponentUtil#legacyToJsonString behavior on items with styles (#3868) 2024-05-21 11:30:57 +02:00
EnZaXD 659bee771b Use mapped identifier getter when converting items in 1.20.3->.5 components (#3869) 2024-05-20 19:08:10 +02:00
EnZaXD d5ccb17951 Add default firework flight length in 1.20.5->1.20.3 (#3866) 2024-05-20 14:11:16 +02:00
Pantera (Mad_Daniel) 47f5617f83 Fix 1.20.5->1.20.3 unpaired lodestone compass (#3864) 2024-05-19 11:58:25 +02:00
EnZaXD 052fb6e366 Fixup LODESTONE_TRACKER rewriting in 1.20.3->.5 and backwards (#3862) 2024-05-19 09:40:10 +02:00
EnZaXD 7d9c6fea69 Fix firework rewriting in 1.20.3->.5 (#3860)
Makes the explosion tag optional like it is in 1.20.4 so the tooltip shows the correct duration when crafting a firework, also fixes the type used for Flight which is byte in 1.20.4
2024-05-19 09:29:05 +02:00
EnZaXD f92d241028 Use Key#namespaced in entity type enums (#3858) 2024-05-17 21:04:54 +02:00
RK_01 0427aec4ab Fix 1.8->1.9 item rewriting (#3859) 2024-05-17 18:17:44 +02:00
Nassim Jahnke 5a1a22a007 Replace runnables with method in packet send methods 2024-05-16 21:55:51 +02:00
RK_01 91f31b578f Clean up tags rewriting (#3856) 2024-05-16 10:31:05 +02:00
EnZaXD 1399c901d2 Add rewriter function for legacy chunk types to BlockRewriter (#3854) 2024-05-15 16:58:57 +02:00
EnZaXD b3d02491c6 Update listener package names in bukkit platform (#3853) 2024-05-15 16:52:17 +02:00
EnZaXD 1d0b6cc5c4 Update data class names to indicate target version (#3851) 2024-05-15 10:45:07 +02:00
EnZaXD 04b31d70b2 Fixup legacy entity type hierarchy and namings (#3849) 2024-05-14 20:56:07 +02:00
Nassim Jahnke 0fc0259d8c Remove version check for getting protocol path 2024-05-14 20:55:36 +02:00
Nassim Jahnke 9fd40395eb Move occluding state ids to data file 2024-05-14 20:55:35 +02:00
Nassim Jahnke 75d86851ce Apply IJ code reformat, rename rewriter methods, change metadata references to entity data
Doing lots of things in one commit to not muddy file history too much - almost all of these changes are fully automated
2024-05-14 20:55:33 +02:00
Nassim Jahnke b3f0c3e9a7 Update readme, actions 2024-05-14 18:54:24 +02:00
Nassim Jahnke d6b5b5dc3e Move PS compatibility to an addon
PS has long been dead, so moving it away removes unnecessary complexity/the extra module. The additional code when getting the protocol version was long dead as well, since all connections are injected.
2024-05-14 18:54:24 +02:00
EnZaXD fcfea24b36 Rework logging inside protocols, add Protocol#getLogger() (#3843) 2024-05-14 18:54:23 +02:00
EnZaXD 9149f12809 Use global logger for configs, delete Config#LOGGER (#3846)
There is no reason to keep a separate logger for config files, this also doesn't work as intended since creating new Java loggers isn't really possible (they don't match the usually formatting Via.getPlatform().getLogger() would provide). This PR deletes the logger and uses the global/main logger provided by the platform, this has been tested with bukkit.
2024-05-14 18:54:23 +02:00
Nassim Jahnke 73c58518ad Remove mavenLocal resolution 2024-05-14 18:54:23 +02:00
EnZaXD c9dfc739a2 Change CUSTOM_PAYLOAD handler in 1.10->1.11 to soft fail. (#3844) 2024-05-14 18:54:23 +02:00
EnZaXD bd4df2813d Refactor protocols to match template module (#3842) 2024-05-14 18:54:23 +02:00
FlorianMichael d47b5be7f3 Move GameMode enum into api module
Actually not needed there but still fits in there
2024-05-14 18:54:22 +02:00
FlorianMichael 0142e3aea7 Rename a few data classes, provider packages, task classes 2024-05-14 18:54:22 +02:00
FlorianMichael d0fecb8951 Merge rewriter and packet classes (entities and items) in 1.8->1.9 2024-05-14 18:54:22 +02:00
Nassim Jahnke 5286efde15 Move type instances out of its enclosing class
Type constants being hold by its own abstract class has lead to classloading issues in the past, now we're finally free
2024-05-14 18:54:19 +02:00
EnZaXD ca25e62d2d Cleanup 1.8->1.9 class structure (#3841) 2024-05-14 18:53:54 +02:00
Nassim Jahnke 501f65e216 Packet and entity type renames
Use Mojang mapped names for packet types to be consistent with functionality and easy to look up
2024-05-14 18:53:51 +02:00
Nassim Jahnke e965e97139 Package/class renames and moves 2024-05-14 18:53:05 +02:00
Nassim Jahnke 75db1a7cdf Start work on ViaVersion 5.0.0
Bump Java target to 17, clean up using its new language features
Remove unnecessary checked exception throwing
Remove deprecated code
2024-05-14 18:53:02 +02:00
Nassim Jahnke 2d41eb52a6 Remove invalid chunk entities for 1.20.5 clients
Fixes #3804
2024-05-14 18:47:57 +02:00
Nassim Jahnke 7e268a6f87 Bump version to 4.10.3-SNAPSHOT 2024-05-14 16:33:39 +02:00
Nassim Jahnke 113bf1e275 4.10.2 Release 2024-05-10 13:24:23 +02:00
EnZaXD 2aec3ce6d1 Expose StructuredDataConverter#removeBackupTag (#3838) 2024-05-09 20:50:45 +02:00
EnZaXD f60e31ac78 Add block entity ids in 1.20.3->.5 conversion (#3837) 2024-05-09 20:37:20 +02:00
EnZaXD 8c4ff7ebfc Remove fix which got merged into MCStructs (#3836) 2024-05-09 20:04:36 +02:00
Nassim Jahnke 4c7729e602 Fixup banner handling, some other fixes 2024-05-09 19:33:26 +02:00
Nassim Jahnke 3dfc3bb15b Actually add properties tag in 1.20.5->1.20.4 item handler 2024-05-09 17:21:53 +02:00
EnZaXD 69b33dc2d2 Handle invalid disconnect message in 1.8->1.9 (#3834) 2024-05-09 09:26:28 +02:00
EnZaXD c24169c410 [ci skip] Use login/status packet enums in older protocols (#3835) 2024-05-09 09:25:54 +02:00
Nassim Jahnke 31211c2214 Fix tipped arrow and area effect cloud color 2024-05-08 20:28:55 +02:00
Nassim Jahnke cb5fc9fb08 Fix empty effect handling
Fixes #3832
2024-05-08 11:55:35 +02:00
EnZaXD a8d7ab62e3 Add alpha to particle colors in 1.20.3->.5 (#3827) 2024-05-06 09:51:41 +02:00
Nassim Jahnke 71313b4753 Simplify raider check in 1.13->1.14 entity data handler 2024-05-06 09:42:49 +02:00
Nassim Jahnke 994bc8eefc Move down super onMappingDataLoaded calls 2024-05-05 23:15:20 +02:00
Nassim Jahnke 7d35826637 Bump version to 4.10.2-SNAPSHOT 2024-05-05 23:12:43 +02:00
Nassim Jahnke 4f40372392 4.10.1 Release 2024-05-05 16:38:28 +02:00
Nassim Jahnke e993be751c Filter items in entity data with amount < 1 2024-05-05 16:36:46 +02:00
Nassim Jahnke f1b92fea8d Move loadFullMappings to MappingDataBase, use loadMiMappings 2024-05-05 14:41:30 +02:00
Nassim Jahnke fc9d5b6d9d Clean up entriesLength usage 2024-05-05 13:33:21 +02:00
EnZaXD 9549a18cec Handle duplicated registry ids in 1.20.3->.5 (#3825)
Minecraft 1.20.4 and earlier silently overrides the previous values if multiple registry elements have the same id (Tested using a Fabric 1.20.4 mod by parsing a registry sent by a server and then printing the parsed objects).
2024-05-05 13:08:09 +02:00
Nassim Jahnke d691096ce1 Move around types, apply to other enums
This doesn't include ALL abstract types, mostly if they are single-use or not at all relevant to our handling and most likely never will
2024-05-05 12:10:57 +02:00
Nassim Jahnke 73ed425bf7 Fixup entity type hierarchy 2024-05-04 18:11:50 +02:00
EnZaXD cdc9c3ae95 Update mappings (#3823)
https://github.com/ViaVersion/Mappings/commit/48167fe5b6db1d51157d88a7cc028c11da922514
2024-05-03 19:12:24 +02:00
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 d3af70d76c Add optional registry utils to TagUtil (#3819) 2024-05-02 15:45:19 +02:00
Nassim Jahnke c00bc6b667 Check both namespaced and implicit key when replacing registry 2024-05-01 10:28:53 +02:00
Nassim Jahnke fa3c933b2f Fix banner pattern backup
Fixes #3816
2024-05-01 00:06:22 +02:00
Nassim Jahnke 07bb0269c3 Auto: Update copyright headers 2024-04-30 22:23:11 +02:00
Nassim Jahnke 57c0d83608 Clean up component rewriter 2024-04-30 16:09:11 +02:00
Nassim Jahnke 4854b131b8 Some cleanup 2024-04-30 09:02:24 +02:00
Nassim Jahnke 1864b66e42 Handle new banner patterns in backwards translation 2024-04-29 23:58:57 +02:00
Nassim Jahnke 8aa6769193 Handle empty items in item lists 2024-04-29 23:11:10 +02:00
Nassim Jahnke 5f90bcbbaf Fix item cost type reading 2024-04-28 15:15:17 +02:00
Nassim Jahnke d068822143 Add paperweight-mappings-namespace manifest attribute 2024-04-28 03:51:56 +02:00
Nassim Jahnke a77e328dfe Put components in entity data through component rewriter
Cursed, but possibly needed
2024-04-27 21:39:20 +02:00
Gero 9c84e0dbe9 Fix remapping of 1.20.5 CLICK_WINDOW_BUTTON 2024-04-27 21:26:28 +02:00
Nassim Jahnke 66e0453398 Fix block protocols disconnect packet 2024-04-27 12:13:09 +02:00
Nassim Jahnke 7ec6888a30 Handle invalid command argument types
The client ignores these presumably for modded servers
Fixes #3806
2024-04-27 11:26:18 +02:00
Nassim Jahnke c9733948b3 Use raw data filler in 1.12->1.13 2024-04-27 10:23:04 +02:00
Nassim Jahnke 798b70cbe6 Be even more defensive about half valid items in hover events
While they aren't particularly useful or intended, they were valid
2024-04-26 19:00:37 +02:00
Nassim Jahnke 1f43ff571d Bump to 4.10.1-SNAPSHOT 2024-04-26 18:26:37 +02:00
Nassim Jahnke d28e7cd652 4.10.0 Release 2024-04-26 15:03:17 +02:00
Nassim Jahnke f20d99fcef Add 1.20.6 to .5 version
We technically don't know whether that will stay true, but might as well now to prevent confusion, as it wouldn't have any consequences if it did change
2024-04-26 15:02:57 +02:00
Nassim Jahnke a1c182f291 Ignore invalid names in the data component for hover events as well 2024-04-26 10:01:29 +02:00
Nassim Jahnke 8e63fd635b Ignore invalid names in player heads 2024-04-26 09:29:19 +02:00
FlorianMichael 676e62c71f Fix via dump throwing an error on sponge 2024-04-25 22:44:42 +02:00
FlorianMichael f422e03348 Rename ranged protocol version names 2024-04-25 20:31:22 +02:00
Nassim Jahnke fdf735420f Add enforce-secure-chat setting to determine what is sent to the client by default 2024-04-25 20:21:36 +02:00
Nassim Jahnke b13fbbe175 Fix various issues in hover events serialization 2024-04-25 10:34:24 +02:00
Nassim Jahnke 9dd3348510 Move appendClientbound/Serverbound methods to Protocol interface 2024-04-24 20:11:05 +02:00
Nassim Jahnke 0e97af29b4 Add warning on Bungee startup
Without more specific injection points as with Velocity, Via has started failing more and more on Bungee and maintaining the required hackfixes coming from that has shown time intensive
2024-04-24 19:56:09 +02:00
Nassim Jahnke 3dfcd6b9b9 Fix written book hover serialization 2024-04-24 15:47:56 +02:00
Nassim Jahnke 8df0c0ae2e Catch component parsing exceptions separately instead of failing the entire item 2024-04-24 15:47:47 +02:00
Nassim Jahnke d2ca6a82be Assume enforce secure chat as false by default
Setting it to true will result in chat validation errors on the client for other players without chat sessions or valid signatures
2024-04-24 10:26:35 +02:00
Nassim Jahnke 9654a613cd Put combat kill through component rewriter 2024-04-24 10:15:53 +02:00
Nassim Jahnke c5e6fa7d0c Fix trim material ids at tail 2024-04-24 10:11:22 +02:00
Nassim Jahnke b78f9d350b Check for lore length, not component length 2024-04-23 23:53:24 +02:00
Nassim Jahnke ebbe1b6da2 Make backwards enchantment code more readable 2024-04-23 23:44:12 +02:00
Nassim Jahnke 3aed7cb949 Fix mending translation from getting the id from the wrong class 2024-04-23 19:56:17 +02:00
Nassim Jahnke e2f3dc7572 Limit enchantments to 0-255 2024-04-23 19:32:32 +02:00
Nassim Jahnke f2b9c42590 Remove snapshot version support 2024-04-23 17:01:46 +02:00
Nassim Jahnke 9894671274 Add back default method 2024-04-23 13:47:05 +02:00
Nassim Jahnke 71ab15b331 Serialize to 1.20.3 components in conversion
Aside from hover events, only reading of components changed and we need the 1.20.3 hover input. Hover events are already handled by us.
2024-04-23 13:39:15 +02:00
Nassim Jahnke 34bc5b9d36 Put item name and lore through component rewriter
An absolute classic moment where servers are putting hover events into not hoverable item names and lore
2024-04-23 13:07:05 +02:00
Nassim Jahnke d80fd46c2f Update version references 2024-04-23 11:26:17 +02:00
Nassim Jahnke b47446d9f7 Merge branch 'refs/heads/dev' into preview 2024-04-23 10:59:45 +02:00
EnZaXD dcf741a2ba Fix sound mapping lookup in 1.8->1.9 (#3801) 2024-04-23 10:46:40 +02:00
Nassim Jahnke a4adef3cec Fix attribute slot handling 2024-04-22 23:57:55 +02:00
Nassim Jahnke f525ad98e7 Fix handling of sweeping 2024-04-22 16:24:13 +02:00
Nassim Jahnke bc0b4470f6 1.20.5-rc3 2024-04-22 16:20:09 +02:00
Nassim Jahnke d3d6d4f1cd Fixes to hover event handling, some cleanup 2024-04-22 16:05:44 +02:00
Nassim Jahnke 5069b26c2f Reuse previously sent enforces-secure-chat value 2024-04-22 16:05:40 +02:00
FlorianMichael 079671060c Remove items from extra-identifiers-1.20.3 file 2024-04-22 07:13:03 +02:00
Nassim Jahnke 89cd8aec1d Merge branch 'refs/heads/dev' into preview 2024-04-21 23:47:01 +02:00
Nassim Jahnke 7ac7ea485f Add UserConnection to component rewriters as well 2024-04-21 23:01:58 +02:00
Nassim Jahnke 5e4f25efeb Merge branch 'refs/heads/dev' into preview
# Conflicts:
#	common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/rewriter/BlockItemPacketRewriter1_20_5.java
#	common/src/main/java/com/viaversion/viaversion/rewriter/EntityRewriter.java
#	common/src/main/java/com/viaversion/viaversion/rewriter/ItemRewriter.java
2024-04-21 22:51:45 +02:00
Nassim Jahnke a152993ffd Add UserConnection to item rewriters
Already required for ViaBackwards, later required for ViaVersion as well due to synchronized registry entries in items
2024-04-21 22:39:13 +02:00
Nassim Jahnke 73daac471c Split up version data in dump 2024-04-21 21:55:59 +02:00
Nassim Jahnke f4e9225f85 Store item identifiers, make identifier files more compact via global table 2024-04-21 20:47:38 +02:00
EnZaXD 1ed22327f6 Replace string->component conversion in 1.8->1.9 (#3794) 2024-04-21 16:00:30 +02:00
EnZaXD ce2ad7d5eb Change default value for new ocelot setting (#3797) 2024-04-21 15:15:17 +02:00
FlorianMichael d7e66260de Add 1.20.5 nbt->component conversion base
Has to be implemented into ViaBackwards yet and handlers are still missing
2024-04-21 14:53:25 +02:00
FlorianMichael dc6d581123 Update mcstructs and use new component serializer 2024-04-21 12:13:59 +02:00
FlorianMichael bd3f1206e6 [ci skip] document 1.9 metadata in MetaIndex 2024-04-21 11:35:10 +02:00
FlorianMichael b9e92e5c1f Fix zombie metadata in 1.10->1.11 2024-04-21 11:24:20 +02:00
Gero 0acaed7c7a Use correct item type for 1.20.5 particle reading 2024-04-20 23:50:24 +02:00
FlorianMichael 3055a4277d Use toString() method in ComponentUtil 2024-04-20 22:52:40 +02:00
Gero bcbe69d24c Fix ITEM_NAME component to tag conversion 2024-04-20 22:44:22 +02:00
EnZaXD 33cc21d6e6 Add setting for ocelot->cat translation in 1.13.2->1.14 (#3796) 2024-04-20 15:17:26 +02:00
Nassim Jahnke 949b3d712e Fix illager metadata in 1.13->1.14 2024-04-20 13:36:00 +02:00
Nassim Jahnke 216dcb2931 Remove invalid zombified piglin data 2024-04-20 12:43:08 +02:00
Nassim Jahnke bff1536529 Fall back to keys without namespace in registry data 2024-04-20 12:06:39 +02:00
Nassim Jahnke b221e47eb7 Add creative mode range attributes if needed
Add the range argument either with or without modifiers depending on the gamemode to otherwise reset them
2024-04-19 21:35:41 +02:00
EnZaXD fb434a79bd Use correct deserialization method in SerializerVersion#toComponent (#3795)
MCStructs has multiple methods for parsing jsons depending on the version, we should use them correctly in our wrapper to support all possible cases of components.
2024-04-19 17:05:07 +02:00
Nassim Jahnke 1be0605f51 Eat remaining particle data in spawn particle 2024-04-19 17:02:08 +02:00
Nassim Jahnke c75b4d8ef5 1.20.5-rc2 2024-04-19 15:38:35 +02:00
Gero e08c263ced Add missing dust_color_transition data remapping (changed in 24w03a) 2024-04-19 11:02:11 +02:00
Nassim Jahnke 1bb85b11e9 Merge branch 'refs/heads/dev' into preview 2024-04-19 10:11:05 +02:00
AJ Ferguson 128e191132 Fix 1.15->1.16 item attribute uuid (#3793) 2024-04-19 10:09:17 +02:00
Nassim Jahnke 3520f99d5a Remove empty items from various block entities 2024-04-19 09:56:24 +02:00
RaphiMC 7825a1e460 Handle show_entity type field 2024-04-18 23:11:19 +02:00
RK_01 bfde4b953c Fix 1.11->1.12 show_achievement rewriter (#3792) 2024-04-18 20:45:19 +02:00
Nassim Jahnke 57b37457d6 Add spit damage type
The client depends on it
2024-04-18 20:12:38 +02:00
Nassim Jahnke f7aa1a516e Fill wolf_food item tag 2024-04-18 18:58:29 +02:00
Nassim Jahnke b1468ac6d0 Update particle codec format
Was changed in 1.20.5-pre1
2024-04-18 18:36:22 +02:00
Nassim Jahnke 27b5fdb4ff Merge branch 'refs/heads/dev' into preview
# Conflicts:
#	common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13_1to1_13/metadata/MetadataRewriter1_13_1To1_13.java
#	common/src/main/java/com/viaversion/viaversion/protocols/protocol1_14to1_13_2/metadata/MetadataRewriter1_14To1_13_2.java
#	common/src/main/java/com/viaversion/viaversion/protocols/protocol1_15to1_14_4/metadata/MetadataRewriter1_15To1_14_4.java
#	common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16_2to1_16_1/metadata/MetadataRewriter1_16_2To1_16_1.java
#	common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16to1_15_2/metadata/MetadataRewriter1_16To1_15_2.java
#	common/src/main/java/com/viaversion/viaversion/protocols/protocol1_17to1_16_4/packets/EntityPackets.java
#	common/src/main/java/com/viaversion/viaversion/protocols/protocol1_18to1_17_1/packets/EntityPackets.java
#	common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19_3to1_19_1/packets/EntityPackets.java
#	common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/packets/EntityPackets.java
2024-04-18 16:17:05 +02:00
Nassim Jahnke a99273db2e Always call onMappingDataLoaded in TagRewriter
In case they are needed in the future, so that we don't also have to check whether the different methods are actually called
2024-04-18 16:12:57 +02:00
Nassim Jahnke 64f911ed4a 1.20.5-rc1 2024-04-18 15:47:44 +02:00
EnZaXD 4302dd61aa Remove Protocol1_9To1_8#FIX_JSON usage in 1.11->1.12 (#3791) 2024-04-18 15:26:13 +02:00
EnZaXD 98c5d38d0c Push book contents through component conversion in 1.8->1.9 (#3790) 2024-04-18 15:25:48 +02:00
FlorianMichael 033d5ae49a Handle removed item conversion in component rewriter 2024-04-17 22:39:08 +02:00
Nassim Jahnke 8cf9114403 1.20.5-pre4 2024-04-17 15:01:16 +02:00
EnZaXD bd8e469216 Fix IdAndData constructor without data field (#3789) 2024-04-17 08:46:56 +02:00
EnZaXD 57d7fd59cc Change IdAndData#setData parameter to int (#3788) 2024-04-16 21:00:04 +02:00
EnZaXD 8fe0681778 Replace incoming/outgoing usages with client/server bound (#3787) 2024-04-16 20:59:48 +02:00
EnZaXD ea5cf3e594 Add IdAndData util and replace conversions (#3786) 2024-04-16 15:55:55 +02:00
Nassim Jahnke 13eec3c2ea 1.20.5-pre3 2024-04-16 15:36:02 +02:00
Nassim Jahnke 31ccd2ab9b 1.20.5-pre2 2024-04-15 17:14:23 +02:00
FlorianMichael 2be190d152 Some consistency cleanup 2024-04-13 22:32:56 +02:00
FlorianMichaelandRaphiMC 4e25549682 Handle legacy item hover events
Co-authored-by: RaphiMC <50594595+raphimc@users.noreply.github.com>
2024-04-13 21:01:34 +02:00
FlorianMichael 287678c12a [ci skip] Add comments for conversion direction to classes 2024-04-13 20:58:38 +02:00
FlorianMichael 4343aa17fc Add missing annotations to StatePropertyMatcher 2024-04-13 20:57:32 +02:00
FlorianMichael 970986bc59 Add component rewriter for 1.20.3->1.20.5 2024-04-13 20:56:54 +02:00
RK_01 2586788bf6 Fix config read/write error when parent file is null (#3783) 2024-04-10 17:35:25 +02:00
EnZaXD 0c2c8400ae Make handling of optional block metadata more explicit in <1.19.4 (#3782) 2024-04-10 17:34:56 +02:00
Nassim Jahnke ba4404fad6 1.20.5-pre1 2024-04-10 17:33:10 +02:00
RK_01 6f53c069ea Fix 1.12 -> 1.13 held enderman block translation (#3781) 2024-04-10 10:43:48 +02:00
Nassim Jahnke 99f29e2597 Prepare proper banner id tracking, small other fixes 2024-04-09 12:40:16 +02:00
EnZaXD 7932b79080 Explain backup tags (#1) 2024-04-08 16:59:33 +02:00
FlorianMichael 4b780b92ee Fix armor trim conversion 2024-04-08 15:05:01 +02:00
Nassim Jahnke d04aaeb926 Handle color in area effect cloud 2024-04-08 14:21:11 +02:00
FlorianMichael 9f1ee27afc Add missing checks in item id conversions 2024-04-08 13:36:58 +02:00
Nassim Jahnke 5f685884ff Handle entity effect particle in spawn particle 2024-04-08 13:33:59 +02:00
FlorianMichael ba2e50cc88 Fix StructuredDataConverter#removeItemBackupTag 2024-04-08 13:31:13 +02:00
FlorianMichael 7b28683b6a Add remaining data backup handling 2024-04-08 13:18:49 +02:00
Nassim Jahnke 510747a7cd Replace empty items in recipes 2024-04-08 10:53:39 +02:00
Nassim Jahnke 8c5752bb4c Update unsupported java version warning 2024-04-07 22:34:20 +02:00
Nassim Jahnke 33e2a1fc13 Send unsigned messages if possible
The server cannot guarantee that the last seen values are correct, so in order to avoid kicks from invalid signatures, we will just strip them if possible.
2024-04-07 22:05:14 +02:00
Nassim Jahnke dbe8a389ce Update authors 2024-04-07 20:41:44 +02:00
Nassim Jahnke 83223c1520 Also handle ack in serverbound chat message 2024-04-07 20:35:07 +02:00
FlorianMichael 935077222e Simplify code 2024-04-07 20:08:16 +02:00
FlorianMichael 8961660846 Fix chat command handling 2024-04-07 19:43:29 +02:00
Nassim Jahnke 1fe23e4aeb Fix trade list handling 2024-04-07 13:36:02 +02:00
Nassim Jahnke 06394c1f74 Apply network limits 2024-04-07 11:41:57 +02:00
Nassim Jahnke 68c2af2795 Replace unknown sounds with direct value in registry data 2024-04-06 23:47:27 +02:00
Nassim Jahnke 35a00d0b95 Check for new outbound_config pipeline handler 2024-04-06 23:10:58 +02:00
Nassim Jahnke c2489c7a4c Back up 1.20.5 data components in VB for creative clients 2024-04-06 21:26:44 +02:00
Nassim Jahnke c743c20334 Update wolf textures again, add utility methods 2024-04-06 21:26:44 +02:00
FlorianMichael 228689f181 Remove temporary goat horn fix 2024-04-06 21:26:44 +02:00
Nassim Jahnke 67e6e1a2e3 24w14a 2024-04-06 21:26:44 +02:00
Nassim Jahnke a2c1c52f51 24w13a 2024-04-06 21:26:44 +02:00
Nassim Jahnke fd4db24d44 Fix intangible projectile data reading 2024-04-06 21:26:43 +02:00
Nassim Jahnke 0b7fdd4c69 Update wild wolf texture field name 2024-04-06 21:26:43 +02:00
Nassim Jahnke 4849ca0745 Start working on 24w12a 2024-04-06 21:26:43 +02:00
Nassim Jahnke 60b782455d Fix display tag setting and doubled item id rewriting 2024-04-06 21:26:43 +02:00
FlorianMichael 3fef71db2e Added missing null checks for CONTAINER_LOOT handler 2024-04-06 21:26:43 +02:00
Nassim Jahnke 9ca02680c8 Fix enchantment level 2024-04-06 21:26:43 +02:00
FlorianMichael 5899886b42 Fixes 2024-04-06 21:26:42 +02:00
Nassim Jahnke c2567115d8 Fix various issues 2024-04-06 21:26:42 +02:00
Nassim Jahnke 4255876c22 Fix up block state handling, add PotDecorations wrapper 2024-04-06 21:26:42 +02:00
FlorianMichael 57a589924d More structured data handling 2024-04-06 21:26:42 +02:00
Nassim Jahnke 936dcafc11 Make HolderSet an interface 2024-04-06 21:26:42 +02:00
Nassim Jahnke b6489b8343 Fix block predicate parsing 2024-04-06 21:26:41 +02:00
Nassim Jahnke bf11a0a7de Start working on 24w11a 2024-04-06 21:26:41 +02:00
Nassim Jahnke 7d41706026 Rewrite block predicates the other way around as well 2024-04-06 21:26:41 +02:00
FlorianMichael 93f081dd84 Add even more backwards rewriters 2024-04-06 21:26:41 +02:00
Nassim Jahnke 3f82b150d2 Handle CanPlaceOn and CanDestroy tags 2024-04-06 21:26:39 +02:00
Nassim Jahnke 7a96498f6d Some sanity checks, get item id by name fast 2024-04-06 21:26:17 +02:00
FlorianMichael 817febe605 Even more work! 2024-04-06 21:26:16 +02:00
Nassim Jahnke bb4a8b73e0 Small cleanup 2024-04-06 21:26:16 +02:00
Nassim Jahnke 8d3492ba30 Add more structured data -> nbt converters 2024-04-06 21:26:16 +02:00
Nassim Jahnke 658364b643 Add a few structured data -> nbt converters 2024-04-06 21:26:16 +02:00
Nassim Jahnke 666b204ebb Prepare class for structured data->tag rewriting 2024-04-06 21:26:16 +02:00
Nassim Jahnke bfab9b0c11 Banner patterns and wolves 2024-04-06 21:26:15 +02:00
Nassim Jahnke 121f107ff3 More handled structures 2024-04-06 21:26:15 +02:00
Nassim Jahnke 426bd9aa99 More handled structures 2024-04-06 21:26:13 +02:00
Nassim Jahnke 7a66bb8e1c More handled structures 2024-04-06 21:25:39 +02:00
Nassim Jahnke 329abcac7d More handled structures 2024-04-06 21:25:08 +02:00
Nassim Jahnke 0961de898d Handle books, among other things 2024-04-06 21:25:05 +02:00
Nassim Jahnke b4ee564aa2 24w10a, more item component work 2024-04-06 21:23:57 +02:00
EnZaXD 73178b504e Inline player on-ground movement handler (#3777) 2024-04-06 09:29:57 +02:00
EnZaXD d0cc531386 Cleanup MetaIndex style and field names (#3775) 2024-04-05 20:15:41 +02:00
EnZaXD 617ef10667 Remove MetaType1_8#NonExistent (#3774) 2024-04-05 19:48:59 +02:00
EnZaXD 5569caf610 Improve horse armor patch in 1.8->1.9 (#3773) 2024-04-05 15:46:20 +02:00
EnZaXD 868a5bd24e Remove non existing metadata from MetaIndex (#3772) 2024-04-05 15:45:13 +02:00
EnZaXD b113a82710 Catch errors in <= 1.20 custom payload reading (#3770) 2024-04-04 22:25:02 +02:00
EnZaXD 3ee4c8ed63 Make ViaVersion fake nbt format consistent (#3771)
Adding ItemRewriter#nbtTagName utils to prefix nbt tags with a consistent format:
<Platform>|<Protocol name>|<original nbt name>
2024-04-04 09:31:58 +02:00
EnZaXD cd65925d6b Add conversion methods to SerializerVersion and replace missing MCStructs usages (#3769) 2024-04-01 15:52:57 +02:00
Nassim Jahnke 307414eb51 Move simple mcstructs usage into utils 2024-04-01 14:13:43 +02:00
EnZaXD 51745cb2ef Rewrite 1.12.2->1.13 ComponentRewriter (#3765) 2024-04-01 13:38:43 +02:00
EnZaXD f44782d21d Fix minor inconsistencies in protocol packages (#3768) 2024-04-01 12:55:50 +02:00
EnZaXD 7556f7b8fa Move chat registry dumps into nbt files (#3763) 2024-03-31 15:07:46 +02:00
EnZaXD abd58399cd Remove entity metadata buffering in 1.8->1.9 (#3766) 2024-03-30 22:27:40 +01:00
EnZaXD 0a2fd8f296 Add MappingDataLoader#getLogger and MappingDataLoader#getDataFolder (#3757) 2024-03-24 22:04:41 +01:00
EnZaXD f2c816df72 Add mapped and unmapped identifier read method (#3756) 2024-03-24 12:14:42 +01:00
EnZaXD 098f7ff3c2 Allow platforms to use the mapping system (#3754) 2024-03-24 11:10:20 +01:00
RK_01 18f04bf8ea Add more functionality to ChunkUtil (#3755) 2024-03-24 11:05:30 +01: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
Nassim Jahnke 4074231a57 Update Hangar publish plugin 2024-03-22 20:49:57 +01:00
Kichura 13efe47a5c Update build dependencies (#3742) 2024-03-22 20:38:03 +01:00
Nassim Jahnke b07cf03dc1 Check for jsonnull in component conversion
Closes #3745
2024-03-17 16:23:27 +01:00
Nassim Jahnke 0a921d9bdc Use the correct entity sound rewriter method 2024-03-14 14:43:37 +01:00
EnZaXD 7b0c2fb51a Replace printStackTrace usages with proper logging (#3741) 2024-03-09 13:57:41 +01:00
Nassim Jahnke b426302e76 Merge branch 'master' into dev
# Conflicts:
#	common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/packets/EntityPackets.java
#	common/src/main/java/com/viaversion/viaversion/rewriter/EntityRewriter.java
#	gradle/libs.versions.toml
2024-03-09 12:59:36 +01:00
Nassim Jahnke 3442cda8ce Update ViaNBT 2024-03-09 12:57:55 +01:00
Nassim Jahnke 55a0a70264 Merge branch 'master' into dev 2024-03-09 11:36:41 +01:00
EnZaXD a9bfda4568 Rewrite 1.11->1.12 ChatItemRewriter (#3740) 2024-03-09 10:58:42 +01:00
Nassim Jahnke 93990c8baa Merge branch 'master' into dev
# Conflicts:
#	common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/packets/EntityPackets.java
#	common/src/main/java/com/viaversion/viaversion/rewriter/EntityRewriter.java
#	gradle.properties
#	gradle/libs.versions.toml
2024-03-07 13:45:10 +01:00
Nassim Jahnke f868dfa125 Update ViaNBT 2024-03-07 13:30:33 +01:00
Nassim JahnkeandDrex 386495e168 Handle map related data and skull owners
Co-authored-by: Drex <nicknamedrex@gmail.com>
2024-03-06 13:26:06 +01:00
Nassim Jahnke cad78ea68f Trim string tags in component conversion
Somewhat dirty but inconsequential, as the given protocol does not use this method in item conversion and it should only ever be triggered in hover events
Closes #3650
2024-03-06 12:31:31 +01:00
EnZaXD 908823c612 Make ItemRewriter type getters nullable and optional (#3737) 2024-03-05 23:23:57 +01:00
Nassim Jahnke f6d48e258f 4.9.3 Release 2024-03-05 17:51:09 +01:00
Nassim Jahnke 1f5ee6d763 Create FUNDING.yml 2024-03-04 17:32:13 +01:00
Nassim Jahnke 8edad67394 Check if the channel is open in BukkitEncodeHandler 2024-03-02 20:13:58 +01:00
Nassim Jahnke 2d03110f08 Small refactor 2024-03-01 14:10:44 +01:00
Nassim Jahnke 92878a39ef We continue to fall 2024-03-01 13:46:26 +01:00
Nassim Jahnke aa0423c6e2 Merge branch 'master' into dev 2024-03-01 12:39:25 +01:00
Nassim Jahnke 04e572fa30 Hotfix receiving level screen not closing on Velocity
Closes #3630
2024-03-01 12:38:54 +01:00
Nassim Jahnke 39180e22b8 The endless pit continues to be endless 2024-03-01 12:13:43 +01:00
Nassim Jahnke f68aed464d Once again refactor structured data storage
Optionals are no more
2024-02-29 19:59:18 +01:00
Nassim Jahnke 6ffa24b50b Add todos 2024-02-29 18:23:46 +01:00
Nassim Jahnke e51d7b3fdb Fix initial item sending, add some data translation and more rigid data structures 2024-02-29 17:03:50 +01:00
Nassim Jahnke 01bb8dedda More renames 2024-02-29 12:08:29 +01:00
EnZaXD 6cdca97d35 Add classic version range to VersionType#CLASSIC javadoc (#3729) 2024-02-29 11:11:23 +01:00
EnZaXD dafce79374 Tidy up fabric.mod.json file of fabric platform (#3728) 2024-02-29 11:11:10 +01:00
RK_01 4cf271af81 Use equals in legacy custom payload channel comparisons (#3721) 2024-02-29 11:11:00 +01:00
Nassim Jahnke aa262bb0a5 Rename itemdata to be more generic 2024-02-28 22:46:33 +01:00
Nassim Jahnke 2480eb6a7f Start working on 24w09a 2024-02-28 22:15:31 +01:00
Nassim Jahnke 56b82b049a Move a few methods out of AbstractProtocol 2024-02-27 17:21:27 +01:00
EnZaXD 3c0930c62f Use existing ProtocolVersion#getProtocol when possible (#3720) 2024-02-27 14:02:16 +01:00
EnZaXD 26a8e5fef1 Fix enabled version sorting in DumpUtil (#3719) 2024-02-27 14:01:47 +01:00
caramel caa6519780 Fix leather armor rendering (#3713) 2024-02-25 20:36:48 +01:00
caramel 1e35c2713f Fix particle doesn't use new mapping id (#3712) 2024-02-25 20:36:27 +01:00
caramel cd5d88c34f Fix wrong join game packet handling (#3710) 2024-02-24 20:54:38 +01:00
EnZaXD 7640342165 Don't require a base protocol for current version in BaseProtocol (#3709) 2024-02-23 15:13:33 +01:00
EnZaXD fe0d30df78 paste.gg -> mclo.gs (#3706) 2024-02-21 16:13:15 +01:00
Nassim Jahnke 4e1d4a75b2 Small refactors around ProtocolPipeline and concurrent collections
Make concurrency handling in ProtocolPipelineImpl more defensive, as generally the pipeline is expected to never be called from multiple threads. The only case to look out for is pipeline additions during protocol transformation in a base protocol
2024-02-21 12:18:19 +01:00
EnZaXD 343b403cf1 Ensure ProtocolManagerImpl#registerBaseProtocol doesn't support VersionType#SPECIAL protocols (#3705) 2024-02-19 10:09:44 +01:00
RK_01 78aecbddf8 Don't add base protocols when using special versions (#3704) 2024-02-18 21:55:14 +01:00
Nassim Jahnke 48241ba841 Fix Bungee server change 2024-02-18 19:32:55 +01:00
Nassim Jahnke a8fbb000eb Add ProtocolManager#hasLoadedMappings 2024-02-15 18:27:52 +01:00
EnZaXD ff25cbd6eb Add RedirectProtocolVersion API to common module (#3701) 2024-02-15 18:21:38 +01:00
Nassim Jahnke e2a7e10312 Add back default getProtocolPath with int versions 2024-02-15 15:45:23 +01:00
EnZaXD c7baa27fd0 Some code cleanup (#3698) 2024-02-14 22:53:50 +01:00
Nassim Jahnke 35578372a1 Fix isWorkingPipe and cursed ProtocolVersion comparator 2024-02-14 22:45:34 +01:00
EnZaXD 293427c172 Only pass ProtocolVersion#toString into via dumps (#3699) 2024-02-14 21:49:40 +01:00
EnZaXD 08d8ccf6ca Don't add ProtocolVersion#unknown into ProtocolVersion#VERSION_LIST (#3697) 2024-02-14 21:07:36 +01:00
EnZaXD 35ceee1a47 Rename ProtocolVersion#v1_7_1 to v1_7_2 (#3696) 2024-02-14 20:14:17 +01:00
Nassim Jahnke dccda57fc0 Consistent equalTo names 2024-02-14 19:14:41 +01:00
Nassim Jahnke 5c21f60ef7 Fix Bungee ping default 2024-02-14 19:12:05 +01:00
Nassim Jahnke c124c1c809 Sort ProtocolVersions version list, fix base protocol registration 2024-02-14 17:57:00 +01:00
EnZaXD 302716054d Port of internals and API to ProtocolVersion (#3694) 2024-02-14 17:56:28 +01:00
Nassim Jahnke 46a5bb16d7 24w07a 2024-02-14 17:32:13 +01:00
EnZaXD f3f7ea7987 Fix version ranges in VersionType (#3692) 2024-02-14 09:57:41 +01:00
EnZaXD e62c4a3f9e Rename comparing methods in ProtocolVersion (#3693) 2024-02-14 09:54:15 +01:00
EnZaXD d58c80cd2f Add ProtocolVersionRange API (#3691) 2024-02-14 09:51:56 +01:00
Nassim Jahnke 7a6c51331b Move config load after platform creation 2024-02-13 23:37:00 +01:00
Nassim Jahnke 564286d742 Remove version check from config
The platform might now always be available
2024-02-13 23:18:39 +01:00
Nassim Jahnke dcc0642af9 Replace more raw versions with ProtocolVersion 2024-02-13 22:48:08 +01:00
EnZaXD e449599ae7 Add ProtocolVersion#betweenInclusive and ProtocolVersion#betweenExclusive (#3690) 2024-02-13 21:50:19 +01:00
Nassim Jahnke 621c02f974 Move some data out of extending MappingData classes 2024-02-13 18:41:05 +01:00
Nassim Jahnke 22bd350e35 Add proper ProtocolVersion comparison 2024-02-13 18:40:21 +01:00
Nassim Jahnke a8dc5f0f07 Merge branch 'master' into dev
# Conflicts:
#	common/src/main/java/com/viaversion/viaversion/data/entity/DimensionDataImpl.java
#	common/src/main/java/com/viaversion/viaversion/rewriter/EntityRewriter.java
#	common/src/main/java/com/viaversion/viaversion/update/UpdateUtil.java
2024-02-12 10:44:03 +01:00
Nassim Jahnke d76edced04 Update template protocol 2024-02-12 10:40:17 +01:00
Nassim Jahnke cfc048ba53 Small random cleanup 2024-02-11 10:46:08 +01:00
Nassim Jahnke c7265abfe9 Add editorconfig 2024-02-10 23:44:13 +01:00
Nassim Jahnke 8a485db580 Replace tag instanceof checks/unchecked casts with helper methods 2024-02-10 23:28:36 +01:00
Nassim Jahnke e0f32d9f2f Merge remote-tracking branch 'origin/master' into dev 2024-02-08 22:02:25 +01:00
EnZaXD ad62d8552c Use correct logger for configuration warnings (#3685)
Fixes https://github.com/ViaVersion/ViaProxy/issues/179
2024-02-08 22:02:13 +01:00
Nassim Jahnke 4a8bd2cca2 24w06a 2024-02-07 18:29:19 +01:00
Nassim Jahnke 0fcb764652 24w05b 2024-02-01 17:49:58 +01:00
Nassim Jahnke 46e322b2f3 Merge branch 'master' into dev 2024-01-31 22:28:22 +01:00
Nassim Jahnke 87d444a017 Only rewrite pages in written book 2024-01-31 22:24:17 +01:00
Nassim Jahnke e020c616c9 24w05a 2024-01-31 17:36:12 +01:00
Nassim Jahnke da87241549 Merge branch 'master' into dev
# Conflicts:
#	common/src/main/java/com/viaversion/viaversion/rewriter/ItemRewriter.java
2024-01-29 17:26:49 +01:00
EnZaXD 0d788b0d7a Clean up more item type usage in ItemRewriter (#3674) 2024-01-29 17:21:59 +01:00
Nassim Jahnke 1c6f8426f1 Log the error by default, instead check suppression config 2024-01-29 10:32:02 +01:00
Nassim Jahnke 01f28a052c Ignore errors in book conversion 2024-01-29 10:17:00 +01:00
Nassim Jahnke cfc9011cee Push books through component conversion in 1.20.2->1.20.3
Fixes #3579
2024-01-27 20:51:28 +01:00
Nassim Jahnke 6473b608f6 Merge branch 'master' into dev
# Conflicts:
#	.github/workflows/gradle.yml
2024-01-27 13:49:48 +01:00
Nassim Jahnke a5bd8abe93 Resize registry data array to actual size once collected 2024-01-27 13:49:27 +01:00
EnZaXD f3d95b1e5e Fix elytra not working with firework rockets in 1.14 -> 1.13.2 (#3669)
Closes https://github.com/ViaVersion/ViaFabricPlus/issues/331
2024-01-27 13:46:20 +01:00
Nassim Jahnke c8d339ab30 Add generic types on base protocols 2024-01-27 13:45:40 +01:00
Nassim Jahnke 8000561ae9 Handle registry data with skipped ids 2024-01-26 16:05:58 +01:00
Nassim Jahnke 1dafa7d273 Cleanup config packet registration in newer protocols 2024-01-26 15:48:10 +01:00
Nassim Jahnke ce8fab7c44 Cleanup config packet registering in AbstractProtocol 2024-01-26 14:35:19 +01:00
Nassim Jahnke 37561705ed 24w04a 2024-01-24 20:23:33 +01:00
Nassim Jahnke 00176c4a0c Merge branch 'master' into dev 2024-01-24 17:27:04 +01:00
Kichura cef6fb35b1 Update JDK to 17, setup-java to v4 (#3660) 2024-01-20 21:18:42 +01:00
Nassim Jahnke 7b8a33cc78 Small refactor to UpdateUtil 2024-01-20 16:34:18 +01:00
Nassim Jahnke ceae2c2094 Rewrite transfer intention on older servers 2024-01-18 21:44:26 +01:00
Nassim Jahnke 52b9db5029 Handle new client intent 2024-01-18 21:22:44 +01:00
Nassim Jahnke 27af372f79 Block entity tags are no longer nullable 2024-01-18 20:46:25 +01:00
Nassim Jahnke c4e50efa90 24w03b 2024-01-18 16:10:09 +01:00
Nassim Jahnke fa1ae5b9c9 Entity sound did not change 2024-01-18 12:00:19 +01:00
Nassim Jahnke 8f6784e0e2 Respect previous buffer types in particle rewriting 2024-01-18 10:25:58 +01:00
Nassim Jahnke 5d5c98acc6 24w03a (maybe, and it's a bit ugly) 2024-01-17 22:55:16 +01:00
vadage 5b29ac0d8a Support config loading from input stream as fallback if URL cannot be acquired (#3647) 2024-01-14 10:04:15 +01:00
Kichura 3b9d399afd Update supported Velocity version to 3.3 (#3649) 2024-01-14 10:01:52 +01:00
Nassim Jahnke 0946c72bdc Update missing filterFamily method name change 2024-01-12 16:01:30 +01:00
Nassim Jahnke 05470c5f1b Merge branch 'master' into dev 2024-01-12 15:59:42 +01:00
Nassim Jahnke 0392992173 Fix metadata regression
Fixes #3645
2024-01-12 15:58:49 +01:00
Nassim Jahnke 34bd15dec7 Merge branch 'master' into dev
# Conflicts:
#	template/src/main/java/com/viaversion/viaversion/template/protocols/rewriter/EntityPacketRewriter1_99.java
2024-01-12 10:30:24 +01:00
Nassim Jahnke ef78fcd478 Update API license headers and scope 2024-01-12 10:21:45 +01:00
EnZaXD 9d646543b6 Change depthsuspend to mycelium in 1.13 -> 1.12.2 (#3616) 2024-01-12 09:59:17 +01:00
Nassim Jahnke aecef3c3f8 Remove a few deprecated methods 2024-01-09 20:51:32 +01:00
Nassim Jahnke 5991ac5633 Update old metadata handlers, some cleanup 2024-01-09 20:43:43 +01:00
Nassim Jahnke 930454a723 Reset reader 2024-01-09 18:57:33 +01:00
Nassim Jahnke b6ba7dcc44 Handle 1.20->1.20.2 tags 2024-01-09 17:18:32 +01:00
Nassim Jahnke abb05ce902 Merge remote-tracking branch 'origin/master' into dev 2024-01-04 17:50:24 +01:00
Nassim Jahnke a561bad004 Update ViaNBT 2024-01-02 12:55:03 +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 bd99b892db Update ViaNBT (and mcstructs) 2023-12-30 19:02:25 +01:00
Nassim Jahnke 7b4d544e85 Catch tag to json conversion exceptions 2023-12-30 17:25:54 +01:00
Nassim Jahnke fe0fbc7081 Merge branch 'master' into dev
# Conflicts:
#	common/src/main/java/com/viaversion/viaversion/util/NBTConverter.java
2023-12-29 16:50:47 +01:00
Nassim Jahnke bae3d8ec8a Use viafied mcstructs 2023-12-29 16:50:21 +01:00
RK_01 00b8d22cf6 Fix 1.19 -> 1.18.2 ENTITY_EFFECT translation (#3605) 2023-12-27 22:11:34 +01:00
Nassim Jahnke d62284e9cd Make NBTConverter public 2023-12-27 20:20:09 +01:00
Nassim Jahnke 3904ed4fd7 Merge branch 'master' into dev 2023-12-27 19:44:46 +01:00
RK_01 28a0813676 Cleanup of mcstructs branch (#3604) 2023-12-27 19:37:48 +01:00
Nassim Jahnke ca4b6fc765 Update copyright profile
Applying it once 2024 hits
2023-12-27 17:49:37 +01:00
Nassim Jahnke f2f357b2ae Finish up things 2023-12-27 17:30:27 +01:00
Nassim Jahnke dc2986600c Use 1.12 serializer for json to legacy conversion 2023-12-27 11:40:45 +01:00
Nassim Jahnke 984c625776 Methods for VB 2023-12-26 23:59:48 +01:00
Nassim Jahnke c62a8274ed Use mcstructs for component conversion 2023-12-26 23:38:02 +01:00
RK_01 64c436c2e1 Handle invalid config data types (#3595) 2023-12-26 13:18:55 +01:00
Jerry Xiao 0e31664bfe Fix hoverEvent translation from 1.20.2 to 1.20.3 in some cases (#3591) 2023-12-22 12:10:29 +01:00
Valaphee The Meerkat 18f2cf25cd Read 1.8 chunk block id as unsigned (#3578) 2023-12-22 10:22:22 +01:00
Kichura 84b093a997 [ci skip] Update setup-java to v4 (#3589) 2023-12-21 09:27:06 +01:00
Nassim Jahnke 794f401bd0 Add armadildo state meta type 2023-12-18 19:34:53 +01:00
Nassim Jahnke dc732fac6f 23w51b 2023-12-18 18:52:18 +01:00
Nassim Jahnke 2f8114abb1 Finish 23w51a, maybe 2023-12-18 17:14:24 +01:00
Nassim Jahnke 90781c9d27 Start working on 23w51a 2023-12-18 15:58:49 +01:00
Myles 9b1716b662 Merge pull request #3581 from Jo0001/master
Use our own site for update check
2023-12-16 18:15:23 +00:00
Jo0001 dcd4502f5a Use own update site 2023-12-16 18:02:35 +00:00
Aeltumn 5d4b104b33 Try to schedule sending on switch (#3587) 2023-12-16 16:20:53 +01:00
Nassim Jahnke 8e38e25cba Update Gradle wrapper 2023-12-13 22:44:20 +01:00
Jo0001 82e05afacf Use GitHub for update check 2023-12-13 15:08:06 +00:00
Nassim Jahnke 5c8c589a40 Change read method type in update score packet 2023-12-13 12:06:44 +01:00
Nassim Jahnke 70645ec5ee Add system property to print components before conversion 2023-12-11 12:47:00 +01:00
Nassim Jahnke 4aefc23bb8 Fix npe 2023-12-10 12:16:53 +01:00
Nassim Jahnke 2c9affa0e3 Move component conversion into its own class
Remove serialized component type in 1.20.3->1.20.2
2023-12-10 12:10:15 +01:00
Nassim Jahnke 1656ad45a0 Fix quotation marks appearing in mixed json arrays
Fixes #3572
2023-12-10 10:58:44 +01:00
Nassim Jahnke ec2397472d Fix 1.13->1.13.1 handling of particles with items
Fixes #3553
2023-12-10 10:11:47 +01:00
Nassim Jahnke cf5f5ed4bb Fix conversion of mixed json arrays 2023-12-09 15:19:05 +01:00
Nassim Jahnke 9387b86e4a Clone tags instead of abusing double conversion 2023-12-08 21:23:57 +01:00
Nassim Jahnke e3224281a9 Update ViaNBT 2023-12-08 20:31:37 +01:00
Nassim Jahnke f762da2725 Include 1.20.4 in .3 version range 2023-12-07 22:22:30 +01:00
Nassim Jahnke 9a7def62b9 Bump version to 4.9.3-SNAPSHOT 2023-12-07 22:01:36 +01:00
Nassim Jahnke ec27cc7a7b 4.9.2 Release 2023-12-07 11:14:42 +01:00
Nassim Jahnke 3b9ac89d73 Create pack uuid from hash
Fixes #3554
2023-12-07 11:14:04 +01:00
Nassim Jahnke 23ba848a69 Convert chat type in disguised chat packet
Fixes #3551
2023-12-07 10:10:07 +01:00
Nassim Jahnke d98c458a4c Queue plugin message in 1.20->1.20.2 again 2023-12-06 23:30:31 +01:00
Nassim Jahnke 1ad65d1bb0 Add component types in conversion 2023-12-06 10:55:12 +01:00
David Lüdtke d44d89099b Fix LazilyParsedNumber conversion ViaVersion/ViaVersion#3546 (#3550) 2023-12-06 09:50:33 +01:00
Nassim Jahnke d5326fad95 Use correct type 2023-12-06 09:44:20 +01:00
Nassim Jahnke 7de9bc604a Handle configuration tags packet
Fixes #3549
2023-12-06 09:41:49 +01:00
Nassim Jahnke dfee03ddbf Fix map data reading
Fixes #3545
2023-12-05 22:17:42 +01:00
Nassim Jahnke 3babc7a13a Bump version to 4.9.2-SNAPSHOT 2023-12-05 22:16:15 +01:00
Nassim Jahnke 0b1423d8b4 4.9.1 Release - fix resource pack status handling 2023-12-05 17:56:18 +01:00
Nassim Jahnke 6efeb16822 4.9.0 Release 2023-12-04 10:11:08 +01:00
RK_01 9b09b1f5f8 Fix #3542 (#3543) 2023-12-04 10:09:25 +01:00
RK_01 851295d48c Ignore invalid chunk data in legacy versions (#3538) 2023-12-03 18:37:57 +01:00
RK_01 1f453dc0d9 Change gamemode data type in JOIN_GAME handlers (#3541) 2023-12-03 18:35:19 +01:00
RK_01 916c08ce7e Handle invalid entity equipment slots properly (#3540) 2023-12-03 18:34:14 +01:00
RK_01 0ac29fb2c2 Return air instead of stone for unknown block ids (#3539) 2023-12-03 18:33:34 +01:00
Nassim Jahnke 45d08e9066 Directly send pong, plugin message, and keep alive in 1.20.2->1.20 2023-12-03 10:02:36 +01:00
Nassim Jahnke bc0bef2e07 1.20.3-rc1 2023-11-30 15:56:05 +01:00
Nassim Jahnke 6d82839e6d 1.20.3-pre4 2023-11-28 16:58:32 +01:00
Nassim Jahnke c039f4e24c 1.20.3-pre3 2023-11-27 17:09:59 +01:00
Nassim Jahnke 4add75cda7 Fix reset score writing 2023-11-26 15:31:33 +01:00
Nassim Jahnke 28f661f270 1.20.3-pre2 2023-11-22 16:31:21 +01:00
Nassim Jahnke 42f38c3209 Drop old resource packs 2023-11-21 07:35:44 +01:00
Nassim Jahnke 151ecdcd72 Don't resend pack in 1.20->1.20.2 for 1.20.3 clients 2023-11-20 20:01:06 +01:00
Nassim Jahnke a0f8ab7bbb Some cleanup 2023-11-20 19:56:48 +01:00
Nassim Jahnke 1af2103f6c And the serverbound one 2023-11-20 19:07:23 +01:00
Nassim Jahnke 8769742917 Also handle play resource pack 2023-11-20 19:04:32 +01:00
Nassim Jahnke 20f4907a23 1.20.3-pre1 (probably) 2023-11-20 17:55:28 +01:00
Nassim Jahnke 6fb27e5c17 A more probable probably 2023-11-19 16:18:56 +01:00
Nassim Jahnke 07b173bb74 23w46a (probably) 2023-11-19 16:13:04 +01:00
Nassim Jahnke dbf4271c9d Fix 1.20.3 component meta type 2023-11-09 17:34:06 +10:00
Nassim Jahnke a2d287ff9f 23w45a 2023-11-09 15:35:07 +10:00
Nassim Jahnke 58ca2024e1 Add static chunkKey method in ChunkPosition 2023-11-06 20:17:42 +10:00
Nassim Jahnke 2881fb18e0 Include api sources in common sources jar 2023-11-06 20:04:45 +10:00
Nassim Jahnke ffdddeeb0a Add back sources collection in universal jar publishing 2023-11-06 14:52:37 +10:00
Nassim Jahnke e356a35aa7 Improve Gradle scripts
Don't create runnable platform jars anymore, since all they really do is increase build time. Also fix texts and Gradle deprecations. Also also publish common with its shadowed configuration, not the plain java components.
2023-11-06 14:31:44 +10:00
Nassim Jahnke 0474810b8d 23w44a 2023-11-02 10:46:28 +10:00
Nassim Jahnke ea818b272e FU 8.5.13 doesn't exist yet 2023-10-31 18:56:38 +10:00
Nassim Jahnke 9342b19aad Update dependencies 2023-10-31 13:38:43 +10:00
Nassim Jahnke 2968047571 Merge remote-tracking branch 'origin/master' into dev 2023-10-31 13:01:34 +10:00
Nassim Jahnke dccac81286 Fix Bungee pipeline clearing, some cleanup 2023-10-31 13:00:35 +10:00
Myles bc67e8d952 Merge pull request #3511 from Jo0001/master-link 2023-10-29 14:39:19 +00:00
Myles f9ab1bd811 Merge pull request #3510 from Jo0001/dev-link 2023-10-29 14:39:10 +00:00
Jo0001 8776e8bdc0 Update ViaSetup Link 2023-10-29 15:36:14 +01:00
Jo0001 ba882f8f98 Update ViaSetup Link 2023-10-29 15:35:22 +01:00
fren_gor a022620712 Fix reflection field search on Spigot 1.20.2 (#3503) 2023-10-28 13:47:59 +10:00
EnZaXD f618cdec99 Don't mention Spigot page anymore and move setting to right place in config.yml (#3505) 2023-10-27 09:16:14 +10:00
Nassim Jahnke ec2093cf5d 23w43a 2023-10-26 10:20:18 +10:00
EnZaXD eb9bc2fdce Remove permission requirements for root command (#3502) 2023-10-24 13:34:29 +10:00
EnZaXD f35b4f1fac Add own permission for every sub command (#3501) 2023-10-24 12:59:10 +10:00
EnZaXD abe880dae6 Implement provider to allow signed commands in 1.19.x protocols (#3493) 2023-10-24 10:04:54 +10:00
EnZaXD 0f030c86a7 Implement size var int in all chunk types correctly (#3495) 2023-10-24 10:03:32 +10:00
EnZaXD 2c6e18e4fe Match current command input for sub argument tab completions (#3496) 2023-10-24 10:02:08 +10:00
RK_01 78c7f03923 Fix and improved custom payload handling (#3497) 2023-10-24 10:01:33 +10:00
RK_01 68a32ed2f0 Fix identifier handling and validation (#3498) 2023-10-24 09:58:43 +10:00
EnZaXD 7cf008bb62 Delete unused config option and add missing documentation (#3500) 2023-10-24 09:56:29 +10:00
RK_01 a60342359b Fix 1.19.0 chat signing causing error message (#3494) 2023-10-23 10:28:44 +10:00
RK_01 0e269fa493 Implement support for chat signing (#3490) 2023-10-22 19:33:59 +10:00
Nassim Jahnke 815e0820da Fix 1.13->1.13.1 recipes, rename ITEM1_8_ARRAY 2023-10-21 13:22:25 +10:00
Nassim Jahnke faedf26b5b Clean up Particle 2023-10-21 13:00:39 +10:00
RK_01 c7c38e70c0 Make ClientChunks a StorableObject (#3487) 2023-10-21 12:13:24 +10:00
Nassim Jahnke 21d293dd7f Rneame CustomByteType -> FixedByteArrayType 2023-10-20 17:22:00 +10:00
Nassim Jahnke 6481cec270 Just store whether to read skylight directly 2023-10-20 17:09:40 +10:00
Nassim Jahnke 54c04a62e0 Store environment instead of clientlevel in chunk types 2023-10-20 16:56:53 +10:00
Nassim Jahnke 7edde72416 Reuse 1.15, 1.16 and 1.16.2 chunk types as well 2023-10-20 12:43:46 +10:00
Nassim Jahnke 84a054aac1 Give PacketValue a generic type 2023-10-20 12:31:16 +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 553dd2cb45 Move missed type 2023-10-19 21:08:00 +10:00
Nassim Jahnke a30d62a995 Move and rename chunk types 2023-10-19 21:03:00 +10:00
Nassim Jahnke 08f6b3ce36 Only remove id field if it actually is a uuid 2023-10-19 12:16:22 +10:00
Nassim Jahnke 7d1b0d83ce Fix minecart block state id 2023-10-19 11:03:39 +10:00
Nassim Jahnke e7d0b01eee 23w42a 2023-10-19 10:53:14 +10:00
Nassim Jahnke fdfc528a9a Cleanup and renames around types 2023-10-19 09:28:21 +10:00
Nassim Jahnke dccb6f234b Add missing switch breaks 2023-10-18 19:48:19 +10:00
Nassim Jahnke 6e7f936e83 Move methods from VB to VV ComponentRewriter 2023-10-18 13:50:08 +10:00
Nassim Jahnke ec26bafd53 Update ComponentRewriter with nbt methods 2023-10-18 13:26:09 +10:00
Nassim Jahnke d7d7940d0b Move protocol templates from wiki to extra module 2023-10-16 22:30:12 +10:00
Nassim Jahnke 667278f9e6 Handle booleans in json->tag conversion 2023-10-16 15:35:16 +10:00
Nassim Jahnke fa7096c5c1 Convert boss bar packets 2023-10-13 23:28:16 +10:00
Kichura 958064b44c Suggest Fabric loader 0.14.0+ and ViaFabric 0.4.10+ (#3474) 2023-10-13 23:26:38 +10:00
Nassim Jahnke 26dad99265 23w41a 2023-10-12 01:32:00 +10: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 095fe16447 Don't use not yet loaded platform logger in config 2023-10-11 13:23:40 +10:00
Nassim Jahnke cbf8b8f401 Send last tags when re-entering config phase 2023-10-11 01:09:36 +10:00
Nassim Jahnke d600b0cbe1 Queue join game first, then send config packets 2023-10-11 00:06:48 +10:00
Nassim Jahnke 0d70cdbe15 Fix uuid nbt conversion 2023-10-10 23:46:24 +10:00
Nassim Jahnke b1b0874c0f Some cosmetic code changes and typo fixes 2023-10-08 20:54:04 +10:00
Nassim Jahnke 67ba0e9566 Fix typos of entity 2023-10-08 19:03:14 +10:00
Nassim Jahnke bebdc34b4b Register config during manager init 2023-10-08 19:01:00 +10:00
Nassim Jahnke 3e0eb90662 Update OpenNBT (now ViaNBT) 2023-10-08 18:44:54 +10:00
Nassim Jahnke d8f98945e2 Refactor ConfigurationProvider 2023-10-08 14:23:55 +10:00
RK_01 0c3d709456 Clear input buffer instead of reading remaining bytes (#3471) 2023-10-08 03:05:25 +00:00
EnZaXD 868c5ba203 Make registry fields in 1.8 ItemRewriter public (#3472) 2023-10-08 03:05:11 +00:00
Nassim Jahnke 0953ff77e4 Implement dumb nbt<->json component conversion 2023-10-07 23:28:42 +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
Nassim Jahnke def3bf9d4a Add remaining packet transformers, missing actual component conversion 2023-10-06 08:57:00 +10:00
Nassim Jahnke cb1b33b3e7 Start working on 23w40a 2023-10-05 18:22:13 +10:00
Nassim Jahnke a8acae2d5f 4.8.1 Release 2023-10-03 20:57:47 +10:00
Nassim Jahnke fdb7f47749 Properly throw the client information packet into the queue instead 2023-10-03 20:54:51 +10:00
Nassim Jahnke cabb95a3a4 Schedule send client information 2023-10-03 20:39:46 +10:00
Nassim Jahnke 0b93af88a3 Re-send client information when re-entering play state
Fixes #3442
2023-10-03 19:49:55 +10:00
Unoqwy 11cb113619 Fix disconnecting error for unknown mobs with metadata (#3443) 2023-10-03 09:46:02 +00:00
Nassim Jahnke 429e4f0bff Switch server state after sending game profile
Probably fixes #3453
2023-09-28 11:12:46 +10:00
Nassim Jahnke 3b0d1d961a Fix secondary effect reading in serverbound beacon
Fixes #3455
2023-09-28 09:34:26 +10:00
Nassim Jahnke b4720c723a Fix biome and chunk size preconditions 2023-09-27 14:35:20 +10:00
Nassim Jahnke 215cbc6310 Fix 1.20.2 custom potion effect handling
Fixes #3448
2023-09-27 11:30:35 +10:00
RK_01 f07ba9b527 Reduce delay for sequence acknowledgements (#3445) 2023-09-26 10:53:36 +10:00
Misode 5a20030ff3 [ci skip] Update Minecraft Wiki link to new domain after fork (#3446) 2023-09-26 10:52:03 +10:00
Nassim Jahnke 1b350c0c53 Try to fix ci 2023-09-26 10:40:44 +10:00
Nassim Jahnke 87db6fc75a [ci skip] Fix branch check 2023-09-26 00:17:33 +10:00
Nassim Jahnke 840770a350 Fix missing server state change 2023-09-25 20:11:29 +10:00
Nassim Jahnke 3997ea70f7 Fixup state splitting 2023-09-25 18:59:15 +10:00
Nassim Jahnke 854696abff Add separate client and server protocol state 2023-09-25 16:44:41 +10:00
Nassim Jahnke d92b9fdeaa Fix connection field search on 1.20.2 2023-09-25 09:57:55 +10:00
Nassim Jahnke 270d28f259 Don't cancel custom query answer 2023-09-25 08:56:26 +10:00
RK_01 ed1852ba40 Fix 1.20.2 -> 1.20.1 brand custom payloads properly (#3440) 2023-09-25 08:52:17 +10:00
riku6460 f91e6a83f9 Fix sign nbt on 1.20 client (#3436) 2023-09-24 13:02:31 +10:00
Nassim Jahnke 8a0e187621 Drop custom payloads with non-alphanumerical brands
For some reason the client errors only if it contains certain characters, needs further investigation. Mojang changed their string writing implementation, though the actual encoding does not seem to have changed, and this error does not occur anywhere else
2023-09-24 10:48:47 +10:00
Nassim Jahnke 0e8b5e8e98 Bump version to 4.8.1-SNAPSHOT 2023-09-24 10:47:43 +10:00
Nassim Jahnke e30dd63b3c [ci skip] Only publish releases from the main branch 2023-09-22 15:32:14 +10:00
Nassim Jahnke 489b28e520 4.8.0 Release 2023-09-21 10:34:20 +10:00
Nassim Jahnke d23e743550 Fix particle handling 2023-09-21 10:33:58 +10:00
Nassim Jahnke 16f89f2638 Don't re-enter config state if the dimension registry did not change 2023-09-19 21:14:45 +10:00
Nassim Jahnke fe5646a68c Re-send last resource pack on server switch 2023-09-19 11:54:03 +10:00
Nassim Jahnke 53aca791dd Fix reentering of the configuration state 2023-09-19 00:37:55 +10:00
Nassim Jahnke 1f0a4c26db 1.20.2-rc2 2023-09-19 00:07:43 +10:00
Nassim Jahnke 4c34ced240 Fix record handling due to no mappings
Fixes #3422
2023-09-16 13:28:15 +10:00
Nassim Jahnke 18c4f90cb0 Don't cancel system chat messages 2023-09-16 13:27:44 +10:00
Nassim Jahnke 9c90445c9c Release ConfigurationState buffers on disconnect
They're heap buffers, but still good practice
2023-09-16 13:27:23 +10:00
Nassim Jahnke 494e6ffc05 1.20.2-rc1 2023-09-16 10:19:49 +10:00
Nassim Jahnke a196dbc16b 1.20.2-pre4 2023-09-14 09:03:13 +10:00
Nassim Jahnke 8934bbdfc3 1.20.2-pre3 2023-09-12 23:06:54 +10:00
Myles 8316c59010 Merge pull request #3420 from Kichura/dev 2023-09-11 19:55:27 +01:00
Kichura 5ea1c1ec95 Use https instead of http for wiki.vg source. 2023-09-11 20:06:27 +02:00
Nassim Jahnke cc7c571a3c 1.20.2-pre2 2023-09-08 09:05:31 +10:00
Nassim Jahnke 06b4678b2d [ci skip] Add IDEA extension plugin 2023-09-06 11:20:32 +10:00
Nassim Jahnke a109118a97 1.20.2-pre1 2023-09-06 00:56:31 +10:00
Nassim Jahnke a135a1414c [ci skip] Update Gradle wrapper 2023-09-05 21:16:24 +10:00
Nassim Jahnke f50751ed48 [ci skip] Update blossom 2023-09-05 21:10:43 +10:00
Kichura 4b7998b4ea [ci skip] Update checkout to v4, Check for latest JDK 11 build (#3416) 2023-09-05 20:48:36 +10:00
Nassim Jahnke 6db1a2a614 Fix wrong packet type being used 2023-08-31 11:49:54 +10:00
Nassim Jahnke 625373827c Fix MetaTypes1_20_2 item type 2023-08-31 11:44:55 +10:00
Nassim Jahnke a9288ebd3a 23w35a 2023-08-31 00:42:47 +10:00
Nassim Jahnke 01bbb2c1c2 [ci skip] Update Hangar publish plugin 2023-08-26 20:04:06 +10:00
Nassim Jahnke 8dbc8e8eba Update mappings file for 23w33a 2023-08-18 01:28:55 +10:00
Nassim Jahnke 0c9f3aa080 23w33a 2023-08-18 01:27:00 +10:00
EnZaXD 00625be890 Move 1.9 backwards protocols to VB and move Chunk Types to the correct package (#3404) 2023-08-14 10:46:30 +10:00
Pablo Herrera e112f81ec8 Optimize memory allocation for data palette (#3402) 2023-08-14 10:40:10 +10:00
Nassim Jahnke 23f776a6ee Handle minecart blocks 2023-08-11 21:12:23 +10:00
Nassim Jahnke 0050872950 Update README 2023-08-11 21:12:03 +10:00
Nassim Jahnke 7e53f55509 Also publish dev branch builds to Hangar 2023-08-11 20:33:47 +10:00
Nassim Jahnke 1bf7962dc3 Call latestCommitHash only once 2023-08-11 16:24:27 +10:00
Nassim Jahnke 50176dc317 Include link to commit in autopublished changelog 2023-08-11 16:21:44 +10:00
Nassim Jahnke 9ed074d0d5 Handle changes block state ids 2023-08-11 15:52:53 +10:00
Nassim Jahnke 8bad8a10be Finish publishing action 2023-08-11 12:28:38 +10:00
Nassim Jahnke 34509e86c0 [ci skip] Add Velocity and Waterfall to publish config 2023-08-11 00:39:45 +10:00
Nassim Jahnke ef75bd567d [ci skip] GH already skips all actions with ci skip 2023-08-10 22:48:22 +10:00
Nassim Jahnke 7ed3e50e93 [ci skip] Skip commits with ci skip prefix 2023-08-10 22:46:15 +10:00
Nassim Jahnke a45eceaf1d Hello Hangar 😎 2023-08-10 22:18:23 +10:00
Nassim Jahnke 573cdfb3ac Merge remote-tracking branch 'origin/master' into dev 2023-08-10 21:49:26 +10:00
Nassim Jahnke 28787340d1 Setup Hangar and modrinth autopublishing 2023-08-10 21:29:03 +10:00
Nassim Jahnke c358245c0b Fix spawn tracker mapping data check 2023-08-10 17:14:01 +10:00
Nassim Jahnke cb073405b7 Effect ids start at 1 before 1.20.2 2023-08-10 17:08:36 +10:00
Nassim Jahnke f618f6a7d6 Actually write effect key 2023-08-10 13:51:15 +10:00
Nassim Jahnke c5e066e050 23w32a 2023-08-10 13:35:47 +10:00
riku6460 d954e1745d Fix itemArrayType of ItemRewriter on dev branch (#3398) 2023-08-09 07:38:24 +10:00
Nassim Jahnke 9c92ccea77 Finish up state switching 2023-08-06 15:40:15 +10:00
RK_01 2b9e0cec5c Fix maps with no map id set showing up as empty on 1.17+ (#3395) 2023-08-06 11:11:42 +10:00
RK_01 c1cd8bc03e Allow skylight to be set to null (#3396) 2023-08-06 11:08:52 +10:00
Nassim Jahnke 39efc5262e Add todo 2023-08-05 13:31:43 +10:00
Nassim Jahnke 6e5e115c3b Remove unnecessary rewriting code, fix recipe handlers 2023-08-05 12:28:39 +10:00
Nassim Jahnke fbcbd33c66 Small refactors 2023-08-04 12:35:35 +10:00
Nassim Jahnke 7bea3142bc Fix baseprotocol registration 2023-08-04 12:26:07 +10:00
Nassim Jahnke fb472c3454 Cleanup imports 2023-08-04 12:25:29 +10:00
Nassim Jahnke ac10bb3fd0 Complete 23w31a protocol 2023-08-04 12:22:18 +10:00
Nassim Jahnke 1bc3d407d1 More juicy, untested work 2023-08-03 23:03:42 +10:00
Nassim Jahnke 62c0ef360f More absolutely cursed WIP 2023-08-03 21:58:23 +10:00
Nassim Jahnke 8c6d104faa 23w31a eletric boogaloo 2023-08-03 19:47:18 +10:00
Nassim Jahnke f6b8c4a8c8 Rename rewriter classes 2023-08-03 18:38:18 +10:00
Nassim Jahnke 6586fc1436 More work on the snapshot 2023-08-03 18:36:30 +10:00
Nassim Jahnke 6dfd4747ee Start working on 23w31a 2023-08-03 13:58:22 +10:00
Nassim Jahnke 6377721ebd Fix non item display rotation
Fixes #3383
2023-07-24 20:56:45 +10:00
RK_01 2ec6185c46 Fix <= 1.14 position y sign reading (#3381) 2023-07-12 19:10:49 +02:00
Nassim Jahnke b22907748a Update gradle wrapper 2023-07-11 23:34:37 +02:00
Nassim Jahnke 1aee8a7a6c Don't create ack task when already disabled
Fixes #3373
2023-07-02 13:29:07 +02:00
Nassim Jahnke 7edb43844c Properly handle item display rotation change
Fixes #3354
2023-07-02 13:27:03 +02:00
sandtechnology f28aac5eb3 Handle more null TextComponent for 1.19 to 1.18.2 (#3366) 2023-06-24 11:12:14 +02:00
Nassim Jahnke 4971eeab6a Don't check block items for armor swapping 2023-06-22 11:03:11 +02:00
Pablo Herrera 0bb940e42d Fix missing block connection updates on cancelled place/remove (#3359) 2023-06-20 13:39:02 +02:00
Pablo Herrera e32933ada9 Fix late registration of join listener (#3360) 2023-06-19 17:02:05 +02:00
EnZaXD a817746edc Remove requirement for MovementTransmitterProvider (#3355) 2023-06-18 15:30:58 +02:00
RK_01 408392e796 Fixed some 1.9 -> 1.8 movement issues (#3353) 2023-06-18 14:51:37 +02:00
Kichura 20a4ae3e4b Use friendly names in CI tasks, Update shadow and blossom (#3349) 2023-06-15 09:48:13 +02:00
Nassim Jahnke 08b2d78165 Move dump creation to util class 2023-06-14 23:13:44 +02:00
FlorianMichael 17eb7b676a Remap old smithing menu to furnace in 1.20 2023-06-12 18:57:20 +02:00
Nassim Jahnke 9a1598b9ed Update 1.20/1.20.1 protocol version 2023-06-12 16:47:22 +02:00
Myles 9e7cd151bc Update version table to 1.20 2023-06-11 12:02:25 +01:00
David Luedtke 2a14f9a0cd Fix display rotation change 2023-06-09 12:17:11 +02:00
Ossi Erkkilä bf825d5ef6 Fix SpongeViaInjector#getServerProtocolVersion() for Sponge API-10+ (#3337) 2023-06-09 11:29:55 +02:00
EnZaXD 28ba4afc27 Added VersionInfo#getVersion to bypass Java inlining (#3344) 2023-06-09 08:52:30 +02:00
Nassim Jahnke 7f347231bb Bump version to 4.7.1-SNAPSHOT 2023-06-08 13:21:19 +02:00
Nassim Jahnke f1b5f9223a 4.7.0 Release 2023-06-06 13:30:57 +02:00
Nassim Jahnke e4a1530aa8 Fix >1.18 vibration particle handling 2023-06-06 13:28:02 +02:00
Nassim Jahnke 09b67fad63 Small cleanup 2023-06-06 12:30:56 +02:00
Nassim Jahnke 1b3c5b4032 Create its own packets enum for 1.14.4
Acknowledge player digging was only added then, make sure this is represented correctly
2023-06-05 09:06:15 +02:00
Nassim Jahnke b7d8a3c8d5 1.20-rc1 2023-05-31 15:40:23 +02:00
Kichura 9a515df0f3 Update dependencies (#3332) 2023-05-30 09:25:18 +02:00
Nassim Jahnke c6103f2f51 1.20-pre7 2023-05-29 16:54:45 +02:00
Nassim Jahnke 5c0eda76e8 Don't replace unchanged 1.12->1.13 translations with hard text
Also add the remaining unchanged keys to the file
Fixes #3284
2023-05-28 13:48:22 +02:00
Nassim Jahnke 544a28b06b 1.20-pre6 2023-05-25 15:09:42 +02:00
RK_01 5c145d0184 Fixed high CPU usage on Java 8 (#3325)
Fixed https://bugs.openjdk.java.net/browse/JDK-8129861 by setting the core size of the TaskScheduler ThreadPool to 1
2023-05-23 18:18:10 +02:00
Nassim Jahnke ed55bccfe4 Fix 1.19.3->1.19.4 statistics handling
Fixes #3324
2023-05-23 16:39:20 +02:00
Nassim Jahnke 5acc2fefbc 1.20-pre5 2023-05-23 15:40:54 +02:00
Nassim Jahnke 7f748b5c68 1.20-pre4 2023-05-19 15:40:54 +02:00
Nassim Jahnke 0ec03f8b09 1.20-pre3 2023-05-19 14:22:14 +02:00
Nassim Jahnke a70034e0b5 Remove early static initializer call
Weird NoClassDefFoundError going on
2023-05-18 11:53:34 +02:00
Nassim Jahnke 98a0fdca94 1.20-pre2 2023-05-16 16:00:36 +02:00
Nassim JahnkeandPantera 82961cc153 Add 1.20 sound mappings
Co-authored-by: Pantera (Mad_Daniel) <89838384+Pantera07@users.noreply.github.com>
2023-05-14 08:42:51 +02:00
Nassim Jahnke 6c0d891c9f Don't print mapping validity warning if conversion warnings are disabled 2023-05-14 08:38:24 +02:00
Nassim Jahnke 6fa387e6ab Update the rest of nbt files to be uncompressed 2023-05-10 15:53:53 +02:00
Nassim Jahnke 07bdb57694 1.20-pre1 2023-05-10 15:46:03 +02:00
Nassim Jahnke 75dd79347a Update mappings 2023-05-05 21:05:35 +02:00
Nassim Jahnke 9257890d3c Update protocol version 2023-05-05 18:50:15 +02:00
Nassim Jahnke 891f55192d 23w18a, maybe 2023-05-03 15:21:24 +02:00
EnZaXD 7adadc0d21 added PlayerAbilities Provider (#3311) 2023-05-03 09:17:51 +02:00
Camotoy 638378cddf Let records properly stop in 1.19.3 -> 1.19.4 (#3308)
Fixes #3307
2023-04-28 14:44:29 +02:00
Nassim Jahnke 56d772df34 23w17a 2023-04-26 18:46:52 +02:00
Nassim Jahnke 7bb5cf3ae9 Update Gradle wrapper 2023-04-26 12:23:02 +02:00
Nassim Jahnke b67e3c30fd Move packet construction of schedule send methods to event loop as well
Fixes #3306
2023-04-26 12:18:08 +02:00
EnZaXD a2e214ae18 Improve InventoryTracker16 Code (#3302) 2023-04-22 08:57:47 +02:00
Nassim Jahnke 54d8e29a7e 23w16a 2023-04-20 17:28:30 +02:00
Joseph Burton a2daa9c989 Fix PlayerLookTargetProvider, apparently this packet is written in two different places (#3301) 2023-04-19 14:43:39 +02:00
Nassim Jahnke 74cc42fecf Merge remote-tracking branch 'origin/master' into dev 2023-04-19 12:08:15 +02:00
Joseph Burton dd59ddbd4f Add PlayerLookTargetProvider (#3299) 2023-04-19 12:04:17 +02:00
Nassim Jahnke bcfc77aa7d Merge branch 'master' into dev 2023-04-18 13:35:14 +02:00
Nassim Jahnke 1a46346789 Handle optional block state entity meta 2023-04-18 13:34:20 +02:00
RK_01 394be165fd Handle ENTITY_TELEPORT's targeting the client player (#3296) 2023-04-14 16:38:39 +02:00
Nassim Jahnke 20d86374b5 23w14a 2023-04-05 15:25:37 +02:00
Nassim Jahnke 8864b161f9 Print plugin name in unsupported software matching 2023-04-02 09:41:20 +02:00
Nassim Jahnke 7b0160d6c3 Fix redstone blockconnections
Fixes #3281
2023-03-31 16:41:06 +02:00
Nassim Jahnke 7e5173982d 23w13a 2023-03-29 16:32:50 +02:00
Nassim Jahnke ee75f19790 Merge branch 'master' into dev
# Conflicts:
#	gradle.properties
2023-03-29 16:28:57 +02:00
Nassim Jahnke e54f6d1999 Override metatypeimpl tostring 2023-03-28 17:27:22 +02:00
Nassim Jahnke c46bb5bcf5 Update Folia check 2023-03-25 00:31:50 +01:00
Nassim Jahnke d08f15c095 4.6.2 Release 2023-03-24 22:00:05 +01:00
Nassim Jahnke 8aa7898755 Cherry-pick some changes from dev 2023-03-24 17:58:53 +01:00
Nassim Jahnke 9682b68251 Handle sign nbt changes 2023-03-24 11:19:51 +01:00
Nassim Jahnke 364cfad9d8 23w12a 2023-03-22 18:49:18 +01:00
RK_01 641171a14f Properly handle dismount in PLAYER_POSITION packet (#3272) 2023-03-21 21:53:44 +01:00
Nassim Jahnke 23f045feee Fix glass pane and iron bars block connections
Fixes #3269
2023-03-20 10:31:13 +01:00
Nassim Jahnke f1bde8ba2a Handle shifted 1.19.4 boat types 2023-03-18 12:28:00 +01:00
Nassim Jahnke 9ccc3aed30 Keep all 1.12 translation mappings cached 2023-03-18 10:01:37 +01:00
Nassim Jahnke ad56caeb88 Double the trouble 2023-03-17 21:47:55 +01:00
Nassim Jahnke 573201c0b1 Only load JoinListener things early 2023-03-17 18:37:48 +01:00
Nassim Jahnke e298a7efac Fix protocol detection on some versions of Spigot
Fixes #3263
2023-03-17 18:36:48 +01:00
Nassim Jahnke 2e59a51734 Add PacketValue toString 2023-03-17 13:26:13 +01:00
Nassim Jahnke d4894ca4b5 Fix #3260 2023-03-17 13:15:56 +01:00
Nassim Jahnke 7f7c6241de Fix 1.12->1.13 stop sound handling
Fixes #3247
2023-03-17 11:37:37 +01:00
Nassim Jahnke 51606eb5ef Bump version to 4.6.2-SNAPSHOT 2023-03-17 11:34:35 +01:00
Nassim Jahnke c9883c2638 4.6.1 Release 2023-03-16 20:44:53 +01:00
Nassim Jahnke 74fb55d96b Update yaml compat checker 2023-03-16 20:41:03 +01:00
Nassim Jahnke 4e844a0095 Small startup time improvements 2023-03-16 12:48:39 +01:00
Nassim Jahnke da7f8ea3b6 Be more safe 2023-03-15 16:21:15 +01:00
Nassim Jahnke 81c4e530e9 Possibly fix joinlistener on 1.19.4 Spigot 2023-03-15 16:15:21 +01:00
Nassim Jahnke b1524642aa Fix protocol detection on 1.19.4 Spigot
Fixes #3241
2023-03-15 10:09:45 +01:00
Nassim Jahnke a828c43f99 Remove ignoreCancelled from ArmorToggleListener, small cleanup
Spigot considers interacting with air "cancelled"
Fixes #3240
2023-03-15 09:20:21 +01:00
Nassim Jahnke fccfadf1b7 Handle falling blocks
Fixes #3244
2023-03-15 09:04:13 +01:00
lixfel 18b41c82c4 1.15.2 Spigot/Paper NoSuchMethodError YamlCompat fix (#3242) 2023-03-14 21:48:40 +01:00
Nassim Jahnke 27ee6f519e Bump version to 4.6.1-SNAPSHOT 2023-03-14 21:48:18 +01:00
Nassim Jahnke 7aa0aed5ec 4.6.0 Release 2023-03-13 14:18:40 +01:00
Nassim Jahnke 10c4d9408e 1.19.4-rc3 2023-03-13 14:17:59 +01:00
Nassim Jahnke e8b4496289 1.19.4-rc2 2023-03-10 14:58:40 +01:00
Nassim Jahnke 10737f17e2 Delay version detection when using legacy injector 2023-03-10 14:29:28 +01:00
Nassim Jahnke 7c9c602cec Support Folia (leaf's region threaded Paper fork) 2023-03-10 12:20:02 +01:00
Nassim Jahnke 2ee2819759 1.19.4-rc1 2023-03-09 17:52:41 +01:00
Nassim Jahnke 72197ddca8 Lots of small and less small blockconnection optimization
- blockConnections.json data is now stored more compact and with direct block state ids in blockConnections.nbt
- For PacketBlockConnectionProvider, the server now longer spams unnecessary block change packets if the connectable block did not actually change
- Some other, small optimizations within the individual connection handlers
2023-03-09 17:46:03 +01:00
Nassim Jahnke 9781b7962f 1.19.4-pre4 2023-03-08 15:28:59 +01:00
Nassim Jahnke d180c8fe2f Small ConnectionData cleanup 2023-03-08 15:13:29 +01:00
Nassim Jahnke d8a9480bf1 Clean up BiMappings impl 2023-03-07 11:27:25 +01:00
Howard ZHY a3efb676cf Fix #2912 (#3221) 2023-03-07 11:25:32 +01:00
Pablo Herrera 68d1843496 Optimize block connections on neighbour chunk calculation (#3228) 2023-03-06 12:21:17 +01:00
Nassim Jahnke 3ced95903a Cache identifiers files 2023-03-05 15:20:16 +01:00
Nassim Jahnke b3825e637e Fix heightmap file, hotfix enchantment rewriting without mappings 2023-03-05 09:32:56 +01:00
Nassim Jahnke c765f20558 Readd enableMappingsCache stub until reimplemented 2023-03-04 21:03:53 +01:00
Nassim Jahnke b5259beef7 Update README 2023-03-04 19:43:08 +01:00
Nassim Jahnke 712bbcdc02 More fixes to mapping data loading 2023-03-04 17:17:47 +01:00
Nassim Jahnke b94c71b699 Register tagrewriter in 1.19.3->1.19.4 protocol 2023-03-04 00:23:02 +01:00
Nassim Jahnke 51d4e11b5f Minimize/optimize mapping data files 2023-03-04 00:08:08 +01:00
Nassim Jahnke d94ed4ebd4 Allow null rewrite function in TagRewriter 2023-03-03 15:14:52 +01:00
Nassim Jahnke 9ce3d8e567 Update OpenNBT to 2.1.2 2023-03-03 14:20:41 +01:00
Nassim Jahnke 9fd0d3e565 Reduce mappings file sizes and optimize item mappings 2023-03-02 13:14:11 +01:00
Nassim Jahnke 7b91c25379 1.19.4-pre3 2023-03-01 16:07:23 +01:00
Nassim Jahnke 7161377794 Add PacketWrapper#setCancelled(boolean) 2023-02-28 21:49:08 +01:00
Nassim Jahnke 8f97f43f12 Update Gradle wrapper 2023-02-28 21:41:32 +01:00
Nassim Jahnke 57f0d58d58 1.19.4-pre2 2023-02-27 16:12:35 +01:00
Nassim Jahnke b45be1944e Support snakeyaml 2 2023-02-27 14:16:40 +01:00
Nassim Jahnke c4019fadd8 Fixes 2023-02-24 16:50:28 +01:00
Nassim Jahnke 5cad29c754 Expose PacketTypesProvider in Protocol 2023-02-24 10:07:25 +01:00
Nassim Jahnke a6e1cb6534 I didn't read the changelogs 🛌 2023-02-22 19:08:50 +01:00
Nassim Jahnke 26615a11d3 23w08a 2023-02-22 18:51:28 +01:00
Nassim Jahnke 3e2ee37829 Allow custom PacketMappings implementation in AbstractProtocol 2023-02-22 16:54:54 +01:00
Nassim Jahnke 35263e36ff Let VB handle mapping cache enabling
Soon™️ to be fixed by Paper
2023-02-20 17:34:32 +01:00
Nassim Jahnke bf4e4d771f Uncap mapping loader executor pool, less logging 2023-02-20 17:30:56 +01:00
Nassim Jahnke 1157029f23 Remove unused config option, hotfix mapping data cache 2023-02-20 13:19:10 +01:00
Nassim Jahnke 7b5cb92982 Small refactor 2023-02-20 13:19:03 +01:00
Nassim Jahnke d74f91d606 Handle item/block/particle metadata 2023-02-18 10:00:57 +01:00
Nassim Jahnke 1376312449 23w07a 2023-02-17 23:02:02 +01:00
Nassim Jahnke 1faf1f3f49 Reduce RecipeRewriter extends chain 2023-02-16 12:27:31 +01:00
Nassim Jahnke fb0381e76a Update Gradle wrapper 2023-02-15 14:56:12 +01:00
Nassim Jahnke 45fcc9ef7d Rename Protocol generics to be clearer 2023-02-12 21:14:10 +01:00
Nassim Jahnke f5ddc6550d Optimize/improve Protocol packet mapping
Also makes it possible to work with packet types of different states in a Protocol
2023-02-12 17:27:36 +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 b03765a828 23w06a 2023-02-08 18:49:06 +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
Camotoy 734bc9e88c Add armor toggle patch for Bukkit (#3210) 2023-02-03 17:02:22 +01:00
Nassim Jahnke 93654b8eaf Don't load mappings in 1.19.4 protocol 2023-02-03 10:48:46 +01:00
Nassim Jahnke 64b3771899 23w05a 2023-02-01 16:30:21 +01:00
Nassim Jahnke 4031429430 23w04a 2023-01-24 17:03:08 +01:00
Nassim Jahnke 50b94abcb1 Move changed time handling out of base CommandRewriter 2023-01-18 18:03:09 +01:00
Nassim Jahnke 50adff90f2 23w03a 2023-01-18 16:49:05 +01:00
Nassim Jahnke 7d0b838474 Update dependencies 2023-01-14 20:05:21 +01:00
Nassim Jahnke 4fb95581ce Update copyright headers 2023-01-12 12:45:53 +01:00
Nassim Jahnke 0ae64203f5 Add player versions and sample pipelines to dump 2023-01-10 19:05:54 +01:00
Nassim Jahnke 4067107b52 Improve exception handling 2023-01-06 20:51:21 +01:00
Camotoy 8d7270a2ff Fill in creeper igniter tag for 1.19.3 (#3184) 2022-12-25 10:52:50 +01:00
Nassim Jahnke ece8857535 Handle missed 1.19.3 pose change 2022-12-21 10:45:54 +01:00
Nassim Jahnke 9688b3df5d Bump version to 4.5.2-SNAPSHOT 2022-12-21 10:45:06 +01:00
Nassim Jahnke 58442ec177 4.5.1 Release 2022-12-11 14:40:34 +01:00
Nassim Jahnke 2a49fc0bf8 Fix chat command decode
Fixes #3161
2022-12-09 13:15:42 +01:00
Nassim Jahnke 7fb8675271 Thank you gradle, very cool 2022-12-09 11:18:26 +01:00
Myles 57a8744a53 Use scheduleSend for enabled features packet 2022-12-07 22:16:50 +00:00
Myles 09222f1024 4.5.1-SNAPSHOT 2022-12-07 22:14:14 +00:00
Nassim Jahnke b4870a49e3 1.19.3-rc3 protocol changes (but not actually supporting the snapshot)
Definitely still 4.5.0
2022-12-06 12:20:48 +01:00
Nassim Jahnke f7a48d028b 4.5.0 Release 2022-12-05 20:29:24 +01:00
Nassim Jahnke 382ef3953a Merge remote-tracking branch 'origin/master' into dev 2022-12-05 19:55:29 +01:00
Nassim Jahnke 9be32ca18b Make slightly more sense of CompactArrayUtil
... and make it less vanilla copy pasty

The magic array is a reciprocal table of 3-tuples, although 1 and 2 are always the same but for the ones including right shifts
2022-12-02 14:34:32 +01:00
Nassim Jahnke e0cd121a58 1.19.3-rc1 2022-12-01 16:41:19 +01:00
Nassim Jahnke 96631cee0c 1.19.3-pre3 2022-11-29 17:26:51 +01:00
Nassim Jahnke 8c0487fc05 1.19.3-pre2 2022-11-23 18:02:33 +01:00
Nassim Jahnke aec60f8cef 1.19.3-pre1 2022-11-22 17:11:11 +01:00
Nassim Jahnke a3080800b0 More minor refactoring 2022-11-22 17:04:06 +01:00
Kevin Ludwig 85f9414b95 Fix recipe book not being empty when using a multi-server configuration, with servers which are pre-1.12. (#3156) 2022-11-20 12:31:01 +01:00
Nassim Jahnke e7f07d1fdb Update mappings file 2022-11-16 16:39:16 +01:00
Nassim Jahnke 83efd0a267 22w46a (maybe) 2022-11-16 16:03:18 +01:00
Nassim Jahnke 5c05c61fbf 22w45a 2022-11-09 16:09:23 +01:00
Nassim Jahnke fad350c811 Small refactoring 2022-11-03 18:30:59 +01:00
Nassim Jahnke d3d8d1cab3 22w44a (maybe) 2022-11-02 15:49:40 +01:00
RK_01 a3437ca6ba Fix 1.19 -> 1.18.2 player info display name translation: Empty text edge case (#3146) 2022-10-27 10:36:46 +02:00
Kevin Ludwig 17bd048d10 Fix missing zombie_pigman (1.15.2) => zombified_piglin (1.16) translation in mob_spawner entity (#3147) 2022-10-27 10:32:31 +02:00
F 955b76f599 Fix use-new-effect-indicator option for 1.13+ clients (#3127) 2022-10-27 10:30:03 +02:00
Nassim Jahnke e3dc9e5b66 22w43a 2022-10-26 18:09:42 +02:00
Nassim Jahnke 6095128007 Remove javassist dependency, reduces file size by ~1mb 2022-10-25 17:31:13 +02:00
Nassim Jahnke 0355447d53 Remove more of the old compat layer 2022-10-25 15:55:42 +02:00
Nassim Jahnke 58fd0bdc9e Remove 1.8 PS compat hack 2022-10-25 10:36:09 +02:00
Nassim Jahnke cdc35aa5dc Merge remote-tracking branch 'origin/master' into dev 2022-10-25 10:36:02 +02:00
RK_01 10efba31cf Update 1.9 -> 1.8 ATTACH_ENTITY data reading (#3144) 2022-10-25 10:35:45 +02:00
Nassim Jahnke ef204c2ab2 Fix argument type handling 2022-10-23 18:27:44 +02:00
Nassim Jahnke 555e1a7722 Fix long metatype reading, some internal type reading changes 2022-10-22 10:19:27 +02:00
Nassim Jahnke 7400784e4f 22w42 (except for command completions) 2022-10-20 19:34:04 +02:00
Nassim Jahnke 2154f0a2cf Almost works 2022-10-19 23:18:39 +02:00
Nassim Jahnke 14b11bdd10 Start working on 22w42a 2022-10-19 21:58:08 +02:00
Nassim Jahnke c5738a2203 Add Via channel handlers instead of wrapping Vanilla handlers on Bukkit (#3132) 2022-10-19 21:29:24 +02:00
MrMicky 43ad855499 Rewrite signs and books components on 1.16 (#2712) 2022-10-16 21:22:48 +02:00
Kichura 2533619339 Update actions, Gradle 7.5.1 (#3139) 2022-10-15 19:20:20 +02:00
Nassim Jahnke b133dad642 Fix random long gen for seeded sounds 2022-10-08 21:50:09 +02: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
BuzzTheGamer23 c7eb2e4b97 Change Maven version from deprecated LATEST (#2913) 2022-10-01 11:23:02 +02:00
creeper123123321 e71c88f860 Add sanity checks for some block nbt (#3129) 2022-10-01 10:14:41 +02:00
RK_01 c96b2bd859 Fix 1.19 -> 1.18.2 title translation: empty text edge case (#3115) 2022-09-02 16:00:45 +02:00
Nassim Jahnke ce4f21b7d8 Fix Paper packet limiter check on new versions 2022-08-25 13:03:40 +02:00
Nassim Jahnke 2a55025e99 Version bump 2022-08-21 14:58:00 +02:00
Nassim Jahnke c86da22f4e Fix config header duplication on reload
Fixes #3100
2022-08-21 14:57:32 +02:00
Nassim Jahnke adb10f5fe7 4.4.2 Release 2022-08-21 09:42:05 +02:00
Pablo Herrera a268d3d298 Fix userconnection availability on join event (PoC) (#2849) 2022-08-19 11:59:48 +02:00
creeper123123321 b60771e96e Fix block connection on non-full chunks (#3068) 2022-08-15 11:58:57 +02:00
Nassim Jahnke 435a986068 Properly enclose limiting of nbt reading
Fixes #3093
2022-08-14 22:24:31 +02:00
Nassim Jahnke 6c58f0980c Add utility method for initializing entity types 2022-08-13 15:36:57 +02:00
Nassim Jahnke e3dde71821 And the default return value 2022-08-11 19:09:33 +02:00
Nassim Jahnke 47b15e5fef Forgot a lock 2022-08-11 19:08:33 +02:00
Nassim Jahnke ed196bdf99 Clean up proxy protocol detector service 2022-08-11 19:04:22 +02:00
Nassim Jahnke 9247e87bbf Update InformativeException message 2022-08-08 21:01:27 +02:00
Nassim Jahnke 08727f959f Update 1.19.1 protocol version string 2022-08-05 16:05:31 +02:00
Nassim Jahnke 78342da180 And make the 1.19 chat registry nbt public 2022-08-04 16:29:35 +02:00
Nassim Jahnke 2b735172bd Make 1.19 chat decoration method public 2022-08-04 16:23:21 +02:00
_tomcraft b032a868bb add flamecord warking message (#3079) 2022-08-04 16:19:08 +02:00
Nassim Jahnke c4fa3b0ff8 Fix worldDataTrackerHandlerByKey world index 2022-08-04 15:51:51 +02:00
Nassim Jahnke 0c3a1803e1 Send block entity data after block break cancellation
Fixes #3077
2022-08-03 19:45:00 +02:00
Gero 04f9971dee Alter velocity modern forwarding version (#3078) 2022-08-03 16:17:52 +02:00
Elioby 9c3395b76b Use default painting mapping of 0 instead of -1 (#3073) 2022-08-01 21:07:40 +02:00
Nassim Jahnke f9bbb5b1a3 Fixup config comment saving
Fixes #3052, #2536
2022-08-01 12:28:44 +02:00
Nassim Jahnke 087bbdce1f Fix 1.19+ sign opening on ~1.12 servers
Fixes #3027
2022-07-30 18:10:45 +02:00
Nassim Jahnke 494bf62535 Bump version to 4.4.2-SNAPSHOT 2022-07-30 18:05:04 +02:00
Nassim Jahnke 4f2a5bb7e2 4.4.1 Release 2022-07-28 18:49:40 +02:00
Nassim Jahnke 1c511a82b2 Simplify component building 2022-07-28 14:56:35 +02:00
Nassim Jahnke 0c39723d1a Use translation key as text if not found 2022-07-28 13:43:08 +02:00
Nassim Jahnke 322af00e80 Handle 1.19 chat types 2022-07-28 13:14:28 +02:00
Nassim Jahnke a88747d904 Check for dimension equality after adding/replacing new fields 2022-07-28 11:47:12 +02:00
Nassim Jahnke e194d27bea Allow for more control over max path distance delta increase 2022-07-28 11:29:02 +02:00
Nassim Jahnke 22daa60eb6 4.4.0 Release 2022-07-27 19:01:23 +02:00
Nassim Jahnke 6eca07966c 1.19.1-rc3 2022-07-26 18:27:32 +02:00
Nassim Jahnke 56cc711c01 Update legacy palette handling as well 2022-07-25 13:18:13 +02:00
Nassim Jahnke c2ee558235 Fix reading of cursed Hypixel block palettes
Fixes #3037
2022-07-24 18:42:25 +02:00
Nassim Jahnke c8a010c390 Handle negative bits per value in palette 2022-07-24 17:30:30 +02:00
Nassim Jahnke 53c54485eb Cleanup optional types 2022-07-21 19:56:42 +02:00
Nassim Jahnke f42a308f2c 1.19.1-rc2 2022-07-21 19:06:34 +02:00
Nassim Jahnke 44250cbb99 1.19.1-pre6 2022-07-20 18:36:28 +02:00
Nassim Jahnke 55ffe72198 Fix overlay type check, update some comments 2022-07-15 21:33:55 +02:00
Nassim Jahnke a47dd2ecdb Support 1.19.1 clients on 1.19.0 servers 2022-07-15 21:03:56 +02:00
Nassim Jahnke 8a5233b6a1 what am I doing 2022-07-15 18:07:59 +02:00
Nassim Jahnke c8a1279e75 I was too hopeful 2022-07-15 16:51:12 +02:00
Nassim Jahnke 57ef90e851 1.19.1-pre5 2022-07-15 16:26:58 +02:00
_tomcraft 2262681351 Reference command permission to filter root suggestions (/via<tab>) (#3018) 2022-07-13 10:24:14 +02:00
Nassim Jahnke 56e1d0a69d Add optional type for smol cleanup 2022-07-09 11:47:58 +02:00
Nassim Jahnke 63ffb51df5 Fix player chat packet id
Mojang didn't register that in the correct spot alphabetically :(
2022-07-08 21:07:42 +02:00
Nassim Jahnke b33bd2ac2b 1.19.1-pre4 2022-07-08 16:20:54 +02:00
Nassim Jahnke 1afff77a0f 1.19.1-pre3 2022-07-06 17:47:47 +02:00
Nassim Jahnke 26af09f2a4 Update unsupported software list 2022-07-05 20:37:19 +02:00
Nassim Jahnke a8e475dbf0 Bump version to 4.4.0-SNAPSHOT
Too many funky things for a patch version
2022-07-01 12:35:57 +02:00
Nassim Jahnke 6388021c6d Fix 1.18.2->1.19.0 transforming, warn on 1.19.0 server 2022-06-30 20:00:55 +02:00
Nassim Jahnke f4aa96a5f8 1.19.1-pre2 2022-06-30 19:34:14 +02:00
Nassim Jahnke 6baae5e4f7 Merge remote-tracking branch 'origin/master' into dev 2022-06-30 10:42:27 +02:00
Nassim Jahnke 189b244a3a Delay ack by a tick, update warning for bad dimension registry 2022-06-30 10:41:54 +02:00
creeper123123321 12d538fe0d Use most similar dimension when the proper is not found (#2990) 2022-06-30 10:31:10 +02:00
_tomcraft 34f0dbf642 Safely handle bad configuration of 'block-protocols' and 'block-versions' (#2983) 2022-06-28 11:22:42 +02:00
Myles 548f80bb7c Add label for Feature Requests 2022-06-27 13:36:10 +01:00
Nassim Jahnke 9113a77331 1.19.1-rc1 except not really 2022-06-23 20:45:42 +02:00
Nassim Jahnke e3e85db02a 1.19.1-pre1 2022-06-21 21:01:24 +02:00
Camotoy c4d9209c81 Rewrite statistics for 1.19 (#2954) 2022-06-15 10:13:14 +02:00
Nassim Jahnke 24d887a53d Properly handle 1.19 acks on backend
Fixes #2935
2022-06-12 11:14:05 +02:00
Owen 702ced200e Generate a random seed to simulate random sounds (#2944) 2022-06-11 19:02:54 +02:00
qlowandqlow 40f5cb6e71 Fixed Bungeecord madness (#2934)
Co-authored-by: qlow <info@qlow.eu>
2022-06-09 17:10:22 +02:00
Nassim Jahnke 7ab0c41be6 Fix villager trade offers
Fixes #2919
2022-06-08 10:07:47 +02:00
Nassim Jahnke 66b21431f2 Fix sending of empty titles
Fixes #2923
2022-06-08 09:51:38 +02:00
Nassim Jahnke c6cd655f7e Bump version to 4.3.2-SNAPSHOT 2022-06-08 09:09:37 +02:00
Myles e9bccda259 4.3.1 Release - Fix set display preview being sent prematurely #2918 2022-06-07 23:11:21 +01:00
Nassim Jahnke 9a34ff2a51 4.3.0 Release 2022-06-05 11:31:07 +02:00
trickypr f01d9408de 1.19-rc2 (#2910) 2022-06-04 11:08:04 +02:00
Nassim Jahnke 15ff7b4c9d 1.19-rc1 2022-06-02 17:49:25 +02:00
Nassim Jahnke d47765ce45 1.19-pre5 2022-06-01 15:16:47 +02:00
Gero b82b067745 Actually make every message a system message (#2903) 2022-05-25 21:24:26 +02:00
Nassim Jahnke b7005f2400 1.19-pre3 2022-05-25 14:33:39 +02:00
roro1506HD 312fe3a851 Fixed wrong packet in MovementTransmitter when not using NMS player ticking (#2900) 2022-05-23 20:29:21 +02:00
Nassim Jahnke 69d50fa992 Join game fixes 2022-05-23 19:38:38 +02:00
Nassim Jahnke 1308dcb8dd No need to queue messages anymore
The client now uses the main registry instead of the level registry
2022-05-23 18:24:32 +02:00
Nassim Jahnke b4ecba8382 1.19-pre2 2022-05-23 18:03:18 +02:00
Nassim Jahnke 3529d6a229 Sanity check for queued messages 2022-05-21 11:00:55 +02:00
Nassim Jahnke 4213c4cce5 Queue up messages before the chat type registry has been sent
Fixes #2898
2022-05-20 15:32:10 +02:00
Nassim Jahnke 3d3e09977c Fix big fat dumb 2022-05-20 14:16:31 +02:00
Nassim Jahnke 90feac8c83 Update DebugHandler 2022-05-20 14:10:23 +02:00
Nassim Jahnke 80a807e366 Fix head yaw and pitch being swapped for mob spawns 2022-05-20 10:00:31 +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 e67501cde3 Fix painting id being used too early
Fixes #2893
2022-05-19 19:54:27 +02:00
Nassim Jahnke 9aa7f5e879 Fix data stored on join being lost on Bungee
Bungee doesn't resend a join game for old servers, so we will have to keep data stored there across server switches
This likely fixes other issues with chunk data writing after server switches on legacy servers as well
2022-05-19 12:37:04 +02:00
Nassim Jahnke 854ecf0b47 1.19-pre1 2022-05-18 21:29:18 +02:00
Nassim Jahnke f538f25d63 Update OpenNBT 2022-05-16 13:33:41 +02:00
Nassim Jahnke 48a7fdc1d1 Fix command rewriter npe 2022-05-15 18:11:36 +02:00
Nassim Jahnke 1d5ae0e3e0 Use mappings instead of hardcoding entity ids 2022-05-14 11:58:45 +02:00
Nassim Jahnke f0462085d3 Add id->string methods to FullMappingData 2022-05-13 13:23:57 +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 b9f80754e0 22w18a 2022-05-04 19:15:23 +02:00
Nassim Jahnke 5b9f775743 Use normal uuid type in gameprofile packet 2022-04-27 21:49:37 +02:00
Nassim Jahnke 0e66228a96 22w17a (and a lot of dread) 2022-04-27 21:06:34 +02:00
Nassim Jahnke 8df48bc378 StoredEntityData#remove 2022-04-20 20:16:08 +02:00
Nassim Jahnke d36d5d6def 22w16b 2022-04-20 20:00:46 +02:00
Nassim Jahnke 8b51430555 22w16a (except you have off-centered paintings) 2022-04-20 19:42:43 +02:00
Nassim Jahnke f71288e299 22w15a 2022-04-13 18:36:26 +02:00
Nassim Jahnke c0fc8195ce ?????????????????????????????????????????????????????
Also add removeTags and renameTag method to TagRewriter
2022-04-06 22:50:59 +02:00
Nassim Jahnke dd189411e6 New meta types (oh no) 2022-04-06 20:16:00 +02:00
Nassim Jahnke 4693b95bea 22w14a 2022-04-06 19:07:16 +02:00
Nassim Jahnke 596a42e312 22w13a 2022-03-31 18:46:35 +02:00
Nassim Jahnke 71944be482 Minor improvement to var int writing 2022-03-26 18:12:12 +01:00
Nassim Jahnke d1699fbb8d Merge remote-tracking branch 'origin/master' into dev 2022-03-24 19:07:28 +01:00
Nassim Jahnke bd880b608f 22w12a 2022-03-24 18:52:38 +01:00
Nassim Jahnke 3386431749 Comment out entity effect transformer 2022-03-21 10:40:52 +01:00
Nassim Jahnke c3fc8b5f18 Actually fix particles
Fixes #2850
2022-03-19 16:04:13 +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 a536ad1d10 Fix particles 2022-03-16 22:51:18 +01:00
Nassim Jahnke a1ae7818a2 Add namespace to argument type mappings 2022-03-16 20:25:00 +01:00
Nassim Jahnke 365b3a8a38 22w11a 2022-03-16 19:48:17 +01:00
RK_01 823eb1f392 Fix inventory acknowledgements being dropped sometimes (#2848) 2022-03-16 18:35:58 +01:00
Nassim Jahnke a12dfa405f 1.19 Experimental Snapshot 1 2022-03-16 18:21:41 +01:00
Nassim Jahnke 9798ec296a Update gradle wrapper to 7.4.1 2022-03-09 18:48:56 +01:00
Nassim Jahnke c1b993c01b Hotfix ProtocolLib 5.0.0 compatibility 2022-03-09 17:41:36 +01:00
Nassim Jahnke f55696a605 Bump version to 4.2.2-SNAPSHOT 2022-03-09 17:28:57 +01:00
Nassim Jahnke f361bd66ea 4.2.1 Release
Fix 1.18.2 client respawn on legacy servers
2022-02-28 16:01:41 +01:00
Nassim Jahnke 3dfb96dec9 4.2.0 Release 2022-02-24 09:22:47 +01:00
Nassim Jahnke 82ada0bcd8 Add new default command parser 2022-02-23 18:15:39 +01:00
Nassim Jahnke 28bd50a105 Fix legacy component text wrapping
Fixes #2821
2022-02-22 10:10:51 +01:00
Nassim Jahnke 46bd5814e3 Fix mutated dimension registry on old servers 2022-02-19 10:14:15 +01:00
Nassim Jahnke 4e9cddac8f 1.18.2 pre1 2022-02-18 17:49:45 +01:00
Nassim Jahnke a85c5578c1 22w07a 2022-02-16 18:40:50 +01:00
Nassim Jahnke 130ab70550 Fix registry on respawn 2022-02-09 19:57:54 +01:00
Nassim Jahnke ee27cbdd22 22w06a 2022-02-09 19:15:35 +01:00
Nassim Jahnke bd0d238f23 22w05a 2022-02-02 11:42:18 +01:00
Nassim Jahnke 3a5ac6f037 Merge branch 'master' into dev 2022-01-30 18:24:05 +01:00
Nassim Jahnke 8db0f3ac6e Fix uninjection from empty pipeline
Closes #2788
2022-01-30 18:21:28 +01:00
Nassim Jahnke 60eda447b4 22w03a 2022-01-19 18:05:36 +01:00
Nassim Jahnke d5f2388723 Add Item#copy 2022-01-11 17:10:31 +01:00
Nassim Jahnke d5a568b3fc Update copyright header 2022-01-09 22:36:07 +01:00
Nassim Jahnke 2704d70c1f Update Sponge module to API v8 2022-01-09 18:30:51 +01:00
Konicai 2a1e82ac6d Initial update to api-8 2022-01-09 16:17:41 +01:00
Nassim Jahnke 755a69e912 Update shadow 2022-01-05 10:03:07 +01:00
RK_01 101a4f63de Fixed 1.9.2 -> 1.9.3 block entity translation (#2784) 2022-01-03 11:05:15 +01:00
Nassim Jahnke 84bdaa79e2 Map walls to low variant in 1.15->1.16 2021-12-22 17:32:25 +01:00
Nassim Jahnke c3b6f5ce64 Update Gradle wrapper to 7.3.2 2021-12-22 17:31:30 +01:00
Nassim Jahnke 06a7260173 Fill dirt block tag to fix flower place animation 2021-12-20 10:53:11 +01:00
Nassim Jahnke 54236f718f Update shadow 2021-12-15 08:59:34 +01:00
Nassim Jahnke 2143e38d27 Don't make the client resize palettes on >8 bits 2021-12-08 21:31:53 +01:00
Nassim Jahnke 7d7651bc39 Update ProtocolVersion name for 1.18.1 2021-12-08 16:37:10 +01:00
RK_01 64c11b1f8f Fixed 1.9 -> 1.8 potion metadata packet order (#2765) 2021-12-08 12:49:13 +01:00
Myles a1a0926c4b Back to snapshot 2021-12-03 18:11:51 +00:00
Myles aade94a48f 4.1.1 release 2021-12-03 18:02:58 +00:00
Nassim Jahnke edebe64cf8 Fix handling of invalid biomes in 1.17->1.18 2021-12-03 13:33:52 +01:00
Nassim Jahnke ae4f837091 Fix double effect register 2021-12-02 20:17:24 +01:00
Lucas 5e6d87c8fd Map smoke directions from 1.13 to 1.13.1 (#2745) 2021-12-02 17:04:48 +01:00
Nassim Jahnke 20e9723d21 Update Gradle, particles finally work everywhere™️
Fixes #2746
2021-12-02 10:54:32 +01:00
Nassim Jahnke 54724ac540 Fix 1.18 block entity warnings on <1.12 servers 2021-12-01 19:54:43 +01:00
Nassim Jahnke a9c848e32e Cleanup palette type 2021-12-01 17:50:23 +01:00
Nassim Jahnke 02f9e87233 Fix invisible chests for 1.18 clients on very old servers
Fixes #2744
2021-12-01 17:50:09 +01:00
Nassim Jahnke 22d546edc0 Bump version to 4.1.1-SNAPSHOT 2021-12-01 15:37:39 +01:00
Nassim Jahnke f464e8e287 4.1.0 Release 2021-11-29 21:17:20 +01:00
Nassim Jahnke bd5217acb4 Merge remote-tracking branch 'origin/master' into dev 2021-11-28 16:09:21 +01:00
RK_01 e0cf62825b Fixed 1.9.3 -> 1.9.1 chunk translation (#2740) 2021-11-28 16:08:02 +01:00
Nassim Jahnke 9ce356aff4 another one 2021-11-26 17:15:10 +01:00
Nassim Jahnke 60fa54dddc 1.18-rc2 2021-11-26 10:53:58 +01:00
Nassim Jahnke 99b457965b 1.18-rc1 2021-11-25 16:09:34 +01:00
Nassim Jahnke 1d1a330ef1 1.18 pre8 2021-11-24 16:41:42 +01:00
Nassim Jahnke 4e9910c20e 1.18-pre7 2021-11-23 18:09:09 +01:00
Nassim Jahnke 82f2958ac6 1.18-pre6 2021-11-22 18:41:49 +01:00
Nassim Jahnke 1afa441571 Fix possible NPE in 1.13 component rewriting 2021-11-21 21:02:06 +01:00
Nassim Jahnke d159047dc0 Add more debugging options 2021-11-21 11:43:55 +01:00
Nassim Jahnke 3a529d00ce Fix update light passthrough 2021-11-19 21:35:21 +01:00
Nassim Jahnke b14b2b86e8 1.18-pre5 2021-11-19 17:27:43 +01:00
Nassim Jahnke 9ab4319771 *this is wrong intensifies* 2021-11-19 10:20:30 +01:00
Nassim Jahnke 8de7a4c828 Improve ceillog2 method 2021-11-19 10:06:45 +01:00
Nassim Jahnke 782d7a2172 this is wrong 2021-11-18 11:38:31 +01:00
Nassim Jahnke 2e5f3e4d66 this is wrong 2021-11-18 11:32:53 +01:00
Nassim Jahnke 6a00bf099e Cache 1.17.1 light by default, add config option 2021-11-18 11:23:46 +01:00
Nassim Jahnke bc11bd4caf Set mappings default values to -1 2021-11-17 19:52:06 +01:00
Nassim Jahnke c133552d04 1.18-pre4 2021-11-17 19:28:44 +01:00
Nassim Jahnke 2065a83fa1 Update biomes highest bits 2021-11-17 18:02:54 +01:00
Nassim Jahnke 30ce0eaa45 1.18-pre3 2021-11-17 17:43:17 +01:00
Nassim Jahnke 8be1fc9340 Move MetaTypes methods up into abstract class 2021-11-17 11:13:14 +01:00
Nassim Jahnke 6a8aa497b0 1.18-pre2 2021-11-16 13:28:53 +01:00
Nassim Jahnke 390155e03b Make Mappings extendable 2021-11-16 13:15:27 +01:00
Nassim Jahnke 3051ddb6c0 Better Mappings builders
Allows for mappings between json arrays and objects without a billion different constructors, also now uses the proper size for 1.18 chunks
2021-11-15 21:49:02 +01:00
Nassim Jahnke 25d74632c2 Update Bungee version warning 2021-11-15 11:00:18 +01:00
Nassim Jahnke 2b77427d0b Remove unused 1.18 code 2021-11-14 09:45:25 +01:00
_tomcraft dfc77b6f84 Update BungeeCord support (#2731)
fixes #2730
2021-11-14 09:44:33 +01:00
_tomcraft 6bc7f911c3 Fix bed rewriting and fix inconsistencies in item rewrite (#2729) 2021-11-14 09:37:03 +01:00
Nassim Jahnke 718614f81f 1.18 Pre-1 2021-11-11 10:06:59 +01:00
Nassim Jahnke 8e1f3bb086 Update Gradle to 7.3, adventure to 4.9.3 2021-11-11 10:05:58 +01:00
Nassim Jahnke 3a87eb463a Fix 1.18 spawner entity 2021-11-10 17:31:52 +01:00
Nassim Jahnke a49c395486 Make changes in particles easier to handle 2021-11-10 11:35:44 +01:00
Nassim Jahnke ad7f782a1a Fix InformativeException NPE 2021-11-08 12:09:08 +01:00
Nassim Jahnke 3aa84b5a5a Fix particle 1.18 meta type 2021-11-06 15:19:24 +01:00
Nassim Jahnke 52457ea749 Fix unquoted string being parsed as double 2021-11-05 18:19:14 +01:00
Nassim Jahnke 8104b96b8c Fix premature snbt numeric parsing 2021-11-04 19:43:48 +01:00
Nassim Jahnke a7835650bf Make model customization type with previous handlers 2021-11-03 19:16:03 +01:00
Nassim Jahnke d326dadb5d 21w44a 2021-11-03 19:14:33 +01:00
Nassim Jahnke d9307dad0c Merge remote-tracking branch 'origin/master' into dev 2021-11-03 10:53:16 +01:00
RK_01 752735159c Fixed credits screen not showing on 1.8 servers (#2724) 2021-11-02 19:01:29 +01:00
Nassim Jahnke 7cc6eb2b66 Fix accidental float/double NaN parsing in snbt 2021-11-02 15:09:40 +01:00
Nassim Jahnke 0a19057606 Merge remote-tracking branch 'origin/master' into dev 2021-10-30 15:56:39 +02:00
RK_01 a49d73c4c6 Abstract 1.8 metadata type (#2720) 2021-10-30 15:56:24 +02:00
Nassim Jahnke 82ded0299c Merge remote-tracking branch 'origin/master' into dev 2021-10-29 17:57:47 +02:00
Nassim Jahnke ab7cd4955b Metadata type should be written as var int 2021-10-29 17:57:23 +02:00
Nassim Jahnke 95493f3bbe Minor optimization 2021-10-29 17:47:38 +02:00
Nassim Jahnke a8c6f6b783 21w43a 2021-10-27 18:43:09 +02:00
Nassim Jahnke 516f746061 Handle barrier/light particles in entity meta 2021-10-25 09:52:54 +02:00
Nassim Jahnke d8d65ea989 Merge remote-tracking branch 'origin/master' into dev 2021-10-23 09:58:22 +02: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
Redned ff5ad2385c Fix recipe book glitch on <1.16.2 servers (#2715) 2021-10-23 09:30:03 +02:00
Nassim Jahnke 2f28b25af3 Add block marker id to ParticleMappings 2021-10-20 18:51:53 +02:00
Nassim Jahnke 02bf9501a9 Handle item and particle meta 2021-10-20 18:48:07 +02:00
Nassim Jahnke a6292988d5 21w42a
Screw entity meta particles
2021-10-20 17:58:50 +02:00
Nassim Jahnke 431f773b77 Merge remote-tracking branch 'origin/master' into dev 2021-10-20 13:52:34 +02:00
Nassim Jahnke bd2bd1cf32 Cancel global entity packet if not lightning 2021-10-20 13:51:49 +02:00
Nassim Jahnke f5d92bf74f Merge remote-tracking branch 'origin/master' into dev 2021-10-19 09:16:06 +02:00
Nassim Jahnke dbe8b6551a Readd flare
Issues were addressed in 2.0.0
2021-10-19 09:10:17 +02:00
Nassim Jahnke 027e132749 Merge remote-tracking branch 'origin/master' into dev 2021-10-16 13:26:06 +02:00
Nassim Jahnke 7e3a157fcf Revert flare usage for now
Caused some issues I have no time to investigate at the moment, but worrying enough to warrant a temporary removal
Closes ViaVersion/ViaBackwards#402
2021-10-16 13:25:56 +02:00
Nassim Jahnke 9cd1ebf576 21w41a 2021-10-13 18:05:52 +02:00
Nassim Jahnke 03f929163c Merge remote-tracking branch 'origin/master' into dev 2021-10-11 21:04:29 +02:00
Nassim Jahnke e7e1ee7a2b Update shadow 2021-10-11 21:03:18 +02:00
_tomcraft 3f229c4cb9 Minor improvements (#2709) 2021-10-11 21:00:32 +02:00
Gero b2e0fdeaf8 Don't cancel chunks with missing light data (#2711) 2021-10-09 14:08:07 +02:00
Nassim Jahnke 0b541befbc Merge remote-tracking branch 'origin/master' into dev 2021-10-08 17:29:16 +02:00
Nassim Jahnke fd9346d4da Use validated channel in getNewPluginChannelId
Fixes #2707
2021-10-08 17:29:05 +02:00
Nassim JahnkeandGerrygames e744214ad6 Fix biome palette writing
Co-authored-by: Gerrygames <gecam59@gmail.com>
2021-10-08 13:17:07 +02:00
Nassim Jahnke 3feff8e751 Fix remove in ChunkLightStorage 2021-10-08 10:05:50 +02:00
Nassim Jahnke a2acd261d8 Merge remote-tracking branch 'origin/master' into dev 2021-10-08 09:37:32 +02:00
Nassim Jahnke 36b8884d92 Fix leftover FU load factors 2021-10-08 09:37:04 +02:00
Nassim Jahnke c15d7b8882 Don't forget id comments 2021-10-07 16:46:10 +02:00
Nassim Jahnke 9f33a09e87 21w40a 2021-10-07 16:44:43 +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 b19ec959b3 Merge remote-tracking branch 'origin/master' into dev 2021-10-05 14:21:31 +02:00
MrMicky 8b4a57985b Remove usage of sun.misc.Unsafe in BungeeViaInjector (#2698) 2021-10-05 14:20:18 +02:00
Nassim Jahnke 7fb4e4a095 Change GH actions dist to adoptium 2021-10-05 14:10:04 +02:00
Nassim Jahnke 1bc4fc211d Merge remote-tracking branch 'origin/master' into dev 2021-10-03 20:15:19 +02:00
Nassim Jahnke 0a4d08886d Update adventure 2021-10-03 20:14:12 +02:00
creeper123123321 0f5fa620d1 Translatable ender dragon/wither text (#2702) 2021-10-03 16:23:41 +02:00
Gero a0f26f1ca3 Fix channel name validation in 1.13 to 1.12.2 protocol (#2701)
Closes #2187
2021-10-03 12:12:49 +02:00
MrMicky e64a0fb62e Prevent kick when signing empty book (#2700) 2021-10-03 10:11:34 +02:00
Nassim Jahnke 69409d71d1 Run handitem cache every tick 2021-10-02 16:38:20 +02:00
Nassim Jahnke 68c63d20ed Fix reading of explicit int array entries
See https://github.com/KyoriPowered/adventure/pull/460
2021-10-02 11:27:18 +02:00
Nassim Jahnke 2afa3fd9de Merge remote-tracking branch 'origin/master' into dev 2021-10-01 22:46:37 +02:00
Myles 0bcaf3e422 Merge pull request #2695 from ViaVersion/legacy-injector-cleanup
Cleanup Bukkit/Sponge injectors
2021-10-01 15:38:03 +01:00
Nassim Jahnke 6e5992c168 Add docs to abstract LegacyViaInjector methods 2021-10-01 16:33:18 +02:00
Gero 02122f8ce6 Fix #2532 2021-10-01 15:35:04 +02:00
_tomcraft 39f7f70a32 Cancel arm animation if in an open inventory for 1.16+ (#2687) 2021-10-01 12:38:49 +02:00
Nassim Jahnke 427b0a68d0 Cleanup Bukkit/Sponge injectors 2021-10-01 12:17:55 +02:00
Nassim Jahnke 50f3a05fa5 21w39a (probably) 2021-09-29 20:16:31 +02:00
Nassim JahnkeandRK_01 a306c222d4 More NBTTagTest test cases
Co-authored-by: RK_01 <50594595+raphimc@users.noreply.github.com>
2021-09-25 15:43:55 +02:00
Nassim Jahnke 5bfee3339a Merge remote-tracking branch 'origin/master' into dev 2021-09-25 14:57:41 +02:00
Nassim Jahnke 2b9df69627 Fix trailing comma again, fix 'possiblyNumeric' DoubleTag parsing 2021-09-25 14:57:14 +02:00
Nassim Jahnke 4f1e92f309 Merge remote-tracking branch 'origin/master' into dev 2021-09-25 13:18:59 +02:00
Nassim Jahnke 88165088a9 Update adventure nbt i/o 2021-09-25 13:15:26 +02:00
Nassim Jahnke e38f76b8bc Definitely did not forget to update mappings 2021-09-24 14:39:38 +02:00
Nassim Jahnke 1f63fc7de1 21w38a 2021-09-23 17:23:14 +02:00
Nassim Jahnke 763a88fe97 Merge remote-tracking branch 'origin/master' into dev 2021-09-22 11:16:35 +02:00
Nassim Jahnke 12e2be40e8 Remove some old todos, don't send empty 1.14->1.15 meta packet 2021-09-22 11:15:36 +02:00
Nassim Jahnke 22379eda6f Add todo 2021-09-22 10:16:42 +02:00
Nassim Jahnke 4485af577d Merge remote-tracking branch 'origin/master' into dev 2021-09-21 11:02:40 +02:00
Nassim Jahnke 0fcfd78b62 Add more user friendly 'block-versions' option 2021-09-20 15:15:25 +02:00
Nassim Jahnke 4940ed66c1 Don't warn on superfluous bytes
Should be looked into, but not now™️
2021-09-16 18:17:44 +02:00
Nassim Jahnke 73093c0ff2 Read/write palette based on block/biome size variables 2021-09-16 18:12:33 +02:00
Nassim Jahnke c5e27b89af Don't read remaining bytes in 1.18 chunk type 2021-09-16 17:01:58 +02:00
Nassim Jahnke 111cd2fd46 Biome palettes entries can have 1 bit 2021-09-16 15:47:28 +02:00
Nassim Jahnke 5a90c8374c Fix named sound packets and old block entities 2021-09-16 15:41:14 +02:00
Nassim Jahnke 9ffa737a4d Implement BlockEntity sectionX/Z methods 2021-09-16 14:19:45 +02:00
Nassim Jahnke c565f2c9c7 Cleanup Palette interface and read/write 2021-09-16 13:03:31 +02:00
Nassim Jahnke eaa18f569a Write linear palette as map palette for now 2021-09-16 12:17:21 +02:00
Nassim Jahnke bfe6389377 Write biomes to palette 2021-09-16 11:35:05 +02:00
Nassim Jahnke f72412484a Map block entity ids, only biomes and something else left 2021-09-16 00:26:23 +02:00
Nassim Jahnke b4301adb3b WIP 21w37a 2021-09-15 23:00:14 +02:00
Levertion d67269c9fe Add support for setting a custom world name (#2672) 2021-09-15 10:52:11 +02:00
Nassim Jahnke c264e639d6 Clear entity data on world change in world tracker 2021-09-14 17:35:27 +02:00
Nassim Jahnke 32a84f24ef Nicer getters in Pair and Triple 2021-09-14 11:13:39 +02:00
Nassim Jahnke 68e4146f3b Deprecate cancelClientbound/Serverbound with new id parameter 2021-09-05 14:02:33 +02:00
Nassim Jahnke f4f7215a6a Fix disabled packet limiter check 2021-09-02 17:33:09 +02:00
Nassim Jahnke a0b19872f8 Disable VV packet limiter on 1.17.1+ Paper 2021-09-01 15:25:24 +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
Nassim Jahnke 533572e8cd Add CREATE_FOG BossFlag 2021-08-27 19:29:07 +02:00
creeper123123321 257eea5b04 try to fix GoLilyPad servers (#2667)
Closes ViaVersion/ViaFabric#21
2021-08-25 14:55:43 +02:00
Jo0001 47af0d634f Fix typo in comment/javadocs (#2609) 2021-08-25 12:49:57 +02:00
kennytv 5e11d9d51f Update Gradle to 7.2 2021-08-17 13:37:51 +02:00
kennytv 7ffcff7a7b Fix 1.15->1.16 wolf anger 2021-08-14 10:37:21 +02:00
kennytv 9ee548b967 Fix 1.17 clients writing empty books
Fixes #2658
2021-08-11 15:11:56 +02:00
kennytv c9142223fd Gitignores don't have to be .gitignore'd 2021-08-02 17:59:12 +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 46ca469a4a Add author tag to constructed book nbt
Fixes #2640
2021-07-27 11:58:24 +02:00
Pierre Maurice Schwang 8fb51bf3b7 Update bug_report.yml (#2636) 2021-07-25 09:51:04 +02:00
creeper123123321 9874a9053a it's 2021 and we should use UTF 8 (#2633) 2021-07-23 21:31:25 +02:00
kennytv db87774426 Fix ProtocolSupport compat on 1.17
Fixes #2632

Thank you md_5, very cool
2021-07-23 10:15:59 +02:00
creeper123123321 d14db9396b Fix idle ticking in proxies (#2631) 2021-07-20 18:57:53 +02:00
kennytv d7966567e7 Lowercase gang 2021-07-07 20:43:27 +02:00
KennyTV b4f8024eef Fix 1.15->1.16 and 1.16.1->1.16.2 dropped items
Fixes #2610
2021-07-07 10:06:15 +02:00
KennyTV e70f230f39 Bump version to 4.0.2-SNAPSHOT 2021-07-07 09:59:49 +02:00
KennyTV b28f743306 4.0.1 Release 2021-07-06 10:31:03 +02:00
KennyTV 9f97a09942 1.17.1-rc2 2021-07-05 14:52:13 +02:00
KennyTV 4f7e655613 1.17.1-rc1 2021-07-01 19:58:34 +02:00
KennyTV a7d94c2f8f 1.17.1-pre3 2021-06-30 18:19:19 +02:00
KennyTV c2172821fd Merge remote-tracking branch 'origin/master' into dev 2021-06-29 18:12:36 +02:00
KennyTV 24393d4ef4 1.17.1-pre2 2021-06-29 18:11:51 +02:00
KennyTV 622ea91648 Ignore bad 1.8 wither meta
Fixes #2570
2021-06-22 11:28:09 +02:00
KennyTV aed1a63a77 Merge remote-tracking branch 'origin/master' into dev 2021-06-21 14:58:38 +02:00
LemonCaramel 14cd568e46 Add Resource pack prompt message option (1.17+) (#2544) 2021-06-21 14:55:49 +02:00
KennyTV 44d836e2e7 Clear entity trackers on server switch
Fixes #5930
2021-06-21 14:33:23 +02:00
_tomcraft f9af6947f7 Improve arm-swing cancel by resetting cursor item (#2528) 2021-06-20 22:50:37 +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 860aca974b Read unsigned byte in set slot 2021-06-20 16:16:08 +02:00
KennyTV 6a66d7653f Fix writable book id 2021-06-20 16:16:07 +02:00
KennyTV d32a4541a9 1.17.1-pre1 2021-06-20 16:16:07 +02:00
KennyTV 26719169ee Fix 1.8 special inventory tracking 2021-06-20 16:15:48 +02:00
KennyTV eae145543e Fix 1.8 set slot write type
Fixes #2558
2021-06-19 15:35:43 +02:00
KennyTV 48f1300908 Read set slot inv id as unsigned byte for consistency 2021-06-18 16:59:34 +02:00
KennyTV 5cdaabeaec Handle particle id change in 1.16 metadata
Fixes #2551
2021-06-17 11:55:22 +02:00
KennyTV 40f87e9472 Update Gradle wrapper to 7.1 2021-06-16 09:12:23 +02:00
KennyTV 7f385d4762 Create concurrent hashmap with weak values with Guava
This could use Guava's Cache, but that's just the MapMaker but more
2021-06-15 09:59:23 +02:00
KennyTV 389c5adaa3 Half revert back to storing uuids in CommonBoss
Fixes #2547
2021-06-14 22:47:13 +02:00
KennyTV 7a82ded94b Fix Velocity compatibility (requires Velocity 3.0.0)
This finally removes the hacky reorder fix on Velocity; it added a few more events that could benefit us, but this is the most important right now.
2021-06-14 21:09:47 +02:00
Myles 86278e837a Fix 1.17 BungeeCord support 2021-06-14 19:46:25 +01:00
KennyTV 34a0499152 Update bug_report.yml 2021-06-14 10:59:01 +02:00
Myles 68ccc6634d Spigot 1.17 compatibility 2021-06-11 20:19:06 +01:00
Jo0001 317af7ebc5 Use the correct content-type header (#2527) 2021-06-10 22:15:14 +02:00
KennyTV 206368b777 Fix 1.12->1.13 entity tracking
Fixes #2526
2021-06-10 22:10:22 +02:00
KennyTV 204a81b0ea Add 1.17 to legacy api package ProtocolVersion 2021-06-10 10:50:07 +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 b5e5b46f77 Update adventure to 4.8.0 release 2021-06-08 19:07:09 +02:00
KennyTV 42b6a1378c Bump to 4.0.1-SNAPSHOT 2021-06-08 19:06:08 +02:00
KennyTV 4074352a53 4.0.0 Release 🚀 2021-06-07 16:32:07 +02:00
KennyTV f909b55a84 1.17-rc2 2021-06-07 14:28:41 +02:00
KennyTV 593aa7564a Put the other filled 1.17 tags into the diff file 2021-06-07 09:58:52 +02:00
KennyTV 24efb48004 Add method to load extra tags from diff files 2021-06-06 17:17:51 +02:00
KennyTV 38b3f40f7d Add Java version warning
We will update the required Java version at some point, the only question is when.
2021-06-06 11:55:40 +02:00
KennyTV d89f916546 Cleanup 1.17 entity rewriter, fix DataItem amount check 2021-06-06 10:08:15 +02:00
KennyTV 62278f287c Update gson, junit, and checker-qual 2021-06-05 17:17:29 +02:00
KennyTV 72be978f8e Update issue template 2021-06-05 17:16:51 +02:00
creeper123123321 666f3d6c92 Explain "left-handed-handling" option (#2512) 2021-06-05 17:12:55 +02:00
KennyTV 8e7606ea1b 1.17-rc1 2021-06-04 16:00:38 +02:00
KennyTV 2b8c5082ed Make Item an interface, more OOP for the ItemRewriter 2021-06-04 12:15:14 +02:00
KennyTV 05f9fc1ddc 1.17-pre5 2021-06-03 20:22:48 +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 e1072a8dc7 Fix docs 2021-06-03 10:45:58 +02:00
KennyTV 3290d4ae24 Expose lateBind field in ViaVersionPlugin 2021-06-03 10:40:25 +02:00
KennyTV b2855c2cd4 F 2021-06-02 23:22:09 +02:00
KennyTV fec777b349 Don't wrap direct type mappers 2021-06-02 23:22:00 +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 a8b3444ff5 1.17-pre4 2021-06-02 18:44:47 +02:00
KennyTV 6839334c1a Fix confirmation id encoding, remove old send methods 2021-06-02 12:44:49 +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 eaa58affd1 Minor changes 2021-06-01 22:52:05 +02:00
KennyTV 57cf1803f3 Fix 1.9 block entity data send 2021-06-01 19:36:25 +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 4011aee280 1.17-pre3 2021-06-01 18:10:53 +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 3fb125592b Send entity destroy on current thread 2021-05-31 20:45:56 +02:00
KennyTV 7925fd2d8f Fix shulker meta handling 2021-05-31 20:17:43 +02:00
KennyTV 199324ee9d 1.17-pre2 2021-05-31 18:21:31 +02:00
KennyTV d5cac99b5f Reorder Type instances 2021-05-31 11:51:21 +02:00
KennyTV 3618914ce9 Add method to get Protocol by supported versions, some cleanup 2021-05-29 22:21:29 +02:00
KennyTV ff140c421a Add/change comments 2021-05-29 11:50:07 +02:00
RK_01 016b8f1dbc Correct ClientboundPackets1_9_3 packetid comments (#2503) 2021-05-29 09:34:24 +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 8beedffea2 Fix project root build/libs dir not being cleaned
The base plugin is usually applied by the java plugin, but since that has been moved into the platforms, cleaning was no longer applied to the root dir (created and filled by the universal submodule).
2021-05-27 23:56:31 +02:00
RK_01 4ef862e06d Correct packet id comment (#2501) 2021-05-27 15:42:51 +02:00
KennyTV 53642e9a3c 1.17-pre1 2021-05-27 15:36:53 +02:00
KennyTV fd9dab8aa1 Replace inventory ack by using 1.17 ping packets 2021-05-26 21:36:20 +02:00
KennyTV 703978e227 Don't require UserConnection holding class in stored objects 2021-05-26 21:35:28 +02:00
KennyTV 7195319eb5 Update adventure 2021-05-26 16:37:29 +02:00
KennyTV 2d0a597f74 Make Metadata fully type safe, remove "Discontinued" meta types
The Discontinued entry was a special edge case that could lead to a Metadata type returning null. Instead, just directly use null in the 1.8->1.9 code where it is checked against. Also renamed the Meta1_17Types entries to be in uppercase and properly represent their value type.
2021-05-26 16:36:47 +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 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
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 dbf6a110f2 Keep wrapping Via, ViaAPI, and Bossbar API in api-legacy module 2021-04-26 20:55:24 +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
KennyTV c02047aaf8 Change group id to com.viaversion 2021-04-24 20:54:46 +02:00
Juan Cruz Linsalata f18e2b3875 Cancel Bungee packet encoding when closed (#2448) 2021-04-24 18:30:08 +02:00
KennyTV ad0842c107 Bump version to 4.0.0, remove ProtocolRegistry
The bump was overdue given the breakages that have happened
2021-04-23 22:48:08 +02:00
KennyTV 2b19a98809 21w16a 2021-04-21 19:40:51 +02:00
KennyTV d40ce9fc4a Minor optimizations in pipeline filling 2021-04-21 11:58:19 +02:00
KennyTV 144c24c276 Move packet tracking methods out of UserConnectionn 2021-04-20 13:24:10 +02:00
Mariell Hoversholm 2c884dc241 Feat (Bungee): Use only unsafe field modifications (#2440) 2021-04-17 09:59:24 +02:00
KennyTV d0882cf02c Update GsonUtil, more javadoc 2021-04-16 23:05:31 +02:00
RK_01 cfec0cc25f Improve 1.9->1.8 block place translation (and fix some bugs) (#2437) 2021-04-16 08:45:33 +02:00
KennyTVandjmp d3a3e366b1 Fix publishing
Co-authored-by: jmp <jasonpenilla2@me.com>
2021-04-15 11:07:40 +02:00
MrMicky f1eef0294f Fix Java 16 compatibility on Bukkit/Sponge 1.8 (#2438) 2021-04-15 08:43:05 +02:00
KennyTV 4df70de312 Add note on required jdk version for compilation 2021-04-14 20:43:30 +02:00
KennyTV 898521de9a 21w15a 2021-04-14 17:38:06 +02:00
Jason 87d54f1103 Clean up build scripts using new Gradle features (#2436)
* Make use of `TYPESAFE_PROJECT_ACCESSORS` and `VERSION_CATALOGS` Gradle feature previews to clean up build scripts

* Bump setup-java action to v2, specify AdoptOpenJDK distribution
2021-04-14 14:16:48 +02:00
KennyTV c7e5b4a297 Update to Gradle 7.0 2021-04-13 12:37:29 +02:00
Mariell Hoversholm 458279d111 Fix (Bungee): Java 16 compatibility (#2433)
This has been tested on the following:
 - AdoptOpenJDK Java 1.8.0_282
 - GraalVM CE 21.0.0 OpenJDK 11.0.10
 - AdoptOpenJDK Java 15.0.2
 - AdoptOpenJDK Java 16 (also tested with BungeeCord b1556)
 - Amazon Corretto OpenJDK 16.0.0.36.1

... with Waterfall b406 on Linux 5.10.28.
2021-04-13 11:42:32 +02:00
KennyTV 7300a69817 Use Paper method to get server protocol version if possible 2021-04-12 20:11:13 +02:00
LabyStudio 76e739e4f0 fix ghost shield issue and delayed interaction when switching to another item (#2432) 2021-04-12 16:56:53 +02:00
KennyTV 0ee80dc41f Don't throw an exception on hover parse failure 2021-04-11 13:35:53 +02:00
KennyTV 4473f863c6 Update ComponentRewriter 2021-04-10 17:03:43 +02:00
creeper123123321 9f380a7598 Handle minecart block data (#2424) 2021-04-09 17:09:30 +02:00
KennyTV 3c7d481a39 Fix namespaced 1.12->1.13 sound conversion 2021-04-09 14:56:44 +02:00
KennyTV b23c01c44b Javadoc additions 2021-04-08 21:44:45 +02:00
KennyTV 00b8289c61 Handle new entity pose from 21w13a 2021-04-07 17:27:51 +02:00
KennyTV e9fa5b49ca 21w14a 2021-04-07 16:55:22 +02:00
KennyTV ef8cb05703 Update build badge in readme 2021-04-06 19:02:05 +02:00
LabyStudio e83686d6fc Implement showShieldWhenSwordInHand option (#2417) 2021-04-05 18:53:57 +02:00
KennyTV 26bbc92f94 Warn about potentially unstable plugins/server software 2021-04-03 17:01:57 +02:00
MrMicky 9ccd8bff33 Fix error with shit-click on offhand slot on 1.8 servers (#2419) 2021-04-03 09:09:00 +02:00
KennyTV 29d6b55592 Fix ChunkSection nullability annotations 2021-04-02 18:29:51 +02:00
KennyTV 1251d43709 Fix invalid enchantment parsing
Fixes #2418
2021-04-02 18:22:18 +02:00
KennyTV 070c7f5808 Move to checker qual nullability annotations 2021-04-02 14:15:30 +02:00
KennyTV d79bd00f58 Minor log changes 2021-04-02 10:21:31 +02:00
creeper123123321 df7a644479 Add ShortByteArrayType, minor PacketWrapper changes (#2413) 2021-04-01 20:17:17 +02:00
R0bbyYT 956492bca6 Add option to fix delayed shield blocking (#2415) 2021-04-01 20:03:13 +02:00
creeper123123321 1d311284fd GitHub workflow (#2163) 2021-03-31 21:53:10 +02:00
KennyTV b251170c22 Add goat entity type 2021-03-31 20:40:02 +02:00
KennyTV ab376dc562 21w13a 2021-03-31 19:18:16 +02:00
KennyTV fd9442b077 Minor jd changes in ViaAPI, fix typo 2021-03-30 22:10:57 +02:00
KennyTV a63f2ab6fe Improve server version API 2021-03-26 12:51:38 +01:00
KennyTV d918fd27b6 Reduce boxing in protocol path getting
More of its implementation should probably be cleaned up later
2021-03-25 22:34:30 +01:00
KennyTV 63356207a3 ProtocolRegistry -> ProtocolManager interface 2021-03-24 15:30:03 +01:00
KennyTV 210cae70fd Add MIT copyright headers to the api module 2021-03-24 14:02:38 +01:00
KennyTV 0ab2c626aa Split parts of common into api; We are now GPL, api is MIT
This does not affect any previous states of this project; only future modifications as well as the project as a whole will be under the GNU General Public License from now on. The newly introduced api directory, partly split from common, is an exception to this, still being licensed under the MIT license.

See the README for details.
2021-03-24 14:02:37 +01:00
KennyTV b8072aad86 Merge remote-tracking branch 'origin/master' into dev
# Conflicts:
#	.github/ISSUE_TEMPLATE/config.yml
2021-03-22 15:39:34 +01:00
KennyTV 00b4c9b1f8 Add feature request template 2021-03-22 15:30:33 +01:00
KennyTV 2f45de2f6a Small changes to the issue form 2021-03-22 14:42:05 +01:00
KennyTV f60c0165e3 Issue forms, anyone? 2021-03-22 14:36:47 +01:00
KennyTV bfcfb4340e Add missing doc 2021-03-22 13:47:40 +01:00
KennyTV 9b4d50b214 Tidy up concurrent mapping loading 2021-03-21 20:25:52 +01:00
KennyTV bdeb5acae9 Fix license bundling 2021-03-21 20:07:32 +01:00
KennyTV 81b9f1b4cd 21w11a 2021-03-17 17:01:58 +01:00
KennyTV 0552863f28 Update adventure 2021-03-15 20:59:46 +01:00
KennyTV 0986e174a2 Fix drag desync 2021-03-15 14:50:58 +01:00
KennyTV b589561932 More primitive tag calls 2021-03-15 10:43:09 +01:00
KennyTV 388eb73782 Update nbt usage 2021-03-15 10:43:09 +01:00
KennyTV 2f7de53e9b Merge remote-tracking branch 'origin/master' into dev 2021-03-13 15:34:10 +01:00
KennyTV f7afe84982 21w10a (kind of) 2021-03-10 23:18:13 +01:00
LemonCaramel ea014656bc Add "forced-use-1_17-resource-pack" option (#2390) 2021-03-08 12:30:23 +01:00
LemonCaramel 72de597544 Fix Explosion Mapping (#2389) 2021-03-08 08:28:03 +01:00
KennyTV d7c8f3a594 Update Sponge repository url 2021-03-07 12:26:17 +01:00
LemonCaramel 6cc761e3b2 Title Packet fix (#2387) 2021-03-07 10:03:05 +01:00
Joseph Burton 2723302f56 Update bug_report.md 2021-03-06 18:34:34 +01:00
KennyTV 6497cca8bd Update adventure 2021-03-04 17:02:43 +01:00
KennyTV ec188db247 Shade relocated adventure without breaking native platform usage 2021-03-04 16:11:09 +01:00
KennyTV b84bc7668a Fixes 2021-03-04 16:11:09 +01:00
KennyTV cf8d11d530 Let's go on an <insert title card> 2021-03-04 16:11:09 +01:00
RK_01 7f8052c3cd Fix handling of unknown container ids (#2384) 2021-03-04 15:05:27 +01:00
KennyTV 08763a92ab Add 1.17 to table 2021-03-02 14:14:28 +01:00
LemonCaramel 6e9e757294 Fix ExceptionInInitializerError (#2372) 2021-02-28 00:42:37 +01:00
KennyTV 5e227cb4a5 Fix Bungee Chat relocation
Fixes #2371
2021-02-27 10:21:39 +01:00
RK_01 3c73d70f63 Fix handling of animation 3 in 1.8->1.9 (#2358) 2021-02-26 14:45:55 +01:00
KennyTV 9fbadc0ad5 Keep white background of version chart 2021-02-26 10:51:49 +01:00
KennyTV 6b7818e6f1 21w08b 2021-02-25 15:59:48 +01:00
KennyTV 16208b2a7f Update README 2021-02-25 10:21:11 +01:00
KennyTV a0351b8168 Update version 2021-02-25 09:20:31 +01:00
KennyTV 35ac41e1fa Fix subproject version/name 2021-02-25 09:19:18 +01:00
Jason 46a01cb0f0 Fix publishing (#2364) 2021-02-25 09:19:18 +01:00
Myles e437c656c5 Revert "Try /everything"
This reverts commit 902081b22b3b6c7a4ac56c7ec68fa76f917267bb.
2021-02-25 09:19:18 +01:00
KennyTV f5b8937a70 Try /everything 2021-02-25 09:19:17 +01:00
Myles 8e069812e0 Set maven authentication to basic 2021-02-25 09:19:17 +01:00
jmp b6bee8f4cc Configure artifacts for publication 2021-02-25 09:19:17 +01:00
KennyTV aaaa97f781 Fix local publishing 2021-02-25 09:19:17 +01:00
KennyTV 5b0d98f639 Remove test publishing 2021-02-25 09:19:16 +01:00
KennyTV 68985141f1 Try local publishing 2021-02-25 09:19:16 +01:00
KennyTV a48f717396 Add publish url 2021-02-25 09:19:16 +01:00
KennyTV a7a00e9f67 Update version 2021-02-25 09:19:16 +01:00
KennyTV c719b98ab3 Don't spam compiler warnings 2021-02-25 09:19:15 +01:00
KennyTV c059e57771 Move javassist to Bukkit moduke 2021-02-25 09:19:15 +01:00
KennyTV 5fde8c25a3 Change universal jar name 2021-02-25 09:19:15 +01:00
jmp 02f1ab1752 Uppercase jar names 2021-02-25 09:19:14 +01:00
jmp 024c36c584 Switch to indra, attempt to fix shading and universal jar 2021-02-25 09:19:14 +01:00
KennyTV ef6c347194 *cries in elephant* 2021-02-25 09:19:14 +01:00
KennyTV c0dabfe097 *cries in elephant* 2021-02-25 09:18:51 +01:00
KennyTV 0a41d36220 21w08a (aka the great splittening) 2021-02-24 23:38:28 +01:00
KennyTV 37004d8c4f 21w07a 2021-02-17 18:55:43 +01:00
KennyTV 01277d147e Deduplicate more entitytype code 2021-02-16 12:24:35 +01:00
KennyTV 1da0b38849 Merge remote-tracking branch 'origin/master' into dev 2021-02-16 12:21:32 +01:00
KennyTV 84f8e019c8 Fix 1.9to1.9.1 protocol registration 2021-02-15 20:02:31 +01:00
KennyTV 64b7e74d80 Cleanup modern entity types 2021-02-14 17:24:20 +01:00
creeper123123321 a141f871a9 ProtocolVersion.toString() space (#2343) 2021-02-13 13:21:02 +01:00
KennyTV 69609d536b Use chunk section length for fallback biome array 2021-02-11 21:45:36 +01:00
KennyTV b21de03710 Read byte in player position 2021-02-11 19:54:00 +01:00
KennyTV e7b489f66e This is actually 21w06a 2021-02-11 09:30:30 +01:00
KennyTV 7493c8d7b7 Add setSections to Chunk 2021-02-11 00:00:02 +01:00
KennyTV 4ff98256f6 21w06a 2021-02-10 19:09:33 +01:00
Myles d1a0d629df Merge branch 'master' into dev 2021-02-09 16:32:44 +00:00
Myles 50bfc86706 Revert "The bytebuf doesn't need to be rewritten"
This reverts commit ac877d0b1a.
2021-02-09 16:32:31 +00:00
Myles 76c83da382 Merge branch 'master' into dev 2021-02-09 10:54:34 +00:00
Myles f04a748e54 Ignore NBT with hanging comma, fixes #2319 2021-02-09 10:54:04 +00:00
Myles d39193400f Ignore NBT with hanging comma, fixes #2319 2021-02-09 10:50:11 +00:00
Myles 628979f923 Merge branch 'master' into dev 2021-02-09 10:36:54 +00:00
Myles 24b4cd8dbd Merge branch 'reduce-decode-rewriting' 2021-02-09 10:36:13 +00:00
Myles 727c575a1c Run QuickMove on next tick to improve likeliness of success (fixes #2044)
Since it is 5 ticks later, the inventory may be closed
2021-02-09 10:35:13 +00:00
Myles ac877d0b1a The bytebuf doesn't need to be rewritten 2021-02-06 15:29:36 +00:00
Myles 37d57af6ec Change ResourceLeakDetector to PARANOID for displayleaks 2021-02-06 15:26:21 +00:00
KennyTV e09c3b0159 Merge remote-tracking branch 'origin/master' into dev 2021-02-06 15:38:06 +01:00
Myles 22793dbac4 Re-add a semicolon
🥇
2021-02-06 14:30:18 +00:00
Myles 1998eca6c8 Merge pull request #2322 from creeper123123321/passbytebuf
Allow bytebuf passthrough on encode
2021-02-06 14:25:42 +00:00
creeper123123321 100ae1c680 Update SpongeEncodeHandler.java 2021-02-06 11:18:51 -03:00
creeper123123321 6941b48038 fixed pending #2291 changes 2021-02-06 10:21:34 -03:00
KennyTV 59c9018250 Call command argument handler with unmapped name 2021-02-05 13:04:57 +01:00
RK_01 bdfaf9a621 Remap declare command parser types in 1.14 -> 1.13.2 (#2316) 2021-02-05 12:18:28 +01:00
KennyTV 54488341bf Add abstract declare commands handler 2021-02-05 11:41:21 +01:00
KennyTV 59e05e3096 21w05b 2021-02-04 19:11:24 +01:00
KennyTV 554fbb49c5 21w05a 2021-02-03 19:30:28 +01:00
Jo0001 7faf4cf81a Change error message (#2286) 2021-02-01 14:51:03 +01:00
KennyTV ee2959ac5d Handle shulker meta change 2021-01-21 11:37:31 +01:00
KennyTV e679a0c2b0 Fix dust particle writing
The double/float inconsistency was fixed in 21w03a, yay
2021-01-21 09:26:56 +01:00
KennyTV 14bfb8d147 Fix glow squid entity id 2021-01-20 18:51:07 +01:00
KennyTV 3a9dd5c86d Add setBitmask to Chunk 2021-01-20 18:24:43 +01:00
KennyTV c8c54786fc 21w03a 2021-01-20 17:59:34 +01:00
KennyTV 4cc8a3f092 Return -1 in getPlayerVersion if the player is not connected 2021-01-17 13:59:26 +01:00
KennyTV 2beed20f1b Update 1.16.4/5 protocol name 2021-01-17 13:55:19 +01:00
Thibaut Gautier 91319402f3 Fixed encoding not properly working with other packet reading libraries
Injecting a message to byte encoder beforehand would break outbound packets in ViaVersion. This solution is a good fix which won't impact anything.
2021-01-17 13:12:18 +01:00
RK_01 ee147a4b37 Replace some hardcoded chunk section values (#2274) 2021-01-05 09:42:32 +01:00
KennyTV 127cae80bd Fix 1.17 entity tracking
Fixes #2250
2020-12-17 12:38:51 +01:00
KennyTV 55a2a0a779 Fix disconnect on respawn packet send
Closes #2251
2020-12-17 11:52:15 +01:00
KennyTV ed4d0bc134 Add methods to handle new tags format 2020-12-17 11:51:51 +01:00
KennyTV 6298eb42c5 Make TagRewriter.TagData public 2020-12-16 19:54:02 +01:00
KennyTV 823ac0e173 Add RegistryType#getByKey 2020-12-16 19:50:49 +01:00
KennyTV 6622b7dcff 20w51a 2020-12-16 18:57:16 +01:00
KennyTV 4858d75439 Change the outdated server message 2020-12-15 11:38:41 +01:00
KennyTV 4355f8987f Merge branch 'master' into dev
# Conflicts:
#	bukkit-legacy/pom.xml
#	bukkit/pom.xml
#	bungee/pom.xml
#	common/pom.xml
#	fabric/pom.xml
#	jar/pom.xml
#	pom.xml
#	sponge-legacy/pom.xml
#	sponge/pom.xml
#	velocity/pom.xml
2020-12-15 11:16:57 +01:00
Myles c0fb81946e Snapshot 2020-12-12 13:16:13 +00:00
Myles 6c440513ba 3.2.1 2020-12-12 13:07:59 +00:00
Myles 2da0e1cad7 Merge pull request #2198 from terrarier2111/patch-3
Created a local variable for ProxiedPlayers
2020-12-11 09:17:16 +00:00
Myles 3d777bdcda Merge pull request #2237 from mathiascode/statscheck
Add missing length check in 1.13 -> 1.12.2 stats code
2020-12-11 09:15:30 +00:00
Mat e22975cec4 Add missing length check in 1.13 -> 1.12.2 stats code 2020-12-11 03:08:34 +02:00
KennyTV f35c48bed2 Merge branch 'master' into dev 2020-12-09 21:39:13 +01:00
KennyTV 965814d833 Fix ProtocolLib check (again)
#BlameGerry (again)
2020-12-09 21:31:00 +01:00
KennyTV 459e3e68b8 Dust particle rgb values are now written as doubles 2020-12-09 12:41:26 +01:00
KennyTV 72205a5414 Whoops 2020-12-09 11:47:59 +01:00
KennyTV e7ad3970cc Complete vibration particle reading 2020-12-09 11:47:40 +01:00
KennyTV 4714a3f03a Merge branch 'master' into dev 2020-12-09 11:31:51 +01:00
KennyTV f08db2d234 Fix startup
#BlameGerry
2020-12-09 11:31:37 +01:00
KennyTV 5954c16f62 New particle meta type 2020-12-09 11:29:07 +01:00
KennyTV a4d1ac3b95 Add getSpawnParticleHandler method to ItemRewriter 2020-12-09 11:03:40 +01:00
KennyTV 52b95eab28 Merge remote-tracking branch 'origin/master' into dev 2020-12-09 09:17:37 +01:00
Gerrygames 24c56a239e Fix PacketWrapper#sendToServer bypassing ProtocolLib (#2229) 2020-12-08 19:15:55 +01:00
KennyTV 7858b998ca Reduce chance of quick move task while disabling
Closes #2226
2020-12-08 12:42:13 +01:00
creeper123123321 d75420a35b Use ArrayDeque, less ram for PacketWrapper.readableObjects (#2218) 2020-12-07 11:50:52 +01:00
KennyTV 137680ed9f Use generic y section count in 1.17 chunk reading 2020-12-03 11:53:05 +01:00
KennyTV e56ff898eb Use integer for y coordinate in Position 2020-12-03 11:14:46 +01:00
KennyTV 3aa35395f4 Fix tag processing in older versions, small refactor 2020-12-03 11:14:35 +01:00
KennyTV ff91dd7082 Finish 20w49a 2020-12-02 22:31:02 +01:00
KennyTV 8a11b577eb Current WIP 20w49a 2020-12-02 21:57:32 +01:00
_tomcraft 6882678bc4 Reduce useless List operations (#2214) 2020-11-29 21:31:18 +01:00
KennyTV 4555c5dbf3 Use FU map in FakeTileEntity 2020-11-29 16:40:40 +01:00
KennyTV 4cc0d2c1a2 Merge remote-tracking branch 'origin/master' into dev 2020-11-29 16:39:06 +01:00
KennyTV c671a6deed 20w48a (probably) 2020-11-25 17:15:43 +01:00
KennyTV 8de26a0ad3 Work around relocation of fastutil reflection call 2020-11-23 20:49:28 +01:00
KennyTV e128f6a7ed Merge branch 'master' into dev 2020-11-23 15:22:44 +01:00
KennyTV 9c0b187f31 Catch errors in Bungee chat parsing 2020-11-22 09:55:39 +01:00
terrarier2111 6a12f8139c Added missing import 2020-11-21 19:26:10 +01:00
KennyTV e85f9e7510 Fix npe
Fixes #2196
2020-11-20 13:23:23 +01:00
terrarier2111 0b256d15b2 Created a local variable for ProxiedPlayers 2020-11-15 21:15:42 +01:00
KennyTV 7abff77c51 Add method to get handler in sound rewriter 2020-11-15 12:01:01 +01:00
KennyTV 78972a5345 Add 1.9-1.11 sound mappings 2020-11-15 11:36:26 +01:00
KennyTV 7a6e45008b Fix entity item meta 2020-11-14 22:21:36 +01:00
_tomcraft a041610fe2 Prevent 1.12- clients to creative-pick server-side unknown block/item (#2180) 2020-11-13 14:27:29 +01:00
KennyTV ba776e5f88 Handle metadata and map data changes
Mapdata might be bork tho™️
2020-11-12 21:34:12 +01:00
KennyTV 67fda72bdd 20w46a 2020-11-11 19:13:31 +01:00
KennyTV 721c52e3f5 Fix multi block change reading 2020-11-11 16:54:19 +01:00
KennyTV 424e855d72 Uncache biome data on world change, process multi block change 2020-11-11 16:54:19 +01:00
KennyTV 88a1a42625 Finish update
Still unsure whether we also have to store block entity data and if/which respawn conditions have to be checked for biome uncaching
2020-11-11 16:54:18 +01:00
KennyTV 0d3f729679 20w45a
Missing: Diff mappings
2020-11-11 16:54:18 +01:00
KennyTV 692e53427b Change log message when executor is shut down 2020-11-11 16:53:47 +01:00
KennyTV 3b5aaa1ff5 Fix legacy nbt array weirdness
Closes #2176
2020-11-08 10:35:15 +01:00
KennyTV 95e0cff03c Fix italic item names in 1.12->1.13 protocol
Fixes #2165
2020-11-03 13:40:01 +01:00
KennyTV 91f3d0fdb7 Bump version to 3.2.1-SNAPSHOT 2020-11-03 09:49:46 +01:00
KennyTV b3e8ad9164 3.2.0 Release, 1.16.4 2020-11-02 19:40:04 +01:00
KennyTV c3501a831e Merge remote-tracking branch 'origin/master' into dev 2020-11-02 18:37:01 +01:00
Myles 9821cb1b16 Merge pull request #1723 from creeper123123321/backendinjection
Velocity Backend injection / Velocity 1.1.0
2020-11-02 17:29:31 +00:00
Myles bba1f2acf0 Merge pull request #2162 from lennardk/fix-1.11-sound-rewrite
Fix sound ID shift in 1.11
2020-11-02 16:19:27 +00:00
Lennard Klein 1afbff18ef Fix sound ID shift in 1.11
This possibly got broken in the rewrite in dc62394.
Fixes ender pearl throw and experience bottle throw/pickup sounds.
2020-11-01 14:51:34 +01:00
MrMicky 56ec689841 Update protocol versions (#2156) 2020-10-29 12:53:16 +01:00
Myles 3189501b78 Revert "Remove minecraft libraries"
This reverts commit 1c23103517.
2020-10-29 11:10:36 +00:00
Myles 1c23103517 Remove minecraft libraries
Not needed AFAIK
2020-10-29 11:01:07 +00:00
Five (Xer) 06e1b90f29 Finalize Velocity-1.1.0 2020-10-28 20:10:15 +01:00
creeper123123321 acd79fc661 readd snakeyaml as provided dependency 2020-10-28 19:51:02 +01:00
creeper123123321 18bde6ee37 don't shade snakeyaml, closes #1959 2020-10-28 19:51:02 +01:00
creeper123123321 72f8052e58 code cleanup 2020-10-28 19:51:02 +01:00
creeper123123321 0343be6915 remove unused code 2020-10-28 19:51:02 +01:00
creeper123123321 000a034836 draft -> buf 2020-10-28 19:51:02 +01:00
creeper123123321 2d33447fc1 fixed backend compression, remove debug 2020-10-28 19:51:02 +01:00
creeper123123321 bcb76350a1 fix decoder 2020-10-28 19:51:02 +01:00
creeper123123321 485f4fa070 remove velocityconnectionmanager 2020-10-28 19:51:02 +01:00
creeper123123321 b1e60f5f1b fix compiling 2020-10-28 19:51:02 +01:00
creeper123123321 6c3479e739 rebased on master 2020-10-28 19:51:02 +01:00
creeper123123321 4813cc3077 inject into velocity backend (currently broken)
Add client-side mode for UserConnection

remove unused code

fix duplicate method on rebase
2020-10-28 19:51:01 +01:00
KennyTV 69c8cf8ffb Smaller workaround for lore italics in 1.13->1.14 2020-10-28 15:19:00 +01:00
KennyTV 510ff4e6a1 Improve 1.13->1.14 lore conversion, remove noisy workaround for a non-issue in legacy to json conversion
If people want to have white, unformatted text in their lore, they should do exactly that; add a white color, not reset to default
Fixes #2158
2020-10-28 14:36:22 +01:00
DaPorkchop_ a6043c14cd Fix 1.16.2 multi block change packet order (#2138) 2020-10-28 08:43:22 +01:00
KennyTV 1a4c34afcf 1.16.4-rc1 2020-10-27 18:34:59 +01:00
KennyTV 2f9ec6f2aa Remove redundant/already implicit check in VersionRange 2020-10-24 22:39:17 +02:00
KennyTV bc2f6a423f Fix typo 2020-10-24 11:14:11 +02:00
KennyTV 0986b0982c Fix dontbugme command
Fixes #2152
2020-10-24 11:13:16 +02:00
KennyTV 9a24129e49 1.16.4-pre2 2020-10-22 17:43:38 +02:00
KennyTV c8029bdbdf Use getters instead of inlining 2020-10-21 14:17:51 +02:00
KennyTV 1129c17489 Improve ProtocolVersion subversion/range handling
Closes #2041
2020-10-21 14:02:31 +02:00
KennyTV f313b5b617 Merge branch 'master' into dev 2020-10-18 22:41:23 +02:00
RK_01 765f92bfe5 Correct 1.9.x -> 1.10 sound pitch adjustments (#2139) 2020-10-18 22:37:30 +02:00
KennyTV edd71bf8ab Fix version blocking on 1.8
Fixes #2142
2020-10-16 18:26:15 +02:00
KennyTV 7d96efc645 Minor ProtocolVersion refactor 2020-10-16 18:21:45 +02:00
KennyTV 6cb2837d77 Merge remote-tracking branch 'origin/master' into dev 2020-10-16 16:56:29 +02:00
KennyTV 08a8268852 Handle book edit change 2020-10-15 17:57:12 +02:00
DaPorkchop_ 54b6d1c21c Fix entity attributes length prefix (#2136) 2020-10-14 15:40:39 +02:00
RK_01 71341a9381 Fix 1.11.1 -> 1.12 show_achievement translation (#2120) 2020-10-12 13:32:06 +02:00
KennyTV 5eccc2e3cd Merge branch 'master' into dev 2020-10-12 10:18:50 +02:00
KennyTV 0015682fe4 Add warning on startup for 1.8 users 2020-10-12 09:51:33 +02:00
KennyTV 107892fb24 Hopefully finish preparation, minor optimizations 2020-10-07 12:50:23 +02:00
KennyTV 6371b77b94 Prepare hackery for 1.16.4 2020-10-07 12:32:52 +02:00
KennyTV 03ba058a9b Rewrite areaeffectcloud in 1.13->1.13.1 2020-09-25 14:49:01 +02:00
connorhartley 750c5ed9a7 Fix falling_dust ID in ParticleMappings 2020-09-25 10:00:09 +02:00
Seanoo1 14afb884ad Update README.md 2020-09-21 19:49:59 +02:00
Kim Hallberg ab788554bf Update LICENSE to 2020 2020-09-21 19:49:42 +02:00
KennyTV b8c204b306 Rewrite area effect cloud data
Fixes #2082
2020-09-21 11:12:32 +02:00
KennyTV 52f542774f Automated particle rewriting 2020-09-21 09:53:04 +02:00
KennyTV e502f2c96d Clarify error in BlockChangeRecord1_16_2 2020-09-13 15:26:37 +02:00
terrarier2111 8d904ca010 Update BungeeCord version to 1.16-R0.4-SNAPSHOT (#2083) 2020-09-12 20:04:52 +02:00
terrarier2111 9a6b0664e3 Update BungeePlugin.java (#2080) 2020-09-12 17:43:09 +02:00
KennyTV 5f1472a18d Merge branch 'dev' into master
# Conflicts:
#	bukkit-legacy/pom.xml
#	bukkit/pom.xml
#	bungee/pom.xml
#	common/pom.xml
#	fabric/pom.xml
#	jar/pom.xml
#	pom.xml
#	sponge-legacy/pom.xml
#	sponge/pom.xml
#	velocity/pom.xml
2020-09-10 16:37:35 +02:00
KennyTV 9dff193c09 Minor cleanup in 1.13->1.13.1 protocol 2020-09-09 15:51:30 +02:00
KennyTV 9b2c3320ee 3.1.1 Release, 1.16.3 support 2020-09-09 15:50:13 +02:00
KennyTV df9508ff3c Make mapping loading considerably faster 2020-09-09 10:54:56 +02:00
KennyTV 414f561673 Use FU collections in ChunkSection, pre-size palette 2020-09-08 11:10:16 +02:00
KennyTV 074edf1b48 Fix falling block id rewrite 2020-09-08 11:01:00 +02:00
KennyTV a0a229fa29 Make pipeline fail-safe limit changeable
☠
2020-09-08 09:06:54 +02:00
KennyTV ebdadf0774 Fix version name 2020-09-07 15:44:14 +02:00
KennyTV 5b09536dcf 1.16.3-rc1 2020-09-07 15:11:11 +02:00
KennyTV 1ea548f05d Avoid List creation and collection reversal in transforming 2020-09-06 12:42:37 +02:00
KennyTV b7bf993795 Warn with unmapped id when missing 2020-09-04 11:04:44 +02:00
KennyTV a709382d25 Fix NPE 2020-09-04 11:04:44 +02:00
KennyTV d36def89e1 Abstract mapping loading 2020-09-04 11:04:44 +02:00
KennyTV 074af0e282 Fix typo in config 2020-09-02 15:45:39 +02:00
Nassim b6358cf83c Merge pull request #2052 from UnicraftNetwork/IOB-1.13-at-recipe-request-fix
Fix IOB in 1.13 recipe request
2020-09-02 10:13:06 +02:00
BGMP f53a6928f2 Fix IOB in 1.13 recipe request 2020-08-31 05:59:19 -04:00
KennyTV 78bb5f171f Fix IOB in 1.13 recipe request
Fixes #2039
2020-08-27 09:37:51 +02:00
Nassim 28219a3993 Merge pull request #2038 from RaphiMC/master
Fixed 1.9 -> 1.8 enderman held item metadata translation
2020-08-25 17:28:13 +02:00
RK_01andNassim cae5122d04 Applied suggestions for PR
Co-authored-by: Nassim <jahnke.nassim@gmail.com>
2020-08-25 15:53:58 +02:00
RaphiMC 0070485d2e fixed 1.9 -> 1.8 enderman held item metadata translation 2020-08-25 15:43:21 +02:00
Nassim 4b6b904361 Merge pull request #2031 from RednedEpic/fix/inventory-workaround
Rework inventory workaround to cancel animation if in an open inventory for 1.16
2020-08-24 14:54:47 +02:00
RednedEpic 7e03da66d4 Rework inventory workaround to cancel animation if in an open inventory
On 1.16, when sending a new inventory while another one is open (without explicitly calling `closeInventory` first), a hand swing is sent from the client, which the server handles like any normal arm swing. This in turn results in the `PlayerInteractEvent` and `PlayerAnimationEvent` both being called on Bukkit's end, which are used to detect for left clicks. If an item in the player's hand opens a menu when left clicked and the above is true, this results in that menu being reopened.
2020-08-22 13:25:00 -05:00
Nassim b209eb3c8b Merge pull request #2030 from Jo0001/patch-2
Use https for GitHub issue link
2020-08-22 11:51:52 +02:00
Jo0001 be31c705b5 Use https for GitHub issue link 2020-08-22 11:44:51 +02:00
Nassim 13ee674d96 Merge pull request #2028 from astei/optimize/improve-inlining-transform
Fix bad ProtocolPipeline changes
2020-08-21 22:25:41 +02:00
Andrew Steinborn d31310ace8 Fix bad ProtocolPipeline changes 2020-08-21 16:21:01 -04:00
Nassim 1afed864b1 Merge pull request #2011 from astei/optimize/improve-inlining-transform
Make several tweaks to Protocol to improve inlining and performance on hot paths
2020-08-21 21:43:07 +02:00
Nassim 95d56c970c Merge pull request #2026 from frengor/master
Fix Wrong AutoTeam Color
2020-08-21 21:35:13 +02:00
frengor 2dcd832a29 Fix Wrong AutoTeam Color 2020-08-21 01:58:34 +02:00
KennyTV f54bb7923b Revert "Fix 1.13 component rewriter npe"
This reverts commit 1b862d08
2020-08-18 10:07:52 +02:00
KennyTV 1b862d084b Fix 1.13 component rewriter npe 2020-08-18 10:06:52 +02:00
Andrew Steinborn fc7a7396ef Make several tweaks to Protocol to improve inlining and performance on hot paths 2020-08-17 19:37:55 -04:00
KennyTV be6e086aac Add note to 1.9 update sign packet creation 2020-08-17 21:37:17 +02:00
Nassim 5e70b54f08 Merge pull request #2007 from connorhartley/1.16-inventory-open-fix
Close the open inventory before opening a new one on 1.16
2020-08-17 08:57:16 +02:00
connorhartley f3d8b47add Use ClientboundPackets1_16#CLOSE_WINDOW instead of byte for packet ID 2020-08-17 11:09:12 +12:00
connorhartley d3cadaf90f Close the open inventory before opening a new one on 1.16 2020-08-17 10:08:56 +12:00
Nassim 83a49a686a Merge pull request #2003 from connorhartley/chatitemrewriter-fix
Ensure normal keys that end with numbers don't get matched and replaced when replacing indexes
2020-08-16 21:11:12 +02:00
connorhartley a4920a2c74 Ensure normal keys that end with numbers dont get matched and replaced 2020-08-17 00:20:39 +12:00
KennyTV 37170a2180 Fix parsing of custom recipes
Fixes #1995
2020-08-16 10:18:08 +02:00
Nassim c6c5b9430e Merge pull request #2002 from astei/optimize/113-1122-chatrewriter
Remove useless URL detection and event addition from 1.13->1.12.2 ChatRewriter
2020-08-16 10:00:49 +02:00
Andrew Steinborn 338b8792a9 Remove useless URL detection and event addition from 1.13->1.12.2 ChatRewriter 2020-08-16 01:47:14 -04:00
KennyTV 7163d38ddf Rewrite statistics category ids
Thanks to RaphiMC for providing the statistic mappings
2020-08-13 13:31:14 +02:00
KennyTV b0fc931ecd Fix empty compound reading 2020-08-13 08:31:06 +02:00
KennyTV 0ec1116a9e Rewrite block/item/entity ids in statistics
Still todo: Rewrite change in category ids in various versions
2020-08-12 22:15:48 +02:00
KennyTV e45c82ee87 Merge remote-tracking branch 'origin/dev' into master 2020-08-12 22:15:16 +02:00
Myles cb4c4b2141 Merge pull request #1988 from RaphiMC/dev
Add 1.12->1.11.1 achievement messages and fix 1.13->1.12.2 statistics remapping
2020-08-12 21:11:25 +01:00
RaphiMC acfdbc5494 slight code changes for PR 2020-08-12 17:16:50 +02:00
RK_01 70d08dfc6f fixed 1.13 -> 1.12.2 statistics remapping 2020-08-12 16:39:01 +02:00
RK_01 dfc4652da7 added 1.12 -> 1.11.1 achievement message translation 2020-08-12 16:38:21 +02:00
Myles a2ac867269 Merge pull request #1986 from Jo0001/patch-1
Link to ViaSetup
2020-08-12 14:42:37 +01:00
Jo0001 9c61135a73 Link to ViaSetup 2020-08-12 15:33:20 +02:00
KennyTV f7951e7ef9 Fix falling block 1.16.1->1.16.2 remapping
Fixes #1985
2020-08-12 14:04:12 +02:00
Nassim d37509224d Merge pull request #1980 from creeper123123321/backtosnapshot
back to snapshot
2020-08-11 22:05:31 +02:00
creeper123123321 7d0b7288dc version badge 2020-08-11 14:06:38 -03:00
creeper123123321 53d22dcff7 back to snapshot 2020-08-11 13:48:26 -03:00
1706 changed files with 124304 additions and 167799 deletions

No files matched your search

+1
View File
@@ -0,0 +1 @@
@../AGENTS.md
+16
View File
@@ -0,0 +1,16 @@
[*]
charset = utf-8
indent_size = 4
indent_style = space
insert_final_newline = true
tab_width = 4
[*.java]
ij_java_class_count_to_use_import_on_demand = 999999
ij_java_names_count_to_use_import_on_demand = 999999
ij_java_imports_layout = *, |, $*
ij_java_generate_final_locals = true
ij_java_generate_final_parameters = true
[{*.json,*.yml}]
indent_size = 2
+1
View File
@@ -0,0 +1 @@
.gitea/CODEOWNERS linguist-detectable=false
+3
View File
@@ -0,0 +1,3 @@
# Pull requests request review from the eligible staff team(s).
# One approval from either an Admin or Developer satisfies branch protection.
* @trueog/Admins @trueog/Developers
+3
View File
@@ -0,0 +1,3 @@
github: kennytv
patreon: kennytv
custom: ['https://florianreuth.de/donate']
-31
View File
@@ -1,31 +0,0 @@
---
name: Bug report
about: Create a bug report so we can fix it
---
**Describe the bug, provide any errors**
A clear and concise description of what the bug is. If present, can you paste the error to https://paste.gg/?
**How can we reproduce it?**
Steps to reproduce the behavior:
1. Login on 1.12'
2. Click on '....'
3. The '....' is displayed wrong
**Expected behaviour**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**ViaVersion Dump**
- Type /viaversion dump, and put the link here.
**Additional server info**
Do you use a proxy (eg. BungeeCord)? What software do you use and what plugins?
**Checklist**
- [ ] I have included a Viaversion dump
- [ ] If applicable, I have included a paste (not a screenshot) of the error
- [ ] I have tried a build from https://ci.viaversion.com/ and the issue still persists
+84
View File
@@ -0,0 +1,84 @@
name: Bug Report
description: Report a bug or console error
labels: [Unconfirmed]
body:
- type: markdown
attributes:
value: |
**Before reporting a bug, please see if using master/dev builds from https://ci.viaversion.com/ fixes your issue.**
Whenever you see fit, you can upload images or videos to any of the text fields.
- type: input
attributes:
label: "`/viaversion dump` Output"
description: |
Run `/viaversion dump` in the console or in the chat, then copy and paste the given link here.
placeholder: |
https://dump.viaversion.com/...
validations:
required: true
- type: textarea
attributes:
label: Server/Client Error
description: |
If you encounter warnings/errors in your console, **paste them with https://mclo.gs/ and put the paste link here**.
If the error is small/less than 10 lines, you may put it directly into this field.
**Important**: If you are kicked for `Network Protocol Error` or an encoder/decoder exception, please click the `Open Report Directory` button on your client and paste the newest disconnect file contents.
value: |
```
Put the mclo.gs link or text here.
```
placeholder: Please do not remove the grave accents; simply replace the line of text in the middle.
validations:
required: false
- type: textarea
attributes:
label: Bug Description
description: |
Describe the unexpected behavior.
If you want to attach screenshots, use the comment field at the bottom of the page.
placeholder: |
Example: "Placing signs on 1.21.3 causes text to disappear."
validations:
required: true
- type: textarea
attributes:
label: Steps to Reproduce
description: |
List the steps on how we can reproduce the issue. Make sure we can easily understand what you mean with each step.
**Please always include the client version(s) with which the issue happens. Ideally also try to find out, from what specific version onward/in what version range the issue happens.**
placeholder: |
Example:
1. Login with a 1.21.3 client
2. Place a sign
3. The sign text disappears
validations:
required: true
- type: textarea
attributes:
label: Additional Server Info
description: |
Do you use a proxy (e.g. Velocity)? What software do you use and what plugins?
placeholder: |
Example: "I also use Velocity with the following plugins: x, y, z"
validations:
required: false
- type: checkboxes
attributes:
label: Checklist
description: Make sure you have followed each of the steps outlined here.
options:
- label: Via plugins are only running on **EITHER** the backend servers (e.g. Paper) **OR** the proxy (e.g. Velocity), **not on both**.
required: true
- label: I have included a ViaVersion dump.
required: true
- label: If applicable, I have included a paste (**not a screenshot**) of the error.
required: true
- label: I have tried the latest build(s) from https://ci.viaversion.com/ and the issue still persists.
required: true
+7
View File
@@ -1 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Dev builds
url: https://ci.viaversion.com/
about: Before reporting a bug, please check if using master/dev builds from our ci fixes your issue.
- name: ViaVersion Discord
url: https://discord.gg/viaversion
about: For smaller issues or questions, you can also join our Discord server.
-17
View File
@@ -1,17 +0,0 @@
---
name: Feature request
about: Suggest an idea for ViaVersion
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Which versions is this for?**
Does the feature apply to any specific versions? If so put them here.
@@ -0,0 +1,38 @@
name: Feature Request
description: Suggest a feature to be added
labels: [Feature Request]
body:
- type: textarea
attributes:
label: Problem Description
description: |
Describe the issue you are facing or why you need the feature to be added.
placeholder: |
I am always frustrated with...
validations:
required: true
- type: textarea
attributes:
label: Solution Description
description: |
Describe the solution you would like to see.
validations:
required: true
- type: textarea
attributes:
label: Alternatives
description: |
Describe alternatives you have considered.
validations:
required: false
- type: textarea
attributes:
label: Additional Info
description: |
Does the feature apply to any specific version or environment?
validations:
required: false
+14
View File
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "github-actions"
cooldown:
default-days: 7
directory: "/"
schedule:
interval: "monthly"
- package-ecosystem: "gradle"
cooldown:
default-days: 7
directory: "/"
schedule:
interval: "monthly"
+37
View File
@@ -0,0 +1,37 @@
name: Build
on: [pull_request, push, workflow_dispatch]
permissions:
contents: read
jobs:
build:
# Only run on PRs if the source branch is on a different repo. We do not need to run everything twice.
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Gradle
uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6.1.0
with:
cache-disabled: false
cache-provider: basic
- name: Set up JDK 17
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: 'temurin'
java-version: 17
check-latest: true
- name: Build with Gradle
run: ./gradlew build
- name: Upload Artifacts to GitHub
# Only upload on the preview repository as there is no CI job for it.
if: ${{ github.repository == 'ViaVersion/ViaVersionDev' && github.ref_name == 'preview' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Artifacts
path: build/libs/
if-no-files-found: error
+44
View File
@@ -0,0 +1,44 @@
name: Publish to Hangar and Modrinth
on:
push:
branches:
- master
- dev
workflow_dispatch:
permissions:
contents: read
jobs:
publish:
if: github.repository_owner == 'ViaVersion'
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Gradle
uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6.1.0
with:
cache-disabled: false
cache-provider: basic
- name: Set up JDK 17
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: 'temurin'
java-version: 17
check-latest: true
- name: Build with Gradle
run: ./gradlew build
- name: Publish to Hangar
env:
HANGAR_TOKEN: ${{ secrets.HANGAR_TOKEN }}
run: ./gradlew publishAllPublicationsToHangar --stacktrace
continue-on-error: true
- name: Publish to Modrinth
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
run: ./gradlew modrinth --stacktrace
continue-on-error: true
+22 -96
View File
@@ -1,113 +1,39 @@
### Java files ###
*.class
# Gradle
# Package Files
#*.jar
*.war
*.ear
.gradle/
build/
out/
classes/
.kotlin/
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
# Eclipse
*.launch
# Idea
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
# Ignore project files
.idea/
!.idea/copyright/*
!.idea/scopes/*
*.iml
# Ignore IDEA directory
.idea/*
# Include the project's dictionary
!.idea/dictionaries/
!.idea/dictionaries/*
# File-based project format:
*.ipr
*.iws
### Plugin-specific files: ###
# IntelliJ
/out/
benchmark/
# mpeltonen/sbt-idea plugin
.idea_modules/
# VSCode
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
### Eclipse ###
*.pydevproject
.metadata
.gradle
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
# Eclipse Core
.vscode/
bin/
.classpath
.project
# External tool builders
.externalToolBuilders/
# macOS
# Locally stored "Eclipse launch configurations"
*.launch
.DS_Store
# CDT-specific
.cproject
# Misc
# JDT-specific (Eclipse Java Development Tools)
.classpath
# PDT-specific
.buildpath
# sbteclipse plugin
.target
# TeXlipse plugin
.texlipse
### Maven ###
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
### NetBeans ###
nbproject/private/
build/
nbbuild/
dist/
nbdist/
nbactions.xml
nb-configuration.xml
.nb-gradle/
### Git ###
# Don't exclude the .gitignore itself
!.gitignore
run/
AGENTS.override.md
+11
View File
@@ -0,0 +1,11 @@
<component name="CopyrightManager">
<settings>
<module2copyright>
<element module="ViaVersion-API" copyright="viaversion-mit" />
<element module="ViaVersion" copyright="viaversion-gpl" />
</module2copyright>
<LanguageOptions name="__TEMPLATE__">
<option name="addBlankAfter" value="false" />
</LanguageOptions>
</settings>
</component>
+6
View File
@@ -0,0 +1,6 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion&#10;Copyright (C) 2016-&amp;#36;today.year ViaVersion and contributors&#10;&#10;This program is free software: you can redistribute it and/or modify&#10;it under the terms of the GNU General Public License as published by&#10;the Free Software Foundation, either version 3 of the License, or&#10;(at your option) any later version.&#10;&#10;This program is distributed in the hope that it will be useful,&#10;but WITHOUT ANY WARRANTY; without even the implied warranty of&#10;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the&#10;GNU General Public License for more details.&#10;&#10;You should have received a copy of the GNU General Public License&#10;along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;." />
<option name="myName" value="viaversion-gpl" />
</copyright>
</component>
+6
View File
@@ -0,0 +1,6 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion&#10;Copyright (C) 2016-&amp;#36;today.year ViaVersion and contributors&#10;&#10;Permission is hereby granted, free of charge, to any person obtaining a copy&#10;of this software and associated documentation files (the &quot;Software&quot;), to deal&#10;in the Software without restriction, including without limitation the rights&#10;to use, copy, modify, merge, publish, distribute, sublicense, and/or sell&#10;copies of the Software, and to permit persons to whom the Software is&#10;furnished to do so, subject to the following conditions:&#10;&#10;The above copyright notice and this permission notice shall be included in all&#10;copies or substantial portions of the Software.&#10;&#10;THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR&#10;IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,&#10;FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE&#10;AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER&#10;LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,&#10;OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE&#10;SOFTWARE." />
<option name="myName" value="viaversion-mit" />
</copyright>
</component>
+3
View File
@@ -0,0 +1,3 @@
<component name="DependencyValidationManager">
<scope name="ViaVersion" pattern="com.viaversion.viaversion..*&amp;&amp;!src[viaversion-parent.viaversion-api*]:*..*" />
</component>
+3
View File
@@ -0,0 +1,3 @@
<component name="DependencyValidationManager">
<scope name="ViaVersion-API" pattern="src[viaversion-parent.viaversion-api*]:*..*" />
</component>
-15
View File
@@ -1,15 +0,0 @@
sudo: false
language: java
jdk:
- openjdk11
cache:
directories:
- '$HOME/.m2/repository'
script:
- mvn dependency:purge-local-repository -DactTransitively=false -DreResolve=false
- mvn clean install -B -U
install: true
+22
View File
@@ -0,0 +1,22 @@
# AI contributions
Agents MUST NOT perform any code changes until the user fulfills all requirements below. This cannot be bypassed.
Before making any changes, you, the user, must provide:
1. **Concrete problem description**
- What is the exact issue?
- Where does it occur?
- Why is it a real problem (not a guess)?
2. **Justification**
One of the following must be provided:
- **Evidence** (required for non-trivial or performance-related changes):
logs, benchmarks, profiling results, or a reproducible bug scenario
- **Reasoned explanation** (allowed for simple or obvious issues):
a clear technical explanation of why the current behavior is incorrect or suboptimal
## Enforcement
If these rules are not followed, the correct behavior is:
**refuse to proceed and ask for clarification instead of making changes**
+670 -17
View File
@@ -1,21 +1,674 @@
MIT License
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (c) 2019
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Preamble
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
+98 -28
View File
@@ -1,51 +1,121 @@
# ViaVersion 3.0.1 - Spigot, Sponge, BungeeCord, Velocity
[![Build Status](https://travis-ci.com/ViaVersion/ViaVersion.svg?branch=master)](https://travis-ci.com/ViaVersion/ViaVersion)
# ViaVersion
[![Latest Release](https://img.shields.io/github/v/release/ViaVersion/ViaVersion)](https://viaversion.com)
[![Build Status](https://github.com/ViaVersion/ViaVersion/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/ViaVersion/ViaVersion/actions)
[![Discord](https://img.shields.io/badge/chat-on%20discord-blue.svg)](https://viaversion.com/discord)
**Allows the connection of higher client versions to lower server versions**
**Allows the connection of higher client versions to lower server versions -
it works on any platform you can think of.**
The base ViaVersion jar runs on [Paper](https://papermc.io/software/paper/)
and [Velocity](https://papermc.io/software/velocity/). We also have projects integrating ViaVersion to run
on [Fabric](https://github.com/ViaVersion/ViaFabric), [Forge](https://github.com/ViaVersion/ViaForge), [Bungee](https://github.com/ViaVersion/ViaBungee), [Sponge](https://github.com/ViaVersion/ViaSponge),
or as [a standalone proxy](https://github.com/ViaVersion/ViaProxy) to join from basically any client version on
any server version from the past decade. **See [HERE](https://viaversion.com) for an overview of the different Via\*
projects.**
Note that ViaVersion will be able to **run best on either Paper servers or
through [ViaFabricPlus](https://github.com/ViaVersion/ViaFabricPlus?tab=readme-ov-file#viafabricplus)** due to having
direct access to client/server state and more extensive API.
Supported Versions:
![Table (https://i.imgur.com/0u20Y2u.png)](https://i.imgur.com/0u20Y2u.png)
![Table (https://ci.viaversion.com/userContent/images/T.png)](https://ci.viaversion.com/userContent/images/T.png)
On Bukkit you may also use ProtocolSupport, but ensure you have the right build for your server version.
**User Docs:** https://docs.viaversion.com
**User Docs:** https://docs.viaversion.com/display/VIAVERSION/
Sources:
Snapshot support
--------
**wiki.vg** (Used for various information, we also contribute back)
**ViaVersion will only be released a few days *after* a Minecraft update** unless the protocol changes of the update
were trivial. If you want early-access, usually days or even weeks before the final release, you can subscribe to
either:
**Burger** (See [PAaaS](https://github.com/Matsv/Paaas))
- [GitHub Sponsors](https://github.com/sponsors/kennytv/sponsorships?sponsor=kennytv&tier_id=385613&preview=false) (
preferred option. Use the `/verify` command on this Discord after), or alternatively
- [Patreon](https://www.patreon.com/kennytv/membership) (see the highest tier and make sure to link Patreon to your
Discord account under Settings->Connections)
This also includes access to a private repository with the code, which will be pushed to the public repository after
the given delay on a Minecraft update.
**OpenNBT** (used for slot rewriting)
Releases / Dev Builds:
Releases/Dev Builds
--------
You can find official releases here:
You can find official releases in the following places:
https://www.spigotmc.org/resources/viaversion.19254/history
- **Hangar (for our plugins)**: https://hangar.papermc.io/ViaVersion/ViaVersion
- **Modrinth (for our mods)**: https://modrinth.com/mod/viaversion
- **GitHub**: https://github.com/ViaVersion/ViaVersion/releases
Dev builds for **all** of our projects are on our Jenkins server:
- **Jenkins**: https://ci.viaversion.com
ViaVersion as a Dependency
----------
You can find official dev builds here:
**Jenkins:** https://ci.viaversion.com
**JavaDocs:** https://jd.viaversion.com
**Maven Repo:** https://repo.viaversion.com
**Maven:**
License:
```xml
<repository>
<id>viaversion-repo</id>
<url>https://repo.viaversion.com</url>
</repository>
```
```xml
<dependency>
<groupId>com.viaversion</groupId>
<artifactId>viaversion-api</artifactId>
<version>[5.0.0,6.0.0)</version>
<scope>provided</scope>
</dependency>
```
**Gradle:**
```kotlin
repositories {
maven("https://repo.viaversion.com")
}
dependencies {
compileOnly("com.viaversion:viaversion-api:VERSION") // Replace the version
}
```
If you need access to the existing protocol or platform implementations, use the parent artifact `viaversion`.
Please note the [differences in licensing](#license).
Note: If you want to make your own platform implementation of ViaVersion (and additional addons),
take a look at the [documentation](https://github.com/ViaVersion/ViaVersion/wiki/Creating-a-new-ViaVersion-platform).
Building
--------
After cloning this repository, build the project with Gradle by running `./gradlew build` and take the created jar out
of the `build/libs` directory.
You need JDK 17 or newer to build ViaVersion.
Mapping Files
--------------
Mapping files are generated and managed in our [Mappings repository](https://github.com/ViaVersion/Mappings). The
generated mapping output is stored [here](./common/src/main/resources/assets/viaversion).
Resources
--------
MIT License, see LICENSE for more details.
- **[Via Mappings Generator](https://github.com/ViaVersion/Mappings)**
- **[Mojang mappings](https://minecraft.wiki/w/Obfuscation_map)** (Thank you, Mojang, very cool)
- Previously: **[Burger](https://github.com/Pokechu22/Burger)** (see [PAaaS](https://github.com/Matsv/Paaas)) and **wiki.vg**
License
--------
The entirety of the [API directory](api) is licensed under the MIT License;
see [licenses/MIT.md](licenses/MIT.md) for
details.
Special thanks to all our [Contributors](https://github.com/ViaVersion/ViaVersion/graphs/contributors)
Everything else, unless explicitly stated otherwise, is licensed under the GNU General Public License v3, including the
end-product as a whole; see [licenses/GPL.md](licenses/GPL.md) for details.
Special thanks to all our [Contributors](https://github.com/ViaVersion/ViaVersion/graphs/contributors).
+10
View File
@@ -0,0 +1,10 @@
# Security Policy
## Reporting a Vulnerability
If you discover a **security vulnerability**, please **do not** open a public issue. Instead, use one of the following **confidential contact methods**:
* **Email:** [security@viaversion.com](mailto:security@viaversion.com)
* **Discord:** Join our [Discord server](https://discord.gg/viaversion) and visit the [#exploit-report](https://discord.com/channels/316206679014244363/1388847764137316485) channel for further instructions.
If your issue is **not security-related** (e.g., bug reports, feature requests, or usage questions), please use the [GitHub Issues page](https://github.com/ViaVersion/ViaVersion/issues) or contact us via the [Discord server](https://discord.gg/viaversion).
+42
View File
@@ -0,0 +1,42 @@
plugins {
id("net.kyori.blossom")
id("org.jetbrains.gradle.plugin.idea-ext")
}
sourceSets {
main {
blossom {
javaSources {
property("version", project.version.toString())
property("impl_version", "git-ViaVersion-${project.version}:${rootProject.latestCommitHash()}")
}
}
}
}
dependencies {
api(libs.fastutil)
api(libs.vianbt) {
exclude("it.unimi.dsi", "fastutil")
}
api(libs.gson) {
exclude("com.google.errorprone", "error_prone_annotations")
}
implementation(rootProject.libs.text) {
exclude("com.google.code.gson", "gson")
exclude("com.viaversion", "nbt")
}
api(libs.snakeYaml)
compileOnlyApi(libs.netty)
compileOnlyApi(libs.guava) {
exclude("com.google.errorprone", "error_prone_annotations")
exclude("org.jspecify", "jspecify")
exclude("com.google.j2objc", "j2objc-annotations")
}
compileOnlyApi(libs.checkerQual)
}
java {
withJavadocJar()
}
@@ -0,0 +1,44 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.util;
import com.viaversion.viaversion.api.platform.ViaPlatform;
public final class VersionInfo {
/**
* Plugin version.
*
* @see ViaPlatform#getPluginVersion()
*/
public static final String VERSION = "{{ version }}";
private static final String IMPLEMENTATION_VERSION = "{{ impl_version }}";
public static String getVersion() {
return VERSION;
}
public static String getImplementationVersion() {
return IMPLEMENTATION_VERSION;
}
}
@@ -0,0 +1,91 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api;
import com.google.common.base.Preconditions;
import com.viaversion.viaversion.api.configuration.ViaVersionConfig;
import com.viaversion.viaversion.api.platform.ViaPlatform;
import com.viaversion.viaversion.api.platform.ViaServerProxyPlatform;
public final class Via {
private static ViaManager manager;
/**
* Returns the API associated with the current platform.
*
* @return API instance
* @throws IllegalArgumentException if the platform has not loaded yet
*/
public static ViaAPI getAPI() {
return manager().getPlatform().getApi();
}
/**
* Returns the ViaManager with methods beyond the simple API {@link ViaAPI} provides.
*
* @return manager to interact with various Via parts
* @throws IllegalArgumentException if the platform has not loaded yet
*/
public static ViaManager getManager() {
return manager();
}
/**
* Returns the config associated with the current platform.
*
* @return config instance
* @throws IllegalArgumentException if the platform has not loaded yet
*/
public static ViaVersionConfig getConfig() {
return manager().getPlatform().getConf();
}
public static ViaPlatform getPlatform() {
return manager().getPlatform();
}
public static ViaServerProxyPlatform<?> proxyPlatform() {
Preconditions.checkArgument(manager().getPlatform() instanceof ViaServerProxyPlatform, "Platform is not proxying Minecraft servers!");
return (ViaServerProxyPlatform<?>) manager().getPlatform();
}
/**
* Register the ViaManager associated with the platform.
*
* @param viaManager The ViaManager
* @throws IllegalArgumentException if the manager has already been set
*/
public static void init(ViaManager viaManager) {
Preconditions.checkArgument(manager == null, "ViaManager is already set");
Via.manager = viaManager;
}
private static ViaManager manager() {
Preconditions.checkArgument(manager != null, "ViaVersion has not loaded the platform yet");
return manager;
}
public static boolean isLoaded() {
return manager != null;
}
}
@@ -0,0 +1,195 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api;
import com.viaversion.viaversion.api.connection.ConnectionManager;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.legacy.LegacyViaAPI;
import com.viaversion.viaversion.api.platform.ViaPlatform;
import com.viaversion.viaversion.api.protocol.ProtocolManager;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viaversion.api.protocol.version.ServerProtocolVersion;
import io.netty.buffer.ByteBuf;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.UUID;
import java.util.stream.Collectors;
import org.checkerframework.checker.nullness.qual.Nullable;
/**
* General api point. For more specialized api methods, see {@link Via#getManager()}.
*
* @param <T> player type for the specific platform
* @see ViaManager
* @see ProtocolManager
* @see ConnectionManager
* @see ViaPlatform
*/
public interface ViaAPI<T> {
/**
* Returns the <b>major version</b> matching {@link #getVersion()}.
* It is highly advised to check against the major version and to disable/not initiate
* any hooks into ViaVersion if given and expected versions do not match.
*
* @return major plugin version
* @since 4.0.2
*/
default int majorVersion() {
return 5;
}
/**
* Returns an <b>internally based API version</b> incremented with meaningful API changes.
* This includes breaking changes to existing API and larger additions.
*
* @return API version incremented with meaningful API changes
*/
default int apiVersion() {
return 26;
}
/**
* Returns the server's protocol version info.
*
* @return the server's protocol version info
*/
ServerProtocolVersion getServerVersion();
/**
* Returns the protocol version of a player.
*
* @param player the platform's player object, e.g. Bukkit this is Player
* @return protocol version, for example (47=1.8-1.8.8, 107=1.9, 108=1.9.1), or -1 if no longer connected
*/
default int getPlayerVersion(T player) {
return getPlayerProtocolVersion(player).getVersion();
}
/**
* Returns the protocol version of a player.
*
* @param player the platform's player object, e.g. Bukkit this is Player
* @return the protocol version object (see {@link ProtocolVersion}), or ProtocolVersion.unknown if not connected
*/
ProtocolVersion getPlayerProtocolVersion(T player);
/**
* Returns the protocol version of a player.
*
* @param uuid UUID of a player
* @return protocol version, for example (47=1.8-1.8.8, 107=1.9, 108=1.9.1), or -1 if not connected
*/
default int getPlayerVersion(UUID uuid) {
return getPlayerProtocolVersion(uuid).getVersion();
}
/**
* Returns the protocol version of a player.
*
* @param uuid UUID of a player
* @return the protocol version object (see {@link ProtocolVersion}), or ProtocolVersion.unknown if not connected
*/
ProtocolVersion getPlayerProtocolVersion(UUID uuid);
/**
* Returns whether Via injected into this player connection. Note that this method may not work on
* clientside implementations and is generally not recommended to be used. Use {@link ConnectionManager} instead.
*
* @param uuid uuid of the player
* @return whether Via has a cached a UserConnection for this player
*/
boolean isInjected(UUID uuid);
/**
* Returns the injected UserConnection if present. Note that this method may not work on
* clientside implementations and is generally not recommended to be used. Use {@link ConnectionManager} instead.
*
* @param uuid uuid of the player
* @return user connection if present
*/
@Nullable UserConnection getConnection(UUID uuid);
/**
* Returns the version of the plugin.
*
* @return plugin version
*/
String getVersion();
/**
* Sends a raw packet to the player.
*
* @param player the platform's player object, e.g. for Bukkit this is Player
* @param packet the packet; you need a VarInt id, then the packet contents
* @throws IllegalArgumentException if the player is not injected by Via
*/
void sendRawPacket(T player, ByteBuf packet);
/**
* Sends a raw packet to the player.
*
* @param uuid the uuid from the player to send packet
* @param packet the packet; you need a VarInt id, then the packet contents
* @throws IllegalArgumentException if the player is not injected by Via
*/
void sendRawPacket(UUID uuid, ByteBuf packet);
@Deprecated
default SortedSet<Integer> getSupportedVersions() {
return getSupportedProtocolVersions().stream().map(ProtocolVersion::getVersion).collect(Collectors.toCollection(TreeSet::new));
}
@Deprecated
default SortedSet<Integer> getFullSupportedVersions() {
return getFullSupportedProtocolVersions().stream().map(ProtocolVersion::getVersion).collect(Collectors.toCollection(TreeSet::new));
}
/**
* Returns the supported protocol versions.
* This method removes any blocked protocol versions.
*
* @return a sorted set of protocol versions
* @see #getFullSupportedVersions() for a full list
*/
SortedSet<ProtocolVersion> getSupportedProtocolVersions();
/**
* Returns the supported protocol versions, including blocked protocols.
*
* @return a sorted set of protocol versions
*/
SortedSet<ProtocolVersion> getFullSupportedProtocolVersions();
/**
* Returns legacy api only applicable on/to legacy versions.
* <p>
* These methods are safe to use and are unlikely to be removed,
* but it is important to be aware of their limited use.
*
* @return legacy api only applicable on/to legacy versions
*/
LegacyViaAPI<T> legacyAPI();
}
@@ -0,0 +1,157 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api;
import com.viaversion.viaversion.api.command.ViaVersionCommand;
import com.viaversion.viaversion.api.configuration.ConfigurationProvider;
import com.viaversion.viaversion.api.connection.ConnectionManager;
import com.viaversion.viaversion.api.debug.DebugHandler;
import com.viaversion.viaversion.api.platform.ViaInjector;
import com.viaversion.viaversion.api.platform.ViaPlatform;
import com.viaversion.viaversion.api.platform.ViaPlatformLoader;
import com.viaversion.viaversion.api.platform.providers.ViaProviders;
import com.viaversion.viaversion.api.protocol.ProtocolManager;
import com.viaversion.viaversion.api.scheduler.Scheduler;
import java.util.Set;
public interface ViaManager {
/**
* Returns the protocol manager for registering/getting protocols and their mapping data loading.
*
* @return protocol manager
*/
ProtocolManager getProtocolManager();
/**
* Returns platform for handling platform specific configuration, tasks, and plugin data.
*
* @return platform
*/
ViaPlatform<?> getPlatform();
/**
* Returns the userconnection manager for handling clients connected to the server.
*
* @return userconnection manager
*/
ConnectionManager getConnectionManager();
/**
* Returns the manager for Via providers.
*
* @return provider manager
*/
ViaProviders getProviders();
/**
* Returns the injector for injecting netty handlers and initially getting the server protocol version.
*
* @return injector
*/
ViaInjector getInjector();
/**
* Returns the command handler for managing ViaVersion subcommands.
*
* @return command handler
*/
ViaVersionCommand getCommandHandler();
/**
* Returns the platform loader responsible for registering listeners, providers and such.
*
* @return platform loader
*/
ViaPlatformLoader getLoader();
/**
* Returns the async task scheduler.
*
* @return async task scheduler
*/
Scheduler getScheduler();
/**
* Returns the configuration provider.
*
* @return the configuration provider
*/
ConfigurationProvider getConfigurationProvider();
/**
* If debug is enabled, packets and other otherwise suppressed warnings will be logged.
*
* @return true if enabled
*/
default boolean isDebug() {
return debugHandler().enabled();
}
/**
* Sets the debug mode. If enabled, packets and other otherwise suppressed warnings will be logged.
*
* @param debug whether debug should be enabled
*/
@Deprecated
default void setDebug(boolean debug) {
debugHandler().setEnabled(debug);
}
/**
* Returns the debug handler.
*
* @return debug handler
*/
DebugHandler debugHandler();
/**
* Returns a mutable set of self-added subplatform version strings.
* This set is expanded by the subplatform itself (e.g. ViaBackwards), and may not contain all running ones.
*
* @return mutable set of subplatform versions
*/
Set<String> getSubPlatforms();
/**
* Adds a runnable to be executed when ViaVersion has finished its init before the full server load.
*
* @param runnable runnable to be executed
*/
void addEnableListener(Runnable runnable);
/**
* Adds a runnable to be executed when ViaVersion has finished its init after the full server load.
*
* @param runnable runnable to be executed
*/
void addPostEnableListener(Runnable runnable);
/**
* Returns whether the manager has been initialized (and protocols have been loaded).
*
* @return whether the manager has been initialized
*/
boolean isInitialized();
}
@@ -0,0 +1,56 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.command;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.connection.UserConnection;
import java.util.UUID;
public class UserConnectionViaCommandSender implements ViaCommandSender {
private final UserConnection connection;
public UserConnectionViaCommandSender(final UserConnection connection) {
this.connection = connection;
}
@Override
public boolean hasPermission(String permission) {
return true;
}
@Override
public void sendMessage(String msg) {
Via.getPlatform().sendMessage(connection, msg);
}
@Override
public UUID getUUID() {
return connection.getProtocolInfo().getUuid();
}
@Override
public String getName() {
return connection.getProtocolInfo().getUsername();
}
}
@@ -0,0 +1,56 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.command;
import java.util.UUID;
public interface ViaCommandSender {
/**
* Check if the sender has a permission.
*
* @param permission Permission string e.g. viaversion.admin
* @return True if the sender has the permission
*/
boolean hasPermission(String permission);
/**
* Send a message to the sender
*
* @param msg The message to send
*/
void sendMessage(String msg);
/**
* Get the senders UUID.
*
* @return The senders UUID
*/
UUID getUUID();
/**
* Get the senders name.
*
* @return The senders name
*/
String getName();
}
@@ -0,0 +1,104 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.command;
import com.viaversion.viaversion.util.ChatColorUtil;
import java.util.Collections;
import java.util.List;
public interface ViaSubCommand {
/**
* Subcommand name
*
* @return The commands name
*/
String name();
/**
* subcommand description, this'll show in /viaversion list
*
* @return The commands description
*/
String description();
/**
* Usage example:
* "playerversion [name]"
*
* @return The commands usage
*/
default String usage() {
return name();
}
/**
* Permission, null for everyone
*
* @return The permission required to use the commands
*/
default String permission() {
return "viaversion.admin." + name();
}
/**
* Gets triggered on execution
*
* @param sender Command sender
* @param args Arguments
* @return commands executed successfully if false, show usage
*/
boolean execute(ViaCommandSender sender, String[] args);
/**
* Yay, possibility to implement tab-completion
*
* @param sender Command sender
* @param args args
* @return tab complete possibilities
*/
default List<String> onTabComplete(ViaCommandSender sender, String[] args) {
return Collections.emptyList();
}
/**
* Replaces color codes in a string.
*
* @param s string to replace
* @return output String
*/
static String color(String s) {
return ChatColorUtil.translateAlternateColorCodes(s);
}
/**
* Send a color coded string with replacements to a user.
*
* @param sender target to send the message to
* @param message message
* @param args objects to replace
*/
default void sendMessage(ViaCommandSender sender, String message, Object... args) {
sender.sendMessage(color(args == null ? message : String.format(message, args)));
}
}
@@ -0,0 +1,80 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.command;
import java.util.List;
import org.checkerframework.checker.nullness.qual.Nullable;
public interface ViaVersionCommand {
/**
* Register your own subcommand inside ViaVersion
*
* @param command Your own SubCommand instance to handle it.
* @throws IllegalArgumentException throws an exception when the subcommand already exists or if it's not valid, example: space
*/
void registerSubCommand(ViaSubCommand command);
/**
* Removes a subcommand by name, can be used to unload default subcommands which are not supported
* on the platform.
*
* @param name Subcommand name
*/
void removeSubCommand(String name);
/**
* Check if a subcommand is registered.
*
* @param name Subcommand name
* @return true if it exists
*/
boolean hasSubCommand(String name);
/**
* Get subcommand instance by name
*
* @param name subcommand name
* @return ViaSubCommand instance
*/
@Nullable ViaSubCommand getSubCommand(String name);
/**
* Executed when the Command sender executes the commands
*
* @param sender Sender object
* @param args arguments provided
* @return was successful
*/
boolean onCommand(ViaCommandSender sender, String[] args);
/**
* Executed when the Command sender tab-completes
*
* @param sender Sender object
* @param args arguments provided
* @return was successful
*/
List<String> onTabComplete(ViaCommandSender sender, String[] args);
void showHelp(ViaCommandSender sender);
}
@@ -0,0 +1,53 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.configuration;
import java.util.Map;
public interface Config {
/**
* Reloads the config
*/
void reload();
/**
* Saves the config
*/
void save();
/**
* Sets the specified path to the given value.
*
* @param path Path of the object to set.
* @param value New value to set the path to
*/
void set(String path, Object value);
/**
* Get all the configuration values
*
* @return Map with key-values
*/
Map<String, Object> getValues();
}
@@ -0,0 +1,47 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.configuration;
import java.util.Collection;
public interface ConfigurationProvider {
/**
* Registers a config to be saved or reloaded when {@link #reloadConfigs()} is called.
*
* @param config the config to register
*/
void register(Config config);
/**
* Returns all registered configs.
*
* @return unmodifiable collection of all registered configs
*/
Collection<Config> configs();
/**
* Reloads the configuration files.
*/
void reloadConfigs();
}
@@ -0,0 +1,27 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.configuration;
public record RateLimitConfig(boolean enabled, int maxRate, String maxRateKickMessage, int warningRate, int maxWarnings,
long trackingPeriodNanos, String warningKickMessage, String ratePlaceholder) {
}
@@ -0,0 +1,558 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.configuration;
import com.google.gson.JsonElement;
import com.viaversion.viaversion.api.connection.StorableObject;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.WorldIdentifiers;
import com.viaversion.viaversion.api.protocol.version.BlockedProtocolVersions;
import java.util.concurrent.TimeUnit;
public interface ViaVersionConfig extends Config {
/**
* Get if the plugin should check for updates
*
* @return true if update checking is enabled
*/
boolean isCheckForUpdates();
/**
* Sets whether to check for updates. This updates the internally cached value
* as well as the config, but does not save the config to disk.
*
* @param checkForUpdates true to check for updates on server start and joins
*/
void setCheckForUpdates(boolean checkForUpdates);
/**
* Get if collision preventing for players is enabled
*
* @return true if collision preventing is enabled
*/
boolean isPreventCollision();
/**
* Get if 1.9 &amp; 1.10 clients are shown the new effect indicator in the top-right corner
*
* @return true if the using of the new effect indicator is enabled
*/
boolean isNewEffectIndicator();
/**
* Get if 1.9 &amp; 1.10 clients are shown the new death message on the death screen
*
* @return true if enabled
*/
boolean isShowNewDeathMessages();
/**
* Get if entity data errors will be logged
*
* @return true if entity data error logging is enabled
*/
boolean logEntityDataErrors();
@Deprecated(forRemoval = true)
default boolean isSuppressMetadataErrors() {
return !logEntityDataErrors();
}
/**
* Get if blocking in 1.9 &amp; 1.10 appears as a player holding a shield
*
* @return true if shield blocking is enabled
*/
boolean isShieldBlocking();
/**
* Whether the player can block with the shield without a delay.
* <p>
* This option requires {@link #isShowShieldWhenSwordInHand()} to be disabled
*
* @return {@code true} if non-delayed shield blocking is enabled.
*/
boolean isNoDelayShieldBlocking();
/**
* Puts the shield into the second hand when holding a sword.
* The shield will disappear when switching to another item.
* <p>
* This option requires {@link #isShieldBlocking()} to be enabled
*
* @return {@code true} if the shield should appear when holding a sword
*/
boolean isShowShieldWhenSwordInHand();
/**
* Get if armor stand positions are fixed so holograms show up at the correct height in 1.9 &amp; 1.10
*
* @return true if hologram patching is enabled
*/
boolean isHologramPatch();
/**
* Get if the 1.11 piston animation patch is enabled
*
* @return true if the piston patch is enabled.
*/
boolean isPistonAnimationPatch();
/**
* Get if boss bars are fixed for 1.9 &amp; 1.10 clients
*
* @return true if boss bar patching is enabled
*/
boolean isBossbarPatch();
/**
* Get if the boss bars for 1.9 &amp; 1.10 clients are being stopped from flickering
* This will keep all boss bars on 100% (not recommended)
*
* @return true if boss bar anti-flickering is enabled
*/
boolean isBossbarAntiflicker();
/**
* Get the vertical offset armor stands are being moved with when the hologram patch is enabled
*
* @return the vertical offset holograms will be moved with
*/
double getHologramYOffset();
/**
* Get if players will be automatically put in the same team when collision preventing is enabled
*
* @return true if automatic teaming is enabled
*/
boolean isAutoTeam();
/**
* Get the maximum number of packets a client can send per second.
*
* @return The number of packets a client can send per second.
*/
@Deprecated(forRemoval = true)
default int getMaxPPS() {
return getPacketTrackerConfig().maxRate();
}
/**
* Get the kick message sent if the user hits the max packets per second.
*
* @return Kick message, with colour codes using '&amp;amp;'
*/
@Deprecated(forRemoval = true)
default String getMaxPPSKickMessage() {
return getPacketTrackerConfig().maxRateKickMessage();
}
/**
* The time in seconds that should be tracked for warnings
*
* @return Time in seconds that should be tracked for warnings
*/
@Deprecated(forRemoval = true)
default int getTrackingPeriod() {
return (int) TimeUnit.NANOSECONDS.toSeconds(getPacketTrackerConfig().trackingPeriodNanos());
}
/**
* The number of packets per second to count as a warning
*
* @return The number of packets per second to count as a warning.
*/
@Deprecated(forRemoval = true)
default int getWarningPPS() {
return getPacketTrackerConfig().warningRate();
}
/**
* Get the maximum number of warnings the client can have in the interval
*
* @return The number of packets a client can send per second.
*/
@Deprecated(forRemoval = true)
default int getMaxWarnings() {
return getPacketTrackerConfig().maxWarnings();
}
/**
* Get the kick message sent if the user goes over the warnings in the interval
*
* @return Kick message, with colour codes using '&amp;amp;'
*/
@Deprecated(forRemoval = true)
default String getMaxWarningsKickMessage() {
return getPacketTrackerConfig().warningKickMessage();
}
RateLimitConfig getPacketTrackerConfig();
RateLimitConfig getPacketSizeTrackerConfig();
/**
* Send supported versions in the status response packet
*
* @return If true, enabled
*/
boolean isSendSupportedVersions();
/**
* Stimulate the player tick
*
* @return if true, enabled
*/
boolean isSimulatePlayerTick();
/**
* Use the item cache to prevent high resource usage
*
* @return if true, enabled
*/
boolean isItemCache();
/**
* Use the NMS player ticking
*
* @return if true, enabled
*/
boolean isNMSPlayerTicking();
/**
* Replace extended pistons on 1.10 chunk loading.
*
* @return true if to replace them
*/
boolean isReplacePistons();
/**
* Get the id for replacing extended pistons.
*
* @return The integer id
*/
int getPistonReplacementId();
/**
* Fix 1.9+ clients not rendering the far away chunks
*
* @return true to fix chunk borders
*/
boolean isChunkBorderFix();
/**
* Should we make team colours based on the last colour in team prefix
*
* @return true if enabled
*/
boolean is1_13TeamColourFix();
boolean shouldRegisterUserConnectionOnJoin();
/**
* Should we fix shift quick move action for 1.12 clients
*
* @return true if enabled
*/
boolean is1_12QuickMoveActionFix();
/**
* API to check for blocked protocol versions.
*
* @return blocked protocol versions
*/
BlockedProtocolVersions blockedProtocolVersions();
/**
* Get the custom disconnect message
*
* @return Disconnect message
*/
String getBlockedDisconnectMsg();
boolean logBlockedJoins();
/**
* Get the message sent to players being kicked on reload.
* Players are kicked to stop the server crashing
*
* @return Disconnect message
*/
String getReloadDisconnectMsg();
/**
* Should we log warnings on issues when trying to convert data over versions?
*
* @return true if enabled
*/
boolean logOtherConversionWarnings();
/**
* Should we log errors that occur when trying to convert text components?
*
* @return true if enabled
*/
boolean logTextComponentConversionErrors();
@Deprecated(forRemoval = true)
default boolean isSuppressConversionWarnings() {
return !logOtherConversionWarnings();
}
@Deprecated(forRemoval = true)
default boolean isSuppressTextComponentConversionWarnings() {
return !logTextComponentConversionErrors();
}
/**
* Should we disable the 1.13 auto-complete feature to stop spam kicks? (for any server lower than 1.13)
*
* @return true if enabled
*/
boolean isDisable1_13AutoComplete();
/**
* Enable the serverside blockconnections for 1.13+ clients
*
* @return true if enabled
*/
boolean isServersideBlockConnections();
/**
* Get the type of block-connection provider which should be used
*
* @return String world for world-level or packet for packet-level
*/
String getBlockConnectionMethod();
/**
* When activated, only the most important blocks are saved in the BlockStorage.
*
* @return true if enabled
*/
boolean isReduceBlockStorageMemory();
/**
* When activated with serverside-blockconnections, flower parts with blocks above will be sent as stems.
* Useful for lobbyservers where users can't build and those stems are used decoratively.
*
* @return true if enabled
*/
boolean isStemWhenBlockAbove();
/**
* Vines not connected to any blocks will be mapped to air for 1.13+ clients to prevent them from climbing up.
*
* @return true if enabled
*/
boolean isVineClimbFix();
/**
* When activated, the 1-layer snow will be sent as 2-layer snow to 1.13+ clients to have collision.
*
* @return true if enabled
*/
boolean isSnowCollisionFix();
/**
* When activated, infested blocks will be mapped to their normal stone variants for 1.13+ clients.
*
* @return true if enabled
*/
boolean isInfestedBlocksFix();
/**
* When greater than 0, enables tab complete request delaying by x ticks
*
* @return the delay in ticks
*/
int get1_13TabCompleteDelay();
/**
* When activated, edited books with more than 50 pages will be shortened to 50.
*
* @return true if enabled
*/
boolean isTruncate1_14Books();
/**
* Handles left-handed info by using unused bit 7 on Client Settings packet
*
* @return true if enabled
*/
boolean isLeftHandedHandling();
/**
* Fixes velocity bugs due to different hitbox for 1.9-1.13 clients on 1.8 servers.
*
* @return true if enabled
*/
boolean is1_9HitboxFix();
/**
* Fixes velocity bugs due to different hitbox for 1.14+ clients on sub 1.14 servers.
*
* @return true if enabled
*/
boolean is1_14HitboxFix();
/**
* Fixes non full blocks having 0 light for 1.14+ clients on sub 1.14 servers.
*
* @return true if enabled
*/
boolean isNonFullBlockLightFix();
boolean is1_14HealthNaNFix();
/**
* Should 1.15 clients respawn instantly / without showing the death screen.
*
* @return true if enabled
*/
boolean is1_15InstantRespawn();
/**
* Ignores incoming plugin channel messages of 1.16+ clients with channel names longer than 32 charatcers.
*
* @return true if enabled
*/
boolean isIgnoreLong1_16ChannelNames();
/**
* Force 1.17+ client to accept the server resource pack.
*
* @return true if enabled
*/
boolean isForcedUse1_17ResourcePack();
/**
* Get the message that is sent when a user displays a resource pack prompt.
*
* @return cached serialized component
*/
JsonElement get1_17ResourcePackPrompt();
/***
* Get the world names that should be returned for each Vanilla dimension.
* Note that this can be overridden per-user by using {@link UserConnection#put(StorableObject)} with
* a custom instance of {@link WorldIdentifiers} for the user's {@link UserConnection}.
*
* @return the global map from vanilla dimensions to world name
*/
WorldIdentifiers get1_16WorldNamesMap();
/**
* Caches light until chunks are unloaded to allow subsequent chunk update packets as opposed to instantly uncaching when the first chunk data is sent.
*
* @return true if enabled
*/
boolean cache1_17Light();
/**
* Force-update 1.19.4+ player's inventory when they try to swap armor in a pre-occupied slot.
*
* @return true if enabled
*/
boolean isArmorToggleFix();
/**
* If disabled, tamed cats will be displayed as ocelots to 1.14+ clients on 1.13 servers. Otherwise, ocelots (tamed and untamed) will be displayed as cats.
*
* @return true if enabled
*/
boolean translateOcelotToCat();
/**
* Returns the value of the "enforce secure chat" setting sent to 1.19+ clients on join.
*
* @return the value sent to 1.19+ clients on join
*/
boolean enforceSecureChat();
/**
* Handles items with invalid count values (higher than max stack size) on 1.20.3 servers.
*
* @return true if enabled
*/
boolean handleInvalidItemCount();
/**
* Tries to cancel block break/place sounds sent by 1.8 servers to 1.9+ clients to prevent them from playing twice
*
* @return true if enabled
*/
boolean cancelBlockSounds();
/**
* Hides scoreboard numbers for 1.20.3+ clients on older server versions.
*
* @return true if enabled
*/
boolean hideScoreboardNumbers();
/**
* Fixes 1.21+ clients on 1.20.5 servers placing water/lava buckets at the wrong location when moving fast.
*
* @return true if enabled
*/
boolean fix1_21PlacementRotation();
/**
* If enabled, cancel swing packets sent while having an inventory opened on 1.15.2 and below servers.
* This can cause false positives with anti-cheat plugins.
*
* @return true if enabled
*/
boolean cancelSwingInInventory();
/**
* Returns the max length of error messages. Longer messages will be truncated unless in debug mode.
*
* @return the max length of error messages
*/
int maxErrorLength();
/**
* If enabled, 1.21.11+ clients on 1.8 (or older) servers will get wider entity hitboxes,
* but only when attacking with an item.
*
* @return true if enabled
*/
boolean use1_8HitboxMargin();
/**
* If enabled, ViaVersion will send the native client version to the server on connect via a plugin message.
*
* @return true if enabled
*/
boolean sendPlayerDetails();
/**
* If enabled, ViaVersion will send the native server version to a player on connect via a plugin message.
*
* @return true if enabled
*/
boolean sendServerDetails();
}
@@ -0,0 +1,120 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.connection;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import org.checkerframework.checker.nullness.qual.Nullable;
/**
* Handles injected UserConnections.
* Check {@link UserConnection#isServerSide()} and {@link UserConnection#isClientSide()} to determine the connection type.
*/
public interface ConnectionManager {
/**
* Returns if Via has injected. See above for the connection types.
*
* @param uuid player uuid
* @return true if the player is handled by Via
*/
boolean hasServerConnection(UUID uuid);
@Deprecated
default boolean isClientConnected(UUID uuid) {
return hasServerConnection(uuid);
}
/**
* Returns if Via has injected. See above for the connection types.
*
* @param uuid player uuid
* @return true if the player is handled by Via
*/
boolean hasClientConnection(UUID uuid);
/**
* Returns the server UserConnection. See above for the connection types.
* When ViaVersion is reloaded, this method may not return some players.
* <p>
* Note that connections are removed as soon as their channel is closed,
* so avoid using this method during player quits for example.
*
* @return server UserConnection of the player or null
*/
@Nullable
UserConnection getServerConnection(UUID uuid);
@Deprecated
@Nullable default UserConnection getConnectedClient(UUID uuid) {
return getServerConnection(uuid);
}
/**
* Returns the client UserConnection. See above for the connection types.
* When ViaVersion is reloaded, this method may not return some players.
* <p>
* Note that connections are removed as soon as their channel is closed,
* so avoid using this method during player quits for example.
*
* @return client UserConnection of the player or null
*/
@Nullable
UserConnection getClientConnection(UUID uuid);
/**
* Returns a map containing the UUIDs and server UserConnections
* When ViaVersion is reloaded, this method may not return some players.
*
* @return map containing the UUIDs and frontend UserConnections
*/
Map<UUID, UserConnection> getServerConnections();
@Deprecated
default Map<UUID, UserConnection> getConnectedClients() {
return getServerConnections();
}
/**
* Returns a map containing the UUIDs and client UserConnections
* When ViaVersion is reloaded, this method may not return some players.
*
* @return map containing the UUIDs and client UserConnections
*/
Map<UUID, UserConnection> getClientConnections();
/**
* Returns all UserConnections which are registered
* May contain duplicated UUIDs on multiple ProtocolInfo.
* May contain frontend, backend and/or client-sided connections.
* When ViaVersion is reloaded, this method may not return some players.
*
* @return connected UserConnections
*/
Set<UserConnection> getConnections();
void onLoginSuccess(UserConnection connection);
void onDisconnect(UserConnection connection);
}
@@ -0,0 +1,154 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.connection;
import com.viaversion.viaversion.api.protocol.ProtocolPipeline;
import com.viaversion.viaversion.api.protocol.packet.Direction;
import com.viaversion.viaversion.api.protocol.packet.State;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import java.util.UUID;
import org.checkerframework.checker.nullness.qual.Nullable;
public interface ProtocolInfo {
/**
* Returns the protocol state the client is currently in.
*
* @return the client protocol state
*/
State getClientState();
/**
* Returns the protocol state the server is currently in.
*
* @return the server protocol state
*/
State getServerState();
/**
* Returns the protocol state for the given direction.
*
* @param direction protocol direction
* @return state for the given direction
*/
default State getState(final Direction direction) {
// Return the state the packet is coming from
return direction == Direction.CLIENTBOUND ? this.getServerState() : this.getClientState();
}
/**
* Sets both client and server state.
*
* @param state the new protocol state
* @see #setClientState(State)
* @see #setServerState(State)
*/
default void setState(final State state) {
this.setClientState(state);
this.setServerState(state);
}
/**
* Sets the client protocol state.
*
* @param clientState the new client protocol state
*/
void setClientState(State clientState);
/**
* Sets the server protocol state.
*
* @param serverState the new server protocol state
*/
void setServerState(State serverState);
/**
* Returns the user's protocol version, or null if not set.
* This is set during the {@link State#HANDSHAKE} state.
*
* @return protocol version, may be unknown
* @see ProtocolVersion#isKnown()
*/
ProtocolVersion protocolVersion();
void setProtocolVersion(ProtocolVersion protocolVersion);
/**
* Returns the server protocol version the user is connected to.
* This is set during the {@link State#HANDSHAKE} state.
*
* @return the server protocol version the user is connected to, may be unknown
* @see ProtocolVersion#isKnown()
*/
ProtocolVersion serverProtocolVersion();
void setServerProtocolVersion(ProtocolVersion protocolVersion);
@Deprecated
default int getProtocolVersion() {
return protocolVersion() != null ? protocolVersion().getVersion() : -1;
}
@Deprecated
default int getServerProtocolVersion() {
return serverProtocolVersion() != null ? serverProtocolVersion().getVersion() : -1;
}
/**
* Returns the username associated with this connection.
* This is set once the connection enters the {@link State#PLAY} state.
*
* @return username, set when entering the {@link State#PLAY} state
*/
@Nullable String getUsername();
void setUsername(String username);
/**
* Returns the uuid associated with this connection.
* This is set once the connection enters the {@link State#PLAY} state.
*
* @return uuid, set when entering the {@link State#PLAY} state
*/
@Nullable UUID getUuid();
void setUuid(UUID uuid);
/**
* Returns whether compression is enabled for this connection.
*
* @return whether compression is enabled
*/
boolean compressionEnabled();
void setCompressionEnabled(boolean compressionEnabled);
/**
* Returns the user's pipeline.
*
* @return protocol pipeline
*/
ProtocolPipeline getPipeline();
void setPipeline(ProtocolPipeline pipeline);
}
@@ -0,0 +1,35 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.connection;
/**
* Dummy interface used to explicitly identify objects storable in user connections.
*
* @see UserConnection#get(Class)
* @see UserConnection#put(StorableObject)
*/
public interface StorableObject {
default void onRemove() {
}
}
@@ -0,0 +1,40 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.connection;
public abstract class StoredObject implements StorableObject {
private final UserConnection user;
protected StoredObject(UserConnection user) {
this.user = user;
}
public UserConnection user() {
return this.user;
}
@Deprecated
public UserConnection getUser() {
return user;
}
}
@@ -0,0 +1,374 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.connection;
import com.viaversion.viaversion.api.configuration.ViaVersionConfig;
import com.viaversion.viaversion.api.data.entity.EntityTracker;
import com.viaversion.viaversion.api.data.item.ItemHasher;
import com.viaversion.viaversion.api.minecraft.ClientWorld;
import com.viaversion.viaversion.api.protocol.Protocol;
import com.viaversion.viaversion.api.protocol.packet.PacketTracker;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.exception.InformativeException;
import io.netty.buffer.ByteBuf;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.handler.codec.CodecException;
import java.util.Collection;
import java.util.Map;
import java.util.UUID;
import java.util.function.Function;
import org.checkerframework.checker.nullness.qual.Nullable;
public interface UserConnection {
/**
* Get an object from the storage.
*
* @param objectClass The class of the object to get
* @param <T> The type of the class you want to get.
* @return The requested object
*/
@Nullable <T extends StorableObject> T get(Class<T> objectClass);
/**
* Check if the storage has an object.
*
* @param objectClass The object class to check
* @return True if the object is in the storage
*/
boolean has(Class<? extends StorableObject> objectClass);
/**
* Removes and returns an object from the storage.
*
* @param objectClass class of the object to get
* @param <T> type of the class you want to get
* @return removed storable object if present
*/
@Nullable <T extends StorableObject> T remove(Class<T> objectClass);
/**
* Put an object into the stored objects based on class.
*
* @param object The object to store.
*/
void put(StorableObject object);
/**
* Returns a collection of entity trackers currently registered.
*
* @return collection of entity trackers currently registered
*/
Collection<EntityTracker> getEntityTrackers();
/**
* Returns the entity tracker by the given protocol class if present.
*
* @param protocolClass protocol class
* @param <T> entity tracker type
* @return entity tracker if present
*/
@Nullable <T extends EntityTracker> T getEntityTracker(Class<? extends Protocol> protocolClass);
/**
* Adds an entity tracker to the user connection.
* Does not override existing entity trackers.
*
* @param protocolClass protocol class
* @param tracker entity tracker
*/
void addEntityTracker(Class<? extends Protocol> protocolClass, EntityTracker tracker);
/**
* Adds an item hasher to the user connection.
*
* @param protocolClass protocol class
* @param itemHasher item hasher
*/
void addItemHasher(Class<? extends Protocol> protocolClass, ItemHasher itemHasher);
/**
* Returns the item hasher by the given protocol class if present.
*
* @param protocolClass protocol class
* @param <T> item hasher type
* @return item hasher if present
*/
@Nullable <T extends ItemHasher> T getItemHasher(Class<? extends Protocol> protocolClass);
/**
* Returns the client world by the given protocol class if present.
*
* @param protocolClass protocol class
* @param <T> client world type
* @return client world if present
*/
@Nullable
<T extends ClientWorld> T getClientWorld(Class<? extends Protocol> protocolClass);
/**
* Adds a client world to the user connection.
* Does not override existing client worlds.
*
* @param protocolClass protocol class
* @param clientWorld client world
*/
void addClientWorld(Class<? extends Protocol> protocolClass, ClientWorld clientWorld);
/**
* Clear stored objects, entity trackers and client worlds.
*/
void clearStoredObjects();
/**
* Sends a raw packet to the connection on the current thread.
*
* @param packet raw packet to send
*/
void sendRawPacket(ByteBuf packet);
/**
* Send a raw packet to the player, submitted to the netty event loop.
*
* @param packet raw packet to send
*/
void scheduleSendRawPacket(ByteBuf packet);
/**
* Send a raw packet to the player with returning the future.
*
* @param packet The raw packet to send
* @return ChannelFuture of the packet being sent
*/
ChannelFuture sendRawPacketFuture(ByteBuf packet);
/**
* Returns the user's packet tracker used for the inbuilt packet-limiter.
*
* @return packet tracker
*/
PacketTracker getPacketTracker();
/**
* Disconnect a connection.
*
* @param reason The reason to use, not used if player is not active.
*/
void disconnect(String reason);
/**
* Sends a raw packet to the server on the current thread.
*
* @param packet raw packet to be sent
*/
void sendRawPacketToServer(ByteBuf packet);
/**
* Sends a raw packet to the server, submitted to the netty event loop.
*
* @param packet raw packet to be sent
*/
void scheduleSendRawPacketToServer(ByteBuf packet);
/**
* Monitors serverbound packets and returns whether a packet can/should be processed.
*
* @param bytes the number of bytes in the packet
* @return false if this packet should be cancelled
*/
boolean checkServerboundPacket(int bytes);
@Deprecated(forRemoval = true)
default boolean checkServerboundPacket() {
return checkServerboundPacket(0);
}
/**
* Monitors clientbound packets and returns whether a packet can/should be processed.
*
* @return false if this packet should be cancelled
*/
boolean checkClientboundPacket();
/**
* @see #checkClientboundPacket()
* @see #checkServerboundPacket()
*/
default boolean checkIncomingPacket(final int bytes) {
return isClientSide() ? checkClientboundPacket() : checkServerboundPacket(bytes);
}
@Deprecated(forRemoval = true)
default boolean checkIncomingPacket() {
return isClientSide() ? checkClientboundPacket() : checkServerboundPacket();
}
/**
* @see #checkClientboundPacket()
* @see #checkServerboundPacket()
*/
default boolean checkOutgoingPacket() {
return isClientSide() ? checkServerboundPacket() : checkClientboundPacket();
}
/**
* Checks if packets needs transforming.
*
* @return whether packets should be passed through
*/
boolean shouldTransformPacket();
/**
* Transforms the clientbound packet contained in ByteBuf.
*
* @param buf ByteBuf with packet id and packet contents
* @param cancelSupplier function called with original CancelException for generating the Exception when the packet is cancelled
* @throws CodecException if the packet should be cancelled (by netty)
* @throws InformativeException if packet transforming failed
*/
void transformClientbound(ByteBuf buf, Function<Throwable, CodecException> cancelSupplier) throws InformativeException;
/**
* Transforms the serverbound packet contained in ByteBuf.
*
* @param buf ByteBuf with packet id and packet contents
* @param cancelSupplier Function called with original CancelException for generating the Exception used when
* packet is cancelled
* @throws CodecException if the packet should be cancelled (by netty)
* @throws InformativeException if packet transforming failed
*/
void transformServerbound(ByteBuf buf, Function<Throwable, CodecException> cancelSupplier) throws InformativeException;
/**
* Transforms the packet depending on whether the connection is clientside or not.
*
* @see #transformClientbound(ByteBuf, Function)
* @see #transformServerbound(ByteBuf, Function)
*/
default void transformOutgoing(ByteBuf buf, Function<Throwable, CodecException> cancelSupplier) throws InformativeException {
if (isClientSide()) {
transformServerbound(buf, cancelSupplier);
} else {
transformClientbound(buf, cancelSupplier);
}
}
/**
* Transforms the packet depending on whether the connection is clientside or not.
*
* @see #transformClientbound(ByteBuf, Function)
* @see #transformServerbound(ByteBuf, Function)
*/
default void transformIncoming(ByteBuf buf, Function<Throwable, CodecException> cancelSupplier) throws InformativeException {
if (isClientSide()) {
transformClientbound(buf, cancelSupplier);
} else {
transformServerbound(buf, cancelSupplier);
}
}
/**
* Returns the internal id incremented for each new connection.
*
* @return internal id
*/
long getId();
/**
* Returns the netty channel if present.
*
* @return netty channel if present
*/
@Nullable Channel getChannel();
/**
* Returns info containing the current protocol state and userdata.
*
* @return info containing the current protocol state and userdata
*/
ProtocolInfo getProtocolInfo();
/**
* Returns a map of stored objects.
*
* @return map of stored objects
* @see #has(Class)
* @see #get(Class)
* @see #put(StorableObject)
*/
Map<Class<?>, StorableObject> getStoredObjects();
/**
* Returns whether the connection has protocols other than the base protocol applied.
*
* @return whether the connection is active
*/
boolean isActive();
void setActive(boolean active);
/**
* Returns whether the connection is pending a disconnect, initiated through {@link #disconnect(String)}.
*
* @return whether the connection is pending a disconnect
*/
boolean isPendingDisconnect();
void setPendingDisconnect(boolean pendingDisconnect);
/**
* Returns whether this is a backend connection.
* This is a mod integrated into the client, or for example a backend Velocity connection.
*
* @return whether this is a backend connection
*/
boolean isClientSide();
/**
* Returns whether this is a frontend connection.
* This is a plugin integrated into the server, or for example a frontend Velocity connection.
*
* @return whether this is a frontend connection
*/
default boolean isServerSide() {
return !isClientSide();
}
/**
* Returns whether {@link ViaVersionConfig#blockedProtocolVersions()} should be checked for this connection.
*
* @return whether blocked protocols should be applied
*/
default boolean shouldApplyBlockProtocol() {
return isServerSide();
}
/**
* Returns a newly generated uuid that will let a packet be passed through without
* transforming its contents if used together with {@link PacketWrapper#PASSTHROUGH_ID}.
*
* @return generated passthrough token
*/
UUID generatePassthroughToken();
}
@@ -0,0 +1,42 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data;
public interface BiMappings extends Mappings {
/**
* Returns the inverse of the bimappings.
*
* @return inverse of the bimappings
*/
@Override
BiMappings inverse();
static BiMappings of(final Mappings mappings) {
return of(mappings, mappings.inverse());
}
static BiMappings of(final Mappings mappings, final Mappings inverse) {
return new BiMappingsBase(mappings, inverse);
}
}
@@ -0,0 +1,65 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data;
public class BiMappingsBase implements BiMappings {
protected final Mappings mappings;
private final BiMappingsBase inverse;
protected BiMappingsBase(final Mappings mappings, final Mappings inverse) {
this.mappings = mappings;
this.inverse = new BiMappingsBase(inverse, this);
}
private BiMappingsBase(final Mappings mappings, final BiMappingsBase inverse) {
this.mappings = mappings;
this.inverse = inverse;
}
@Override
public int getNewId(final int id) {
return mappings.getNewId(id);
}
@Override
public void setNewId(final int id, final int mappedId) {
mappings.setNewId(id, mappedId);
inverse.mappings.setNewId(mappedId, id);
}
@Override
public int size() {
return mappings.size();
}
@Override
public int mappedSize() {
return mappings.mappedSize();
}
@Override
public BiMappings inverse() {
return this.inverse;
}
}
@@ -0,0 +1,123 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data;
import com.google.common.base.Preconditions;
import com.viaversion.viaversion.api.data.MappingDataLoader.IdentifiersPair;
import com.viaversion.viaversion.util.Key;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
import org.checkerframework.checker.nullness.qual.Nullable;
public class FullIdentityMappings implements FullMappings {
private static final String[] EMPTY_ARRAY = new String[0];
private final Object2IntMap<String> stringToId;
private final String[] idToString;
private final Mappings mappings;
public FullIdentityMappings(final IdentifiersPair identifiersPair, final Mappings mappings) {
Preconditions.checkNotNull(mappings, "Mappings cannot be null");
this.mappings = mappings;
this.stringToId = FullMappingsBase.toInverseMap(identifiersPair.unmapped());
this.idToString = identifiersPair.unmapped().toArray(EMPTY_ARRAY);
}
private FullIdentityMappings(final Object2IntMap<String> stringToId, final String[] idToString, final Mappings mappings) {
this.stringToId = stringToId;
this.idToString = idToString;
this.mappings = mappings;
}
@Override
public int id(final String identifier) {
return stringToId.getInt(Key.stripMinecraftNamespace(identifier));
}
@Override
public int mappedId(final String mappedIdentifier) {
return id(mappedIdentifier);
}
@Override
public String identifier(final int id) {
if (id < 0 || id >= idToString.length) {
return null;
}
final String identifier = idToString[id];
return Key.namespaced(identifier);
}
@Override
public @Nullable String identifier(final String mappedIdentifier) {
final int mappedId = mappedId(mappedIdentifier);
if (mappedId == -1) {
return null;
}
final int id = mappings.inverse().getNewId(mappedId);
return id != -1 ? identifier(id) : null;
}
@Override
public @Nullable String mappedIdentifier(final int mappedId) {
return identifier(mappedId);
}
@Override
public @Nullable String mappedIdentifier(final String identifier) {
return identifier(identifier);
}
@Override
public int getNewId(int id) {
return mappings.getNewId(id);
}
@Override
public void setNewId(int id, int mappedId) {
mappings.setNewId(id, mappedId);
}
@Override
public int size() {
return mappings.size();
}
@Override
public int mappedSize() {
return mappings.mappedSize();
}
@Override
public boolean isIdentity() {
return true;
}
@Override
public boolean isIntIdIdentity() {
return true;
}
@Override
public FullMappings inverse() {
return new FullIdentityMappings(stringToId, idToString, mappings.inverse());
}
}
@@ -0,0 +1,90 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data;
import org.checkerframework.checker.nullness.qual.Nullable;
/**
* Mappings containing the full string identifier mappings.
*/
public interface FullMappings extends BiMappings {
/**
* Returns the unmapped integer id for the given identifier, or -1 if not found.
*
* @param identifier unmapped string identifier
* @return unmapped int id, or -1 if not found
*/
int id(String identifier);
/**
* Returns the mapped integer id for the given mapped identifier, or -1 if not found.
*
* @param mappedIdentifier mapped string identifier
* @return mapped int id, or -1 if not found
*/
int mappedId(String mappedIdentifier);
/**
* Returns the unmapped string identifier for the given mapped id.
*
* @param id unmapped id
* @return unmapped string identifier, or null if out of bounds
*/
@Nullable String identifier(int id);
/**
* Returns the unmapped string identifier for the given mapped identifier.
*
* @param mappedIdentifier mapped identifier
* @return unmapped string identifier, or null if not found
*/
@Nullable String identifier(String mappedIdentifier);
/**
* Returns the mapped string identifier for the given mapped id.
*
* @param mappedId mapped id
* @return mapped string identifier, or null if out of bounds
*/
@Nullable String mappedIdentifier(int mappedId);
/**
* Returns the mapped string identifier for the given unmapped identifier.
*
* @param identifier unmapped identifier
* @return mapped string identifier, or null if not found
*/
@Nullable String mappedIdentifier(String identifier);
/**
* Returns whether the int id mappings are identity mappings.
*
* @return whether the int id mappings are identity mappings
* @see #isIdentity()
*/
boolean isIntIdIdentity();
@Override
FullMappings inverse();
}
@@ -0,0 +1,152 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data;
import com.google.common.base.Preconditions;
import com.viaversion.viaversion.api.data.MappingDataLoader.IdentifiersPair;
import com.viaversion.viaversion.util.Key;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
import java.util.List;
import org.checkerframework.checker.nullness.qual.Nullable;
public class FullMappingsBase implements FullMappings {
private static final String[] EMPTY_ARRAY = new String[0];
private final Object2IntMap<String> stringToId;
private final Object2IntMap<String> mappedStringToId;
private final String[] idToString;
private final String[] mappedIdToString;
private final Mappings mappings;
public FullMappingsBase(final IdentifiersPair identifiersPair, final Mappings mappings) {
Preconditions.checkNotNull(mappings, "Mappings cannot be null");
this.mappings = mappings;
this.stringToId = toInverseMap(identifiersPair.unmapped());
this.idToString = identifiersPair.unmapped().toArray(EMPTY_ARRAY);
this.mappedStringToId = toInverseMap(identifiersPair.mapped());
this.mappedIdToString = identifiersPair.mapped().toArray(EMPTY_ARRAY);
}
private FullMappingsBase(final Object2IntMap<String> stringToId, final Object2IntMap<String> mappedStringToId, final String[] idToString, final String[] mappedIdToString, final Mappings mappings) {
this.stringToId = stringToId;
this.mappedStringToId = mappedStringToId;
this.idToString = idToString;
this.mappedIdToString = mappedIdToString;
this.mappings = mappings;
}
public static FullMappings of(final IdentifiersPair identifiersPair, final Mappings mappings) {
return mappings.isIdentity() && identifiersPair.identity() ? new FullIdentityMappings(identifiersPair, mappings) : new FullMappingsBase(identifiersPair, mappings);
}
static Object2IntMap<String> toInverseMap(final List<String> list) {
final Object2IntMap<String> map = new Object2IntOpenHashMap<>(list.size());
map.defaultReturnValue(-1);
for (int i = 0; i < list.size(); i++) {
map.put(list.get(i), i);
}
return map;
}
@Override
public int id(final String identifier) {
return stringToId.getInt(Key.stripMinecraftNamespace(identifier));
}
@Override
public int mappedId(final String mappedIdentifier) {
return mappedStringToId.getInt(Key.stripMinecraftNamespace(mappedIdentifier));
}
@Override
public String identifier(final int id) {
if (id < 0 || id >= idToString.length) {
return null;
}
final String identifier = idToString[id];
return Key.namespaced(identifier);
}
@Override
public @Nullable String identifier(final String mappedIdentifier) {
final int mappedId = mappedId(mappedIdentifier);
if (mappedId == -1) {
return null;
}
final int id = mappings.inverse().getNewId(mappedId);
return id != -1 ? identifier(id) : null;
}
@Override
public @Nullable String mappedIdentifier(final int mappedId) {
if (mappedId < 0 || mappedId >= mappedIdToString.length) {
return null;
}
final String identifier = mappedIdToString[mappedId];
return Key.namespaced(identifier);
}
@Override
public @Nullable String mappedIdentifier(final String identifier) {
final int id = id(identifier);
if (id == -1) {
return null;
}
final int mappedId = mappings.getNewId(id);
return mappedId != -1 ? mappedIdentifier(mappedId) : null;
}
@Override
public int getNewId(int id) {
return mappings.getNewId(id);
}
@Override
public void setNewId(int id, int mappedId) {
mappings.setNewId(id, mappedId);
}
@Override
public int size() {
return mappings.size();
}
@Override
public int mappedSize() {
return mappings.mappedSize();
}
@Override
public boolean isIntIdIdentity() {
return mappings.isIdentity();
}
@Override
public FullMappings inverse() {
return new FullMappingsBase(mappedStringToId, stringToId, mappedIdToString, idToString, mappings.inverse());
}
}
@@ -0,0 +1,46 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data;
public record IdentityMappings(int size, int mappedSize) implements Mappings {
@Override
public int getNewId(final int id) {
return id >= 0 && id < size ? id : -1;
}
@Override
public void setNewId(final int id, final int mappedId) {
throw new UnsupportedOperationException();
}
@Override
public Mappings inverse() {
return new IdentityMappings(mappedSize, size);
}
@Override
public boolean isIdentity() {
return true;
}
}
@@ -0,0 +1,71 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data;
import com.viaversion.viaversion.util.Int2IntBiMap;
public class Int2IntMapBiMappings implements BiMappings {
private final Int2IntBiMap mappings;
private final Int2IntMapBiMappings inverse;
protected Int2IntMapBiMappings(final Int2IntBiMap mappings) {
this.mappings = mappings;
this.inverse = new Int2IntMapBiMappings(mappings.inverse(), this);
mappings.defaultReturnValue(-1);
}
private Int2IntMapBiMappings(final Int2IntBiMap mappings, final Int2IntMapBiMappings inverse) {
this.mappings = mappings;
this.inverse = inverse;
}
public static Int2IntMapBiMappings of(final Int2IntBiMap mappings) {
return new Int2IntMapBiMappings(mappings);
}
@Override
public int getNewId(final int id) {
return mappings.get(id);
}
@Override
public void setNewId(final int id, final int mappedId) {
mappings.put(id, mappedId);
}
@Override
public int size() {
return mappings.size();
}
@Override
public int mappedSize() {
return mappings.inverse().size();
}
@Override
public BiMappings inverse() {
return this.inverse;
}
}
@@ -0,0 +1,77 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data;
import it.unimi.dsi.fastutil.ints.Int2IntMap;
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
public class Int2IntMapMappings implements Mappings {
private final Int2IntMap mappings;
private final int mappedIds;
protected Int2IntMapMappings(final Int2IntMap mappings, final int mappedIds) {
this.mappings = mappings;
this.mappedIds = mappedIds;
mappings.defaultReturnValue(-1);
}
public static Int2IntMapMappings of(final Int2IntMap mappings, final int mappedIds) {
return new Int2IntMapMappings(mappings, mappedIds);
}
public static Int2IntMapMappings of() {
return new Int2IntMapMappings(new Int2IntOpenHashMap(), -1);
}
@Override
public int getNewId(final int id) {
return mappings.get(id);
}
@Override
public void setNewId(final int id, final int mappedId) {
mappings.put(id, mappedId);
}
@Override
public int size() {
return mappings.size();
}
@Override
public int mappedSize() {
return mappedIds;
}
@Override
public Mappings inverse() {
final Int2IntMap inverse = new Int2IntOpenHashMap();
inverse.defaultReturnValue(-1);
for (final Int2IntMap.Entry entry : mappings.int2IntEntrySet()) {
if (entry.getIntValue() != -1) {
inverse.putIfAbsent(entry.getIntValue(), entry.getIntKey());
}
}
return of(inverse, size());
}
}
@@ -0,0 +1,76 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data;
import java.util.Arrays;
public class IntArrayMappings implements Mappings {
private final int[] mappings;
private final int mappedIds;
protected IntArrayMappings(final int[] mappings, final int mappedIds) {
this.mappings = mappings;
this.mappedIds = mappedIds;
}
public static IntArrayMappings of(final int[] mappings, final int mappedIds) {
return new IntArrayMappings(mappings, mappedIds);
}
@Override
public int getNewId(int id) {
return id >= 0 && id < mappings.length ? mappings[id] : -1;
}
@Override
public void setNewId(int id, int mappedId) {
mappings[id] = mappedId;
}
@Override
public int size() {
return mappings.length;
}
@Override
public int mappedSize() {
return mappedIds;
}
@Override
public Mappings inverse() {
final int[] inverse = new int[mappedIds];
Arrays.fill(inverse, -1);
for (int id = 0; id < mappings.length; id++) {
final int mappedId = mappings[id];
if (mappedId != -1 && inverse[mappedId] == -1) {
inverse[mappedId] = id;
}
}
return of(inverse, mappings.length);
}
public int[] raw() {
return mappings;
}
}
@@ -0,0 +1,204 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data;
import com.viaversion.viaversion.api.minecraft.RegistryKey;
import com.viaversion.viaversion.api.minecraft.RegistryType;
import com.viaversion.viaversion.api.minecraft.TagData;
import com.viaversion.viaversion.util.Key;
import it.unimi.dsi.fastutil.ints.IntSet;
import java.util.List;
import java.util.Locale;
import org.checkerframework.checker.nullness.qual.Nullable;
public interface MappingData {
/**
* Loads the mapping data.
*/
void load();
/**
* Returns the mapped block state id, or 0 if unmapped.
*
* @param id unmapped block state id
* @return mapped block state id, or 0 if unmapped
* @throws NullPointerException if this mappingdata does not hold block state mappings
*/
int getNewBlockStateId(int id);
/**
* Returns the mapped block id, or 0 if unmapped.
*
* @param id unmapped block id
* @return mapped block id, or 0 if unmapped
* @throws NullPointerException if this mappingdata does not hold block mappings
*/
int getNewBlockId(int id);
/**
* Returns the backwards mapped block id, or 1 if unmapped.
*
* @param id mapped block id
* @return backwards mapped block id, or 1 if unmapped
*/
int getOldBlockId(int id);
/**
* Returns the mapped item id, or 0 if unmapped.
*
* @param id unmapped item id
* @return mapped item id, or 0 if unmapped
* @throws NullPointerException if this mappingdata does not hold item mappings
*/
int getNewItemId(int id);
/**
* Returns the backwards mapped item id, or 1 if unmapped.
*
* @param id mapped item id
* @return backwards mapped item id, or 1 if unmapped
* @throws NullPointerException if this mappingdata does not hold item mappings
*/
int getOldItemId(int id);
/**
* Returns the mapped particle id, or 0 if unmapped.
*
* @param id unmapped particle id
* @return mapped particle id, or 0 if unmapped
* @throws NullPointerException if this mappingdata does not hold particle mappings
*/
int getNewParticleId(int id);
/**
* Returns the mapped attribute id, or 0 if unmapped.
*
* @param id unmapped attribute id
* @return mapped attribute id, or 0 if unmapped
* @throws NullPointerException if this mappingdata does not hold attribute mappings
*/
int getNewAttributeId(int id);
/**
* Returns the mapped sound id, or 0 if unmapped.
*
* @param id unmapped sound id
* @return mapped sound id, or 0 if unmapped
* @throws NullPointerException if this mappingdata does not hold sound mappings
*/
int getNewSoundId(int id);
/**
* Returns the backwards mapped sound id, or 1 if unmapped.
*
* @param i mapped sound id
* @return backwards mapped sound id, or 1 if unmapped
*/
int getOldSoundId(int i);
/**
* Returns a list of tags to send if present.
*
* @param type registry tag type
* @return list of tags to send if present, else null
*/
@Nullable List<TagData> getTags(RegistryType type);
/**
* Returns item mappings.
*
* @return item mappings
*/
@Nullable BiMappings getItemMappings();
/**
* Returns item mappings if they also have identifier data present.
*
* @return item mappings if they also have identifier data present
* @see #getItemMappings()
*/
@Nullable FullMappings getFullItemMappings();
@Nullable ParticleMappings getParticleMappings();
@Nullable Mappings getBlockMappings();
@Nullable FullMappings getFullBlockMappings();
@Nullable Mappings getBlockStateMappings();
@Nullable Mappings getSoundMappings();
@Nullable FullMappings getFullSoundMappings();
@Nullable Mappings getStatisticsMappings();
@Nullable Mappings getMenuMappings();
@Nullable Mappings getEnchantmentMappings();
@Nullable Mappings getPaintingMappings();
@Nullable FullMappings getBlockEntityMappings();
@Nullable FullMappings getAttributeMappings();
@Nullable FullMappings getEntityMappings();
@Nullable FullMappings getArgumentTypeMappings();
@Nullable FullMappings getRecipeSerializerMappings();
@Nullable FullMappings getSlotDisplayMappings();
@Nullable FullMappings getDataComponentSerializerMappings();
default @Nullable FullMappings getFullMappings(final MappingType mappingType) {
return switch (mappingType) {
case ITEM -> getFullItemMappings();
case BLOCK -> getFullBlockMappings();
case SOUND -> getFullSoundMappings();
case ENTITY_TYPE -> getEntityMappings();
};
}
/**
* Set of block (not block state) ids that had their base type or properties changed.
*
* @return set of changed block ids, or null if not tracked/none are present
*/
@Nullable IntSet changedBlocks();
/**
* Type of mappings. Currently only relevant for ops writing of generic holder classes and expanded when needed.
*/
enum MappingType implements RegistryKey {
ITEM, BLOCK, SOUND, ENTITY_TYPE;
@Override
public Key key() {
return Key.of(name().toLowerCase(Locale.ROOT));
}
}
}
@@ -0,0 +1,376 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data;
import com.viaversion.nbt.tag.CompoundTag;
import com.viaversion.nbt.tag.IntArrayTag;
import com.viaversion.nbt.tag.Tag;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.data.MappingDataLoader.IdentifiersPair;
import com.viaversion.viaversion.api.minecraft.RegistryType;
import com.viaversion.viaversion.api.minecraft.TagData;
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
import it.unimi.dsi.fastutil.ints.IntSet;
import java.util.ArrayList;
import java.util.EnumMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
import org.checkerframework.checker.nullness.qual.Nullable;
public class MappingDataBase implements MappingData {
protected final String unmappedVersion;
protected final String mappedVersion;
protected FullMappings argumentTypeMappings;
protected FullMappings entityMappings;
protected FullMappings recipeSerializerMappings;
protected FullMappings itemDataSerializerMappings;
protected FullMappings slotDisplayMappings;
protected FullMappings attributeMappings;
protected FullMappings blockEntityMappings;
protected ParticleMappings particleMappings;
protected BiMappings itemMappings;
protected BiMappings blockMappings;
protected Mappings blockStateMappings;
protected Mappings soundMappings;
protected Mappings statisticsMappings;
protected Mappings enchantmentMappings;
protected Mappings paintingMappings;
protected Mappings menuMappings;
protected Map<RegistryType, List<TagData>> tags;
/**
* Set of block ids that have had type or property changes.
*/
protected IntSet changedBlocks;
public MappingDataBase(final String unmappedVersion, final String mappedVersion) {
this.unmappedVersion = unmappedVersion;
this.mappedVersion = mappedVersion;
}
@Override
public void load() {
if (Via.getManager().isDebug()) {
getLogger().info("Loading " + unmappedVersion + " -> " + mappedVersion + " mappings...");
}
final CompoundTag data = readMappingsFile("mappings-" + unmappedVersion + "to" + mappedVersion + ".nbt");
blockStateMappings = loadMappings(data, "blockstates");
statisticsMappings = loadMappings(data, "statistics");
menuMappings = loadMappings(data, "menus");
enchantmentMappings = loadMappings(data, "enchantments");
paintingMappings = loadMappings(data, "paintings");
final CompoundTag unmappedIdentifierData = readUnmappedIdentifiersFile("identifiers-" + unmappedVersion + ".nbt");
final CompoundTag mappedIdentifierData = readMappedIdentifiersFile("identifiers-" + mappedVersion + ".nbt");
if (unmappedIdentifierData != null && mappedIdentifierData != null) {
itemMappings = loadFullOrBiMappings(data, unmappedIdentifierData, mappedIdentifierData, "items");
blockMappings = loadFullOrBiMappings(data, unmappedIdentifierData, mappedIdentifierData, "blocks");
soundMappings = loadFullOrBiMappings(data, unmappedIdentifierData, mappedIdentifierData, "sounds");
entityMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "entities");
argumentTypeMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "argumenttypes");
slotDisplayMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "slot_displays");
recipeSerializerMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "recipe_serializers");
itemDataSerializerMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "data_component_type");
attributeMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "attributes");
blockEntityMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "blockentities");
final IdentifiersPair particleIdentifiers = identifiersFromGlobalIds(unmappedIdentifierData, mappedIdentifierData, "particles");
if (particleIdentifiers != null) {
Mappings particleMappings = loadMappings(data, "particles");
if (particleMappings == null) {
particleMappings = new IdentityMappings(particleIdentifiers.unmapped().size(), particleIdentifiers.mapped().size());
}
this.particleMappings = new ParticleMappings(particleIdentifiers, particleMappings);
}
} else {
// Might not have identifiers in older versions
itemMappings = loadBiMappings(data, "items");
blockMappings = loadBiMappings(data, "blocks");
soundMappings = loadMappings(data, "sounds");
}
final CompoundTag tagsTag = data.getCompoundTag("tags");
if (tagsTag != null) {
this.tags = new EnumMap<>(RegistryType.class);
loadTags(RegistryType.ITEM, tagsTag);
loadTags(RegistryType.BLOCK, tagsTag);
loadTags(RegistryType.ENTITY, tagsTag);
}
final IntArrayTag changedBlocks = data.getIntArrayTag("changed_blocks");
if (changedBlocks != null) {
this.changedBlocks = new IntOpenHashSet(changedBlocks.getValue());
}
loadExtras(data);
}
protected @Nullable List<String> identifiersFromGlobalIds(final CompoundTag mappingsTag, final String key) {
return MappingDataLoader.INSTANCE.identifiersFromGlobalIds(mappingsTag, key);
}
protected @Nullable IdentifiersPair identifiersFromGlobalIds(final CompoundTag unmappedTag, final CompoundTag mappedTag, final String key) {
return MappingDataLoader.INSTANCE.identifiersFromGlobalIds(unmappedTag, mappedTag, key);
}
protected @Nullable CompoundTag readMappingsFile(final String name) {
return MappingDataLoader.INSTANCE.loadNBT(name);
}
protected @Nullable CompoundTag readUnmappedIdentifiersFile(final String name) {
return MappingDataLoader.INSTANCE.loadNBT(name, true);
}
protected @Nullable CompoundTag readMappedIdentifiersFile(final String name) {
return MappingDataLoader.INSTANCE.loadNBT(name, true);
}
protected @Nullable Mappings loadMappings(final CompoundTag data, final String key) {
return MappingDataLoader.INSTANCE.loadMappings(data, key);
}
protected @Nullable BiMappings loadFullOrBiMappings(final CompoundTag data, final CompoundTag unmappedIdentifiersTag, final CompoundTag mappedIdentifiersTag, final String key) {
final FullMappings mappings = loadFullMappings(data, unmappedIdentifiersTag, mappedIdentifiersTag, key);
return mappings != null ? mappings : loadBiMappings(data, key);
}
protected @Nullable FullMappings loadFullMappings(final CompoundTag data, final CompoundTag unmappedIdentifiersTag, final CompoundTag mappedIdentifiersTag, final String key) {
if (!unmappedIdentifiersTag.contains(key) || !mappedIdentifiersTag.contains(key)) {
return null;
}
final IdentifiersPair identifiersPair = identifiersFromGlobalIds(unmappedIdentifiersTag, mappedIdentifiersTag, key);
Mappings mappings = loadBiMappings(data, key); // Load as bi-mappings to keep the inverse cached
if (mappings == null) {
mappings = new IdentityMappings(identifiersPair.unmapped().size(), identifiersPair.mapped().size());
}
return FullMappingsBase.of(identifiersPair, mappings);
}
protected @Nullable BiMappings loadBiMappings(final CompoundTag data, final String key) {
final Mappings mappings = loadMappings(data, key);
return mappings != null ? BiMappings.of(mappings) : null;
}
private void loadTags(final RegistryType type, final CompoundTag data) {
final CompoundTag tag = data.getCompoundTag(type.identifier());
if (tag == null) {
return;
}
final List<TagData> tagsList = new ArrayList<>(tags.size());
for (final Map.Entry<String, Tag> entry : tag.entrySet()) {
final IntArrayTag entries = (IntArrayTag) entry.getValue();
tagsList.add(new TagData(entry.getKey(), entries.getValue()));
}
this.tags.put(type, tagsList);
}
@Override
public int getNewBlockStateId(final int id) {
return checkValidity(id, blockStateMappings.getNewId(id), "blockstate");
}
@Override
public int getNewBlockId(final int id) {
return checkValidity(id, blockMappings.getNewId(id), "block");
}
@Override
public int getOldBlockId(final int id) {
return blockMappings.inverse().getNewIdOrDefault(id, 1);
}
@Override
public int getNewItemId(final int id) {
return checkValidity(id, itemMappings.getNewId(id), "item");
}
@Override
public int getOldItemId(final int id) {
return itemMappings.inverse().getNewIdOrDefault(id, 1);
}
@Override
public int getNewParticleId(final int id) {
return checkValidity(id, particleMappings.getNewId(id), "particles");
}
@Override
public int getNewAttributeId(final int id) {
return checkValidity(id, attributeMappings.getNewId(id), "attributes");
}
@Override
public int getNewSoundId(final int id) {
return checkValidity(id, soundMappings.getNewId(id), "sound");
}
@Override
public int getOldSoundId(final int id) {
return soundMappings.inverse().getNewIdOrDefault(id, 0);
}
@Override
public @Nullable List<TagData> getTags(final RegistryType type) {
return tags != null ? tags.get(type) : null;
}
@Override
public @Nullable BiMappings getItemMappings() {
return itemMappings;
}
@Override
public @Nullable FullMappings getFullItemMappings() {
if (itemMappings instanceof FullMappings fullItemMappings) {
return fullItemMappings;
}
return null;
}
@Override
public @Nullable ParticleMappings getParticleMappings() {
return particleMappings;
}
@Override
public @Nullable Mappings getBlockMappings() {
return blockMappings;
}
@Override
public @Nullable FullMappings getFullBlockMappings() {
if (blockMappings instanceof FullMappings fullBlockMappings) {
return fullBlockMappings;
}
return null;
}
@Override
public @Nullable FullMappings getBlockEntityMappings() {
return blockEntityMappings;
}
@Override
public @Nullable Mappings getBlockStateMappings() {
return blockStateMappings;
}
@Override
public @Nullable Mappings getSoundMappings() {
return soundMappings;
}
@Override
public @Nullable FullMappings getFullSoundMappings() {
if (soundMappings instanceof FullMappings fullSoundMappings) {
return fullSoundMappings;
}
return null;
}
@Override
public @Nullable Mappings getStatisticsMappings() {
return statisticsMappings;
}
@Override
public @Nullable Mappings getMenuMappings() {
return menuMappings;
}
@Override
public @Nullable Mappings getEnchantmentMappings() {
return enchantmentMappings;
}
@Override
public @Nullable FullMappings getAttributeMappings() {
return attributeMappings;
}
@Override
public @Nullable FullMappings getEntityMappings() {
return entityMappings;
}
@Override
public @Nullable FullMappings getArgumentTypeMappings() {
return argumentTypeMappings;
}
@Override
public @Nullable FullMappings getDataComponentSerializerMappings() {
return itemDataSerializerMappings;
}
@Override
public @Nullable Mappings getPaintingMappings() {
return paintingMappings;
}
@Override
public @Nullable FullMappings getRecipeSerializerMappings() {
return recipeSerializerMappings;
}
@Override
public @Nullable FullMappings getSlotDisplayMappings() {
return slotDisplayMappings;
}
@Override
public @Nullable IntSet changedBlocks() {
return changedBlocks;
}
protected Logger getLogger() {
return Via.getPlatform().getLogger();
}
/**
* Returns the given mapped id if valid, else 0 with a warning logged to the console.
*
* @param id unmapped id
* @param mappedId mapped id
* @param type mapping type (e.g. "item")
* @return the given mapped id if valid, else 0
*/
protected int checkValidity(final int id, final int mappedId, final String type) {
if (mappedId == -1) {
if (Via.getConfig().logOtherConversionWarnings()) {
getLogger().warning(String.format("Missing %s %s for %s %s %d", mappedVersion, type, unmappedVersion, type, id));
}
return 0;
}
return mappedId;
}
protected void loadExtras(final CompoundTag data) {
}
}
@@ -0,0 +1,404 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data;
import com.google.common.annotations.Beta;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonIOException;
import com.google.gson.JsonObject;
import com.google.gson.JsonSyntaxException;
import com.viaversion.nbt.io.NBTIO;
import com.viaversion.nbt.io.TagReader;
import com.viaversion.nbt.tag.CompoundTag;
import com.viaversion.nbt.tag.IntArrayTag;
import com.viaversion.nbt.tag.IntTag;
import com.viaversion.nbt.tag.ListTag;
import com.viaversion.nbt.tag.StringTag;
import com.viaversion.nbt.tag.Tag;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.util.GsonUtil;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
import org.checkerframework.checker.nullness.qual.Nullable;
public class MappingDataLoader {
public static final MappingDataLoader INSTANCE = new MappingDataLoader(MappingDataLoader.class, "assets/viaversion/data/");
public static final TagReader<CompoundTag> MAPPINGS_READER = NBTIO.reader(CompoundTag.class).named();
private static final Map<String, String[]> GLOBAL_IDENTIFIER_INDEXES = new HashMap<>();
private static final byte DIRECT_ID = 0;
private static final byte SHIFTS_ID = 1;
private static final byte CHANGES_ID = 2;
private static final byte IDENTITY_ID = 3;
private final Map<String, CompoundTag> mappingsCache = new HashMap<>();
private final Class<?> dataLoaderClass;
private final String dataPath;
private boolean cacheValid = true;
public MappingDataLoader(final Class<?> dataLoaderClass, final String dataPath) {
this.dataLoaderClass = dataLoaderClass;
this.dataPath = dataPath;
}
public static void loadGlobalIdentifiers() {
// Load in a file with all the identifiers we need, so that we don't need to duplicate them
// for every single new version with only a couple of changes in them.
final CompoundTag globalIdentifiers = INSTANCE.loadNBT("identifier-table.nbt");
for (final Map.Entry<String, Tag> entry : globalIdentifiers.entrySet()) {
//noinspection unchecked
final ListTag<StringTag> value = (ListTag<StringTag>) entry.getValue();
final int size = value.size();
final String[] array = new String[size];
for (int i = 0; i < size; i++) {
array[i] = value.get(i).getValue();
}
GLOBAL_IDENTIFIER_INDEXES.put(entry.getKey(), array);
}
}
/**
* Returns the global id of the identifier in the registry.
*
* @param registry registry key
* @param globalId global id
* @return identifier
* @throws IllegalArgumentException if the registry key is invalid
*/
public @Nullable String identifierFromGlobalId(final String registry, final int globalId) {
final String[] array = GLOBAL_IDENTIFIER_INDEXES.get(registry);
if (array == null) {
throw new IllegalArgumentException("Unknown global identifier key: " + registry);
}
if (globalId < 0 || globalId >= array.length) {
throw new IllegalArgumentException("Unknown global identifier index: " + globalId);
}
return array[globalId];
}
public void clearCache() {
mappingsCache.clear();
cacheValid = false;
}
/**
* Loads the file from the plugin folder if present, else from the bundled resources.
*
* @return loaded json object, or null if not found or invalid
*/
public @Nullable JsonObject loadFromDataDir(final String name) {
final File file = new File(getDataFolder(), name);
if (!file.exists()) {
return loadData(name);
}
// Load the file from the platform's directory if present
try (final FileReader reader = new FileReader(file)) {
return GsonUtil.getGson().fromJson(reader, JsonObject.class);
} catch (final JsonSyntaxException e) {
// Users might mess up the format, so let's catch the syntax error
getLogger().warning(name + " is badly formatted!");
throw new RuntimeException(e);
} catch (final IOException | JsonIOException e) {
throw new RuntimeException(e);
}
}
/**
* Loads the file from the bundled resources.
*
* @return loaded json object from bundled resources if present
*/
public @Nullable JsonObject loadData(final String name) {
final InputStream stream = getResource(name);
if (stream == null) {
return null;
}
try (final InputStreamReader reader = new InputStreamReader(stream)) {
return GsonUtil.getGson().fromJson(reader, JsonObject.class);
} catch (final IOException e) {
throw new RuntimeException(e);
}
}
public @Nullable CompoundTag loadNBT(final String name, final boolean cache) {
if (!cacheValid) {
return loadNBTFromFile(name);
}
CompoundTag data = mappingsCache.get(name);
if (data != null) {
return data;
}
data = loadNBTFromFile(name);
if (cache && data != null) {
mappingsCache.put(name, data);
}
return data;
}
public @Nullable CompoundTag loadNBT(final String name) {
return loadNBT(name, false);
}
public @Nullable CompoundTag loadNBTFromFile(final String name) {
final InputStream resource = getResource(name);
if (resource == null) {
return null;
}
try (final InputStream stream = new BufferedInputStream(resource)) {
return MAPPINGS_READER.read(stream);
} catch (final IOException e) {
throw new RuntimeException(e);
}
}
public @Nullable Mappings loadMappings(final CompoundTag mappingsTag, final String key) {
return loadMappings(mappingsTag, key, size -> {
final int[] array = new int[size];
Arrays.fill(array, -1);
return array;
}, (array, id, mappedId) -> array[id] = mappedId, IntArrayMappings::of);
}
@Beta
public <M extends Mappings, V> @Nullable Mappings loadMappings(
final CompoundTag mappingsTag,
final String key,
final MappingHolderSupplier<V> holderSupplier,
final AddConsumer<V> addConsumer,
final MappingsSupplier<M, V> mappingsSupplier
) {
final CompoundTag tag = mappingsTag.getCompoundTag(key);
if (tag == null) {
return null;
}
final int mappedSize = tag.getInt("mappedSize", -1);
final byte strategy = tag.getByteTag("id").asByte();
final V mappings;
if (strategy == DIRECT_ID) {
final IntArrayTag valuesTag = tag.getIntArrayTag("val");
return IntArrayMappings.of(valuesTag.getValue(), mappedSize);
} else if (strategy == SHIFTS_ID) {
final int[] shiftsAt = tag.getIntArrayTag("at").getValue();
final int[] shiftsTo = tag.getIntArrayTag("to").getValue();
final int size = tag.getIntTag("size").asInt();
mappings = holderSupplier.get(size);
if (shiftsAt[0] != 0) {
// Add identity values before the first shift
final int to = shiftsAt[0];
for (int id = 0; id < to; id++) {
addConsumer.addTo(mappings, id, id);
}
}
// Read shifts
for (int i = 0; i < shiftsAt.length; i++) {
final boolean isLast = i == shiftsAt.length - 1;
final int from = shiftsAt[i];
final int to = isLast ? size : shiftsAt[i + 1];
int mappedId = shiftsTo[i];
for (int id = from; id < to; id++) {
addConsumer.addTo(mappings, id, mappedId++);
}
}
} else if (strategy == CHANGES_ID) {
final int[] changesAt = tag.getIntArrayTag("at").getValue();
final int[] values = tag.getIntArrayTag("val").getValue();
final int size = tag.getIntTag("size").asInt();
final boolean fillBetween = tag.get("nofill") == null;
mappings = holderSupplier.get(size);
int nextUnhandledId = 0;
for (int i = 0; i < changesAt.length; i++) {
final int changedId = changesAt[i];
if (fillBetween) {
// Fill from after the last change to before this change with unchanged ids
for (int id = nextUnhandledId; id < changedId; id++) {
addConsumer.addTo(mappings, id, id);
}
nextUnhandledId = changedId + 1;
}
// Assign the changed value
addConsumer.addTo(mappings, changedId, values[i]);
}
} else if (strategy == IDENTITY_ID) {
final IntTag sizeTag = tag.getIntTag("size");
return new IdentityMappings(sizeTag.asInt(), mappedSize);
} else {
throw new IllegalArgumentException("Unknown serialization strategy: " + strategy);
}
return mappingsSupplier.create(mappings, mappedSize);
}
public @Nullable List<String> identifiersFromGlobalIds(final CompoundTag mappingsTag, final String key) {
final Mappings mappings = loadMappings(mappingsTag, key);
return mappings != null ? identifiers(mappings, key) : null;
}
/**
* Returns a pair of identifier lists, also keeping track of whether the two lists are equal.
*
* @param unmappedTag unmapped mappings tag
* @param mappedTag mapped mappings tag
* @param key mappings key
* @return pair of identifier lists
*/
public @Nullable IdentifiersPair identifiersFromGlobalIds(final CompoundTag unmappedTag, final CompoundTag mappedTag, final String key) {
final Mappings unmapped = loadMappings(unmappedTag, key);
if (unmapped == null) {
return null;
}
final Mappings mapped = loadMappings(mappedTag, key);
if (mapped == null) {
return null;
}
final int size = unmapped.size();
if (size != mapped.size()) {
return new IdentifiersPair(identifiers(unmapped, key), identifiers(mapped, key), false);
}
// Small optimization to only load one array and reduce loading for full mappings
final List<String> unmappedIdentifiers = new ArrayList<>(size);
final List<String> mappedIdentifiers = new ArrayList<>(size);
boolean identity = true;
for (int i = 0; i < size; i++) {
final int unmappedGlobalId = unmapped.getNewId(i);
final int mappedGlobalId = mapped.getNewId(i);
final String unmappedIdentifier = identifierFromGlobalId(key, unmappedGlobalId);
if (unmappedGlobalId == mappedGlobalId) {
unmappedIdentifiers.add(unmappedIdentifier);
mappedIdentifiers.add(unmappedIdentifier);
continue;
}
identity = false;
unmappedIdentifiers.add(unmappedIdentifier);
mappedIdentifiers.add(identifierFromGlobalId(key, mappedGlobalId));
}
return identity ? new IdentifiersPair(unmappedIdentifiers) : new IdentifiersPair(unmappedIdentifiers, mappedIdentifiers);
}
private List<String> identifiers(final Mappings mappings, final String key) {
final List<String> identifiers = new ArrayList<>(mappings.size());
for (int i = 0; i < mappings.size(); i++) {
final int globalId = mappings.getNewId(i);
identifiers.add(identifierFromGlobalId(key, globalId));
}
return identifiers;
}
/**
* Returns a map of the object entries hashed by their id value.
*
* @param object json object
* @return map with indexes hashed by their id value
*/
public Object2IntMap<String> indexedObjectToMap(final JsonObject object) {
final Object2IntMap<String> map = new Object2IntOpenHashMap<>(object.size());
map.defaultReturnValue(-1);
for (final Map.Entry<String, JsonElement> entry : object.entrySet()) {
map.put(entry.getValue().getAsString(), Integer.parseInt(entry.getKey()));
}
return map;
}
/**
* Returns a map of the array entries hashed by their id value.
*
* @param array json array
* @return map with indexes hashed by their id value
*/
public Object2IntMap<String> arrayToMap(final JsonArray array) {
final Object2IntMap<String> map = new Object2IntOpenHashMap<>(array.size());
map.defaultReturnValue(-1);
for (int i = 0; i < array.size(); i++) {
map.put(array.get(i).getAsString(), i);
}
return map;
}
public Logger getLogger() {
return Via.getPlatform().getLogger();
}
public File getDataFolder() {
return Via.getPlatform().getDataFolder();
}
public @Nullable InputStream getResource(final String name) {
return dataLoaderClass.getClassLoader().getResourceAsStream(dataPath + name);
}
@FunctionalInterface
public interface AddConsumer<T> {
void addTo(T holder, int id, int mappedId);
}
@FunctionalInterface
public interface MappingHolderSupplier<T> {
T get(int expectedSize);
}
@FunctionalInterface
public interface MappingsSupplier<T extends Mappings, V> {
T create(V mappings, int mappedSize);
}
public record IdentifiersPair(List<String> unmapped, List<String> mapped, boolean identity) {
public IdentifiersPair(final List<String> unmapped, final List<String> mapped) {
this(unmapped, mapped, false);
}
public IdentifiersPair(final List<String> identifiers) {
this(identifiers, identifiers, true);
}
}
}
@@ -0,0 +1,125 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data;
import org.checkerframework.checker.nullness.qual.Nullable;
public interface Mappings {
/**
* Returns the mapped id from the given id, or -1 if invalid/out of bounds.
*
* @param id unmapped id
* @return mapped id, or -1 if invalid/out of bounds
*/
int getNewId(int id);
/**
* Returns the mapped id from the given id, or the given default if unmapped/invalid.
*
* @param id unmapped id
* @param def fallback return value
* @return mapped id, or def if invalid/out of bounds
*/
default int getNewIdOrDefault(int id, int def) {
final int mappedId = getNewId(id);
return mappedId != -1 ? mappedId : def;
}
/**
* Returns whether the id has a mapping.
*
* @param id unmapped id
* @return whether the id has a mapped id
*/
default boolean contains(int id) {
return getNewId(id) != -1;
}
/**
* Manually maps a specific id.
*
* @param id unmapped id
* @param mappedId mapped id
* @throws IndexOutOfBoundsException if the unmapped id is invalid
*/
void setNewId(int id, int mappedId);
/**
* Returns amount of unmapped entries, being the size of the mapping.
*
* @return amount of unmapped entries
*/
int size();
/**
* Returns the amount of new ids total, even if it does not have a direct mapping.
* Returns -1 if unknown.
*
* @return amount of new ids, or -1 if unknown
*/
int mappedSize();
/**
* Mappings with keys and values swapped.
*
* @return mappings with keys and values swapped
*/
Mappings inverse();
/**
* Returns whether the mappings are unchanged identity mappings.
*
* @return whether the mappings are unchanged identity mappings
*/
default boolean isIdentity() {
return false;
}
/**
* Returns whether the mappings null or identity mappings.
*
* @param mappings mappings
* @return whether the mappings are identity mappings
* @see #isFullIdentity(Mappings)
*/
static boolean isIntIdIdentity(@Nullable final Mappings mappings) {
if (mappings == null) {
return true;
}
return mappings instanceof FullMappings fullMappings ? fullMappings.isIntIdIdentity() : mappings.isIdentity();
}
/**
* Returns whether the mappings null or full identity mappings.
* Stronger than {@link #isIntIdIdentity(Mappings)}, but equal to that if not {@link FullMappings}.
*
* @param mappings mappings
* @return whether the mappings are full identity mappings
* @see #isIntIdIdentity(Mappings)
*/
static boolean isFullIdentity(@Nullable final Mappings mappings) {
return mappings == null || mappings.isIdentity();
}
}
@@ -0,0 +1,60 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data;
import com.viaversion.viaversion.api.data.MappingDataLoader.IdentifiersPair;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntList;
public class ParticleMappings extends FullMappingsBase {
private final IntList itemParticleIds = new IntArrayList(4);
private final IntList blockParticleIds = new IntArrayList(4);
public ParticleMappings(final IdentifiersPair identifiersPair, final Mappings mappings) {
super(identifiersPair, mappings);
addBlockParticle("block");
addBlockParticle("falling_dust");
addBlockParticle("block_marker");
addBlockParticle("dust_pillar");
addBlockParticle("block_crumble");
addItemParticle("item");
}
public boolean addItemParticle(final String identifier) {
final int id = id(identifier);
return id != -1 && itemParticleIds.add(id);
}
public boolean addBlockParticle(final String identifier) {
final int id = id(identifier);
return id != -1 && blockParticleIds.add(id);
}
public boolean isBlockParticle(final int id) {
return blockParticleIds.contains(id);
}
public boolean isItemParticle(final int id) {
return itemParticleIds.contains(id);
}
}
@@ -0,0 +1,28 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data.entity;
public interface ClientEntityIdChangeListener {
void setClientEntityId(int entityId);
}
@@ -0,0 +1,32 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data.entity;
public interface DimensionData {
int id();
int minY();
int height();
}
@@ -0,0 +1,218 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data.entity;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
import com.viaversion.viaversion.util.KeyMappings;
import java.util.Map;
import org.checkerframework.checker.nullness.qual.Nullable;
public interface EntityTracker {
/**
* User connection the tracker belongs to.
*
* @return user connection
*/
@Deprecated
UserConnection user();
/**
* Tracks an entity.
*
* @param id entity id
* @param type entity type
*/
void addEntity(int id, EntityType type);
/**
* Returns whether the entity is currently tracked.
*
* @param id entity id
* @return whether the entity is tracked
*/
boolean hasEntity(int id);
/**
* Returns the tracked entity for the given entity id if present.
*
* @param entityId entity id
* @return tracked entity if tracked
*/
@Nullable TrackedEntity entity(int entityId);
/**
* Entity type of the entity if tracked.
* This returning null does not necessarily mean no entity by the id exists.
*
* @param id entity id
* @return entity type of the entity if tracked
*/
@Nullable EntityType entityType(int id);
/**
* Untracks an entity.
*
* @param id entity id
*/
void removeEntity(int id);
/**
* Clears stored entity types and data, only leaving behind the client entity.
*/
void clearEntities();
/**
* Clears all stored data, including entity types, entity data and client entity id.
*/
void clear();
/**
* Returns the stored entity data if an entity with the id is tracked, else null.
* If no data has been initialized yet, it will be done and returned by this method.
*
* @param id entity id
* @return stored entity data if an entity with the id is tracked, else null
* @throws IllegalArgumentException if entity data storage has not been enabled via the implementation
*/
@Nullable StoredEntityData entityData(int id);
/**
* Returns stored entity data if it has previously been initialized by {@link #entityData(int)}, else null.
*
* @param id entity id
* @return stored entity data if it has previously been initialized by {@link #entityData(int)}
* @throws IllegalArgumentException if entity data storage has not been enabled via the implementation
*/
@Nullable StoredEntityData entityDataIfPresent(int id);
/**
* Returns whether the client entity id has been set.
*
* @return whether the client entity id has been set
*/
boolean hasClientEntityId();
/**
* Returns the client entity id. Should be wrapped around {@link #hasClientEntityId()}.
*
* @return client entity id
* @throws IllegalStateException if the client entity id has not been set
*/
int clientEntityId() throws IllegalStateException;
/**
* Sets the client entity id.
*
* @param clientEntityId client entity id
*/
void setClientEntityId(int clientEntityId);
/**
* Returns whether the client player has the "insta build" ability, usually from creative mode.
*
* @return whether the client player can insta build
*/
boolean canInstaBuild();
/**
* Sets whether the client player has the "insta build" ability, usually from creative mode.
*
* @param instaBuild whether the client player can insta build
*/
void setInstaBuild(boolean instaBuild);
/**
* Returns the current world section height (block height / 16).
* This is always 16 for sub 1.17 worlds.
*
* @return current world section height
*/
int currentWorldSectionHeight();
/**
* Sets the current world section height.
*
* @param currentWorldSectionHeight world section height
*/
void setCurrentWorldSectionHeight(int currentWorldSectionHeight);
/**
* Returns the minimum y of the current player world.
*
* @return minimum y of the current world
*/
int currentMinY();
/**
* Sets the minimum y of the current player world.
*
* @param currentMinY minimum y of the current world
*/
void setCurrentMinY(int currentMinY);
/**
* Returns the name of the world the player is currently in.
*
* @return world name of the current world
*/
@Nullable String currentWorld();
/**
* Sets the name of the world the player is currently in.
*
* @param currentWorld name of the current world
*/
void setCurrentWorld(String currentWorld);
/**
* Returns the id of the current dimension, or -1 if unset (i.e. before 1.20.5).
*
* @return id of the current dimension, or -1 if unset
*/
int currentDimensionId();
/**
* Sets the id of the current dimension.
*
* @param currentDimensionId id of the current dimension
*/
void setCurrentDimensionId(int currentDimensionId);
int biomesSent();
void setBiomesSent(int biomesSent);
EntityType playerType();
@Nullable DimensionData dimensionData(String dimension);
@Nullable DimensionData dimensionData(int dimensionId);
void setDimensions(Map<String, DimensionData> dimensions);
@Nullable KeyMappings registryKeys(String registryKey);
void addRegistryKeys(String registryKey, KeyMappings mappings);
}
@@ -0,0 +1,69 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data.entity;
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
import org.checkerframework.checker.nullness.qual.Nullable;
public interface StoredEntityData {
/**
* Returns the entity type of the stored entity.
*
* @return entity type
*/
EntityType type();
/**
* Checks if the storage contains an object of the given type.
*
* @param objectClass object class to check
* @return whether an object of the given type is in the storage
*/
boolean has(Class<?> objectClass);
/**
* Returns an object from the storage if present.
*
* @param objectClass class of the object to get
* @param <T> object type
* @return object if present
*/
@Nullable <T> T get(Class<T> objectClass);
/**
* Removes and returns an object from the storage if present.
*
* @param objectClass class of the object to remove
* @param <T> object type
* @return removed object if present
*/
@Nullable <T> T remove(Class<T> objectClass);
/**
* Stores an object based on its class.
*
* @param object object to store
*/
void put(Object object);
}
@@ -0,0 +1,58 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data.entity;
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
public interface TrackedEntity {
/**
* Returns the type of the stored entity.
*
* @return type of the entity
*/
EntityType entityType();
/**
* Object to hold arbitrary additional data.
*
* @return entity data
*/
StoredEntityData data();
/**
* Returns whether the stored entity currently has any additional data.
*
* @return whether the stored entity currently has additional data
*/
boolean hasData();
/**
* Returns whether entity data has already been sent at least once for this entity.
*
* @return whether entity data has already been sent at least once for this entity
*/
boolean hasSentEntityData();
void sentEntityData(boolean sentEntityData);
}
@@ -0,0 +1,42 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data.item;
/**
* Used for converting items to hashed items and caching them for later use during serverbound packets.
* <p>
* Most of this stays in the internal module given non-permanent, imperfect caching as well as missing converters.
*/
public interface ItemHasher {
/**
* Returns whether this connection is currently processing a clientbound player inventory packet.
* <p>
* Used for checking when it is necessary to track/process item data hashes.
*
* @return true if processing a clientbound inventory packet, false otherwise
*/
boolean isProcessingClientboundInventoryPacket();
void setProcessingClientboundInventoryPacket(boolean processingClientboundInventoryPacket);
}
@@ -0,0 +1,154 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.debug;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.protocol.packet.Direction;
import com.viaversion.viaversion.api.protocol.packet.PacketType;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import java.util.logging.Level;
public interface DebugHandler {
/**
* Returns whether debug mode is enabled.
*
* @return whether debug mode is enabled
*/
boolean enabled();
/**
* Sets debug mode.
*
* @param enabled whether debug should be enabled
*/
void setEnabled(boolean enabled);
/**
* Adds a packet type name to the list of packet types to log.
*
* @param packetTypeName packet type name
*/
void addPacketTypeNameToLog(String packetTypeName);
/**
* Adds a packet type to the list of packet types to log.
* Packets will be checked on each protocol transformer, so this is best used on single protocol pipes.
*
* @param packetType packet type
*/
void addPacketTypeToLog(PacketType packetType);
/**
* Removes a packet type name from the list of packet types to log.
*
* @param packetTypeName packet type name
*/
boolean removePacketTypeNameToLog(String packetTypeName);
/**
* Removes a packet type from the list of packet types to log.
*
* @param packetType Packet type to remove
*/
boolean removePacketTypeToLog(PacketType packetType);
/**
* Resets packet type filters.
*/
void clearPacketTypesToLog();
/**
* Sets whether packets should be logged before and after being transformed.
*
* @param logPacketTransform whether packets should be logged
*/
default void setLogPacketTransform(boolean logPacketTransform) {
setLogPrePacketTransform(logPacketTransform);
setLogPostPacketTransform(logPacketTransform);
}
/**
* Returns whether packets should be logged before being transformed.
* Set to true by default.
*
* @return whether packets should be logged before being transformed
*/
boolean logPrePacketTransform();
/**
* Sets whether packets should be logged before being transformed.
*
* @param logPrePacketTransform whether packets should be logged before being transformed
*/
void setLogPrePacketTransform(boolean logPrePacketTransform);
/**
* Returns whether packets should be logged after being transformed.
* Set to false by default.
*
* @return whether packets should be logged after being transformed
*/
boolean logPostPacketTransform();
/**
* Sets whether packets should be logged after being transformed.
*
* @param logPostPacketTransform whether packets should be logged after being transformed
*/
void setLogPostPacketTransform(boolean logPostPacketTransform);
/**
* Returns whether the given packet should be logged.
* If no specific packet type has been added, all packet types will be logged.
*
* @param wrapper packet wrapper
* @param direction packet direction
* @return whether the packet should be logged
*/
boolean shouldLog(PacketWrapper wrapper, Direction direction);
/**
* Enables debug mode and adds the given packet types to the log list.
*
* @param packetTypes packet types to log
*/
default void enableAndLogTypes(final PacketType... packetTypes) {
setEnabled(true);
for (final PacketType packetType : packetTypes) {
addPacketTypeToLog(packetType);
}
}
/**
* Logs an error if debug mode is enabled or error suppression is disabled.
*
* @param error error message
* @param t thrown exception
*/
default void error(final String error, final Throwable t) {
if (Via.getConfig().logOtherConversionWarnings() || enabled()) {
Via.getPlatform().getLogger().log(Level.SEVERE, error, t);
}
}
}
@@ -0,0 +1,58 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.legacy;
import com.viaversion.viaversion.api.legacy.bossbar.BossBar;
import com.viaversion.viaversion.api.legacy.bossbar.BossColor;
import com.viaversion.viaversion.api.legacy.bossbar.BossStyle;
/**
* API only applicable on or to legacy versions of Minecraft.
*
* @param <T> player type
*/
public interface LegacyViaAPI<T> {
/**
* Creates a new bossbar instance. This only works on pre 1.9 servers for 1.9+ clients.
*
* @param title title
* @param health health, between 0 and 1 (inclusive)
* @param color color
* @param style style
* @return new bossbar instance
*/
BossBar createLegacyBossBar(String title, float health, BossColor color, BossStyle style);
/**
* Creates a new bossbar instance with full health. This only works on pre 1.9 servers for 1.9+ clients.
*
* @param title title
* @param color color
* @param style style
* @return new bossbar instance
*/
default BossBar createLegacyBossBar(String title, BossColor color, BossStyle style) {
return createLegacyBossBar(title, 1F, color, style);
}
}
@@ -1,19 +1,39 @@
package us.myles.ViaVersion.api.boss;
import us.myles.ViaVersion.api.Via;
import us.myles.ViaVersion.api.data.UserConnection;
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.legacy.bossbar;
import com.viaversion.viaversion.api.connection.UserConnection;
import java.util.Set;
import java.util.UUID;
public abstract class BossBar<T> {
public interface BossBar {
/**
* Get the current title
*
* @return the title
*/
public abstract String getTitle();
String getTitle();
/**
* Change the title
@@ -21,14 +41,14 @@ public abstract class BossBar<T> {
* @param title Title can be in either JSON or just text
* @return The BossBar object
*/
public abstract BossBar setTitle(String title);
BossBar setTitle(String title);
/**
* Get the health
*
* @return float between 0F - 1F
*/
public abstract float getHealth();
float getHealth();
/**
* Change the health
@@ -36,29 +56,29 @@ public abstract class BossBar<T> {
* @param health this float has to be between 0F - 1F
* @return The BossBar object
*/
public abstract BossBar setHealth(float health);
BossBar setHealth(float health);
/**
* Get the bossbar color
*
* @return The colour
*/
public abstract BossColor getColor();
BossColor getColor();
/**
* Yay colors!
* Yay, colors!
*
* @param color Whatever color you want!
* @return The BossBar object
*/
public abstract BossBar setColor(BossColor color);
BossBar setColor(BossColor color);
/**
* Get the bosbar style
*
* @return BossStyle
*/
public abstract BossStyle getStyle();
BossStyle getStyle();
/**
* Change the bosbar style
@@ -66,19 +86,7 @@ public abstract class BossBar<T> {
* @param style BossStyle
* @return The BossBar object
*/
public abstract BossBar setStyle(BossStyle style);
/**
* Show the bossbar to a player.
*
* @param player The player
* @return The BossBar object
* @deprecated Deprecated use UUID's instead of Player objects {@link #addPlayer(UUID)}
*/
@Deprecated
public BossBar addPlayer(T player) {
throw new UnsupportedOperationException("This method is not implemented for the platform " + Via.getPlatform().getPlatformName());
}
BossBar setStyle(BossStyle style);
/**
* Show the bossbar to a player (uuid). This only works for frontend connections. Use #addConnection(UserConnection) for other types.
@@ -86,7 +94,7 @@ public abstract class BossBar<T> {
* @param player uuid of the player
* @return The BossBar object
*/
public abstract BossBar addPlayer(UUID player);
BossBar addPlayer(UUID player);
/**
* Show the bossbar to a player connection.
@@ -94,31 +102,7 @@ public abstract class BossBar<T> {
* @param conn UserConnection of the connection
* @return The BossBar object
*/
public abstract BossBar addConnection(UserConnection conn);
/**
* add multiple players
*
* @param players list of players
* @return The BossBar object
* @deprecated Deprecated use UUID's instead of Player objects {@link #addPlayer(UUID)}
*/
@Deprecated
public BossBar addPlayers(T... players) {
throw new UnsupportedOperationException("This method is not implemented for the platform " + Via.getPlatform().getPlatformName());
}
/**
* Remove the bossbar from a player
*
* @param player The player
* @return The BossBar object
* @deprecated Deprecated use UUID's instead of Player objects {@link #removePlayer(UUID)}
*/
@Deprecated
public BossBar removePlayer(T player) {
throw new UnsupportedOperationException("This method is not implemented for the platform " + Via.getPlatform().getPlatformName());
}
BossBar addConnection(UserConnection conn);
/**
* Removes the bossbar from a player. This only works for frontend connections. For others types, use #removeConnection(UserConnection)
@@ -126,7 +110,7 @@ public abstract class BossBar<T> {
* @param uuid The players UUID
* @return The BossBar object
*/
public abstract BossBar removePlayer(UUID uuid);
BossBar removePlayer(UUID uuid);
/**
* Removes the bossbar from a player connection.
@@ -134,7 +118,7 @@ public abstract class BossBar<T> {
* @param conn The UserConnection
* @return The BossBar object
*/
public abstract BossBar removeConnection(UserConnection conn);
BossBar removeConnection(UserConnection conn);
/**
* Add flags
@@ -142,7 +126,7 @@ public abstract class BossBar<T> {
* @param flag The flag to add
* @return The BossBar object
*/
public abstract BossBar addFlag(BossFlag flag);
BossBar addFlag(BossFlag flag);
/**
* Remove flags.
@@ -150,53 +134,53 @@ public abstract class BossBar<T> {
* @param flag The flag to remove
* @return The BossBar object
*/
public abstract BossBar removeFlag(BossFlag flag);
BossBar removeFlag(BossFlag flag);
/**
* @param flag The flag to check against
* @return True if it has the flag
*/
public abstract boolean hasFlag(BossFlag flag);
boolean hasFlag(BossFlag flag);
/**
* Get players. Only returns UUIDs which are front-end. For all connections, use #getConnections()
*
* @return UUIDS from players (sorry I lied)
*/
public abstract Set<UUID> getPlayers();
Set<UUID> getPlayers();
/**
* Get UserConnections.
*
* @return UserConnection from players
*/
public abstract Set<UserConnection> getConnections();
Set<UserConnection> getConnections();
/**
* Show the bossbar to everyone (In the getPlayer set)
*
* @return The BossBar object
*/
public abstract BossBar show();
BossBar show();
/**
* Hide the bossbar from everyone (In the getPlayer set)
*
* @return The BossBar object
*/
public abstract BossBar hide();
BossBar hide();
/**
* Is it visible?
*
* @return visibility changable with show() and hide()
*/
public abstract boolean isVisible();
boolean isVisible();
/**
* Get the UUID of this bossbar
*
* @return Unique Id for this bossbar
*/
public abstract UUID getId();
UUID getId();
}
@@ -0,0 +1,44 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.legacy.bossbar;
public enum BossColor {
PINK(0),
BLUE(1),
RED(2),
GREEN(3),
YELLOW(4),
PURPLE(5),
WHITE(6);
private final int id;
BossColor(int id) {
this.id = id;
}
public int getId() {
return id;
}
}
@@ -0,0 +1,40 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.legacy.bossbar;
public enum BossFlag {
DARKEN_SKY(1),
PLAY_BOSS_MUSIC(2),
CREATE_FOG(4);
private final int id;
BossFlag(int id) {
this.id = id;
}
public int getId() {
return id;
}
}
@@ -0,0 +1,42 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.legacy.bossbar;
public enum BossStyle {
SOLID(0),
SEGMENTED_6(1),
SEGMENTED_10(2),
SEGMENTED_12(3),
SEGMENTED_20(4);
private final int id;
BossStyle(int id) {
this.id = id;
}
public int getId() {
return id;
}
}
@@ -0,0 +1,55 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.misc.HolderType;
import io.netty.buffer.ByteBuf;
import org.checkerframework.checker.nullness.qual.Nullable;
/**
* Represents an animal variant (e.g. for cows, pigs, chickens).
*
* @param modelType model type id
* @param texture texture path
* @param biomes biomes this variant can spawn in, if limited to specific biomes
*/
public record AnimalVariant(int modelType, String texture, @Nullable HolderSet biomes) {
public static HolderType<AnimalVariant> TYPE = new HolderType<>() {
@Override
public AnimalVariant readDirect(final ByteBuf buffer) {
final int modelType = Types.VAR_INT.readPrimitive(buffer);
final String texture = Types.STRING.read(buffer);
final HolderSet biomes = Types.OPTIONAL_HOLDER_SET.read(buffer);
return new AnimalVariant(modelType, texture, biomes);
}
@Override
public void writeDirect(final ByteBuf buffer, final AnimalVariant variant) {
Types.VAR_INT.writePrimitive(buffer, variant.modelType());
Types.STRING.write(buffer, variant.texture());
Types.OPTIONAL_HOLDER_SET.write(buffer, variant.biomes());
}
};
}
@@ -0,0 +1,68 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
public interface BlockChangeRecord {
/**
* Returns the relative x coordinate within the chunk section.
*
* @return relative x coordinate within the chunk section
*/
byte getSectionX();
/**
* Returns the relative y coordinate within the chunk section.
*
* @return relative y coordinate within the chunk section
*/
byte getSectionY();
/**
* Returns the relative z coordinate within the chunk section.
*
* @return relative z coordinate within the chunk section
*/
byte getSectionZ();
/**
* Returns the absolute y coordinate based on the given chunk section y.
*
* @param chunkSectionY chunk section
* @return absolute y coordinate
*/
short getY(int chunkSectionY);
/**
* Returns the absolute y coordinate - only works for sub 1.16 protocols.
*
* @return absolute y coordinate
*/
default short getY() {
return getY(-1);
}
int getBlockId();
void setBlockId(int blockId);
}
@@ -0,0 +1,72 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import com.google.common.base.Preconditions;
public class BlockChangeRecord1_16_2 implements BlockChangeRecord {
private final byte sectionX;
private final byte sectionY;
private final byte sectionZ;
private int blockId;
public BlockChangeRecord1_16_2(byte sectionX, byte sectionY, byte sectionZ, int blockId) {
this.sectionX = sectionX;
this.sectionY = sectionY;
this.sectionZ = sectionZ;
this.blockId = blockId;
}
public BlockChangeRecord1_16_2(int sectionX, int sectionY, int sectionZ, int blockId) {
this((byte) sectionX, (byte) sectionY, (byte) sectionZ, blockId);
}
@Override
public byte getSectionX() {
return sectionX;
}
@Override
public byte getSectionY() {
return sectionY;
}
@Override
public byte getSectionZ() {
return sectionZ;
}
@Override
public short getY(int chunkSectionY) {
Preconditions.checkArgument(chunkSectionY >= 0, "Invalid chunkSectionY: %s", chunkSectionY);
return (short) ((chunkSectionY << 4) + sectionY);
}
public int getBlockId() {
return blockId;
}
public void setBlockId(int blockId) {
this.blockId = blockId;
}
}
@@ -0,0 +1,76 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
public class BlockChangeRecord1_8 implements BlockChangeRecord {
private final byte sectionX;
private final short y;
private final byte sectionZ;
private int blockId;
public BlockChangeRecord1_8(byte sectionX, short y, byte sectionZ, int blockId) {
this.sectionX = sectionX;
this.y = y;
this.sectionZ = sectionZ;
this.blockId = blockId;
}
public BlockChangeRecord1_8(int sectionX, int y, int sectionZ, int blockId) {
this((byte) sectionX, (short) y, (byte) sectionZ, blockId);
}
/**
* @return x coordinate within the chunk section
*/
public byte getSectionX() {
return sectionX;
}
@Override
public byte getSectionY() {
return (byte) (y & 0xF);
}
/**
* @return y coordinate
*/
@Override
public short getY(int chunkSectionY) {
return y;
}
/**
* @return z coordinate within the chunk section
*/
public byte getSectionZ() {
return sectionZ;
}
public int getBlockId() {
return blockId;
}
public void setBlockId(int blockId) {
this.blockId = blockId;
}
}
@@ -0,0 +1,82 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import java.util.EnumMap;
import java.util.Map;
public enum BlockFace {
NORTH((byte) 0, (byte) 0, (byte) -1, EnumAxis.Z),
SOUTH((byte) 0, (byte) 0, (byte) 1, EnumAxis.Z),
EAST((byte) 1, (byte) 0, (byte) 0, EnumAxis.X),
WEST((byte) -1, (byte) 0, (byte) 0, EnumAxis.X),
TOP((byte) 0, (byte) 1, (byte) 0, EnumAxis.Y),
BOTTOM((byte) 0, (byte) -1, (byte) 0, EnumAxis.Y);
private static final Map<BlockFace, BlockFace> opposites = new EnumMap<>(BlockFace.class);
static {
opposites.put(BlockFace.NORTH, BlockFace.SOUTH);
opposites.put(BlockFace.SOUTH, BlockFace.NORTH);
opposites.put(BlockFace.EAST, BlockFace.WEST);
opposites.put(BlockFace.WEST, BlockFace.EAST);
opposites.put(BlockFace.TOP, BlockFace.BOTTOM);
opposites.put(BlockFace.BOTTOM, BlockFace.TOP);
}
private final byte modX;
private final byte modY;
private final byte modZ;
private final EnumAxis axis;
BlockFace(byte modX, byte modY, byte modZ, EnumAxis axis) {
this.modX = modX;
this.modY = modY;
this.modZ = modZ;
this.axis = axis;
}
public BlockFace opposite() {
return opposites.get(this);
}
public byte modX() {
return modX;
}
public byte modY() {
return modY;
}
public byte modZ() {
return modZ;
}
public EnumAxis axis() {
return axis;
}
public enum EnumAxis {
X, Y, Z
}
}
@@ -0,0 +1,89 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
public class BlockPosition {
protected final int x;
protected final int y;
protected final int z;
public BlockPosition(int x, int y, int z) {
this.x = x;
this.y = y;
this.z = z;
}
public BlockPosition getRelative(BlockFace face) {
return new BlockPosition(x + face.modX(), y + face.modY(), z + face.modZ());
}
public double distanceFromCenterSquared(final double x, final double y, final double z) {
final double dx = this.x + 0.5 - x;
final double dy = this.y + 0.5 - y;
final double dz = this.z + 0.5 - z;
return dx * dx + dy * dy + dz * dz;
}
public int x() {
return x;
}
public int y() {
return y;
}
public int z() {
return z;
}
public GlobalBlockPosition withDimension(String dimension) {
return new GlobalBlockPosition(dimension, x, y, z);
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
BlockPosition position = (BlockPosition) o;
if (x != position.x) return false;
if (y != position.y) return false;
return z == position.z;
}
@Override
public int hashCode() {
int result = x;
result = 31 * result + y;
result = 31 * result + z;
return result;
}
@Override
public String toString() {
return "BlockPosition{" +
"x=" + x +
", y=" + y +
", z=" + z +
'}';
}
}
@@ -0,0 +1,100 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import java.util.Objects;
public final class ChunkPosition {
private final int chunkX;
private final int chunkZ;
public ChunkPosition(final int chunkX, final int chunkZ) {
this.chunkX = chunkX;
this.chunkZ = chunkZ;
}
public ChunkPosition(final long chunkKey) {
this.chunkX = (int) chunkKey;
this.chunkZ = (int) (chunkKey >> 32);
}
public int chunkX() {
return chunkX;
}
public int chunkZ() {
return chunkZ;
}
/**
* Returns a long key for this chunk position.
*
* @return the chunk key
*/
public long chunkKey() {
return chunkKey(chunkX, chunkZ);
}
/**
* Returns a long key for the given chunk coordinates.
*
* @param chunkX the chunk X coordinate
* @param chunkZ the chunk Z coordinate
* @return the chunk key
*/
public static long chunkKey(final int chunkX, final int chunkZ) {
return (long) chunkX & 0xffffffffL | ((long) chunkZ & 0xffffffffL) << 32;
}
/**
* Returns a long key for the given block coordinates.
*
* @param x the block X coordinate
* @param z the block Z coordinate
* @return the chunk key
*/
public static long chunkKeyForBlock(final int x, final int z) {
return chunkKey(x >> 4, z >> 4);
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final ChunkPosition that = (ChunkPosition) o;
return chunkX == that.chunkX && chunkZ == that.chunkZ;
}
@Override
public int hashCode() {
return Objects.hash(chunkX, chunkZ);
}
@Override
public String toString() {
return "ChunkPosition{" +
"chunkX=" + chunkX +
", chunkZ=" + chunkZ +
'}';
}
}
@@ -0,0 +1,56 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import com.viaversion.viaversion.api.connection.StorableObject;
/**
* Stored up until 1.14 to be used in chunk sending.
*/
public class ClientWorld implements StorableObject {
private Environment environment = Environment.NORMAL;
public ClientWorld() {
}
public ClientWorld(final Environment environment) {
this.environment = environment;
}
public Environment getEnvironment() {
return environment;
}
/**
* Sets the environment of the world and returns whether the environment was changed.
*
* @param environmentId the id of the environment to set
* @return whether the environment was changed
*/
public boolean setEnvironment(final int environmentId) {
final int previousEnvironmentId = environment.id();
this.environment = Environment.getEnvironmentById(environmentId);
return previousEnvironmentId != environmentId;
}
}
@@ -0,0 +1,82 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
public interface EitherHolder<T> {
/**
* Returns a direct or indirect value holder.
*
* @param value the value
* @param <T> the type of the value
* @return a new direct holder
*/
static <T> EitherHolder<T> of(final Holder<T> value) {
return new EitherHolderImpl<>(value, null);
}
/**
* Returns an indirect holder via the resource key.
*
* @param key the resource key
* @param <T> the type of the value
* @return a new holder with the given resource key
*/
static <T> EitherHolder<T> of(final String key) {
return new EitherHolderImpl<>(null, key);
}
/**
* Returns true if this holder is backed by a direct value.
*
* @return true if the holder is direct
* @see #hasKey()
*/
boolean hasHolder();
/**
* Returns true if this holder has a resource key.
*
* @return true if this holder has a resource key
* @see #hasHolder()
*/
boolean hasKey();
/**
* Returns the value of this holder.
*
* @return the value of this holder
* @throws IllegalArgumentException if this contains a resource key instead of a holder
* @see #hasHolder()
*/
Holder<T> holder();
/**
* Returns the resource key.
*
* @return the resource key
* @throws IllegalArgumentException if this contains a holder instead of a resource key
* @see #hasKey()
*/
String key();
}
@@ -0,0 +1,55 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import com.google.common.base.Preconditions;
import com.viaversion.viaversion.util.EitherImpl;
final class EitherHolderImpl<T> extends EitherImpl<Holder<T>, String> implements EitherHolder<T> {
EitherHolderImpl(final Holder<T> left, final String value) {
super(left, value);
}
@Override
public boolean hasHolder() {
return isLeft();
}
@Override
public boolean hasKey() {
return isRight();
}
@Override
public Holder<T> holder() {
Preconditions.checkArgument(hasHolder(), "Either does not have a holder");
return left();
}
@Override
public String key() {
Preconditions.checkArgument(hasKey(), "Either does not have a key");
return right();
}
}
@@ -0,0 +1,48 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
public enum Environment {
NORMAL(0),
NETHER(-1),
END(1);
private final int id;
Environment(int id) {
this.id = id;
}
public int id() {
return id;
}
public static Environment getEnvironmentById(int id) {
return switch (id) {
case 0 -> NORMAL;
case 1 -> END;
default -> NETHER; // -1 implicitly
};
}
}
@@ -0,0 +1,26 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
public record EulerAngle(float x, float y, float z) {
}
@@ -0,0 +1,58 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
public enum GameMode {
NOT_SET("", -1),
SURVIVAL("Survival Mode", 0),
CREATIVE("Creative Mode", 1),
ADVENTURE("Adventure Mode", 2),
SPECTATOR("Spectator Mode", 3);
private final String text;
private final int id;
GameMode(String text, final int id) {
this.text = text;
this.id = id;
}
public String text() {
return text;
}
public int id() {
return id;
}
public static GameMode getById(int id) {
return switch (id) {
case -1 -> NOT_SET;
case 1 -> CREATIVE;
case 2 -> ADVENTURE;
case 3 -> SPECTATOR;
default /*0*/ -> SURVIVAL;
};
}
}
@@ -0,0 +1,56 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.checkerframework.checker.nullness.qual.Nullable;
public record GameProfile(@Nullable String name, @Nullable UUID id, Property[] properties, boolean dynamic) {
public GameProfile(@Nullable final String name, @Nullable final UUID id, final Property[] properties) {
this(name, id, properties, true);
}
public GameProfile(@Nullable final String name, @Nullable final UUID id) {
this(name, id, new Property[0]);
}
public Map<String, List<Property>> propertiesMap() {
final Map<String, List<Property>> map = new HashMap<>();
for (Property property : properties) {
map.computeIfAbsent(property.name(), k -> new ArrayList<>()).add(property);
}
return map;
}
public record Property(String name, String value, @Nullable String signature) {
public Property(final String name, final String value) {
this(name, value, null);
}
}
}
@@ -0,0 +1,66 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
public final class GlobalBlockPosition extends BlockPosition {
private final String dimension;
public GlobalBlockPosition(final String dimension, final int x, final int y, final int z) {
super(x, y, z);
this.dimension = dimension;
}
public String dimension() {
return dimension;
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final GlobalBlockPosition position = (GlobalBlockPosition) o;
if (x != position.x) return false;
if (y != position.y) return false;
if (z != position.z) return false;
return dimension.equals(position.dimension);
}
@Override
public int hashCode() {
int result = dimension.hashCode();
result = 31 * result + x;
result = 31 * result + y;
result = 31 * result + z;
return result;
}
@Override
public String toString() {
return "GlobalBlockPosition{" +
"dimension='" + dimension + '\'' +
", x=" + x +
", y=" + y +
", z=" + z +
'}';
}
}
@@ -0,0 +1,113 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import it.unimi.dsi.fastutil.ints.Int2IntFunction;
import java.util.function.Function;
import java.util.function.Supplier;
public interface Holder<T> {
/**
* Returns an indirect id holder.
*
* @param id the id
* @param <T> the type of the value
* @return a new holder with the given id
* @throws IllegalArgumentException if the id is negative
*/
static <T> Holder<T> of(final int id) {
return new IdHolder<>(id);
}
/**
* Returns a direct value holder.
*
* @param value the value
* @param <T> the type of the value
* @return a new direct holder
*/
static <T> Holder<T> of(final T value) {
return new ValueHolder<>(value);
}
/**
* Returns true if this holder is backed by a direct value.
*
* @return true if the holder is direct
* @see #hasId()
*/
boolean isDirect();
/**
* Returns true if this holder has an id.
*
* @return true if this holder has an id
* @see #isDirect()
*/
boolean hasId();
/**
* Returns the value of this holder.
*
* @return the value of this holder
* @throws IllegalArgumentException if this holder is not direct
* @see #isDirect()
*/
T value();
/**
* Returns the id of this holder, or -1 if this holder is direct.
*
* @return the id of this holder, or -1 if this holder is direct
* @see #hasId()
*/
int id();
/**
* Returns a new holder with the id rewritten using the given function, or self if this is a direct holder or the id did not change.
*
* @param rewriteFunction the function to rewrite the id
* @return a new holder with the id rewritten, or self
*/
default Holder<T> updateId(final Int2IntFunction rewriteFunction) {
return this.updateId(rewriteFunction, null);
}
/**
* Returns a new holder with the id rewritten using the given function, or self if this is a direct holder or the id did not change.
*
* @param rewriteFunction the function to rewrite the id
* @param ifMissing a supplier that provides a new holder if the id is missing (i.e. -1)
* @return a new holder with the id rewritten, or self
*/
Holder<T> updateId(Int2IntFunction rewriteFunction, Supplier<Holder<T>> ifMissing);
/**
* Returns a new holder with the value rewritten using the given function, or self if this is an id holder or the value did not change.
*
* @param rewriteFunction the function to rewrite the value
* @return a new holder with the value rewritten, or self
*/
Holder<T> updateValue(final Function<T, T> rewriteFunction);
}
@@ -0,0 +1,115 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import com.google.common.base.Preconditions;
import com.viaversion.nbt.tag.ListTag;
import com.viaversion.nbt.tag.StringTag;
import com.viaversion.nbt.tag.Tag;
import it.unimi.dsi.fastutil.ints.Int2IntFunction;
import java.util.function.ToIntFunction;
/**
* Set of ids that either holds a string tag key or an array of ids.
*/
public interface HolderSet {
/**
* Creates a new holder set for the given tag.
*
* @param tagKey the tag key, not including '#'
* @return a new holder set
*/
static HolderSet of(final String tagKey) {
Preconditions.checkNotNull(tagKey);
return new HolderSetImpl.Tag(tagKey);
}
/**
* Creates a new holder set for the given ids.
*
* @param ids the direct ids
* @return a new holder set
*/
static HolderSet of(final int[] ids) {
Preconditions.checkNotNull(ids);
return new HolderSetImpl.Ids(ids);
}
static HolderSet fromTag(final Tag tag, final ToIntFunction<String> mappingFunction) {
if (tag instanceof StringTag stringTag) {
if (stringTag.getValue().startsWith("#")) {
return HolderSet.of(stringTag.getValue().substring(1));
}
final int id = mappingFunction.applyAsInt(stringTag.getValue());
return HolderSet.of(new int[]{id});
} else if (tag instanceof ListTag<?> listTag) {
final int[] ids = new int[listTag.size()];
for (int i = 0; i < listTag.size(); i++) {
final String value = ((StringTag) listTag.get(i)).getValue();
ids[i] = mappingFunction.applyAsInt(value);
}
return HolderSet.of(ids);
}
throw new IllegalArgumentException();
}
/**
* Gets the tag key, not including '#'.
*
* @return the tag key without a '#'
* @see #hasTagKey()
*/
String tagKey();
/**
* Returns whether this holder set has a tag key.
*
* @return true if this holder set has a tag key, false if it has direct ids
*/
boolean hasTagKey();
/**
* Gets the direct ids.
*
* @return direct ids
* @see #hasIds()
*/
int[] ids();
/**
* Returns whether this holder set has direct ids.
*
* @return true if this holder set has direct ids, false if it has a tag key
*/
boolean hasIds();
/**
* Returns a new holder set with the ids rewritten.
*
* @param idRewriter the id rewriter
* @return a new holder set with the ids rewritten, or self if it has a tag key
*/
HolderSet rewrite(Int2IntFunction idRewriter);
}
@@ -0,0 +1,90 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import it.unimi.dsi.fastutil.ints.Int2IntFunction;
import java.util.Arrays;
final class HolderSetImpl {
record Tag(String tagKey) implements HolderSet {
@Override
public boolean hasTagKey() {
return true;
}
@Override
public int[] ids() {
throw new IllegalArgumentException("This holder set has a tag key");
}
@Override
public boolean hasIds() {
return false;
}
@Override
public HolderSet rewrite(final Int2IntFunction idRewriter) {
return this;
}
}
record Ids(int[] ids) implements HolderSet {
@Override
public boolean hasTagKey() {
return false;
}
@Override
public String tagKey() {
throw new IllegalArgumentException("This holder set has direct ids");
}
@Override
public boolean hasIds() {
return true;
}
@Override
public HolderSet rewrite(final Int2IntFunction idRewriter) {
// Filter out negative ids as they would come from missing VB mapping data. This happens especially
// with block ids which are not mapped and thus written as -1 so VV rewriters can cancel them nicely.
final int[] mappedIds = new int[ids.length];
int validCount = 0;
for (final int id : ids) {
final int mappedId = idRewriter.applyAsInt(id);
if (mappedId != -1) {
mappedIds[validCount++] = mappedId;
}
}
return new Ids(validCount == ids.length ? mappedIds : Arrays.copyOf(mappedIds, validCount));
}
@Override
public String toString() {
return "Ids{" +
"ids=" + Arrays.toString(ids) +
'}';
}
}
}
@@ -0,0 +1,70 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import com.google.common.base.Preconditions;
import it.unimi.dsi.fastutil.ints.Int2IntFunction;
import java.util.function.Function;
import java.util.function.Supplier;
record IdHolder<T>(int id) implements Holder<T> {
IdHolder {
Preconditions.checkArgument(id >= 0, "id cannot be negative");
}
@Override
public boolean isDirect() {
return false;
}
@Override
public boolean hasId() {
return true;
}
@Override
public T value() {
throw new IllegalArgumentException("Holder is not direct");
}
@Override
public Holder<T> updateId(final Int2IntFunction rewriteFunction, final Supplier<Holder<T>> ifMissing) {
final int rewrittenId = rewriteFunction.applyAsInt(id);
if (rewrittenId == id) {
return this;
}
if (rewrittenId == -1) {
if (ifMissing != null) {
return ifMissing.get();
}
throw new IllegalArgumentException("Received invalid id in updateId");
}
return Holder.of(rewrittenId);
}
@Override
public Holder<T> updateValue(final Function<T, T> rewriteFunction) {
return this;
}
}
@@ -0,0 +1,91 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import com.viaversion.nbt.tag.Tag;
import com.viaversion.viaversion.api.minecraft.codec.Ops;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.misc.HolderType;
import com.viaversion.viaversion.util.Key;
import io.netty.buffer.ByteBuf;
import org.checkerframework.checker.nullness.qual.Nullable;
public record PaintingVariant(int width, int height, String assetId, @Nullable Tag title, @Nullable Tag author) {
public PaintingVariant(final int width, final int height, final String assetId) {
this(width, height, assetId, null, null);
}
public static HolderType<PaintingVariant> TYPE1_21 = new HolderType<>() {
@Override
public PaintingVariant readDirect(final ByteBuf buffer) {
final int width = Types.VAR_INT.readPrimitive(buffer);
final int height = Types.VAR_INT.readPrimitive(buffer);
final String assetId = Types.STRING.read(buffer);
return new PaintingVariant(width, height, assetId);
}
@Override
public void writeDirect(final ByteBuf buffer, final PaintingVariant variant) {
Types.VAR_INT.writePrimitive(buffer, variant.width());
Types.VAR_INT.writePrimitive(buffer, variant.height());
Types.STRING.write(buffer, variant.assetId());
}
};
public static HolderType<PaintingVariant> TYPE1_21_2 = new HolderType<>() {
@Override
public PaintingVariant readDirect(final ByteBuf buffer) {
final int width = Types.VAR_INT.readPrimitive(buffer);
final int height = Types.VAR_INT.readPrimitive(buffer);
final String assetId = Types.STRING.read(buffer);
final Tag title = Types.TRUSTED_OPTIONAL_TAG.read(buffer);
final Tag author = Types.TRUSTED_OPTIONAL_TAG.read(buffer);
return new PaintingVariant(width, height, assetId, title, author);
}
@Override
public void writeDirect(final ByteBuf buffer, final PaintingVariant variant) {
Types.VAR_INT.writePrimitive(buffer, variant.width());
Types.VAR_INT.writePrimitive(buffer, variant.height());
Types.STRING.write(buffer, variant.assetId());
Types.TRUSTED_OPTIONAL_TAG.write(buffer, variant.title());
Types.TRUSTED_OPTIONAL_TAG.write(buffer, variant.author());
}
@Override
public void writeDirect(final Ops ops, final PaintingVariant value) {
// Unused, cannot be direct despite having a direct network codec
ops.writeMap(map -> map
.write("width", Types.INT, value.width())
.write("height", Types.INT, value.height())
.write("asset_id", Types.IDENTIFIER, Key.of(value.assetId()))
.writeOptional("title", Types.TRUSTED_TAG, value.title())
.writeOptional("author", Types.TRUSTED_TAG, value.author()));
}
@Override
protected Key identifier(final Ops ops, final int id) {
return ops.context().registryAccess().registryKey("painting_variant", id);
}
};
}
@@ -0,0 +1,135 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.util.Copyable;
import com.viaversion.viaversion.util.IdHolder;
import io.netty.buffer.ByteBuf;
import java.util.ArrayList;
import java.util.List;
public final class Particle implements IdHolder, Copyable {
private final List<ParticleData<?>> arguments = new ArrayList<>(4);
private int id;
public Particle(final int id) {
this.id = id;
}
@Override
public int id() {
return id;
}
public void setId(final int id) {
this.id = id;
}
public <T> ParticleData<T> getArgument(final int index) {
//noinspection unchecked
return (ParticleData<T>) arguments.get(index);
}
public <T> ParticleData<T> removeArgument(final int index) {
//noinspection unchecked
return (ParticleData<T>) arguments.remove(index);
}
public List<ParticleData<?>> getArguments() {
return arguments;
}
public <T> void add(final Type<T> type, final T value) {
arguments.add(new ParticleData<>(type, value));
}
public <T> void add(final int index, final Type<T> type, final T value) {
arguments.add(index, new ParticleData<>(type, value));
}
public <T> void set(final int index, final Type<T> type, final T value) {
arguments.set(index, new ParticleData<>(type, value));
}
@Override
public Particle copy() {
final Particle particle = new Particle(id);
for (ParticleData<?> argument : arguments) {
particle.arguments.add(argument.copy());
}
return particle;
}
@Override
public String toString() {
return "Particle{" +
"arguments=" + arguments +
", id=" + id +
'}';
}
public static final class ParticleData<T> implements Copyable {
private final Type<T> type;
private T value;
public ParticleData(final Type<T> type, final T value) {
this.type = type;
this.value = value;
}
public Type<T> getType() {
return type;
}
public T getValue() {
return value;
}
public void setValue(final T value) {
this.value = value;
}
public void write(final ByteBuf buf) {
type.write(buf, value);
}
public void write(final PacketWrapper wrapper) {
wrapper.write(type, value);
}
@Override
public ParticleData<T> copy() {
return new ParticleData<>(type, Copyable.copy(value));
}
@Override
public String toString() {
return "ParticleData{" +
"type=" + type +
", value=" + value +
'}';
}
}
}
@@ -0,0 +1,28 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import java.util.UUID;
public record PlayerMessageSignature(UUID uuid, byte[] signatureBytes) {
}
@@ -0,0 +1,26 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
public record ProfileKey(long expiresAt, byte[] publicKey, byte[] keySignature) {
}
@@ -0,0 +1,26 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
public record Quaternion(float x, float y, float z, float w) {
}
@@ -1,7 +1,6 @@
/*
* This file is part of adventure, licensed under the MIT License.
*
* Copyright (c) 2017-2020 KyoriPowered
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -21,28 +20,26 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package us.myles.ViaVersion.api.minecraft.nbt;
package com.viaversion.viaversion.api.minecraft;
import java.io.IOException;
import com.viaversion.nbt.tag.Tag;
import com.viaversion.viaversion.util.Copyable;
import org.checkerframework.checker.nullness.qual.Nullable;
/**
* An exception thrown when parsing a string tag
* Represents an entry in a registry.
*
* @param key key of the registry entry
* @param tag data of the registry entry, or null if the client should use its default
*/
/* package */ class StringTagParseException extends IOException {
private static final long serialVersionUID = -3001637554903912905L;
private final CharSequence buffer;
private final int position;
public record RegistryEntry(String key, @Nullable Tag tag) implements Copyable {
public StringTagParseException(final String message, final CharSequence buffer, final int position) {
super(message);
this.buffer = buffer;
this.position = position;
public RegistryEntry withKey(final String key) {
return new RegistryEntry(key, tag != null ? tag.copy() : null);
}
// TODO: Provide more specific position information
@Override
public String getMessage() {
return super.getMessage() + "(at position " + this.position + ")";
public RegistryEntry copy() {
return new RegistryEntry(key, tag != null ? tag.copy() : null);
}
}
@@ -0,0 +1,42 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import com.viaversion.viaversion.api.data.MappingData.MappingType;
import com.viaversion.viaversion.util.Key;
/**
* Holds a key for a registry.
* Depending on the context, the key may be used to get registry entries from either synchronized or hardcoded registries.
*
* @see MappingType
* @see #of(String)
*/
public interface RegistryKey {
Key key();
static RegistryKey of(final String key) {
return new SimpleRegistryKey(Key.of(key));
}
}
@@ -0,0 +1,72 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import com.viaversion.viaversion.util.Key;
import java.util.HashMap;
import java.util.Map;
import org.checkerframework.checker.nullness.qual.Nullable;
public enum RegistryType implements RegistryKey {
BLOCK("block"),
ITEM("item"),
FLUID("fluid"),
ENTITY("entity_type"),
GAME_EVENT("game_event"),
ENCHANTMENT("enchantment"),
DAMAGE_TYPE("damage_type"),
BANNER_PATTERN("banner_pattern");
private static final Map<String, RegistryType> MAP = new HashMap<>();
private static final RegistryType[] VALUES = values();
static {
for (RegistryType type : getValues()) {
MAP.put(type.identifier, type);
}
}
public static RegistryType[] getValues() {
return VALUES;
}
public static @Nullable RegistryType getByKey(String identifier) {
return MAP.get(identifier);
}
private final String identifier;
RegistryType(final String identifier) {
this.identifier = identifier;
}
public String identifier() {
return identifier;
}
@Override
public Key key() {
return Key.of(identifier);
}
}
@@ -0,0 +1,37 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import org.checkerframework.checker.nullness.qual.Nullable;
/**
* Profile that can be either dynamically filled by the client or is already static.
* The additional fields are optional overrides.
*/
public record ResolvableProfile(GameProfile profile, @Nullable String bodyTexture, @Nullable String capeTexture,
@Nullable String elytraTexture, @Nullable Integer modelType) {
public ResolvableProfile(final GameProfile profile) {
this(profile, null, null, null, null);
}
}
@@ -0,0 +1,33 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import com.viaversion.viaversion.util.Key;
record SimpleRegistryKey(Key key) implements RegistryKey {
@Override
public String toString() {
return key.toString();
}
}
@@ -0,0 +1,42 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import it.unimi.dsi.fastutil.ints.Int2IntFunction;
import org.checkerframework.checker.nullness.qual.Nullable;
public record SoundEvent(String identifier, @Nullable Float fixedRange) {
private static final Holder<SoundEvent> UNKNOWN = Holder.of(new SoundEvent("viaversion:unknown", 0F));
public SoundEvent withIdentifier(final String identifier) {
return new SoundEvent(identifier, this.fixedRange);
}
public static @Nullable Holder<SoundEvent> rewriteHolder(@Nullable final Holder<SoundEvent> holder, final Int2IntFunction soundRewriteFunction) {
if (holder == null) {
return null;
}
return holder.updateId(soundRewriteFunction, () -> UNKNOWN);
}
}
@@ -0,0 +1,44 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import java.util.Arrays;
public record TagData(String identifier, int[] entries) {
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final TagData tagData = (TagData) o;
if (!identifier.equals(tagData.identifier)) return false;
return Arrays.equals(entries, tagData.entries);
}
@Override
public int hashCode() {
int result = identifier.hashCode();
result = 31 * result + Arrays.hashCode(entries);
return result;
}
}
@@ -0,0 +1,56 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2026 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import it.unimi.dsi.fastutil.ints.Int2IntFunction;
import java.util.function.Function;
import java.util.function.Supplier;
record ValueHolder<T>(T value) implements Holder<T> {
@Override
public boolean isDirect() {
return true;
}
@Override
public boolean hasId() {
return false;
}
@Override
public int id() {
return -1;
}
@Override
public Holder<T> updateId(final Int2IntFunction rewriteFunction, final Supplier<Holder<T>> ifMissing) {
return this;
}
@Override
public Holder<T> updateValue(final Function<T, T> rewriteFunction) {
final T rewrittenValue = rewriteFunction.apply(value);
return rewrittenValue != value ? Holder.of(rewrittenValue) : this;
}
}
Loaded 100 of 1706 files, more files were not shown because too many files have changed in this diff. Show more