Compare commits

...
156 Commits
Author SHA1 Message Date
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 04e572fa30 Hotfix receiving level screen not closing on Velocity
Closes #3630
2024-03-01 12:38:54 +01:00
EnZaXD dafce79374 Tidy up fabric.mod.json file of fabric platform (#3728) 2024-02-29 11:11:10 +01:00
EnZaXD fe0d30df78 paste.gg -> mclo.gs (#3706) 2024-02-21 16:13:15 +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
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 87d444a017 Only rewrite pages in written book 2024-01-31 22:24:17 +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
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
Kichura cef6fb35b1 Update JDK to 17, setup-java to v4 (#3660) 2024-01-20 21:18:42 +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 0392992173 Fix metadata regression
Fixes #3645
2024-01-12 15:58:49 +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 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 bae3d8ec8a Use viafied mcstructs 2023-12-29 16:50:21 +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
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
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
802 changed files with 8025 additions and 7365 deletions

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
[*]
charset = utf-8
indent_size = 4
indent_style = space
insert_final_newline = false
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
+2
View File
@@ -0,0 +1,2 @@
github: kennytv
patreon: kennytv
+3 -3
View File
@@ -23,11 +23,11 @@ body:
attributes:
label: Console Error
description: |
If you encounter warnings/errors in your console, **paste them with https://paste.gg/ and put the paste link here**.
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.
value: |
```
Put the paste.gg link or text here.
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:
@@ -71,7 +71,7 @@ body:
attributes:
label: Additional Server Info
description: |
Do you use a proxy (eg. BungeeCord)? What software do you use and what plugins?
Do you use a proxy (e.g. BungeeCord)? What software do you use and what plugins?
placeholder: |
Example: "I also use BungeeCord with the following plugins: x, y, z"
validations:
+3 -3
View File
@@ -14,11 +14,11 @@ jobs:
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 11
uses: actions/setup-java@v3
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
java-version: 17
check-latest: true
- name: Build with Gradle
run: ./gradlew build
+1 -1
View File
@@ -15,7 +15,7 @@ jobs:
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
+1 -1
View File
@@ -1,6 +1,6 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion&#10;Copyright (C) &amp;#36;originalComment.match(&quot;Copyright \(C\) (\d+)&quot;, 1, &quot;-&quot;)&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="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>
+1 -1
View File
@@ -1,6 +1,6 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion&#10;Copyright (C) &amp;#36;originalComment.match(&quot;Copyright \(C\) (\d+)&quot;, 1, &quot;-&quot;)&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="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>
+1 -1
View File
@@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="ViaVersion-API" pattern="src[viaversion-parent.viaversion-api*]:*..*&amp;&amp;!src[viaversion-parent.viaversion-api.main]:com.viaversion.viaversion.api.minecraft.nbt.*" />
<scope name="ViaVersion-API" pattern="src[viaversion-parent.viaversion-api*]:*..*" />
</component>
-25
View File
@@ -1,25 +0,0 @@
plugins {
id("com.github.johnrengelman.shadow")
}
// Shade and relocate adventure in an extra module, so that common/the rest can directly depend on a
// relocated adventure without breaking native platform's adventure usage with project wide relocation
tasks {
shadowJar {
relocate("net.kyori", "com.viaversion.viaversion.libs.kyori")
}
build {
dependsOn(shadowJar)
}
}
dependencies {
api(libs.bundles.adventure) {
exclude("org.checkerframework")
exclude("net.kyori", "adventure-api")
exclude("net.kyori", "adventure-bom")
exclude("com.google.code.gson", "gson")
}
}
publishShadowJar()
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -88,6 +88,7 @@ public class ProtocolVersion {
public static final ProtocolVersion v1_19_4 = register(762, "1.19.4");
public static final ProtocolVersion v1_20 = register(763, "1.20/1.20.1", new VersionRange("1.20", 0, 1));
public static final ProtocolVersion v1_20_2 = register(764, "1.20.2");
public static final ProtocolVersion v1_20_3 = register(765, "1.20.3");
public static final ProtocolVersion unknown = register(-1, "UNKNOWN");
public static ProtocolVersion register(int version, String name) {
+7 -5
View File
@@ -1,7 +1,6 @@
plugins {
id("net.kyori.blossom")
id("org.jetbrains.gradle.plugin.idea-ext")
id("via.shadow-conventions")
}
sourceSets {
@@ -16,14 +15,15 @@ sourceSets {
}
dependencies {
api(projects.adventure) {
targetConfiguration = "shadow"
}
api(libs.fastutil)
api(libs.flare)
api(libs.flareFastutil)
api(libs.openNBT)
api(libs.vianbt)
api(libs.gson)
implementation(rootProject.libs.text) {
exclude("com.google.code.gson", "gson")
exclude("com.viaversion", "nbt")
}
compileOnlyApi(libs.snakeYaml)
compileOnlyApi(libs.netty)
@@ -34,3 +34,5 @@ dependencies {
java {
withJavadocJar()
}
publishShadowJar()
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -63,7 +63,7 @@ public interface ViaAPI<T> {
* @return API version incremented with meaningful API changes
*/
default int apiVersion() {
return 20;
return 23;
}
/**
@@ -117,7 +117,7 @@ public interface ViaAPI<T> {
* 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
* @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);
@@ -126,7 +126,7 @@ public interface ViaAPI<T> {
* 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
* @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);
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -23,6 +23,7 @@
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;
@@ -91,6 +92,13 @@ public interface ViaManager {
*/
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.
*
@@ -138,4 +146,5 @@ public interface ViaManager {
* @return whether the manager has been initialized
*/
boolean isInitialized();
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -28,7 +28,7 @@ public interface ViaCommandSender {
/**
* Check if the sender has a permission.
*
* @param permission Permission string eg. viaversion.admin
* @param permission Permission string e.g. viaversion.admin
* @return True if the sender has the permission
*/
boolean hasPermission(String permission);
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -58,7 +58,7 @@ public abstract class ViaSubCommand {
* @return The permission required to use the commands
*/
public String permission() {
return "viaversion.admin";
return "viaversion.admin." + name();
}
/**
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -32,7 +32,7 @@ public interface ViaVersionCommand {
* @param command Your own SubCommand instance to handle it.
* @throws Exception throws an exception when the subcommand already exists or if it's not valid, example: spacee
*/
void registerSubCommand(ViaSubCommand command) throws Exception;
void registerSubCommand(ViaSubCommand command);
/**
* Check if a subcommand is registered.
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -20,23 +20,34 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.type.types.minecraft;
package com.viaversion.viaversion.api.configuration;
import com.viaversion.viaversion.api.minecraft.chunks.Chunk;
import com.viaversion.viaversion.api.type.Type;
import java.util.Map;
public abstract class BaseChunkBulkType extends Type<Chunk[]> {
public interface Config {
protected BaseChunkBulkType() {
super(Chunk[].class);
}
/**
* Reloads the config
*/
void reload();
protected BaseChunkBulkType(String typeName) {
super(typeName, Chunk[].class);
}
/**
* Saves the config
*/
void save();
@Override
public Class<? extends Type> getBaseClass() {
return BaseChunkBulkType.class;
}
/**
* 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();
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -22,32 +22,26 @@
*/
package com.viaversion.viaversion.api.configuration;
import java.util.Map;
import java.util.Collection;
public interface ConfigurationProvider {
/**
* Sets the specified path to the given value.
* Registers a config to be saved or reloaded when {@link #reloadConfigs()} is called.
*
* @param path Path of the object to set.
* @param value New value to set the path to
* @param config the config to register
*/
void set(String path, Object value);
void register(Config config);
/**
* Saves the config
*/
void saveConfig();
/**
* Reloads the config
*/
void reloadConfig();
/**
* Get all the configuration values
* Returns all registered configs.
*
* @return Map with key-values
* @return unmodifiable collection of all registered configs
*/
Map<String, Object> getValues();
Collection<Config> configs();
/**
* Reloads the configuration files.
*/
void reloadConfigs();
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -30,7 +30,7 @@ import com.viaversion.viaversion.api.protocol.version.BlockedProtocolVersions;
import it.unimi.dsi.fastutil.ints.IntSet;
import org.checkerframework.checker.nullness.qual.Nullable;
public interface ViaVersionConfig {
public interface ViaVersionConfig extends Config {
/**
* Get if the plugin should check for updates
@@ -87,7 +87,7 @@ public interface ViaVersionConfig {
* <p>
* This option requires {@link #isShowShieldWhenSwordInHand()} to be disabled
*
* @return {@code true} if non delayed shield blocking is enabled.
* @return {@code true} if non-delayed shield blocking is enabled.
*/
boolean isNoDelayShieldBlocking();
@@ -126,7 +126,7 @@ public interface ViaVersionConfig {
* 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
* @return true if boss bar anti-flickering is enabled
*/
boolean isBossbarAntiflicker();
@@ -384,7 +384,7 @@ public interface ViaVersionConfig {
boolean isTruncate1_14Books();
/**
* Handles left handed info by using unused bit 7 on Client Settings packet
* Handles left-handed info by using unused bit 7 on Client Settings packet
*
* @return true if enabled
*/
@@ -443,16 +443,24 @@ public interface ViaVersionConfig {
/***
* Get the world names that should be returned for each Vanilla dimension.
* Note that this can be overriden per-user by using {@link UserConnection#put(StorableObject)} with
* 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();
@Nullable String chatTypeFormat(String translationKey);
/**
* 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();
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -65,7 +65,7 @@ public interface ConnectionManager {
/**
* Returns the UUID from the frontend connection to this proxy server
* Returns null when there isn't a server or this connection isn't frontend or it doesn't have an id
* Returns null when there isn't a server or this connection isn't frontend, or it doesn't have an id
* When ViaVersion is reloaded, this method may not return some players.
* May not return ProtocolSupport players.
* <p>
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -29,11 +29,6 @@ import org.checkerframework.checker.nullness.qual.Nullable;
*/
public interface FullMappings extends Mappings {
@Deprecated
default Mappings mappings() {
return this;
}
/**
* Returns the unmapped integer id for the given identifier, or -1 if not found.
*
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -52,11 +52,6 @@ public class FullMappingsBase implements FullMappings {
this.mappings = mappings;
}
@Override
public Mappings mappings() {
return mappings;
}
@Override
public int id(final String identifier) {
return stringToId.getInt(Key.stripMinecraftNamespace(identifier));
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -37,11 +37,6 @@ public class IntArrayMappings implements Mappings {
return new IntArrayMappings(mappings, mappedIds);
}
@Deprecated
public static Builder<IntArrayMappings> builder() {
return Mappings.builder(IntArrayMappings::new);
}
@Override
public int getNewId(int id) {
return id >= 0 && id < mappings.length ? mappings[id] : -1;
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -22,12 +22,13 @@
*/
package com.viaversion.viaversion.api.data;
import com.github.steveice10.opennbt.NBTIO;
import com.github.steveice10.opennbt.tag.builtin.ByteTag;
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
import com.github.steveice10.opennbt.tag.builtin.IntArrayTag;
import com.github.steveice10.opennbt.tag.builtin.IntTag;
import com.github.steveice10.opennbt.tag.builtin.ListTag;
import com.github.steveice10.opennbt.tag.io.NBTIO;
import com.github.steveice10.opennbt.tag.io.TagReader;
import com.google.common.annotations.Beta;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
@@ -51,18 +52,14 @@ import org.checkerframework.checker.nullness.qual.Nullable;
public final class MappingDataLoader {
private static final Map<String, CompoundTag> MAPPINGS_CACHE = new HashMap<>();
private static final TagReader<CompoundTag> MAPPINGS_READER = NBTIO.reader(CompoundTag.class).named();
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 static final Map<String, CompoundTag> MAPPINGS_CACHE = new HashMap<>();
private static boolean cacheValid = true;
@Deprecated/*(forRemoval = true)*/
public static void enableMappingsCache() {
// Always enabled
}
public static void clearCache() {
MAPPINGS_CACHE.clear();
cacheValid = false;
@@ -131,14 +128,14 @@ public final class MappingDataLoader {
return loadNBT(name, false);
}
private static @Nullable CompoundTag loadNBTFromFile(final String name) {
public static @Nullable CompoundTag loadNBTFromFile(final String name) {
final InputStream resource = getResource(name);
if (resource == null) {
return null;
}
try (final InputStream stream = resource) {
return NBTIO.readTag(stream);
return MAPPINGS_READER.read(stream);
} catch (final IOException e) {
throw new RuntimeException(e);
}
@@ -248,56 +245,6 @@ public final class MappingDataLoader {
);
}
@Deprecated
public static void mapIdentifiers(final int[] output, final JsonObject unmappedIdentifiers, final JsonObject mappedIdentifiers, @Nullable final JsonObject diffIdentifiers, final boolean warnOnMissing) {
final Object2IntMap<String> newIdentifierMap = MappingDataLoader.indexedObjectToMap(mappedIdentifiers);
for (final Map.Entry<String, JsonElement> entry : unmappedIdentifiers.entrySet()) {
final int id = Integer.parseInt(entry.getKey());
final int mappedId = mapIdentifierEntry(id, entry.getValue().getAsString(), newIdentifierMap, diffIdentifiers, warnOnMissing);
if (mappedId != -1) {
output[id] = mappedId;
}
}
}
private static int mapIdentifierEntry(final int id, final String val, final Object2IntMap<String> mappedIdentifiers, @Nullable final JsonObject diffIdentifiers, final boolean warnOnMissing) {
int mappedId = mappedIdentifiers.getInt(val);
if (mappedId == -1) {
// Search in diff mappings
if (diffIdentifiers != null) {
JsonElement diffElement = diffIdentifiers.get(val);
if (diffElement != null || (diffElement = diffIdentifiers.get(Integer.toString(id))) != null) {
final String mappedName = diffElement.getAsString();
if (mappedName.isEmpty()) {
return -1; // "empty" remaps without warnings
}
mappedId = mappedIdentifiers.getInt(mappedName);
}
}
if (mappedId == -1) {
if (warnOnMissing && !Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) {
Via.getPlatform().getLogger().warning("No key for " + val + " :( ");
}
return -1;
}
}
return mappedId;
}
@Deprecated
public static void mapIdentifiers(final int[] output, final JsonArray unmappedIdentifiers, final JsonArray mappedIdentifiers, @Nullable final JsonObject diffIdentifiers, final boolean warnOnMissing) {
final Object2IntMap<String> newIdentifierMap = MappingDataLoader.arrayToMap(mappedIdentifiers);
for (int id = 0; id < unmappedIdentifiers.size(); id++) {
final JsonElement unmappedIdentifier = unmappedIdentifiers.get(id);
final int mappedId = mapIdentifierEntry(id, unmappedIdentifier.getAsString(), newIdentifierMap, diffIdentifiers, warnOnMissing);
if (mappedId != -1) {
output[id] = mappedId;
}
}
}
/**
* Returns a map of the object entries hashed by their id value.
*
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -22,11 +22,6 @@
*/
package com.viaversion.viaversion.api.data;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.util.Arrays;
public interface Mappings {
/**
@@ -90,122 +85,9 @@ public interface Mappings {
*/
Mappings inverse();
static <T extends Mappings> Builder<T> builder(final MappingsSupplier<T> supplier) {
return new Builder<>(supplier);
}
@FunctionalInterface
interface MappingsSupplier<T extends Mappings> {
T supply(int[] mappings, int mappedIds);
}
@Deprecated
class Builder<T extends Mappings> {
protected final MappingsSupplier<T> supplier;
protected JsonElement unmapped;
protected JsonElement mapped;
protected JsonObject diffMappings;
protected int mappedSize = -1;
protected int size = -1;
protected boolean warnOnMissing = true;
protected Builder(final MappingsSupplier<T> supplier) {
this.supplier = supplier;
}
/**
* Sets a custom entry size different to the size of the unmapped collection.
*
* @param size custom entry size
* @return self
*/
public Builder<T> customEntrySize(final int size) {
this.size = size;
return this;
}
/**
* Sets a custom entry mapped ids count different to the size of the mapped collection.
*
* @param size custom mapped id count
* @return self
*/
public Builder<T> customMappedSize(final int size) {
this.mappedSize = size;
return this;
}
/**
* Sets whether warnings should be logged for missing mapped ids.
*
* @param warnOnMissing whether warnings should be logged for missing mapped ids
* @return self
*/
public Builder<T> warnOnMissing(final boolean warnOnMissing) {
this.warnOnMissing = warnOnMissing;
return this;
}
public Builder<T> unmapped(final JsonArray unmappedArray) {
this.unmapped = unmappedArray;
return this;
}
public Builder<T> unmapped(final JsonObject unmappedObject) {
this.unmapped = unmappedObject;
return this;
}
public Builder<T> mapped(final JsonArray mappedArray) {
this.mapped = mappedArray;
return this;
}
public Builder<T> mapped(final JsonObject mappedObject) {
this.mapped = mappedObject;
return this;
}
public Builder<T> diffMappings(final JsonObject diffMappings) {
this.diffMappings = diffMappings;
return this;
}
public T build() {
final int size = this.size != -1 ? this.size : size(unmapped);
final int mappedSize = this.mappedSize != -1 ? this.mappedSize : size(mapped);
final int[] mappings = new int[size];
Arrays.fill(mappings, -1);
// Do conversion if one is an array and the other an object, otherwise directly map
if (unmapped.isJsonArray()) {
if (mapped.isJsonObject()) {
MappingDataLoader.mapIdentifiers(mappings, toJsonObject(unmapped.getAsJsonArray()), mapped.getAsJsonObject(), diffMappings, warnOnMissing);
} else {
MappingDataLoader.mapIdentifiers(mappings, unmapped.getAsJsonArray(), mapped.getAsJsonArray(), diffMappings, warnOnMissing);
}
} else if (mapped.isJsonArray()) {
MappingDataLoader.mapIdentifiers(mappings, unmapped.getAsJsonObject(), toJsonObject(mapped.getAsJsonArray()), diffMappings, warnOnMissing);
} else {
MappingDataLoader.mapIdentifiers(mappings, unmapped.getAsJsonObject(), mapped.getAsJsonObject(), diffMappings, warnOnMissing);
}
return supplier.supply(mappings, mappedSize);
}
protected int size(final JsonElement element) {
return element.isJsonObject() ? element.getAsJsonObject().size() : element.getAsJsonArray().size();
}
protected JsonObject toJsonObject(final JsonArray array) {
final JsonObject object = new JsonObject();
for (int i = 0; i < array.size(); i++) {
final JsonElement element = array.get(i);
object.add(Integer.toString(i), element);
}
return object;
}
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -55,19 +55,4 @@ public class ParticleMappings extends FullMappingsBase {
public boolean isItemParticle(final int id) {
return itemParticleIds.contains(id);
}
@Deprecated/*(forRemoval = true)*/
public int getBlockId() {
return id("block");
}
@Deprecated/*(forRemoval = true)*/
public int getFallingDustId() {
return id("falling_dust");
}
@Deprecated/*(forRemoval = true)*/
public int getItemId() {
return id("item");
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -87,7 +87,7 @@ public interface EntityTracker {
*
* @param id entity id
* @return stored entity data if an entity with the id is tracked, else null
* @throws IllegalArgumentException if entitiy data storage has not been enabled via the implementation
* @throws IllegalArgumentException if entity data storage has not been enabled via the implementation
*/
@Nullable StoredEntityData entityData(int id);
@@ -96,7 +96,7 @@ public interface EntityTracker {
*
* @param id entity id
* @return stored entity data if it has previously been initialized by {@link #entityData(int)}
* @throws IllegalArgumentException if entitiy data storage has not been enabled via the implementation
* @throws IllegalArgumentException if entity data storage has not been enabled via the implementation
*/
@Nullable StoredEntityData entityDataIfPresent(int id);
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -23,9 +23,11 @@
package com.viaversion.viaversion.api.debug;
import com.google.common.annotations.Beta;
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;
@Beta
public interface DebugHandler {
@@ -102,4 +104,16 @@ public interface DebugHandler {
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().isSuppressConversionWarnings() || enabled()) {
Via.getPlatform().getLogger().log(Level.SEVERE, error, t);
}
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -66,7 +66,7 @@ public interface BossBar {
BossColor getColor();
/**
* Yay colors!
* Yay, colors!
*
* @param color Whatever color you want!
* @return The BossBar object
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -20,25 +20,29 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.type.types.minecraft;
package com.viaversion.viaversion.api.minecraft;
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
import com.viaversion.viaversion.api.type.Type;
import io.netty.buffer.ByteBuf;
import com.viaversion.viaversion.api.connection.StorableObject;
import org.checkerframework.checker.nullness.qual.Nullable;
public class NamelessNBTType extends Type<CompoundTag> {
/**
* Stored up until 1.14 to be used in chunk sending.
*/
public class ClientWorld implements StorableObject {
private Environment environment;
public NamelessNBTType() {
super(CompoundTag.class);
public ClientWorld() {
}
@Override
public CompoundTag read(final ByteBuf buffer) throws Exception {
return NBTType.read(buffer, false);
public ClientWorld(final Environment environment) {
this.environment = environment;
}
@Override
public void write(final ByteBuf buffer, final CompoundTag tag) throws Exception {
NBTType.write(buffer, tag, null);
public @Nullable Environment getEnvironment() {
return environment;
}
public void setEnvironment(final int environmentId) {
this.environment = Environment.getEnvironmentById(environmentId);
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -20,17 +20,19 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.type.types;
package com.viaversion.viaversion.api.minecraft;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.type.Type;
import io.netty.buffer.ByteBuf;
import java.util.ArrayList;
import java.util.List;
public class Particle {
private List<ParticleData> arguments = new ArrayList<>(4);
public final class Particle {
private final List<ParticleData<?>> arguments = new ArrayList<>(4);
private int id;
public Particle(int id) {
public Particle(final int id) {
this.id = id;
}
@@ -38,50 +40,59 @@ public class Particle {
return id;
}
public void setId(int id) {
public void setId(final int id) {
this.id = id;
}
public List<ParticleData> getArguments() {
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;
}
@Deprecated/*(forRemoval = true)*/
public void setArguments(List<ParticleData> arguments) {
this.arguments = arguments;
public <T> void add(final Type<T> type, final T value) {
arguments.add(new ParticleData<>(type, value));
}
public <T> void add(Type<T> type, 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 static class ParticleData {
private Type type;
private Object value;
public static final class ParticleData<T> {
private final Type<T> type;
private T value;
public ParticleData(Type type, Object value) {
public ParticleData(final Type<T> type, final T value) {
this.type = type;
this.value = value;
}
public Type getType() {
public Type<T> getType() {
return type;
}
public void setType(Type type) {
this.type = type;
}
public Object getValue() {
public T getValue() {
return value;
}
public <T> T get() {
return (T) value;
public void setValue(final T value) {
this.value = value;
}
public void setValue(Object value) {
this.value = value;
public void write(final ByteBuf buf) throws Exception {
type.write(buf, value);
}
public void write(final PacketWrapper wrapper) {
wrapper.write(type, value);
}
@Override
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -57,11 +57,6 @@ public enum RegistryType {
this.resourceLocation = resourceLocation;
}
@Deprecated/*(forRemoval = true)*/
public String getResourceLocation() {
return resourceLocation;
}
public String resourceLocation() {
return resourceLocation;
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -63,16 +63,6 @@ public interface EntityType {
*/
boolean isAbstractType();
@Deprecated/*(forRemoval = true)*/
default boolean is(EntityType... types) {
for (EntityType type : types) {
if (this == type) {
return true;
}
}
return false;
}
default boolean is(EntityType type) {
return this == type;
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -28,7 +28,7 @@ import java.util.Map;
import java.util.Optional;
// 1.10 Entity / Object ids
public class Entity1_10Types {
public class EntityTypes1_10 {
public static EntityType getTypeFromId(int typeID, boolean isObject) {
Optional<EntityType> type;
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -28,7 +28,7 @@ import java.util.Map;
import java.util.Optional;
// 1.11 Entity / Object ids
public class Entity1_11Types {
public class EntityTypes1_11 {
public static EntityType getTypeFromId(int typeID, boolean isObject) {
Optional<EntityType> type;
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -29,7 +29,7 @@ import java.util.Map;
import java.util.Optional;
// 1.12 Entity / Object taken from https://github.com/Matsv/ViaBackwards/blob/master/core/src/main/java/nl/matsv/viabackwards/api/entities/types/EntityType1_12.java
public class Entity1_12Types {
public class EntityTypes1_12 {
public static EntityType getTypeFromId(int typeID, boolean isObject) {
Optional<EntityType> type;
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -27,7 +27,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
public class Entity1_13Types {
public class EntityTypes1_13 {
public static EntityType getTypeFromId(int typeID, boolean isObject) {
Optional<EntityType> type;
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -24,7 +24,7 @@ package com.viaversion.viaversion.api.minecraft.entities;
import com.viaversion.viaversion.util.EntityTypeUtil;
public enum Entity1_14Types implements EntityType {
public enum EntityTypes1_14 implements EntityType {
ENTITY(-1),
@@ -204,12 +204,12 @@ public enum Entity1_14Types implements EntityType {
private final int id;
private final EntityType parent;
Entity1_14Types(int id) {
EntityTypes1_14(int id) {
this.id = id;
this.parent = null;
}
Entity1_14Types(int id, EntityType parent) {
EntityTypes1_14(int id, EntityType parent) {
this.id = id;
this.parent = parent;
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -24,7 +24,7 @@ package com.viaversion.viaversion.api.minecraft.entities;
import com.viaversion.viaversion.util.EntityTypeUtil;
public enum Entity1_15Types implements EntityType {
public enum EntityTypes1_15 implements EntityType {
ENTITY(-1),
@@ -206,12 +206,12 @@ public enum Entity1_15Types implements EntityType {
private final int id;
private final EntityType parent;
Entity1_15Types(int id) {
EntityTypes1_15(int id) {
this.id = id;
this.parent = null;
}
Entity1_15Types(int id, EntityType parent) {
EntityTypes1_15(int id, EntityType parent) {
this.id = id;
this.parent = parent;
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -24,7 +24,7 @@ package com.viaversion.viaversion.api.minecraft.entities;
import com.viaversion.viaversion.util.EntityTypeUtil;
public enum Entity1_16Types implements EntityType {
public enum EntityTypes1_16 implements EntityType {
ENTITY(-1),
@@ -211,12 +211,12 @@ public enum Entity1_16Types implements EntityType {
private final int id;
private final EntityType parent;
Entity1_16Types(int id) {
EntityTypes1_16(int id) {
this.id = id;
this.parent = null;
}
Entity1_16Types(int id, EntityType parent) {
EntityTypes1_16(int id, EntityType parent) {
this.id = id;
this.parent = parent;
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -24,7 +24,7 @@ package com.viaversion.viaversion.api.minecraft.entities;
import com.viaversion.viaversion.util.EntityTypeUtil;
public enum Entity1_16_2Types implements EntityType {
public enum EntityTypes1_16_2 implements EntityType {
ENTITY(-1),
@@ -215,12 +215,12 @@ public enum Entity1_16_2Types implements EntityType {
private final int id;
private final EntityType parent;
Entity1_16_2Types(int id) {
EntityTypes1_16_2(int id) {
this.id = id;
this.parent = null;
}
Entity1_16_2Types(int id, EntityType parent) {
EntityTypes1_16_2(int id, EntityType parent) {
this.id = id;
this.parent = parent;
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2023 ViaVersion and contributors
* Copyright (C) 2016-2024 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
@@ -24,7 +24,7 @@ package com.viaversion.viaversion.api.minecraft.entities;
import com.viaversion.viaversion.util.EntityTypeUtil;
public enum Entity1_17Types implements EntityType {
public enum EntityTypes1_17 implements EntityType {
ENTITY(-1),
@@ -220,12 +220,12 @@ public enum Entity1_17Types implements EntityType {
private final int id;
private final EntityType parent;
Entity1_17Types(int id) {
EntityTypes1_17(int id) {
this.id = id;
this.parent = null;
}
Entity1_17Types(int id, EntityType parent) {
EntityTypes1_17(int id, EntityType parent) {
this.id = id;
this.parent = parent;
}
Loaded 100 of 802 files, more files were not shown because too many files have changed in this diff. Show more