Compare commits

...

516 Commits

Author SHA1 Message Date
Kichura
67d33c6985
Update ViaVersion to 5.0.2-SNAPSHOT (#347)
* Update ViaVersion to 5.0.1.

* Replace 5.0.1 with 5.0.2-SNAPSHOT.
2024-06-25 23:45:26 +02:00
FlorianMichael
9871d1f745
Fixup chat messages on 1.21 as well 2024-06-18 00:05:41 +02:00
Kichura
b0a68be851
Upstream deps, Set loader to 0.15.11, Via 5.0.1-SNAPSHOT. (#345) 2024-06-17 19:11:10 +02:00
FlorianMichael
127e7ed9e2
Merge branch 'refs/heads/dev' 2024-06-16 18:21:48 +02:00
EnZaXD
a29320acf2
Add 1.21 support (#342) 2024-06-16 18:21:04 +02:00
FlorianMichael
113a6e354a
Fixup command execution on 1.20.6+
Closes https://github.com/ViaVersion/ViaFabric/issues/340
2024-06-15 14:46:34 +02:00
creeper123123321
b0de2d8a0b update gradle 2024-06-14 10:29:53 -03:00
FlorianMichael
880a64c6c1
Add note for J8 jars 2024-06-11 23:52:19 +02:00
FlorianMichael
7ebc4f4cb5
Slightly improve setting description 2024-06-11 23:46:04 +02:00
FlorianMichael
cb0d2aea88
Use HandlerNames class for netty injection in 1.20.6 2024-06-11 23:41:36 +02:00
EnZaXD
2c47fabcd5
Add setting to ignore Fabric registry sync errors (#341)
* Add setting to ignore Fabric registry sync errors

* Mark as remap = false

* Backport registry error setting to MC 1.20.4 as well
2024-06-11 23:36:46 +02:00
FlorianMichael
00c4899f3c
Remove bungee options from FabricViaConfig 2024-06-05 02:10:55 +02:00
Kichura
617675302c
[ci skip] BungeeCord->Velocity, Exclude NEC. (#339) 2024-06-02 02:26:21 +02:00
Kichura
64b9d6cdd6
Gradle 8.8 (#337)
* Update Gradle to 8.8.

* Update max Java to 22.
2024-06-01 18:56:38 +02:00
FlorianMichael
3fb4d18b7e
Downgrade VV dependency to J8
Downgrades the included dependency to J8 to support bootstrapping legacy versions which don't support newer Java versions, running from IDE is excluded here
2024-06-01 01:57:28 +02:00
FlorianMichael
0d1c553ee1
Update VV API usage 2024-06-01 00:34:15 +02:00
FlorianMichael
057e892729
Merge remote-tracking branch 'refs/remotes/origin/main' into dev 2024-05-31 21:32:41 +02:00
Kichura
54dad0f36a
Update Fabric API to 0.97.1 in 1.20.4. (#336)
Resolves two issues basically, one for Indigo and one in the changeDimension code.
2024-05-30 15:36:26 +02:00
FlorianMichael
50f78eea5e
Update VV API usage 2024-05-26 22:59:36 +02:00
FlorianMichael
c455ccbc98
Merge branch 'refs/heads/main' into dev
# Conflicts:
#	gradle.properties
2024-05-26 21:27:58 +02:00
Kichura
e18cac5842
Upstream Mod Menu, Fabric API and Yarn, Add note for CurseGradle (#335)
* Upstream Mod Menu, Fabric API and Yarn, Add note for CurseGradle.

* Update Legacy Fabric API to 1.9.4.
2024-05-18 15:05:13 +02:00
Kichura
608c5cbb58
Ubuntu 24.04, JDK 21.0.3 in JitPack, ViaVersion 4.10.3-SNAPSHOT (#333)
* Update Ubuntu to 24.04, JDK to 21.0.3.

* Update ViaVersion to 4.10.3-SNAPSHOT.

This update removes invalid chunk entities for 1.20.5 clients basically.
2024-05-17 21:50:27 +02:00
FlorianMichael
9909c282fb
Port to upstream changes (maybe) 2024-05-15 00:49:33 +02:00
creeper123123321
9065c5260c fix version sent in 1.8/1.12 detector 2024-05-13 09:12:16 -03:00
pompompopi
bab35223bb
Also destroy ViaManager on 1.15.2 servers (#330) 2024-05-10 14:55:15 +02:00
pompompopi
9454942af6
Ensure ViaManager is destroyed on the server at graceful shutdown (#328)
Fixes #327
2024-05-10 14:45:53 +02:00
Kichura
a7d5601d7b
Update Loader to 0.15.11, ViaVersion 4.10.2. (#329) 2024-05-10 14:45:27 +02:00
FlorianMichael
982145d5cb
Update Via (4.10.1) 2024-05-05 17:16:25 +02:00
Kichura
60d96777b0
Ensure the 1.20.6 mixins use Java 21 in compatibility level. (#326) 2024-05-05 17:15:31 +02:00
Kichura
045187975f
Update ViaVersion to 4.10.1-SNAPSHOT. (#325)
Contains multiple bug fixes and other things basically. ™️
2024-05-02 00:27:32 +02:00
FlorianMichael
2c2c654387
Update version references 2024-04-29 17:59:45 +02:00
FlorianMichael
808f60a96e
Merge remote-tracking branch 'refs/remotes/origin/dev' 2024-04-29 17:58:15 +02:00
FlorianMichael
3d0980953b
1.20.6 2024-04-29 17:55:47 +02:00
FlorianMichael
35642a468b
Fix 1.20.5 boot 2024-04-26 20:22:51 +02:00
FlorianMichael
f2541bcca9
0.4.14 2024-04-26 15:54:40 +02:00
Kichura
d973079821
[ci skip] Reflect 1.20.1/5 support in README version table. (#321) 2024-04-24 22:14:58 +02:00
FlorianMichael
fdcb845a4a
Update version references 2024-04-24 08:39:05 +02:00
FlorianMichael
75fd16de9d
1.20.1 support
Starting with this commit, VF will now support LTS or generally common versions (besides the latest minor of every major version). Many people have requested this in the past and there is no reason to not just provide it, now 1.20.1 users don't have to use ViaProxy if they are using Fabric anyway.
2024-04-24 08:34:19 +02:00
FlorianMichael
56b3e56c9f
Move out handshake accessor interface 2024-04-21 18:26:59 +02:00
FlorianMichael
fc1bd8a1cc
Fix 1.20.4 version range
Also allowing 1.20.3 since Mojang only changed one line of code between those versions.
2024-04-21 18:20:20 +02:00
FlorianMichael
80dc92e177
1.20.5 support
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
2024-04-21 18:05:25 +02:00
FlorianMichael
40689b6400
Fix config screen rendering order in 1.20.4 2024-04-21 18:04:56 +02:00
FlorianMichael
16dd9002b3
Move GH actions to J21
Co-authored-by: Kichura <68134602+kichura@users.noreply.github.com>
2024-04-21 17:08:42 +02:00
FlorianMichael
057bdc925f
Repackage modern fabric platforms 2024-04-21 17:02:13 +02:00
FlorianMichael
5651643360
Repackage legacy fabric platforms 2024-04-21 16:29:57 +02:00
FlorianMichael
2aced1f5f5
Rename submodules to their explicit mc version
This is split into several commits so that Git doesn't break completely
2024-04-21 15:20:34 +02:00
FlorianMichael
644d592561
Merge branch 'refs/heads/main' into dev
# Conflicts:
#	gradle.properties
2024-04-14 02:22:26 +02:00
Kichura
6ea86f3f70
Update loader, api and loom (#318)
* Update API to 0.97.0 in mc120.

* Update loader to 0.15.10.

* Update loom to 1.6.
2024-04-13 22:44:59 +02:00
Kichura
e4d1951c51
Supersed old Gradle wrapper validation step. (#317) 2024-04-13 00:20:43 +02:00
FlorianMichael
6b98d22ee4
Update client-side-force-disable list 2024-03-31 21:36:35 +02:00
FlorianMichael
5c1b71eba2
Merge remote-tracking branch 'origin/main' 2024-03-23 12:41:29 +01:00
FlorianMichael
5fa1677332
Gradle 8.7 2024-03-23 12:41:18 +01:00
Kichura
5eb3fd204c
ViaVersion to 4.9.4-SNAPSHOT and some other things (#315)
* ViaVersion to 4.9.4-SNAPSHOT, Dependency + Cosmetical changes.

* legacy fabric moment.

* LF API 1.9.3

* LF API 1.9.3

---------

Co-authored-by: EnZaXD <60033407+FlorianMichael@users.noreply.github.com>
2024-03-15 14:37:08 +01:00
creeper123123321
2a0028cb0c
change default version type to beta in cf 2024-03-05 18:50:17 -03:00
FlorianMichael
cf999c38ab
Merge branch 'main' into dev
# Conflicts:
#	gradle.properties
2024-03-05 20:17:32 +01:00
EnZaXD
9c898756f0
Merge pull request #314 from Kichura/main
Update ViaVersion to 4.9.3
2024-03-05 20:15:31 +01:00
Kichura
de9e6bb204
Update ViaVersion to 4.9.3. 2024-03-05 20:08:14 +01:00
FlorianMichael
8939886e1f
[ci skip] Extend FUNDING.yml 2024-03-05 13:38:58 +01:00
FlorianMichael
0023b789e2
Updated Via API usage 2024-02-24 10:26:16 +01:00
FlorianMichael
9cd0ac3abf
Merge remote-tracking branch 'origin/main' into dev
# Conflicts:
#	gradle.properties
2024-02-24 10:21:56 +01:00
EnZaXD
a1f1c7abe7
Merge pull request #311 from Kichura/gradle-8.6
Update Gradle to 8.6
2024-02-17 14:36:08 +01:00
Kichura
139eb681b4
Update Gradle to 8.6. 2024-02-17 14:23:16 +01:00
Kichura
5ddaaf61d0
Update fabric dependencies (#310)
* Update loader to 0.15.7.

* Update API to 0.96.1.
2024-02-14 23:10:56 +01:00
FlorianMichael
fbd46800c0
Port to upstream changes (maybe) 2024-02-14 20:35:36 +01:00
FlorianMichael
2971cdedeb
Merge branch 'main' into dev
# Conflicts:
#	gradle.properties
2024-02-14 02:30:09 +01:00
EnZaXD
ea875acac9
24w06a 2024-02-07 19:56:44 +01:00
FlorianMichael
49a01fe81b
Merge remote-tracking branch 'origin/main' 2024-02-03 23:23:58 +01:00
FlorianMichael
6c8e0c5a89
Fixed publishing 2024-02-03 23:23:44 +01:00
Kichura
2ab66b0d21
Fix 1.12.2 not being recognized as supported version. (#308) 2024-02-03 23:17:25 +01:00
FlorianMichael
cc78074c22
Merge remote-tracking branch 'origin/main' 2024-02-03 23:08:10 +01:00
FlorianMichael
1429bebf80
Only apply mixin on the client 2024-02-03 23:07:57 +01:00
EnZaXD
1aa6903a96
Merge pull request #307 from Kichura/main
Final dependency updates, ViaFabric 0.4.13
2024-02-03 23:01:38 +01:00
Kichura
266ab67253
Final dependency, ViaFabric 0.4.13. 2024-02-03 22:55:55 +01:00
FlorianMichael
6f67cbdea4
Merge dev into main 2024-02-03 22:53:22 +01:00
FlorianMichael
d83ed61e8e
Updated README file 2024-02-03 22:49:17 +01:00
FlorianMichael
6dd9ad9361
There you go, 1.12 support
Co-authored-by: Kichura <business_squeezy@outlook.com>
2024-02-03 22:39:26 +01:00
FlorianMichael
4a4b4a3cf1
Merge branch 'main' into dev 2024-02-03 21:42:12 +01:00
EnZaXD
6c8250a995
Merge pull request #306 from HowardZHY/dev
Update zh_*.json
2024-02-03 19:48:32 +01:00
Howard ZHY
f88f73d395 Update zh_*.json
Use Author instead of I
2024-02-04 02:45:12 +08:00
EnZaXD
e9887d8f45
Merge pull request #305 from Kichura/main
Fix typo in config file in "force disable" line
2024-02-03 17:03:02 +01:00
Kichura
33429ee6ce
Fix typo in config file in "force disable" line. 2024-02-03 17:01:13 +01:00
EnZaXD
4959dceffc
24w05b 2024-02-02 11:30:25 +01:00
EnZaXD
b4295d17ff
Merge pull request #303 from Kichura/main
Update wrapper-validation-action to v2
2024-01-31 14:11:34 +01:00
Kichura
6645435c2c
Update wrapper-validation-action to v2. 2024-01-31 00:57:27 +01:00
FlorianMichael
24cfacbd70
Merge branch 'main' into dev
# Conflicts:
#	gradle.properties
#	viafabric-mc120/build.gradle.kts
2024-01-29 19:42:30 +01:00
FlorianMichael
7426e648a6
Merge remote-tracking branch 'origin/main' 2024-01-29 19:39:23 +01:00
FlorianMichael
132bad3de9
Updated all fabric.mod.json files 2024-01-29 19:39:10 +01:00
EnZaXD
2635f15469
24w04a 2024-01-26 13:57:57 +01:00
Kichura
81e6a158f6
Ensure the JDK is defaulted in shell. (#301) 2024-01-21 14:06:27 +01:00
FlorianMichael
f0d771d2e3
Include license header to class files 2024-01-21 11:38:02 +01:00
FlorianMichael
ff68b7af26
Added copyright profile 2024-01-21 11:33:04 +01:00
FlorianMichael
c675d34296
Removed unsupported mod warnings
Reverts c21985cc24
2024-01-21 11:15:39 +01:00
FlorianMichael
68ecd55d8c
Normalize Unique fields in mixins 2024-01-21 11:11:09 +01:00
FlorianMichael
08f153f434
Don't rely on deprecated Via API 2024-01-21 10:54:24 +01:00
FlorianMichael
1f9cbd2853
Cleanup of the last PR. 2024-01-21 10:43:22 +01:00
Kichura
67c977009b
Fix loom 1.5 screwing up the buildscript (#300)
* Finally fix the cursed loom 1.5 update.

* Formatstyle adjustment.

Tabs make this look ugly.
2024-01-21 10:38:51 +01:00
EnZaXD
051e944693
Merge pull request #298 from Kichura/main
Update CI and fabric
2024-01-20 23:25:25 +01:00
EnZaXD
db5a12bbcd
Fabric Loom 1.5 2024-01-20 23:25:08 +01:00
Kichura
0c6fcbd383
Update CI and fabric. 2024-01-20 23:21:14 +01:00
EnZaXD
8a3e961550
Merge pull request #297 from Kichura/patch-1
Update JDK to 17.0.10
2024-01-20 09:01:57 +01:00
Kichura
8a1be75f27
Update JDK to 17.0.10. 2024-01-19 22:46:13 +01:00
EnZaXD
ad47afb6e0
Merge pull request #296 from Kichura/main
Use JDK 17 instead of 21 in terms of codespaces
2024-01-16 03:29:08 +01:00
Kichura
55dab979ec
Use JDK 17 instead of 21 in terms of codespaces. 2024-01-16 00:04:11 +01:00
FlorianMichael
7e12d8024f
[ci skip] Updated README.md 2024-01-15 00:04:14 +01:00
FlorianMichael
dac4b4a771
Update Fabric API 2024-01-14 23:59:12 +01:00
FlorianMichael
f946c609e4
Switch back to master VV branch 2024-01-14 23:52:51 +01:00
FlorianMichael
d2cd87c35b
Merge branch 'dev'
# Conflicts:
#	gradle.properties
2024-01-14 23:49:42 +01:00
FlorianMichael
d6386bf679
Updated Via API usage 2023-12-29 04:42:35 +01:00
EnZaXD
4baeaea176
Merge pull request #294 from Kichura/patch-1
Don't upload artifacts twice, only on build script
2023-12-26 16:46:56 +01:00
Kichura
acb9c5e519
Don't upload artifacts twice, only on build script. 2023-12-26 16:41:47 +01:00
FlorianMichael
9bc6fb90c9
Update Fabric Loader to 0.15.3 2023-12-26 16:30:26 +01:00
EnZaXD
8fdc3cd902
Merge pull request #293 from Kichura/main
Undo ViaVersion dependency but update loader to 0.15.3
2023-12-26 16:29:13 +01:00
Kichura
b2e8af0b25
Undo ViaVersion dependency but update loader to 0.15.3. 2023-12-26 16:17:36 +01:00
Kichura
510d0fe993
Update 1.20.x's build dependencies (#292)
* Update Mod Menu and Fabric API for 1.20.x.

* Update 1.20.4 yarn to build 3.
2023-12-24 00:24:50 +01:00
FlorianMichael
b5974553da
ViaVersion 4.10.0-23w51b-SNAPSHOT 2023-12-20 18:26:17 +01:00
FlorianMichael
679de94c18
Fixed 1.17 not booting
Closes https://github.com/ViaVersion/ViaFabric/issues/290
2023-12-20 18:24:19 +01:00
Kichura
660f3690dc
Gradle 8.5, CI Updates, ViaVersion 4.9.3. (#288)
* Update setup-java and upload-artifact to v4.

* Gradle 8.5, ViaVersion 4.9.3 (SNAPSHOT).
2023-12-17 03:31:17 +01:00
Kichura
e0d19dbe8c
1.20.3->1.20.4, Update authors list (#286)
* 1.20.3->1.20.4, Update authors list.

* Revert to 1.20.3 being compatible.
2023-12-07 20:19:06 +01:00
Kichura
6c0184d1a2
Update ViaVersion to 4.9.2. (#285) 2023-12-07 12:46:32 +01:00
FlorianMichael
47afaf1043
0.4.12, 1.20.3 2023-12-05 20:37:05 +01:00
Kichura
91a0a1809d
Update ViaFabric from 1.20.2->1.20.3 (#284)
* Prepare to update to 1.20.3. (Hunt for errors first)

* Correct report URL in value, Update Mod Menu.

* Fixed compile errors

---------

Co-authored-by: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com>
2023-12-05 20:35:11 +01:00
EnZaXD
f233b4b6d3
1.20.3-rc1 2023-11-30 18:12:24 +01:00
EnZaXD
a433afb317
1.20.3-pre4 2023-11-28 17:33:37 +01:00
EnZaXD
b86ab4ac5c
1.20.3-pre3 2023-11-27 17:22:04 +01:00
Kichura
4d40e852aa
Update Fabric Loader to 0.14.24 in Gradle. (#281) 2023-11-22 18:19:01 +01:00
EnZaXD
7831f9fd16
1.20.3-pre2 2023-11-22 18:08:24 +01:00
EnZaXD
d0ed185ec1
1.20.3-pre1 2023-11-20 19:40:13 +01:00
EnZaXD
a2ff858685
23w46a 2023-11-20 14:00:04 +01:00
EnZaXD
f36f63d4a8
23w45a 2023-11-10 16:04:01 +01:00
EnZaXD
08546bbbd8
23w44a Via 2023-11-03 20:13:16 +01:00
EnZaXD
c36106c1fc
23w43a Via 2023-10-26 05:23:06 +02:00
Kichura
d1860be2ad
Gradle 8.4, Fabric Loader 0.14.23. (#277)
* Gradle 8.4, Fabric Loader 0.14.23.

* Ensure gradle-wrapper JAR is up-to-date.
2023-10-19 15:17:09 +02:00
FlorianMichael
1e3f80d046
23w42a Via 2023-10-19 12:56:09 +02:00
FlorianMichael
d5e06f67e0
Add task to validate gradle wrapper jar file. 2023-10-16 15:03:00 +02:00
FlorianMichael
36a41fd9b4
Sync debug mixin to all ViaFabric versions 2023-10-16 15:00:44 +02:00
FlorianMichael
f3151e820c
Combine ViaVersion injections into one mixin 2023-10-16 14:37:53 +02:00
FlorianMichael
bf2a1abde4
23w41a Via 2023-10-16 14:32:26 +02:00
FlorianMichael
1ed87db152
fabric loom 1.4 2023-10-16 14:24:59 +02:00
Nassim Jahnke
573fc8e2b4 Print network stacktraces 2023-10-13 23:20:54 +10:00
FlorianMichael
158ba3ee93
fixed config screens 2023-10-08 09:50:46 +02:00
FlorianMichael
e18f886111
Updated Via API usage 2023-10-08 09:45:02 +02:00
FlorianMichael
ccf25b41e1
Added high_contrast sprites for Via Button in 1.20.2 2023-10-04 04:50:23 +02:00
FlorianMichael
a20bb5033c
Added programmer-art sprites for Via Button in 1.20.2 2023-10-04 04:26:34 +02:00
FlorianMichael
43b89472d3
Fixed modification of pinging textures 2023-10-04 04:17:32 +02:00
Kichura
399dd9003f
Prepare for ViaVersion 4.8.1, Update 1.20.2 dependencies. (#274) 2023-10-03 21:46:59 +02:00
FlorianMichael
0e538ee6e8
Fixed Via Button in 1.20.2 2023-09-22 23:02:08 +02:00
FlorianMichael
bec1c76415
Fixed building 2023-09-22 23:01:34 +02:00
Kichura
0259407fc2
1.20.2, Dependency updates, JDK level correction. (#272)
* 1.20.2-rc2, Dependency updates, JDK level correction.

* Clarify what SDKMAN will deploy.

* Improve second-liner for jitpack comment.

* Modrinth does not have 1.20.2-rc2 yet.

* Set viaversion dependency to 4.8.0 in fabric.mod.json.

1.20.2 will not work with ViaVersion 4.6.0 - 4.7.1-SNAPSHOT, therefore this part is needed at some point.

* 1.20.2-rc2 -> 1.20.2.

* We use mclo.gs now, not paste.gg.
2023-09-21 19:57:20 +02:00
Nassim Jahnke
957b62620c Fix 1.20.2 ProtocolAutoDetector 2023-09-21 11:29:55 +10:00
Nassim Jahnke
ffd7e0bc23 1.20.2-rc2 2023-09-19 18:58:01 +10:00
Nassim Jahnke
613a1c8b3e Update to 1.20.2-rc1 2023-09-18 21:43:20 +10:00
Nassim Jahnke
d2f0fe9d46 Update Gradle wrapper 2023-09-06 19:12:51 +10:00
Kichura
ae316e81be
Fix issue where jitpack does not work properly. (#270) 2023-09-03 15:27:51 +02:00
creeper123123321
df04490b5d
Update README.md 2023-08-11 03:42:07 -03:00
EnZaXD
b69dc9baf3
Bump mc 1.20 libraries 2023-08-03 20:28:31 +02:00
EnZaXD
407bc3722b
Bump temurin version 2023-07-30 21:41:04 +02:00
Amirhan-Taipovjan-Greatest-I
12e89ad5c2
Tatar Translation! (#267)
* Tatar Translation!

Vanilla-ish Tatar Translation!

* ModMenu Integration
2023-07-26 17:00:32 +02:00
EnZaXD
4593e04b26
Updated ViaProxy link 2023-07-25 19:30:21 +02:00
creeper123123321
d1fe3f8f6e update compat for krypton 2023-07-02 19:25:03 -03:00
creeper123123321
ebdd4a71c6
update to 1.20.1 in gradle.properties 2023-07-02 17:53:44 -03:00
Kichura
cc6c2f56af
Update versioning table for client-side, Add required note at the end of client-side. (#263)
* [ci skip] Include note for 1.7.x and four other versions, Use latest minor versions in README.

* [ci skip] Include "mode" at end of client-side.
2023-06-27 17:50:50 +02:00
Kichura
a71737827a
Set Minecraft Versions to latest minor versions only. (#261) 2023-06-20 18:33:05 +02:00
YoMonNPC
3ad5d718a0
Update zh_cn.json, add zh_tw.json and zh_TW.lang (#256)
* Update zh_cn.json

* Create zh_TW.lang

* Create zh_tw.json

* Delete zh_TW.lang

* Removed spacer

* Update zh_cn.json

* Revert "Delete zh_TW.lang" locally

---------

Co-authored-by: EnZaXD <60033407+FlorianMichael@users.noreply.github.com>
2023-06-18 21:42:06 +02:00
Kichura
bfc295e5b8
Update ViaVersion, CI and MC dependencies. (#260)
* Update ViaVersion, CI and MC dependencies.

* Ensure publish only works on ViaVersion repo.

* Fix Mod Menu versions in 1.14.4 and 1.15.2.

* Update yarn for 1.18.2, 1.19.4 and 1.20.1.
2023-06-18 21:13:21 +02:00
EnZaXD
c55cd801ec
Removed MovementTransmitterProvider use() call (updated ViaVersion to 4.7.1-SNAPSHOT) (#259) 2023-06-18 20:43:50 +02:00
Kichura
b7ea59e954
1.7.x doesn't work on viafabric. (#254) 2023-06-18 20:36:44 +02:00
creeper123123321
73bb621462
Merge dev branch
merge branch dev into main #253
2023-06-08 03:50:39 -03:00
Kichura
aa797eff1c
Finalize 1.20 for ViaFabric. (sorta) (#252)
* Final 1.20 for ViaFabric. (Mod Menu isn't updated yet)

* Yarn build 2 of 1.20 doesn't exist yet.

* Cut out the versions from snapshot contexts.

* github why you no work?

* Restore old examples.

* Update Mod Menu to version 7.

* curseforge metadata is weird

---------

Co-authored-by: creeper123123321 <7974274+creeper123123321@users.noreply.github.com>
2023-06-08 03:48:03 -03:00
Kichura
f474efdc5f
1.20 Release Candidate 1. (#251) 2023-06-05 08:53:10 -03:00
creeper123123321
d0f3f0b345
fix publishing 2023-05-30 08:26:30 -03:00
Kichura
9c1673fb52
1.20 Pre-Release 7 for ViaFabric, Mention 1.20 in README and publish. (#250)
* 1.20 Pre-Release 7 for ViaFabric.

* Include 1.20 in publish list.

* Mention 1.20 in ViaFabric's README.
2023-05-29 14:16:13 -03:00
Kichura
8195adaadf
multiconnect -> ViaFabricPlus (#249)
* [ci skip] Multiconnect -> ViaFabricPlus in README.

* ViaFabricPlus breaks ViaFabric itself.
2023-05-29 09:08:56 -03:00
EnZaXD
01aa8fd17e
Code cleanup (#246)
* use CommonTransformer fields in Decoder

* Renamed classes and removed unused code
2023-05-28 10:40:02 -03:00
Kichura
35287e4c29
1.20 Pre-Release 6 for ViaFabric. (#248) 2023-05-28 10:36:49 -03:00
creeper123123321
6c0739b4ab
fix modrinth metadata 2023-05-11 09:35:28 -03:00
Kichura
97b8623f29
23w18a -> 1.20-pre1. (#244) 2023-05-11 09:29:05 -03:00
EnZaXD
0c0cfdcfda
Implement PlayerAbilities and PlayerLookTarget provider (#245)
* implemented providers from my last pull requests

* only register providers on the client

* added UserConnection#isClientSide checks
2023-05-11 09:20:43 -03:00
Kichura
9d77da9912
Fix GUI texture not referencing viafabric. (#243)
* Fix GUI texture not referencing viafabric.

* I set "viafabric" to wrong place, oops.
2023-05-09 16:13:22 -03:00
Kichura
4cdceacb94
23w18a support, CI updates, Minor README adjustments (#242)
* Update to 23w18a.

I have finally learned something incredible in the ViaVersion universe, Also i thank RK for his help.

Co-Authored-By: RK_01 <50594595+RaphiMC@users.noreply.github.com>

* Update Gradle dependencies and Jitpack.

* [ci skip] Reference Modrinth properly, 1.19.4 too, Fix typos.

* ViaForge and ViaFabricPlus are also on modrinth.

And now let GitHub actions compile this entire thing.

* Restore and fix viafabric ping textures.

---------

Co-authored-by: RK_01 <50594595+RaphiMC@users.noreply.github.com>
2023-05-08 18:09:40 -03:00
adryd
685efbcddc
Show protocol version and advertised version in server listing (#240)
Backport showing protocol version to 1.16, 1.15 and 1.14
2023-05-07 18:30:05 -03:00
creeper123123321
a2c103c6a1 fixed uuid for console 2023-04-09 20:04:25 -03:00
creeper123123321
e3fb5db561 update fabric api 2023-04-08 13:21:09 -03:00
creeper123123321
afb0797f06 0.4.10, 23w14a 2023-04-08 11:27:01 -03:00
creeper123123321
1570501acc update 23w13a 2023-04-01 12:11:26 -03:00
creeper123123321
fda8d39147 update deps 2023-04-01 11:09:38 -03:00
Kichura
8161c3f97c
Change warning to disclaimer. (#235)
This is taken from the ViaFabric's english language file but also makes ViaFabric slightly less fearing in terms of tone.
2023-03-31 19:18:23 -03:00
creeper123123321
8bcf67092b update deps, use beta as default 2023-03-19 09:29:46 -03:00
creeper123123321
a3cf49e786 1.19.4 2023-03-14 16:52:50 -03:00
creeper123123321
c0dce2e425 Merge branch 'dev' 2023-03-14 16:31:57 -03:00
Nassim Jahnke
89b178dbd2
Update ViaVersion 2023-03-12 10:39:52 +01:00
Nassim Jahnke
647092f299
Update ViaVersion, 1.19.4-rc2 2023-03-10 18:40:17 +01:00
florian
8100a1f463
add viafabricplus to alternatives (#227) 2023-02-26 14:32:13 -03:00
Nassim Jahnke
7b40f03369
Add wrapper validation action to workflows 2023-02-22 16:36:04 +01:00
creeper123123321
f69e1ef2d3 fix mc dependency metadata 2023-02-21 19:45:51 -03:00
creeper123123321
cd3af46b7a 23w07a, use synthetic field 2023-02-21 08:39:38 -03:00
creeper123123321
3398251281 23w04a, increase heap 2023-01-26 07:36:23 -03:00
creeper123123321
084c7bc8bb
add viaproxy to alternatives 2023-01-22 16:04:33 -03:00
Kichura
3203ef13e0
Move to temurin JDK. (#219) 2023-01-14 19:08:43 -03:00
Kichura
afc689a7cc
Upstream fabric loader, Use viaversion 4.5.2. (#218) 2023-01-04 16:19:17 -03:00
creeper123123321
7265dcffb7 1.19.3, remove 1.19 chat patch 2022-12-07 16:17:15 -03:00
creeper123123321
c8e9132e68 don't patch keys on server-side 2022-11-14 17:02:29 -03:00
creeper123123321
13a50efff0 some changes to config screen 2022-11-05 20:47:21 -03:00
creeper123123321
396695aea7 some code style 2022-11-05 19:40:49 -03:00
F
683a7128b7
Fixes 1.19.2 -> 1.19.0 Protocol (#200)
* implemented 1.19.2 -> 1.19.0 Signatures

* moved Protocol Patching

* removed old loading

* some finally improvements

* fixed compile issue

* finally fixed edge-case

* resolve conflict #1
2022-11-05 19:08:10 -03:00
creeper123123321
7622f73a74
Remove ncr warn (#206)
* Remove warning for NoChatReports, fix typo
The warning is due to an old vulnerability of NCR

* fix some space issue
2022-10-21 06:11:18 -03:00
Kichura
8e61509140
Ensure setup-java uses temurin instead of blank value. (#205) 2022-10-13 17:18:19 -03:00
Kichura
21603a0e5c
Upstream GitHub Actions and correct typos in issue templates. (#204) 2022-10-13 17:10:21 -03:00
creeper123123321
ba5f0c175c update deps 2022-10-13 17:01:07 -03:00
creeper123123321
846a8c6d72 update legacy fabric 2022-09-10 12:05:44 -03:00
creeper123123321
71c376b101 allocate more ram 2022-09-10 10:52:03 -03:00
creeper123123321
d49d7f05e7 0.4.9, update deps 2022-09-10 10:40:27 -03:00
Kichura
084421c942
Add 1.19.x panel + Redo 1.8.x panel. (#199) 2022-09-06 18:00:25 -03:00
creeper123123321
60b59b8c2d update deps 2022-08-28 10:32:20 -03:00
creeper123123321
04b1e5a5b0 update deps 2022-08-21 11:52:40 -03:00
Devendra Poonia
237ef309e1
Added Hindi translations. (#191)
* Added Hindi translations

* Create hi_IN.lang

* Update hi_IN.lang

* fixed json

* fix case

Co-authored-by: creeper123123321 <7974274+creeper123123321@users.noreply.github.com>
2022-08-13 15:54:58 -03:00
Nassim Jahnke
dccbefbea0
Update unsupported software reasons, fix spaces 2022-08-09 22:25:19 +02:00
creeper123123321
0ba0736b68
mc 1.19.2 2022-08-05 18:23:55 -03:00
Nassim Jahnke
c21985cc24
Add unsupported mod warning
Pretty well hidden in the logs filled by Fabric debug and errors, but it's there.
2022-08-04 13:29:16 +02:00
creeper123123321
1786c73219 update viaver 2022-08-03 18:58:11 -03:00
creeper123123321
d75974bb08 update viaversion 2022-07-28 20:30:54 -03:00
creeper123123321
3cedc30260 0.4.8: fix links, 1.19.1
fixes #188
2022-07-27 17:58:34 -03:00
creeper123123321
c1cbf7dacd
Rename bug_report.md to bug_report.yml 2022-07-25 20:43:17 -03:00
creeper123123321
c41aeef961
Update bug_report.md 2022-07-25 20:42:31 -03:00
creeper123123321
e9aaf03974 1.19.1-rc2 2022-07-24 15:05:24 -03:00
creeper123123321
bb614fb9aa update via 2022-07-15 17:57:54 -03:00
creeper123123321
b397a85e77 fix cf version 2022-07-05 21:29:23 -03:00
creeper123123321
d2b3507822 update via 2022-07-05 19:23:57 -03:00
creeper123123321
4caf071049 update deps 2022-07-02 13:42:04 -03:00
creeper123123321
c60755a8c6 print all stacktraces when debug 2022-06-19 09:49:33 -03:00
creeper123123321
989a2be326 don't use modImplementation 2022-06-11 17:47:10 -03:00
creeper123123321
295bbfa24a update deps, fix runClient 2022-06-11 16:50:19 -03:00
creeper123123321
26aea3e9a3 update viaver 2022-06-10 13:34:45 -03:00
creeper123123321
87c7452dd0
Update FUNDING.yml 2022-06-07 16:55:07 -03:00
creeper123123321
491559c0e2 1.19 2022-06-07 13:34:03 -03:00
creeper123123321
503fa81aff 1.19-rc2 2022-06-04 15:14:19 -03:00
creeper123123321
086942e267 update deps + cleanup 2022-06-03 17:43:45 -03:00
creeper123123321
1b4b940469 update readme 2022-05-29 16:00:08 -03:00
creeper123123321
f2ee6af689
1.19-pre3 modrinth metadata 2022-05-28 20:06:14 -03:00
creeper123123321
213873ca42 update deps 2022-05-28 17:23:07 -03:00
creeper123123321
8a61dcbaf4
increase version number 2022-05-22 14:23:17 -03:00
creeper123123321
710bae8ff5 make actions publish manual 2022-05-22 14:17:14 -03:00
creeper123123321
45f1400328 update minotaur 2022-05-22 13:56:30 -03:00
creeper123123321
69695c86de add modrinth 2022-05-22 13:12:13 -03:00
creeper123123321
960d9cf372 1.19-pre1 2022-05-22 12:04:22 -03:00
creeper123123321
6cb0da6682 update deps, use 4 threads 2022-05-08 10:04:01 -03:00
creeper123123321
f109df3523 update gradle, fix 1.8.9 runClient 2022-04-23 07:17:36 -03:00
creeper123123321
b0fb3c0399 update deps, fix legacy fabric 2022-04-21 12:58:25 -03:00
creeper123123321
b18697c15e 22w11a + fix #175 2022-03-27 11:32:59 -03:00
Kichura
f6fefb7245
Update config contexts. (#174)
* Update config contexts.

Contained the original text aswell and missed it entirely - will also go ahead and update it.

* that sweet little period pls.
2022-03-26 17:05:19 -03:00
creeper123123321
4d17e38218 22w11a 2022-03-19 13:35:42 -03:00
creeper123123321
d1571ea360 0.4.6: 1.18.2 2022-02-28 13:00:51 -03:00
Kichura
59aaeca4c5
Update the caution text. (#173) 2022-02-12 13:33:53 -03:00
creeper123123321
bd2a7ea9db revert cursegradle 2022-01-26 17:31:31 -03:00
creeper123123321
f8547729d3 update loom, allocate more ram 2022-01-26 17:22:09 -03:00
creeper123123321
b463b48312 update legacy fabric api, lang autogen 2022-01-26 09:05:18 -03:00
creeper123123321
0381c595b8 embedded dep 2022-01-19 09:14:06 -03:00
creeper123123321
c0180acd71
shouldn't bundle this 2022-01-19 09:04:26 -03:00
creeper123123321
e9bdee41e3 Use Rewoven api, use Tinfoil client-commands
fix #168 fix #167
2022-01-19 09:00:28 -03:00
creeper123123321
af11cd38b9
1.18.1 curseforge metadata 2022-01-10 19:57:32 -03:00
creeper123123321
ef7062d1eb update deps 2022-01-03 15:18:49 -03:00
creeper123123321
7c88d64676 update deps, legacy intermediary is broken 2021-12-18 11:19:57 -03:00
creeper123123321
43379d2369 fixed injector, don't pretend to be a proxy on server-side 2021-12-18 08:07:47 -03:00
creeper123123321
db57ced2bb return native version on server-side, allow untested mc versions
closes #165
2021-12-18 07:53:24 -03:00
HexedHero
0035c47d2a
Add 1.18 in version graph (#164) 2021-12-06 19:14:50 -03:00
creeper123123321
cce6a3e0b8 too up to date 2021-12-04 10:28:10 -03:00
creeper123123321
49dbbf0ccf update via 2021-12-04 10:22:23 -03:00
creeper123123321
33a07403d2 1.18 2021-12-01 20:30:07 -03:00
creeper123123321
8f317b0318 1.18-rc3 2021-11-26 19:02:09 -03:00
creeper123123321
f2ee3bc413 1.18-rc1 2021-11-25 19:26:02 -03:00
creeper123123321
8a5982434e 1.18-pre5 2021-11-19 19:17:36 -03:00
creeper123123321
1abd584d95 1.18-pre4, java 17 2021-11-17 19:07:12 -03:00
creeper123123321
51ac0be637 1.18-pre1, fix #161 ? 2021-11-12 18:49:05 -03:00
creeper123123321
7436b2c6da fix build 2021-11-06 17:50:53 -03:00
creeper123123321
c88d67eb8b update deps 2021-11-06 17:28:11 -03:00
creeper123123321
a2ac407bad 0.4.4 2021-10-29 18:43:18 -03:00
creeper123123321
2f80e9a67e 21w43a 2021-10-29 17:47:26 -03:00
creeper123123321
6122d7faa0 21w42a 2021-10-23 11:55:23 -03:00
creeper123123321
2a5ba15209 21w41a + fix #157 2021-10-17 10:31:04 -03:00
creeper123123321
a2693aafce crash if submod dont load correctly 2021-10-09 07:11:17 -03:00
creeper123123321
e2fe610288 21w40a 2021-10-08 20:30:57 -03:00
creeper123123321
acb3623570
add curseforge "1.18-Snapshot" 2021-09-28 07:25:37 -03:00
creeper123123321
344010a9ed
fix build 2021-09-24 18:23:06 -03:00
creeper123123321
a5b8676172 21w38a 2021-09-24 18:08:38 -03:00
creeper123123321
a93d08e549 fix mixin in 1.18 2021-09-18 19:56:39 -03:00
creeper123123321
0a21312bc2 21w37a 2021-09-18 19:19:46 -03:00
creeper123123321
703c6d0e8c
update fabric loader 2021-09-18 18:07:27 -03:00
creeper123123321
217b7bc0d7 gradle is eating all my ram 2021-09-18 17:59:16 -03:00
creeper123123321
c1ca789ee5 custom loom 2021-09-18 17:53:00 -03:00
creeper123123321
d13b86fa03 update fabric, fix .viafabric 2021-09-16 16:26:13 -03:00
creeper123123321
b7128059d2 update gradle 2021-08-26 16:05:18 -03:00
creeper123123321
8b47d493de
Update README.md 2021-08-08 12:48:14 -03:00
Kichura
32252e57f7
Replace the hive with minemen. (#151) 2021-07-27 15:47:09 -03:00
creeper123123321
47ed47126f
fix typo for 1.16 2021-07-22 18:21:53 -03:00
creeper123123321
e476a36695 fix #149 2021-07-21 15:58:44 -03:00
creeper123123321
1d6363bbb9 move client code to own class, some cleanup 2021-07-21 11:24:21 -03:00
creeper123123321
9e337d45c1 fix server closes #148 2021-07-21 10:07:56 -03:00
Kichura
dd28200b0f
Correct mod title. (#147) 2021-07-20 14:49:29 -03:00
creeper123123321
e3b0db878d fabric screen, fix version field, 1.18
closes #135 closes #145 closes #146
2021-07-20 12:35:00 -03:00
creeper123123321
84c3421d38 fix #144 getting native server version, update address parser 2021-07-18 16:49:14 -03:00
creeper123123321
b1e5645a2c We're now a pseudoproxy, fixes #142 2021-07-16 11:29:07 -03:00
creeper123123321
28958d9491
comment terraformersmc repo 2021-07-16 07:09:40 -03:00
creeper123123321
078bd82644
Update build.gradle 2021-07-16 07:03:07 -03:00
creeper123123321
3a5da20c4d very cursed message of failed load 2021-07-15 19:42:47 -03:00
creeper123123321
5ff1667655
Create CONTRIBUTING.md 2021-07-13 07:15:49 -03:00
creeper123123321
04b4f4a0e1
update viaver 2021-07-07 12:19:30 -03:00
creeper123123321
8935183fc6
0.4.3 2021-07-07 11:08:52 -03:00
creeper123123321
c35f2ff970 fix compression mixin 2021-07-07 10:32:18 -03:00
creeper123123321
a9b06c2b72
update curseforge metadata 2021-07-07 09:15:51 -03:00
creeper123123321
1a52dad483 0.4.2: update to 1.17.1 fabric 2021-07-07 09:06:58 -03:00
creeper123123321
15f3db8ef8
update via 2021-07-06 12:47:13 -03:00
creeper123123321
aa300c0226
update via 2021-07-05 15:26:50 -03:00
creeper123123321
5bc033cf40 make protocol version cache expire faster 2021-07-02 20:30:03 -03:00
creeper123123321
bf0cb84ac7
update viaver 2021-07-01 15:10:42 -03:00
DrHesperus
6e57ccdfee update ru_ru lang
closes #139 closes #140
2021-06-30 20:10:04 -03:00
creeper123123321
a44fc51dc0
1.17.1-pre3 2021-06-30 19:14:36 -03:00
creeper123123321
bdd599e92e update gradle 2021-06-26 11:19:09 -03:00
creeper123123321
ffb668930c
update viaversion 2021-06-18 20:45:39 -03:00
creeper123123321
10cdc36606 update deps 2021-06-17 15:04:30 -03:00
creeper123123321
37ad066aa3
remove unused code 2021-06-17 10:48:33 -03:00
creeper123123321
27fbea0cad
Update README.md 2021-06-15 08:40:19 -03:00
creeper123123321
bce4b1456d
install sdkman before using it 2021-06-12 07:35:04 -03:00
creeper123123321
9e6f174c17
use sdk command for java 16 2021-06-12 07:24:30 -03:00
creeper123123321
6e0063630c
Create jitpack.yml 2021-06-12 07:18:05 -03:00
creeper123123321
a1d5916215 update deps 2021-06-10 14:54:53 -03:00
creeper123123321
9f8d29ee40
update via 2021-06-10 07:07:19 -03:00
creeper123123321
ee14ca2bb7
via 4.0.0 release 2021-06-07 19:42:52 -03:00
creeper123123321
c223e3cf28 1.17-rc2 2021-06-07 18:26:29 -03:00
creeper123123321
4637ca3564 update via 2021-06-04 15:26:43 -03:00
KennyTV
c5ff2053fe
Update ViaVersion 2021-06-04 13:27:02 +02:00
creeper123123321
1664ec58b0
update bug template, recommend not enough crashes 2021-06-03 16:23:16 -03:00
creeper123123321
5242e75cd7
update viaversion 2021-06-03 15:45:16 -03:00
creeper123123321
bbe70b3a7e update viaversion 2021-06-02 20:18:24 -03:00
creeper123123321
36097d42da provide modmenu config for viafabric id 2021-05-31 18:11:13 -03:00
creeper123123321
9b21962c30 1.17-pre2 2021-05-31 17:04:00 -03:00
creeper123123321
96f3da8557 update fabric 2021-05-29 14:40:26 -03:00
creeper123123321
2ec65bb116 update viaversion 2021-05-27 19:37:37 -03:00
creeper123123321
9f528c6e4e reimplement #35 for 1.17, very cursed code 2021-05-21 20:21:56 -03:00
creeper123123321
dfcf9cf354 update to 21w20a 2021-05-20 09:47:41 -03:00
creeper123123321
c622e4af08 optipng 2021-05-18 15:18:25 -03:00
creeper123123321
b3735fc9c6 fix #124, some cleanup 2021-05-18 09:42:41 -03:00
creeper123123321
042e6b1ed6 update readme 2021-05-16 16:39:47 -03:00
creeper123123321
199296b2a6 fix #131 2021-05-15 09:10:16 -03:00
creeper123123321
108268e8a6 remove ProtocolDetectionHandler 2021-05-15 08:52:47 -03:00
creeper123123321
db97205169 cleanup, close #125, fix #95 2021-05-14 20:25:49 -03:00
creeper123123321
105e64b11a update 1.17 snapshot, cleanup VersionProvider 2021-05-13 21:05:30 -03:00
creeper123123321
4bbd683382
Update ViaVersion, add Java 16 to cf metadata 2021-05-13 17:51:35 -03:00
creeper123123321
b4344e38a5 fix metadata 2021-05-11 16:24:40 -03:00
creeper123123321
85a29989f5 update metadata, use only cmd v1 for 1.16/17 2021-05-11 16:20:55 -03:00
creeper123123321
745818e62b cleanup, deduplicate some code 2021-05-09 20:35:24 -03:00
creeper123123321
b38d518214
make a table viafabric x multiconnect 2021-05-09 10:40:42 -03:00
creeper123123321
2e87eb5670
cache 2021-05-05 20:38:09 -03:00
creeper123123321
92295a83e1
update via 2021-05-05 20:11:28 -03:00
creeper123123321
7eddd53cd5
cf metadata: mark fabric api as optional 2021-05-04 18:14:54 -03:00
creeper123123321
04631ddc18
run number in version 2021-05-02 14:35:52 -03:00
creeper123123321
4782c7e448 fix description, parent mod data 2021-05-02 14:13:07 -03:00
creeper123123321
1948fdcd26
fix description, publish main branch 2021-05-02 13:49:49 -03:00
creeper123123321
07b7b27f3a
don't share cache 2021-05-02 13:21:27 -03:00
creeper123123321
cae79c2b68 update gradle + loom 2021-05-02 13:17:19 -03:00
creeper123123321
4fb5e9cfac try to fix intermediary 2021-05-02 12:56:59 -03:00
creeper123123321
8c2ff4562c fix build 2021-05-02 12:26:15 -03:00
creeper123123321
c09d6f0a74 subprojects part 2 2021-05-02 12:01:24 -03:00
creeper123123321
e49f1539ed multiversion modules 2021-05-02 11:01:46 -03:00
creeper123123321
974d3b34ab Merge branch 'mc-1.16' into mc-1.17 2021-04-28 20:34:34 -03:00
creeper123123321
803555c1ae Update VV dependency to the 4.0.0 repackage (#121)
Co-authored-by: KennyTV <jahnke.nassim@gmail.com>
2021-04-28 19:19:43 -03:00
creeper123123321
bc3677e27c
Update VV dependency to the 4.0.0 repackage (#121)
Co-authored-by: KennyTV <jahnke.nassim@gmail.com>
2021-04-28 18:31:51 -03:00
creeper123123321
7b7fb9177e
try to cleanup readme 2021-04-24 12:14:03 -03:00
creeper123123321
4a431a9ed2
Update README.md 2021-04-22 17:34:38 -03:00
creeper123123321
e9c97cff89 fix base protocol 2021-04-21 11:44:05 -03:00
creeper123123321
43162be6ff fix base protocol 2021-04-21 11:41:50 -03:00
creeper123123321
2621374519 update fabric 2021-04-21 10:57:59 -03:00
creeper123123321
a56223c418 update via 2021-04-21 10:39:38 -03:00
creeper123123321
c8876d1a5c update via 2021-04-21 10:37:25 -03:00
creeper123123321
f720b205be check envtype before registering client comamnds 2021-04-13 19:33:03 -03:00
creeper123123321
c433aa5b34
check envtype before registering client comamnds 2021-04-13 19:30:42 -03:00
creeper123123321
031ae68a7f update curseforge metadata 2021-04-09 17:11:46 -03:00
creeper123123321
bd7274d345 update curseforge metadata 2021-04-09 17:11:29 -03:00
creeper123123321
e683756ea2 fabric client-side commands, update modmenu 2021-04-09 17:01:14 -03:00
creeper123123321
2b843d24b9 fabric client-side commands 2021-04-09 15:39:21 -03:00
creeper123123321
cfa0c89178 21w14a 2021-04-09 15:14:10 -03:00
creeper123123321
16d3729f03 update via 2021-04-09 14:26:52 -03:00
creeper123123321
cc4cc7f265 update via 2021-04-09 14:26:48 -03:00
creeper123123321
6098ac90ec fix build 2021-04-03 08:17:48 -03:00
creeper123123321
fb10c60e32 fix build 2021-04-03 08:17:31 -03:00
creeper123123321
9460bd1a9f remove license header 2021-04-03 08:07:06 -03:00
creeper123123321
4b2d2e8586 remove license header 2021-04-03 08:06:43 -03:00
creeper123123321
670086c049 GPL 2021-04-02 12:03:58 -03:00
creeper123123321
8fcb0cf97c GPL 2021-04-02 12:03:06 -03:00
creeper123123321
64258b7742 viaversion update 2021-04-02 11:20:29 -03:00
creeper123123321
e03a3d3aa6 viaversion update 2021-04-01 17:53:46 -03:00
creeper123123321
aa322427e1 try to fix cf 2021-03-31 17:43:31 -03:00
creeper123123321
98edd5ac90 try to fix cf 2021-03-31 17:40:51 -03:00
creeper123123321
d29d8235db append commit hash 2021-03-31 16:49:01 -03:00
creeper123123321
4356d2fbca append commit hash 2021-03-31 16:48:12 -03:00
creeper123123321
333b2e0eab use GH workflow for curseforge 2021-03-31 16:36:46 -03:00
creeper123123321
53801b03ec use GH workflow for curseforge 2021-03-31 16:36:26 -03:00
creeper123123321
a52097ff1c java 11 workflow 2021-03-30 08:52:39 -03:00
creeper123123321
63a1be763e java 11 workflow 2021-03-30 08:52:06 -03:00
creeper123123321
885f881a83 try to fix npe 2021-03-19 17:09:07 -03:00
creeper123123321
41a7211715 update gradle and loom 2021-03-19 17:08:12 -03:00
creeper123123321
0e3e6e27ea update gradle and loom 2021-03-19 17:07:47 -03:00
creeper123123321
cdad3dbe3a adventure 2021-03-19 16:57:58 -03:00
creeper123123321
d7276da2ea try to fix npe 2021-03-19 16:43:47 -03:00
creeper123123321
02c96d412e
warn about using 1.17 build on 1.16.5
closes #106
2021-03-15 19:13:44 -03:00
Alexander
c59e902c87
Update to 21w08b and ViaVersion to 3.3.0-21w08b (#103)
Took 38 minutes
2021-02-27 12:21:15 -03:00
creeper123123321
7e2053d808 add multiconnect to readme 2021-02-07 08:40:17 -03:00
Michael
0db41aab10
Update to 21w05a (#100) 2021-02-03 19:16:31 -03:00
creeper123123321
8df4c9d4d5
add multiconnect to readme 2021-01-31 07:02:30 -03:00
creeper123123321
416e5c42a8 add 1.16.5 to list 2021-01-23 16:32:16 -03:00
creeper123123321
4af1506648 add 1.16.5 to list 2021-01-23 16:31:51 -03:00
creeper123123321
1b759733a7 update 21w03a 2021-01-23 16:30:56 -03:00
creeper123123321
bc86bff22b 0.3.1, update gradle 2021-01-23 16:20:53 -03:00
creeper123123321
412637442f 0.3.1, update gradle 2021-01-23 16:20:33 -03:00
creeper123123321
bf7d4a5045 update readme, parse .viafabric before autodetect, close #89 by stealing viaversion-velocity code 2021-01-11 12:02:56 -03:00
creeper123123321
db57b474d9 update readme, parse .viafabric before autodetect, close #89 by stealing viaversion-velocity code 2021-01-11 12:02:03 -03:00
creeper123123321
98d9052aaf closes #90 2021-01-03 17:22:09 -03:00
creeper123123321
2c3937f1e2 closes #90 2021-01-03 17:21:58 -03:00
creeper123123321
8c4a37ef9a fix #89 2021-01-03 16:37:14 -03:00
creeper123123321
d90bb4640a fix #89 2021-01-03 16:36:53 -03:00
creeper123123321
ea21c68147 0.3.0-SNAPSHOT 2020-12-29 19:17:17 -03:00
creeper123123321
7149b5d630 0.3.0-SNAPSHOT 2020-12-29 19:17:08 -03:00
creeper123123321
99da63d7b2 update readme 2020-12-27 13:28:58 -03:00
creeper123123321
396db40877 update readme 2020-12-27 13:28:48 -03:00
creeper123123321
b33b58af61 1.17 2020-12-27 13:07:04 -03:00
creeper123123321
75f8661ac9 prepare 1.17 branch 2020-12-27 12:43:57 -03:00
creeper123123321
ab316ad2e1 update viaversion 2020-12-13 13:53:56 -03:00
creeper123123321
daa291b2b8 Implement #70 2020-12-05 17:53:08 -03:00
creeper123123321
bac7e86217 Fix #80 #81 2020-12-05 16:06:58 -03:00
creeper123123321
00aed06518 CancelEncoderException, not decoder 2020-11-14 18:20:43 -03:00
creeper123123321
18bd30cdbc Compact F3 debug 2020-11-14 18:16:15 -03:00
creeper123123321
8ecb679ac3 implements #74 2020-11-14 18:04:09 -03:00
creeper123123321
e463c2bfb8 implements #75, remove Shadow workaround 2020-11-14 17:33:04 -03:00
creeper123123321
7a74f411a4 #78 snakeyaml 2020-11-14 17:07:23 -03:00
creeper123123321
6112767ad3
Added VIAaaS and DirtMultiversion to alternatives 2020-11-10 20:30:38 -03:00
creeper123123321
84a3079378 update readme and curseforge mc version 2020-11-02 16:21:09 -03:00
creeper123123321
d277fc4fde 0.2.16, via 3.2.0 2020-11-02 15:54:50 -03:00
creeper123123321
61938c9430 viaversion 3.2.0-1.16.4-rc2 2020-11-01 20:31:44 -03:00
maximeurban
4b49a3deab
Added langs : es, fr, nl, jp, ru, it and updated already existing ones (#56)
* Langs : es, fr, nl, jp, ru, it and updated others

* Changed brazilian name to portugese

* added Jo0001 changes

* Added mihapain1 changes

* Error by mihapain1

* Added more changes by mihapain1

* revert to pt_br + some changes

* Make de_de button not overflow

Co-authored-by: Gerrygames <gecam59@gmail.com>

Co-authored-by: creeper123123321 <7974274+creeper123123321@users.noreply.github.com>
Co-authored-by: Gerrygames <gecam59@gmail.com>
2020-10-20 04:58:58 -03:00
Madis Otenurm
ec195a15f4
Create et_ee.json (#67) 2020-10-20 04:37:15 -03:00
mygizli04
d55b076737
Added lang: Turkish (#57)
* Create tr_tr.json

* “Protokol”
2020-10-20 04:29:00 -03:00
creeper123123321
c25b09355c Fixed version auto detector .write() warn, fixed multiconnect integration behaviour: now checks if suggested version will be supported by ViaFabric 2020-10-18 11:41:59 -03:00
creeper123123321
bec45c4dbd compile push script 2020-10-17 17:09:19 -03:00
creeper123123321
c6a9cef362 0.1.15: Fixed multiconnect integration broken in 0.1.13, closes 2020-10-17 17:00:30 -03:00
creeper123123321
754bdd855d Hold messages for auto protocol detector, fixes #65, 0.2.14 2020-10-17 16:10:51 -03:00
creeper123123321
748085f8aa fix #64 2020-10-17 08:01:22 -03:00
creeper123123321
3fead84f59 Some GUI fixes, update readme, protocol auto detector
closes #33
2020-10-16 11:22:43 -03:00
creeper123123321
43c62a5d9c another missing override annotation 2020-10-11 19:10:14 -03:00
creeper123123321
98311a6b8d missing override 2020-10-11 19:05:11 -03:00
creeper123123321
9ba05e0fbe fix config client-side consent screen 2020-10-03 17:58:16 -03:00
creeper123123321
326310d5c9
try to make more clear about 1.8/1.14-1.16 2020-09-28 10:51:18 -03:00
creeper123123321
20cfd8af73 update loom 2020-09-27 11:52:50 -03:00
creeper123123321
86eb3d54f1 workaround FabricMC/fabric-loom#279, implement #52, update gradle and fabric, update README.md 2020-09-16 10:19:51 -03:00
creeper123123321
d7c0e2fece try to fix #53 2020-09-15 19:01:40 -03:00
creeper123123321
4c52cdc097 separate 1.14 and 1.15 branches 2020-09-14 20:41:45 -03:00
creeper123123321
9b1051b6d6 update viaversion, 0.2.11, try to make maven work 2020-09-14 19:58:08 -03:00
creeper123123321
3a39c4cf7f update readme, remove programemrartinjector from cursegradle 2020-08-28 06:25:19 -03:00
creeper123123321
9f3e0d2ff3 remove programmer art injector, it's causing issues 2020-08-28 06:18:23 -03:00
creeper123123321
46cc0b729f 0.2.9, fix ProtocolViaFabricHostname, update README 2020-08-25 10:24:05 -03:00
creeper123123321
24908febbc fix MixinServerAddress in 1.16 2020-08-25 09:54:53 -03:00
creeper123123321
fad8151ca1 Daemon thread, implement per server version
fixes #45 and implements #34
2020-08-25 09:36:07 -03:00
creeper123123321
d207d9a7ef [ci skip] update README 2020-08-14 15:50:13 -03:00
creeper123123321
8577eeb96a
fixed version name 2020-08-14 13:24:43 -03:00
creeper123123321
8f9d637d62 0.2.8, make fabric commands optional 2020-08-14 12:57:21 -03:00
creeper123123321
b029905968 Update LICENSE 2020-08-14 11:31:22 -03:00
creeper123123321
2969605ad7 update readme and viaversion to 3.1.0 2020-08-11 14:07:34 -03:00
Joseph Burton
94e8eee976
Add multiconnect beta check (#43) 2020-08-11 09:49:35 -03:00
creeper123123321
606dca4864 Update ViaVersion and README 2020-08-07 09:00:17 -03:00
creeper123123321
a25603fc99 bundle viaversion and snakeyaml
ViaVersion/ViaVersion#1959
2020-08-06 10:45:40 -03:00
creeper123123321
3c0d44c8a2 new via button, fixes #42 programmer's art
side effect: older versions will have the newest design
2020-08-05 10:11:51 -03:00
creeper123123321
8653889fea [ci skip] fix when api key isn't set 2020-08-05 08:29:03 -03:00
creeper123123321
cac25115ab hope this works 2020-08-05 08:26:51 -03:00
creeper123123321
3388885b1b use system env instead of project property 2020-08-05 08:21:54 -03:00
creeper123123321
d049a80010 update readme, try to use cursegradle 2020-08-05 07:52:25 -03:00
creeper123123321
071ed15947 [ci skip] oops 2020-08-04 09:35:16 -03:00
creeper123123321
b1245bffc0 [ci skip] update readme client-side version chart 2020-08-04 09:31:47 -03:00
creeper123123321
70a19739e1 make curseforge badge more visible 2020-08-04 09:10:29 -03:00
creeper123123321
262e5ffd9d grammar, use ViaVersion 3.1.0-1.16.2-pre1, reenable travis cache 2020-08-04 08:14:11 -03:00
creeper123123321
7c183177bd Update issue templates 2020-08-04 08:06:00 -03:00
creeper123123321
771887c01a use viaversion modcontainer version, update issue templates
closes #41
2020-08-04 07:57:43 -03:00
creeper123123321
dccf63bb86 [ci skip] version graph 2020-07-26 13:29:44 -03:00
creeper123123321
398d180652 very high quality logo inspired by foamfix, add contributors and contact info 2020-07-26 11:42:49 -03:00
creeper123123321
aef11c660f
fix table 2020-07-21 13:49:05 -03:00
creeper123123321
e8c857e05a hide github releases from readme, update oauth key 2020-07-21 09:57:03 -03:00
creeper123123321
c8775600f2 Update README.md and fix mod id in fabric.mod.json 2020-07-14 17:19:27 -03:00
creeper123123321
6a80862f8a fix branch name on travis 2020-07-12 16:47:56 -03:00
creeper123123321
df6430a127 port some changes from 1.8 branch 2020-07-12 16:40:30 -03:00
creeper123123321
12daf60f95
[ci skip] update readme 2020-07-09 16:04:54 -03:00
creeper123123321
61e655b212 check for multiconnect when trying to integrate, fix blocked servers 2020-07-06 13:41:42 -03:00
creeper123123321
76a22655cc Fix server blocking with multiconnect 2020-07-06 12:12:23 -03:00
creeper123123321
77fc8bd16b still not fixed 2020-07-04 17:23:21 -03:00
creeper123123321
2a35f37d8e fix travis 2020-07-04 17:16:25 -03:00
creeper123123321
9709bd6449 remove failed attempt to implement UpdateListener and some client-side code for VRPlatform, implement #32, update README.md, show client version in F3, multiconnect integration 2020-07-04 17:02:02 -03:00
creeper123123321
d879d57baf fix legacy text in NMSCommandSender 2020-07-01 18:00:45 -03:00
creeper123123321
bd70a8365b Fix legacy text 2020-07-01 17:50:34 -03:00
creeper123123321
c9b6313a72 Add update listener, fix ViaVersion dependency, fix UUID usages 2020-07-01 17:29:06 -03:00
creeper123123321
c8b991d5df
[ci skip] create FUNDING.yml 2020-07-01 14:38:14 -03:00
creeper123123321
cfa2e8b69e [ci skip] fix CurseForge badge 2020-06-29 16:38:20 -03:00
creeper123123321
c56e69fd1a update gradlew and workaround building 2020-06-25 16:57:55 -03:00
creeper123123321
c15f247b61 Better quality logo, change debug message 2020-06-25 15:47:09 -03:00
creeper123123321
7e4a526e3d Add debug and update ViaVersion 3.0.2, ViaFabric 0.2.4-SNAPSHOT 2020-06-25 13:56:49 -03:00
creeper123123321
7114988372 [ci skip] update readme, add more alternatives 2020-06-25 10:08:01 -03:00
creeper123123321
f1aa2728ca update cotton-client-commands, fabric commands, add more info in readme, fix typo, rename logger 2020-06-23 16:29:12 -03:00
creeper123123321
010b91d618 update homepage url 2020-06-23 13:44:27 -03:00
creeper123123321
9b9ebf0533 fix date format 2020-06-23 13:06:32 -03:00
creeper123123321
1e1d11e217 update loom 2020-06-23 12:46:59 -03:00
creeper123123321
212a7aea17 add logo and update dependencies 2020-06-23 12:45:22 -03:00
creeper123123321
4d7bcf92ea add curseforge link to readme, conflicts, alternatives and more information, update viaversion link 2020-06-23 12:29:21 -03:00
KennyTV
3051b32d07
Update codec handlers 2020-06-10 09:18:47 +02:00
Alexander
14ccf796d5
Update to 1.16-pre2 (#23) 2020-06-06 05:16:09 -03:00
creeper123123321
35b9d8b07c Fix logging on future cancelling 2020-04-30 10:21:08 -03:00
creeper123123321
253a4452c6 update to latest snapshot 2020-04-29 16:02:20 -03:00
creeper123123321
0973ddadec 0.2.2-SNAPSHOT, make compatible with latest ViaVersion, cotton-client-commands is actually included and is a dependency 2020-04-29 15:43:01 -03:00
creeper123123321
83abb49752
[ci skip] Update README 2020-04-16 14:01:27 -03:00
creeper123123321
e7b8e573e2 clean some implementation code, implement new via changes, fixed mod dump, 0.2.2-SNAPSHOT, fix semver 2020-04-16 13:39:00 -03:00
creeper123123321
392ea470b2 trying to fix .travis.yml 2020-04-16 12:35:26 -03:00
creeper123123321
988a6b5202 Allow building on ver/* branches 2020-04-16 12:35:22 -03:00
creeper123123321
a3b080d49a 20w15a 2020-04-14 12:39:09 -03:00
529 changed files with 25253 additions and 2331 deletions

4
.editorconfig Normal file
View File

@ -0,0 +1,4 @@
root = true
[*.java]
indent_style = space

2
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,2 @@
custom: ['https://viaversion.com/donate', 'https://creeper123123321.github.io/#donate', 'https://florianmichael.de/donate']
github: FlorianMichael

View File

@ -1,26 +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. Can you https://hastebin.com the error?
**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?

92
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@ -0,0 +1,92 @@
name: Bug Report
description: Report a bug or console error
labels: [bug]
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. If you're using client-side mode, run it on singleplayer mode.
placeholder: |
https://dump.viaversion.com/...
validations:
required: true
- type: textarea
attributes:
label: Console 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.
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.13.2 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.
placeholder: |
Example:
1. Login with a 1.13.2 client
2. Place a sign
3. The sign text is displayed wrong
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: |
Describe what exactly you expected to happen.
placeholder: |
Example: "Placed sign text should not disappear."
validations:
required: true
- type: textarea
attributes:
label: Additional Server Info
description: |
Does the server use a proxy (eg. Velocity)? What software are used and what plugins/mods (Check with F3 debug menu)? Are you using client-side mode?
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: I have checked if this is specific to ViaFabric platform, and doesn't happen when running it on other platforms (Paper/Sponge/Velocity/Waterfall).
required: false
- 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

View File

@ -1,12 +1,19 @@
---
name: Feature request
about: Suggest an idea for ViaVersion
about: Suggest an idea for ViaFabric
title: ''
labels: enhancement
assignees: ''
---
**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 [...]
**Is this related specifically to ViaFabric?**
(Optional)
- [ ] It seems to not apply for ViaVersion/ViaBackwards/ViaRewind installed on Bukkit/BungeeCord/Sponge/Velocity servers.
**Describe the solution you'd like**
A clear and concise description of what you want to happen.

33
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: Java CI with Gradle
on: [ pull_request, push ]
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
check-latest: true
- name: Cache Dependencies
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build with Gradle
run: ./gradlew build
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Artifacts
path: build/libs/

23
.github/workflows/publish.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: Publish to CurseForge and Modrinth
on: [workflow_dispatch] # Manual trigger
jobs:
publish:
if: github.repository_owner == 'ViaVersion'
runs-on: ubuntu-24.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
check-latest: true
- name: Build and Publish
env:
CURSEFORGE_API_KEY: ${{ secrets.CREEPER_CF }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
run: ./gradlew curseforge modrinth

View File

@ -0,0 +1,10 @@
<component name="CopyrightManager">
<settings>
<module2copyright>
<element module="Project Files" copyright="viafabric-gpl" />
</module2copyright>
<LanguageOptions name="__TEMPLATE__">
<option name="addBlankAfter" value="false" />
</LanguageOptions>
</settings>
</component>

View File

@ -0,0 +1,6 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric&#10;Copyright (C) 2018-&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="viafabric-gpl" />
</copyright>
</component>

View File

@ -1,23 +0,0 @@
language: java
#before_cache:
#- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
#- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
#cache:
# directories:
# - "$HOME/.gradle/caches/"
# - "$HOME/.gradle/wrapper/"
deploy:
provider: releases
api_key:
secure: B+xrpk79kvRF5AhNqHKlsUd1vloo4xe1oZjzsmsm67rrd2RS9iBgpRBC5YfCeYmxj5HviBjQx3Qzdu/zzaYP9ry5IT17t5g3OcPpP9GynyinIlfAN6TUlk9u0D7ojSYV6JJjD7Go8K9+U5E+jEn4cSIVQ4kFWH62lDyjjNQqZitd4p+/J9M4p5sQ9BiC2oUIFVMrOXZs5v0tqVSCWGp/s2OkX+ie/RYm1ULW4vvpwTlK2+fklOfq2qyityPtV1v6DQoOMJ4GdouBVGtva7hdnuHtCCqVvwTnpgmItLE68uCczgR4gQ5SIeCo7Vppda6jSseA5DDku1YwUUTRm1VOENhmv3iln9sDRiZbX17d86689FslMAltSggmg4urEPmjzlP55NCebvEsQoKp8x3XuViUOUqkQS+e/IGkK1F4oeh4YB7Mz6LyGM3TOv2gfE+nbQ4xU7s1nELoqdwUp2HshN4SFxurLtKDfC2/ZHRwtwXhGbEQgK0TSRSohxoE8a1XZvXLJ+ddc8ZZX8LqBiKgXkkEyvpAehAqK+lWsqIBJp+828CMeUet9sYNJ9QkAy3Lz8ecwuzCXEuacTW+f6XW1rBr2wPSXOJQt45xt4IfW1so7G1V5QSmcExU3uKKxkgekOnhZjT8LTmUpaSBW1Nu2a5kKuHnHvs0uDexhoJ/cEs=
file_glob: true
file: build/libs/*
skip_cleanup: true
on:
repo: ViaVersion/ViaFabric
install: true
script:
# Set up git user name and tag this commit
- if [ -z $TRAVIS_TAG ] && [ -z $(git tag -l --points-at HEAD) ]; then git config --local user.name "creeper12313321"; git config --local user.email "7974274+creeper123123321@users.noreply.github.com"; export TRAVIS_TAG=build-$TRAVIS_JOB_NUMBER; git tag $TRAVIS_TAG; fi
- ./gradlew clean build

17
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,17 @@
# Contributing
## Language Files
Language files are under ``src/main/resources/assets/viafabric/lang/``. Please edit ``.json`` files. Create a ``.lang``
with ``${nameofjson}``, so the build script can convert automatically to the old format.
Use capitalization rules from your language. Try to be consistent with Minecraft language files.
Please check in-game string length. Note that abbreviations may cause issues with the screen reader.
Take a look at UN's guidelines for Gender-inclusive
language: https://www.un.org/en/gender-inclusive-language/guidelines.shtml
## Source Code
Use 4 spaces, run code cleanup and ``optipng`` on new png files.

687
LICENSE
View File

@ -1,21 +1,674 @@
MIT License
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (c) 2018 creeper123123321 and contributors
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>.

163
README.md
View File

@ -1,35 +1,154 @@
# ViaFabric
[![Travis Build Status](https://travis-ci.com/ViaVersion/ViaFabric.svg?branch=master)](https://travis-ci.com/ViaVersion/ViaFabric)
[![ViaVersion Discord](https://img.shields.io/badge/chat-on%20discord-blue.svg)](https://viaversion.com/discord)
[![GitHub Releases](https://img.shields.io/github/downloads/ViaVersion/ViaFabric/total)](https://github.com/ViaVersion/ViaFabric/releases)
**Client-side and server-side ViaVersion implementation for Fabric**
[![ViaVersion Discord](https://img.shields.io/badge/chat-on%20discord-blue.svg)](https://viaversion.com/discord)
[![CurseForge Downloads](http://cf.way2muchnoise.eu/full_viafabric_downloads.svg)](https://viaversion.com/fabric)
[![Modrinth Downloads](https://img.shields.io/modrinth/dt/ViaFabric?label=Modrinth&logo=Modrinth&style=flat-square)](https://modrinth.com/mod/ViaFabric)
[![CurseForge Versions](http://cf.way2muchnoise.eu/versions/viafabric.svg)](https://viaversion.com/fabric)
<!-- ^ GitHub seems to not like this https -->
### Client-side and server-side ViaVersion implementation for Fabric
Allows the connection to/from different Minecraft versions on your Minecraft client/server (LAN worlds too)
This mod supports 1.14.4/1.15.x with Fabric Loader
This mod can be installed on 1.8.9, 1.12.2, 1.14.4, 1.15.2, 1.16.5, 1.17.1, 1.18.2, 1.19.4, 1.20.1, 1.20.4, 1.20.6, 1.21 with Fabric Loader.
Note: ViaVersion is not designed for modded Minecraft with modified registries
## Dependencies
| Dependency | Download |
|-----------------------------------------------|----------------------------------------------------------------|
| (Bundled) ViaVersion | https://viaversion.com/ |
| (Bundled) Cotton Client Commands (MC 1.14-15) | https://jitpack.io/#TinfoilMC/ClientCommands |
| Fabric API (MC 1.14+) | https://modrinth.com/mod/fabric-api |
| Legacy Fabric API (MC 1.8.9 and 1.12.2) | https://modrinth.com/mod/legacy-fabric-api |
**Dependencies:**
| Dependency | Download |
| --- | --- |
| ViaVersion 3.0.0+ | dev builds at https://ci.viaversion.com/job/ViaVersion-Abstraction/ |
| Fabric Textures v0 | https://www.curseforge.com/minecraft/mc-mods/fabric-api |
| Fabric Resource Loader v0 | https://www.curseforge.com/minecraft/mc-mods/fabric-api |
| Fabric Commands v0 | https://www.curseforge.com/minecraft/mc-mods/fabric-api |
| (Optional) Cotton Client Commands | https://www.curseforge.com/minecraft/mc-mods/cotton-client-commands |
Note: ViaVersion is designed for Vanilla Minecraft servers. It probably will not work with modded registry entries or
registry synchronization (fabric-registry-sync mod).
## ViaVersion
With ViaVersion:
- your server can accept newer versions
- your client can connect to older versions
### How can I install ViaBackwards/ViaRewind?:
- Just drop them into mods folder. Make sure you are using versions compatible with the ViaVersion version you are
using.
Adding ViaBackwards (and optionally ViaRewind):
- your server can accept older versions
- your client can connect to newer versions
### What versions can ViaVersion, ViaBackwards and ViaRewind translate?:
## WARNING
**I can not guarantee that this mod is allowed on every (or even any) server. This mod may cause problems with anti cheat plugins. USE AT OWN RISK**
- **With [ViaVersion](https://viaversion.com)**:
Your server can accept newer versions. Your client can connect to older versions.
- **Adding [ViaBackwards](https://viaversion.com/backwards) (and
optionally [ViaRewind](https://viaversion.com/rewind))**:
Your server can accept older versions. Your client can connect to newer versions.
Note: When using ViaFabric for versions older than 1.17, you need [Java 8 builds](https://ci.viaversion.com/)
- Server-side: See https://viaversion.com/
- Client-side:
| | 1.8.9 | 1.9.x | 1.10-1.12.2 | 1.13-1.14.4 | 1.15.x | 1.16.x | 1.17.x | 1.18.x | 1.19.x | 1.20.x |
|---------------|-------|-------|-------------|-------------|--------|--------|--------|--------|--------|--------------------------------------------------------|
| 1.8.9 client | ✓ | ⏪ | ⏪⟲ | ⏪⟲ | ⏪⟲ | ⏪⟲ | ⏪⟲ | ⏪⟲ | ⏪⟲ | ⏪⟲ |
| 1.12.2 client | ✓ | ✓ | ✓ | ⏪ | ⏪ | ⏪ | ⏪ | ⏪ | ⏪ | ⏪ |
| 1.14.4 client | ✓ | ✓ | ✓ | ✓ | ⟲ | ⟲ | ⟲ | ⟲ | ⟲ | ⟲ |
| 1.15.2 client | ✓ | ✓ | ✓ | ✓ | ✓ | ⟲ | ⟲ | ⟲ | ⟲ | ⟲ |
| 1.16.5 client | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ⟲ | ⟲ | ⟲ | ⟲ |
| 1.17.1 client | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ⟲ | ⟲ | ⟲ |
| 1.18.2 client | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ⟲ | ⟲ |
| 1.19.4 client | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ⟲ |
| 1.20.1 client | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ *(⟲ if connecting to newer 1.20.2 - 1.20.6 servers)* |
| 1.20.4 client | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ *(⟲ if connecting to 1.20.6 servers)* |
| 1.20.6 client | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
✓ = [ViaVersion](https://viaversion.com) ⟲ = [ViaBackwards](https://viaversion.com/backwards) ⏪
= [ViaRewind](https://viaversion.com/rewind)
*Note: 1.7.x is not supported in ViaFabric - 1.9.x, 1.10.x, 1.11.x, and 1.13.x may cause problems when visiting such servers in client-side mode.*
### Can ViaVersion, ViaBackwards and ViaRewind support snapshots?:
- Check https://ci.viaversion.com/ for development builds with snapshot support
## Alternatives
### Client-side:
- [ClientViaVersion](https://github.com/Gerrygames/ClientViaVersion): Discontinued 5zig plugin.
- [multiconnect](https://www.curseforge.com/minecraft/mc-mods/multiconnect): Discontinued Fabric mod for connecting to older
versions: down to 1.11 (stable) and 1.8 (experimental).
- [ViaForge](https://www.modrinth.com/mod/viaforge): Clientside Implementation of ViaVersion for Forge.
- [ViaFabricPlus](https://www.modrinth.com/mod/viafabricplus): Fabric ViaVersion/ViaLegacy/ViaAprilFools/ViaBedrock implementation with client-side fixes.
### Server-side:
- [ProtocolSupport](https://protocol.support/): Bukkit plugin for older client versions (down to 1.4.7).
- [ViaVersion](https://viaversion.com): Plugin for BungeeCord, CraftBukkit, SpongeCommon and Velocity servers.
### Standalone proxy:
- [DirtMultiversion](https://github.com/DirtPowered/DirtMultiversion): Proxy allowing to connect down to Beta 1.3 with
newer Minecraft client versions.
- [VIAaaS](https://github.com/ViaVersion/VIAaaS): Standalone ViaVersion proxy with ViaBackwards and ViaRewind, allowing
you to connect without a mod installed on your client. Supports online mode.
- [ViaProxy](https://github.com/ViaVersion/ViaProxy): Standalone ViaVersion proxy with ViaBackwards, ViaRewind and ViaLegacy,
allowing you to connect to a wide range of versions (down to classic versions) with your modern client (1.7.2+). Supports online mode.
### Cool things to try:
- [Geyser](https://geysermc.org/): Plugins, Fabric mod and a standalone proxy for allowing Bedrock Edition on Java
Edition servers.
- [PolyMc](https://github.com/TheEpicBlock/PolyMc): Fabric mods which translates modded items and blocks, allowing
vanilla to connect using resource packs.
## Commands
### Commands:
- There're 3 server-side alias ``/viaversion``, ``/vvfabric`` and ``/viaver``, and a client-side command
``/viafabricclient`` for Minecraft 1.14+ (OP permission level 3 is required for these commands, received
by [Entity Status Packet](https://wiki.vg/Entity_statuses#Player))
## Configs
### Configuration:
- ViaVersion configuration is available at ``.minecraft/config/viafabric/viaversion.yml``
- ViaFabric configuration is at ``.minecraft/config/viafabric/viafabric.yml``
### How can I disable client-side ViaFabric?:
- You can disable it in the menu or by setting global protocol version to -1 (this will keep per-server translations
still enabled)
### How to use protocol detection?:
- For using globally, set the protocol to AUTO or -2. For using in a specific
server: ``ddns.example.com._v-2.viafabric``
- The protocol detector will try to ping with the client native protocol version, differently than multiconnect which
uses -1 version, which may detect the native server version.
### How can I set the version for specific servers?:
- Append ._v(VERSION).viafabric.
- Examples: ``minigame.example.com._v1_8.viafabric``, ``native.example.com._v-1.viafabric``
, ``auto.example.com._v-2.viafabric``
## ViaFabricPlus
### Does it work with ViaFabric:
- No, ViaFabric cannot be used with ViaFabricPlus.
### Differences with ViaFabricPlus:
| | ViaFabric | ViaFabricPlus |
|----------------------------------|-------------------------------------------------|-----------------------------------------------------------------|
| Can be installed on | Multiple client/server versions with fabric | Latest client-side version with fabric |
| Objectives | Simply implement ViaVersion | Implements ViaVersion with client-side fixes to version changes |
| How does it work? | Modifying packets at network code | Modifying client code more deeply |
| Triggering anti-cheats | Very likely | Mostly not |
## Disclaimer
It cannot be guaranteed that this mod is allowed on specific servers as it can possibly cause problems with anti-cheat plugins.\
***(USE ONLY WITH CAUTION!)***

239
build.gradle Normal file
View File

@ -0,0 +1,239 @@
// todo migrate this code to kotlin
import com.google.gson.JsonParser
import java.nio.file.Files
import java.util.stream.Collectors
import java.util.stream.IntStream
// Stolen https://github.com/FabricMC/fabric/blob/1.17/build.gradle
plugins {
id "java"
id "maven-publish"
id "org.ajoberstar.grgit" version "5.2.2"
id "com.matthewprenger.cursegradle" version "1.4.0" // This repository is archived on GH
id "com.modrinth.minotaur" version "2.8.7"
id "fabric-loom" version "1.6-SNAPSHOT" apply false
id "com.github.ben-manes.versions" version "0.51.0"
id "xyz.wagyourtail.jvmdowngrader" version "0.7.1"
}
def ENV = System.getenv()
group = "com.viaversion.fabric"
description = "Client-side and server-side ViaVersion implementation for Fabric"
version = "0.4.14+" + ENV.GITHUB_RUN_NUMBER + "-" + getBranch()
logger.lifecycle("Building ViaFabric: $version")
def getBranch() {
def ENV = System.getenv()
def branch = "unknown"
if (ENV.GITHUB_REF) {
branch = ENV.GITHUB_REF
} else if (grgit != null) {
branch = grgit.branch.current().name
}
return branch.substring(branch.lastIndexOf("/") + 1)
}
allprojects {
apply plugin: "maven-publish"
apply plugin: "fabric-loom"
java {
toolchain {
// lwjgl2 works with Adoptium
languageVersion = JavaLanguageVersion.of(21)
vendor = JvmVendorSpec.ADOPTIUM
}
withSourcesJar()
}
tasks.withType(JavaCompile).configureEach {
it.options.release.set(8)
}
tasks.withType(JavaExec).configureEach {
it.javaLauncher.set(javaToolchains.launcherFor(java.toolchain))
}
version = rootProject.version
group = rootProject.group
repositories {
mavenCentral()
maven { url = "https://repo.viaversion.com/" }
maven { url = "https://maven.fabricmc.net/" }
maven { url = "https://maven.legacyfabric.net/" }
maven { url = "https://maven.terraformersmc.com/releases/" }
maven { url = "https://jitpack.io/" }
}
dependencies {
// transitive = false because Guava is conflicting on runClient
implementation("com.viaversion:viaversion:${rootProject.viaver_version}") { transitive = false }
implementation("org.yaml:snakeyaml:${rootProject.yaml_version}")
modImplementation("net.fabricmc:fabric-loader:${rootProject.loader_version}")
}
processResources {
filesMatching("fabric.mod.json") {
it.expand(rootProject.properties)
}
}
}
subprojects {
dependencies {
implementation(rootProject) {
exclude group: "net.fabricmc", module: "fabric-loader" // prevent duplicate fabric-loader on run
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
setupRepositories(repositories)
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
setupRepositories(repositories)
}
static void setupRepositories(RepositoryHandler repositories) {
//repositories.mavenLocal() // uncomment for testing
def ENV = System.getenv()
if (ENV.MAVEN_URL) {
repositories.maven {
url ENV.MAVEN_URL
credentials {
username ENV.MAVEN_USERNAME
password ENV.MAVEN_PASSWORD
}
}
}
}
subprojects.each {
remapJar.dependsOn("${it.path}:remapJar")
}
configurations {
includeJ8
}
jvmdg.dg(configurations.includeJ8)
dependencies {
// dummy version
minecraft("com.mojang:minecraft:1.14.4")
mappings("net.fabricmc:yarn:1.14.4+build.18:v2")
includeJ8("com.viaversion:viaversion:${rootProject.viaver_version}")
include("org.yaml:snakeyaml:${rootProject.yaml_version}")
include("com.github.TinfoilMC:ClientCommands:1.1.0")
}
remapJar {
nestedJars.from configurations.includeJ8
afterEvaluate {
subprojects.each {
nestedJars.from project("${it.path}").tasks.named("remapJar")
}
}
}
processResources {
filesMatching("assets/*/lang/*.lang") {
HashMap<String, String> langMap = new HashMap<>()
Files.list(rootProject.file("src/main/resources/assets/viafabric/lang").toPath())
.filter(path -> path.toString().endsWith(".json"))
.forEach(path -> {
String legacyFile = "\n" + String.join("\n", JsonParser
.parseReader(Files.newBufferedReader(path)).asJsonObject.entrySet().stream()
.map(entry -> entry.key + "=" + entry.value.asString)
.toArray(String[]::new))
langMap.put(path.getFileName().toString().replace(".json", ""), legacyFile)
})
it.expand(langMap)
}
}
List<String> mcReleases = Arrays.stream(rootProject.publish_mc_versions.toString().split(","))
.map({ it -> it.trim() })
.collect(Collectors.toList())
List<String> javaVersions = IntStream.rangeClosed(8, 22)
.mapToObj { n -> (String) "Java $n" }
.collect(Collectors.toList())
String changelogMsg = "A changelog can be found at https://github.com/ViaVersion/ViaFabric/commits"
String versionNameMsg = "[${getBranch()}] ViaFabric " + rootProject.version
curseforge {
if (ENV.CURSEFORGE_API_KEY) {
apiKey = ENV.CURSEFORGE_API_KEY
}
project {
id = "391298"
changelog = changelogMsg
releaseType = "beta" // alpha is hidden by default
mcReleases.forEach { ver -> addGameVersion(ver) }
if (!rootProject.curseforge_mc_snapshot.isEmpty()) addGameVersion(rootProject.curseforge_mc_snapshot)
javaVersions.forEach(v -> addGameVersion(v))
addGameVersion("Fabric")
mainArtifact(remapJar) {
displayName = versionNameMsg
relations {
optionalDependency("fabric-api")
optionalDependency("legacy-fabric-api")
embeddedLibrary("cotton-client-commands")
}
}
afterEvaluate {
uploadTask.dependsOn("remapJar")
}
}
options {
forgeGradleIntegration = false
}
}
modrinth {
token.set(ENV.MODRINTH_TOKEN)
projectId.set("YlKdE5VK")
versionType.set("alpha")
versionNumber.set(rootProject.version)
versionName.set(versionNameMsg)
changelog.set(changelogMsg)
uploadFile.set(remapJar)
List<String> mcs = new ArrayList<>(mcReleases)
if (!rootProject.modrinth_mc_snapshot.isEmpty()) mcs.add(rootProject.modrinth_mc_snapshot.toString())
gameVersions.set(mcs)
loaders.set(["fabric"])
dependencies {
optional.project "P7dR8mSH" // fabric api
optional.project "9CJED7xi" // legacy fabric api
embedded.project "P1OZGk5p" // viaversion
}
}
defaultTasks("clean", "build")

View File

@ -1,69 +0,0 @@
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id("java")
id("net.minecrell.licenser") version "0.4.1"
id("fabric-loom") version "0.2.7-SNAPSHOT"
id("com.palantir.git-version") version "0.12.0-rc2"
}
group = "com.github.creeper123123321.viafabric"
val gitVersion: groovy.lang.Closure<Any> by extra
version = "0.2.1-SNAPSHOT+" + try {
gitVersion()
} catch (e: Exception) {
"unknown"
} + "+1.14-1.15"
extra.set("archivesBaseName", "ViaFabric")
description = "Client-side and server-side ViaVersion implementation for Fabric"
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
extra.set("sourceCompatibility", 1.8)
extra.set("targetCompatibility", 1.8)
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven(url = "https://repo.viaversion.com/")
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
maven(url = "https://maven.fabricmc.net/")
maven(url = "https://server.bbkr.space/artifactory/libs-snapshot")
maven(url = "https://server.bbkr.space/artifactory/libs-release")
}
tasks.named<ProcessResources>("processResources") {
filesMatching("fabric.mod.json") {
filter<ReplaceTokens>("tokens" to mapOf(
"version" to project.property("version"),
"description" to project.property("description")
))
}
}
dependencies {
// transitive = false because Guava is conflicting on runClient
implementation("us.myles:viaversion:3.0.0-SNAPSHOT") { isTransitive = false }
// Use 1.14.4 release, probably intermediary will make it work on snapshots
// https://modmuss50.me/fabric.html?&version=1.14.4
minecraft("com.mojang:minecraft:1.14.4")
mappings("net.fabricmc:yarn:1.14.4+build.16:v2")
modImplementation("net.fabricmc:fabric-loader:0.8.2+build.194")
modImplementation("net.fabricmc.fabric-api:fabric-api:0.4.3+build.247-1.14")
modImplementation("io.github.cottonmc:cotton-client-commands:1.0.0+1.15.2")
include("io.github.cottonmc:cotton-client-commands:1.0.0+1.15.2")
}
minecraft {
}
license {
include("**/*.java")
}

View File

@ -1 +1,12 @@
org.gradle.jvmargs=-Xmx1G -XX:+UseG1GC
# suppress inspection "UnusedProperty" for whole file
org.gradle.jvmargs=-Xms32M -Xmx4G -XX:+UseG1GC -XX:+UseStringDeduplication
loader_version=0.15.11
viaver_version=5.0.2-SNAPSHOT
yaml_version=2.2
publish_mc_versions=1.21, 1.20.6, 1.20.4, 1.20.1, 1.19.4, 1.18.2, 1.17.1, 1.16.5, 1.15.2, 1.14.4, 1.12.2, 1.8.9
# example: 1.19.1-rc1. Can be a blank value
modrinth_mc_snapshot=
# example: 1.19-Snapshot. Can be a blank value
curseforge_mc_snapshot=

Binary file not shown.

View File

@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

298
gradlew vendored
View File

@ -1,7 +1,7 @@
#!/usr/bin/env sh
#!/bin/sh
#
# Copyright 2015 the original author or authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -15,80 +15,115 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
##
## Gradle start up script for UN*X
##
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
MAX_FD=maximum
warn () {
echo "$*"
}
} >&2
die () {
echo
echo "$*"
echo
exit 1
}
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@ -97,87 +132,120 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
exec "$JAVACMD" "$@"
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

64
gradlew.bat vendored
View File

@ -13,8 +13,10 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@ -25,25 +27,29 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
@ -51,50 +57,38 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
:omega

7
jitpack.yml Normal file
View File

@ -0,0 +1,7 @@
# Deploys the latest stable JDK 21 available and sets it to default without having to manually specify it here,
# Which includes using temurin as the distribution.
before_install:
- curl -s "https://get.sdkman.io" | bash
- source ~/.sdkman/bin/sdkman-init.sh
- sdk install java 21.0.3-tem
- sdk use java 21.0.3-tem

View File

@ -1,10 +0,0 @@
pluginManagement {
repositories {
jcenter()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
gradlePluginPortal()
}
}

26
settings.gradle.kts Normal file
View File

@ -0,0 +1,26 @@
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
maven ("https://maven.fabricmc.net/")
}
}
rootProject.name = "ViaFabric"
include("viafabric-mc189")
include("viafabric-mc1122")
include("viafabric-mc1144")
include("viafabric-mc1152")
include("viafabric-mc1165")
include("viafabric-mc1171")
include("viafabric-mc1182")
include("viafabric-mc1194")
include("viafabric-mc1201")
include("viafabric-mc1204")
include("viafabric-mc1206")
include("viafabric-mc121")
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}

View File

@ -1,102 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric;
import com.github.creeper123123321.viafabric.commands.VRCommandHandler;
import com.github.creeper123123321.viafabric.config.VRConfig;
import com.github.creeper123123321.viafabric.platform.VRInjector;
import com.github.creeper123123321.viafabric.platform.VRLoader;
import com.github.creeper123123321.viafabric.platform.VRPlatform;
import com.github.creeper123123321.viafabric.util.JLoggerToLog4j;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
import io.netty.channel.DefaultEventLoop;
import io.netty.channel.EventLoop;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.registry.CommandRegistry;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.server.command.CommandSource;
import org.apache.logging.log4j.LogManager;
import us.myles.ViaVersion.ViaManager;
import us.myles.ViaVersion.api.Via;
import us.myles.ViaVersion.api.data.MappingDataLoader;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.logging.Logger;
public class ViaFabric implements ModInitializer {
public static final Logger JLOGGER = new JLoggerToLog4j(LogManager.getLogger("ViaFabric"));
public static final ExecutorService ASYNC_EXECUTOR;
public static final EventLoop EVENT_LOOP;
public static VRConfig config;
static {
ThreadFactory factory = new ThreadFactoryBuilder().setNameFormat("ViaFabric-%d").build();
ASYNC_EXECUTOR = Executors.newFixedThreadPool(8, factory);
EVENT_LOOP = new DefaultEventLoop(factory);
}
public static String getVersion() {
return FabricLoader.getInstance().getModContainer("viafabric")
.get().getMetadata().getVersion().getFriendlyString();
}
public static <S extends CommandSource> LiteralArgumentBuilder<S> command(String commandName) {
return LiteralArgumentBuilder.<S>literal(commandName)
.then(
RequiredArgumentBuilder
.<S, String>argument("args", StringArgumentType.greedyString())
.executes(((VRCommandHandler) Via.getManager().getCommandHandler())::execute)
.suggests(((VRCommandHandler) Via.getManager().getCommandHandler())::suggestion)
)
.executes(((VRCommandHandler) Via.getManager().getCommandHandler())::execute);
}
@Override
public void onInitialize() {
Via.init(ViaManager.builder()
.injector(new VRInjector())
.loader(new VRLoader())
.commandHandler(new VRCommandHandler())
.platform(new VRPlatform()).build());
FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache());
Via.getManager().init();
FabricLoader.getInstance().getEntrypoints("viafabric:via_api_initialized", Runnable.class).forEach(Runnable::run);
CommandRegistry.INSTANCE.register(false, c -> c.register(command("viaversion")));
CommandRegistry.INSTANCE.register(false, c -> c.register(command("viaver")));
CommandRegistry.INSTANCE.register(false, c -> c.register(command("vvfabric")));
config = new VRConfig(FabricLoader.getInstance().getConfigDirectory().toPath().resolve("ViaFabric")
.resolve("viafabric.yml").toFile());
}
}

View File

@ -1,60 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.commands;
import us.myles.ViaVersion.api.Via;
import us.myles.ViaVersion.api.command.ViaCommandSender;
import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
import java.util.UUID;
public class UserCommandSender implements ViaCommandSender {
private UserConnection con;
public UserCommandSender(UserConnection con) {
this.con = con;
}
@Override
public boolean hasPermission(String s) {
return false;
}
@Override
public void sendMessage(String s) {
Via.getPlatform().sendMessage(getUUID(), s);
}
@Override
public UUID getUUID() {
return con.get(ProtocolInfo.class).getUuid();
}
@Override
public String getName() {
return con.get(ProtocolInfo.class).getUsername();
}
}

View File

@ -1,37 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.commands;
import com.github.creeper123123321.viafabric.ViaFabric;
import com.mojang.brigadier.CommandDispatcher;
import io.github.cottonmc.clientcommands.ClientCommandPlugin;
import io.github.cottonmc.clientcommands.CottonClientCommandSource;
public class VRClientCommands implements ClientCommandPlugin {
@Override
public void registerCommands(CommandDispatcher<CottonClientCommandSource> commandDispatcher) {
commandDispatcher.register(ViaFabric.command("viafabricclient"));
}
}

View File

@ -1,75 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.config;
import net.minecraft.SharedConstants;
import us.myles.ViaVersion.util.Config;
import java.io.File;
import java.net.URL;
import java.util.Collections;
import java.util.List;
import java.util.Map;
public class VRConfig extends Config {
public static final String ENABLE_CLIENT_SIDE = "enable-client-side";
public static final String CLIENT_SIDE_VERSION = "client-side-version";
public VRConfig(File configFile) {
super(configFile);
reloadConfig();
}
@Override
public URL getDefaultConfigURL() {
return getClass().getClassLoader().getResource("assets/viafabric/config.yml");
}
@Override
protected void handleConfig(Map<String, Object> map) {
}
@Override
public List<String> getUnsupportedOptions() {
return Collections.emptyList();
}
public boolean isClientSideEnabled() {
return getBoolean(ENABLE_CLIENT_SIDE, false);
}
public int getClientSideVersion() {
int nat = SharedConstants.getGameVersion().getProtocolVersion();
return !isClientSideEnabled() ? nat : getInt(CLIENT_SIDE_VERSION, -1);
}
public void setClientSideEnabled(boolean val) {
set(ENABLE_CLIENT_SIDE, val);
}
public void setClientSideVersion(int val) {
set(CLIENT_SIDE_VERSION, val);
}
}

View File

@ -1,85 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.handler;
import io.netty.buffer.ByteBuf;
import us.myles.ViaVersion.api.PacketWrapper;
import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.type.Type;
import us.myles.ViaVersion.exception.CancelException;
import us.myles.ViaVersion.packets.Direction;
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
import java.util.function.Function;
// TODO delete this when https://github.com/ViaVersion/ViaVersion/pull/1505 is merged
public class CommonTransformer {
public static final String HANDLER_DECODER_NAME = "via-decoder";
public static final String HANDLER_ENCODER_NAME = "via-encoder";
public static boolean preServerboundCheck(UserConnection user) {
// Ignore if pending disconnect
if (user.isPendingDisconnect()) return true;
// Increment received + Check PPS
return user.incrementReceived() && user.handlePPS();
}
public static void preClientbound(UserConnection user) {
user.incrementSent();
}
public static boolean willTransformPacket(UserConnection user) {
return user.isActive();
}
public static void transformClientbound(ByteBuf draft, UserConnection user, Function<Throwable, Exception> cancelSupplier) throws Exception {
if (!draft.isReadable()) return;
transform(draft, user, Direction.OUTGOING, cancelSupplier);
}
public static void transformServerbound(ByteBuf draft, UserConnection user, Function<Throwable, Exception> cancelSupplier) throws Exception {
if (!draft.isReadable()) return;
transform(draft, user, Direction.INCOMING, cancelSupplier);
}
private static void transform(ByteBuf draft, UserConnection user, Direction direction, Function<Throwable, Exception> cancelSupplier) throws Exception {
int id = Type.VAR_INT.read(draft);
if (id == PacketWrapper.PASSTHROUGH_ID) return;
PacketWrapper wrapper = new PacketWrapper(id, draft, user);
ProtocolInfo protInfo = user.get(ProtocolInfo.class);
try {
protInfo.getPipeline().transform(direction, protInfo.getState(), wrapper);
} catch (CancelException ex) {
throw cancelSupplier.apply(ex);
}
ByteBuf transformed = draft.alloc().buffer();
try {
wrapper.writeToBuffer(transformed);
draft.clear().writeBytes(transformed);
} finally {
transformed.release();
}
}
}

View File

@ -1,76 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.handler.clientside;
import com.github.creeper123123321.viafabric.handler.CommonTransformer;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageDecoder;
import us.myles.ViaVersion.api.Via;
import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.exception.CancelException;
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
import us.myles.ViaVersion.util.PipelineUtil;
import java.util.List;
public class VRDecodeHandler extends MessageToMessageDecoder<ByteBuf> {
private UserConnection user;
public VRDecodeHandler(UserConnection user) {
this.user = user;
}
@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) throws Exception {
CommonTransformer.preClientbound(user);
if (!CommonTransformer.willTransformPacket(user)) {
out.add(msg.retain());
return;
}
ByteBuf draft = msg.alloc().buffer().writeBytes(msg);
try {
CommonTransformer.transformClientbound(draft, user, ignored -> CancelException.CACHED);
out.add(draft.retain());
} finally {
draft.release();
}
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
if (PipelineUtil.containsCause(cause, CancelException.class)) return;
super.exceptionCaught(ctx, cause);
}
@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
super.channelInactive(ctx);
ProtocolInfo info = user.get(ProtocolInfo.class);
if (info.getUuid() != null) {
Via.getManager().removePortedClient(info.getUuid());
}
}
}

View File

@ -1,67 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.handler.clientside;
import com.github.creeper123123321.viafabric.handler.CommonTransformer;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageEncoder;
import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.exception.CancelException;
import us.myles.ViaVersion.util.PipelineUtil;
import java.util.List;
public class VREncodeHandler extends MessageToMessageEncoder<ByteBuf> {
private UserConnection user;
public VREncodeHandler(UserConnection user) {
this.user = user;
}
@Override
protected void encode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) throws Exception {
if (CommonTransformer.preServerboundCheck(user)) {
throw CancelException.CACHED; // M2ME expects at least one message
}
if (!CommonTransformer.willTransformPacket(user)) {
out.add(msg.retain());
return;
}
ByteBuf draft = ctx.alloc().buffer().writeBytes(msg);
try {
CommonTransformer.transformServerbound(draft, user, ignored -> CancelException.CACHED);
out.add(draft.retain());
} finally {
draft.release();
}
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
if (PipelineUtil.containsCause(cause, CancelException.class)) return;
super.exceptionCaught(ctx, cause);
}
}

View File

@ -1,78 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.handler.serverside;
import com.github.creeper123123321.viafabric.handler.CommonTransformer;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageDecoder;
import us.myles.ViaVersion.api.Via;
import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.exception.CancelException;
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
import us.myles.ViaVersion.util.PipelineUtil;
import java.util.List;
public class FabricDecodeHandler extends MessageToMessageDecoder<ByteBuf> {
private final UserConnection user;
public FabricDecodeHandler(UserConnection user) {
this.user = user;
}
@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) throws Exception {
if (CommonTransformer.preServerboundCheck(user)) {
throw CancelException.CACHED;
}
if (!CommonTransformer.willTransformPacket(user)) {
out.add(msg.retain());
return;
}
ByteBuf draft = ctx.alloc().buffer().writeBytes(msg);
try {
CommonTransformer.transformServerbound(draft, user, ignored -> CancelException.CACHED);
out.add(draft.retain());
} finally {
draft.release();
}
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
if (PipelineUtil.containsCause(cause, CancelException.class)) return;
super.exceptionCaught(ctx, cause);
}
@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
super.channelInactive(ctx); // May call decode
ProtocolInfo pi = user.get(ProtocolInfo.class);
if (pi.getUuid() != null) {
Via.getManager().removePortedClient(pi.getUuid());
}
}
}

View File

@ -1,65 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.handler.serverside;
import com.github.creeper123123321.viafabric.handler.CommonTransformer;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageEncoder;
import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.exception.CancelException;
import us.myles.ViaVersion.util.PipelineUtil;
import java.util.List;
public class FabricEncodeHandler extends MessageToMessageEncoder<ByteBuf> {
private final UserConnection user;
public FabricEncodeHandler(UserConnection user) {
this.user = user;
}
@Override
protected void encode(final ChannelHandlerContext ctx, ByteBuf msg, final List<Object> out) throws Exception {
CommonTransformer.preClientbound(user);
if (!CommonTransformer.willTransformPacket(user)) {
out.add(msg.readRetainedSlice(msg.readableBytes()));
return;
}
ByteBuf draft = ctx.alloc().buffer().writeBytes(msg);
try {
CommonTransformer.transformClientbound(draft, user, ignored -> CancelException.CACHED);
out.add(draft.retain());
} finally {
draft.release();
}
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
if (PipelineUtil.containsCause(cause, CancelException.class)) return;
super.exceptionCaught(ctx, cause);
}
}

View File

@ -1,75 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.mixin;
import com.github.creeper123123321.viafabric.handler.CommonTransformer;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelPipeline;
import net.minecraft.network.ClientConnection;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(ClientConnection.class)
public class MixinClientConnection {
@Redirect(
method = "exceptionCaught",
remap = false,
at = @At(
value = "INVOKE",
target = "Lorg/apache/logging/log4j/Logger;debug(Ljava/lang/String;Ljava/lang/Throwable;)V"
))
private void redirectDebug(Logger logger, String message, Throwable t) {
if ("Failed to sent packet".equals(message)) {
logger.info(message, t);
} else {
logger.debug(message, t);
}
}
@Redirect(method = "setCompressionThreshold", at = @At(
value = "INVOKE",
remap = false,
target = "Lio/netty/channel/ChannelPipeline;addBefore(Ljava/lang/String;Ljava/lang/String;Lio/netty/channel/ChannelHandler;)Lio/netty/channel/ChannelPipeline;"
))
private ChannelPipeline decodeEncodePlacement(ChannelPipeline instance, String base, String newHandler, ChannelHandler handler) {
// Fixes the handler order
switch (base) {
case "decoder": {
if (instance.get(CommonTransformer.HANDLER_DECODER_NAME) != null)
base = CommonTransformer.HANDLER_DECODER_NAME;
break;
}
case "encoder": {
if (instance.get(CommonTransformer.HANDLER_ENCODER_NAME) != null)
base = CommonTransformer.HANDLER_ENCODER_NAME;
break;
}
}
return instance.addBefore(base, newHandler, handler);
}
}

View File

@ -1,51 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.mixin;
import com.github.creeper123123321.viafabric.handler.CommonTransformer;
import com.github.creeper123123321.viafabric.handler.serverside.FabricDecodeHandler;
import com.github.creeper123123321.viafabric.handler.serverside.FabricEncodeHandler;
import io.netty.channel.Channel;
import io.netty.channel.socket.SocketChannel;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.protocol.ProtocolPipeline;
@Mixin(targets = "net.minecraft.server.ServerNetworkIo$1")
public class MixinServerNetworkIoChInit {
@Inject(method = "initChannel(Lio/netty/channel/Channel;)V", at = @At(value = "TAIL"), remap = false)
private void onInitChannel(Channel channel, CallbackInfo ci) {
if (channel instanceof SocketChannel) {
UserConnection user = new UserConnection(channel);
new ProtocolPipeline(user);
channel.pipeline().addBefore("encoder", CommonTransformer.HANDLER_ENCODER_NAME, new FabricEncodeHandler(user));
channel.pipeline().addBefore("decoder", CommonTransformer.HANDLER_DECODER_NAME, new FabricDecodeHandler(user));
}
}
}

View File

@ -1,52 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.mixin.client;
import com.github.creeper123123321.viafabric.handler.CommonTransformer;
import com.github.creeper123123321.viafabric.handler.clientside.VRDecodeHandler;
import com.github.creeper123123321.viafabric.handler.clientside.VREncodeHandler;
import com.github.creeper123123321.viafabric.platform.VRClientSideUserConnection;
import io.netty.channel.Channel;
import io.netty.channel.socket.SocketChannel;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.protocol.ProtocolPipeline;
@Mixin(targets = "net.minecraft.network.ClientConnection$1")
public class MixinClientConnectionChInit {
@Inject(method = "initChannel(Lio/netty/channel/Channel;)V", at = @At(value = "TAIL"), remap = false)
private void onInitChannel(Channel channel, CallbackInfo ci) {
if (channel instanceof SocketChannel) {
UserConnection user = new VRClientSideUserConnection(channel);
new ProtocolPipeline(user);
channel.pipeline().addBefore("encoder", CommonTransformer.HANDLER_ENCODER_NAME, new VREncodeHandler(user));
channel.pipeline().addBefore("decoder", CommonTransformer.HANDLER_DECODER_NAME, new VRDecodeHandler(user));
}
}
}

View File

@ -1,174 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.mixin.client;
import com.github.creeper123123321.viafabric.ViaFabric;
import com.github.creeper123123321.viafabric.util.VersionFormatFilter;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.ConfirmScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.TextFieldWidget;
import net.minecraft.client.gui.widget.TexturedButtonWidget;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Identifier;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import us.myles.ViaVersion.api.protocol.ProtocolRegistry;
import us.myles.ViaVersion.api.protocol.ProtocolVersion;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Mixin(MultiplayerScreen.class)
public abstract class MixinMultiplayerScreen extends Screen {
@Unique
private TextFieldWidget protocolVersion;
@Unique
private ButtonWidget enableClientSideViaVersion;
@Unique
private boolean validProtocol;
@Unique
private boolean supportedProtocol;
@Unique
private CompletableFuture<Void> latestProtocolSave;
protected MixinMultiplayerScreen(Text title, UnsupportedOperationException e) {
super(title);
throw e;
}
@Inject(method = "init", at = @At("TAIL"), remap = false)
private void onInit(CallbackInfo ci) {
protocolVersion = new TextFieldWidget(font, this.width / 2 + 88, 13, 65, 15, I18n.translate("gui.protocol_version_field.name"));
protocolVersion.setTextPredicate(new VersionFormatFilter());
protocolVersion.setChangedListener((text) -> {
protocolVersion.setSuggestion(null);
int newVersion = ViaFabric.config.getClientSideVersion();
validProtocol = true;
try {
newVersion = Integer.parseInt(text);
} catch (NumberFormatException e) {
ProtocolVersion closest = ProtocolVersion.getClosest(text);
if (closest != null) {
newVersion = closest.getId();
} else {
validProtocol = false;
List<String> completions = ProtocolVersion.getProtocols().stream()
.map(ProtocolVersion::getName)
.flatMap(str -> Stream.concat(
Arrays.stream(str.split("-")),
Arrays.stream(new String[]{str})
))
.distinct()
.filter(ver -> ver.startsWith(text))
.collect(Collectors.toList());
if (completions.size() == 1) {
protocolVersion.setSuggestion(completions.get(0).substring(text.length()));
}
}
}
supportedProtocol = isSupported(newVersion);
protocolVersion.setEditableColor(getTextColor());
int finalNewVersion = newVersion;
if (latestProtocolSave == null) latestProtocolSave = CompletableFuture.completedFuture(null);
latestProtocolSave = latestProtocolSave.thenRunAsync(() -> {
ViaFabric.config.setClientSideVersion(finalNewVersion);
ViaFabric.config.saveConfig();
}, ViaFabric.ASYNC_EXECUTOR);
});
int clientSideVersion = ViaFabric.config.getClientSideVersion();
protocolVersion.setVisible(ViaFabric.config.isClientSideEnabled());
protocolVersion.setText(ProtocolVersion.isRegistered(clientSideVersion)
? ProtocolVersion.getProtocol(clientSideVersion).getName()
: Integer.toString(clientSideVersion));
this.children.add(protocolVersion);
enableClientSideViaVersion = new TexturedButtonWidget(this.width / 2 + 113, 10,
40, 20, // Size
0, 0, // Start pos of texture
20, // v Hover offset
new Identifier("viafabric:textures/gui/via_button.png"),
64, 64, // Texture size
button -> MinecraftClient.getInstance().openScreen(new ConfirmScreen(
answer -> {
MinecraftClient.getInstance().openScreen(this);
if (answer) {
ViaFabric.config.setClientSideEnabled(true);
ViaFabric.config.saveConfig();
protocolVersion.setVisible(true);
enableClientSideViaVersion.visible = false;
}
},
new TranslatableText("gui.enable_client_side.question"),
new TranslatableText("gui.enable_client_side.warning"),
I18n.translate("gui.enable_client_side.enable"),
I18n.translate("gui.cancel")
)),
I18n.translate("gui.enable_client_side_button"));
enableClientSideViaVersion.visible = !protocolVersion.isVisible();
addButton(enableClientSideViaVersion);
}
@Inject(method = "render", at = {
@At(value = "INVOKE", target = "Lnet/minecraft/client/gui/Screen;render(IIF)V"),
@At(value = "INVOKE", target = "Lnet/minecraft/class_437;render(IIF)V") // todo check if refmap was fixed
}, remap = false)
private void onRender(int int_1, int int_2, float float_1, CallbackInfo ci) {
protocolVersion.render(int_1, int_2, float_1);
}
@Inject(method = "tick", at = @At("TAIL"), remap = false)
private void onTick(CallbackInfo ci) {
protocolVersion.tick();
}
@Unique
private int getTextColor() {
if (!validProtocol) {
return 0xff0000; // Red
} else if (!supportedProtocol) {
return 0xFFA500; // Orange
}
return 0xE0E0E0; // Default
}
@Unique
private boolean isSupported(int protocol) {
return ProtocolRegistry.getProtocolPath(ProtocolRegistry.SERVER_PROTOCOL, protocol) != null
|| ProtocolRegistry.SERVER_PROTOCOL == protocol;
}
}

View File

@ -1,35 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.platform;
import us.myles.ViaVersion.api.boss.BossColor;
import us.myles.ViaVersion.api.boss.BossStyle;
import us.myles.ViaVersion.boss.CommonBoss;
public class VRBossBar extends CommonBoss {
public VRBossBar(String title, float health, BossColor color, BossStyle style) {
super(title, health, color, style);
}
}

View File

@ -1,66 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.platform;
import com.github.creeper123123321.viafabric.handler.CommonTransformer;
import io.netty.buffer.ByteBuf;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import us.myles.ViaVersion.api.data.UserConnection;
public class VRClientSideUserConnection extends UserConnection {
public VRClientSideUserConnection(Channel socketChannel) {
super(socketChannel);
}
// Based on https://github.com/Gerrygames/ClientViaVersion/blob/master/src/main/java/de/gerrygames/the5zig/clientviaversion/reflection/Injector.java
@Override
public void sendRawPacket(final ByteBuf packet, boolean currentThread) {
Runnable act = () -> getChannel().pipeline().context(CommonTransformer.HANDLER_DECODER_NAME)
.fireChannelRead(packet);
if (currentThread) {
act.run();
} else {
getChannel().eventLoop().execute(act);
}
}
@Override
public ChannelFuture sendRawPacketFuture(ByteBuf packet) {
getChannel().pipeline().context(CommonTransformer.HANDLER_DECODER_NAME).fireChannelRead(packet);
return getChannel().newSucceededFuture();
}
@Override
public void sendRawPacketToServer(ByteBuf packet, boolean currentThread) {
if (currentThread) {
getChannel().pipeline().context(CommonTransformer.HANDLER_ENCODER_NAME).writeAndFlush(packet);
} else {
getChannel().eventLoop().submit(() -> {
getChannel().pipeline().context(CommonTransformer.HANDLER_ENCODER_NAME).writeAndFlush(packet);
});
}
}
}

View File

@ -1,85 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.platform;
import com.github.creeper123123321.viafabric.handler.CommonTransformer;
import net.fabricmc.api.EnvType;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.SharedConstants;
import us.myles.ViaVersion.api.platform.ViaInjector;
import us.myles.ViaVersion.util.GsonUtil;
import us.myles.viaversion.libs.gson.JsonObject;
import java.lang.reflect.Method;
import java.util.Arrays;
public class VRInjector implements ViaInjector {
@Override
public void inject() {
// *looks at Mixins*
}
@Override
public void uninject() {
// not possible *plays sad violin*
}
@Override
public int getServerProtocolVersion() {
return SharedConstants.getGameVersion().getProtocolVersion();
}
@Override
public String getEncoderName() {
return CommonTransformer.HANDLER_ENCODER_NAME;
}
@Override
public String getDecoderName() {
return CommonTransformer.HANDLER_DECODER_NAME;
}
@Override
public JsonObject getDump() {
JsonObject obj = new JsonObject();
try {
obj.add("serverNetworkIOChInit", GsonUtil.getGson().toJsonTree(
Arrays.stream(Class.forName("net.minecraft.class_3242$1").getDeclaredMethods())
.map(Method::toString)
.toArray(String[]::new)));
} catch (ClassNotFoundException ignored) {
}
if (FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT) {
try {
obj.add("clientConnectionChInit", GsonUtil.getGson().toJsonTree(
Arrays.stream(Class.forName("net.minecraft.class_2535$1").getDeclaredMethods())
.map(Method::toString)
.toArray(String[]::new)));
} catch (ClassNotFoundException ignored) {
}
}
return obj;
}
}

View File

@ -1,45 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.platform;
import com.github.creeper123123321.viafabric.providers.VRVersionProvider;
import us.myles.ViaVersion.api.Via;
import us.myles.ViaVersion.api.platform.ViaPlatformLoader;
import us.myles.ViaVersion.bungee.providers.BungeeMovementTransmitter;
import us.myles.ViaVersion.protocols.base.VersionProvider;
import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.MovementTransmitterProvider;
public class VRLoader implements ViaPlatformLoader {
@Override
public void load() {
Via.getManager().getProviders().use(MovementTransmitterProvider.class, new BungeeMovementTransmitter());
Via.getManager().getProviders().use(VersionProvider.class, new VRVersionProvider());
}
@Override
public void unload() {
// Nothing to do
}
}

View File

@ -1,314 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.platform;
import com.github.creeper123123321.viafabric.ViaFabric;
import com.github.creeper123123321.viafabric.commands.NMSCommandSender;
import com.github.creeper123123321.viafabric.commands.UserCommandSender;
import com.github.creeper123123321.viafabric.util.FutureTaskId;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.ModContainer;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.entity.Entity;
import net.minecraft.network.MessageType;
import net.minecraft.network.OffThreadException;
import net.minecraft.network.packet.s2c.play.ChatMessageS2CPacket;
import net.minecraft.network.packet.s2c.play.DisconnectS2CPacket;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.Text;
import us.myles.ViaVersion.api.Via;
import us.myles.ViaVersion.api.ViaAPI;
import us.myles.ViaVersion.api.ViaVersionConfig;
import us.myles.ViaVersion.api.command.ViaCommandSender;
import us.myles.ViaVersion.api.configuration.ConfigurationProvider;
import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.platform.TaskId;
import us.myles.ViaVersion.api.platform.ViaPlatform;
import us.myles.ViaVersion.dump.PluginInfo;
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.ChatRewriter;
import us.myles.ViaVersion.sponge.VersionInfo;
import us.myles.ViaVersion.util.GsonUtil;
import us.myles.viaversion.libs.gson.JsonObject;
import java.io.File;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
import java.util.stream.Collectors;
public class VRPlatform implements ViaPlatform {
private VRViaConfig config;
private File dataFolder;
public VRPlatform() {
Path configDir = FabricLoader.getInstance().getConfigDirectory().toPath().resolve("ViaFabric");
config = new VRViaConfig(configDir.resolve("viaversion.yml").toFile());
dataFolder = configDir.toFile();
}
public static MinecraftServer getServer() {
if (FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT) {
return getIntegratedServer();
}
return (MinecraftServer) FabricLoader.getInstance().getGameInstance();
}
@Environment(EnvType.CLIENT)
private static MinecraftServer getIntegratedServer() {
return MinecraftClient.getInstance().getServer();
}
@Override
public Logger getLogger() {
return ViaFabric.JLOGGER;
}
@Override
public String getPlatformName() {
return "ViaFabric";
}
@Override
public String getPlatformVersion() {
return ViaFabric.getVersion();
}
@Override
public String getPluginVersion() {
try {
return VersionInfo.class.getField("VERSION").get(null).toString();
} catch (IllegalAccessException | NoSuchFieldException e) {
e.printStackTrace();
}
return "?";
}
@Override
public TaskId runAsync(Runnable runnable) {
return new FutureTaskId(CompletableFuture
.runAsync(runnable, ViaFabric.ASYNC_EXECUTOR)
.exceptionally(throwable -> {
throwable.printStackTrace();
return null;
})
);
}
@Override
public TaskId runSync(Runnable runnable) {
// Kick task needs to be on main thread
Executor executor = ViaFabric.EVENT_LOOP;
boolean alreadyLogged;
MinecraftServer server = getServer();
if (server != null) {
alreadyLogged = true;
executor = server;
} else {
alreadyLogged = false;
}
return new FutureTaskId(
CompletableFuture.runAsync(runnable, executor)
.exceptionally(throwable -> {
if (!alreadyLogged) {
throwable.printStackTrace();
}
return null;
})
);
}
@Override
public TaskId runSync(Runnable runnable, Long ticks) {
// ViaVersion seems to not need to run delayed tasks on main thread
return new FutureTaskId(
ViaFabric.EVENT_LOOP
.schedule(runnable, ticks * 50, TimeUnit.MILLISECONDS)
.addListener(future -> {
if (!future.isSuccess()) {
future.cause().printStackTrace();
}
})
);
}
@Override
public TaskId runRepeatingSync(Runnable runnable, Long ticks) {
// ViaVersion seems to not need to run repeating tasks on main thread
return new FutureTaskId(
ViaFabric.EVENT_LOOP
.scheduleAtFixedRate(runnable, 0, ticks * 50, TimeUnit.MILLISECONDS)
.addListener(future -> {
if (!future.isSuccess()) {
future.cause().printStackTrace();
}
})
);
}
@Override
public void cancelTask(TaskId taskId) {
if (taskId instanceof FutureTaskId) {
((FutureTaskId) taskId).getObject().cancel(false);
}
}
@Override
public ViaCommandSender[] getOnlinePlayers() {
MinecraftServer server = getServer();
if (server != null && server.isOnThread()) {
// Not thread safe
return server.getPlayerManager().getPlayerList().stream()
.map(Entity::getCommandSource)
.map(NMSCommandSender::new)
.toArray(ViaCommandSender[]::new);
}
return Via.getManager().getPortedPlayers().values().stream()
.map(UserCommandSender::new)
.toArray(ViaCommandSender[]::new);
}
@Override
public void sendMessage(UUID uuid, String s) {
UserConnection user = Via.getManager().getPortedPlayers().get(uuid);
if (user instanceof VRClientSideUserConnection) {
sendMessageClient(s);
} else {
runSync(() -> {
MinecraftServer server = getServer();
if (server == null) return;
ServerPlayerEntity player = server.getPlayerManager().getPlayer(uuid);
if (player == null) return;
player.sendChatMessage(Text.Serializer.fromJson(ChatRewriter.legacyTextToJson(s)), MessageType.SYSTEM);
});
}
}
@Environment(EnvType.CLIENT)
private void sendMessageClient(String s) {
ClientPlayNetworkHandler handler = MinecraftClient.getInstance().getNetworkHandler();
if (handler != null) {
try {
handler.onChatMessage(new ChatMessageS2CPacket(
Text.Serializer.fromJson(ChatRewriter.legacyTextToJson(s))
));
} catch (OffThreadException ignored) {
}
}
}
@Override
public boolean kickPlayer(UUID uuid, String s) {
UserConnection user = Via.getManager().getPortedPlayers().get(uuid);
if (user instanceof VRClientSideUserConnection) {
return kickClient(s);
} else {
MinecraftServer server = getServer();
if (server != null && server.isOnThread()) {
ServerPlayerEntity player = server.getPlayerManager().getPlayer(uuid);
if (player == null) return false;
player.networkHandler.disconnect(Text.Serializer.fromJson(ChatRewriter.legacyTextToJson(s)));
}
}
return false;
}
@Environment(EnvType.CLIENT)
private boolean kickClient(String msg) {
ClientPlayNetworkHandler handler = MinecraftClient.getInstance().getNetworkHandler();
if (handler != null) {
try {
handler.onDisconnect(new DisconnectS2CPacket(
Text.Serializer.fromJson(ChatRewriter.legacyTextToJson(msg))
));
} catch (OffThreadException ignored) {
}
return true;
}
return false;
}
@Override
public boolean isPluginEnabled() {
return true;
}
@Override
public ViaAPI getApi() {
return new VRViaAPI();
}
@Override
public ViaVersionConfig getConf() {
return config;
}
@Override
public ConfigurationProvider getConfigurationProvider() {
return config;
}
@Override
public File getDataFolder() {
return dataFolder;
}
@Override
public void onReload() {
// Nothing to do
}
@Override
public JsonObject getDump() {
JsonObject platformSpecific = new JsonObject();
List<PluginInfo> mods = new ArrayList<>();
for (ModContainer mod : FabricLoader.getInstance().getAllMods()) {
mods.add(new PluginInfo(true,
mod.getMetadata().getName(),
mod.getMetadata().getVersion().getFriendlyString(),
null,
mod.getMetadata().getAuthors().stream()
.map(info -> info.getName() + "(" + info.getContact().asMap() + ")")
.collect(Collectors.toList())
));
}
platformSpecific.add("mods", GsonUtil.getGson().toJsonTree(mods));
return platformSpecific;
}
@Override
public boolean isOldClientsAllowed() {
return true;
}
}

View File

@ -1,99 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.platform;
import io.netty.buffer.ByteBuf;
import us.myles.ViaVersion.api.Via;
import us.myles.ViaVersion.api.ViaAPI;
import us.myles.ViaVersion.api.boss.BossBar;
import us.myles.ViaVersion.api.boss.BossColor;
import us.myles.ViaVersion.api.boss.BossStyle;
import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.protocol.ProtocolRegistry;
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.UUID;
public class VRViaAPI implements ViaAPI<Void> {
@Override
public int getPlayerVersion(Void o) {
throw new UnsupportedOperationException();
}
@Override
public int getPlayerVersion(UUID uuid) {
UserConnection con = Via.getManager().getPortedPlayers().get(uuid);
if (con != null) {
return con.get(ProtocolInfo.class).getProtocolVersion();
}
try {
return Via.getManager().getInjector().getServerProtocolVersion();
} catch (Exception e) {
throw new AssertionError(e);
}
}
@Override
@Deprecated
public boolean isPorted(UUID uuid) {
return Via.getManager().getPortedPlayers().containsKey(uuid);
}
@Override
public String getVersion() {
return Via.getPlatform().getPluginVersion();
}
@Override
public void sendRawPacket(Void o, ByteBuf byteBuf) throws IllegalArgumentException {
throw new UnsupportedOperationException();
}
@Override
public void sendRawPacket(UUID uuid, ByteBuf byteBuf) throws IllegalArgumentException {
UserConnection ci = Via.getManager().getPortedPlayers().get(uuid);
ci.sendRawPacket(byteBuf);
}
@Override
public BossBar createBossBar(String s, BossColor bossColor, BossStyle bossStyle) {
return new VRBossBar(s, 1f, bossColor, bossStyle);
}
@Override
public BossBar createBossBar(String s, float v, BossColor bossColor, BossStyle bossStyle) {
return new VRBossBar(s, v, bossColor, bossStyle);
}
@Override
public SortedSet<Integer> getSupportedVersions() {
SortedSet<Integer> outputSet = new TreeSet<>(ProtocolRegistry.getSupportedVersions());
outputSet.removeAll(Via.getPlatform().getConf().getBlockedProtocols());
return outputSet;
}
}

View File

@ -1,97 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.platform;
import us.myles.ViaVersion.AbstractViaConfig;
import java.io.File;
import java.net.URL;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
public class VRViaConfig extends AbstractViaConfig {
// Based on Sponge ViaVersion
private static List<String> UNSUPPORTED = Arrays.asList("anti-xray-patch", "bungee-ping-interval",
"bungee-ping-save", "bungee-servers", "quick-move-action-fix", "nms-player-ticking",
"item-cache", "velocity-ping-interval", "velocity-ping-save", "velocity-servers",
"blockconnection-method", "change-1_9-hitbox", "change-1_14-hitbox");
public VRViaConfig(File configFile) {
super(configFile);
// Load config
reloadConfig();
}
@Override
public URL getDefaultConfigURL() {
return getClass().getClassLoader().getResource("assets/viaversion/config.yml");
}
@Override
protected void handleConfig(Map<String, Object> config) {
// Nothing Currently
}
@Override
public List<String> getUnsupportedOptions() {
return UNSUPPORTED;
}
@Override
public boolean isAntiXRay() {
return false;
}
@Override
public boolean isItemCache() {
return false;
}
@Override
public boolean isNMSPlayerTicking() {
return false;
}
@Override
public boolean is1_12QuickMoveActionFix() {
return false;
}
@Override
public String getBlockConnectionMethod() {
return "packet";
}
@Override
public boolean is1_9HitboxFix() {
return false;
}
@Override
public boolean is1_14HitboxFix() {
return false;
}
}

View File

@ -1,39 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.providers;
import com.github.creeper123123321.viafabric.ViaFabric;
import com.github.creeper123123321.viafabric.platform.VRClientSideUserConnection;
import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.protocols.base.VersionProvider;
public class VRVersionProvider extends VersionProvider {
@Override
public int getServerProtocol(UserConnection connection) throws Exception {
if (connection instanceof VRClientSideUserConnection)
return ViaFabric.config.getClientSideVersion();
return super.getServerProtocol(connection);
}
}

View File

@ -1,42 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.util;
import us.myles.ViaVersion.api.platform.TaskId;
import java.util.concurrent.Future;
public class FutureTaskId implements TaskId {
private Future<?> object;
public FutureTaskId(Future<?> object) {
this.object = object;
}
@Override
public Future<?> getObject() {
return object;
}
}

View File

@ -1,54 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2018 creeper123123321 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.github.creeper123123321.viafabric.util;
import us.myles.ViaVersion.api.protocol.ProtocolVersion;
import java.util.Arrays;
import java.util.function.Predicate;
import java.util.stream.Stream;
public class VersionFormatFilter implements Predicate<String> {
@Override
public boolean test(String s) {
try {
Integer.parseInt(s);
return true;
} catch (NumberFormatException e) {
try {
Integer.parseInt(s + '0');
return true;
} catch (NumberFormatException e2) {
return ProtocolVersion.getProtocols().stream()
.map(ProtocolVersion::getName)
.flatMap(str -> Stream.concat(
Arrays.stream(str.split("-")),
Arrays.stream(new String[]{str})
))
.anyMatch(ver -> ver.startsWith(s));
}
}
}
}

View File

@ -0,0 +1,104 @@
/*
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.viaversion.fabric.common;
import com.google.common.collect.Lists;
import com.google.common.primitives.Ints;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;
// Based on VIAaaS parser
public class AddressParser {
public Integer protocol;
public String viaSuffix;
public String serverAddress;
public String viaOptions;
public AddressParser parse(String address) {
return parse(address, "viafabric");
}
public String getSuffixWithOptions() {
if (viaOptions != null && !viaOptions.isEmpty()) {
return viaOptions + "." + viaSuffix;
}
return viaSuffix;
}
public AddressParser parse(String address, String viaHostName) {
address = StringUtils.removeEnd(address, ".");
String suffixRemoved = StringUtils.removeEnd(address, "." + viaHostName);
if (suffixRemoved.equals(address)) {
serverAddress = address;
return this;
}
boolean stopOptions = false;
List<String> optionsParts = new ArrayList<>();
List<String> serverParts = new ArrayList<>();
for (String part : Lists.reverse(Arrays.asList(suffixRemoved.split(Pattern.quote("."))))) {
if (!stopOptions && parseOption(part)) {
optionsParts.add(part);
continue;
}
stopOptions = true;
serverParts.add(part);
}
serverAddress = String.join(".", Lists.reverse(serverParts));
viaOptions = String.join(".", Lists.reverse(optionsParts));
viaSuffix = viaHostName;
return this;
}
public boolean parseOption(String part) {
String option;
if (part.length() < 2) {
return false;
} else if (part.startsWith("_")) {
option = String.valueOf(part.charAt(1));
} else if (part.charAt(1) == '_') {
option = String.valueOf(part.charAt(0));
} else {
return false;
}
String arg = part.substring(2);
if ("v".equals(option)) {
parseProtocol(arg);
}
return true;
}
public void parseProtocol(String arg) {
protocol = Ints.tryParse(arg);
if (protocol == null) {
ProtocolVersion ver = ProtocolVersion.getClosest(arg.replace("_", "."));
if (ver != null) protocol = ver.getVersion();
}
}
}

View File

@ -0,0 +1,32 @@
/*
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.viaversion.fabric.common;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.loader.api.FabricLoader;
public class ViaFabric implements ModInitializer {
@Override
public void onInitialize() {
if (FabricLoader.getInstance().getAllMods()
.stream()
.noneMatch(it -> it.getMetadata().getId().startsWith("viafabric-mc"))) {
throw new IllegalStateException("ViaFabric sub-mod didn't load correctly. Check if required dependencies are installed");
}
}
}

View File

@ -0,0 +1,52 @@
/*
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.viaversion.fabric.common.commands;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.command.ViaCommandSender;
import com.viaversion.viaversion.api.connection.UserConnection;
import java.util.UUID;
public class UserCommandSender implements ViaCommandSender {
private final UserConnection con;
public UserCommandSender(UserConnection con) {
this.con = con;
}
@Override
public boolean hasPermission(String s) {
return false;
}
@Override
public void sendMessage(String s) {
Via.getPlatform().sendMessage(getUUID(), s);
}
@Override
public UUID getUUID() {
return con.getProtocolInfo().getUuid();
}
@Override
public String getName() {
return con.getProtocolInfo().getUsername();
}
}

View File

@ -1,38 +1,31 @@
/*
* MIT License
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* Copyright (c) 2018 creeper123123321 and contributors
* 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.
*
* 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:
* 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.
*
* 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.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.creeper123123321.viafabric.commands.subs;
package com.viaversion.fabric.common.commands.subs;
import io.netty.util.ResourceLeakDetector;
import us.myles.ViaVersion.api.command.ViaCommandSender;
import us.myles.ViaVersion.api.command.ViaSubCommand;
import com.viaversion.viaversion.api.command.ViaCommandSender;
import com.viaversion.viaversion.api.command.ViaSubCommand;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class LeakDetectSubCommand extends ViaSubCommand {
public class LeakDetectSubCommand implements ViaSubCommand {
@Override
public String name() {
return "leakdetect";
@ -67,6 +60,6 @@ public class LeakDetectSubCommand extends ViaSubCommand {
.filter(it -> it.startsWith(args[0]))
.collect(Collectors.toList());
}
return super.onTabComplete(sender, args);
return ViaSubCommand.super.onTabComplete(sender, args);
}
}

View File

@ -0,0 +1,41 @@
/*
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.viaversion.fabric.common.config;
import com.viaversion.fabric.common.util.ProtocolUtils;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
public interface AbstractViaConfigScreen {
String TITLE_TRANSLATE_ID = "gui.viafabric_config.title";
String VERSION_TRANSLATE_ID = "gui.protocol_version_field.name";
default int getProtocolTextColor(ProtocolVersion version, boolean parsedValid) {
if (!parsedValid) return 0xff0000; // Red
if (!ProtocolUtils.isValid(version)) return 0x5555FF; // Blue
if (!ProtocolUtils.isSupportedClientSide(version)) return 0xFFA500; // Orange
return 0xE0E0E0; // Default
}
default int calculatePosX(int width, int entryNumber) {
return width / 2 - 155 + entryNumber % 2 * 160;
}
default int calculatePosY(int height, int entryNumber) {
return height / 6 + 24 * (entryNumber / 2);
}
}

View File

@ -0,0 +1,91 @@
/*
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.viaversion.fabric.common.config;
import com.viaversion.viaversion.util.Config;
import java.io.File;
import java.net.URL;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
public class VFConfig extends Config {
public static final String ENABLE_CLIENT_SIDE = "enable-client-side";
public static final String CLIENT_SIDE_VERSION = "client-side-version";
public static final String CLIENT_SIDE_FORCE_DISABLE = "client-side-force-disable";
public static final String HIDE_BUTTON = "hide-button";
public static final String IGNORE_REGISTRY_SYNC_ERRORS = "ignore-registry-sync-errors";
public VFConfig(File configFile, Logger logger) {
super(configFile, logger);
reload();
}
@Override
public URL getDefaultConfigURL() {
return getClass().getClassLoader().getResource("assets/viafabric/config.yml");
}
@Override
protected void handleConfig(Map<String, Object> map) {
}
@Override
public List<String> getUnsupportedOptions() {
return Collections.emptyList();
}
public boolean isClientSideEnabled() {
return getBoolean(ENABLE_CLIENT_SIDE, false);
}
public void setClientSideEnabled(boolean val) {
set(ENABLE_CLIENT_SIDE, val);
}
public int getClientSideVersion() {
return getInt(CLIENT_SIDE_VERSION, -1);
}
public void setClientSideVersion(int val) {
set(CLIENT_SIDE_VERSION, val);
}
public Collection<?> getClientSideForceDisable() {
return get(CLIENT_SIDE_FORCE_DISABLE, Collections.emptyList());
}
public void setHideButton(boolean val) {
set(HIDE_BUTTON, val);
}
public boolean isHideButton() {
return getBoolean(HIDE_BUTTON, false);
}
public boolean isForcedDisable(String line) {
return getClientSideForceDisable().contains(line);
}
public boolean isIgnoreRegistrySyncErrors() {
return getBoolean(IGNORE_REGISTRY_SYNC_ERRORS, false);
}
}

View File

@ -0,0 +1,28 @@
/*
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.viaversion.fabric.common.gui;
public interface ViaServerInfo {
boolean viaFabric$translating();
void viaFabric$setTranslating(boolean via);
int viaFabric$getServerVer();
void viaFabric$setServerVer(int ver);
}

View File

@ -0,0 +1,23 @@
/*
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.viaversion.fabric.common.handler;
public class CommonTransformer {
public static final String HANDLER_DECODER_NAME = "via-decoder";
public static final String HANDLER_ENCODER_NAME = "via-encoder";
}

View File

@ -0,0 +1,106 @@
/*
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.viaversion.fabric.common.handler;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.protocol.packet.State;
import com.viaversion.viaversion.exception.CancelCodecException;
import com.viaversion.viaversion.exception.CancelDecoderException;
import com.viaversion.viaversion.exception.InformativeException;
import com.viaversion.viaversion.util.PipelineUtil;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageDecoder;
import java.util.List;
@ChannelHandler.Sharable
public class FabricDecodeHandler extends MessageToMessageDecoder<ByteBuf> {
private final UserConnection info;
public FabricDecodeHandler(UserConnection info) {
this.info = info;
}
public UserConnection getInfo() {
return info;
}
// https://github.com/ViaVersion/ViaVersion/blob/master/velocity/src/main/java/us/myles/ViaVersion/velocity/handlers/VelocityDecodeHandler.java
@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf bytebuf, List<Object> out) throws Exception {
if (!info.checkIncomingPacket()) throw CancelDecoderException.generate(null);
if (!info.shouldTransformPacket()) {
out.add(bytebuf.retain());
return;
}
ByteBuf transformedBuf = ctx.alloc().buffer().writeBytes(bytebuf);
try {
info.transformIncoming(transformedBuf, CancelDecoderException::generate);
out.add(transformedBuf.retain());
} finally {
transformedBuf.release();
}
}
private void reorder(ChannelHandlerContext ctx) {
int decoderIndex = ctx.pipeline().names().indexOf("decompress");
if (decoderIndex == -1) return;
if (decoderIndex > ctx.pipeline().names().indexOf(CommonTransformer.HANDLER_DECODER_NAME)) {
ChannelHandler encoder = ctx.pipeline().get(CommonTransformer.HANDLER_ENCODER_NAME);
ChannelHandler decoder = ctx.pipeline().get(CommonTransformer.HANDLER_DECODER_NAME);
ctx.pipeline().remove(encoder);
ctx.pipeline().remove(decoder);
ctx.pipeline().addAfter("compress", CommonTransformer.HANDLER_ENCODER_NAME, encoder);
ctx.pipeline().addAfter("decompress", CommonTransformer.HANDLER_DECODER_NAME, decoder);
}
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
if (PipelineUtil.containsCause(cause, CancelCodecException.class)) return;
super.exceptionCaught(ctx, cause);
if ((PipelineUtil.containsCause(cause, InformativeException.class)
&& info.getProtocolInfo().getServerState() != State.HANDSHAKE)
|| Via.getManager().debugHandler().enabled()) {
cause.printStackTrace();
}
}
@Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
boolean kryptonReorder = false;
switch (evt.toString()) {
case "COMPRESSION_THRESHOLD_UPDATED":
case "COMPRESSION_ENABLED":
kryptonReorder = true;
}
if (evt instanceof PipelineReorderEvent || kryptonReorder) {
reorder(ctx);
}
super.userEventTriggered(ctx, evt);
}
}

View File

@ -0,0 +1,62 @@
/*
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.viaversion.fabric.common.handler;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.exception.CancelCodecException;
import com.viaversion.viaversion.exception.CancelEncoderException;
import com.viaversion.viaversion.util.PipelineUtil;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageEncoder;
import java.util.List;
@ChannelHandler.Sharable
public class FabricEncodeHandler extends MessageToMessageEncoder<ByteBuf> {
private final UserConnection info;
public FabricEncodeHandler(UserConnection info) {
this.info = info;
}
@Override
protected void encode(final ChannelHandlerContext ctx, ByteBuf bytebuf, List<Object> out) throws Exception {
if (!info.checkOutgoingPacket()) throw CancelEncoderException.generate(null);
if (!info.shouldTransformPacket()) {
out.add(bytebuf.retain());
return;
}
ByteBuf transformedBuf = ctx.alloc().buffer().writeBytes(bytebuf);
try {
info.transformOutgoing(transformedBuf, CancelEncoderException::generate);
out.add(transformedBuf.retain());
} finally {
transformedBuf.release();
}
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
if (PipelineUtil.containsCause(cause, CancelCodecException.class)) return;
super.exceptionCaught(ctx, cause);
}
}

View File

@ -0,0 +1,21 @@
/*
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.viaversion.fabric.common.handler;
public class PipelineReorderEvent {
}

View File

@ -0,0 +1,77 @@
/*
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.viaversion.fabric.common.platform;
import com.viaversion.fabric.common.handler.CommonTransformer;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.platform.ViaInjector;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viaversion.libs.gson.JsonObject;
import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet;
import it.unimi.dsi.fastutil.objects.ObjectSortedSet;
import it.unimi.dsi.fastutil.objects.ObjectSortedSets;
import net.fabricmc.api.EnvType;
import net.fabricmc.loader.api.FabricLoader;
import java.util.OptionalInt;
public class FabricInjector implements ViaInjector {
@Override
public void inject() {
// *looks at Mixins*
}
@Override
public void uninject() {
// not possible *plays sad violin*
}
@Override
public String getEncoderName() {
return CommonTransformer.HANDLER_ENCODER_NAME;
}
@Override
public String getDecoderName() {
return CommonTransformer.HANDLER_DECODER_NAME;
}
@Override
public JsonObject getDump() {
return new JsonObject();
}
@Override
public ObjectSortedSet<ProtocolVersion> getServerProtocolVersions() {
if (FabricLoader.getInstance().getEnvironmentType() == EnvType.SERVER) {
final ProtocolVersion version = Via.getManager().getProviders().get(NativeVersionProvider.class).getNativeServerProtocolVersion();
return ObjectSortedSets.singleton(version);
}
// On client-side we can connect to any server version
ObjectSortedSet<ProtocolVersion> versions = new ObjectLinkedOpenHashSet<>();
versions.add(ProtocolVersion.v1_8);
final OptionalInt highestSupportedVersion = ProtocolVersion.getProtocols().stream().mapToInt(ProtocolVersion::getOriginalVersion).max();
versions.add(ProtocolVersion.getProtocol(highestSupportedVersion.getAsInt()));
return versions;
}
@Override
public ProtocolVersion getServerProtocolVersion() {
return getServerProtocolVersions().first();
}
}

View File

@ -0,0 +1,37 @@
/*
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.viaversion.fabric.common.platform;
import com.viaversion.viaversion.ViaAPIBase;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import io.netty.buffer.ByteBuf;
import java.util.UUID;
public class FabricViaAPI extends ViaAPIBase<UserConnection> {
@Override
public ProtocolVersion getPlayerProtocolVersion(UserConnection player) {
return player.getProtocolInfo().protocolVersion();
}
@Override
public void sendRawPacket(UserConnection player, ByteBuf packet) {
player.scheduleSendRawPacket(packet);
}
}

View File

@ -0,0 +1,55 @@
/*
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.viaversion.fabric.common.platform;
import com.viaversion.viaversion.configuration.AbstractViaConfig;
import java.io.File;
import java.net.URL;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
public class FabricViaConfig extends AbstractViaConfig {
// Based on Sponge ViaVersion
private static final List<String> UNSUPPORTED = Arrays.asList("anti-xray-patch", "quick-move-action-fix",
"nms-player-ticking", "velocity-ping-interval", "velocity-ping-save", "velocity-servers",
"blockconnection-method", "change-1_9-hitbox", "change-1_14-hitbox");
public FabricViaConfig(File configFile, Logger logger) {
super(configFile, logger);
// Load config
reload();
}
@Override
public URL getDefaultConfigURL() {
return getClass().getClassLoader().getResource("assets/viaversion/config.yml");
}
@Override
protected void handleConfig(Map<String, Object> config) {
// Nothing Currently
}
@Override
public List<String> getUnsupportedOptions() {
return UNSUPPORTED;
}
}

View File

@ -0,0 +1,30 @@
/*
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.viaversion.fabric.common.platform;
import com.viaversion.viaversion.api.platform.providers.Provider;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
public interface NativeVersionProvider extends Provider {
int getNativeServerVersion();
default ProtocolVersion getNativeServerProtocolVersion() {
return ProtocolVersion.getProtocol(getNativeServerVersion());
}
}

View File

@ -0,0 +1,53 @@
/*
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.viaversion.fabric.common.protocol;
import com.viaversion.fabric.common.AddressParser;
import com.viaversion.viaversion.api.protocol.AbstractSimpleProtocol;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
import com.viaversion.viaversion.api.protocol.remapper.ValueTransformer;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.protocol.packet.State;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.protocols.base.ServerboundHandshakePackets;
public class HostnameParserProtocol extends AbstractSimpleProtocol {
public static final HostnameParserProtocol INSTANCE = new HostnameParserProtocol();
@Override
protected void registerPackets() {
registerServerbound(State.HANDSHAKE, ServerboundHandshakePackets.CLIENT_INTENTION.getId(), ServerboundHandshakePackets.CLIENT_INTENTION.getId(), new PacketHandlers() {
@Override
protected void register() {
map(Types.VAR_INT); // Protocol version
map(Types.STRING, new ValueTransformer<String, String>(Types.STRING) {
@Override
public String transform(PacketWrapper packetWrapper, String s) {
return new AddressParser().parse(s).serverAddress;
}
});
}
});
}
@Override
public boolean isBaseProtocol() {
return true;
}
}

View File

@ -0,0 +1,222 @@
/*
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.viaversion.fabric.common.provider;
import com.viaversion.fabric.common.platform.FabricViaAPI;
import com.viaversion.fabric.common.platform.FabricViaConfig;
import com.viaversion.fabric.common.platform.NativeVersionProvider;
import com.viaversion.fabric.common.util.FutureTaskId;
import com.viaversion.fabric.common.util.JLoggerToLog4j;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.ViaAPI;
import com.viaversion.viaversion.api.configuration.ConfigurationProvider;
import com.viaversion.viaversion.api.configuration.ViaVersionConfig;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.platform.UnsupportedSoftware;
import com.viaversion.viaversion.api.platform.ViaPlatform;
import com.viaversion.viaversion.libs.gson.JsonArray;
import com.viaversion.viaversion.libs.gson.JsonObject;
import com.viaversion.viaversion.unsupported.UnsupportedPlugin;
import io.netty.channel.EventLoop;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GenericFutureListener;
import net.fabricmc.api.EnvType;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.ModContainer;
import net.fabricmc.loader.api.Version;
import net.fabricmc.loader.api.metadata.ModMetadata;
import org.apache.logging.log4j.LogManager;
import java.io.File;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.CancellationException;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
public abstract class AbstractFabricPlatform implements ViaPlatform<UserConnection> {
private final Logger logger = new JLoggerToLog4j(LogManager.getLogger("ViaVersion"));
private FabricViaConfig config;
private File dataFolder;
private final ViaAPI<UserConnection> api;
{
api = new FabricViaAPI();
}
public void init() {
// We'll use it early for ViaInjector
installNativeVersionProvider();
Path configDir = FabricLoader.getInstance().getConfigDir().resolve("ViaFabric");
dataFolder = configDir.toFile();
config = new FabricViaConfig(configDir.resolve("viaversion.yml").toFile(), logger);
}
protected abstract void installNativeVersionProvider();
protected abstract ExecutorService asyncService();
protected abstract EventLoop eventLoop();
protected FutureTaskId runEventLoop(Runnable runnable) {
return new FutureTaskId(eventLoop().submit(runnable).addListener(errorLogger()));
}
@Override
public FutureTaskId runAsync(Runnable runnable) {
return new FutureTaskId(CompletableFuture.runAsync(runnable, asyncService())
.exceptionally(throwable -> {
if (!(throwable instanceof CancellationException)) {
throwable.printStackTrace();
}
return null;
}));
}
@Override
public FutureTaskId runRepeatingAsync(Runnable runnable, long ticks) {
return new FutureTaskId(eventLoop()
.scheduleAtFixedRate(() -> runAsync(runnable), 0, ticks * 50, TimeUnit.MILLISECONDS)
.addListener(errorLogger())
);
}
@Override
public FutureTaskId runSync(Runnable runnable, long ticks) {
// ViaVersion seems to not need to run delayed tasks on main thread
return new FutureTaskId(eventLoop()
.schedule(() -> runSync(runnable), ticks * 50, TimeUnit.MILLISECONDS)
.addListener(errorLogger())
);
}
@Override
public FutureTaskId runRepeatingSync(Runnable runnable, long ticks) {
// ViaVersion seems to not need to run repeating tasks on main thread
return new FutureTaskId(eventLoop()
.scheduleAtFixedRate(() -> runSync(runnable), 0, ticks * 50, TimeUnit.MILLISECONDS)
.addListener(errorLogger())
);
}
protected <T extends Future<?>> GenericFutureListener<T> errorLogger() {
return future -> {
if (!future.isCancelled() && future.cause() != null) {
future.cause().printStackTrace();
}
};
}
@Override
public boolean isProxy() {
// We kinda of have all server versions
return FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT;
}
@Override
public void onReload() {
}
@Override
public Logger getLogger() {
return logger;
}
@Override
public ViaVersionConfig getConf() {
return config;
}
@Override
public ViaAPI<UserConnection> getApi() {
return api;
}
@Override
public File getDataFolder() {
return dataFolder;
}
@Override
public String getPluginVersion() {
return FabricLoader.getInstance().getModContainer("viaversion").map(ModContainer::getMetadata)
.map(ModMetadata::getVersion).map(Version::getFriendlyString).orElse("UNKNOWN");
}
@Override
public String getPlatformName() {
return "ViaFabric";
}
@Override
public String getPlatformVersion() {
return FabricLoader.getInstance().getModContainer("viafabric")
.get().getMetadata().getVersion().getFriendlyString();
}
@Override
public boolean isPluginEnabled() {
return true;
}
@Override
public JsonObject getDump() {
JsonObject platformSpecific = new JsonObject();
JsonArray mods = new JsonArray();
FabricLoader.getInstance().getAllMods().stream().map((mod) -> {
JsonObject jsonMod = new JsonObject();
jsonMod.addProperty("id", mod.getMetadata().getId());
jsonMod.addProperty("name", mod.getMetadata().getName());
jsonMod.addProperty("version", mod.getMetadata().getVersion().getFriendlyString());
JsonArray authors = new JsonArray();
mod.getMetadata().getAuthors().stream().map(it -> {
JsonObject info = new JsonObject();
JsonObject contact = new JsonObject();
it.getContact().asMap().entrySet()
.forEach(c -> contact.addProperty(c.getKey(), c.getValue()));
if (contact.size() != 0) {
info.add("contact", contact);
}
info.addProperty("name", it.getName());
return info;
}).forEach(authors::add);
jsonMod.add("authors", authors);
return jsonMod;
}).forEach(mods::add);
platformSpecific.add("mods", mods);
NativeVersionProvider ver = Via.getManager().getProviders().get(NativeVersionProvider.class);
if (ver != null) {
platformSpecific.addProperty("native version", ver.getNativeServerProtocolVersion().getVersion());
}
return platformSpecific;
}
@Override
public final boolean hasPlugin(String name) {
return FabricLoader.getInstance().isModLoaded(name);
}
}

View File

@ -0,0 +1,209 @@
/*
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.viaversion.fabric.common.provider;
import com.google.common.primitives.Ints;
import com.viaversion.fabric.common.AddressParser;
import com.viaversion.fabric.common.config.VFConfig;
import com.viaversion.fabric.common.platform.NativeVersionProvider;
import com.viaversion.fabric.common.util.ProtocolUtils;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.connection.ProtocolInfo;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.protocol.packet.State;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.exception.CancelException;
import com.viaversion.viaversion.protocol.version.BaseVersionProvider;
import com.viaversion.viaversion.protocols.base.BaseProtocol1_16;
import com.viaversion.viaversion.protocols.base.BaseProtocol1_7;
import com.viaversion.viaversion.protocols.base.ClientboundStatusPackets;
import io.netty.channel.ChannelPipeline;
import net.fabricmc.loader.api.FabricLoader;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.logging.Logger;
import java.util.stream.IntStream;
public abstract class AbstractFabricVersionProvider extends BaseVersionProvider {
private int[] multiconnectSupportedVersions = null;
{
multiconnectIntegration();
}
private void multiconnectIntegration() {
if (!FabricLoader.getInstance().isModLoaded("multiconnect")) return;
try {
Class<?> mcApiClass = Class.forName("net.earthcomputer.multiconnect.api.MultiConnectAPI");
Class<?> iProtocolClass = Class.forName("net.earthcomputer.multiconnect.api.IProtocol");
Object mcApiInstance = mcApiClass.getMethod("instance").invoke(null);
List<?> protocols = (List<?>) mcApiClass.getMethod("getSupportedProtocols").invoke(mcApiInstance);
Method getValue = iProtocolClass.getMethod("getValue");
Method isMulticonnectBeta;
try {
isMulticonnectBeta = iProtocolClass.getMethod("isMulticonnectBeta");
} catch (NoSuchMethodException e) {
isMulticonnectBeta = null;
}
Set<Integer> vers = new TreeSet<>();
for (Object protocol : protocols) {
// Do not use versions with beta multiconnect support, which may have stability issues
if (isMulticonnectBeta == null || !(Boolean) isMulticonnectBeta.invoke(protocol)) {
vers.add((Integer) getValue.invoke(protocol));
}
}
multiconnectSupportedVersions = vers.stream().mapToInt(Integer::intValue).toArray();
getLogger().info("ViaFabric will integrate with multiconnect");
} catch (ClassNotFoundException | IllegalAccessException | InvocationTargetException | NoSuchMethodException
| ClassCastException ignored) {
}
}
@Override
public ProtocolVersion getClosestServerProtocol(UserConnection connection) throws Exception {
if (connection.isClientSide()) {
ProtocolInfo info = Objects.requireNonNull(connection.getProtocolInfo());
if (!getConfig().isClientSideEnabled()) return info.protocolVersion();
int serverVer = getConfig().getClientSideVersion();
SocketAddress addr = connection.getChannel().remoteAddress();
if (addr instanceof InetSocketAddress) {
AddressParser parser = new AddressParser();
Integer addrVersion = parser.parse(((InetSocketAddress) addr).getHostName()).protocol;
if (addrVersion != null) {
serverVer = addrVersion;
}
try {
if (serverVer == -2) {
// Hope protocol was autodetected
ProtocolVersion autoVer =
detectVersion((InetSocketAddress) addr).getNow(null);
if (autoVer != null) {
serverVer = autoVer.getVersion();
}
}
} catch (Exception e) {
getLogger().warning("Couldn't auto detect: " + e);
}
}
ProtocolVersion serverVersion = ProtocolVersion.getProtocol(serverVer);
boolean blocked = checkAddressBlocked(addr);
boolean supported = ProtocolUtils.isSupported(serverVersion, info.protocolVersion());
handleMulticonnectPing(connection, info, blocked, serverVersion);
if (blocked || !supported) serverVer = info.getProtocolVersion();
return ProtocolVersion.getProtocol(serverVer);
}
NativeVersionProvider natProvider = Via.getManager().getProviders().get(NativeVersionProvider.class);
if (natProvider != null) {
return natProvider.getNativeServerProtocolVersion();
}
return super.getClosestServerProtocol(connection);
}
private boolean checkAddressBlocked(SocketAddress addr) {
return addr instanceof InetSocketAddress && (isDisabled(((InetSocketAddress) addr).getHostString())
|| ((((InetSocketAddress) addr).getAddress() != null) &&
(isDisabled(((InetSocketAddress) addr).getAddress().getHostAddress())
|| isDisabled(((InetSocketAddress) addr).getAddress().getHostName()))));
}
private void handleMulticonnectPing(UserConnection connection, ProtocolInfo info, boolean blocked, ProtocolVersion serverVer) throws Exception {
if (info.getServerState() == State.STATUS
&& info.getProtocolVersion() == -1
&& isMulticonnectHandler(connection.getChannel().pipeline())
&& (blocked || ProtocolUtils.isSupported(serverVer, getVersionForMulticonnect(serverVer)))) { // Intercept the connection
ProtocolVersion multiconnectSuggestion = blocked ? ProtocolVersion.unknown : getVersionForMulticonnect(serverVer);
getLogger().info("Sending " + multiconnectSuggestion + " for multiconnect version detector");
PacketWrapper newAnswer = PacketWrapper.create(ClientboundStatusPackets.STATUS_RESPONSE, null, connection);
newAnswer.write(Types.STRING, "{\"version\":{\"name\":\"viafabric integration\",\"protocol\":" + multiconnectSuggestion.getVersion() + "}}");
newAnswer.send(info.getPipeline().contains(BaseProtocol1_16.class) ? BaseProtocol1_16.class : BaseProtocol1_7.class);
throw CancelException.generate();
}
}
protected boolean isMulticonnectHandler(ChannelPipeline pipe) {
return false;
}
private ProtocolVersion getVersionForMulticonnect(ProtocolVersion clientSideVersion) {
// https://github.com/ViaVersion/ViaVersion/blob/master/velocity/src/main/java/us/myles/ViaVersion/velocity/providers/VelocityVersionProvider.java
int[] compatibleProtocols = multiconnectSupportedVersions;
if (Arrays.binarySearch(compatibleProtocols, clientSideVersion.getVersion()) >= 0) {
return clientSideVersion;
}
if (clientSideVersion.getVersion() < compatibleProtocols[0]) {
return ProtocolVersion.getProtocol(compatibleProtocols[0]);
}
// TODO: This needs a better fix, i.e checking ProtocolRegistry to see if it would work.
for (int i = compatibleProtocols.length - 1; i >= 0; i--) {
int protocol = compatibleProtocols[i];
if (clientSideVersion.getVersion() > protocol && ProtocolVersion.isRegistered(protocol)) {
return ProtocolVersion.getProtocol(protocol);
}
}
getLogger().severe("multiconnect integration: Panic, no protocol id found for " + clientSideVersion);
return clientSideVersion;
}
private boolean isDisabled(String addr) {
String[] parts = addr.split("\\.");
boolean isNumericIp = parts.length == 4 && Arrays.stream(parts).map(Ints::tryParse).allMatch(Objects::nonNull);
return IntStream.range(0, parts.length).anyMatch(i -> {
String query;
if (isNumericIp) {
query = String.join(".", Arrays.stream(parts, 0, i + 1)
.toArray(String[]::new)) + ((i != 3) ? ".*" : "");
} else {
query = ((i != 0) ? "*." : "") + String.join(".", Arrays.stream(parts, i, parts.length)
.toArray(String[]::new));
}
if (getConfig().isForcedDisable(query)) {
getLogger().info(addr + " is force-disabled. (Matches " + query + ")");
return true;
} else {
return false;
}
});
}
protected abstract Logger getLogger();
protected abstract VFConfig getConfig();
protected abstract CompletableFuture<ProtocolVersion> detectVersion(InetSocketAddress address);
}

View File

@ -0,0 +1,35 @@
/*
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.viaversion.fabric.common.util;
import com.viaversion.viaversion.api.platform.PlatformTask;
import java.util.concurrent.Future;
public class FutureTaskId implements PlatformTask<Future<?>> {
private final Future<?> object;
public FutureTaskId(Future<?> object) {
this.object = object;
}
@Override
public void cancel() {
object.cancel(false);
}
}

View File

@ -1,28 +1,21 @@
/*
* MIT License
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* Copyright (c) 2018 creeper123123321 and contributors
* 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.
*
* 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:
* 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.
*
* 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.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.creeper123123321.viafabric.util;
package com.viaversion.fabric.common.util;
import java.text.MessageFormat;
import java.util.logging.Level;

View File

@ -0,0 +1,89 @@
/*
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.viaversion.fabric.common.util;
import com.viaversion.fabric.common.platform.NativeVersionProvider;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import java.util.Arrays;
import java.util.stream.Stream;
public class ProtocolUtils {
public static boolean isSupportedClientSide(ProtocolVersion server) {
return isSupported(server, Via.getManager().getProviders()
.get(NativeVersionProvider.class)
.getNativeServerProtocolVersion());
}
public static boolean isSupported(ProtocolVersion server, ProtocolVersion client) {
return server.equals(client) || Via.getManager().getProtocolManager().getProtocolPath(client, server) != null;
}
public static String getProtocolName(int id) {
if (!ProtocolVersion.isRegistered(id)) return Integer.toString(id);
return ProtocolVersion.getProtocol(id).getName();
}
public static boolean isValid(final ProtocolVersion version) {
return version.isKnown() && version.getVersion() != -2;
}
public static boolean isStartOfProtocolText(String s) {
try {
Integer.parseInt(s);
return true;
} catch (NumberFormatException e) {
try {
Integer.parseInt(s + '0');
return true;
} catch (NumberFormatException e2) {
if (ProtocolVersion.getClosest(s) != null) return true;
return ProtocolVersion.getProtocols().stream()
.map(ProtocolVersion::getName)
.flatMap(str -> Stream.concat(
Arrays.stream(str.split("-")),
Arrays.stream(new String[]{str})
))
.anyMatch(ver -> ver.startsWith(s));
}
}
}
public static Integer parseProtocolId(String s) {
try {
return Integer.parseInt(s);
} catch (NumberFormatException ignored) {
ProtocolVersion closest = ProtocolVersion.getClosest(s);
if (closest == null) return null;
return closest.getVersion();
}
}
public static String[] getProtocolSuggestions(String text) {
return ProtocolVersion.getProtocols().stream()
.map(ProtocolVersion::getName)
.flatMap(str -> Stream.concat(
Arrays.stream(str.split("-")),
Arrays.stream(new String[]{str})
))
.distinct()
.filter(ver -> ver.startsWith(text))
.toArray(String[]::new);
}
}

View File

@ -0,0 +1,38 @@
/*
* This file is part of ViaFabric - https://github.com/ViaVersion/ViaFabric
* Copyright (C) 2018-2024 ViaVersion and contributors
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.viaversion.fabric.common.util;
public class RemappingUtil {
public static int swordId(String id) {
// https://github.com/ViaVersion/ViaVersion/blob/8de26a0ad33f5b739f5394ed80f69d14197fddc7/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/Protocol1_9To1_8.java#L86
switch (id) {
case "minecraft:iron_sword":
return 267;
case "minecraft:wooden_sword":
return 268;
case "minecraft:golden_sword":
return 272;
case "minecraft:diamond_sword":
return 276;
case "minecraft:stone_sword":
return 283;
}
return 0;
}
}

View File

@ -1,6 +1,17 @@
# WARNING
# I can not guarantee that this mod is allowed on every (or even any) server. This mod may cause problems with anti cheat plugins. USE AT OWN RISK
# This option enables client-side transforming (can also be enabled in-game)
# Disclaimer:
#
# It cannot be guaranteed that this mod is allowed on specific servers as it can possibly cause problems with anti-cheat plugins, (USE ONLY WITH CAUTION!)
# This option enables client-side transforming. (can also be enabled in-game)
enable-client-side: false
# This option sets the protocol version to be used when connection to the server (can also be changed in-game)
client-side-version: -1
# This option sets the protocol version to be used when connecting to servers. (can also be changed in-game)
client-side-version: -1
# Hides VIA button from multiplayer menu.
hide-button: false
# List of servers which ViaFabric will force disable transforming on client-side. It can be overwritten by setting per-server version.
#
# This isn't always the address in multiplayer menu; It will use the SRV record pointer when present, Check the game log for the address.
# Uses https://wiki.vg/Mojang_API#Blocked_Servers format (mc.example.com, *.example.com, 192.168.0.1, 192.168.*)
client-side-force-disable: ["hypixel.net", "*.hypixel.net", "minemen.club", "*.minemen.club", "icantjoinlmfao.club"]
# Fabric registry synchronization will be disabled when installed server-side and validation errors are ignored when installed on client-side.
# Note: this setting only works on 1.20.4+ ViaFabric versions, and it might cause issues, use with caution.
ignore-registry-sync-errors: false

View File

@ -0,0 +1 @@
# Autogenerated ${de_de}

View File

@ -3,5 +3,12 @@
"gui.enable_client_side_button": "ViaVersion aktivieren",
"gui.enable_client_side.question": "Bist du dir sicher, dass du den clientseitigen Modus aktivieren möchtest?",
"gui.enable_client_side.warning": "Ich kann nicht garantieren, dass diese Mod auf jedem (oder überhaupt einem) Server erlaubt ist. Diese Mod könnte eventuell Probleme mit Anti-Cheat Plugins hervorrufen. VERWENDUNG AUF EIGENE GEFAHR.",
"gui.enable_client_side.enable": "Aktivieren"
}
"gui.enable_client_side.enable": "Aktivieren",
"gui.viafabric_config.title": "ViaFabric-Konfigurationen",
"gui.client_side.enable": "Clientseitig aktivieren",
"gui.client_side.disable": "Clientseitig deaktivieren",
"gui.ping_version.translated": "VIA: %s",
"gui.hide_via_button.enable": "VIA Button ausblenden",
"gui.hide_via_button.disable": "VIA Button anzeigen",
"gui.via_button": "VIA"
}

View File

@ -0,0 +1 @@
# Autogenerated ${en_us}

View File

@ -2,6 +2,13 @@
"gui.protocol_version_field.name": "Protocol Version",
"gui.enable_client_side_button": "Enable ViaVersion",
"gui.enable_client_side.question": "Are you sure you want to enable client-side mode?",
"gui.enable_client_side.warning": "I can not guarantee that this mod is allowed on every (or even any) server. This mod may cause problems with anti-cheat plugins. USE AT OWN RISK.",
"gui.enable_client_side.enable": "Enable"
}
"gui.enable_client_side.warning": "It cannot be guaranteed that this mod is allowed on specific servers as it can possibly cause problems with anti-cheat plugins. (USE ONLY WITH CAUTION!)",
"gui.enable_client_side.enable": "Enable",
"gui.viafabric_config.title": "ViaFabric Configurations",
"gui.client_side.enable": "Enable client-side",
"gui.client_side.disable": "Disable client-side",
"gui.ping_version.translated": "VIA: %s (%s)",
"gui.hide_via_button.enable": "Hide VIA button",
"gui.hide_via_button.disable": "Show VIA button",
"gui.via_button": "VIA"
}

View File

@ -0,0 +1 @@
# Autogenerated ${es_es}

View File

@ -0,0 +1,14 @@
{
"gui.protocol_version_field.name": "Versión del protocolo",
"gui.enable_client_side_button": "Activar ViaVersion",
"gui.enable_client_side.question": "¿Estás seguro de que quieres habilitar el modo de lado del cliente?",
"gui.enable_client_side.warning": "No puedo garantizar que este mod esté permitido en todos (o incluso en cualquier) los servidores. Este mod puede causar problemas con los plugins anti-cheat. EL USO DE ESTE MOD ES BAJO SU PROPIO RIESGO.",
"gui.enable_client_side.enable": "Activar",
"gui.viafabric_config.title": "Configuraciones de ViaFabric",
"gui.client_side.enable": "Activar el lado del cliente",
"gui.client_side.disable": "Desactivar el lado del cliente",
"gui.ping_version.translated": "VIA: %s",
"gui.hide_via_button.enable": "Ocultar el botón VIA",
"gui.hide_via_button.disable": "Mostrar el botón VIA",
"gui.via_button": "VIA"
}

View File

@ -0,0 +1 @@
# Autogenerated ${et_ee}

View File

@ -0,0 +1,14 @@
{
"gui.protocol_version_field.name": "Protokolli versioon",
"gui.enable_client_side_button": "Luba ViaVersion",
"gui.enable_client_side.question": "Kas soovid kindlasti lubada kliendipoolse režiimi?",
"gui.enable_client_side.warning": "Ma ei saa garanteerida selle modi lubamist igas (mistahes) serveris. See mod võib põhjustada sohivastaste pluginatega probleeme. KASUTA OMAL VASTUTUSEL.",
"gui.enable_client_side.enable": "Luba",
"gui.viafabric_config.title": "ViaFabricu seadistused",
"gui.client_side.enable": "Luba kliendipoolne",
"gui.client_side.disable": "Keela kliendipoolne",
"gui.ping_version.translated": "VIA: %s",
"gui.hide_via_button.enable": "Peida VIA nupp",
"gui.hide_via_button.disable": "Kuva VIA nuppu",
"gui.via_button": "VIA"
}

View File

@ -0,0 +1 @@
# Autogenerated ${fr_fr}

View File

@ -0,0 +1,14 @@
{
"gui.protocol_version_field.name": "Version du protocole",
"gui.enable_client_side_button": "Activer ViaVersion",
"gui.enable_client_side.question": "Êtes vous sûr de vouloir activer le mode coté client ?",
"gui.enable_client_side.warning": "Je ne peux pas vous garantir que ce mod est autorisé dans tous (ou même aucun) serveur. Ce mod peut causer des problèmes avec les plugin anti-cheat. À UTILISEZ À VOS RISQUES ET PERILS.",
"gui.enable_client_side.enable": "Activer",
"gui.viafabric_config.title": "Configuration de ViaFabric",
"gui.client_side.enable": "Activer coté client",
"gui.client_side.disable": "Désactiver coté client",
"gui.ping_version.translated": "VIA: %s",
"gui.hide_via_button.enable": "Cacher le bouton VIA",
"gui.hide_via_button.disable": "Montrer le bouton VIA",
"gui.via_button": "VIA"
}

View File

@ -0,0 +1 @@
# Autogenerated ${hi_in}

View File

@ -0,0 +1,14 @@
{
"gui.protocol_version_field.name": "प्रोटोकॉल संस्करण",
"gui.enable_client_side_button": "ViaVersion सक्षम करें",
"gui.enable_client_side.question": "क्या आप वाकई में उपयोगकर्ता-मोड सक्षम करना चाहते हैं?",
"gui.enable_client_side.warning": "यह गारंटी नहीं दी जा सकती है कि यह mod कुछ सर्वेरों पर अनुमत है क्योंकि यह छल विरोधी प्लगिन के साथ समस्या उत्पन्न कर सकता है। (सावधानी से इस्तेमाल करें!)",
"gui.enable_client_side.enable": "सक्षम करें",
"gui.viafabric_config.title": "ViaFabric कॉन्फ़िगरेशन",
"gui.client_side.enable": "क्लाइंट साइड पर चालू करें",
"gui.client_side.disable": "क्लाइंट साइड पर बंद करें",
"gui.ping_version.translated": "VIA: %s",
"gui.hide_via_button.enable": "VIA बटन छुपाएँ",
"gui.hide_via_button.disable": "VIA बटन दिखाएँ",
"gui.via_button": "VIA"
}

View File

@ -0,0 +1 @@
# Autogenerated ${it_it}

View File

@ -0,0 +1,14 @@
{
"gui.protocol_version_field.name": "Versione del protocollo",
"gui.enable_client_side_button": "Attivare ViaVersion",
"gui.enable_client_side.question": "Siete sicuri di voler attivare la modalità lato cliente?",
"gui.enable_client_side.warning": "Non posso garantire che questo mod sia consentito su ogni server (o anche solo su uno qualsiasi). Questo mod può causare problemi con i plugin anti-cheat. USO A PROPRIO RISCHIO E PERICOLO.",
"gui.enable_client_side.enable": "Attivare",
"gui.viafabric_config.title": "Configurazioni ViaFabric",
"gui.client_side.enable": "Attivare lato cliente",
"gui.client_side.disable": "Disattivare lato cliente",
"gui.ping_version.translated": "VIA: %s",
"gui.hide_via_button.enable": "Nascondi il pulsante VIA",
"gui.hide_via_button.disable": "Mostra il pulsante VIA",
"gui.via_button": "VIA"
}

View File

@ -0,0 +1 @@
# Autogenerated ${ja_jp}

View File

@ -0,0 +1,14 @@
{
"gui.protocol_version_field.name": "プロトコルバージョン",
"gui.enable_client_side_button": "ViaVersionを有効にする",
"gui.enable_client_side.question": "本当にクライアントサイドモードを有効にしますか?",
"gui.enable_client_side.warning": "私はこのMODがすべての(あるいはどのサーバーでも)許可されていることを保証することはできません。このMODはアンチチートプラグインの問題を引き起こす可能性があります。自己責任で使用してください。",
"gui.enable_client_side.enable": "有効化",
"gui.viafabric_config.title": "ViaFabricの構成",
"gui.client_side.enable": "クライアント側を有効にする",
"gui.client_side.disable": "クライアント側を無効にする",
"gui.ping_version.translated": "VIA: %s",
"gui.hide_via_button.enable": "VIAボタンを隠す",
"gui.hide_via_button.disable": "VIAボタンを表示",
"gui.via_button": "VIA"
}

View File

@ -0,0 +1 @@
# Autogenerated ${nl_nl}

View File

@ -0,0 +1,14 @@
{
"gui.protocol_version_field.name": "Protocolversie",
"gui.enable_client_side_button": "Schakel ViaVersion in",
"gui.enable_client_side.question": "Weet u zeker dat u de client-side modus wilt inschakelen?",
"gui.enable_client_side.warning": "Ik kan niet garanderen dat deze mod op elke (of zelfs maar één) server is toegestaan. Deze mod kan problemen veroorzaken met anti-cheat plugins. GEBRUIK OP EIGEN RISICO.",
"gui.enable_client_side.enable": "Schakel in",
"gui.viafabric_config.title": "ViaFabric-configuraties",
"gui.client_side.enable": "Klantenservice inschakelen",
"gui.client_side.disable": "Cliëntenservice uitschakelen",
"gui.ping_version.translated": "VIA: %s",
"gui.hide_via_button.enable": "VIA-knop verbergen",
"gui.hide_via_button.disable": "Toon VIA-knop",
"gui.via_button": "VIA"
}

View File

@ -0,0 +1 @@
# Autogenerated ${pl_pl}

View File

@ -3,5 +3,12 @@
"gui.enable_client_side_button": "Włącz ViaVersion",
"gui.enable_client_side.question": "Jesteś pewien, że chcesz włączyć tryb client-side?",
"gui.enable_client_side.warning": "Nie możemy zagwarantować, że ten mod jest dozwolony na każdym (lub jakimkolwiek) serwerze. Ten mod może powodować problemy z anty-cheatami. UŻYWASZ NA WŁASNE RYZYKO!.",
"gui.enable_client_side.enable": "Włącz"
}
"gui.enable_client_side.enable": "Włączyć",
"gui.viafabric_config.title": "Konfiguracje ViaFabric",
"gui.client_side.enable": "Włączenie po stronie klienta",
"gui.client_side.disable": "Wyłączenie po stronie klienta",
"gui.ping_version.translated": "VIA: %s",
"gui.hide_via_button.enable": "Ukrycie przycisku VIA",
"gui.hide_via_button.disable": "Pokaż przycisk VIA",
"gui.via_button": "VIA"
}

View File

@ -0,0 +1 @@
# Autogenerated ${pt_br}

View File

@ -1,7 +1,14 @@
{
"gui.protocol_version_field.name": "Versão do protocolo",
"gui.enable_client_side_button": "Habilitar ViaVersion",
"gui.enable_client_side.question": "Você tem certeza de que deseja habilitar o modo client-side?",
"gui.enable_client_side.question": "Você tem certeza de que deseja habilitar o modo cliente?",
"gui.enable_client_side.warning": "Não posso garantir que este mod seja permitido em todos os (ou mesmo em quaisquer) servidores. Esse poderá causar problemas com plugins anti-trapaça. USE POR SUA PRÓPRIA CONTA E RISCO.",
"gui.enable_client_side.enable": "Habilitar"
}
"gui.enable_client_side.enable": "Habilitar",
"gui.viafabric_config.title": "Configurações de ViaFabric",
"gui.client_side.enable": "Habilitar modo cliente",
"gui.client_side.disable": "Desativar modo cliente",
"gui.ping_version.translated": "VIA: %s",
"gui.hide_via_button.enable": "Esconder botão VIA",
"gui.hide_via_button.disable": "Mostrar botão VIA",
"gui.via_button": "VIA"
}

View File

@ -0,0 +1 @@
# Autogenerated ${ru_ru}

View File

@ -0,0 +1,14 @@
{
"gui.protocol_version_field.name": "Версия протокола",
"gui.enable_client_side_button": "Включить ViaVersion",
"gui.enable_client_side.question": "Вы уверены, что хотите включить режим: На стороне клиента?",
"gui.enable_client_side.warning": "Я не могу гарантировать, что этот мод разрешён любом (или хотя бы) сервере. Этот мод может вызывать проблемы с Античит плагинами. ИСПОЛЬЗУЙТЕ НА СВОЙ СТРАХ И РИСК.",
"gui.enable_client_side.enable": "Включить",
"gui.viafabric_config.title": "Конфигурации ViaFabric",
"gui.client_side.enable": "Включить на стороне клиента",
"gui.client_side.disable": "Отключить на стороне клиента",
"gui.ping_version.translated": "VIA: %s",
"gui.hide_via_button.enable": "Скрыть кнопку VIA",
"gui.hide_via_button.disable": "Показать кнопку VIA",
"gui.via_button": "VIA"
}

View File

@ -0,0 +1 @@
# Autogenerated ${tr_tr}

View File

@ -0,0 +1,14 @@
{
"gui.protocol_version_field.name": "Protokol Versiyonu",
"gui.enable_client_side_button": "ViaVersion'u aktive et",
"gui.enable_client_side.question": "Alıcı-tarafı modunu aktive etmek istediğinize min misiniz?",
"gui.enable_client_side.warning": "Bu modun her ( veya herhangi ) bir sunucuda izin verildiğine garanti veremem. Bu mod anti-cheat pluginleriyle sorunlara yol açabilir. KENDİ RİSKİNİZDE KULLANIN.",
"gui.enable_client_side.enable": "Aktive et",
"gui.viafabric_config.title": "ViaFabric Konfigürasyonu",
"gui.client_side.enable": "Alıcı-tarafı aktive et",
"gui.client_side.disable": "Alıcı-tarafı devre dışı bırak",
"gui.ping_version.translated": "VIA: %s",
"gui.hide_via_button.enable": "VIA tuşunu gizle",
"gui.hide_via_button.disable": "VIA tuşunu göster",
"gui.via_button": "VIA"
}

View File

@ -0,0 +1,15 @@
{
"modmenu.summaryTranslation.viafabric": "Fabric өчен клиентлы һәм серверлы ViaVersion тормышка ашыру.",
"gui.protocol_version_field.name": "Протокол версиясе",
"gui.enable_client_side_button": "ViaVersion кушу",
"gui.enable_client_side.question": "Сез чыннан да «клиент тарафында» шартын кушырга телисезме?",
"gui.enable_client_side.warning": "Бу мод билгеле бер серверларда рөхсәт ителгән дип гарантияләргә ярамый, чөнки ул античит-плагиннар белән проблемалар китереп чыгара ала. (САК БУЛЫГЫЗ!)",
"gui.enable_client_side.enable": "Кушу",
"gui.viafabric_config.title": "ViaFabric көйләүләре",
"gui.client_side.enable": "Клиент тарафында кушу",
"gui.client_side.disable": "Клиент тарафында сүндерү",
"gui.ping_version.translated": "VIA: %s (%s)",
"gui.hide_via_button.enable": "VIA төймәсен яшерү",
"gui.hide_via_button.disable": "VIA төймәсен күрсәтү",
"gui.via_button": "VIA"
}

View File

@ -0,0 +1 @@
# Autogenerated ${zh_cn}

View File

@ -0,0 +1 @@
# Autogenerated ${zh_tw}

View File

@ -0,0 +1 @@
# Autogenerated ${zh_tw}

View File

@ -1,7 +1,14 @@
{
"gui.protocol_version_field.name": "协议版本",
"gui.enable_client_side_button": "启用 ViaVersion",
"gui.enable_client_side.question": "您确定要启用客户端模式?",
"gui.enable_client_side.warning": "我无法保证所有(甚至任何一个)服务器允许您使用这个 mod。这个 mod 可能被反作弊插件作出误判。使用后果自负。",
"gui.enable_client_side.enable": "启用"
"gui.enable_client_side.question": "你确定要启用客户端模式?",
"gui.enable_client_side.warning": "作者无法保证所有的服务器都允许你使用这个模组。这个模组可能使你被反作弊插件误判。使用后果自负!",
"gui.enable_client_side.enable": "启用",
"gui.viafabric_config.title": "ViaFabric 配置",
"gui.client_side.enable": "启用客户端模式",
"gui.client_side.disable": "禁用客户端模式",
"gui.ping_version.translated": "转换为:%s%s",
"gui.hide_via_button.enable": "隐藏 VIA 按钮",
"gui.hide_via_button.disable": "显示 VIA 按钮",
"gui.via_button": "VIA"
}

Some files were not shown because too many files have changed in this diff Show More