Compare commits

...
60 Commits
Author SHA1 Message Date
Alexander Xia 5ebee1f1e0 Bump 14.12 2020-07-06 23:01:40 +08:00
Alexander Xia 1eb8db550f Fix custom launchwrapper 2020-07-06 22:57:31 +08:00
Alexander Xia 52a232f982 Update custom launchwrapper version 2020-07-06 22:54:49 +08:00
ZekerZhayard eeebc30b58 Apply custom launchwrapper. (#102) 2020-07-02 01:08:24 +08:00
Evan Goode 46bccadca2 Escape URLs, for usernames with spaces (#100) 2020-07-01 22:47:47 +08:00
ZekerZhayard d7f207177c Apply ModSystemTweaker when another tweaker being applied. (#101) 2020-07-01 22:47:40 +08:00
ZekerZhayard 339e30247a Add "launchermeta" to "latest.json". (#99) 2020-06-30 23:45:37 +08:00
ZekerZhayard ba8d86789d Support Vanilla 1.8.9, 1.12.2, 1.15.2, 1.16.1. (#98)
* Support Vanilla 1.8.9, 1.12.2, 1.15.2, 1.16.1.

* Move vanilla specific version folders to "Vanilla" folder.

* Fix launchwrapper dependency.

* Update profile.

* Move customskinloader.fabric.mixin to customskinloader.mixin
2020-06-29 01:33:53 +08:00
ZekerZhayard a9f19cfc8d Allow users to customize the size of thread pools. (#86)
* Increase compatible Java version to 8.

* Support Forge & Fabric 1.15.2

* Fix lag spike while loading player skull textures.

* Allow users to customize the size of thread pools.

* Use the old scheme about loading skulls to avoid blocking the thread pool when "enableUpdateSkull" is true.

* Fix merge.
2020-06-29 00:57:42 +08:00
ZekerZhayard 8b1400ef0d Support Forge 1.16.x. (#97)
* Support Forge 1.16.x.

* Add Minecraft versions.
2020-06-29 00:56:41 +08:00
Steven Qiu 82c2e80e76 Update LittleSkin's API Root (#96) 2020-06-23 21:16:20 +08:00
ZekerZhayard 8146773354 Fix legacy model auto judge for 1.15.x (#93) 2020-05-21 10:30:45 +08:00
Alexander Xia 5ac6aa1865 Fix legacy model auto judge
Thanks to @ZekerZhayard
2020-05-21 02:37:51 +08:00
Alexander Xia dab8e3dd22 Fix legacy model auto judge 2020-05-20 18:38:31 +08:00
ZekerZhayard fdceb08a2c Fix skull loading lag for Minecraft 1.13.2 or older version. (#91) 2020-05-15 22:51:04 +08:00
ZekerZhayard ad846f37a2 Support Fabric 20w17a. (#90) 2020-05-12 17:07:30 +08:00
ZekerZhayard b8ce13606b Fix SkullTileEntityTransformer. (#88) 2020-04-17 20:19:23 +08:00
Steven Qiu 2fbd3965e0 Update LittleSkin's API root (#87) 2020-04-17 11:21:54 +08:00
Alexander Xia a714670b9a Fix GitHub publish in pull request 2020-03-29 22:57:28 +08:00
Alexander Xia c5460624e3 Fix typo 2020-03-29 19:56:52 +08:00
Alexander Xia 9f63a770c3 Fix concurrent issue 2020-03-26 10:22:20 +08:00
ZekerZhayard 4d234762d2 Fix lag spike while loading player skull textures. (#84)
* Increase compatible Java version to 8.

* Support Forge & Fabric 1.15.2

* Fix lag spike while loading player skull textures.
2020-03-25 11:58:01 +08:00
Alexander Xia 730b565c59 Fix transform script 2020-03-25 10:54:31 +08:00
Alexander Xia 4d12d70bf0 Fix skull loading lag
#79
2020-03-25 10:17:28 +08:00
Alexander Xia 42adcb5b27 Add thread pool to load skull
#79
2020-03-24 11:46:11 +08:00
Alexander Xia 77ddcc8bf5 Add GitHub Packages 2020-03-11 17:26:28 +08:00
Alexander Xia d46adaac5e Tweak transformer to avoid repeated modification 2020-03-04 15:51:54 +08:00
Alexander Xia a6666b53a1 Fix UniSkinAPI elytra 2020-02-22 03:05:38 +08:00
ZekerZhayard 958860ecce Support Forge & Fabric 1.15.2 (#78)
* Increase compatible Java version to 8.

* Support Forge & Fabric 1.15.2
2020-01-24 16:56:26 +08:00
ZekerZhayard 6fab945eb1 Support Forge for Minecraft 1.15.x (#77) 2019-12-18 15:07:46 +08:00
ZekerZhayard e19b9d860f Support Fabric for Minecraft 1.15.x (#75)
* Support Fabric for Minecraft 1.15.x

* Remove unused imports
2019-12-11 18:53:57 +08:00
ZekerZhayard 7adb0f9ef7 Fix PlayerTab for 1.14+ in Fabric. (#72) 2019-12-10 12:52:55 +08:00
Alexander Xia 1bb130bb87 Add latest.json 2019-12-10 03:10:26 +08:00
Alexander Xia 779e25f837 Init CustomSkinLoader earlier 2019-12-09 23:47:29 +08:00
Alexander Xia 3a2d8f9caf Fix PlayerTab in 1.14+ again 2019-12-09 23:20:52 +08:00
Alexander Xia 0c91fb3975 Fix PlayerTab in 1.14+ 2019-12-09 23:10:27 +08:00
Alexander Xia 290cbb63d8 Support UUID in Legacy Loader
Update copyright statement
#65 #66
2019-10-03 15:30:46 +08:00
Alexander Xia 100e661ac5 Add 1.14.4 vanilla 2019-09-20 22:07:58 +08:00
Alexander Xia c490631f2c Fix spelling mistake 2019-09-20 16:33:04 +08:00
Alexander Xia c519d09be4 Fix content type which causes 415 2019-09-20 11:44:07 +08:00
Alexander Xia e5a31ae49e Add custom Yggdrasil api & sessionserver root 2019-09-18 22:50:04 +08:00
Alexander Xia 68615ba724 Add custom Yggdrasil root 2019-09-18 22:15:58 +08:00
Alexander Xia 10e57fe349 Bump 14.11 2019-08-27 17:55:49 +08:00
Alexander Xia 9f70ad0159 Update upload url 2019-06-25 15:24:14 +08:00
ZekerZhayard 0d5538a110 Support for forge 1.14.2 (#59)
* Support for forge 1.14.2

* Delete unnecessary code.
2019-06-25 14:38:40 +08:00
Alexander Xia 27efbbfeb0 Fix addScheduledTask method not found 2019-06-24 20:07:48 +08:00
Alexander Xia 7fad8c602d Add 1.14.2 forge suport 2019-06-24 19:52:02 +08:00
Alexander Xia 29a0952bc4 Fix compatibility with ModLauncher 1.1 (#57) 2019-06-15 17:37:48 +08:00
Alexander Xia b7107b7172 Remove 1.13.2 vanilla 2019-05-24 00:06:35 +08:00
Alexander Xia 2adbc25f69 Fix gradle upload 2019-05-23 23:47:33 +08:00
ZekerZhayard 3bee9281ec Fix remapJar (#55) 2019-05-23 23:35:56 +08:00
ZekerZhayard 917f9f650b Support Fabric for 1.14.1 (#53)
* Fix ClassCastException

* Support Fabric for 1.14.1

* Support Fabric for 1.14.1

* Use mapping file instead of hard code
2019-05-22 23:47:59 +08:00
LionZXY edf6e241e4 Add GlitchlessAPI (#51)
* Add GlitchlessAPI

* Fix build and move GlitchlessSkin to down
2019-05-10 16:20:39 +08:00
Alexander Xia d2c65f00c9 Remove meaningless log 2019-04-26 13:59:08 +08:00
Alexander Xia 95ee345441 Fix 1.14 skin load 2019-04-26 13:56:22 +08:00
Alexander Xia 3ade4867d4 Add 1.14 to settings.gradle 2019-04-26 10:36:20 +08:00
Alexander Xia 2d1951774d Add 1.14 support 2019-04-26 10:34:31 +08:00
ZekerZhayard cc3616a074 Add CSLPluginsLoader (#48)
* Add CSLPluginsLoader

* Remove plugin loader. Add some events.

* Use ServiceLoader to load plugins

* Remove PluginClassLoader.
2019-03-08 13:38:44 +08:00
xfl03 42c48c5c2e Bump 14.10a 2019-03-05 19:33:09 +08:00
xfl03 030daf12a2 Fix 1.8 forge support 2019-03-04 20:12:13 +08:00
90 changed files with 2433 additions and 1352 deletions

No files matched your search

+2 -1
View File
@@ -22,11 +22,12 @@ jobs:
# - run: sudo chmod +x gradlew # - run: sudo chmod +x gradlew
# - run: ./gradlew --version # - run: ./gradlew --version
# - run: ./gradlew clean build # - run: ./gradlew clean build
# Gradle # Gradle
- run: gradle --version - run: gradle --version
- run: gradle clean build - run: gradle clean build
- run: gradle upload - run: gradle upload
- run: gradle publishGprPublicationToGitHubPackagesRepository
- store_artifacts: - store_artifacts:
path: ./build/libs path: ./build/libs
+4 -5
View File
@@ -4,11 +4,6 @@
# Mobile Tools for Java (J2ME) # Mobile Tools for Java (J2ME)
.mtj.tmp/ .mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid* hs_err_pid*
@@ -21,10 +16,14 @@ hs_err_pid*
*/.project */.project
.project .project
.settings/ .settings/
*.launch
# gradle # gradle
.gradle/ .gradle/
build/ build/
gradle/
gradlew*
run/
# IDEA # IDEA
.idea/ .idea/
-2
View File
@@ -1,2 +0,0 @@
/build/
/src/main/
-458
View File
@@ -1,458 +0,0 @@
CL: net/minecraft/util/ResourceLocation pc
CL: net/minecraft/util/ResourceLocation$Serializer pc$a
CL: net/minecraft/util/StringUtils xw
CL: net/minecraft/client/Minecraft cft
CL: net/minecraft/client/Minecraft$1 cft$1
CL: net/minecraft/client/Minecraft$2 cft$2
CL: net/minecraft/client/multiplayer/ServerData crj
CL: net/minecraft/client/multiplayer/ServerData$ServerResourceMode crj$a
CL: net/minecraft/client/renderer/IImageBuffer cub
CL: net/minecraft/client/renderer/ImageBufferDownload cug
CL: net/minecraft/client/renderer/ThreadDownloadImageData ddc
CL: net/minecraft/client/renderer/ThreadDownloadImageData$1 ddc$1
CL: net/minecraft/client/renderer/texture/NativeImage ddg
CL: net/minecraft/client/renderer/texture/NativeImage$1 ddg$1
CL: net/minecraft/client/renderer/texture/NativeImage$PixelFormat ddg$a
CL: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode ddg$b
CL: net/minecraft/client/renderer/texture/NativeImage$WriteCallback ddg$c
CL: net/minecraft/client/renderer/texture/SimpleTexture ddi
CL: net/minecraft/client/renderer/texture/TextureManager ddn
CL: net/minecraft/client/renderer/texture/ITextureObject ddo
CL: net/minecraft/client/resources/DefaultPlayerSkin dec
CL: net/minecraft/client/resources/SkinManager deh
CL: net/minecraft/client/resources/SkinManager$1 deh$1
CL: net/minecraft/client/resources/SkinManager$2 deh$2
CL: net/minecraft/client/resources/SkinManager$SkinAvailableCallback deh$a
FD: net/minecraft/util/ResourceLocation/field_110626_a pc/a
FD: net/minecraft/util/ResourceLocation/field_110625_b pc/b
FD: net/minecraft/util/ResourceLocation/field_200118_c pc/c
FD: net/minecraft/util/StringUtils/field_76339_a xw/a
FD: net/minecraft/client/Minecraft$1/field_74532_a cft$1/a
FD: net/minecraft/client/Minecraft$2/field_210222_a cft$2/a
FD: net/minecraft/client/Minecraft$2/field_210223_b cft$2/b
FD: net/minecraft/client/Minecraft/field_175612_E cft/D
FD: net/minecraft/client/Minecraft/field_195555_I cft/E
FD: net/minecraft/client/Minecraft/field_147123_G cft/F
FD: net/minecraft/client/Minecraft/field_211120_F cft/G
FD: net/minecraft/client/Minecraft/field_130070_K cft/H
FD: net/minecraft/client/Minecraft/field_181038_N cft/I
FD: net/minecraft/client/Minecraft/field_195556_O cft/J
FD: net/minecraft/client/Minecraft/field_71422_O cft/K
FD: net/minecraft/client/Minecraft/field_71446_o cft/L
FD: net/minecraft/client/Minecraft/field_71432_P cft/M
FD: net/minecraft/client/Minecraft/field_184131_U cft/N
FD: net/minecraft/client/Minecraft/field_195557_T cft/O
FD: net/minecraft/client/Minecraft/field_71434_R cft/P
FD: net/minecraft/client/Minecraft/field_71433_S cft/Q
FD: net/minecraft/client/Minecraft/field_181541_X cft/R
FD: net/minecraft/client/Minecraft/field_71428_T cft/S
FD: net/minecraft/client/Minecraft/field_71427_U cft/T
FD: net/minecraft/client/Minecraft/field_175616_W cft/U
FD: net/minecraft/client/Minecraft/field_175621_X cft/V
FD: net/minecraft/client/Minecraft/field_175620_Y cft/W
FD: net/minecraft/client/Minecraft/field_175622_Z cft/X
FD: net/minecraft/client/Minecraft/field_193995_ae cft/Y
FD: net/minecraft/client/Minecraft/field_71449_j cft/Z
FD: net/minecraft/client/Minecraft/field_142025_a cft/a
FD: net/minecraft/client/Minecraft/field_211502_b cft/b
FD: net/minecraft/client/Minecraft/field_71464_q cft/c
FD: net/minecraft/client/Minecraft/field_71444_a cft/d
FD: net/minecraft/client/Minecraft/field_71442_b cft/e
FD: net/minecraft/client/Minecraft/field_195558_d cft/f
FD: net/minecraft/client/Minecraft/field_71441_e cft/g
FD: net/minecraft/client/Minecraft/field_71438_f cft/h
FD: net/minecraft/client/Minecraft/field_71439_g cft/i
FD: net/minecraft/client/Minecraft/field_147125_j cft/j
FD: net/minecraft/client/Minecraft/field_71452_i cft/k
FD: net/minecraft/client/Minecraft/field_71466_p cft/l
FD: net/minecraft/client/Minecraft/field_71462_r cft/m
FD: net/minecraft/client/Minecraft/field_71460_t cft/n
FD: net/minecraft/client/Minecraft/field_184132_p cft/o
FD: net/minecraft/client/Minecraft/field_71429_W cft/p
FD: net/minecraft/client/Minecraft/field_71456_v cft/q
FD: net/minecraft/client/Minecraft/field_71454_w cft/r
FD: net/minecraft/client/Minecraft/field_71476_x cft/s
FD: net/minecraft/client/Minecraft/field_71474_y cft/t
FD: net/minecraft/client/Minecraft/field_71417_B cft/u
FD: net/minecraft/client/Minecraft/field_195559_v cft/v
FD: net/minecraft/client/Minecraft/field_71412_D cft/w
FD: net/minecraft/client/Minecraft/field_181542_y cft/x
FD: net/minecraft/client/Minecraft/field_71424_I cft/y
FD: net/minecraft/client/Minecraft/field_71426_K cft/z
FD: net/minecraft/client/Minecraft/field_147128_au cft/aA
FD: net/minecraft/client/Minecraft/field_147127_av cft/aB
FD: net/minecraft/client/Minecraft/field_147126_aw cft/aC
FD: net/minecraft/client/Minecraft/field_211501_aD cft/aD
FD: net/minecraft/client/Minecraft/field_152355_az cft/aE
FD: net/minecraft/client/Minecraft/field_152350_aA cft/aF
FD: net/minecraft/client/Minecraft/field_152351_aB cft/aG
FD: net/minecraft/client/Minecraft/field_152352_aC cft/aH
FD: net/minecraft/client/Minecraft/field_175617_aL cft/aI
FD: net/minecraft/client/Minecraft/field_175618_aM cft/aJ
FD: net/minecraft/client/Minecraft/field_193034_aS cft/aK
FD: net/minecraft/client/Minecraft/field_71425_J cft/aL
FD: net/minecraft/client/Minecraft/field_71419_L cft/aM
FD: net/minecraft/client/Minecraft/field_71420_M cft/aN
FD: net/minecraft/client/Minecraft/field_193035_aW cft/aO
FD: net/minecraft/client/Minecraft/field_71465_an cft/aP
FD: net/minecraft/client/Minecraft/field_71445_n cft/aa
FD: net/minecraft/client/Minecraft/field_193996_ah cft/ab
FD: net/minecraft/client/Minecraft/field_71437_Z cft/ac
FD: net/minecraft/client/Minecraft/field_191950_u cft/ad
FD: net/minecraft/client/Minecraft/field_110446_Y cft/ae
FD: net/minecraft/client/Minecraft/field_110447_Z cft/af
FD: net/minecraft/client/Minecraft/field_184130_ao cft/ag
FD: net/minecraft/client/Minecraft/field_110453_aa cft/ah
FD: net/minecraft/client/Minecraft/field_71469_aa cft/ai
FD: net/minecraft/client/Minecraft/field_71470_ab cft/aj
FD: net/minecraft/client/Minecraft/field_71467_ac cft/ak
FD: net/minecraft/client/Minecraft/field_71475_ae cft/al
FD: net/minecraft/client/Minecraft/field_71477_af cft/am
FD: net/minecraft/client/Minecraft/field_71457_ai cft/an
FD: net/minecraft/client/Minecraft/field_181543_z cft/ao
FD: net/minecraft/client/Minecraft/field_147129_ai cft/ap
FD: net/minecraft/client/Minecraft/field_71459_aj cft/aq
FD: net/minecraft/client/Minecraft/field_71453_ak cft/ar
FD: net/minecraft/client/Minecraft/field_71455_al cft/as
FD: net/minecraft/client/Minecraft/field_110451_am cft/at
FD: net/minecraft/client/Minecraft/field_195554_ax cft/au
FD: net/minecraft/client/Minecraft/field_110448_aq cft/av
FD: net/minecraft/client/Minecraft/field_135017_as cft/aw
FD: net/minecraft/client/Minecraft/field_184127_aH cft/ax
FD: net/minecraft/client/Minecraft/field_184128_aI cft/ay
FD: net/minecraft/client/Minecraft/field_147124_at cft/az
FD: net/minecraft/client/multiplayer/ServerData$ServerResourceMode/ENABLED crj$a/a
FD: net/minecraft/client/multiplayer/ServerData$ServerResourceMode/DISABLED crj$a/b
FD: net/minecraft/client/multiplayer/ServerData$ServerResourceMode/PROMPT crj$a/c
FD: net/minecraft/client/multiplayer/ServerData$ServerResourceMode/field_152594_d crj$a/d
FD: net/minecraft/client/multiplayer/ServerData$ServerResourceMode/$VALUES crj$a/e
FD: net/minecraft/client/multiplayer/ServerData/field_78847_a crj/a
FD: net/minecraft/client/multiplayer/ServerData/field_78845_b crj/b
FD: net/minecraft/client/multiplayer/ServerData/field_78846_c crj/c
FD: net/minecraft/client/multiplayer/ServerData/field_78843_d crj/d
FD: net/minecraft/client/multiplayer/ServerData/field_78844_e crj/e
FD: net/minecraft/client/multiplayer/ServerData/field_82821_f crj/f
FD: net/minecraft/client/multiplayer/ServerData/field_82822_g crj/g
FD: net/minecraft/client/multiplayer/ServerData/field_78841_f crj/h
FD: net/minecraft/client/multiplayer/ServerData/field_147412_i crj/i
FD: net/minecraft/client/multiplayer/ServerData/field_152587_j crj/j
FD: net/minecraft/client/multiplayer/ServerData/field_147411_m crj/k
FD: net/minecraft/client/multiplayer/ServerData/field_181042_l crj/l
FD: net/minecraft/client/renderer/ThreadDownloadImageData$1/field_110932_a ddc$1/a
FD: net/minecraft/client/renderer/ThreadDownloadImageData/field_147644_c ddc/g
FD: net/minecraft/client/renderer/ThreadDownloadImageData/field_147643_d ddc/h
FD: net/minecraft/client/renderer/ThreadDownloadImageData/field_152434_e ddc/i
FD: net/minecraft/client/renderer/ThreadDownloadImageData/field_110562_b ddc/j
FD: net/minecraft/client/renderer/ThreadDownloadImageData/field_110563_c ddc/k
FD: net/minecraft/client/renderer/ThreadDownloadImageData/field_110561_e ddc/l
FD: net/minecraft/client/renderer/ThreadDownloadImageData/field_110559_g ddc/m
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/RGBA ddg$a/a
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/RGB ddg$a/b
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/LUMINANCE_ALPHA ddg$a/c
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/LUMINANCE ddg$a/d
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211659_e ddg$a/e
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211660_f ddg$a/f
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211661_g ddg$a/g
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211662_h ddg$a/h
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211663_i ddg$a/i
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211664_j ddg$a/j
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211665_k ddg$a/k
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211666_l ddg$a/l
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211667_m ddg$a/m
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211668_n ddg$a/n
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211669_o ddg$a/o
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211670_p ddg$a/p
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211671_q ddg$a/q
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/$VALUES ddg$a/r
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode/RGBA ddg$b/a
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode/RGB ddg$b/b
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode/LUMINANCE_ALPHA ddg$b/c
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode/LUMINANCE ddg$b/d
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode/INTENSITY ddg$b/e
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode/field_211673_f ddg$b/f
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode/$VALUES ddg$b/g
FD: net/minecraft/client/renderer/texture/NativeImage$WriteCallback/field_209268_a ddg$c/a
FD: net/minecraft/client/renderer/texture/NativeImage$WriteCallback/field_209269_b ddg$c/b
FD: net/minecraft/client/renderer/texture/NativeImage/field_209272_a ddg/a
FD: net/minecraft/client/renderer/texture/NativeImage/field_211680_b ddg/b
FD: net/minecraft/client/renderer/texture/NativeImage/field_195719_a ddg/c
FD: net/minecraft/client/renderer/texture/NativeImage/field_195720_b ddg/d
FD: net/minecraft/client/renderer/texture/NativeImage/field_195721_c ddg/e
FD: net/minecraft/client/renderer/texture/NativeImage/field_195722_d ddg/f
FD: net/minecraft/client/renderer/texture/NativeImage/field_195723_e ddg/g
FD: net/minecraft/client/renderer/texture/SimpleTexture/field_110568_b ddi/f
FD: net/minecraft/client/renderer/texture/SimpleTexture/field_147639_c ddi/g
FD: net/minecraft/client/renderer/texture/TextureManager/field_194008_a ddn/a
FD: net/minecraft/client/renderer/texture/TextureManager/field_147646_a ddn/b
FD: net/minecraft/client/renderer/texture/TextureManager/field_110585_a ddn/c
FD: net/minecraft/client/renderer/texture/TextureManager/field_110583_b ddn/d
FD: net/minecraft/client/renderer/texture/TextureManager/field_110584_c ddn/e
FD: net/minecraft/client/renderer/texture/TextureManager/field_110582_d ddn/f
FD: net/minecraft/client/resources/DefaultPlayerSkin/field_177337_a dec/a
FD: net/minecraft/client/resources/DefaultPlayerSkin/field_177336_b dec/b
FD: net/minecraft/client/resources/SkinManager$1/field_152787_a deh$1/a
FD: net/minecraft/client/resources/SkinManager$2/field_152635_a deh$2/a
FD: net/minecraft/client/resources/SkinManager$2/field_152636_b deh$2/b
FD: net/minecraft/client/resources/SkinManager$2/field_152637_c deh$2/c
FD: net/minecraft/client/resources/SkinManager$2/field_152638_d deh$2/d
FD: net/minecraft/client/resources/SkinManager$2/field_177249_e deh$2/e
FD: net/minecraft/client/resources/SkinManager$2/field_152639_e deh$2/f
FD: net/minecraft/client/resources/SkinManager/field_152794_b deh/a
FD: net/minecraft/client/resources/SkinManager/field_152795_c deh/b
FD: net/minecraft/client/resources/SkinManager/field_152796_d deh/c
FD: net/minecraft/client/resources/SkinManager/field_152797_e deh/d
FD: net/minecraft/client/resources/SkinManager/field_152798_f deh/e
MD: net/minecraft/util/ResourceLocation$Serializer/deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lnet/minecraft/util/ResourceLocation; pc$a/a (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lpc;
MD: net/minecraft/util/ResourceLocation$Serializer/serialize (Lnet/minecraft/util/ResourceLocation;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement; pc$a/a (Lpc;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
MD: net/minecraft/util/ResourceLocation$Serializer/serialize (Ljava/lang/Object;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement; pc$a/serialize (Ljava/lang/Object;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
MD: net/minecraft/util/ResourceLocation$Serializer/deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object; pc$a/deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
MD: net/minecraft/util/ResourceLocation/func_110623_a ()Ljava/lang/String; pc/a ()Ljava/lang/String;
MD: net/minecraft/util/ResourceLocation/func_195824_a (C)Z pc/a (C)Z
MD: net/minecraft/util/ResourceLocation/func_195827_a (I)Z pc/a (I)Z
MD: net/minecraft/util/ResourceLocation/func_195826_a (Lcom/mojang/brigadier/StringReader;)Lnet/minecraft/util/ResourceLocation; pc/a (Lcom/mojang/brigadier/StringReader;)Lpc;
MD: net/minecraft/util/ResourceLocation/func_208304_a (Ljava/lang/String;)Lnet/minecraft/util/ResourceLocation; pc/a (Ljava/lang/String;)Lpc;
MD: net/minecraft/util/ResourceLocation/func_195828_a (Ljava/lang/String;C)Lnet/minecraft/util/ResourceLocation; pc/a (Ljava/lang/String;C)Lpc;
MD: net/minecraft/util/ResourceLocation/compareTo (Lnet/minecraft/util/ResourceLocation;)I pc/a (Lpc;)I
MD: net/minecraft/util/ResourceLocation/func_110624_b ()Ljava/lang/String; pc/b ()Ljava/lang/String;
MD: net/minecraft/util/ResourceLocation/func_195825_b (I)Z pc/b (I)Z
MD: net/minecraft/util/ResourceLocation/func_195823_b (Ljava/lang/String;C)[Ljava/lang/String; pc/b (Ljava/lang/String;C)[Ljava/lang/String;
MD: net/minecraft/util/ResourceLocation/equals (Ljava/lang/Object;)Z pc/equals (Ljava/lang/Object;)Z
MD: net/minecraft/util/ResourceLocation/hashCode ()I pc/hashCode ()I
MD: net/minecraft/util/ResourceLocation/toString ()Ljava/lang/String; pc/toString ()Ljava/lang/String;
MD: net/minecraft/util/ResourceLocation/compareTo (Ljava/lang/Object;)I pc/compareTo (Ljava/lang/Object;)I
MD: net/minecraft/util/StringUtils/func_76337_a (I)Ljava/lang/String; xw/a (I)Ljava/lang/String;
MD: net/minecraft/util/StringUtils/func_76338_a (Ljava/lang/String;)Ljava/lang/String; xw/a (Ljava/lang/String;)Ljava/lang/String;
MD: net/minecraft/util/StringUtils/func_151246_b (Ljava/lang/String;)Z xw/b (Ljava/lang/String;)Z
MD: net/minecraft/client/Minecraft$1/run ()V cft$1/run ()V
MD: net/minecraft/client/Minecraft/func_71378_E ()Lnet/minecraft/profiler/Snooper; cft/A ()Ladu;
MD: net/minecraft/client/Minecraft/func_110432_I ()Lnet/minecraft/util/Session; cft/B ()Lcga;
MD: net/minecraft/client/Minecraft/func_181037_M ()Lcom/mojang/authlib/properties/PropertyMap; cft/C ()Lcom/mojang/authlib/properties/PropertyMap;
MD: net/minecraft/client/Minecraft/func_110437_J ()Ljava/net/Proxy; cft/D ()Ljava/net/Proxy;
MD: net/minecraft/client/Minecraft/func_110434_K ()Lnet/minecraft/client/renderer/texture/TextureManager; cft/E ()Lddn;
MD: net/minecraft/client/Minecraft/func_195551_G ()Lnet/minecraft/resources/IResourceManager; cft/F ()Lvf;
MD: net/minecraft/client/Minecraft/func_195548_H ()Lnet/minecraft/resources/ResourcePackList; cft/G ()Lux;
MD: net/minecraft/client/Minecraft/func_195541_I ()Lnet/minecraft/client/resources/DownloadingPackFinder; cft/H ()Ldea;
MD: net/minecraft/client/Minecraft/func_195549_J ()Ljava/io/File; cft/I ()Ljava/io/File;
MD: net/minecraft/client/Minecraft/func_135016_M ()Lnet/minecraft/client/resources/LanguageManager; cft/J ()Ldel;
MD: net/minecraft/client/Minecraft/func_147117_R ()Lnet/minecraft/client/renderer/texture/TextureMap; cft/K ()Lddl;
MD: net/minecraft/client/Minecraft/func_147111_S ()Z cft/L ()Z
MD: net/minecraft/client/Minecraft/func_147113_T ()Z cft/M ()Z
MD: net/minecraft/client/Minecraft/func_147118_V ()Lnet/minecraft/client/audio/SoundHandler; cft/N ()Ldgt;
MD: net/minecraft/client/Minecraft/func_147109_W ()Lnet/minecraft/client/audio/MusicTicker$MusicType; cft/O ()Ldgq$a;
MD: net/minecraft/client/Minecraft/func_70002_Q ()Z cft/P ()Z
MD: net/minecraft/client/Minecraft/func_152347_ac ()Lcom/mojang/authlib/minecraft/MinecraftSessionService; cft/Q ()Lcom/mojang/authlib/minecraft/MinecraftSessionService;
MD: net/minecraft/client/Minecraft/func_152342_ad ()Lnet/minecraft/client/resources/SkinManager; cft/R ()Ldeh;
MD: net/minecraft/client/Minecraft/func_175606_aa ()Lnet/minecraft/entity/Entity; cft/S ()Laer;
MD: net/minecraft/client/Minecraft/func_175602_ab ()Lnet/minecraft/client/renderer/BlockRendererDispatcher; cft/T ()Lcuu;
MD: net/minecraft/client/Minecraft/func_175598_ae ()Lnet/minecraft/client/renderer/entity/RenderManager; cft/U ()Lcyo;
MD: net/minecraft/client/Minecraft/func_175599_af ()Lnet/minecraft/client/renderer/ItemRenderer; cft/V ()Lczg;
MD: net/minecraft/client/Minecraft/func_175597_ag ()Lnet/minecraft/client/renderer/FirstPersonRenderer; cft/W ()Lcuc;
MD: net/minecraft/client/Minecraft/func_175610_ah ()I cft/X ()I
MD: net/minecraft/client/Minecraft/func_181539_aj ()Lnet/minecraft/util/FrameTimer; cft/Y ()Lxi;
MD: net/minecraft/client/Minecraft/func_181540_al ()Z cft/Z ()Z
MD: net/minecraft/client/Minecraft/func_99999_d ()V cft/a ()V
MD: net/minecraft/client/Minecraft/func_71383_b (I)V cft/a (I)V
MD: net/minecraft/client/Minecraft/func_181536_a (IIIIIIIIII)V cft/a (IIIIIIIIII)V
MD: net/minecraft/client/Minecraft/func_195545_a (IJ)V cft/a (IJ)V
MD: net/minecraft/client/Minecraft/func_70000_a (Lnet/minecraft/profiler/Snooper;)V cft/a (Ladu;)V
MD: net/minecraft/client/Minecraft/func_175607_a (Lnet/minecraft/entity/Entity;)V cft/a (Laer;)V
MD: net/minecraft/client/Minecraft/func_193985_a (Lnet/minecraft/item/ItemStack;)Ljava/lang/Iterable; cft/a (Late;)Ljava/lang/Iterable;
MD: net/minecraft/client/Minecraft/func_184119_a (Lnet/minecraft/item/ItemStack;Lnet/minecraft/tileentity/TileEntity;)Lnet/minecraft/item/ItemStack; cft/a (Late;Lbji;)Late;
MD: net/minecraft/client/Minecraft/func_200237_a (Lnet/minecraft/item/crafting/IRecipe;)Lnet/minecraft/util/ResourceLocation; cft/a (Lavk;)Lpc;
MD: net/minecraft/client/Minecraft/func_71404_a (Lnet/minecraft/crash/CrashReport;)V cft/a (Lb;)V
MD: net/minecraft/client/Minecraft/func_212315_a (Lnet/minecraft/world/dimension/DimensionType;)V cft/a (Lbod;)V
MD: net/minecraft/client/Minecraft/access$000 (Lnet/minecraft/client/Minecraft;)Z cft/a (Lcft;)Z
MD: net/minecraft/client/Minecraft/func_147108_a (Lnet/minecraft/client/gui/GuiScreen;)V cft/a (Lckd;)V
MD: net/minecraft/client/Minecraft/func_193992_a (Lnet/minecraft/client/gui/recipebook/RecipeList;)Ljava/lang/Iterable; cft/a (Lcmk;)Ljava/lang/Iterable;
MD: net/minecraft/client/Minecraft/func_71403_a (Lnet/minecraft/client/multiplayer/WorldClient;)V cft/a (Lcrg;)V
MD: net/minecraft/client/Minecraft/func_205055_a (Lnet/minecraft/client/multiplayer/WorldClient;Lnet/minecraft/client/gui/GuiScreen;)V cft/a (Lcrg;Lckd;)V
MD: net/minecraft/client/Minecraft/func_71351_a (Lnet/minecraft/client/multiplayer/ServerData;)V cft/a (Lcrj;)V
MD: net/minecraft/client/Minecraft/func_193987_a (Lnet/minecraft/client/util/SearchTreeManager$Key;)Lnet/minecraft/client/util/ISearchTree; cft/a (Ldgc$a;)Ldgd;
MD: net/minecraft/client/Minecraft/func_209507_a (Lnet/minecraft/util/text/ITextComponent;)V cft/a (Lij;)V
MD: net/minecraft/client/Minecraft/func_211108_a (Ljava/lang/Integer;Ljava/lang/String;)V cft/a (Ljava/lang/Integer;Ljava/lang/String;)V
MD: net/minecraft/client/Minecraft/func_152344_a (Ljava/lang/Runnable;)Lcom/google/common/util/concurrent/ListenableFuture; cft/a (Ljava/lang/Runnable;)Lcom/google/common/util/concurrent/ListenableFuture;
MD: net/minecraft/client/Minecraft/func_200234_a (Ljava/lang/String;)Z cft/a (Ljava/lang/String;)Z
MD: net/minecraft/client/Minecraft/func_71371_a (Ljava/lang/String;Ljava/lang/String;Lnet/minecraft/world/WorldSettings;)V cft/a (Ljava/lang/String;Ljava/lang/String;Layd;)V
MD: net/minecraft/client/Minecraft/func_211818_a (Ljava/lang/String;ZLjava/util/function/Supplier;Lnet/minecraft/resources/IResourcePack;Lnet/minecraft/resources/data/PackMetadataSection;Lnet/minecraft/resources/ResourcePackInfo$Priority;)Lnet/minecraft/client/resources/ResourcePackInfoClient; cft/a (Ljava/lang/String;ZLjava/util/function/Supplier;Lul;Luq;Lva$a;)Ldei;
MD: net/minecraft/client/Minecraft/func_211100_a (Ljava/util/List;IJ)V cft/a (Ljava/util/List;IJ)V
MD: net/minecraft/client/Minecraft/func_152343_a (Ljava/util/concurrent/Callable;)Lcom/google/common/util/concurrent/ListenableFuture; cft/a (Ljava/util/concurrent/Callable;)Lcom/google/common/util/concurrent/ListenableFuture;
MD: net/minecraft/client/Minecraft/func_211809_a (Ljava/util/function/Supplier;)Lnet/minecraft/resources/IResourcePack; cft/a (Ljava/util/function/Supplier;)Lul;
MD: net/minecraft/client/Minecraft/func_181537_a (Z)V cft/a (Z)V
MD: net/minecraft/client/Minecraft/func_147110_a ()Lnet/minecraft/client/shader/Framebuffer; cft/b ()Lcul;
MD: net/minecraft/client/Minecraft/func_193988_b (Lnet/minecraft/item/ItemStack;)Ljava/lang/Iterable; cft/b (Late;)Ljava/lang/Iterable;
MD: net/minecraft/client/Minecraft/func_200240_b (Lnet/minecraft/item/crafting/IRecipe;)Ljava/util/stream/Stream; cft/b (Lavk;)Ljava/util/stream/Stream;
MD: net/minecraft/client/Minecraft/func_71396_d (Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReport; cft/b (Lb;)Lb;
MD: net/minecraft/client/Minecraft/func_193990_a (Lnet/minecraft/client/gui/recipebook/RecipeList;)Ljava/lang/Iterable; cft/b (Lcmk;)Ljava/lang/Iterable;
MD: net/minecraft/client/Minecraft/func_200235_b (Lnet/minecraft/util/text/ITextComponent;)Ljava/lang/String; cft/b (Lij;)Ljava/lang/String;
MD: net/minecraft/client/Minecraft/func_200241_b (Ljava/lang/String;)Z cft/b (Ljava/lang/String;)Z
MD: net/minecraft/client/Minecraft/func_175600_c ()Ljava/lang/String; cft/c ()Ljava/lang/String;
MD: net/minecraft/client/Minecraft/func_71377_b (Lnet/minecraft/crash/CrashReport;)V cft/c (Lb;)V
MD: net/minecraft/client/Minecraft/func_211817_c (Lnet/minecraft/util/text/ITextComponent;)Ljava/lang/String; cft/c (Lij;)Ljava/lang/String;
MD: net/minecraft/client/Minecraft/func_195542_b (Z)V cft/c (Z)V
MD: net/minecraft/client/Minecraft/func_184123_d ()Ljava/lang/String; cft/d ()Ljava/lang/String;
MD: net/minecraft/client/Minecraft/func_147115_a (Z)V cft/d (Z)V
MD: net/minecraft/client/Minecraft/func_211821_e ()Z cft/e ()Z
MD: net/minecraft/client/Minecraft/func_110436_a ()V cft/f ()V
MD: net/minecraft/client/Minecraft/func_71359_d ()Lnet/minecraft/world/storage/ISaveFormat; cft/g ()Lcce;
MD: net/minecraft/client/Minecraft/func_71405_e ()V cft/h ()V
MD: net/minecraft/client/Minecraft/func_71398_f ()V cft/i ()V
MD: net/minecraft/client/Minecraft/func_71400_g ()V cft/j ()V
MD: net/minecraft/client/Minecraft/func_71385_j ()V cft/k ()V
MD: net/minecraft/client/Minecraft/func_181535_r ()Lnet/minecraft/client/audio/MusicTicker; cft/l ()Ldgq;
MD: net/minecraft/client/Minecraft/func_71407_l ()V cft/m ()V
MD: net/minecraft/client/Minecraft/func_71355_q ()Z cft/n ()Z
MD: net/minecraft/client/Minecraft/func_147114_u ()Lnet/minecraft/client/network/NetHandlerPlayClient; cft/o ()Lcrd;
MD: net/minecraft/client/Minecraft/func_71382_s ()Z cft/p ()Z
MD: net/minecraft/client/Minecraft/func_71375_t ()Z cft/q ()Z
MD: net/minecraft/client/Minecraft/func_71379_u ()Z cft/r ()Z
MD: net/minecraft/client/Minecraft/func_71410_x ()Lnet/minecraft/client/Minecraft; cft/s ()Lcft;
MD: net/minecraft/client/Minecraft/func_175603_A ()Lcom/google/common/util/concurrent/ListenableFuture; cft/t ()Lcom/google/common/util/concurrent/ListenableFuture;
MD: net/minecraft/client/Minecraft/func_71369_N ()I cft/u ()I
MD: net/minecraft/client/Minecraft/func_147104_D ()Lnet/minecraft/client/multiplayer/ServerData; cft/v ()Lcrj;
MD: net/minecraft/client/Minecraft/func_71387_A ()Z cft/w ()Z
MD: net/minecraft/client/Minecraft/func_71356_B ()Z cft/x ()Z
MD: net/minecraft/client/Minecraft/func_71401_C ()Lnet/minecraft/server/integrated/IntegratedServer; cft/y ()Ldgh;
MD: net/minecraft/client/Minecraft/func_71363_D ()V cft/z ()V
MD: net/minecraft/client/Minecraft/func_211816_aA ()Ljava/lang/String; cft/aA ()Ljava/lang/String;
MD: net/minecraft/client/Minecraft/func_211112_aw ()Ljava/lang/String; cft/aB ()Ljava/lang/String;
MD: net/minecraft/client/Minecraft/func_211115_ay ()Ljava/lang/String; cft/aC ()Ljava/lang/String;
MD: net/minecraft/client/Minecraft/func_211117_az ()Ljava/lang/String; cft/aD ()Ljava/lang/String;
MD: net/minecraft/client/Minecraft/func_210110_az ()Ljava/lang/String; cft/aE ()Ljava/lang/String;
MD: net/minecraft/client/Minecraft/func_210108_aA ()Ljava/lang/String; cft/aF ()Ljava/lang/String;
MD: net/minecraft/client/Minecraft/func_212317_aG ()Z cft/aG ()Z
MD: net/minecraft/client/Minecraft/func_212316_aH ()V cft/aH ()V
MD: net/minecraft/client/Minecraft/func_211813_aH ()J cft/aI ()J
MD: net/minecraft/client/Minecraft/func_184126_aj ()Lcom/mojang/datafixers/DataFixer; cft/aa ()Lcom/mojang/datafixers/DataFixer;
MD: net/minecraft/client/Minecraft/func_184121_ak ()F cft/ab ()F
MD: net/minecraft/client/Minecraft/func_193989_ak ()F cft/ac ()F
MD: net/minecraft/client/Minecraft/func_184125_al ()Lnet/minecraft/client/renderer/color/BlockColors; cft/ad ()Lcgf;
MD: net/minecraft/client/Minecraft/func_189648_am ()Z cft/af ()Z
MD: net/minecraft/client/Minecraft/func_193033_an ()Lnet/minecraft/client/gui/toasts/GuiToast; cft/ag ()Lcib;
MD: net/minecraft/client/Minecraft/func_193032_ao ()Lnet/minecraft/client/tutorial/Tutorial; cft/ah ()Ldhe;
MD: net/minecraft/client/Minecraft/func_195544_aj ()Z cft/ai ()Z
MD: net/minecraft/client/Minecraft/func_199403_al ()Lnet/minecraft/client/settings/CreativeSettings; cft/aj ()Lcfn;
MD: net/minecraft/client/Minecraft/func_209506_al ()Lnet/minecraft/client/renderer/model/ModelManager; cft/ak ()Ldfd;
MD: net/minecraft/client/Minecraft/func_211500_ak ()Lnet/minecraft/client/gui/fonts/FontResourceManager; cft/al ()Lcif;
MD: net/minecraft/client/Minecraft/func_71384_a ()V cft/am ()V
MD: net/minecraft/client/Minecraft/func_211118_al ()V cft/an ()V
MD: net/minecraft/client/Minecraft/func_193986_ar ()V cft/ao ()V
MD: net/minecraft/client/Minecraft/func_147122_X ()Z cft/ap ()Z
MD: net/minecraft/client/Minecraft/func_71389_H ()V cft/aq ()V
MD: net/minecraft/client/Minecraft/func_195547_ap ()V cft/ar ()V
MD: net/minecraft/client/Minecraft/func_203410_as ()V cft/as ()V
MD: net/minecraft/client/Minecraft/func_147116_af ()V cft/at ()V
MD: net/minecraft/client/Minecraft/func_147121_ag ()V cft/au ()V
MD: net/minecraft/client/Minecraft/func_152345_ab ()Z cft/av ()Z
MD: net/minecraft/client/Minecraft/func_184117_aA ()V cft/aw ()V
MD: net/minecraft/client/Minecraft/func_147112_ai ()V cft/ax ()V
MD: net/minecraft/client/Minecraft/func_181538_aA ()Ljava/lang/String; cft/ay ()Ljava/lang/String;
MD: net/minecraft/client/Minecraft/func_211822_az ()Ljava/lang/String; cft/az ()Ljava/lang/String;
MD: net/minecraft/client/Minecraft/getFocused ()Lnet/minecraft/client/gui/IGuiEventListener; cft/getFocused ()Lchr;
MD: net/minecraft/client/multiplayer/ServerData$ServerResourceMode/func_152589_a ()Lnet/minecraft/util/text/ITextComponent; crj$a/a ()Lij;
MD: net/minecraft/client/multiplayer/ServerData$ServerResourceMode/values ()[Lnet/minecraft/client/multiplayer/ServerData$ServerResourceMode; crj$a/values ()[Lcrj$a;
MD: net/minecraft/client/multiplayer/ServerData$ServerResourceMode/valueOf (Ljava/lang/String;)Lnet/minecraft/client/multiplayer/ServerData$ServerResourceMode; crj$a/valueOf (Ljava/lang/String;)Lcrj$a;
MD: net/minecraft/client/multiplayer/ServerData/func_78836_a ()Lnet/minecraft/nbt/NBTTagCompound; crj/a ()Lgy;
MD: net/minecraft/client/multiplayer/ServerData/func_152584_a (Lnet/minecraft/client/multiplayer/ServerData$ServerResourceMode;)V crj/a (Lcrj$a;)V
MD: net/minecraft/client/multiplayer/ServerData/func_152583_a (Lnet/minecraft/client/multiplayer/ServerData;)V crj/a (Lcrj;)V
MD: net/minecraft/client/multiplayer/ServerData/func_78837_a (Lnet/minecraft/nbt/NBTTagCompound;)Lnet/minecraft/client/multiplayer/ServerData; crj/a (Lgy;)Lcrj;
MD: net/minecraft/client/multiplayer/ServerData/func_147407_a (Ljava/lang/String;)V crj/a (Ljava/lang/String;)V
MD: net/minecraft/client/multiplayer/ServerData/func_152586_b ()Lnet/minecraft/client/multiplayer/ServerData$ServerResourceMode; crj/b ()Lcrj$a;
MD: net/minecraft/client/multiplayer/ServerData/func_147409_e ()Ljava/lang/String; crj/c ()Ljava/lang/String;
MD: net/minecraft/client/multiplayer/ServerData/func_181041_d ()Z crj/d ()Z
MD: net/minecraft/client/renderer/IImageBuffer/func_152634_a ()V cub/a ()V
MD: net/minecraft/client/renderer/IImageBuffer/func_195786_a (Lnet/minecraft/client/renderer/texture/NativeImage;)Lnet/minecraft/client/renderer/texture/NativeImage; cub/a (Lddg;)Lddg;
MD: net/minecraft/client/renderer/ImageBufferDownload/func_152634_a ()V cug/a ()V
MD: net/minecraft/client/renderer/ImageBufferDownload/func_195786_a (Lnet/minecraft/client/renderer/texture/NativeImage;)Lnet/minecraft/client/renderer/texture/NativeImage; cug/a (Lddg;)Lddg;
MD: net/minecraft/client/renderer/ImageBufferDownload/func_195788_a (Lnet/minecraft/client/renderer/texture/NativeImage;IIII)V cug/a (Lddg;IIII)V
MD: net/minecraft/client/renderer/ImageBufferDownload/func_195787_b (Lnet/minecraft/client/renderer/texture/NativeImage;IIII)V cug/b (Lddg;IIII)V
MD: net/minecraft/client/renderer/ThreadDownloadImageData$1/func_195658_a (Lnet/minecraft/client/renderer/texture/NativeImage;)V ddc$1/a (Lddg;)V
MD: net/minecraft/client/renderer/ThreadDownloadImageData$1/func_195657_a (Ljava/io/InputStream;)V ddc$1/a (Ljava/io/InputStream;)V
MD: net/minecraft/client/renderer/ThreadDownloadImageData$1/run ()V ddc$1/run ()V
MD: net/minecraft/client/renderer/ThreadDownloadImageData/func_152433_a ()V ddc/a ()V
MD: net/minecraft/client/renderer/ThreadDownloadImageData/access$000 (Lnet/minecraft/client/renderer/ThreadDownloadImageData;)Ljava/lang/String; ddc/a (Lddc;)Ljava/lang/String;
MD: net/minecraft/client/renderer/ThreadDownloadImageData/func_195417_a (Lnet/minecraft/client/renderer/texture/NativeImage;)V ddc/a (Lddg;)V
MD: net/minecraft/client/renderer/ThreadDownloadImageData/func_195413_a (Lnet/minecraft/resources/IResourceManager;)V ddc/a (Lvf;)V
MD: net/minecraft/client/renderer/ThreadDownloadImageData/access$100 (Lnet/minecraft/client/renderer/ThreadDownloadImageData;)Ljava/io/File; ddc/b (Lddc;)Ljava/io/File;
MD: net/minecraft/client/renderer/ThreadDownloadImageData/func_195416_b (Lnet/minecraft/client/renderer/texture/NativeImage;)V ddc/b (Lddg;)V
MD: net/minecraft/client/renderer/ThreadDownloadImageData/access$300 (Lnet/minecraft/client/renderer/ThreadDownloadImageData;)Lnet/minecraft/client/renderer/IImageBuffer; ddc/c (Lddc;)Lcub;
MD: net/minecraft/client/renderer/ThreadDownloadImageData/access$200 ()Lorg/apache/logging/log4j/Logger; ddc/e ()Lorg/apache/logging/log4j/Logger;
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211651_a ()I ddg$a/a ()I
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211652_a (I)Lnet/minecraft/client/renderer/texture/NativeImage$PixelFormat; ddg$a/a (I)Lddg$a;
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211655_a (Lnet/minecraft/client/renderer/texture/NativeImage$PixelFormat;)I ddg$a/a (Lddg$a;)I
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211656_b ()V ddg$a/b ()V
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211646_b (I)Lnet/minecraft/client/renderer/texture/NativeImage$PixelFormat; ddg$a/b (I)Lddg$a;
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211658_c ()V ddg$a/c ()V
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211650_d ()I ddg$a/d ()I
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211645_i ()Z ddg$a/i ()Z
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211648_n ()I ddg$a/n ()I
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211653_r ()Z ddg$a/r ()Z
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211647_v ()I ddg$a/v ()I
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211654_w ()Z ddg$a/w ()Z
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/values ()[Lnet/minecraft/client/renderer/texture/NativeImage$PixelFormat; ddg$a/values ()[Lddg$a;
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/valueOf (Ljava/lang/String;)Lnet/minecraft/client/renderer/texture/NativeImage$PixelFormat; ddg$a/valueOf (Ljava/lang/String;)Lddg$a;
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode/func_211672_a ()I ddg$b/a ()I
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode/values ()[Lnet/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode; ddg$b/values ()[Lddg$b;
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode/valueOf (Ljava/lang/String;)Lnet/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode; ddg$b/valueOf (Ljava/lang/String;)Lddg$b;
MD: net/minecraft/client/renderer/texture/NativeImage$WriteCallback/func_209267_a ()V ddg$c/a ()V
MD: net/minecraft/client/renderer/texture/NativeImage$WriteCallback/invoke (JJI)V ddg$c/invoke (JJI)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195702_a ()I ddg/a ()I
MD: net/minecraft/client/renderer/texture/NativeImage/func_195709_a (II)I ddg/a (II)I
MD: net/minecraft/client/renderer/texture/NativeImage/func_195700_a (III)V ddg/a (III)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195715_a (IIIII)V ddg/a (IIIII)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195706_a (IIIIIIIZ)V ddg/a (IIIIIIIZ)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195712_a (IIIIIIIZZZ)V ddg/a (IIIIIIIZZZ)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195699_a (IIIIIIZZ)V ddg/a (IIIIIIZZ)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195708_a (IIIILnet/minecraft/client/renderer/texture/NativeImage;)V ddg/a (IIIILddg;)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195697_a (IIIZ)V ddg/a (IIIZ)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195717_a (IZ)V ddg/a (IZ)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_211679_a (Lnet/minecraft/client/renderer/texture/NativeImage$PixelFormat;Ljava/io/InputStream;)Lnet/minecraft/client/renderer/texture/NativeImage; ddg/a (Lddg$a;Ljava/io/InputStream;)Lddg;
MD: net/minecraft/client/renderer/texture/NativeImage/func_211677_a (Lnet/minecraft/client/renderer/texture/NativeImage$PixelFormat;Ljava/nio/ByteBuffer;)Lnet/minecraft/client/renderer/texture/NativeImage; ddg/a (Lddg$a;Ljava/nio/ByteBuffer;)Lddg;
MD: net/minecraft/client/renderer/texture/NativeImage/func_195703_a (Lnet/minecraft/client/renderer/texture/NativeImage;)V ddg/a (Lddg;)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_209271_a (Ljava/io/File;)V ddg/a (Ljava/io/File;)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195713_a (Ljava/io/InputStream;)Lnet/minecraft/client/renderer/texture/NativeImage; ddg/a (Ljava/io/InputStream;)Lddg;
MD: net/minecraft/client/renderer/texture/NativeImage/func_195704_a (Ljava/nio/ByteBuffer;)Lnet/minecraft/client/renderer/texture/NativeImage; ddg/a (Ljava/nio/ByteBuffer;)Lddg;
MD: net/minecraft/client/renderer/texture/NativeImage/func_209270_a (Ljava/nio/file/Path;)V ddg/a (Ljava/nio/file/Path;)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_211676_a (Lorg/lwjgl/stb/STBTTFontinfo;IIIFFFFII)V ddg/a (Lorg/lwjgl/stb/STBTTFontinfo;IIIFFFFII)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195701_a (Z)V ddg/a (Z)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195705_a (ZZ)V ddg/a (ZZ)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195714_b ()I ddg/b ()I
MD: net/minecraft/client/renderer/texture/NativeImage/func_195718_b (III)V ddg/b (III)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195707_b (Z)V ddg/b (Z)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_211678_c ()Lnet/minecraft/client/renderer/texture/NativeImage$PixelFormat; ddg/c ()Lddg$a;
MD: net/minecraft/client/renderer/texture/NativeImage/func_195716_c ()[I ddg/d ()[I
MD: net/minecraft/client/renderer/texture/NativeImage/func_211675_e (II)B ddg/e (II)B
MD: net/minecraft/client/renderer/texture/NativeImage/func_195710_e ()V ddg/f ()V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195711_f ()V ddg/g ()V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195696_g ()V ddg/h ()V
MD: net/minecraft/client/renderer/texture/NativeImage/close ()V ddg/close ()V
MD: net/minecraft/client/renderer/texture/NativeImage/toString ()Ljava/lang/String; ddg/toString ()Ljava/lang/String;
MD: net/minecraft/client/renderer/texture/SimpleTexture/func_195413_a (Lnet/minecraft/resources/IResourceManager;)V ddi/a (Lvf;)V
MD: net/minecraft/client/renderer/texture/TextureManager/func_210123_a (Lnet/minecraft/client/renderer/texture/ITextureObject;)Ljava/lang/String; ddn/a (Lddo;)Ljava/lang/String;
MD: net/minecraft/client/renderer/texture/TextureManager/func_110578_a (Ljava/lang/String;Lnet/minecraft/client/renderer/texture/DynamicTexture;)Lnet/minecraft/util/ResourceLocation; ddn/a (Ljava/lang/String;Lddb;)Lpc;
MD: net/minecraft/client/renderer/texture/TextureManager/func_110577_a (Lnet/minecraft/util/ResourceLocation;)V ddn/a (Lpc;)V
MD: net/minecraft/client/renderer/texture/TextureManager/func_110579_a (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/ITextureObject;)Z ddn/a (Lpc;Lddo;)Z
MD: net/minecraft/client/renderer/texture/TextureManager/func_110580_a (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/ITickableTextureObject;)Z ddn/a (Lpc;Lddr;)Z
MD: net/minecraft/client/renderer/texture/TextureManager/func_195410_a (Lnet/minecraft/resources/IResourceManager;)V ddn/a (Lvf;)V
MD: net/minecraft/client/renderer/texture/TextureManager/func_110581_b (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/renderer/texture/ITextureObject; ddn/b (Lpc;)Lddo;
MD: net/minecraft/client/renderer/texture/TextureManager/func_147645_c (Lnet/minecraft/util/ResourceLocation;)V ddn/c (Lpc;)V
MD: net/minecraft/client/renderer/texture/TextureManager/func_110550_d ()V ddn/e ()V
MD: net/minecraft/client/renderer/texture/ITextureObject/func_195413_a (Lnet/minecraft/resources/IResourceManager;)V ddo/a (Lvf;)V
MD: net/minecraft/client/renderer/texture/ITextureObject/func_174935_a ()V ddo/b ()V
MD: net/minecraft/client/renderer/texture/ITextureObject/func_174936_b (ZZ)V ddo/b (ZZ)V
MD: net/minecraft/client/renderer/texture/ITextureObject/func_110552_b ()I ddo/c ()I
MD: net/minecraft/client/renderer/texture/ITextureObject/func_195412_h ()V ddo/h ()V
MD: net/minecraft/client/resources/DefaultPlayerSkin/func_177335_a ()Lnet/minecraft/util/ResourceLocation; dec/a ()Lpc;
MD: net/minecraft/client/resources/DefaultPlayerSkin/func_177334_a (Ljava/util/UUID;)Lnet/minecraft/util/ResourceLocation; dec/a (Ljava/util/UUID;)Lpc;
MD: net/minecraft/client/resources/DefaultPlayerSkin/func_177332_b (Ljava/util/UUID;)Ljava/lang/String; dec/b (Ljava/util/UUID;)Ljava/lang/String;
MD: net/minecraft/client/resources/DefaultPlayerSkin/func_177333_c (Ljava/util/UUID;)Z dec/c (Ljava/util/UUID;)Z
MD: net/minecraft/client/resources/SkinManager$1/load (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map; deh$1/a (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map;
MD: net/minecraft/client/resources/SkinManager$1/load (Ljava/lang/Object;)Ljava/lang/Object; deh$1/load (Ljava/lang/Object;)Ljava/lang/Object;
MD: net/minecraft/client/resources/SkinManager$2/func_152634_a ()V deh$2/a ()V
MD: net/minecraft/client/resources/SkinManager$2/func_195786_a (Lnet/minecraft/client/renderer/texture/NativeImage;)Lnet/minecraft/client/renderer/texture/NativeImage; deh$2/a (Lddg;)Lddg;
MD: net/minecraft/client/resources/SkinManager$SkinAvailableCallback/func_180521_a (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/util/ResourceLocation;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;)V deh$a/onSkinTextureAvailable (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lpc;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;)V
MD: net/minecraft/client/resources/SkinManager/func_152788_a (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map; deh/a (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map;
MD: net/minecraft/client/resources/SkinManager/func_152790_a (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V deh/a (Lcom/mojang/authlib/GameProfile;Ldeh$a;Z)V
MD: net/minecraft/client/resources/SkinManager/func_210275_a (Lcom/mojang/authlib/GameProfile;ZLnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)V deh/a (Lcom/mojang/authlib/GameProfile;ZLdeh$a;)V
MD: net/minecraft/client/resources/SkinManager/func_152792_a (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;)Lnet/minecraft/util/ResourceLocation; deh/a (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;)Lpc;
MD: net/minecraft/client/resources/SkinManager/func_152789_a (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)Lnet/minecraft/util/ResourceLocation; deh/a (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Ldeh$a;)Lpc;
MD: net/minecraft/client/resources/SkinManager/func_210276_a (Ljava/util/Map;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)V deh/a (Ljava/util/Map;Ldeh$a;)V
+76 -10
View File
@@ -29,19 +29,28 @@ String getMcVersion(String filename) {
String getKey(String filename) { String getKey(String filename) {
String name = filename.substring(0, filename.lastIndexOf('.')) String name = filename.substring(0, filename.lastIndexOf('.'))
if (name.indexOf('-') == -1) return null
if (filename.endsWith(".json")) if (filename.endsWith(".json"))
return String.format( return String.format(
"versions/%s/%s", "versions/%s/%s",
name, name,
filename filename
) )
if (filename.endsWith(".jar")) if (filename.endsWith(".jar")) {
return String.format( if (filename.contains("Fabric") || filename.contains("Forge")) {
"libraries/customskinloader/%s/%s/%s", return String.format(
name.substring(0, name.indexOf('-')), "mods/%s",
name.substring(name.indexOf('-') + 1), filename
filename )
) } else {
return String.format(
"libraries/customskinloader/%s/%s/%s",
name.substring(0, name.indexOf('-')),
name.substring(name.indexOf('-') + 1),
filename
)
}
}
return filename return filename
} }
@@ -67,19 +76,76 @@ void downloadFile(String key, File file) {
getCosClient().getObject(getObjectRequest, file) getCosClient().getObject(getObjectRequest, file)
} }
String toJson(Map<String, Object> map, int d) {
StringBuilder sb = new StringBuilder("{\n")
Iterator<Map.Entry<String, Object>> it = map.entrySet().iterator()
while (it.hasNext()) {
Map.Entry<String, Object> e = it.next()
String k = e.key
String v = null
if (e.value instanceof String) {
v = "\"" + e.value + "\""
} else if (e.value instanceof Map) {
v = toJson((Map) e.value, d + 1)
}
for (int i = 0; i < d * 2; i++) {
sb.append(' ')
}
if (it.hasNext()) {
sb.append(String.format("\"%s\" : %s,\n", k, v))
} else {
sb.append(String.format("\"%s\" : %s\n", k, v))
}
}
for (int i = 0; i < (d - 1) * 2; i++) {
sb.append(' ')
}
sb.append("}")
return sb.toString()
}
String toJson(Map<String, Object> map) {
return toJson(map, 1)
}
void writeToFile(File f, String s) {
FileWriter fw = new FileWriter(f)
fw.write(s)
fw.flush()
fw.close()
}
void uploadArtifacts(String shortVersion) { void uploadArtifacts(String shortVersion) {
String cslversion = shortVersion.replace(".", "")
File dir = rootProject.file("build/libs") File dir = rootProject.file("build/libs")
if (!dir.isDirectory()) return if (!dir.isDirectory()) return
String cslversion = shortVersion.replace(".", "")
LinkedHashMap<String, Object> map = new LinkedHashMap<String, Object>()
LinkedHashMap<String, String> map2 = new LinkedHashMap<String, String>()
LinkedHashMap<String, String> map3 = new LinkedHashMap<String, String>()
map.put("version", shortVersion)
map.put("downloads", map2)
map.put("launchermeta", map3)
File[] files = dir.listFiles() File[] files = dir.listFiles()
for (file in files) { for (file in files) {
String key = getKey(file.getName()) String key = getKey(file.getName())
if (key == null) continue
uploadFile(key, file) uploadFile(key, file)
String url = cosUrl + key String url = cosUrl + key
String mcversion = getMcVersion(file.getName()).replace(".", "").toLowerCase() String mcversion = getMcVersion(file.getName())
println(String.format("csl-%s-%s\t%s", mcversion, cslversion, url)) println(String.format("csl-%s-%s\t%s", mcversion.replace(".", "").toLowerCase(), cslversion, url))
if (key.endsWith(".jar")) {
map2.put(mcversion, url)
} else if (key.endsWith(".json")) {
map3.put(mcversion, url)
}
} }
File latest = new File("build/libs/latest.json")
writeToFile(latest, toJson(map))
uploadFile("latest.json", latest)
} }
ext { ext {
+1
View File
@@ -13,6 +13,7 @@ buildscript {
} }
} }
dependencies { dependencies {
classpath 'net.md-5:SpecialSource:1.8.6'
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
} }
} }
+2 -1
View File
@@ -6,5 +6,6 @@
"mcFullVersions": "${mcFullVersions}", "mcFullVersions": "${mcFullVersions}",
"forgeVersion": "${forgeVersion}", "forgeVersion": "${forgeVersion}",
"gitVersion": "${gitVersion}", "gitVersion": "${gitVersion}",
"buildUrl": "${buildUrl}" "buildUrl": "${buildUrl}",
"buildTime": "${releaseTime}"
} }
-24
View File
@@ -1,24 +0,0 @@
{
"id": "${mcVersion}-CSL-${modShortFullVersion}",
"inheritsFrom": "${mcVersion}",
"jar": "${mcVersion}",
"releaseTime": "2013-01-02T21:10:00+08:00",
"time": "2013-01-02T21:10:00+08:00",
"type": "release",
"arguments": {
"game": [
"--tweakClass",
"customskinloader.tweaker.Tweaker"
]
},
"mainClass": "net.minecraft.launchwrapper.Launch",
"libraries": [
{
"name": "customskinloader:CustomSkinLoader_${mcVersion}:${modFullVersion}",
"url": "https://csl.littleservice.cn/libraries/"
},
{
"name": "net.minecraft:launchwrapper:1.12"
}
]
}
@@ -2,6 +2,9 @@ package customskinloader;
import java.io.File; import java.io.File;
import java.util.Map; import java.util.Map;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.gson.Gson; import com.google.gson.Gson;
@@ -21,7 +24,7 @@ import customskinloader.utils.MinecraftUtil;
/** /**
* Custom skin loader mod for Minecraft. * Custom skin loader mod for Minecraft.
* @author (C) Jeremy Lam [JLChnToZ] 2013 & Alexander Xia [xfl03] 2014-2018 * @author (C) Jeremy Lam [JLChnToZ] 2013-2014 & Alexander Xia [xfl03] 2014-2020
* @version @MOD_FULL_VERSION@ * @version @MOD_FULL_VERSION@
*/ */
public class CustomSkinLoader { public class CustomSkinLoader {
@@ -33,7 +36,7 @@ public class CustomSkinLoader {
CONFIG_FILE=new File(DATA_DIR,"CustomSkinLoader.json"); CONFIG_FILE=new File(DATA_DIR,"CustomSkinLoader.json");
public static final SkinSiteProfile[] DEFAULT_LOAD_LIST={ public static final SkinSiteProfile[] DEFAULT_LOAD_LIST={
SkinSiteProfile.createMojangAPI("Mojang"), SkinSiteProfile.createMojangAPI("Mojang"),
SkinSiteProfile.createCustomSkinAPI("LittleSkin","https://littleskin.cn/"), SkinSiteProfile.createCustomSkinAPI("LittleSkin","https://littlesk.in/csl/"),
SkinSiteProfile.createCustomSkinAPI("BlessingSkin","http://skin.prinzeugen.net/"), SkinSiteProfile.createCustomSkinAPI("BlessingSkin","http://skin.prinzeugen.net/"),
//OneSkin has been removed temporarily //OneSkin has been removed temporarily
//SkinSiteProfile.createCustomSkinAPI("OneSkin","http://fleey.cn/skin/skin_user/skin_json.php/"), //SkinSiteProfile.createCustomSkinAPI("OneSkin","http://fleey.cn/skin/skin_user/skin_json.php/"),
@@ -41,7 +44,8 @@ public class CustomSkinLoader {
//SkinSiteProfile.creatLegacy("Minecrack","http://minecrack.fr.nf/mc/skinsminecrackd/{USERNAME}.png","http://minecrack.fr.nf/mc/cloaksminecrackd/{USERNAME}.png",null), //SkinSiteProfile.creatLegacy("Minecrack","http://minecrack.fr.nf/mc/skinsminecrackd/{USERNAME}.png","http://minecrack.fr.nf/mc/cloaksminecrackd/{USERNAME}.png",null),
SkinSiteProfile.createElyByAPI("ElyBy"), SkinSiteProfile.createElyByAPI("ElyBy"),
SkinSiteProfile.createUniSkinAPI("SkinMe","http://www.skinme.cc/uniskin/"), SkinSiteProfile.createUniSkinAPI("SkinMe","http://www.skinme.cc/uniskin/"),
SkinSiteProfile.createLegacy("LocalSkin","LocalSkin/skins/{USERNAME}.png","LocalSkin/capes/{USERNAME}.png","LocalSkin/elytras/{USERNAME}.png")}; SkinSiteProfile.createLegacy("LocalSkin","LocalSkin/skins/{USERNAME}.png","LocalSkin/capes/{USERNAME}.png","LocalSkin/elytras/{USERNAME}.png"),
SkinSiteProfile.createGlitchlessAPI("GlitchlessGames","https://games.glitchless.ru/api/minecraft/users/profiles/textures/?nickname=")};
public static final Gson GSON=new GsonBuilder().setPrettyPrinting().create(); public static final Gson GSON=new GsonBuilder().setPrettyPrinting().create();
public static final Logger logger=initLogger(); public static final Logger logger=initLogger();
@@ -49,6 +53,8 @@ public class CustomSkinLoader {
private static final ProfileCache profileCache=new ProfileCache(); private static final ProfileCache profileCache=new ProfileCache();
private static final DynamicSkullManager dynamicSkullManager=new DynamicSkullManager(); private static final DynamicSkullManager dynamicSkullManager=new DynamicSkullManager();
private static final ThreadPoolExecutor threadPool = new ThreadPoolExecutor(config.threadPoolSize, config.threadPoolSize, 1L, TimeUnit.MINUTES, new LinkedBlockingQueue<>());
//For User Skin //For User Skin
public static Map<Type, MinecraftProfileTexture> loadProfile(GameProfile gameProfile){ public static Map<Type, MinecraftProfileTexture> loadProfile(GameProfile gameProfile){
@@ -159,14 +165,20 @@ public class CustomSkinLoader {
UserProfile profile=profileCache.getProfile(credential); UserProfile profile=profileCache.getProfile(credential);
return ModelManager0.fromUserProfile(profile); return ModelManager0.fromUserProfile(profile);
} }
//profileCache.setLoading(username, true); if (!profileCache.isLoading(credential)) {
Thread loadThread=new Thread(){ profileCache.setLoading(credential, true);
public void run(){ Runnable loadThread = () -> {
String tempName = Thread.currentThread().getName();
Thread.currentThread().setName(username + "'s skull");
loadProfile0(gameProfile);//Load in thread loadProfile0(gameProfile);//Load in thread
Thread.currentThread().setName(tempName);
};
if (config.enableUpdateSkull) {
new Thread(loadThread).start();
} else {
threadPool.execute(loadThread);
} }
}; }
loadThread.setName(username+"'s skull");
loadThread.start();
return Maps.newHashMap(); return Maps.newHashMap();
} }
@@ -27,6 +27,7 @@ public class Config {
public boolean ignoreHttpsCertificate=false; public boolean ignoreHttpsCertificate=false;
public boolean forceLoadAllTextures=false; public boolean forceLoadAllTextures=false;
public boolean enableCape = true; public boolean enableCape = true;
public int threadPoolSize = 1;
//Cache //Cache
public int cacheExpiry=30; public int cacheExpiry=30;
@@ -56,6 +57,7 @@ public class Config {
//Init program //Init program
config.loadExtraList(); config.loadExtraList();
config.initLocalFolder(); config.initLocalFolder();
config.threadPoolSize = Math.max(config.threadPoolSize, 1);
if(config.ignoreHttpsCertificate) if(config.ignoreHttpsCertificate)
HttpUtil0.ignoreHttpsCertificate(); HttpUtil0.ignoreHttpsCertificate();
if(config.enableCacheAutoClean && !config.enableLocalProfileCache){ if(config.enableCacheAutoClean && !config.enableLocalProfileCache){
@@ -168,7 +170,7 @@ public class Config {
ProfileLoader.IProfileLoader loader=ProfileLoader.LOADERS.get(ssp.type.toLowerCase()); ProfileLoader.IProfileLoader loader=ProfileLoader.LOADERS.get(ssp.type.toLowerCase());
if(loader==null) if(loader==null)
continue; continue;
loader.initLocalFolder(ssp); loader.init(ssp);
} }
} }
@@ -1,54 +1,73 @@
package customskinloader.config; package customskinloader.config;
public class SkinSiteProfile { public class SkinSiteProfile {
//Common
public String name; public String name;
public String type; public String type;
public String userAgent; public String userAgent;
//Mojang API
public String apiRoot;
public String sessionRoot;
//Json API
public String root; public String root;
//Legacy
public Boolean checkPNG;//Not suitable for local skin public Boolean checkPNG;//Not suitable for local skin
public String skin; public String skin;
public String model; public String model;
public String cape; public String cape;
public String elytra; public String elytra;
public static SkinSiteProfile createMojangAPI(String name){ public static SkinSiteProfile createMojangAPI(String name) {
SkinSiteProfile ssp=new SkinSiteProfile(); SkinSiteProfile ssp = new SkinSiteProfile();
ssp.name=name; ssp.name = name;
ssp.type="MojangAPI"; ssp.type = "MojangAPI";
return ssp; return ssp;
} }
public static SkinSiteProfile createCustomSkinAPI(String name,String root){
SkinSiteProfile ssp=new SkinSiteProfile(); public static SkinSiteProfile createCustomSkinAPI(String name, String root) {
ssp.name=name; SkinSiteProfile ssp = new SkinSiteProfile();
ssp.type="CustomSkinAPI"; ssp.name = name;
ssp.root=root; ssp.type = "CustomSkinAPI";
ssp.root = root;
return ssp; return ssp;
} }
public static SkinSiteProfile creatCustomSkinAPIPlus(String name,String root){
SkinSiteProfile ssp=new SkinSiteProfile(); public static SkinSiteProfile creatCustomSkinAPIPlus(String name, String root) {
ssp.name=name; SkinSiteProfile ssp = new SkinSiteProfile();
ssp.type="CustomSkinAPIPlus"; ssp.name = name;
ssp.root=root; ssp.type = "CustomSkinAPIPlus";
ssp.root = root;
return ssp; return ssp;
} }
public static SkinSiteProfile createUniSkinAPI(String name,String root){
SkinSiteProfile ssp=new SkinSiteProfile(); public static SkinSiteProfile createGlitchlessAPI(String name, String root) {
ssp.name=name; SkinSiteProfile ssp = new SkinSiteProfile();
ssp.type="UniSkinAPI"; ssp.name = name;
ssp.root=root; ssp.type = "GlitchlessAPI";
ssp.root = root;
return ssp; return ssp;
} }
public static SkinSiteProfile createLegacy(String name,String skin,String cape,String elytra){
SkinSiteProfile ssp=new SkinSiteProfile(); public static SkinSiteProfile createUniSkinAPI(String name, String root) {
ssp.name=name; SkinSiteProfile ssp = new SkinSiteProfile();
ssp.type="Legacy"; ssp.name = name;
ssp.checkPNG=false; ssp.type = "UniSkinAPI";
ssp.skin=skin; ssp.root = root;
ssp.model="auto"; return ssp;
ssp.cape=cape; }
ssp.elytra=elytra;
public static SkinSiteProfile createLegacy(String name, String skin, String cape, String elytra) {
SkinSiteProfile ssp = new SkinSiteProfile();
ssp.name = name;
ssp.type = "Legacy";
ssp.checkPNG = false;
ssp.skin = skin;
ssp.model = "auto";
ssp.cape = cape;
ssp.elytra = elytra;
return ssp; return ssp;
} }
@@ -9,7 +9,7 @@ import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
import customskinloader.CustomSkinLoader; import customskinloader.CustomSkinLoader;
import net.minecraft.client.Minecraft; import customskinloader.utils.MinecraftUtil;
import net.minecraft.client.renderer.ThreadDownloadImageData; import net.minecraft.client.renderer.ThreadDownloadImageData;
import net.minecraft.client.renderer.texture.ITextureObject; import net.minecraft.client.renderer.texture.ITextureObject;
import net.minecraft.client.renderer.texture.SimpleTexture; import net.minecraft.client.renderer.texture.SimpleTexture;
@@ -24,12 +24,12 @@ public class FakeClientPlayer {
//For Legacy Skin //For Legacy Skin
public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation resourceLocationIn, String username) { public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation resourceLocationIn, String username) {
//CustomSkinLoader.logger.debug("FakeClientPlayer/getDownloadImageSkin "+username); //CustomSkinLoader.logger.debug("FakeClientPlayer/getDownloadImageSkin "+username);
TextureManager textman = Minecraft.getMinecraft().getTextureManager(); TextureManager textman = MinecraftUtil.getTextureManager();
ITextureObject ito = textman.getTexture(resourceLocationIn); ITextureObject ito = textman.getTexture(resourceLocationIn);
if (ito == null || !(ito instanceof ThreadDownloadImageData)) { if (ito == null || !(ito instanceof ThreadDownloadImageData)) {
//if Legacy Skin for username not loaded yet //if Legacy Skin for username not loaded yet
SkinManager skinman = Minecraft.getMinecraft().getSkinManager(); SkinManager skinman = MinecraftUtil.getSkinManager();
UUID offlineUUID = getOfflineUUID(username); UUID offlineUUID = getOfflineUUID(username);
GameProfile offlineProfile = new GameProfile(offlineUUID, username); GameProfile offlineProfile = new GameProfile(offlineUUID, username);
@@ -52,8 +52,8 @@ public class FakeClientPlayer {
//CustomSkinLoader.logger.debug("FakeClientPlayer/getLocationSkin "+username); //CustomSkinLoader.logger.debug("FakeClientPlayer/getLocationSkin "+username);
return new ResourceLocation("skins/legacy-" + StringUtils.stripControlCodes(username)); return new ResourceLocation("skins/legacy-" + StringUtils.stripControlCodes(username));
} }
public static UUID getOfflineUUID(String username)
{ public static UUID getOfflineUUID(String username) {
return UUID.nameUUIDFromBytes(("OfflinePlayer:" + username).getBytes()); return UUID.nameUUIDFromBytes(("OfflinePlayer:" + username).getBytes());
} }
@@ -73,7 +73,7 @@ public class FakeClientPlayer {
if (typeIn != Type.SKIN || loaded) if (typeIn != Type.SKIN || loaded)
return; return;
TextureManager textman = Minecraft.getMinecraft().getTextureManager(); TextureManager textman = MinecraftUtil.getTextureManager();
ITextureObject ito = textman.getTexture(location); ITextureObject ito = textman.getTexture(location);
if (ito == null) if (ito == null)
ito = textureCache.get(location); ito = textureCache.get(location);
@@ -1,19 +1,29 @@
package customskinloader.fake; package customskinloader.fake;
import java.awt.image.BufferedImage;
import java.util.function.Predicate;
import customskinloader.CustomSkinLoader; import customskinloader.CustomSkinLoader;
import customskinloader.fake.texture.FakeBufferedImage; import customskinloader.fake.texture.FakeBufferedImage;
import customskinloader.fake.texture.FakeImage; import customskinloader.fake.texture.FakeImage;
import customskinloader.fake.texture.FakeNativeImage; import customskinloader.fake.texture.FakeNativeImage;
import net.minecraft.client.renderer.IImageBuffer;
import net.minecraft.client.renderer.texture.NativeImage;
import java.awt.image.BufferedImage; public class FakeSkinBuffer implements IImageBuffer {
public class FakeSkinBuffer implements net.minecraft.client.renderer.IImageBuffer {
private int ratio = 1; private int ratio = 1;
private FakeImage image = null; private FakeImage image = null;
//parseUserSkin for 1.15+
public static NativeImage processLegacySkin(NativeImage image, Runnable processTask) {
if (processTask instanceof IImageBuffer) {
return ((IImageBuffer) processTask).func_195786_a(image);
}
return new FakeSkinBuffer().func_195786_a(image);
}
//parseUserSkin for 1.13+ //parseUserSkin for 1.13+
public net.minecraft.client.renderer.texture.NativeImage func_195786_a(net.minecraft.client.renderer.texture.NativeImage image) { public NativeImage func_195786_a(NativeImage image) {
if (image == null) if (image == null)
return null; return null;
@@ -45,40 +55,42 @@ public class FakeSkinBuffer implements net.minecraft.client.renderer.IImageBuffe
if (image.getHeight() != image.getWidth()) {//Single Layer if (image.getHeight() != image.getWidth()) {//Single Layer
//Create a new image and copy origin image data //Create a new image and copy origin image data
FakeImage img = image.createImage(64 * ratio, 64 * ratio); FakeImage img = image.createImage(64 * ratio, 64 * ratio);
img.copyImageData(image); image.close(); image = img; img.copyImageData(image);
image.close();
image = img;
image.fillArea(0 * ratio, 32 * ratio, 64 * ratio, 32 * ratio); image.fillArea(0 * ratio, 32 * ratio, 64 * ratio, 32 * ratio);
//Right Leg -> Left Leg //Right Leg -> Left Leg
image.copyArea( 4 * ratio, 16 * ratio, 16 * ratio, 32 * ratio, 4 * ratio, 4 * ratio, true, false);//Top image.copyArea(4 * ratio, 16 * ratio, 16 * ratio, 32 * ratio, 4 * ratio, 4 * ratio, true, false);//Top
image.copyArea( 8 * ratio, 16 * ratio, 16 * ratio, 32 * ratio, 4 * ratio, 4 * ratio, true, false);//Bottom image.copyArea(8 * ratio, 16 * ratio, 16 * ratio, 32 * ratio, 4 * ratio, 4 * ratio, true, false);//Bottom
image.copyArea( 0 * ratio, 20 * ratio, 24 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Right image.copyArea(0 * ratio, 20 * ratio, 24 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Right
image.copyArea( 4 * ratio, 20 * ratio, 16 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Front image.copyArea(4 * ratio, 20 * ratio, 16 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Front
image.copyArea( 8 * ratio, 20 * ratio, 8 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Left image.copyArea(8 * ratio, 20 * ratio, 8 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Left
image.copyArea(12 * ratio, 20 * ratio, 16 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Back image.copyArea(12 * ratio, 20 * ratio, 16 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Back
//Right Arm -> Left Arm //Right Arm -> Left Arm
image.copyArea(44 * ratio, 16 * ratio, -8 * ratio, 32 * ratio, 4 * ratio, 4 * ratio, true, false);//Top image.copyArea(44 * ratio, 16 * ratio, -8 * ratio, 32 * ratio, 4 * ratio, 4 * ratio, true, false);//Top
image.copyArea(48 * ratio, 16 * ratio, -8 * ratio, 32 * ratio, 4 * ratio, 4 * ratio, true, false);//Bottom image.copyArea(48 * ratio, 16 * ratio, -8 * ratio, 32 * ratio, 4 * ratio, 4 * ratio, true, false);//Bottom
image.copyArea(40 * ratio, 20 * ratio, 0 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Right image.copyArea(40 * ratio, 20 * ratio, 0 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Right
image.copyArea(44 * ratio, 20 * ratio, -8 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Front image.copyArea(44 * ratio, 20 * ratio, -8 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Front
image.copyArea(48 * ratio, 20 * ratio,-16 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Left image.copyArea(48 * ratio, 20 * ratio, -16 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Left
image.copyArea(52 * ratio, 20 * ratio, -8 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Back image.copyArea(52 * ratio, 20 * ratio, -8 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Back
} }
this.image = image; this.image = image;
setAreaDueToConfig( 0 * ratio, 0 * ratio, 32 * ratio, 16 * ratio);//Head - 1 setAreaDueToConfig(0 * ratio, 0 * ratio, 32 * ratio, 16 * ratio);//Head - 1
setAreaTransparent(32 * ratio, 0 * ratio, 64 * ratio, 16 * ratio);//Head - 2 setAreaTransparent(32 * ratio, 0 * ratio, 64 * ratio, 16 * ratio);//Head - 2
setAreaDueToConfig(16 * ratio, 16 * ratio, 40 * ratio, 32 * ratio);//Body - 1 setAreaDueToConfig(16 * ratio, 16 * ratio, 40 * ratio, 32 * ratio);//Body - 1
setAreaTransparent(16 * ratio, 32 * ratio, 40 * ratio, 48 * ratio);//Body - 2 setAreaTransparent(16 * ratio, 32 * ratio, 40 * ratio, 48 * ratio);//Body - 2
setAreaDueToConfig(40 * ratio, 16 * ratio, 56 * ratio, 32 * ratio);//Right Arm - 1 setAreaDueToConfig(40 * ratio, 16 * ratio, 56 * ratio, 32 * ratio);//Right Arm - 1
setAreaTransparent(40 * ratio, 32 * ratio, 56 * ratio, 48 * ratio);//Right Arm - 2 setAreaTransparent(40 * ratio, 32 * ratio, 56 * ratio, 48 * ratio);//Right Arm - 2
setAreaDueToConfig( 0 * ratio, 16 * ratio, 16 * ratio, 32 * ratio);//Right Leg - 1 setAreaDueToConfig(0 * ratio, 16 * ratio, 16 * ratio, 32 * ratio);//Right Leg - 1
setAreaTransparent( 0 * ratio, 32 * ratio, 16 * ratio, 48 * ratio);//Right Leg - 2 setAreaTransparent(0 * ratio, 32 * ratio, 16 * ratio, 48 * ratio);//Right Leg - 2
setAreaDueToConfig(32 * ratio, 48 * ratio, 48 * ratio, 64 * ratio);//Left Arm - 1 setAreaDueToConfig(32 * ratio, 48 * ratio, 48 * ratio, 64 * ratio);//Left Arm - 1
setAreaTransparent(48 * ratio, 48 * ratio, 64 * ratio, 64 * ratio);//Left Arm - 2 setAreaTransparent(48 * ratio, 48 * ratio, 64 * ratio, 64 * ratio);//Left Arm - 2
setAreaDueToConfig(16 * ratio, 48 * ratio, 32 * ratio, 64 * ratio);//Left Leg - 1 setAreaDueToConfig(16 * ratio, 48 * ratio, 32 * ratio, 64 * ratio);//Left Leg - 1
setAreaTransparent( 0 * ratio, 48 * ratio, 16 * ratio, 64 * ratio);//Left Leg - 2 setAreaTransparent(0 * ratio, 48 * ratio, 16 * ratio, 64 * ratio);//Left Leg - 2
return image; return image;
} }
@@ -91,10 +103,26 @@ public class FakeSkinBuffer implements net.minecraft.client.renderer.IImageBuffe
*/ */
public String judgeType() { public String judgeType() {
if (this.image == null) if (this.image == null)
return null; return "default";
if (((image.getRGBA(55, 20) & B) >>> 24) == 0)//if (55,20) is transparent int bgColor = image.getRGBA(63 * ratio, 20 * ratio);
return "slim"; /*
return "default"; * If background is transparent, all the pixels in ((54, 20), (55, 31)) areas is transparent,
* which means it is Alex model.
* If background is opaque, all the pixels in ((54, 20), (55, 31)) areas is same with background,
* which means it is Alex model.
* Otherwise, it is Steve model.
* */
Predicate<Integer> predicate =
getA(bgColor) == 0 ? (c) -> getA(c) == 0 : (c) -> c == bgColor;
for (int x = 54 * ratio; x <= 55 * ratio; ++x) {
for (int y = 20 * ratio; y <= 31 * ratio; ++y) {
int color = image.getRGBA(x, y);
if (!predicate.test(color)) {
return "default";
}
}
}
return "slim";
} }
/* 2^24-1 /* 2^24-1
@@ -119,7 +147,7 @@ public class FakeSkinBuffer implements net.minecraft.client.renderer.IImageBuffe
return; return;
for (int x = x0; x < x1; ++x) for (int x = x0; x < x1; ++x)
for (int y = y0; y < y1; ++y) for (int y = y0; y < y1; ++y)
image.setRGBA(x, y, image.getRGBA(x,y) & A); image.setRGBA(x, y, image.getRGBA(x, y) & A);
} }
/* -2^24 /* -2^24
@@ -131,7 +159,7 @@ public class FakeSkinBuffer implements net.minecraft.client.renderer.IImageBuffe
private void setAreaOpaque(int x0, int y0, int x1, int y1) { private void setAreaOpaque(int x0, int y0, int x1, int y1) {
for (int x = x0; x < x1; ++x) for (int x = x0; x < x1; ++x)
for (int y = y0; y < y1; ++y) for (int y = y0; y < y1; ++y)
image.setRGBA(x, y, image.getRGBA(x,y) | B); image.setRGBA(x, y, image.getRGBA(x, y) | B);
} }
private void setAreaDueToConfig(int x0, int y0, int x1, int y1) { private void setAreaDueToConfig(int x0, int y0, int x1, int y1) {
@@ -148,4 +176,8 @@ public class FakeSkinBuffer implements net.minecraft.client.renderer.IImageBuffe
private static int getARGB(int a, int r, int g, int b) { private static int getARGB(int a, int r, int g, int b) {
return (a << 24) | (r << 16) | (g << 8) | b; return (a << 24) | (r << 16) | (g << 8) | b;
} }
private static int getA(int argb) {
return (argb & B) >>> 24;
}
} }
@@ -2,6 +2,7 @@ package customskinloader.fake;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File; import java.io.File;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
@@ -13,107 +14,119 @@ import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.MinecraftProfileTexture; import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
import com.mojang.authlib.minecraft.MinecraftSessionService; import com.mojang.authlib.minecraft.MinecraftSessionService;
import customskinloader.CustomSkinLoader; import customskinloader.CustomSkinLoader;
import customskinloader.fake.itf.IFakeMinecraft;
import customskinloader.fake.itf.IFakeTextureManager_1;
import customskinloader.fake.itf.IFakeTextureManager_2;
import customskinloader.utils.HttpTextureUtil; import customskinloader.utils.HttpTextureUtil;
import customskinloader.utils.HttpTextureUtil.HttpTextureInfo; import customskinloader.utils.HttpTextureUtil.HttpTextureInfo;
import customskinloader.utils.MinecraftUtil;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.IImageBuffer; import net.minecraft.client.renderer.IImageBuffer;
import net.minecraft.client.renderer.ThreadDownloadImageData; import net.minecraft.client.renderer.texture.SimpleTexture;
import net.minecraft.client.renderer.texture.ITextureObject; import net.minecraft.client.renderer.texture.Texture;
import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.resources.DefaultPlayerSkin; import net.minecraft.client.resources.DefaultPlayerSkin;
import net.minecraft.client.resources.SkinManager.SkinAvailableCallback; import net.minecraft.client.resources.SkinManager.SkinAvailableCallback;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
public class FakeSkinManager{ public class FakeSkinManager {
private static final ExecutorService THREAD_POOL = new ThreadPoolExecutor(0, 2, 1L, TimeUnit.MINUTES, new LinkedBlockingQueue<Runnable>()); private static final ExecutorService THREAD_POOL = new ThreadPoolExecutor(CustomSkinLoader.config.threadPoolSize, CustomSkinLoader.config.threadPoolSize, 1L, TimeUnit.MINUTES, new LinkedBlockingQueue<>());
private final TextureManager textureManager; private final TextureManager textureManager;
private final Map<ResourceLocation, MinecraftProfileTexture> modelCache = new HashMap<>();
public FakeSkinManager(TextureManager textureManagerInstance, File skinCacheDirectory, MinecraftSessionService sessionService) { public FakeSkinManager(TextureManager textureManagerInstance, File skinCacheDirectory, MinecraftSessionService sessionService) {
this.textureManager=textureManagerInstance; this.textureManager = textureManagerInstance;
HttpTextureUtil.defaultCacheDir=skinCacheDirectory; HttpTextureUtil.defaultCacheDir = skinCacheDirectory;
} }
public ResourceLocation loadSkin(MinecraftProfileTexture profileTexture, Type textureType){ public ResourceLocation loadSkin(MinecraftProfileTexture profileTexture, Type textureType) {
return this.loadSkin(profileTexture, textureType, null); return this.loadSkin(profileTexture, textureType, null);
} }
public ResourceLocation loadSkin(final MinecraftProfileTexture profileTexture, final Type textureType, final SkinAvailableCallback skinAvailableCallback){
HttpTextureInfo info=HttpTextureUtil.toHttpTextureInfo(profileTexture.getUrl());
final ResourceLocation resourcelocation = new ResourceLocation("skins/" + info.hash);
ITextureObject itextureobject = this.textureManager.getTexture(resourcelocation);
if (itextureobject != null)//Have already loaded public ResourceLocation loadSkin(final MinecraftProfileTexture profileTexture, final Type textureType, final SkinAvailableCallback skinAvailableCallback) {
makeCallback(skinAvailableCallback,textureType, resourcelocation, profileTexture); HttpTextureInfo info = HttpTextureUtil.toHttpTextureInfo(profileTexture.getUrl());
else{
ThreadDownloadImageData threaddownloadimagedata = new ThreadDownloadImageData(info.cacheFile, info.url, DefaultPlayerSkin.getDefaultSkinLegacy(), final ResourceLocation resourcelocation = new ResourceLocation("skins/" + info.hash);
new BaseBuffer(skinAvailableCallback, textureType, resourcelocation, profileTexture));
if(skinAvailableCallback instanceof FakeClientPlayer.LegacyBuffer)//Cache for client player if (((IFakeTextureManager_1) this.textureManager).func_229267_b_(resourcelocation) != null) {//Have already loaded
FakeClientPlayer.textureCache.put(resourcelocation,threaddownloadimagedata); makeCallback(skinAvailableCallback, textureType, resourcelocation, modelCache.getOrDefault(resourcelocation, profileTexture));
this.textureManager.loadTexture(resourcelocation, threaddownloadimagedata); } else {
SimpleTexture threaddownloadimagedata = MinecraftUtil.createThreadDownloadImageData(info.cacheFile, info.url, DefaultPlayerSkin.getDefaultSkinLegacy(), new BaseBuffer(skinAvailableCallback, textureType, resourcelocation, profileTexture), textureType);
if (skinAvailableCallback instanceof FakeClientPlayer.LegacyBuffer)//Cache for client player
FakeClientPlayer.textureCache.put(resourcelocation, threaddownloadimagedata);
((IFakeTextureManager_2) this.textureManager).func_229263_a_(resourcelocation, (Texture) threaddownloadimagedata);
} }
return resourcelocation; return resourcelocation;
} }
public void loadProfileTextures(final GameProfile profile, final SkinAvailableCallback skinAvailableCallback, final boolean requireSecure){
THREAD_POOL.submit(new Runnable(){ public void loadProfileTextures(final GameProfile profile, final SkinAvailableCallback skinAvailableCallback, final boolean requireSecure) {
public void run(){ THREAD_POOL.execute(new Runnable() {
public void run() {
final Map<Type, MinecraftProfileTexture> map = Maps.newHashMap(); final Map<Type, MinecraftProfileTexture> map = Maps.newHashMap();
map.putAll(customskinloader.CustomSkinLoader.loadProfile(profile)); map.putAll(customskinloader.CustomSkinLoader.loadProfile(profile));
Minecraft.getMinecraft().addScheduledTask(new Runnable(){ ((IFakeMinecraft) Minecraft.getMinecraft()).execute(() -> {
public void run(){ for (Type type : Type.values()) {
for(Type type:Type.values()) if (map.containsKey(type)) {
if(map.containsKey(type)) CustomSkinLoader.logger.debug("Loading type:" + type);
FakeSkinManager.this.loadSkin(map.get(type), type, skinAvailableCallback); FakeSkinManager.this.loadSkin(map.get(type), type, skinAvailableCallback);
}
} }
}); });
} }
}); });
} }
public Map<Type, MinecraftProfileTexture> loadSkinFromCache(GameProfile profile){
public Map<Type, MinecraftProfileTexture> loadSkinFromCache(GameProfile profile) {
return CustomSkinLoader.loadProfileFromCache(profile); return CustomSkinLoader.loadProfileFromCache(profile);
} }
private static void makeCallback(SkinAvailableCallback callback,Type type, ResourceLocation location, MinecraftProfileTexture texture){ private static void makeCallback(SkinAvailableCallback callback, Type type, ResourceLocation location, MinecraftProfileTexture texture) {
if(callback!=null) if (callback != null)
callback.skinAvailable(type, location, texture); callback.skinAvailable(type, location, texture);
} }
private class BaseBuffer implements IImageBuffer{
private class BaseBuffer implements IImageBuffer {
private IImageBuffer buffer; private IImageBuffer buffer;
private SkinAvailableCallback callback; private SkinAvailableCallback callback;
private Type type; private Type type;
private ResourceLocation location; private ResourceLocation location;
private MinecraftProfileTexture texture; private MinecraftProfileTexture texture;
public BaseBuffer(SkinAvailableCallback callback,Type type,ResourceLocation location,MinecraftProfileTexture texture){
this.buffer=(type==Type.SKIN?new FakeSkinBuffer():null); public BaseBuffer(SkinAvailableCallback callback, Type type, ResourceLocation location, MinecraftProfileTexture texture) {
this.buffer = (type == Type.SKIN ? new FakeSkinBuffer() : null);
this.callback=callback;
this.type=type; this.callback = callback;
this.location=location; this.type = type;
this.texture=texture; this.location = location;
this.texture = texture;
} }
public net.minecraft.client.renderer.texture.NativeImage func_195786_a(net.minecraft.client.renderer.texture.NativeImage image){ public net.minecraft.client.renderer.texture.NativeImage func_195786_a(net.minecraft.client.renderer.texture.NativeImage image) {
return buffer instanceof FakeSkinBuffer ? ((FakeSkinBuffer) buffer).func_195786_a(image) : image; return buffer instanceof FakeSkinBuffer ? ((FakeSkinBuffer) buffer).func_195786_a(image) : image;
} }
public BufferedImage parseUserSkin(BufferedImage image){
return buffer==null?image:buffer.parseUserSkin(image); public BufferedImage parseUserSkin(BufferedImage image) {
return buffer == null ? image : buffer.parseUserSkin(image);
} }
public void skinAvailable(){
if (buffer != null){ public void skinAvailable() {
if (buffer != null) {
buffer.skinAvailable(); buffer.skinAvailable();
if ("auto".equals(texture.getMetadata("model")) && buffer instanceof FakeSkinBuffer){ if ("auto".equals(texture.getMetadata("model")) && buffer instanceof FakeSkinBuffer) {
//Auto judge skin type //Auto judge skin type
Map<String, String> metadata = Maps.newHashMap(); Map<String, String> metadata = Maps.newHashMap();
metadata.put("model", ((FakeSkinBuffer) buffer).judgeType()); String type = ((FakeSkinBuffer) buffer).judgeType();
metadata.put("model", type);
texture = new MinecraftProfileTexture(texture.getUrl(), metadata); texture = new MinecraftProfileTexture(texture.getUrl(), metadata);
FakeSkinManager.this.modelCache.put(location, texture);
} }
} }
FakeSkinManager.makeCallback(callback,type, location, texture); FakeSkinManager.makeCallback(callback, type, location, texture);
} }
} }
} }
@@ -0,0 +1,9 @@
package customskinloader.fake.itf;
import net.minecraft.client.Minecraft;
public interface IFakeMinecraft {
default void execute(Runnable runnable) {
((Minecraft) this).addScheduledTask(runnable);
}
}
@@ -0,0 +1,16 @@
package customskinloader.fake.itf;
import net.minecraft.client.renderer.texture.ITextureObject;
import net.minecraft.client.renderer.texture.Texture;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.ResourceLocation;
public interface IFakeTextureManager_1 {
default boolean func_229263_a_(ResourceLocation textureLocation, Texture textureObj) {
return ((TextureManager) this).loadTexture(textureLocation, (ITextureObject) textureObj);
}
default Texture func_229267_b_(ResourceLocation textureLocation) {
return (Texture) ((TextureManager) this).getTexture(textureLocation);
}
}
@@ -0,0 +1,10 @@
package customskinloader.fake.itf;
import net.minecraft.client.renderer.texture.Texture;
import net.minecraft.util.ResourceLocation;
public interface IFakeTextureManager_2 {
default void func_229263_a_(ResourceLocation textureLocation, Texture textureObj) {
((IFakeTextureManager_1) this).func_229263_a_(textureLocation, textureObj);
}
}
@@ -33,7 +33,8 @@ public class JsonAPILoader implements ProfileLoader.IProfileLoader {
CustomSkinAPI(new CustomSkinAPI()), CustomSkinAPI(new CustomSkinAPI()),
CustomSkinAPIPlus(new CustomSkinAPIPlus()), CustomSkinAPIPlus(new CustomSkinAPIPlus()),
UniSkinAPI(new UniSkinAPI()), UniSkinAPI(new UniSkinAPI()),
ElyByAPI(new ElyByAPI()); ElyByAPI(new ElyByAPI()),
GlitchlessAPI(new GlitchlessAPI());
public IJsonAPI jsonAPI; public IJsonAPI jsonAPI;
Type(IJsonAPI jsonAPI){ Type(IJsonAPI jsonAPI){
this.jsonAPI=jsonAPI; this.jsonAPI=jsonAPI;
@@ -95,7 +96,7 @@ public class JsonAPILoader implements ProfileLoader.IProfileLoader {
} }
@SuppressWarnings("ResultOfMethodCallIgnored") @SuppressWarnings("ResultOfMethodCallIgnored")
@Override @Override
public void initLocalFolder(SkinSiteProfile ssp) { public void init(SkinSiteProfile ssp) {
if(HttpUtil0.isLocal(ssp.root)){ if(HttpUtil0.isLocal(ssp.root)){
File f=new File(ssp.root); File f=new File(ssp.root);
if(!f.exists()) if(!f.exists())
@@ -2,6 +2,7 @@ package customskinloader.loader;
import java.io.File; import java.io.File;
import com.mojang.util.UUIDTypeAdapter;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
@@ -16,51 +17,54 @@ import customskinloader.utils.HttpRequestUtil.HttpResponce;
import customskinloader.utils.HttpTextureUtil; import customskinloader.utils.HttpTextureUtil;
import customskinloader.utils.HttpUtil0; import customskinloader.utils.HttpUtil0;
import javax.annotation.Nonnull;
public class LegacyLoader implements ProfileLoader.IProfileLoader { public class LegacyLoader implements ProfileLoader.IProfileLoader {
public static final String USERNAME_PLACEHOLDER="{USERNAME}"; public static final String USERNAME_PLACEHOLDER = "{USERNAME}";
public static final String UUID_PLACEHOLDER = "{UUID}";
@Override @Override
public UserProfile loadProfile(SkinSiteProfile ssp, GameProfile gameProfile) throws Exception { public UserProfile loadProfile(SkinSiteProfile ssp, GameProfile gameProfile) throws Exception {
String username=gameProfile.getName(); String username = gameProfile.getName();
UserProfile profile=new UserProfile(); UserProfile profile = new UserProfile();
if(StringUtils.isNoneEmpty(ssp.skin)){ if (StringUtils.isNoneEmpty(ssp.skin)) {
String skin=ssp.skin.replace(USERNAME_PLACEHOLDER, username); String skin = expandURL(ssp.skin, username);
if(HttpUtil0.isLocal(ssp.skin)){ if (HttpUtil0.isLocal(ssp.skin)) {
File skinFile=new File(CustomSkinLoader.DATA_DIR,skin); File skinFile = new File(CustomSkinLoader.DATA_DIR, skin);
if(skinFile.exists()&&skinFile.isFile()) if (skinFile.exists() && skinFile.isFile())
profile.skinUrl=HttpTextureUtil.getLocalLegacyFakeUrl(skin, HttpTextureUtil.getHash(skin, skinFile.length(), skinFile.lastModified())); profile.skinUrl = HttpTextureUtil.getLocalLegacyFakeUrl(skin, HttpTextureUtil.getHash(skin, skinFile.length(), skinFile.lastModified()));
}else{ } else {
HttpResponce responce = HttpRequestUtil.makeHttpRequest(new HttpRequest(skin).setUserAgent(ssp.userAgent).setCheckPNG(ssp.checkPNG!=null && ssp.checkPNG).setLoadContent(false).setCacheTime(90)); HttpResponce responce = HttpRequestUtil.makeHttpRequest(new HttpRequest(skin).setUserAgent(ssp.userAgent).setCheckPNG(ssp.checkPNG != null && ssp.checkPNG).setLoadContent(false).setCacheTime(90));
if(responce.success) if (responce.success)
profile.skinUrl=HttpTextureUtil.getLegacyFakeUrl(skin); profile.skinUrl = HttpTextureUtil.getLegacyFakeUrl(skin);
} }
profile.model=profile.hasSkinUrl()?ssp.model:null; profile.model = profile.hasSkinUrl() ? ssp.model : null;
} }
if(StringUtils.isNoneEmpty(ssp.cape)){ if (StringUtils.isNoneEmpty(ssp.cape)) {
String cape=ssp.cape.replace(USERNAME_PLACEHOLDER, username); String cape = expandURL(ssp.cape, username);
if(HttpUtil0.isLocal(ssp.cape)){ if (HttpUtil0.isLocal(ssp.cape)) {
File capeFile=new File(CustomSkinLoader.DATA_DIR,cape); File capeFile = new File(CustomSkinLoader.DATA_DIR, cape);
if(capeFile.exists()&&capeFile.isFile()) if (capeFile.exists() && capeFile.isFile())
profile.capeUrl=HttpTextureUtil.getLocalLegacyFakeUrl(cape, HttpTextureUtil.getHash(cape, capeFile.length(), capeFile.lastModified())); profile.capeUrl = HttpTextureUtil.getLocalLegacyFakeUrl(cape, HttpTextureUtil.getHash(cape, capeFile.length(), capeFile.lastModified()));
}else{ } else {
HttpResponce responce = HttpRequestUtil.makeHttpRequest(new HttpRequest(cape).setUserAgent(ssp.userAgent).setCheckPNG(ssp.checkPNG!=null && ssp.checkPNG).setLoadContent(false).setCacheTime(90)); HttpResponce responce = HttpRequestUtil.makeHttpRequest(new HttpRequest(cape).setUserAgent(ssp.userAgent).setCheckPNG(ssp.checkPNG != null && ssp.checkPNG).setLoadContent(false).setCacheTime(90));
if(responce.success) if (responce.success)
profile.capeUrl=HttpTextureUtil.getLegacyFakeUrl(cape); profile.capeUrl = HttpTextureUtil.getLegacyFakeUrl(cape);
} }
} }
if(ModelManager0.isElytraSupported()&&StringUtils.isNoneEmpty(ssp.elytra)){ if (ModelManager0.isElytraSupported() && StringUtils.isNoneEmpty(ssp.elytra)) {
String elytra=ssp.elytra.replace(USERNAME_PLACEHOLDER, username); String elytra = expandURL(ssp.elytra, username);
if(HttpUtil0.isLocal(ssp.elytra)){ if (HttpUtil0.isLocal(ssp.elytra)) {
File elytraFile=new File(CustomSkinLoader.DATA_DIR,elytra); File elytraFile = new File(CustomSkinLoader.DATA_DIR, elytra);
if(elytraFile.exists()&&elytraFile.isFile()) if (elytraFile.exists() && elytraFile.isFile())
profile.elytraUrl=HttpTextureUtil.getLocalLegacyFakeUrl(elytra, HttpTextureUtil.getHash(elytra, elytraFile.length(), elytraFile.lastModified())); profile.elytraUrl = HttpTextureUtil.getLocalLegacyFakeUrl(elytra, HttpTextureUtil.getHash(elytra, elytraFile.length(), elytraFile.lastModified()));
}else{ } else {
HttpResponce responce=HttpRequestUtil.makeHttpRequest(new HttpRequest(elytra).setUserAgent(ssp.userAgent).setCheckPNG(ssp.checkPNG!=null && ssp.checkPNG).setLoadContent(false).setCacheTime(90)); HttpResponce responce = HttpRequestUtil.makeHttpRequest(new HttpRequest(elytra).setUserAgent(ssp.userAgent).setCheckPNG(ssp.checkPNG != null && ssp.checkPNG).setLoadContent(false).setCacheTime(90));
if(responce.success) if (responce.success)
profile.elytraUrl=HttpTextureUtil.getLegacyFakeUrl(elytra); profile.elytraUrl = HttpTextureUtil.getLegacyFakeUrl(elytra);
} }
} }
if(profile.isEmpty()){ if (profile.isEmpty()) {
CustomSkinLoader.logger.info("Both skin and cape not found."); CustomSkinLoader.logger.info("Both skin and cape not found.");
return null; return null;
} }
@@ -71,25 +75,44 @@ public class LegacyLoader implements ProfileLoader.IProfileLoader {
public boolean compare(SkinSiteProfile ssp0, SkinSiteProfile ssp1) { public boolean compare(SkinSiteProfile ssp0, SkinSiteProfile ssp1) {
return (!StringUtils.isNoneEmpty(ssp0.skin) || ssp0.skin.equalsIgnoreCase(ssp1.skin)) || (!StringUtils.isNoneEmpty(ssp0.cape) || ssp0.cape.equalsIgnoreCase(ssp1.cape)); return (!StringUtils.isNoneEmpty(ssp0.skin) || ssp0.skin.equalsIgnoreCase(ssp1.skin)) || (!StringUtils.isNoneEmpty(ssp0.cape) || ssp0.cape.equalsIgnoreCase(ssp1.cape));
} }
@Override @Override
public String getName() { public String getName() {
return "Legacy"; return "Legacy";
} }
@Override @Override
public void initLocalFolder(SkinSiteProfile ssp) { public void init(SkinSiteProfile ssp) {
if(HttpUtil0.isLocal(ssp.skin)) if (HttpUtil0.isLocal(ssp.skin))
initFolder(ssp.skin); initFolder(ssp.skin);
if(HttpUtil0.isLocal(ssp.cape)) if (HttpUtil0.isLocal(ssp.cape))
initFolder(ssp.cape); initFolder(ssp.cape);
if(HttpUtil0.isLocal(ssp.elytra)) if (HttpUtil0.isLocal(ssp.elytra))
initFolder(ssp.elytra); initFolder(ssp.elytra);
} }
@SuppressWarnings("ResultOfMethodCallIgnored") @SuppressWarnings("ResultOfMethodCallIgnored")
private void initFolder(String target){ private void initFolder(String target) {
String file=target.replace(USERNAME_PLACEHOLDER, "init"); String file = target.replace(USERNAME_PLACEHOLDER, "init");
File folder=new File(CustomSkinLoader.DATA_DIR,file).getParentFile(); File folder = new File(CustomSkinLoader.DATA_DIR, file).getParentFile();
if(folder!=null&&!folder.exists()) if (folder != null && !folder.exists())
folder.mkdirs(); folder.mkdirs();
} }
private String expandURL(String url, String username) {
String t = url.replace(USERNAME_PLACEHOLDER, username);
if (t.contains(UUID_PLACEHOLDER))
t = t.replace(UUID_PLACEHOLDER, getMojangUUID(username));
return t;
}
@Nonnull
private String getMojangUUID(String username) {
GameProfile profile = MojangAPILoader.loadGameProfile(MojangAPILoader.getMojangApiRoot(), username);
if (profile == null) {
CustomSkinLoader.logger.info("UUID for %s not found.", username);
return "{ABORT}";
}
return UUIDTypeAdapter.fromUUID(profile.getId());
}
} }
@@ -1,5 +1,6 @@
package customskinloader.loader; package customskinloader.loader;
import java.util.Collections;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
@@ -13,7 +14,6 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.MinecraftProfileTexture; import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import com.mojang.authlib.minecraft.MinecraftSessionService;
import com.mojang.authlib.properties.Property; import com.mojang.authlib.properties.Property;
import com.mojang.authlib.properties.PropertyMap; import com.mojang.authlib.properties.PropertyMap;
import com.mojang.authlib.yggdrasil.response.MinecraftProfilePropertiesResponse; import com.mojang.authlib.yggdrasil.response.MinecraftProfilePropertiesResponse;
@@ -27,95 +27,113 @@ import customskinloader.profile.UserProfile;
import customskinloader.utils.HttpRequestUtil; import customskinloader.utils.HttpRequestUtil;
import customskinloader.utils.HttpRequestUtil.HttpRequest; import customskinloader.utils.HttpRequestUtil.HttpRequest;
import customskinloader.utils.HttpRequestUtil.HttpResponce; import customskinloader.utils.HttpRequestUtil.HttpResponce;
import customskinloader.utils.MinecraftUtil;
public class MojangAPILoader implements ProfileLoader.IProfileLoader { public class MojangAPILoader implements ProfileLoader.IProfileLoader {
public static final MinecraftSessionService defaultSessionService=MinecraftUtil.getSessionService();
@Override @Override
public UserProfile loadProfile(SkinSiteProfile ssp, GameProfile gameProfile) throws Exception { public UserProfile loadProfile(SkinSiteProfile ssp, GameProfile gameProfile) throws Exception {
Map<MinecraftProfileTexture.Type,MinecraftProfileTexture> map=getTextures(gameProfile); Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> map = getTextures(gameProfile);
if(!map.isEmpty()){ if (!map.isEmpty()) {
CustomSkinLoader.logger.info("Default profile will be used."); CustomSkinLoader.logger.info("Default profile will be used.");
return ModelManager0.toUserProfile(map); return ModelManager0.toUserProfile(map);
} }
String username=gameProfile.getName(); String username = gameProfile.getName();
GameProfile newGameProfile=loadGameProfile(username); GameProfile newGameProfile = loadGameProfile(ssp.apiRoot, username);
if(newGameProfile==null){ if (newGameProfile == null) {
CustomSkinLoader.logger.info("Profile not found.("+username+"'s profile not found.)"); CustomSkinLoader.logger.info("Profile not found.(" + username + "'s profile not found.)");
return null; return null;
} }
newGameProfile=fillGameProfile(newGameProfile); newGameProfile = fillGameProfile(ssp.sessionRoot, newGameProfile);
map=getTextures(newGameProfile); map = getTextures(newGameProfile);
if(!map.isEmpty()){ if (!map.isEmpty()) {
gameProfile.getProperties().putAll(newGameProfile.getProperties()); gameProfile.getProperties().putAll(newGameProfile.getProperties());
return ModelManager0.toUserProfile(map); return ModelManager0.toUserProfile(map);
} }
CustomSkinLoader.logger.info("Profile not found.("+username+" doesn't have skin/cape.)"); CustomSkinLoader.logger.info("Profile not found.(" + username + " doesn't have skin/cape.)");
return null; return null;
} }
//Username -> UUID //Username -> UUID
public static GameProfile loadGameProfile(String username) { public static GameProfile loadGameProfile(String apiRoot, String username) {
//Doc (http://wiki.vg/Mojang_API#Username_-.3E_UUID_at_time) //Doc (https://wiki.vg/Mojang_API#Playernames_-.3E_UUIDs)
HttpResponce responce=HttpRequestUtil.makeHttpRequest(new HttpRequest("https://api.mojang.com/users/profiles/minecraft/"+username).setCacheTime(0)); Gson gson = new GsonBuilder().registerTypeAdapter(UUID.class, new UUIDTypeAdapter()).create();
if(StringUtils.isEmpty(responce.content))
HttpResponce responce = HttpRequestUtil.makeHttpRequest(
new HttpRequest(apiRoot + "profiles/minecraft")
.setCacheTime(-1).setPayload(gson.toJson(Collections.singletonList(username)))
);
if (StringUtils.isEmpty(responce.content))
return null; return null;
Gson gson=new GsonBuilder().registerTypeAdapter(UUID.class, new UUIDTypeAdapter()).create();
GameProfile gameProfile=gson.fromJson(responce.content, GameProfile.class); GameProfile[] profiles = gson.fromJson(responce.content, GameProfile[].class);
if (profiles.length == 0) return null;
if(gameProfile.getId()==null) GameProfile gameProfile = profiles[0];
if (gameProfile.getId() == null)
return null; return null;
return new GameProfile(gameProfile.getId(),gameProfile.getName()); return new GameProfile(gameProfile.getId(), gameProfile.getName());
} }
//UUID -> Profile //UUID -> Profile
public static GameProfile fillGameProfile(GameProfile profile) { public static GameProfile fillGameProfile(String sessionRoot, GameProfile profile) {
//Doc (http://wiki.vg/Mojang_API#UUID_-.3E_Profile_.2B_Skin.2FCape) //Doc (http://wiki.vg/Mojang_API#UUID_-.3E_Profile_.2B_Skin.2FCape)
HttpResponce responce = HttpRequestUtil.makeHttpRequest( HttpResponce responce = HttpRequestUtil.makeHttpRequest(
new HttpRequest("https://sessionserver.mojang.com/session/minecraft/profile/" new HttpRequest(sessionRoot + "session/minecraft/profile/"
+ UUIDTypeAdapter.fromUUID(profile.getId())).setCacheTime(90)); + UUIDTypeAdapter.fromUUID(profile.getId())).setCacheTime(90));
if(StringUtils.isEmpty(responce.content)) if (StringUtils.isEmpty(responce.content))
return profile; return profile;
Gson gson=new GsonBuilder() Gson gson = new GsonBuilder()
.registerTypeAdapter(UUID.class, new UUIDTypeAdapter()) .registerTypeAdapter(UUID.class, new UUIDTypeAdapter())
.registerTypeAdapter(PropertyMap.class, new PropertyMap.Serializer()) .registerTypeAdapter(PropertyMap.class, new PropertyMap.Serializer())
.create(); .create();
MinecraftProfilePropertiesResponse propertiesResponce=gson.fromJson(responce.content, MinecraftProfilePropertiesResponse.class); MinecraftProfilePropertiesResponse propertiesResponce = gson.fromJson(responce.content, MinecraftProfilePropertiesResponse.class);
GameProfile newGameProfile=new GameProfile(propertiesResponce.getId(),propertiesResponce.getName()); GameProfile newGameProfile = new GameProfile(propertiesResponce.getId(), propertiesResponce.getName());
newGameProfile.getProperties().putAll(propertiesResponce.getProperties()); newGameProfile.getProperties().putAll(propertiesResponce.getProperties());
return newGameProfile; return newGameProfile;
} }
public static Map<MinecraftProfileTexture.Type,MinecraftProfileTexture> getTextures(GameProfile gameProfile) { public static Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> getTextures(GameProfile gameProfile) {
if(gameProfile==null) if (gameProfile == null)
return Maps.newHashMap(); return Maps.newHashMap();
Property textureProperty=Iterables.getFirst(gameProfile.getProperties().get("textures"), null); Property textureProperty = Iterables.getFirst(gameProfile.getProperties().get("textures"), null);
if (textureProperty==null) if (textureProperty == null)
return Maps.newHashMap(); return Maps.newHashMap();
String value=textureProperty.getValue(); String value = textureProperty.getValue();
if(StringUtils.isBlank(value)) if (StringUtils.isBlank(value))
return Maps.newHashMap(); return Maps.newHashMap();
@SuppressWarnings("deprecation") String json = new String(Base64.decodeBase64(value), Charsets.UTF_8); @SuppressWarnings("deprecation") String json = new String(Base64.decodeBase64(value), Charsets.UTF_8);
Gson gson=new GsonBuilder().registerTypeAdapter(UUID.class,new UUIDTypeAdapter()).create(); Gson gson = new GsonBuilder().registerTypeAdapter(UUID.class, new UUIDTypeAdapter()).create();
MinecraftTexturesPayload result=gson.fromJson(json,MinecraftTexturesPayload.class); MinecraftTexturesPayload result = gson.fromJson(json, MinecraftTexturesPayload.class);
if (result==null||result.getTextures()==null) if (result == null || result.getTextures() == null)
return Maps.newHashMap(); return Maps.newHashMap();
return result.getTextures(); return result.getTextures();
} }
@Override @Override
public boolean compare(SkinSiteProfile ssp0, SkinSiteProfile ssp1) { public boolean compare(SkinSiteProfile ssp0, SkinSiteProfile ssp1) {
return true; return true;
} }
@Override @Override
public String getName() { public String getName() {
return "MojangAPI"; return "MojangAPI";
} }
@Override @Override
public void initLocalFolder(SkinSiteProfile ssp) { public void init(SkinSiteProfile ssp) {
//Init default api & session root for Mojang API
if (ssp.apiRoot == null)
ssp.apiRoot = "https://api.mojang.com/";
if (ssp.sessionRoot == null)
ssp.sessionRoot = "https://sessionserver.mojang.com/";
}
private static final String MOJANG_API_ROOT = "https://api{DO_NOT_MODIFY}.mojang.com/";
public static String getMojangApiRoot() {
return MOJANG_API_ROOT.replace("{DO_NOT_MODIFY}", "");
} }
} }
@@ -5,6 +5,7 @@ import java.util.HashMap;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import customskinloader.config.SkinSiteProfile; import customskinloader.config.SkinSiteProfile;
import customskinloader.plugin.PluginLoader;
import customskinloader.profile.UserProfile; import customskinloader.profile.UserProfile;
public class ProfileLoader { public class ProfileLoader {
@@ -14,6 +15,7 @@ public class ProfileLoader {
new JsonAPILoader(JsonAPILoader.Type.CustomSkinAPIPlus), new JsonAPILoader(JsonAPILoader.Type.CustomSkinAPIPlus),
new JsonAPILoader(JsonAPILoader.Type.UniSkinAPI), new JsonAPILoader(JsonAPILoader.Type.UniSkinAPI),
new JsonAPILoader(JsonAPILoader.Type.ElyByAPI), new JsonAPILoader(JsonAPILoader.Type.ElyByAPI),
new JsonAPILoader(JsonAPILoader.Type.GlitchlessAPI),
new LegacyLoader()}; new LegacyLoader()};
public static final HashMap<String,IProfileLoader> LOADERS=initLoaders(); public static final HashMap<String,IProfileLoader> LOADERS=initLoaders();
@@ -23,6 +25,7 @@ public class ProfileLoader {
for(IProfileLoader loader:DEFAULT_LOADERS){ for(IProfileLoader loader:DEFAULT_LOADERS){
loaders.put(loader.getName().toLowerCase(), loader); loaders.put(loader.getName().toLowerCase(), loader);
} }
loaders.putAll(PluginLoader.loadPlugins());
return loaders; return loaders;
} }
@@ -30,6 +33,6 @@ public class ProfileLoader {
UserProfile loadProfile(SkinSiteProfile ssp,GameProfile gameProfile) throws Exception; UserProfile loadProfile(SkinSiteProfile ssp,GameProfile gameProfile) throws Exception;
boolean compare(SkinSiteProfile ssp0,SkinSiteProfile ssp1); boolean compare(SkinSiteProfile ssp0,SkinSiteProfile ssp1);
String getName(); String getName();
void initLocalFolder(SkinSiteProfile ssp); void init(SkinSiteProfile ssp);
} }
} }
@@ -0,0 +1,40 @@
package customskinloader.loader.jsonapi;
import com.google.gson.Gson;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import customskinloader.config.SkinSiteProfile;
import customskinloader.loader.JsonAPILoader;
import customskinloader.profile.ModelManager0;
import customskinloader.profile.UserProfile;
import java.util.Map;
public class GlitchlessAPI implements JsonAPILoader.IJsonAPI {
@Override
public String toJsonUrl(String root, String username) {
return root + username;
}
@Override
public UserProfile toUserProfile(String root, String json, boolean local) {
GlitchlessApiResponse result = new Gson().fromJson(json, GlitchlessApiResponse.class);
if (!result.textures.containsKey(MinecraftProfileTexture.Type.SKIN))
return null;
return ModelManager0.toUserProfile(result.textures);
}
@Override
public String getPayload(SkinSiteProfile ssp) {
return null;
}
@Override
public String getName() {
return "GlitchlessAPI";
}
public static class GlitchlessApiResponse {
protected Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> textures;
}
}
@@ -0,0 +1,7 @@
package customskinloader.plugin;
import customskinloader.loader.ProfileLoader;
public interface ICustomSkinLoaderPlugin {
ProfileLoader.IProfileLoader getProfileLoader();
}
@@ -0,0 +1,39 @@
package customskinloader.plugin;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.ServiceLoader;
import org.apache.commons.io.FileUtils;
import customskinloader.CustomSkinLoader;
import customskinloader.loader.ProfileLoader;
public class PluginLoader {
public static HashMap<String, ProfileLoader.IProfileLoader> loadPlugins() {
File pluginsDir = new File(CustomSkinLoader.DATA_DIR, "Plugins");
ArrayList<URL> urls = new ArrayList<URL>();
if (!pluginsDir.isDirectory()) {
pluginsDir.mkdirs();
} else {
for (File plugin : FileUtils.listFiles(pluginsDir, new String[] {"jar", "zip"}, false)) {
try {
urls.add(plugin.toURI().toURL());
CustomSkinLoader.logger.info("Found a jar or zip file: " + plugin.getName());
} catch (MalformedURLException ignored) {}
}
}
ServiceLoader<ICustomSkinLoaderPlugin> sl = ServiceLoader.load(ICustomSkinLoaderPlugin.class, new URLClassLoader(urls.toArray(new URL[0]), PluginLoader.class.getClassLoader()));
HashMap<String, ProfileLoader.IProfileLoader> profileLoaders = new HashMap<String, ProfileLoader.IProfileLoader>();
for (ICustomSkinLoaderPlugin cslPlugin : sl) {
ProfileLoader.IProfileLoader profileLoader = cslPlugin.getProfileLoader();
profileLoaders.put(profileLoader.getName().toLowerCase(), profileLoader);
CustomSkinLoader.logger.info("Add profile loader: " + profileLoader.getName());
}
return profileLoaders;
}
}
@@ -2,6 +2,7 @@ package customskinloader.profile;
import java.io.File; import java.io.File;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.apache.commons.codec.Charsets; import org.apache.commons.codec.Charsets;
@@ -38,8 +39,8 @@ public class DynamicSkullManager {
public long startTime; public long startTime;
public int period; public int period;
} }
private Map<GameProfile,SkullTexture> dynamicTextures=new HashMap<GameProfile,SkullTexture>(); private Map<GameProfile, SkullTexture> dynamicTextures = new ConcurrentHashMap<>();
private Map<GameProfile,Map<Type,MinecraftProfileTexture>> staticTextures=new HashMap<GameProfile,Map<Type,MinecraftProfileTexture>>(); private Map<GameProfile, Map<Type, MinecraftProfileTexture>> staticTextures = new ConcurrentHashMap<>();
private List<GameProfile> loadingList=new ArrayList<GameProfile>(); private List<GameProfile> loadingList=new ArrayList<GameProfile>();
private void parseGameProfile(GameProfile profile){ private void parseGameProfile(GameProfile profile){
@@ -13,109 +13,119 @@ import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
* Model Manager for 1.8 and higher. * Model Manager for 1.8 and higher.
* A manager to check if model is available. * A manager to check if model is available.
* It is the only class in package 'customskinloader' which has differences in different Minecraft version. * It is the only class in package 'customskinloader' which has differences in different Minecraft version.
*
* @since 13.1 * @since 13.1
*/ */
public class ModelManager0 { public class ModelManager0 {
public enum Model{ public enum Model {
SKIN_DEFAULT, SKIN_DEFAULT,
SKIN_SLIM, SKIN_SLIM,
CAPE, CAPE,
ELYTRA ELYTRA
} }
private static HashMap<String,Model> models=new HashMap<String,Model>();
private static Type typeElytra=null; private static HashMap<String, Model> models = new HashMap<String, Model>();
static{ private static Type typeElytra = null;
for(Type type:Type.values()){
if(type.ordinal()==2)//ELYTRA static {
typeElytra=type; for (Type type : Type.values()) {
if (type.ordinal() == 2)//ELYTRA
typeElytra = type;
} }
models.put("default", Model.SKIN_DEFAULT); models.put("default", Model.SKIN_DEFAULT);
models.put("slim", Model.SKIN_SLIM); models.put("slim", Model.SKIN_SLIM);
models.put("cape", Model.CAPE); models.put("cape", Model.CAPE);
if(typeElytra!=null) if (typeElytra != null) {
models.put("elytra", Model.ELYTRA); models.put("elytra", Model.ELYTRA);
models.put("elytron", Model.ELYTRA);
}
} }
/** /**
* Get enum for the model. * Get enum for the model.
*
* @param model - string model * @param model - string model
* @since 14.5 * @since 14.5
*/ */
public static Model getEnumModel(String model){ public static Model getEnumModel(String model) {
return models.get(model); return models.get(model);
} }
/** /**
* Check if model is skin. * Check if model is skin.
* @since 14.5 *
* */
public static boolean isSkin(Model model){
return model==Model.SKIN_DEFAULT||model==Model.SKIN_SLIM;
}
/**
* Check if elytra is supported.
* @since 14.5 * @since 14.5
*/ */
public static boolean isElytraSupported(){ public static boolean isSkin(Model model) {
return typeElytra!=null; return model == Model.SKIN_DEFAULT || model == Model.SKIN_SLIM;
} }
/**
* Check if elytra is supported.
*
* @since 14.5
*/
public static boolean isElytraSupported() {
return typeElytra != null;
}
/** /**
* Parse hashMapProfile to UserProfile * Parse hashMapProfile to UserProfile
*
* @param profile - hashMapProfile (HashMap<String,MinecraftProfileTexture>) * @param profile - hashMapProfile (HashMap<String,MinecraftProfileTexture>)
* @return profile - UserProfile instance * @return profile - UserProfile instance
* @since 13.1 * @since 13.1
*/ */
public static UserProfile toUserProfile(Map<Type, MinecraftProfileTexture> profile){ public static UserProfile toUserProfile(Map<Type, MinecraftProfileTexture> profile) {
UserProfile userProfile=new UserProfile(); UserProfile userProfile = new UserProfile();
if(profile==null) if (profile == null)
return userProfile; return userProfile;
MinecraftProfileTexture skin = profile.get(Type.SKIN); MinecraftProfileTexture skin = profile.get(Type.SKIN);
userProfile.skinUrl= skin==null?null:skin.getUrl();//Avoid NullPointerException userProfile.skinUrl = skin == null ? null : skin.getUrl();//Avoid NullPointerException
userProfile.model= skin==null?null:skin.getMetadata("model"); userProfile.model = skin == null ? null : skin.getMetadata("model");
if(StringUtils.isEmpty(userProfile.model)) if (StringUtils.isEmpty(userProfile.model))
userProfile.model="default"; userProfile.model = "default";
MinecraftProfileTexture cape = profile.get(Type.CAPE); MinecraftProfileTexture cape = profile.get(Type.CAPE);
userProfile.capeUrl= cape==null?null:cape.getUrl(); userProfile.capeUrl = cape == null ? null : cape.getUrl();
return userProfile; return userProfile;
} }
/** /**
* Parse UserProfile to hashMapProfile * Parse UserProfile to hashMapProfile
*
* @param profile - UserProfile instance * @param profile - UserProfile instance
* @return profile - hashMapProfile (HashMap<String,MinecraftProfileTexture>) * @return profile - hashMapProfile (HashMap<String,MinecraftProfileTexture>)
* @since 13.1 * @since 13.1
*/ */
public static Map<Type, MinecraftProfileTexture> fromUserProfile(UserProfile profile){ public static Map<Type, MinecraftProfileTexture> fromUserProfile(UserProfile profile) {
Map<Type, MinecraftProfileTexture> map=Maps.newHashMap(); Map<Type, MinecraftProfileTexture> map = Maps.newHashMap();
if(profile==null) if (profile == null)
return map; return map;
if(profile.skinUrl!=null){ if (profile.skinUrl != null) {
Map<String,String> metadata = null; Map<String, String> metadata = null;
if("slim".equals(profile.model) || "auto".equals(profile.model)){ if ("slim".equals(profile.model) || "auto".equals(profile.model)) {
metadata = Maps.newHashMap(); metadata = Maps.newHashMap();
metadata.put("model", profile.model); metadata.put("model", profile.model);
} }
map.put(Type.SKIN, getProfileTexture(profile.skinUrl,metadata)); map.put(Type.SKIN, getProfileTexture(profile.skinUrl, metadata));
} }
if(profile.capeUrl!=null) if (profile.capeUrl != null)
map.put(Type.CAPE, getProfileTexture(profile.capeUrl,null)); map.put(Type.CAPE, getProfileTexture(profile.capeUrl, null));
if(typeElytra!=null && profile.elytraUrl!=null) if (typeElytra != null && profile.elytraUrl != null)
map.put(typeElytra, getProfileTexture(profile.elytraUrl,null)); map.put(typeElytra, getProfileTexture(profile.elytraUrl, null));
return map; return map;
} }
/** /**
* Parse url to MinecraftProfileTexture * Parse url to MinecraftProfileTexture
* *
* @param url - textureUrl * @param url - textureUrl
* metadata - metadata * @param metadata - metadata
* @return MinecraftProfileTexture * @return MinecraftProfileTexture
* @since 14.5 * @since 14.5
*/ */
public static MinecraftProfileTexture getProfileTexture(String url,Map<String,String> metadata){ public static MinecraftProfileTexture getProfileTexture(String url, Map<String, String> metadata) {
return new MinecraftProfileTexture(url,metadata); return new MinecraftProfileTexture(url, metadata);
} }
} }
@@ -2,6 +2,8 @@ package customskinloader.profile;
import java.io.File; import java.io.File;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
@@ -11,8 +13,8 @@ import customskinloader.utils.TimeUtil;
public class ProfileCache { public class ProfileCache {
public static File PROFILE_CACHE_DIR=new File(CustomSkinLoader.DATA_DIR,"ProfileCache"); public static File PROFILE_CACHE_DIR=new File(CustomSkinLoader.DATA_DIR,"ProfileCache");
private HashMap<String,CachedProfile> cachedProfiles=new HashMap<String,CachedProfile>(); private Map<String, CachedProfile> cachedProfiles = new ConcurrentHashMap<>();
private HashMap<String,UserProfile> localProfiles=new HashMap<String,UserProfile>(); private Map<String, UserProfile> localProfiles = new ConcurrentHashMap<>();
@SuppressWarnings("ResultOfMethodCallIgnored") @SuppressWarnings("ResultOfMethodCallIgnored")
public ProfileCache(){ public ProfileCache(){
@@ -23,6 +25,10 @@ public class ProfileCache {
public boolean isExist(String username){ public boolean isExist(String username){
return cachedProfiles.containsKey(username.toLowerCase()); return cachedProfiles.containsKey(username.toLowerCase());
} }
public boolean isLoading(String username) {
CachedProfile cp=cachedProfiles.get(username.toLowerCase());
return cp != null && cp.loading;
}
public boolean isReady(String username){ public boolean isReady(String username){
CachedProfile cp=cachedProfiles.get(username.toLowerCase()); CachedProfile cp=cachedProfiles.get(username.toLowerCase());
return cp != null && (cp.loading || cp.expiryTime > TimeUtil.getCurrentUnixTimestamp()); return cp != null && (cp.loading || cp.expiryTime > TimeUtil.getCurrentUnixTimestamp());
@@ -12,7 +12,6 @@ import java.util.regex.Pattern;
import java.util.zip.GZIPInputStream; import java.util.zip.GZIPInputStream;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.io.Charsets;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@@ -20,119 +19,143 @@ import org.apache.commons.lang3.StringUtils;
import customskinloader.CustomSkinLoader; import customskinloader.CustomSkinLoader;
public class HttpRequestUtil { public class HttpRequestUtil {
public static class HttpRequest{ public static class HttpRequest {
public String url; public String url;
public String userAgent=null; public String userAgent = null;
public String payload=null; public String payload = null;
public boolean loadContent=true; public boolean loadContent = true;
public boolean checkPNG=false; public boolean checkPNG = false;
public int cacheTime=600;//-1=No Cache 0=Always Cache t=Default Cache Time(second) public int cacheTime = 600;//-1=No Cache 0=Always Cache t=Default Cache Time(second)
public File cacheFile=null;//Default Cache File public File cacheFile = null;//Default Cache File
public HttpRequest(String url){ public HttpRequest(String url) {
this.url=url; this.url = url;
} }
public HttpRequest setUserAgent(String userAgent){
this.userAgent=userAgent; public HttpRequest setUserAgent(String userAgent) {
this.userAgent = userAgent;
return this; return this;
} }
public HttpRequest setPayload(String payload){
this.payload=payload; public HttpRequest setPayload(String payload) {
this.payload = payload;
return this; return this;
} }
public HttpRequest setLoadContent(boolean loadContent){
this.loadContent=loadContent; public HttpRequest setLoadContent(boolean loadContent) {
this.loadContent = loadContent;
return this; return this;
} }
public HttpRequest setCheckPNG(boolean checkPNG){
this.checkPNG=checkPNG; public HttpRequest setCheckPNG(boolean checkPNG) {
this.checkPNG = checkPNG;
return this; return this;
} }
public HttpRequest setCacheTime(int cacheTime){
this.cacheTime=cacheTime; public HttpRequest setCacheTime(int cacheTime) {
this.cacheTime = cacheTime;
return this; return this;
} }
public HttpRequest setCacheFile(File cacheFile){
this.cacheFile=cacheFile; public HttpRequest setCacheFile(File cacheFile) {
this.cacheFile = cacheFile;
return this; return this;
} }
} }
public static class HttpResponce{
public String content=null; public static class HttpResponce {
public int responceCode=-1; public String content = null;
public boolean success=false; public int responceCode = -1;
public boolean fromCache=false; public boolean success = false;
public boolean fromCache = false;
} }
public static class CacheInfo{
public static class CacheInfo {
public String url; public String url;
public String etag=null; public String etag = null;
public long lastModified=-1;//ms public long lastModified = -1;//ms
public long expire=-1;//UNIX timestamp public long expire = -1;//UNIX timestamp
} }
public static final File CACHE_DIR=new File(CustomSkinLoader.DATA_DIR,"caches");
public static final File CACHE_DIR = new File(CustomSkinLoader.DATA_DIR, "caches");
public static HttpResponce makeHttpRequest(HttpRequest request){
public static HttpResponce makeHttpRequest(HttpRequest request) {
return makeHttpRequest(request, 0); return makeHttpRequest(request, 0);
} }
public static HttpResponce makeHttpRequest(HttpRequest request, int redirectTime){ public static HttpResponce makeHttpRequest(HttpRequest request, int redirectTime) {
try{ try {
CustomSkinLoader.logger.debug("Try to request '"+request.url+(request.userAgent==null?"'.":"' with user agent '"+request.userAgent+"'.")); if(request.url.contains("{ABORT}")){
CustomSkinLoader.logger.info("ABORT tag found in url, request has been aborted.");
return new HttpResponce();
}
CustomSkinLoader.logger.debug("Try to request '" + request.url + (request.userAgent == null ? "'." : "' with user agent '" + request.userAgent + "'."));
//Check Cache //Check Cache
if(StringUtils.isNotEmpty(request.payload)) if (StringUtils.isNotEmpty(request.payload))
request.cacheTime=-1;//No Cache request.cacheTime = -1;//No Cache
File cacheInfoFile=null; File cacheInfoFile = null;
CacheInfo cacheInfo=new CacheInfo(); CacheInfo cacheInfo = new CacheInfo();
if(request.cacheFile==null && request.cacheTime>=0){ if (request.cacheFile == null && request.cacheTime >= 0) {
String hash=DigestUtils.sha1Hex(request.url); String hash = DigestUtils.sha1Hex(request.url);
request.cacheFile=new File(CACHE_DIR,hash); request.cacheFile = new File(CACHE_DIR, hash);
cacheInfoFile=new File(CACHE_DIR,hash+".json"); cacheInfoFile = new File(CACHE_DIR, hash + ".json");
} }
if(request.cacheTime==0 && request.cacheFile.isFile()) if (request.cacheTime == 0 && request.cacheFile.isFile())
return loadFromCache(request,new HttpResponce()); return loadFromCache(request, new HttpResponce());
if(cacheInfoFile!=null&&cacheInfoFile.isFile()){ if (cacheInfoFile != null && cacheInfoFile.isFile()) {
String json=FileUtils.readFileToString(cacheInfoFile, "UTF-8"); String json = FileUtils.readFileToString(cacheInfoFile, "UTF-8");
if(StringUtils.isNotEmpty(json)) if (StringUtils.isNotEmpty(json))
cacheInfo=CustomSkinLoader.GSON.fromJson(json, CacheInfo.class); cacheInfo = CustomSkinLoader.GSON.fromJson(json, CacheInfo.class);
if(cacheInfo==null) if (cacheInfo == null)
cacheInfo=new CacheInfo(); cacheInfo = new CacheInfo();
if(cacheInfo.expire>=TimeUtil.getCurrentUnixTimestamp()) if (cacheInfo.expire >= TimeUtil.getCurrentUnixTimestamp())
return loadFromCache(request,new HttpResponce(),cacheInfo.expire); return loadFromCache(request, new HttpResponce(), cacheInfo.expire);
} }
//Init Connection //Init Connection
String url=new URI(request.url).toASCIIString(); URL rawUrl = new URL(request.url);
if(!url.equalsIgnoreCase(request.url)) URI uri = new URI(
CustomSkinLoader.logger.debug("Encoded URL: "+url); rawUrl.getProtocol(),
rawUrl.getUserInfo(),
rawUrl.getHost(),
rawUrl.getPort(),
rawUrl.getPath(),
rawUrl.getQuery(),
rawUrl.getRef()
);
String url = uri.toASCIIString();
if (!url.equalsIgnoreCase(request.url))
CustomSkinLoader.logger.debug("Encoded URL: " + url);
HttpURLConnection c = (HttpURLConnection) (new URL(url)).openConnection(); HttpURLConnection c = (HttpURLConnection) (new URL(url)).openConnection();
c.setReadTimeout(1000 * 10); c.setReadTimeout(1000 * 10);
c.setConnectTimeout(1000 * 10); c.setConnectTimeout(1000 * 10);
c.setDoInput(true); c.setDoInput(true);
c.setUseCaches(false); c.setUseCaches(false);
c.setInstanceFollowRedirects(true); c.setInstanceFollowRedirects(true);
//Make Connection //Make Connection
if(cacheInfo.lastModified>=0) if (cacheInfo.lastModified >= 0)
c.setIfModifiedSince(cacheInfo.lastModified); c.setIfModifiedSince(cacheInfo.lastModified);
if(cacheInfo.etag!=null) if (cacheInfo.etag != null)
c.setRequestProperty("If-None-Match",cacheInfo.etag); c.setRequestProperty("If-None-Match", cacheInfo.etag);
c.setRequestProperty("Accept-Encoding","gzip"); c.setRequestProperty("Accept-Encoding", "gzip");
if(request.userAgent!=null) if (request.userAgent != null)
c.setRequestProperty("User-Agent",request.userAgent); c.setRequestProperty("User-Agent", request.userAgent);
if(StringUtils.isNotEmpty(request.payload)){ if (StringUtils.isNotEmpty(request.payload)) {
CustomSkinLoader.logger.info("Payload: "+request.payload); CustomSkinLoader.logger.info("Payload: " + request.payload);
c.setRequestProperty("Content-Type", "application/json");
c.setDoOutput(true); c.setDoOutput(true);
OutputStream os=c.getOutputStream(); OutputStream os = c.getOutputStream();
IOUtils.write(request.payload, os, "UTF-8"); IOUtils.write(request.payload, os, "UTF-8");
IOUtils.closeQuietly(os); IOUtils.closeQuietly(os);
} }
c.connect(); c.connect();
//Check Connection //Check Connection
HttpResponce responce=new HttpResponce(); HttpResponce responce = new HttpResponce();
responce.responceCode=c.getResponseCode(); responce.responceCode = c.getResponseCode();
int res = c.getResponseCode(); int res = c.getResponseCode();
if (res / 100 == 4 || res / 100 == 5) {//Failed if (res / 100 == 4 || res / 100 == 5) {//Failed
CustomSkinLoader.logger.debug("Failed to request (Response Code: " + res + ")"); CustomSkinLoader.logger.debug("Failed to request (Response Code: " + res + ")");
@@ -142,7 +165,7 @@ public class HttpRequestUtil {
//Redirect //Redirect
if (redirectTime >= 4) { if (redirectTime >= 4) {
CustomSkinLoader.logger.debug("Failed to request (Too many redirection)"); CustomSkinLoader.logger.debug("Failed to request (Too many redirection)");
return responce; return responce;
} }
request.url = c.getHeaderField("Location");//Get redirecting location request.url = c.getHeaderField("Location");//Get redirecting location
if (request.url == null) { if (request.url == null) {
@@ -152,82 +175,86 @@ public class HttpRequestUtil {
CustomSkinLoader.logger.debug("Redirect to: " + request.url); CustomSkinLoader.logger.debug("Redirect to: " + request.url);
return makeHttpRequest(request, redirectTime + 1);//Recursion return makeHttpRequest(request, redirectTime + 1);//Recursion
} }
responce.success=true; responce.success = true;
CustomSkinLoader.logger.debug("Successfully request (Response Code: " + res + " , Content Length: " + c.getContentLength() + ")"); CustomSkinLoader.logger.debug("Successfully request (Response Code: " + res + " , Content Length: " + c.getContentLength() + ")");
if(responce.responceCode==HttpURLConnection.HTTP_NOT_MODIFIED) if (responce.responceCode == HttpURLConnection.HTTP_NOT_MODIFIED)
return loadFromCache(request,responce); return loadFromCache(request, responce);
if (responce.responceCode == HttpURLConnection.HTTP_NO_CONTENT) if (responce.responceCode == HttpURLConnection.HTTP_NO_CONTENT)
request.cacheTime = 3600; request.cacheTime = 3600;
//Load Content //Load Content
InputStream is="gzip".equals(c.getContentEncoding())?new GZIPInputStream(c.getInputStream()):c.getInputStream(); InputStream is = "gzip".equals(c.getContentEncoding()) ? new GZIPInputStream(c.getInputStream()) : c.getInputStream();
byte [] bytes = IOUtils.toByteArray(is); byte[] bytes = IOUtils.toByteArray(is);
if(request.checkPNG&&(bytes.length<=4||bytes[1]!=(byte)'P'||bytes[2]!=(byte)'N'||bytes[3]!=(byte)'G')){ if (request.checkPNG && (bytes.length <= 4 || bytes[1] != (byte) 'P' || bytes[2] != (byte) 'N' || bytes[3] != (byte) 'G')) {
CustomSkinLoader.logger.debug("Failed to request (Not Standard PNG)"); CustomSkinLoader.logger.debug("Failed to request (Not Standard PNG)");
responce.success=false; responce.success = false;
return responce; return responce;
} }
if(request.cacheFile!=null){ if (request.cacheFile != null) {
FileUtils.writeByteArrayToFile(request.cacheFile, bytes); FileUtils.writeByteArrayToFile(request.cacheFile, bytes);
if(cacheInfoFile!=null){ if (cacheInfoFile != null) {
cacheInfo.url=request.url; cacheInfo.url = request.url;
cacheInfo.etag=c.getHeaderField("ETag"); cacheInfo.etag = c.getHeaderField("ETag");
cacheInfo.lastModified=c.getLastModified(); cacheInfo.lastModified = c.getLastModified();
cacheInfo.expire=getExpire(c,request.cacheTime); cacheInfo.expire = getExpire(c, request.cacheTime);
FileUtils.write(cacheInfoFile, CustomSkinLoader.GSON.toJson(cacheInfo), "UTF-8"); FileUtils.write(cacheInfoFile, CustomSkinLoader.GSON.toJson(cacheInfo), "UTF-8");
} }
CustomSkinLoader.logger.debug("Saved to cache (Length: "+request.cacheFile.length()+" , Path: '"+request.cacheFile.getAbsolutePath()+"' , Expire: "+cacheInfo.expire+")"); CustomSkinLoader.logger.debug("Saved to cache (Length: " + request.cacheFile.length() + " , Path: '" + request.cacheFile.getAbsolutePath() + "' , Expire: " + cacheInfo.expire + ")");
} }
if(!request.loadContent) if (!request.loadContent)
return responce; return responce;
responce.content=new String(bytes, "UTF-8"); responce.content = new String(bytes, "UTF-8");
CustomSkinLoader.logger.debug("Content: "+responce.content); CustomSkinLoader.logger.debug("Content: " + responce.content);
return responce; return responce;
}catch(Exception e){ } catch (Exception e) {
CustomSkinLoader.logger.debug("Failed to request (Exception: "+e.toString()+")"); CustomSkinLoader.logger.debug("Failed to request (Exception: " + e.toString() + ")");
return loadFromCache(request,new HttpResponce()); return loadFromCache(request, new HttpResponce());
} }
} }
public static File getCacheFile(String hash){ public static File getCacheFile(String hash) {
return new File(CACHE_DIR,hash); return new File(CACHE_DIR, hash);
} }
private static HttpResponce loadFromCache(HttpRequest request,HttpResponce responce){
return loadFromCache(request,responce,0); private static HttpResponce loadFromCache(HttpRequest request, HttpResponce responce) {
return loadFromCache(request, responce, 0);
} }
private static HttpResponce loadFromCache(HttpRequest request,HttpResponce responce,long expireTime){
if(request.cacheFile==null||!request.cacheFile.isFile()) private static HttpResponce loadFromCache(HttpRequest request, HttpResponce responce, long expireTime) {
if (request.cacheFile == null || !request.cacheFile.isFile())
return responce; return responce;
CustomSkinLoader.logger.debug("Cache file found (Length: "+request.cacheFile.length()+" , Path: '"+request.cacheFile.getAbsolutePath()+"' , Expire: "+expireTime+"')"); CustomSkinLoader.logger.debug("Cache file found (Length: " + request.cacheFile.length() + " , Path: '" + request.cacheFile.getAbsolutePath() + "' , Expire: " + expireTime + "')");
responce.fromCache=true; responce.fromCache = true;
responce.success=true; responce.success = true;
if(!request.loadContent) if (!request.loadContent)
return responce; return responce;
CustomSkinLoader.logger.info("Try to load from cache '"+request.cacheFile.getAbsolutePath()+"'."); CustomSkinLoader.logger.info("Try to load from cache '" + request.cacheFile.getAbsolutePath() + "'.");
try { try {
responce.content=FileUtils.readFileToString(request.cacheFile, "UTF-8"); responce.content = FileUtils.readFileToString(request.cacheFile, "UTF-8");
CustomSkinLoader.logger.debug("Successfully load from cache"); CustomSkinLoader.logger.debug("Successfully load from cache");
CustomSkinLoader.logger.debug("Content: "+responce.content); CustomSkinLoader.logger.debug("Content: " + responce.content);
} catch (IOException e) { } catch (IOException e) {
CustomSkinLoader.logger.debug("Failed to load from cache (Exception: "+e.toString()+")"); CustomSkinLoader.logger.debug("Failed to load from cache (Exception: " + e.toString() + ")");
responce.success=false; responce.success = false;
} }
return responce; return responce;
} }
private final static Pattern MAX_AGE_PATTERN = Pattern.compile(".*?max-age=(\\d+).*?"); private final static Pattern MAX_AGE_PATTERN = Pattern.compile(".*?max-age=(\\d+).*?");
private static long getExpire(HttpURLConnection connection,int cacheTime){
String cacheControl=connection.getHeaderField("Cache-Control"); private static long getExpire(HttpURLConnection connection, int cacheTime) {
if(StringUtils.isNotEmpty(cacheControl)){ String cacheControl = connection.getHeaderField("Cache-Control");
Matcher m=MAX_AGE_PATTERN.matcher(cacheControl); if (StringUtils.isNotEmpty(cacheControl)) {
if(m.matches()) Matcher m = MAX_AGE_PATTERN.matcher(cacheControl);
if (m.matches())
return TimeUtil.getUnixTimestamp(Long.parseLong(m.group(m.groupCount()))); return TimeUtil.getUnixTimestamp(Long.parseLong(m.group(m.groupCount())));
} }
long expires=connection.getExpiration(); long expires = connection.getExpiration();
if(expires>0) if (expires > 0)
return expires/1000; return expires / 1000;
return TimeUtil.getUnixTimestampRandomDelay(cacheTime==0 ? 86400 : cacheTime); return TimeUtil.getUnixTimestampRandomDelay(cacheTime == 0 ? 86400 : cacheTime);
} }
} }
@@ -24,11 +24,11 @@ public class JavaUtil {
LinkedList<URL> urls = new LinkedList<URL>(); LinkedList<URL> urls = new LinkedList<URL>();
for (String ele : elements) { for (String ele : elements) {
try { try {
urls.add(new URL(ele)); urls.add(new File(ele).toURI().toURL());
} catch (Exception ignored) { } catch (Exception ignored) {
} }
} }
return (URL[]) urls.toArray(); return urls.toArray(new URL[0]);
} }
} }
} }
@@ -1,125 +1,176 @@
package customskinloader.utils; package customskinloader.utils;
import java.io.File; import java.io.File;
import java.lang.reflect.Constructor;
import java.net.URL; import java.net.URL;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.apache.commons.lang3.StringUtils;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.MinecraftSessionService; import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.IImageBuffer;
import net.minecraft.client.renderer.ThreadDownloadImageData;
import net.minecraft.client.renderer.texture.SimpleTexture;
import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.resources.SkinManager;
import net.minecraft.util.ResourceLocation;
import org.apache.commons.lang3.StringUtils;
/** /**
* @author Alexander Xia * @author Alexander Xia
* @since 13.6 * @since 13.6
*
*/ */
public class MinecraftUtil { public class MinecraftUtil {
public static File getMinecraftDataDir(){ public static File getMinecraftDataDir() {
return Minecraft.getMinecraft().gameDir; return Minecraft.getMinecraft().gameDir;
} }
public static MinecraftSessionService getSessionService(){
return Minecraft.getMinecraft().getSessionService(); public static TextureManager getTextureManager() {
}
public static TextureManager getTextureManager(){
return Minecraft.getMinecraft().getTextureManager(); return Minecraft.getMinecraft().getTextureManager();
} }
private static ArrayList<String> minecraftVersion=new ArrayList<String>(); public static SkinManager getSkinManager() {
private static String minecraftMainVersion=null; return Minecraft.getMinecraft().getSkinManager();
}
private static boolean is_1_15_plus = false;
private static Constructor<?> constructor = null;
public static SimpleTexture createThreadDownloadImageData(File cacheFileIn, String imageUrlIn, ResourceLocation textureResourceLocation, IImageBuffer imageBufferIn, MinecraftProfileTexture.Type textureType) {
if (constructor == null) {
Class<?> c;
try {
c = Class.forName("net.minecraft.client.renderer.texture.ThreadDownloadImageData", false, MinecraftUtil.class.getClassLoader()); // Forge 1.13
} catch (ClassNotFoundException e1) {
try {
c = Class.forName("net.minecraft.client.renderer.texture.DownloadingTexture", false, MinecraftUtil.class.getClassLoader()); // Forge 1.14+
} catch (ClassNotFoundException e2) {
c = ThreadDownloadImageData.class; // Forge 1.12- or Fabric or Vanilla
}
}
try {
constructor = c.getConstructor(File.class, String.class, ResourceLocation.class, boolean.class, Runnable.class); // For 1.15+
is_1_15_plus = true;
} catch (NoSuchMethodException e1) {
try {
constructor = c.getConstructor(File.class, String.class, ResourceLocation.class, IImageBuffer.class); // For 1.15-
} catch (NoSuchMethodException e2) {
throw new RuntimeException(e2);
}
}
}
try {
if (is_1_15_plus) {
return (SimpleTexture) constructor.newInstance(cacheFileIn, imageUrlIn, textureResourceLocation, textureType == MinecraftProfileTexture.Type.SKIN, imageBufferIn);
} else {
return (SimpleTexture) constructor.newInstance(cacheFileIn, imageUrlIn, textureResourceLocation, imageBufferIn);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private static ArrayList<String> minecraftVersion = new ArrayList<String>();
private static String minecraftMainVersion = null;
private final static Pattern MINECRAFT_VERSION_PATTERN = Pattern.compile(".*?(\\d+\\.\\d+[\\.]?\\d*).*?"); private final static Pattern MINECRAFT_VERSION_PATTERN = Pattern.compile(".*?(\\d+\\.\\d+[\\.]?\\d*).*?");
public static ArrayList<String> getMinecraftVersions(){
if(minecraftVersion!=null&&!minecraftVersion.isEmpty()) public static ArrayList<String> getMinecraftVersions() {
if (minecraftVersion != null && !minecraftVersion.isEmpty())
return minecraftVersion; return minecraftVersion;
testProbe(); testProbe();
return minecraftVersion; return minecraftVersion;
} }
public static String getMinecraftVersionText(){
StringBuilder sb=new StringBuilder(); public static String getMinecraftVersionText() {
for(String version:getMinecraftVersions()) StringBuilder sb = new StringBuilder();
for (String version : getMinecraftVersions())
sb.append(version).append(" "); sb.append(version).append(" ");
return StringUtils.trim(sb.toString()); return StringUtils.trim(sb.toString());
} }
public static String getMinecraftMainVersion(){
if(minecraftMainVersion!=null) public static String getMinecraftMainVersion() {
if (minecraftMainVersion != null)
return minecraftMainVersion; return minecraftMainVersion;
for(String version:getMinecraftVersions()){ for (String version : getMinecraftVersions()) {
Matcher m = null; Matcher m = null;
try{ try {
m=MINECRAFT_VERSION_PATTERN.matcher(version); m = MINECRAFT_VERSION_PATTERN.matcher(version);
}catch(Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
if(m==null || !m.matches()) if (m == null || !m.matches())
continue; continue;
minecraftMainVersion=m.group(m.groupCount()); minecraftMainVersion = m.group(m.groupCount());
break; break;
} }
return minecraftMainVersion; return minecraftMainVersion;
} }
// (domain|ip)(:port) // (domain|ip)(:port)
public static String getServerAddress(){ public static String getServerAddress() {
net.minecraft.client.multiplayer.ServerData data = Minecraft.getMinecraft().getCurrentServerData(); net.minecraft.client.multiplayer.ServerData data = Minecraft.getMinecraft().getCurrentServerData();
if(data==null)//Single Player if (data == null)//Single Player
return null; return null;
return data.serverIP; return data.serverIP;
} }
// ip:port // ip:port
public static String getStandardServerAddress(){ public static String getStandardServerAddress() {
return HttpUtil0.parseAddress(getServerAddress()); return HttpUtil0.parseAddress(getServerAddress());
} }
public static boolean isLanServer(){
public static boolean isLanServer() {
return HttpUtil0.isLanServer(getStandardServerAddress()); return HttpUtil0.isLanServer(getStandardServerAddress());
} }
public static String getCurrentUsername(){
public static String getCurrentUsername() {
return Minecraft.getMinecraft().getSession().getProfile().getName(); return Minecraft.getMinecraft().getSession().getProfile().getName();
} }
private final static Pattern MINECRAFT_CORE_FILE_PATTERN = Pattern.compile("^(.*?)/versions/([^\\/\\\\]*?)/([^\\/\\\\]*?).jar$"); private final static Pattern MINECRAFT_CORE_FILE_PATTERN = Pattern.compile("^(.*?)/versions/([^\\/\\\\]*?)/([^\\/\\\\]*?).jar$");
private static void testProbe(){
private static void testProbe() {
minecraftVersion.clear(); minecraftVersion.clear();
URL urls[] = JavaUtil.getClasspath(); URL urls[] = JavaUtil.getClasspath();
for(URL url:urls){ for (URL url : urls) {
Matcher m = null; Matcher m = null;
try{ try {
m=MINECRAFT_CORE_FILE_PATTERN.matcher(URLDecoder.decode(url.getPath(),"UTF-8")); m = MINECRAFT_CORE_FILE_PATTERN.matcher(URLDecoder.decode(url.getPath(), "UTF-8"));
}catch(Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
if(m==null || !m.matches()) if (m == null || !m.matches())
continue; continue;
minecraftVersion.add(m.group(2)); minecraftVersion.add(m.group(2));
} }
} }
public static boolean isCoreFile(URL url) { public static boolean isCoreFile(URL url) {
return regexMatch(url, MINECRAFT_CORE_FILE_PATTERN); return regexMatch(url, MINECRAFT_CORE_FILE_PATTERN);
} }
private final static Pattern LIBRARY_FILE_PATTERN = Pattern.compile("^(.*?)/libraries/(.*?)/([^\\/\\\\]*?).jar$"); private final static Pattern LIBRARY_FILE_PATTERN = Pattern.compile("^(.*?)/libraries/(.*?)/([^\\/\\\\]*?).jar$");
public static boolean isLibraryFile(URL url) { public static boolean isLibraryFile(URL url) {
return regexMatch(url, LIBRARY_FILE_PATTERN); return regexMatch(url, LIBRARY_FILE_PATTERN);
} }
private static boolean regexMatch(URL url, Pattern p) { private static boolean regexMatch(URL url, Pattern p) {
Matcher m; Matcher m;
try { try {
m=p.matcher(URLDecoder.decode(url.getPath(), "UTF-8")); m = p.matcher(URLDecoder.decode(url.getPath(), "UTF-8"));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return false; return false;
} }
return m.matches(); return m.matches();
} }
public static String getCredential(GameProfile profile) { public static String getCredential(GameProfile profile) {
return (profile==null || profile.hashCode()==0) ? null : return (profile == null || profile.hashCode() == 0) ? null :
(profile.getId()==null ? profile.getName() : String.format("%s-%s", profile.getName(),profile.getId())); (profile.getId() == null ? profile.getName() : String.format("%s-%s", profile.getName(), profile.getId()));
} }
} }
@@ -0,0 +1,18 @@
package net.minecraft.client.renderer;
import java.awt.image.BufferedImage;
import net.minecraft.client.renderer.texture.NativeImage;
public interface IImageBuffer extends Runnable {
BufferedImage parseUserSkin(BufferedImage image);
NativeImage func_195786_a(NativeImage image);
void skinAvailable();
@Override
default void run() {
this.skinAvailable();
}
}
@@ -0,0 +1,16 @@
package net.minecraft.client.renderer.texture;
import java.io.File;
import net.minecraft.client.renderer.IImageBuffer;
import net.minecraft.util.ResourceLocation;
public class DownloadingTexture extends SimpleTexture {
public DownloadingTexture(File cacheFileIn, String imageUrlIn, ResourceLocation textureResourceLocation, IImageBuffer imageBufferIn) {
super(textureResourceLocation);
}
public DownloadingTexture(File cacheFileIn, String imageUrlIn, ResourceLocation textureResourceLocation, boolean legacySkinIn, Runnable processTaskIn) {
super(textureResourceLocation);
}
}
@@ -0,0 +1,5 @@
package net.minecraft.client.renderer.texture;
// exclude
public interface Texture {
}
@@ -0,0 +1,12 @@
package net.minecraft.client.renderer.texture;
import java.io.File;
import net.minecraft.client.renderer.IImageBuffer;
import net.minecraft.util.ResourceLocation;
public class ThreadDownloadImageData extends SimpleTexture {
public ThreadDownloadImageData(File cacheFileIn, String imageUrlIn, ResourceLocation textureResourceLocation, IImageBuffer imageBufferIn) {
super(textureResourceLocation);
}
}
+50
View File
@@ -0,0 +1,50 @@
customskinloader/fake/itf/IFakeTextureManager_1 customskinloader/fake/itf/IFakeTextureManager_1
func_229263_a_ (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/Texture;)Z method_4616
func_229267_b_ (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/renderer/texture/Texture; method_4619
customskinloader/fake/itf/IFakeTextureManager_2 customskinloader/fake/itf/IFakeTextureManager_2
func_229263_a_ (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/Texture;)V method_4616
net/minecraft/client/gui/GuiPlayerTabOverlay net/minecraft/class_355
net/minecraft/client/gui/spectator/PlayerMenuObject net/minecraft/class_530
net/minecraft/client/Minecraft net/minecraft/class_310
field_71412_D field_1697
func_110432_I ()Lnet/minecraft/util/Session; method_1548
func_110434_K ()Lnet/minecraft/client/renderer/texture/TextureManager; method_1531
func_147104_D ()Lnet/minecraft/client/multiplayer/ServerData; method_1558
func_152342_ad ()Lnet/minecraft/client/resources/SkinManager; method_1582
func_152347_ac ()Lcom/mojang/authlib/minecraft/MinecraftSessionService; method_1495
func_71410_x ()Lnet/minecraft/client/Minecraft; method_1551
net/minecraft/client/multiplayer/ServerData net/minecraft/class_642
field_78845_b field_3761
net/minecraft/client/renderer/IImageBuffer net/minecraft/class_760
func_152634_a ()V method_3238
func_195786_a (Lnet/minecraft/client/renderer/texture/NativeImage;)Lnet/minecraft/client/renderer/texture/NativeImage; method_3237
net/minecraft/client/renderer/ThreadDownloadImageData net/minecraft/class_1046
net/minecraft/client/renderer/texture/DownloadingTexture net/minecraft/class_1046
net/minecraft/client/renderer/texture/ITextureObject net/minecraft/class_1062
net/minecraft/client/renderer/texture/NativeImage net/minecraft/class_1011
func_195699_a (IIIIIIZZ)V method_4304
func_195700_a (III)V method_4305
func_195702_a ()I method_4307
func_195703_a (Lnet/minecraft/client/renderer/texture/NativeImage;)V method_4317
func_195709_a (II)I method_4315
func_195714_b ()I method_4323
func_195715_a (IIIII)V method_4326
net/minecraft/client/renderer/texture/SimpleTexture net/minecraft/class_1049
net/minecraft/client/renderer/texture/Texture net/minecraft/class_1044
net/minecraft/client/renderer/texture/TextureManager net/minecraft/class_1060
func_110579_a (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/ITextureObject;)Z method_4616
func_110581_b (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/renderer/texture/ITextureObject; method_4619
net/minecraft/client/renderer/texture/ThreadDownloadImageData net/minecraft/class_1046
net/minecraft/client/resources/DefaultPlayerSkin net/minecraft/class_1068
func_177334_a (Ljava/util/UUID;)Lnet/minecraft/util/ResourceLocation; method_4648
func_177335_a ()Lnet/minecraft/util/ResourceLocation; method_4649
net/minecraft/client/resources/SkinManager net/minecraft/class_1071
func_152790_a (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V method_4652
net/minecraft/client/resources/SkinManager$SkinAvailableCallback net/minecraft/class_1071$class_1072
func_180521_a (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/util/ResourceLocation;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;)V onSkinTextureAvailable
net/minecraft/tileentity/TileEntitySkull net/minecraft/class_2631
net/minecraft/util/ResourceLocation net/minecraft/class_2960
net/minecraft/util/Session net/minecraft/class_320
func_148256_e ()Lcom/mojang/authlib/GameProfile; method_1677
net/minecraft/util/StringUtils net/minecraft/class_3544
func_76338_a (Ljava/lang/String;)Ljava/lang/String; method_15440
+135
View File
@@ -0,0 +1,135 @@
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'org.spongepowered.mixin'
ext.configFile = file "build.properties"
configFile.withReader {
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}
apply from: rootProject.file("BuildScripts/version.gradle")
version = getCSLVersion()
group = "customskinloader"
archivesBaseName = "CustomSkinLoader_Fabric"
ext.shortVersion = getShortVersion()
sourceCompatibility = targetCompatibility = 1.8
compileJava {
sourceCompatibility = targetCompatibility = 1.8
}
minecraft {
version = config.forge_mc_version + "-" + config.forge_version
runDir = "run"
mappings = config.mappings_version
replace '@MOD_VERSION@', rootProject.ext.config.version
replace '@MOD_FULL_VERSION@', project.version
replaceIn 'CustomSkinLoader.java'
}
jar {
exclude 'customskinloader/tweaker/**'
exclude 'net/minecraft/client/renderer/texture/**'
}
repositories {
maven {
name = "sponge"
url = "https://repo.spongepowered.org/maven"
}
}
dependencies {
implementation 'org.spongepowered:mixin:0.8'
}
mixin {
add sourceSets.main, "mixins.customskinloader.refmap.json"
reobfSrgFile = "mixin.srg"
reobfNotchSrgFile = "mixin.srg"
}
sourceSets {
main {
java {
//Common
srcDir "${rootDir}/Common/source"
//Vanilla
srcDir "${rootDir}/Vanilla/source"
//Fabric
srcDir "source"
}
resources {
//Common
srcDir "${rootDir}/Common/resource"
exclude "Profile.json"
//Fabric
srcDir "resource"
}
}
}
processResources {
expand([
modVersion : rootProject.ext.config.version,
modFullVersion : project.version,
modShortFullVersion: shortVersion,
mcVersion : config.minecraft_version,
mcFullVersions : config.minecraft_full_versions,
forgeVersion : config.forge_version,
gitVersion : System.getenv("CIRCLE_SHA1"),
buildUrl : System.getenv("CIRCLE_BUILD_URL"),
releaseTime : new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
apply from: rootProject.file("BuildScripts/remap.gradle")
task afterBuild {
doLast {
//renameSrgJar
def file0 = file("build/libs/${archivesBaseName}-${version}.jar")
def file1 = file("build/libs/${archivesBaseName}-${version}-srg.jar")
file0.renameTo(file1)
//reobfSrgToNotch
reobfSrgToNotch()
//copyBuildFile
copy {
from "build/libs"
into "${rootDir}/build/libs"
include "**/*.jar"
exclude "**/*-srg.jar"
exclude "**/*-dev.jar"
exclude "**/*-sources.jar"
}
}
}
build.finalizedBy afterBuild
apply plugin: 'maven-publish'
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/xfl03/MCCustomSkinLoader")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
groupId 'customskinloader'
artifactId project.archivesBaseName
from(components.java)
}
}
}
tasks.withType(PublishToMavenRepository) {
onlyIf { System.getenv("GITHUB_TOKEN") != null }
}
+7
View File
@@ -0,0 +1,7 @@
minecraft_version=1.14
minecraft_full_versions=1.14,1.14.1,1.14.2,1.14.3,1.14.4,1.15,1.15.1,1.15.2,1.16,1.16.1
#forge gradle needs forge version
forge_mc_version=1.12.2
forge_version=14.23.5.2768
mappings_version=stable_39
srg_notch_map=Fabric.tsrg
+25
View File
@@ -0,0 +1,25 @@
CL: com/mojang/blaze3d/matrix/MatrixStack net/minecraft/class_4587
CL: net/minecraft/client/entity/AbstractClientPlayer net/minecraft/class_742
CL: net/minecraft/client/gui/GuiPlayerTabOverlay net/minecraft/class_355
CL: net/minecraft/client/Minecraft net/minecraft/class_310
CL: net/minecraft/client/renderer/ThreadDownloadImageData net/minecraft/class_1046
CL: net/minecraft/client/renderer/texture/NativeImage net/minecraft/class_1011
CL: net/minecraft/client/renderer/texture/TextureManager net/minecraft/class_1060
CL: net/minecraft/client/resources/SkinManager net/minecraft/class_1071
CL: net/minecraft/client/resources/SkinManager$SkinAvailableCallback net/minecraft/class_1071$class_1072
CL: net/minecraft/scoreboard/ScoreObjective net/minecraft/class_266
CL: net/minecraft/scoreboard/Scoreboard net/minecraft/class_269
CL: net/minecraft/tileentity/TileEntitySkull net/minecraft/class_2631
CL: net/minecraft/util/ResourceLocation net/minecraft/class_2960
FD: net/minecraft/client/renderer/ThreadDownloadImageData/processTask net/minecraft/class_1046/field_20843
MD: net/minecraft/client/entity/AbstractClientPlayer/getDownloadImageSkin (Lnet/minecraft/util/ResourceLocation;Ljava/lang/String;)Lnet/minecraft/client/renderer/ThreadDownloadImageData; net/minecraft/class_742/method_3120 (Lnet/minecraft/class_2960;Ljava/lang/String;)Lnet/minecraft/class_1046;
MD: net/minecraft/client/entity/AbstractClientPlayer/getLocationSkin (Ljava/lang/String;)Lnet/minecraft/util/ResourceLocation; net/minecraft/class_742/method_3124 (Ljava/lang/String;)Lnet/minecraft/class_2960;
MD: net/minecraft/client/gui/GuiPlayerTabOverlay/renderPlayerlist (ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V net/minecraft/class_355/method_1919 (ILnet/minecraft/class_269;Lnet/minecraft/class_266;)V
MD: net/minecraft/client/gui/GuiPlayerTabOverlay/renderPlayerlist (Lcom/mojang/blaze3d/matrix/MatrixStack;ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V net/minecraft/class_355/method_1919 (Lnet/minecraft/class_4587;ILnet/minecraft/class_269;Lnet/minecraft/class_266;)V
MD: net/minecraft/client/Minecraft/isIntegratedServerRunning ()Z net/minecraft/class_310/method_1542 ()Z
MD: net/minecraft/client/renderer/ThreadDownloadImageData/loadTexture (Ljava/io/InputStream;)Lnet/minecraft/client/renderer/texture/NativeImage; net/minecraft/class_1046/method_22795 (Ljava/io/InputStream;)Lnet/minecraft/class_1011;
MD: net/minecraft/client/renderer/ThreadDownloadImageData/processLegacySkin (Lnet/minecraft/client/renderer/texture/NativeImage;)Lnet/minecraft/client/renderer/texture/NativeImage; net/minecraft/class_1046/method_22798 (Lnet/minecraft/class_1011;)Lnet/minecraft/class_1011;
MD: net/minecraft/client/resources/SkinManager/loadProfileTextures (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V net/minecraft/class_1071/method_4652 (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/class_1071$class_1072;Z)V
MD: net/minecraft/client/resources/SkinManager/loadSkin (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)Lnet/minecraft/util/ResourceLocation; net/minecraft/class_1071/method_4651 (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/class_1071$class_1072;)Lnet/minecraft/class_2960;
MD: net/minecraft/client/resources/SkinManager/loadSkinFromCache (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map; net/minecraft/class_1071/method_4654 (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map;
MD: net/minecraft/tileentity/TileEntitySkull/updateGameProfile (Lcom/mojang/authlib/GameProfile;)Lcom/mojang/authlib/GameProfile; net/minecraft/class_2631/method_11335 (Lcom/mojang/authlib/GameProfile;)Lcom/mojang/authlib/GameProfile;
+23
View File
@@ -0,0 +1,23 @@
{
"schemaVersion": 1,
"id": "customskinloader",
"version": "${modFullVersion}",
"name": "CustomSkinLoader",
"description": "Custom Skin Loader for Minecraft",
"authors": ["xfl03", "JLChnToZ"],
"contact": {
"homepage": "https://github.com/xfl03/MCCustomSkinLoader",
"issues": "https://github.com/xfl03/MCCustomSkinLoader/issues",
"sources": "https://github.com/xfl03/MCCustomSkinLoader"
},
"license": "GPL-3.0-only",
"environment": "client",
"mixins": [
{
"config": "mixins.customskinloader.json",
"environment": "client"
}
]
}
@@ -0,0 +1,16 @@
{
"compatibilityLevel": "JAVA_8",
"package": "customskinloader.mixin",
"client": [
"MixinGuiPlayerTabOverlay",
"MixinMinecraft",
"MixinSkinManager",
"MixinTextureManager",
"MixinThreadDownloadImageData",
"MixinTileEntitySkull"
],
"refmap": "mixins.customskinloader.refmap.json",
"injectors": {
"defaultRequire": 1
}
}
+51 -24
View File
@@ -13,20 +13,21 @@ buildscript {
} }
apply plugin: 'net.minecraftforge.gradle.forge' apply plugin: 'net.minecraftforge.gradle.forge'
ext.MINECRAFT_VERSION = "1.12.2" ext.configFile = file "build.properties"
ext.FORGE_VERSION = "14.23.5.2768" configFile.withReader {
ext.MAPPING_VERSION = "stable_39" def prop = new Properties()
ext.MINECRAFT_FULL_VERSIONS = "1.8,1.8.8,1.8.9,1.9,1.9.4,1.10,1.10.2,1.11,1.11.2,1.12,1.12.1,1.12.2" prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}
apply from: rootProject.file("BuildScripts/version.gradle") apply from: rootProject.file("BuildScripts/version.gradle")
archivesBaseName = "CustomSkinLoader_Forge" archivesBaseName = "CustomSkinLoader_Forge"
version = getCSLVersion() version = getCSLVersion()
group = "customskinloader" group = "customskinloader"
sourceCompatibility = targetCompatibility = 1.6 sourceCompatibility = targetCompatibility = 1.8
compileJava { compileJava {
sourceCompatibility = targetCompatibility = 1.6 sourceCompatibility = targetCompatibility = 1.8
} }
jar { jar {
manifest { manifest {
@@ -42,31 +43,31 @@ jar {
"Implementation-Timestamp" : new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") "Implementation-Timestamp" : new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
]) ])
} }
exclude 'net/minecraft/client/renderer/texture/NativeImage.class' exclude 'net/minecraft/client/renderer/texture/**'
exclude 'net/minecraftforge/fml/common/Mod.class' exclude 'net/minecraftforge/**'
} }
sourceSets { sourceSets {
main { main {
java { java {
//Common //Common
srcDir '../Common/source' srcDir "${rootDir}/Common/source"
//Forge //Forge
srcDir 'source' srcDir "source"
} }
resources { resources {
//Common //Common
srcDir '../Common/resource' srcDir "${rootDir}/Common/resource"
exclude 'Profile.json' exclude "Profile.json"
//Forge //Forge
srcDir 'resource' srcDir "resource"
} }
} }
} }
minecraft { minecraft {
version = MINECRAFT_VERSION + "-" + FORGE_VERSION version = config.forge_mc_version + "-" + config.forge_version
runDir = "run" runDir = "run"
mappings = MAPPING_VERSION mappings = config.mappings_version
clientJvmArgs += "-Dfml.coreMods.load=customskinloader.forge.ForgePlugin" clientJvmArgs += "-Dfml.coreMods.load=customskinloader.forge.ForgePlugin"
replace '@MOD_VERSION@', rootProject.ext.config.version replace '@MOD_VERSION@', rootProject.ext.config.version
@@ -80,11 +81,12 @@ processResources {
expand([ expand([
modVersion : rootProject.ext.config.version, modVersion : rootProject.ext.config.version,
modFullVersion: project.version, modFullVersion: project.version,
mcVersion : MINECRAFT_VERSION, mcVersion : config.minecraft_version,
mcFullVersions: MINECRAFT_FULL_VERSIONS, mcFullVersions: config.minecraft_full_versions,
forgeVersion : FORGE_VERSION, forgeVersion : config.forge_version,
gitVersion : System.getenv("CIRCLE_SHA1"), gitVersion : System.getenv("CIRCLE_SHA1"),
buildUrl : System.getenv("CIRCLE_BUILD_URL") buildUrl : System.getenv("CIRCLE_BUILD_URL"),
releaseTime : new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])} ])}
} }
@@ -106,11 +108,36 @@ task afterBuild {
doLast { doLast {
//copyBuildFile //copyBuildFile
copy { copy {
from 'build/libs' from "build/libs"
into '../build/libs' into "${rootDir}/build/libs"
include '**/*.jar' include "**/*.jar"
exclude '**/*-sources.jar' exclude "**/*-sources.jar"
} }
} }
} }
build.finalizedBy afterBuild build.finalizedBy afterBuild
apply plugin: 'maven-publish'
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/xfl03/MCCustomSkinLoader")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
groupId 'customskinloader'
artifactId project.archivesBaseName
from(components.java)
}
}
}
tasks.withType(PublishToMavenRepository) {
onlyIf { System.getenv("GITHUB_TOKEN") != null }
}
+7
View File
@@ -0,0 +1,7 @@
minecraft_version=1.12.2
minecraft_full_versions=1.8,1.8.8,1.8.9,1.9,1.9.4,1.10,1.10.2,1.11,1.11.2,1.12,1.12.1,1.12.2,1.13.2,1.14.2,1.14.3,1.14.4,1.15,1.15.1,1.15.2,1.16.1
#forge gradle needs forge version
forge_mc_version=1.12.2
forge_version=14.23.5.2768
mappings_version=stable_39
srg_notch_map=Forge.srg
+3 -4
View File
@@ -1,9 +1,5 @@
modLoader="javafml" modLoader="javafml"
loaderVersion="[25,)" loaderVersion="[25,)"
issueTrackerURL="https://github.com/xfl03/MCCustomSkinLoader/issues"
displayURL="https://github.com/xfl03/MCCustomSkinLoader"
credits="GPLv3"
authors=["xfl03", "JLChnToZ"]
[[mods]] [[mods]]
modId="customskinloader" modId="customskinloader"
version="${modFullVersion}" version="${modFullVersion}"
@@ -11,6 +7,9 @@ displayName="CustomSkinLoader"
description=''' description='''
Custom Skin Loader for Minecraft Custom Skin Loader for Minecraft
''' '''
issueTrackerURL="https://github.com/xfl03/MCCustomSkinLoader/issues"
displayURL="https://github.com/xfl03/MCCustomSkinLoader"
authors=["xfl03", "JLChnToZ"]
[[dependencies.customskinloader]] [[dependencies.customskinloader]]
modId="forge" modId="forge"
mandatory=true mandatory=true
+1 -2
View File
@@ -5,7 +5,6 @@
"description": "Custom Skin Loader for Minecraft", "description": "Custom Skin Loader for Minecraft",
"version": "${modFullVersion}", "version": "${modFullVersion}",
"url": "https://github.com/xfl03/MCCustomSkinLoader", "url": "https://github.com/xfl03/MCCustomSkinLoader",
"authorList": ["xfl03", "JLChnToZ"], "authorList": ["xfl03", "JLChnToZ"]
"credits": "GPLv3"
} }
] ]
+93 -124
View File
@@ -1,151 +1,120 @@
var AbstractInsnNode = Java.type('org.objectweb.asm.tree.AbstractInsnNode');
var FieldInsnNode = Java.type('org.objectweb.asm.tree.FieldInsnNode'); var FieldInsnNode = Java.type('org.objectweb.asm.tree.FieldInsnNode');
var FieldNode = Java.type('org.objectweb.asm.tree.FieldNode'); var InsnList = Java.type('org.objectweb.asm.tree.InsnList');
var InsnNode = Java.type('org.objectweb.asm.tree.InsnNode'); var InsnNode = Java.type('org.objectweb.asm.tree.InsnNode');
var MethodInsnNode = Java.type('org.objectweb.asm.tree.MethodInsnNode'); var MethodInsnNode = Java.type('org.objectweb.asm.tree.MethodInsnNode');
var TypeInsnNode = Java.type('org.objectweb.asm.tree.TypeInsnNode');
var VarInsnNode = Java.type('org.objectweb.asm.tree.VarInsnNode'); var VarInsnNode = Java.type('org.objectweb.asm.tree.VarInsnNode');
var Opcodes = Java.type('org.objectweb.asm.Opcodes'); var Opcodes = Java.type('org.objectweb.asm.Opcodes');
function SkinManagerTransformer() {
return {
'InitTransformer': function (cn, mn) {
cn.fields.add(new FieldNode(Opcodes.ACC_PRIVATE, "fakeManager", "Lcustomskinloader/fake/FakeSkinManager;", null, null));
mn.instructions.clear();
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 0));
mn.instructions.add(new MethodInsnNode(Opcodes.INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false));
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 0));
mn.instructions.add(new TypeInsnNode(Opcodes.NEW, "customskinloader/fake/FakeSkinManager"));
mn.instructions.add(new InsnNode(Opcodes.DUP));
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1));
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 2));
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 3));
mn.instructions.add(new MethodInsnNode(Opcodes.INVOKESPECIAL, "customskinloader/fake/FakeSkinManager", "<init>",
"(Lnet/minecraft/client/renderer/texture/TextureManager;Ljava/io/File;Lcom/mojang/authlib/minecraft/MinecraftSessionService;)V", false));
mn.instructions.add(new FieldInsnNode(Opcodes.PUTFIELD, "net/minecraft/client/resources/SkinManager", "fakeManager", "Lcustomskinloader/fake/FakeSkinManager;"));
mn.instructions.add(new InsnNode(Opcodes.RETURN));
},
'LoadSkinTransformer': function (cn, mn) {
mn.instructions.clear();
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 0));
mn.instructions.add(new FieldInsnNode(Opcodes.GETFIELD, "net/minecraft/client/resources/SkinManager", "fakeManager", "Lcustomskinloader/fake/FakeSkinManager;"));
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1));
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 2));
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 3));
mn.instructions.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, "customskinloader/fake/FakeSkinManager", "loadSkin",
"(Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)Lnet/minecraft/util/ResourceLocation;", false));
mn.instructions.add(new InsnNode(Opcodes.ARETURN));
},
'LoadProfileTexturesTransformer': function (cn, mn) {
mn.instructions.clear();
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 0));
mn.instructions.add(new FieldInsnNode(Opcodes.GETFIELD, "net/minecraft/client/resources/SkinManager", "fakeManager", "Lcustomskinloader/fake/FakeSkinManager;"));
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1));
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 2));
mn.instructions.add(new VarInsnNode(Opcodes.ILOAD, 3));
mn.instructions.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, "customskinloader/fake/FakeSkinManager", "loadProfileTextures",
"(Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V", false));
mn.instructions.add(new InsnNode(Opcodes.RETURN));
},
'LoadSkinFromCacheTransformer': function (cn, mn) {
mn.instructions.clear();
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 0));
mn.instructions.add(new FieldInsnNode(Opcodes.GETFIELD, "net/minecraft/client/resources/SkinManager", "fakeManager", "Lcustomskinloader/fake/FakeSkinManager;"));
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1));
mn.instructions.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, "customskinloader/fake/FakeSkinManager", "loadSkinFromCache",
"(Lcom/mojang/authlib/GameProfile;)Ljava/util/Map;", false));
mn.instructions.add(new InsnNode(Opcodes.ARETURN));
}
};
}
function PlayerTabTransformer(cn, mn) {
var iterator = mn.instructions.iterator();
while (iterator.hasNext()) {
var node = iterator.next();
if (node instanceof VarInsnNode) {
var varNode = node;
if (varNode.getOpcode() === Opcodes.ISTORE && varNode.var === 11) {
mn.instructions.set(varNode.getPrevious(), new InsnNode(Opcodes.ICONST_1));
}
}
}
}
function FakeSkinManagerTransformer(cn, mn) {
var TARGET_CLASS = "net/minecraft/client/renderer/ThreadDownloadImageData";
var NEW_TARGET_CLASS = "net/minecraft/client/renderer/texture/ThreadDownloadImageData";
var CALLBACK_CLASS = "net/minecraft/client/resources/SkinManager$SkinAvailableCallback";
var il = mn.instructions;
var li = il.iterator();
while (li.hasNext()) {
var ain = li.next();
if (ain instanceof MethodInsnNode) {
var min = ain;
if (min.owner.equals(TARGET_CLASS)) {
min.owner = NEW_TARGET_CLASS;
//il.set(min, new MethodInsnNode(min.getOpcode(), NEW_TARGET_CLASS, min.name, min.desc, false));
}
if (min.owner.equals(CALLBACK_CLASS) && min.name.equals("func_180521_a")) {
min.name = "onSkinTextureAvailable";
//il.set(min, new MethodInsnNode(min.getOpcode(), min.owner, "onSkinTextureAvailable", min.desc, false));
}
} else if (ain instanceof TypeInsnNode) {
var tin = ain;
if (tin.desc.equals(TARGET_CLASS)) {
tin.desc = NEW_TARGET_CLASS;
}
}
}
}
function initializeCoreMod() { function initializeCoreMod() {
return { return {
'SkinManagerTransformer': {
'target': {
'type': 'CLASS',
'name': 'net/minecraft/client/resources/SkinManager'
},
'transformer': function (cn) {
cn.methods.forEach(function (mn) {
if (mn.name === '<init>')
SkinManagerTransformer()['InitTransformer'](cn, mn);
else if(mn.name === 'func_152789_a')
SkinManagerTransformer()['LoadSkinTransformer'](cn, mn);
else if(mn.name === 'func_152790_a')
SkinManagerTransformer()['LoadProfileTexturesTransformer'](cn, mn);
else if(mn.name === 'func_152788_a')
SkinManagerTransformer()['LoadSkinFromCacheTransformer'](cn, mn);
});
return cn;
}
},
'PlayerTabTransformer': { 'PlayerTabTransformer': {
'target': { 'target': {
'type': 'CLASS', 'type': 'CLASS',
'name': 'net/minecraft/client/gui/GuiPlayerTabOverlay' 'names': function (target) {
return ['net/minecraft/client/gui/GuiPlayerTabOverlay', 'net/minecraft/client/gui/overlay/PlayerTabOverlayGui'];
}
}, },
'transformer': function (cn) { 'transformer': function (cn) {
cn.methods.forEach(function (mn) { cn.methods.forEach(function (mn) {
if (mn.name === 'func_175249_a') if (mn.name === 'func_175249_a' || mn.name === 'func_238523_a_') {
PlayerTabTransformer(cn, mn); for (var iterator = mn.instructions.iterator(); iterator.hasNext();) {
var node = iterator.next();
if (node.getOpcode() === Opcodes.INVOKEVIRTUAL && node.name === "func_71387_A") {
mn.instructions.insertBefore(node, new InsnNode(Opcodes.POP));
mn.instructions.set(node, new InsnNode(Opcodes.ICONST_1));
}
}
}
}); });
return cn; return cn;
} }
}, },
'FakeSkinManagerTransformer': { 'TileEntitySkullTransformer': {
'target': { 'target': {
'type': 'CLASS', 'type': 'CLASS',
'name': 'customskinloader/fake/FakeSkinManager' 'names': function (target) {
return ['net/minecraft/tileentity/TileEntitySkull', 'net/minecraft/tileentity/SkullTileEntity'];
}
}, },
'transformer': function (cn) { 'transformer': function (cn) {
cn.methods.forEach(function (mn) { cn.methods.forEach(function (mn) {
//if (mn.name === '<init>') if (mn.name === 'func_174884_b') {
FakeSkinManagerTransformer(cn, mn); var il = new InsnList();
il.add(new VarInsnNode(Opcodes.ALOAD, 0));
il.add(new InsnNode(Opcodes.ARETURN));
mn.instructions.insert(il);
}
});
return cn;
}
},
// For 1.13+
'AbstractTextureTransformer': {
'target': {
'type': 'CLASS',
'name': 'net/minecraft/client/renderer/texture/AbstractTexture'
},
'transformer': function (cn) {
cn.interfaces.add("net/minecraft/client/renderer/texture/Texture");
return cn;
}
},
'TextureTransformer': {
'target': {
'type': 'CLASS',
'name': 'net/minecraft/client/renderer/texture/Texture'
},
'transformer': function (cn) {
if (cn.access === 0) {
cn.access = Opcodes.ACC_PUBLIC | Opcodes.ACC_INTERFACE | Opcodes.ACC_ABSTRACT;
}
return cn;
}
},
// For 1.14+
'MinecraftTransformer': {
'target': {
'type': 'CLASS',
'name': 'net/minecraft/client/Minecraft'
},
'transformer': function (cn) {
cn.interfaces.add("customskinloader/fake/itf/IFakeMinecraft");
return cn;
}
},
// For 1.15+
'TextureManagerTransformer': {
'target': {
'type': 'CLASS',
'name': 'net/minecraft/client/renderer/texture/TextureManager'
},
'transformer': function (cn) {
cn.interfaces.add("customskinloader/fake/itf/IFakeTextureManager_1");
cn.interfaces.add("customskinloader/fake/itf/IFakeTextureManager_2");
return cn;
}
},
'DownloadingTextureTransformer': {
'target': {
'type': 'CLASS',
'name': 'net/minecraft/client/renderer/texture/DownloadingTexture'
},
'transformer': function (cn) {
cn.methods.forEach(function (mn) {
if (mn.name === 'func_229159_a_') {
for (var iterator = mn.instructions.iterator(); iterator.hasNext();) {
var node = iterator.next();
if (node.getOpcode() === Opcodes.INVOKESTATIC && node.name === "func_229163_c_") {
mn.instructions.insertBefore(node, new VarInsnNode(Opcodes.ALOAD, 0));
mn.instructions.insertBefore(node, new FieldInsnNode(Opcodes.GETFIELD, "net/minecraft/client/renderer/texture/DownloadingTexture", "field_229155_i_", "Ljava/lang/Runnable;"));
iterator.set(new MethodInsnNode(Opcodes.INVOKESTATIC, "customskinloader/fake/FakeSkinBuffer", "processLegacySkin", "(Lnet/minecraft/client/renderer/texture/NativeImage;Ljava/lang/Runnable;)Lnet/minecraft/client/renderer/texture/NativeImage;", false));
}
}
}
}); });
return cn; return cn;
} }
@@ -1,10 +1,41 @@
package customskinloader.forge; package customskinloader.forge;
import customskinloader.CustomSkinLoader;
import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLFingerprintViolationEvent;
/** /**
* Forge Mod Container for 1.13+ * Forge Mod Container
*/ */
@Mod("customskinloader") @Mod(
value = "customskinloader",
modid = "customskinloader",
name = "CustomSkinLoader",
version = "@MOD_FULL_VERSION@",
clientSideOnly = true,
acceptedMinecraftVersions = "[1.8,)",
acceptableRemoteVersions = "*",
certificateFingerprint = "52885f395e68f42e9b3b629ba56ecf606f7d4269"
)//1.13-
public class ForgeMod { public class ForgeMod {
}
@EventHandler
public void fingerprintError(FMLFingerprintViolationEvent event) {
if (event.isDirectory()) return;//Development Environment
CustomSkinLoader.logger.warning("!!!Fingerprint ERROR!!!");
CustomSkinLoader.logger.warning("Failed to check fingerprint in file '" + event.getSource().getAbsolutePath() + "'.");
CustomSkinLoader.logger.warning("Excepted Fingerprint: " + event.getExpectedFingerprint());
if (event.getFingerprints().isEmpty()) {
CustomSkinLoader.logger.warning("No Fingerprint Founded.");
} else {
CustomSkinLoader.logger.warning("Founded Fingerprint: ");
for (String s : event.getFingerprints())
CustomSkinLoader.logger.warning(s);
}
throw new RuntimeException("Fingerprint ERROR, please **DO NOT MODIFY** any mod.");
}
}
@@ -1,41 +0,0 @@
package customskinloader.forge;
import customskinloader.CustomSkinLoader;
import net.minecraftforge.fml.common.FMLModContainer;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.discovery.ModCandidate;
import net.minecraftforge.fml.common.event.FMLFingerprintViolationEvent;
import java.util.Map;
/**
* Forge Mod Container for 1.13-
*/
@ModOld(
modid = "customskinloader",
name = "CustomSkinLoader",
version = "@MOD_FULL_VERSION@",
clientSideOnly = true,
acceptedMinecraftVersions = "[1.8,)",
certificateFingerprint = "52885f395e68f42e9b3b629ba56ecf606f7d4269"
)//1.13-
public class ForgeModOld {
@EventHandler
public void fingerprintError(FMLFingerprintViolationEvent event) {
if (event.isDirectory()) return;//Development Environment
CustomSkinLoader.logger.warning("!!!Fingerprint ERROR!!!");
CustomSkinLoader.logger.warning("Failed to check fingerprint in file '" + event.getSource().getAbsolutePath() + "'.");
CustomSkinLoader.logger.warning("Excepted Fingerprint: " + event.getExpectedFingerprint());
if (event.getFingerprints().isEmpty()) {
CustomSkinLoader.logger.warning("No Fingerprint Founded.");
} else {
CustomSkinLoader.logger.warning("Founded Fingerprint: ");
for (String s : event.getFingerprints())
CustomSkinLoader.logger.warning(s);
}
throw new RuntimeException("Fingerprint ERROR, please **DO NOT MODIFY** any mod.");
}
}
@@ -2,19 +2,11 @@ package customskinloader.forge;
import java.util.Map; import java.util.Map;
import net.minecraftforge.fml.common.FMLModContainer;
import net.minecraftforge.fml.common.ModContainerFactory;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.Name; import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.Name;
import org.objectweb.asm.Type;
@Name("CustomSkinLoader") @Name("CustomSkinLoader")
public class ForgePlugin implements IFMLLoadingPlugin { public class ForgePlugin implements IFMLLoadingPlugin {
static{
//Transform Annotation in 1.13-
ModContainerFactory.instance().registerContainerType(Type.getType(ModOld.class), FMLModContainer.class);
}
@Override @Override
public String[] getASMTransformerClass() { public String[] getASMTransformerClass() {
@@ -1,23 +0,0 @@
package customskinloader.forge;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
//https://github.com/MinecraftForge/MinecraftForge/blob/1.12.x/src/main/java/net/minecraftforge/fml/common/Mod.java
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface ModOld {
String modid();
String name() default "";
String version() default "";
boolean clientSideOnly() default false;
String acceptedMinecraftVersions() default "";
String certificateFingerprint() default "";
}
@@ -5,12 +5,13 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import java.util.*; import java.util.HashMap;
import java.util.Map;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodNode;
import customskinloader.Logger; import customskinloader.Logger;
import net.minecraftforge.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodNode;
public class TransformerManager { public class TransformerManager {
public static Logger logger = new Logger(new File("./CustomSkinLoader/ForgePlugin.log")); public static Logger logger = new Logger(new File("./CustomSkinLoader/ForgePlugin.log"));
@@ -20,42 +21,84 @@ public class TransformerManager {
public @interface TransformTarget { public @interface TransformTarget {
String className(); String className();
String[] methodNames(); String[] methodNames() default {};
String desc(); String desc() default "";
}
public interface IClassTransformer {
void transform(ClassNode cn);
} }
public interface IMethodTransformer { public interface IMethodTransformer {
void transform(ClassNode cn, MethodNode mn); void transform(ClassNode cn, MethodNode mn);
} }
public Map<String, Map<String, IMethodTransformer>> map; public Map<String, IClassTransformer> classMap = new HashMap<>();
public Map<String, Map<String, IMethodTransformer>> map = new HashMap<>();
public TransformerManager(IMethodTransformer... transformers) { public TransformerManager(IMethodTransformer... methodTransformers) {
map = new HashMap<String, Map<String, IMethodTransformer>>(); this(new IClassTransformer[0], methodTransformers);
for (IMethodTransformer t : transformers) { }
logger.info("[CSL DEBUG] REGISTERING TRANSFORMER %s", t.getClass().getName());
if (!t.getClass().isAnnotationPresent(TransformTarget.class)) { public TransformerManager(IClassTransformer[] classTransformers, IMethodTransformer[] methodTransformers) {
logger.info("[CSL DEBUG] ERROR occurs while parsing Annotation."); for (IClassTransformer t : classTransformers) {
continue; TransformTarget tt = this.getTransformTarget(t.getClass());
if (tt != null) {
addClassTransformer(tt.className(), t);
}
}
for (IMethodTransformer t : methodTransformers) {
TransformTarget tt = this.getTransformTarget(t.getClass());
if (tt != null) {
addMethodTransformer(tt, tt.className(), t);
} }
addMethodTransformer(t.getClass().getAnnotation(TransformTarget.class), t);
} }
} }
private void addMethodTransformer(TransformTarget target, IMethodTransformer transformer) { private TransformTarget getTransformTarget(Class<?> cl) {
if (!map.containsKey(target.className())) logger.info("[CSL DEBUG] REGISTERING TRANSFORMER %s", cl.getName());
map.put(target.className(), new HashMap<String, IMethodTransformer>()); if (!cl.isAnnotationPresent(TransformTarget.class)) {
for (String methodName : target.methodNames()) { logger.info("[CSL DEBUG] ERROR occurs while parsing Annotation.");
map.get(target.className()).put(methodName + target.desc(), transformer); return null;
logger.info("[CSL DEBUG] REGISTERING METHOD %s(%s)", target.className(), methodName + target.desc());
} }
return cl.getAnnotation(TransformTarget.class);
}
private void addClassTransformer(String className, IClassTransformer transformer) {
if (!classMap.containsKey(className)) {
classMap.put(className, transformer);
logger.info("[CSL DEBUG] REGISTERING CLASS %s", className);
}
}
private void addMethodTransformer(TransformTarget target, String className, IMethodTransformer transformer) {
if (!map.containsKey(className))
map.put(className, new HashMap<String, IMethodTransformer>());
for (String methodName : target.methodNames()) {
map.get(className).put(methodName + target.desc(), transformer);
logger.info("[CSL DEBUG] REGISTERING METHOD %s(%s)", className, methodName + target.desc());
}
}
public ClassNode transform(ClassNode classNode) {
IClassTransformer transformer = classMap.get(FMLDeobfuscatingRemapper.INSTANCE.map(classNode.name).replace("/", "."));
if (transformer != null) {
try {
transformer.transform(classNode);
logger.info("[CSL DEBUG] Successfully transformed class %s", classNode.name);
} catch (Exception e) {
logger.warning("[CSL DEBUG] An error happened when transforming class %s.", classNode.name);
logger.warning(e);
}
}
return classNode;
} }
public MethodNode transform(ClassNode classNode, MethodNode methodNode, String className, String methodName, String methodDesc) { public MethodNode transform(ClassNode classNode, MethodNode methodNode, String className, String methodName, String methodDesc) {
Map<String, IMethodTransformer> transMap = map.get(className); Map<String, IMethodTransformer> transMap = map.get(className);
String methodTarget = methodName + methodDesc; String methodTarget = methodName + methodDesc;
if (transMap.containsKey(methodTarget)) { if (transMap != null && transMap.containsKey(methodTarget)) {
try { try {
transMap.get(methodTarget).transform(classNode, methodNode); transMap.get(methodTarget).transform(classNode, methodNode);
logger.info("[CSL DEBUG] Successfully transformed method %s in class %s", methodName, className); logger.info("[CSL DEBUG] Successfully transformed method %s in class %s", methodName, className);
@@ -1,40 +1,55 @@
package customskinloader.forge.loader; package customskinloader.forge.loader;
import customskinloader.forge.TransformerManager; import customskinloader.forge.TransformerManager;
import customskinloader.forge.transformer.FakeInterfacesTransformer;
import customskinloader.forge.transformer.PlayerTabTransformer; import customskinloader.forge.transformer.PlayerTabTransformer;
import customskinloader.forge.transformer.SkinManagerTransformer; import customskinloader.forge.transformer.SkinManagerTransformer;
import customskinloader.forge.transformer.SpectatorMenuTransformer; import customskinloader.forge.transformer.SpectatorMenuTransformer;
import customskinloader.forge.transformer.TileEntitySkullTransformer;
import net.minecraft.launchwrapper.IClassTransformer; import net.minecraft.launchwrapper.IClassTransformer;
import net.minecraftforge.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper; import net.minecraftforge.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper;
import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter; import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodNode; import org.objectweb.asm.tree.MethodNode;
//LaunchWrapper for 1.13- //LaunchWrapper for 1.13-
public class LaunchWrapper implements IClassTransformer { public class LaunchWrapper implements IClassTransformer {
private static final TransformerManager.IMethodTransformer[] TRANFORMERS = { private static final TransformerManager.IClassTransformer[] CLASS_TRANSFORMERS = {
new SkinManagerTransformer.InitTransformer(), new FakeInterfacesTransformer.MinecraftTransformer(),
new SkinManagerTransformer.LoadSkinTransformer(), new FakeInterfacesTransformer.AbstractTextureTransfomer(),
new SkinManagerTransformer.LoadProfileTexturesTransformer(), new FakeInterfacesTransformer.TextureTransformer(),
new SkinManagerTransformer.LoadSkinFromCacheTransformer(), new FakeInterfacesTransformer.TextureManagerTransformer()
new PlayerTabTransformer.ScoreObjectiveTransformer(),
new SpectatorMenuTransformer.PlayerMenuObjectTransformer()
}; };
private TransformerManager transformerManager = new TransformerManager(TRANFORMERS); private static final TransformerManager.IMethodTransformer[] TRANFORMERS = {
new SkinManagerTransformer.InitTransformer(),
new SkinManagerTransformer.LoadSkinTransformer(),
new SkinManagerTransformer.LoadProfileTexturesTransformer(),
new SkinManagerTransformer.LoadSkinFromCacheTransformer(),
new PlayerTabTransformer.ScoreObjectiveTransformer(),
new SpectatorMenuTransformer.PlayerMenuObjectTransformer(),
new TileEntitySkullTransformer.UpdateGameProfileTransformer()
};
private TransformerManager transformerManager = new TransformerManager(CLASS_TRANSFORMERS, TRANFORMERS);
//From: https://github.com/RecursiveG/UniSkinMod/blob/1.9.4/src/main/java/org/devinprogress/uniskinmod/coremod/BaseAsmTransformer.java#L83-L114 //From: https://github.com/RecursiveG/UniSkinMod/blob/1.9.4/src/main/java/org/devinprogress/uniskinmod/coremod/BaseAsmTransformer.java#L83-L114
public byte[] transform(String obfClassName, String className, byte[] bytes) { public byte[] transform(String obfClassName, String className, byte[] bytes) {
if (!transformerManager.map.containsKey(className)) return bytes;//Check if should be transformed if (!transformerManager.classMap.containsKey(className) && !transformerManager.map.containsKey(className)) return bytes;//Check if should be transformed
//Parse bytes to ClassNode //Parse bytes to ClassNode
ClassReader cr = new ClassReader(bytes);
ClassNode cn = new ClassNode(); ClassNode cn = new ClassNode();
cr.accept(cn, 0); if (bytes != null && bytes.length > 0) {
ClassReader cr = new ClassReader(bytes);
cr.accept(cn, 0);
} else {
cn.name = className.replace(".", "/");
cn.version = Opcodes.V1_8;
cn.superName = "java/lang/Object";
}
//Transform ClassNode //Transform ClassNode
transformerManager.transform(cn);
for (MethodNode mn : cn.methods) { for (MethodNode mn : cn.methods) {
String methodName = FMLDeobfuscatingRemapper.INSTANCE.mapMethodName(obfClassName, mn.name, mn.desc); String methodName = FMLDeobfuscatingRemapper.INSTANCE.mapMethodName(obfClassName, mn.name, mn.desc);
String methodDesc = FMLDeobfuscatingRemapper.INSTANCE.mapMethodDesc(mn.desc); String methodDesc = FMLDeobfuscatingRemapper.INSTANCE.mapMethodDesc(mn.desc);
@@ -0,0 +1,50 @@
package customskinloader.forge.transformer;
import customskinloader.forge.TransformerManager;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode;
public class FakeInterfacesTransformer {
@TransformerManager.TransformTarget(
className = "net.minecraft.client.Minecraft"
)
public static class MinecraftTransformer implements TransformerManager.IClassTransformer {
@Override
public void transform(ClassNode cn) {
cn.interfaces.add("customskinloader/fake/itf/IFakeMinecraft");
}
}
@TransformerManager.TransformTarget(
className = "net.minecraft.client.renderer.texture.AbstractTexture"
)
public static class AbstractTextureTransfomer implements TransformerManager.IClassTransformer {
@Override
public void transform(ClassNode cn) {
cn.interfaces.add("net/minecraft/client/renderer/texture/Texture");
}
}
@TransformerManager.TransformTarget(
className = "net.minecraft.client.renderer.texture.Texture"
)
public static class TextureTransformer implements TransformerManager.IClassTransformer {
@Override
public void transform(ClassNode cn) {
if (cn.access == 0) {
cn.access = Opcodes.ACC_PUBLIC | Opcodes.ACC_INTERFACE | Opcodes.ACC_ABSTRACT;
}
}
}
@TransformerManager.TransformTarget(
className = "net.minecraft.client.renderer.texture.TextureManager"
)
public static class TextureManagerTransformer implements TransformerManager.IClassTransformer {
@Override
public void transform(ClassNode cn) {
cn.interfaces.add("customskinloader/fake/itf/IFakeTextureManager_1");
cn.interfaces.add("customskinloader/fake/itf/IFakeTextureManager_2");
}
}
}
@@ -20,7 +20,16 @@ public class SkinManagerTransformer {
public static class InitTransformer implements IMethodTransformer{ public static class InitTransformer implements IMethodTransformer{
@Override @Override
public void transform(ClassNode cn,MethodNode mn) { public void transform(ClassNode cn,MethodNode mn) {
cn.fields.add(new FieldNode(Opcodes.ACC_PRIVATE, "fakeManager", "Lcustomskinloader/fake/FakeSkinManager;", null, null)); boolean hasField = false;
for (FieldNode fn : cn.fields) {
if (fn.name.equals("fakeManager")) {
hasField = true;
break;
}
}
if (!hasField) {
cn.fields.add(new FieldNode(Opcodes.ACC_PRIVATE, "fakeManager", "Lcustomskinloader/fake/FakeSkinManager;", null, null));
}
mn.instructions.clear(); mn.instructions.clear();
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD,0)); mn.instructions.add(new VarInsnNode(Opcodes.ALOAD,0));
mn.instructions.add(new MethodInsnNode(Opcodes.INVOKESPECIAL,"java/lang/Object","<init>","()V", false)); mn.instructions.add(new MethodInsnNode(Opcodes.INVOKESPECIAL,"java/lang/Object","<init>","()V", false));
@@ -0,0 +1,26 @@
package customskinloader.forge.transformer;
import customskinloader.forge.TransformerManager;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.InsnList;
import org.objectweb.asm.tree.InsnNode;
import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.VarInsnNode;
public class TileEntitySkullTransformer {
@TransformerManager.TransformTarget(
className = "net.minecraft.tileentity.TileEntitySkull",
methodNames = {"updateGameProfile", "func_174884_b"},
desc = "(Lcom/mojang/authlib/GameProfile;)Lcom/mojang/authlib/GameProfile;"
)
public static class UpdateGameProfileTransformer implements TransformerManager.IMethodTransformer {
@Override
public void transform(ClassNode cn, MethodNode mn) {
InsnList il = new InsnList();
il.add(new VarInsnNode(Opcodes.ALOAD, 0));
il.add(new InsnNode(Opcodes.ARETURN));
mn.instructions.insert(il);
}
}
}
@@ -0,0 +1,59 @@
package net.minecraft.client.resources;
import java.io.File;
import java.util.Map;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import com.mojang.authlib.minecraft.MinecraftSessionService;
import customskinloader.fake.FakeSkinManager;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.ResourceLocation;
public class SkinManager {
private FakeSkinManager fakeManager;
public SkinManager(TextureManager textureManagerInstance, File skinCacheDirectory, MinecraftSessionService sessionService) {
this.fakeManager = new FakeSkinManager(textureManagerInstance, skinCacheDirectory, sessionService);
}
public ResourceLocation loadSkin(MinecraftProfileTexture profileTexture, MinecraftProfileTexture.Type textureType) {
return this.loadSkin(profileTexture, textureType, null);
}
public ResourceLocation loadSkin(MinecraftProfileTexture profileTexture, MinecraftProfileTexture.Type textureType, SkinManager.SkinAvailableCallback skinAvailableCallback) {
return this.fakeManager.loadSkin(profileTexture, textureType, skinAvailableCallback);
}
// For 1.14+
public ResourceLocation func_152789_a(MinecraftProfileTexture profileTexture, MinecraftProfileTexture.Type textureType, SkinManager.ISkinAvailableCallback skinAvailableCallback) {
return this.loadSkin(profileTexture, textureType, skinAvailableCallback);
}
public void loadProfileTextures(GameProfile profile, SkinManager.SkinAvailableCallback skinAvailableCallback, boolean requireSecure) {
this.fakeManager.loadProfileTextures(profile, skinAvailableCallback, requireSecure);
}
// For 1.14+
public void func_152790_a(GameProfile profile, SkinManager.ISkinAvailableCallback skinAvailableCallback, boolean requireSecure) {
this.loadProfileTextures(profile, skinAvailableCallback, requireSecure);
}
public Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> loadSkinFromCache(GameProfile profile) {
return this.fakeManager.loadSkinFromCache(profile);
}
public interface SkinAvailableCallback {
default void skinAvailable(MinecraftProfileTexture.Type typeIn, ResourceLocation location, MinecraftProfileTexture profileTexture) {
this.onSkinTextureAvailable(typeIn, location, profileTexture);
}
default void onSkinTextureAvailable(MinecraftProfileTexture.Type typeIn, ResourceLocation location, MinecraftProfileTexture profileTexture) {
this.skinAvailable(typeIn, location, profileTexture);
}
}
public interface ISkinAvailableCallback extends SkinAvailableCallback {
}
}
@@ -6,12 +6,26 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
//https://github.com/MinecraftForge/MinecraftForge/blob/1.13.x/src/main/java/net/minecraftforge/fml/common/Mod.java //https://github.com/MinecraftForge/MinecraftForge/blob/1.13.x/src/main/java/net/minecraftforge/fml/common/Mod.java
//https://github.com/MinecraftForge/MinecraftForge/blob/1.12.x/src/main/java/net/minecraftforge/fml/common/Mod.java
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
public @interface Mod { public @interface Mod {
String value(); String value();
//From 1.12.x String modid();
String name() default "";
String version() default "";
boolean clientSideOnly() default false;
String acceptedMinecraftVersions() default "";
String acceptableRemoteVersions() default "";
String certificateFingerprint() default "";
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD) @Target(ElementType.METHOD)
@interface EventHandler { @interface EventHandler {
+2 -1
View File
@@ -80,7 +80,8 @@ Including some codes from
- [RecursiveG/UniSkinMod](https://github.com/RecursiveG/UniSkinMod) (GPLv3) - [RecursiveG/UniSkinMod](https://github.com/RecursiveG/UniSkinMod) (GPLv3)
- [NekoCaffeine/Alchemy](https://github.com/NekoCaffeine/Alchemy) (GPLv3) - [NekoCaffeine/Alchemy](https://github.com/NekoCaffeine/Alchemy) (GPLv3)
Copyright(C) 2013-2018 JLChnToZ xfl03 Copyright © 2013-2014 Jeremy Lam "JLChnToZ".
Copyright © 2014-2019 Alexander Xia "xfl03".
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 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.
+38
View File
@@ -0,0 +1,38 @@
net/minecraft/client/gui/GuiPlayerTabOverlay bjq
net/minecraft/client/gui/spectator/PlayerMenuObject boo
net/minecraft/client/Minecraft bib
field_71412_D w
func_110432_I ()Lnet/minecraft/util/Session; K
func_110434_K ()Lnet/minecraft/client/renderer/texture/TextureManager; N
func_147104_D ()Lnet/minecraft/client/multiplayer/ServerData; C
func_152342_ad ()Lnet/minecraft/client/resources/SkinManager; Y
func_152344_a (Ljava/lang/Runnable;)Lcom/google/common/util/concurrent/ListenableFuture; a
func_152347_ac ()Lcom/mojang/authlib/minecraft/MinecraftSessionService; X
func_71410_x ()Lnet/minecraft/client/Minecraft; z
net/minecraft/client/multiplayer/ServerData bse
field_78845_b b
net/minecraft/client/renderer/IImageBuffer but
func_152634_a ()V a
func_78432_a (Ljava/awt/image/BufferedImage;)Ljava/awt/image/BufferedImage; a
net/minecraft/client/renderer/ThreadDownloadImageData cdh
net/minecraft/client/renderer/texture/DownloadingTexture cdh
net/minecraft/client/renderer/texture/ITextureObject cds
net/minecraft/client/renderer/texture/SimpleTexture cdm
net/minecraft/client/renderer/texture/Texture cdf
net/minecraft/client/renderer/texture/TextureManager cdr
func_110579_a (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/ITextureObject;)Z a
func_110581_b (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/renderer/texture/ITextureObject; b
net/minecraft/client/renderer/texture/ThreadDownloadImageData cdh
net/minecraft/client/resources/DefaultPlayerSkin cef
func_177334_a (Ljava/util/UUID;)Lnet/minecraft/util/ResourceLocation; a
func_177335_a ()Lnet/minecraft/util/ResourceLocation; a
net/minecraft/client/resources/SkinManager cex
func_152790_a (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V a
net/minecraft/client/resources/SkinManager$SkinAvailableCallback cex$a
func_180521_a (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/util/ResourceLocation;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;)V a
net/minecraft/tileentity/TileEntitySkull awd
net/minecraft/util/ResourceLocation nf
net/minecraft/util/Session bii
func_148256_e ()Lcom/mojang/authlib/GameProfile; e
net/minecraft/util/StringUtils rp
func_76338_a (Ljava/lang/String;)Ljava/lang/String; a
+7
View File
@@ -0,0 +1,7 @@
minecraft_version=1.12.2
minecraft_full_versions=1.12.2
#forge gradle needs forge version
forge_mc_version=1.12.2
forge_version=14.23.5.2768
mappings_version=stable_39
srg_notch_map=1.12.2.tsrg
+24
View File
@@ -0,0 +1,24 @@
CL: net/minecraft/client/entity/AbstractClientPlayer bua
CL: net/minecraft/client/gui/GuiPlayerTabOverlay bjq
CL: net/minecraft/client/gui/spectator/PlayerMenuObject boo
CL: net/minecraft/client/Minecraft bib
CL: net/minecraft/client/renderer/ThreadDownloadImageData cdh
CL: net/minecraft/client/renderer/texture/TextureManager cdr
CL: net/minecraft/client/resources/SkinManager cex
CL: net/minecraft/client/resources/SkinManager$SkinAvailableCallback cex$a
CL: net/minecraft/scoreboard/ScoreObjective bhg
CL: net/minecraft/scoreboard/Scoreboard bhk
CL: net/minecraft/tileentity/TileEntitySkull awd
CL: net/minecraft/util/ResourceLocation nf
FD: net/minecraft/client/renderer/ThreadDownloadImageData/processTask cdh/field_229155_i_
MD: net/minecraft/client/entity/AbstractClientPlayer/getDownloadImageSkin (Lnet/minecraft/util/ResourceLocation;Ljava/lang/String;)Lnet/minecraft/client/renderer/ThreadDownloadImageData; bua/a (Lnf;Ljava/lang/String;)Lcdh;
MD: net/minecraft/client/entity/AbstractClientPlayer/getLocationSkin (Ljava/lang/String;)Lnet/minecraft/util/ResourceLocation; bua/e (Ljava/lang/String;)Lnf;
MD: net/minecraft/client/gui/GuiPlayerTabOverlay/renderPlayerlist (ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V bjq/a (ILbhk;Lbhg;)V
MD: net/minecraft/client/gui/GuiPlayerTabOverlay/renderPlayerlist (Lcom/mojang/blaze3d/matrix/MatrixStack;ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V bjq/func_238523_a_ (Lcom/mojang/blaze3d/matrix/MatrixStack;ILbhk;Lbhg;)V
MD: net/minecraft/client/Minecraft/isIntegratedServerRunning ()Z bib/D ()Z
MD: net/minecraft/client/renderer/ThreadDownloadImageData/loadTexture (Ljava/io/InputStream;)Lnet/minecraft/client/renderer/texture/NativeImage; cdh/func_229159_a_ (Ljava/io/InputStream;)Lnet/minecraft/client/renderer/texture/NativeImage;
MD: net/minecraft/client/renderer/ThreadDownloadImageData/processLegacySkin (Lnet/minecraft/client/renderer/texture/NativeImage;)Lnet/minecraft/client/renderer/texture/NativeImage; cdh/func_229163_c_ (Lnet/minecraft/client/renderer/texture/NativeImage;)Lnet/minecraft/client/renderer/texture/NativeImage;
MD: net/minecraft/client/resources/SkinManager/loadProfileTextures (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V cex/a (Lcom/mojang/authlib/GameProfile;Lcex$a;Z)V
MD: net/minecraft/client/resources/SkinManager/loadSkin (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)Lnet/minecraft/util/ResourceLocation; cex/a (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lcex$a;)Lnf;
MD: net/minecraft/client/resources/SkinManager/loadSkinFromCache (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map; cex/a (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map;
MD: net/minecraft/tileentity/TileEntitySkull/updateGameProfile (Lcom/mojang/authlib/GameProfile;)Lcom/mojang/authlib/GameProfile; awd/b (Lcom/mojang/authlib/GameProfile;)Lcom/mojang/authlib/GameProfile;
@@ -0,0 +1,16 @@
{
"compatibilityLevel": "JAVA_8",
"package": "customskinloader.mixin",
"client": [
"MixinGuiPlayerTabOverlay",
"MixinMinecraft",
"MixinPlayerMenuObject",
"MixinSkinManager",
"MixinTextureManager",
"MixinTileEntitySkull"
],
"refmap": "mixins.customskinloader.refmap.json",
"injectors": {
"defaultRequire": 1
}
}
+43
View File
@@ -0,0 +1,43 @@
customskinloader/fake/itf/IFakeTextureManager_1 customskinloader/fake/itf/IFakeTextureManager_1
func_229267_b_ (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/renderer/texture/Texture; b
customskinloader/fake/itf/IFakeTextureManager_2 customskinloader/fake/itf/IFakeTextureManager_2
func_229263_a_ (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/Texture;)V a
net/minecraft/client/gui/GuiPlayerTabOverlay ddj
net/minecraft/client/gui/spectator/PlayerMenuObject djn
net/minecraft/client/Minecraft dbn
field_71412_D m
func_110432_I ()Lnet/minecraft/util/Session; E
func_110434_K ()Lnet/minecraft/client/renderer/texture/TextureManager; H
func_147104_D ()Lnet/minecraft/client/multiplayer/ServerData; z
func_152342_ad ()Lnet/minecraft/client/resources/SkinManager; S
func_152347_ac ()Lcom/mojang/authlib/minecraft/MinecraftSessionService; R
func_71410_x ()Lnet/minecraft/client/Minecraft; x
net/minecraft/client/multiplayer/ServerData dnu
field_78845_b b
net/minecraft/client/renderer/ThreadDownloadImageData dzz
net/minecraft/client/renderer/texture/DownloadingTexture dzz
net/minecraft/client/renderer/texture/NativeImage cxr
func_195699_a (IIIIIIZZ)V a
func_195700_a (III)V a
func_195702_a ()I a
func_195703_a (Lnet/minecraft/client/renderer/texture/NativeImage;)V a
func_195709_a (II)I a
func_195714_b ()I b
func_195715_a (IIIII)V a
net/minecraft/client/renderer/texture/SimpleTexture eaf
net/minecraft/client/renderer/texture/Texture dzw
net/minecraft/client/renderer/texture/TextureManager eak
net/minecraft/client/renderer/texture/ThreadDownloadImageData dzz
net/minecraft/client/resources/DefaultPlayerSkin eaq
func_177334_a (Ljava/util/UUID;)Lnet/minecraft/util/ResourceLocation; a
func_177335_a ()Lnet/minecraft/util/ResourceLocation; a
net/minecraft/client/resources/SkinManager eaz
func_152790_a (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V a
net/minecraft/client/resources/SkinManager$SkinAvailableCallback eaz$a
func_180521_a (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/util/ResourceLocation;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;)V onSkinTextureAvailable
net/minecraft/tileentity/TileEntitySkull bxi
net/minecraft/util/ResourceLocation sm
net/minecraft/util/Session dbz
func_148256_e ()Lcom/mojang/authlib/GameProfile; e
net/minecraft/util/StringUtils aby
func_76338_a (Ljava/lang/String;)Ljava/lang/String; a
+7
View File
@@ -0,0 +1,7 @@
minecraft_version=1.15.2
minecraft_full_versions=1.15.2
#forge gradle needs forge version
forge_mc_version=1.12.2
forge_version=14.23.5.2768
mappings_version=stable_39
srg_notch_map=1.15.2.tsrg
+25
View File
@@ -0,0 +1,25 @@
CL: com/mojang/blaze3d/matrix/MatrixStack cyl
CL: net/minecraft/client/entity/AbstractClientPlayer dpy
CL: net/minecraft/client/gui/GuiPlayerTabOverlay ddj
CL: net/minecraft/client/Minecraft dbn
CL: net/minecraft/client/renderer/ThreadDownloadImageData dzz
CL: net/minecraft/client/renderer/texture/NativeImage cxr
CL: net/minecraft/client/renderer/texture/TextureManager eak
CL: net/minecraft/client/resources/SkinManager eaz
CL: net/minecraft/client/resources/SkinManager$SkinAvailableCallback eaz$a
CL: net/minecraft/scoreboard/ScoreObjective cwi
CL: net/minecraft/scoreboard/Scoreboard cwl
CL: net/minecraft/tileentity/TileEntitySkull bxi
CL: net/minecraft/util/ResourceLocation sm
FD: net/minecraft/client/renderer/ThreadDownloadImageData/processTask dzz/i
MD: net/minecraft/client/entity/AbstractClientPlayer/getDownloadImageSkin (Lnet/minecraft/util/ResourceLocation;Ljava/lang/String;)Lnet/minecraft/client/renderer/ThreadDownloadImageData; dpy/a (Lsm;Ljava/lang/String;)Ldzz;
MD: net/minecraft/client/entity/AbstractClientPlayer/getLocationSkin (Ljava/lang/String;)Lnet/minecraft/util/ResourceLocation; dpy/d (Ljava/lang/String;)Lsm;
MD: net/minecraft/client/gui/GuiPlayerTabOverlay/renderPlayerlist (ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V ddj/a (ILcwl;Lcwi;)V
MD: net/minecraft/client/gui/GuiPlayerTabOverlay/renderPlayerlist (Lcom/mojang/blaze3d/matrix/MatrixStack;ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V ddj/func_238523_a_ (Lcyl;ILbhk;Lbhg;)V
MD: net/minecraft/client/Minecraft/isIntegratedServerRunning ()Z dbn/A ()Z
MD: net/minecraft/client/renderer/ThreadDownloadImageData/loadTexture (Ljava/io/InputStream;)Lnet/minecraft/client/renderer/texture/NativeImage; dzz/a (Ljava/io/InputStream;)Lcxr;
MD: net/minecraft/client/renderer/ThreadDownloadImageData/processLegacySkin (Lnet/minecraft/client/renderer/texture/NativeImage;)Lnet/minecraft/client/renderer/texture/NativeImage; dzz/c (Lcxr;)Lcxr;
MD: net/minecraft/client/resources/SkinManager/loadProfileTextures (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V eaz/a (Lcom/mojang/authlib/GameProfile;Leaz$a;Z)V
MD: net/minecraft/client/resources/SkinManager/loadSkin (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)Lnet/minecraft/util/ResourceLocation; eaz/a (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Leaz$a;)Lsm;
MD: net/minecraft/client/resources/SkinManager/loadSkinFromCache (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map; eaz/a (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map;
MD: net/minecraft/tileentity/TileEntitySkull/updateGameProfile (Lcom/mojang/authlib/GameProfile;)Lcom/mojang/authlib/GameProfile; bxi/b (Lcom/mojang/authlib/GameProfile;)Lcom/mojang/authlib/GameProfile;
@@ -0,0 +1,16 @@
{
"compatibilityLevel": "JAVA_8",
"package": "customskinloader.mixin",
"client": [
"MixinGuiPlayerTabOverlay",
"MixinMinecraft",
"MixinSkinManager",
"MixinTextureManager",
"MixinThreadDownloadImageData",
"MixinTileEntitySkull"
],
"refmap": "mixins.customskinloader.refmap.json",
"injectors": {
"defaultRequire": 1
}
}
+43
View File
@@ -0,0 +1,43 @@
customskinloader/fake/itf/IFakeTextureManager_1 customskinloader/fake/itf/IFakeTextureManager_1
func_229267_b_ (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/renderer/texture/Texture; b
customskinloader/fake/itf/IFakeTextureManager_2 customskinloader/fake/itf/IFakeTextureManager_2
func_229263_a_ (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/Texture;)V a
net/minecraft/client/gui/GuiPlayerTabOverlay dnw
net/minecraft/client/gui/spectator/PlayerMenuObject duh
net/minecraft/client/Minecraft dlx
field_71412_D n
func_110432_I ()Lnet/minecraft/util/Session; I
func_110434_K ()Lnet/minecraft/client/renderer/texture/TextureManager; L
func_147104_D ()Lnet/minecraft/client/multiplayer/ServerData; D
func_152342_ad ()Lnet/minecraft/client/resources/SkinManager; Y
func_152347_ac ()Lcom/mojang/authlib/minecraft/MinecraftSessionService; X
func_71410_x ()Lnet/minecraft/client/Minecraft; B
net/minecraft/client/multiplayer/ServerData dys
field_78845_b b
net/minecraft/client/renderer/ThreadDownloadImageData elm
net/minecraft/client/renderer/texture/DownloadingTexture elm
net/minecraft/client/renderer/texture/NativeImage dgs
func_195699_a (IIIIIIZZ)V a
func_195700_a (III)V a
func_195702_a ()I a
func_195703_a (Lnet/minecraft/client/renderer/texture/NativeImage;)V a
func_195709_a (II)I a
func_195714_b ()I b
func_195715_a (IIIII)V a
net/minecraft/client/renderer/texture/SimpleTexture elr
net/minecraft/client/renderer/texture/Texture elj
net/minecraft/client/renderer/texture/TextureManager elw
net/minecraft/client/renderer/texture/ThreadDownloadImageData elm
net/minecraft/client/resources/DefaultPlayerSkin emc
func_177334_a (Ljava/util/UUID;)Lnet/minecraft/util/ResourceLocation; a
func_177335_a ()Lnet/minecraft/util/ResourceLocation; a
net/minecraft/client/resources/SkinManager emm
func_152790_a (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V a
net/minecraft/client/resources/SkinManager$SkinAvailableCallback emm$a
func_180521_a (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/util/ResourceLocation;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;)V onSkinTextureAvailable
net/minecraft/tileentity/TileEntitySkull cei
net/minecraft/util/ResourceLocation uh
net/minecraft/util/Session dml
func_148256_e ()Lcom/mojang/authlib/GameProfile; e
net/minecraft/util/StringUtils aei
func_76338_a (Ljava/lang/String;)Ljava/lang/String; a
+7
View File
@@ -0,0 +1,7 @@
minecraft_version=1.16.1
minecraft_full_versions=1.16.1
#forge gradle needs forge version
forge_mc_version=1.12.2
forge_version=14.23.5.2768
mappings_version=stable_39
srg_notch_map=1.16.1.tsrg
+25
View File
@@ -0,0 +1,25 @@
CL: com/mojang/blaze3d/matrix/MatrixStack dhl
CL: net/minecraft/client/entity/AbstractClientPlayer ebc
CL: net/minecraft/client/gui/GuiPlayerTabOverlay dnw
CL: net/minecraft/client/Minecraft dlx
CL: net/minecraft/client/renderer/ThreadDownloadImageData elm
CL: net/minecraft/client/renderer/texture/NativeImage dgs
CL: net/minecraft/client/renderer/texture/TextureManager elw
CL: net/minecraft/client/resources/SkinManager emm
CL: net/minecraft/client/resources/SkinManager$SkinAvailableCallback emm$a
CL: net/minecraft/scoreboard/ScoreObjective dfj
CL: net/minecraft/scoreboard/Scoreboard dfm
CL: net/minecraft/tileentity/TileEntitySkull cei
CL: net/minecraft/util/ResourceLocation uh
FD: net/minecraft/client/renderer/ThreadDownloadImageData/processTask elm/i
MD: net/minecraft/client/entity/AbstractClientPlayer/getDownloadImageSkin (Lnet/minecraft/util/ResourceLocation;Ljava/lang/String;)Lnet/minecraft/client/renderer/ThreadDownloadImageData; ebc/a (Luh;Ljava/lang/String;)Lelm;
MD: net/minecraft/client/entity/AbstractClientPlayer/getLocationSkin (Ljava/lang/String;)Lnet/minecraft/util/ResourceLocation; ebc/d (Ljava/lang/String;)Luh;
MD: net/minecraft/client/gui/GuiPlayerTabOverlay/renderPlayerlist (ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V dnw/func_175249_a (ILcwl;Lcwi;)V
MD: net/minecraft/client/gui/GuiPlayerTabOverlay/renderPlayerlist (Lcom/mojang/blaze3d/matrix/MatrixStack;ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V dnw/a (Ldhl;ILdfm;Ldfj;)V
MD: net/minecraft/client/Minecraft/isIntegratedServerRunning ()Z dlx/E ()Z
MD: net/minecraft/client/renderer/ThreadDownloadImageData/loadTexture (Ljava/io/InputStream;)Lnet/minecraft/client/renderer/texture/NativeImage; elm/a (Ljava/io/InputStream;)Ldgs;
MD: net/minecraft/client/renderer/ThreadDownloadImageData/processLegacySkin (Lnet/minecraft/client/renderer/texture/NativeImage;)Lnet/minecraft/client/renderer/texture/NativeImage; elm/c (Ldgs;)Ldgs;
MD: net/minecraft/client/resources/SkinManager/loadProfileTextures (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V emm/a (Lcom/mojang/authlib/GameProfile;Lemm$a;Z)V
MD: net/minecraft/client/resources/SkinManager/loadSkin (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)Lnet/minecraft/util/ResourceLocation; emm/a (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lemm$a;)Luh;
MD: net/minecraft/client/resources/SkinManager/loadSkinFromCache (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map; emm/a (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map;
MD: net/minecraft/tileentity/TileEntitySkull/updateGameProfile (Lcom/mojang/authlib/GameProfile;)Lcom/mojang/authlib/GameProfile; cei/b (Lcom/mojang/authlib/GameProfile;)Lcom/mojang/authlib/GameProfile;
@@ -0,0 +1,16 @@
{
"compatibilityLevel": "JAVA_8",
"package": "customskinloader.mixin",
"client": [
"MixinGuiPlayerTabOverlay",
"MixinMinecraft",
"MixinSkinManager",
"MixinTextureManager",
"MixinThreadDownloadImageData",
"MixinTileEntitySkull"
],
"refmap": "mixins.customskinloader.refmap.json",
"injectors": {
"defaultRequire": 1
}
}
+38
View File
@@ -0,0 +1,38 @@
net/minecraft/client/gui/GuiPlayerTabOverlay awh
net/minecraft/client/gui/spectator/PlayerMenuObject bad
net/minecraft/client/Minecraft ave
field_71412_D v
func_110432_I ()Lnet/minecraft/util/Session; L
func_110434_K ()Lnet/minecraft/client/renderer/texture/TextureManager; P
func_147104_D ()Lnet/minecraft/client/multiplayer/ServerData; D
func_152342_ad ()Lnet/minecraft/client/resources/SkinManager; ab
func_152344_a (Ljava/lang/Runnable;)Lcom/google/common/util/concurrent/ListenableFuture; a
func_152347_ac ()Lcom/mojang/authlib/minecraft/MinecraftSessionService; aa
func_71410_x ()Lnet/minecraft/client/Minecraft; A
net/minecraft/client/multiplayer/ServerData bde
field_78845_b b
net/minecraft/client/renderer/IImageBuffer bfm
func_152634_a ()V a
func_78432_a (Ljava/awt/image/BufferedImage;)Ljava/awt/image/BufferedImage; a
net/minecraft/client/renderer/ThreadDownloadImageData bma
net/minecraft/client/renderer/texture/DownloadingTexture bma
net/minecraft/client/renderer/texture/ITextureObject bmk
net/minecraft/client/renderer/texture/SimpleTexture bme
net/minecraft/client/renderer/texture/Texture bly
net/minecraft/client/renderer/texture/TextureManager bmj
func_110579_a (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/ITextureObject;)Z a
func_110581_b (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/renderer/texture/ITextureObject; b
net/minecraft/client/renderer/texture/ThreadDownloadImageData bma
net/minecraft/client/resources/DefaultPlayerSkin bmz
func_177334_a (Ljava/util/UUID;)Lnet/minecraft/util/ResourceLocation; a
func_177335_a ()Lnet/minecraft/util/ResourceLocation; a
net/minecraft/client/resources/SkinManager bnp
func_152790_a (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V a
net/minecraft/client/resources/SkinManager$SkinAvailableCallback bnp$a
func_180521_a (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/util/ResourceLocation;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;)V a
net/minecraft/tileentity/TileEntitySkull alo
net/minecraft/util/ResourceLocation jy
net/minecraft/util/Session avm
func_148256_e ()Lcom/mojang/authlib/GameProfile; e
net/minecraft/util/StringUtils nx
func_76338_a (Ljava/lang/String;)Ljava/lang/String; a
@@ -1,7 +1,7 @@
minecraft_version=1.13.2 minecraft_version=1.8.9
minecraft_full_versions=1.13.2 minecraft_full_versions=1.8.9
#forge gradle needs forge version #forge gradle needs forge version
forge_mc_version=1.12.2 forge_mc_version=1.12.2
forge_version=14.23.5.2768 forge_version=14.23.5.2768
mappings_version=stable_39 mappings_version=stable_39
srg_notch_map=1.13.2.srg srg_notch_map=1.8.9.tsrg
+24
View File
@@ -0,0 +1,24 @@
CL: net/minecraft/client/entity/AbstractClientPlayer bet
CL: net/minecraft/client/gui/GuiPlayerTabOverlay awh
CL: net/minecraft/client/gui/spectator/PlayerMenuObject bad
CL: net/minecraft/client/Minecraft ave
CL: net/minecraft/client/renderer/ThreadDownloadImageData bma
CL: net/minecraft/client/renderer/texture/TextureManager bmj
CL: net/minecraft/client/resources/SkinManager bnp
CL: net/minecraft/client/resources/SkinManager$SkinAvailableCallback bnp$a
CL: net/minecraft/scoreboard/ScoreObjective auk
CL: net/minecraft/scoreboard/Scoreboard auo
CL: net/minecraft/tileentity/TileEntitySkull alo
CL: net/minecraft/util/ResourceLocation jy
FD: net/minecraft/client/renderer/ThreadDownloadImageData/processTask bma/field_229155_i_
MD: net/minecraft/client/entity/AbstractClientPlayer/getDownloadImageSkin (Lnet/minecraft/util/ResourceLocation;Ljava/lang/String;)Lnet/minecraft/client/renderer/ThreadDownloadImageData; bet/a (Ljy;Ljava/lang/String;)Lbma;
MD: net/minecraft/client/entity/AbstractClientPlayer/getLocationSkin (Ljava/lang/String;)Lnet/minecraft/util/ResourceLocation; bet/c (Ljava/lang/String;)Ljy;
MD: net/minecraft/client/gui/GuiPlayerTabOverlay/renderPlayerlist (ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V awh/a (ILauo;Lauk;)V
MD: net/minecraft/client/gui/GuiPlayerTabOverlay/renderPlayerlist (Lcom/mojang/blaze3d/matrix/MatrixStack;ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V awh/func_238523_a_ (Lcom/mojang/blaze3d/matrix/MatrixStack;ILbhk;Lbhg;)V
MD: net/minecraft/client/Minecraft/isIntegratedServerRunning ()Z ave/E ()Z
MD: net/minecraft/client/renderer/ThreadDownloadImageData/loadTexture (Ljava/io/InputStream;)Lnet/minecraft/client/renderer/texture/NativeImage; bma/func_229159_a_ (Ljava/io/InputStream;)Lnet/minecraft/client/renderer/texture/NativeImage;
MD: net/minecraft/client/renderer/ThreadDownloadImageData/processLegacySkin (Lnet/minecraft/client/renderer/texture/NativeImage;)Lnet/minecraft/client/renderer/texture/NativeImage; bma/func_229163_c_ (Lnet/minecraft/client/renderer/texture/NativeImage;)Lnet/minecraft/client/renderer/texture/NativeImage;
MD: net/minecraft/client/resources/SkinManager/loadProfileTextures (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V bnp/a (Lcom/mojang/authlib/GameProfile;Lbnp$a;Z)V
MD: net/minecraft/client/resources/SkinManager/loadSkin (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)Lnet/minecraft/util/ResourceLocation; bnp/a (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lbnp$a;)Ljy;
MD: net/minecraft/client/resources/SkinManager/loadSkinFromCache (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map; bnp/a (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map;
MD: net/minecraft/tileentity/TileEntitySkull/updateGameProfile (Lcom/mojang/authlib/GameProfile;)Lcom/mojang/authlib/GameProfile; alo/b (Lcom/mojang/authlib/GameProfile;)Lcom/mojang/authlib/GameProfile;
+49
View File
@@ -0,0 +1,49 @@
{
"arguments": {
"game": [
"--tweakClass",
"customskinloader.tweaker.Tweaker"
]
},
"id": "${mcVersion}-CSL-${modShortFullVersion}",
"inheritsFrom": "${mcVersion}",
"libraries": [
{
"downloads": {
"artifact": {
"path": "customskinloader/CustomSkinLoader_${mcVersion}/${modFullVersion}/CustomSkinLoader_${mcVersion}-${modFullVersion}.jar",
"sha1": "{SHA1}",
"size": -1,
"url": "https://csl.littleservice.cn/libraries/customskinloader/CustomSkinLoader_${mcVersion}/${modFullVersion}/CustomSkinLoader_${mcVersion}-${modFullVersion}.jar"
}
},
"name": "customskinloader:CustomSkinLoader_${mcVersion}:${modFullVersion}"
},
{
"downloads": {
"artifact": {
"path": "net/minecraft/launchwrapper/1.12/launchwrapper-1.12.jar",
"sha1": "111e7bea9c968cdb3d06ef4632bf7ff0824d0f36",
"size": 32999,
"url": "https://libraries.minecraft.net/net/minecraft/launchwrapper/1.12/launchwrapper-1.12.jar"
}
},
"name": "net.minecraft:launchwrapper:1.12"
},
{
"downloads": {
"artifact": {
"path": "org/spongepowered/mixin/0.7.11-SNAPSHOT/mixin-0.7.11-20180703.121122-1.jar",
"sha1": "7a670207bdb97db418118ad1e9bb42424ff3776d",
"size": 1017668,
"url": "https://repo.spongepowered.org/maven/org/spongepowered/mixin/0.7.11-SNAPSHOT/mixin-0.7.11-20180703.121122-1.jar"
}
},
"name": "org.spongepowered:mixin:0.7.11-SNAPSHOT"
}
],
"mainClass": "net.minecraft.launchwrapper.Launch",
"releaseTime": "${releaseTime}",
"time": "${releaseTime}",
"type": "release"
}
@@ -0,0 +1,16 @@
{
"compatibilityLevel": "JAVA_8",
"package": "customskinloader.mixin",
"client": [
"MixinGuiPlayerTabOverlay",
"MixinMinecraft",
"MixinPlayerMenuObject",
"MixinSkinManager",
"MixinTextureManager",
"MixinTileEntitySkull"
],
"refmap": "mixins.customskinloader.refmap.json",
"injectors": {
"defaultRequire": 1
}
}
@@ -1,91 +0,0 @@
package net.minecraft.client.resources;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.collect.Maps;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.InsecureTextureException;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import com.mojang.authlib.minecraft.MinecraftSessionService;
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.IImageBuffer;
import net.minecraft.client.renderer.ImageBufferDownload;
import net.minecraft.client.renderer.ThreadDownloadImageData;
import net.minecraft.client.renderer.texture.ITextureObject;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.ResourceLocation;
//From 1.12-mcp940
public class SkinManager
{
private static final ExecutorService THREAD_POOL = new ThreadPoolExecutor(0, 2, 1L, TimeUnit.MINUTES, new LinkedBlockingQueue());
private final TextureManager textureManager;
private final File skinCacheDir;
private final MinecraftSessionService sessionService;
private final LoadingCache<GameProfile, Map<Type, MinecraftProfileTexture>> skinCacheLoader;
private customskinloader.fake.FakeSkinManager fakeManager;//Fake Skin Manager
public SkinManager(TextureManager textureManagerInstance, File skinCacheDirectory, MinecraftSessionService sessionService)
{
this.textureManager = textureManagerInstance;
this.skinCacheDir = skinCacheDirectory;
this.sessionService = sessionService;
this.skinCacheLoader = CacheBuilder.newBuilder().expireAfterAccess(15L, TimeUnit.SECONDS).<GameProfile, Map<Type, MinecraftProfileTexture>>build(new CacheLoader<GameProfile, Map<Type, MinecraftProfileTexture>>()
{
public Map<Type, MinecraftProfileTexture> load(GameProfile p_load_1_) throws Exception
{
try
{
return Minecraft.getMinecraft().getSessionService().getTextures(p_load_1_, false);
}
catch (Throwable var3)
{
return Maps.<Type, MinecraftProfileTexture>newHashMap();
}
}
});
this.fakeManager=new customskinloader.fake.FakeSkinManager(textureManagerInstance,skinCacheDirectory,sessionService);
}
/**
* Used in the Skull renderer to fetch a skin. May download the skin if it's not in the cache
*/
public ResourceLocation loadSkin(MinecraftProfileTexture profileTexture, Type textureType)
{
return this.loadSkin(profileTexture, textureType, (SkinManager.SkinAvailableCallback)null);
}
/**
* May download the skin if its not in the cache, can be passed a SkinManager#SkinAvailableCallback for handling
*/
public ResourceLocation loadSkin(final MinecraftProfileTexture profileTexture, final Type textureType, @Nullable final SkinManager.SkinAvailableCallback skinAvailableCallback)
{
return this.fakeManager.loadSkin(profileTexture, textureType, skinAvailableCallback);
}
public void loadProfileTextures(final GameProfile profile, final SkinManager.SkinAvailableCallback skinAvailableCallback, final boolean requireSecure)
{
this.fakeManager.loadProfileTextures(profile, skinAvailableCallback, requireSecure);
}
public Map<Type, MinecraftProfileTexture> loadSkinFromCache(GameProfile profile)
{
return this.fakeManager.loadSkinFromCache(profile);
}
public interface SkinAvailableCallback
{
void skinAvailable(Type typeIn, ResourceLocation location, MinecraftProfileTexture profileTexture);
}
}
+115
View File
@@ -0,0 +1,115 @@
{
"arguments": {
"game": [
"--tweakClass",
"customskinloader.tweaker.Tweaker"
]
},
"id": "${mcVersion}-CSL-${modShortFullVersion}",
"inheritsFrom": "${mcVersion}",
"libraries": [
{
"downloads": {
"artifact": {
"path": "customskinloader/CustomSkinLoader_${mcVersion}/${modFullVersion}/CustomSkinLoader_${mcVersion}-${modFullVersion}.jar",
"sha1": "{SHA1}",
"size": -1,
"url": "https://csl.littleservice.cn/libraries/customskinloader/CustomSkinLoader_${mcVersion}/${modFullVersion}/CustomSkinLoader_${mcVersion}-${modFullVersion}.jar"
}
},
"name": "customskinloader:CustomSkinLoader_${mcVersion}:${modFullVersion}"
},
{
"downloads": {
"artifact": {
"path": "customskinloader/launchwrapper/2.1.4/launchwrapper-2.1.4.jar",
"sha1": "32145fe60ea650e44636ab093ada31648e0de781",
"size": 16603,
"url": "https://csl.littleservice.cn/libraries/customskinloader/launchwrapper/2.1.4/launchwrapper-2.1.4.jar"
}
},
"name": "customskinloader:launchwrapper:2.1.4"
},
{
"downloads": {
"artifact": {
"path": "javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar",
"sha1": "934c04d3cfef185a8008e7bf34331b79730a9d43",
"size": 26586,
"url": "https://repo1.maven.org/maven2/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar"
}
},
"name": "javax.annotation:javax.annotation-api:1.3.2"
},
{
"downloads": {
"artifact": {
"path": "org/ow2/asm/asm/8.0.1/asm-8.0.1.jar",
"sha1": "3f5199523fb95304b44563f5d56d9f5a07270669",
"size": 121772,
"url": "https://repo1.maven.org/maven2/org/ow2/asm/asm/8.0.1/asm-8.0.1.jar"
}
},
"name": "org.ow2.asm:asm:8.0.1"
},
{
"downloads": {
"artifact": {
"path": "org/ow2/asm/asm-analysis/8.0.1/asm-analysis-8.0.1.jar",
"sha1": "6c2c7b3006b3a54dd63467a020263c0756fd5e80",
"size": 33438,
"url": "https://repo1.maven.org/maven2/org/ow2/asm/asm-analysis/8.0.1/asm-analysis-8.0.1.jar"
}
},
"name": "org.ow2.asm:asm-analysis:8.0.1"
},
{
"downloads": {
"artifact": {
"path": "org/ow2/asm/asm-commons/8.0.1/asm-commons-8.0.1.jar",
"sha1": "019c7ba355f0737815205518e332a8dc08b417c6",
"size": 71563,
"url": "https://repo1.maven.org/maven2/org/ow2/asm/asm-commons/8.0.1/asm-commons-8.0.1.jar"
}
},
"name": "org.ow2.asm:asm-commons:8.0.1"
},
{
"downloads": {
"artifact": {
"path": "org/ow2/asm/asm-tree/8.0.1/asm-tree-8.0.1.jar",
"sha1": "dfcad5abbcff36f8bdad5647fe6f4972e958ad59",
"size": 52628,
"url": "https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/8.0.1/asm-tree-8.0.1.jar"
}
},
"name": "org.ow2.asm:asm-tree:8.0.1"
},
{
"downloads": {
"artifact": {
"path": "org/ow2/asm/asm-util/8.0.1/asm-util-8.0.1.jar",
"sha1": "a8f978fbad00c565210bebedb28e5d6f73327134",
"size": 84795,
"url": "https://repo1.maven.org/maven2/org/ow2/asm/asm-util/8.0.1/asm-util-8.0.1.jar"
}
},
"name": "org.ow2.asm:asm-util:8.0.1"
},
{
"downloads": {
"artifact": {
"path": "org/spongepowered/mixin/0.8.1-SNAPSHOT/mixin-0.8.1-20200124.185151-1.jar",
"sha1": "c7c000c209a33783cf80f7105032b8d89e1f65d2",
"size": 934746,
"url": "https://repo.spongepowered.org/maven/org/spongepowered/mixin/0.8.1-SNAPSHOT/mixin-0.8.1-20200124.185151-1.jar"
}
},
"name": "org.spongepowered:mixin:0.8.1-SNAPSHOT"
}
],
"mainClass": "net.minecraft.launchwrapper.Launch",
"releaseTime": "${releaseTime}",
"time": "${releaseTime}",
"type": "release"
}
@@ -0,0 +1,25 @@
package customskinloader.mixin;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiPlayerTabOverlay;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(GuiPlayerTabOverlay.class)
@SuppressWarnings("target")
public abstract class MixinGuiPlayerTabOverlay {
@Redirect(
method = {
"Lnet/minecraft/client/gui/GuiPlayerTabOverlay;renderPlayerlist(ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V",
"Lnet/minecraft/client/gui/GuiPlayerTabOverlay;renderPlayerlist(Lcom/mojang/blaze3d/matrix/MatrixStack;ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V"
},
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/Minecraft;isIntegratedServerRunning()Z"
)
)
private boolean redirect_renderPlayerlist(Minecraft mc) {
return true;
}
}
@@ -0,0 +1,10 @@
package customskinloader.mixin;
import customskinloader.fake.itf.IFakeMinecraft;
import net.minecraft.client.Minecraft;
import org.spongepowered.asm.mixin.Mixin;
@Mixin(Minecraft.class)
public abstract class MixinMinecraft implements IFakeMinecraft {
}
@@ -0,0 +1,34 @@
package customskinloader.mixin;
import customskinloader.fake.FakeClientPlayer;
import net.minecraft.client.gui.spectator.PlayerMenuObject;
import net.minecraft.client.renderer.ThreadDownloadImageData;
import net.minecraft.util.ResourceLocation;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(PlayerMenuObject.class)
public abstract class MixinPlayerMenuObject {
@Redirect(
method = "Lnet/minecraft/client/gui/spectator/PlayerMenuObject;<init>(Lcom/mojang/authlib/GameProfile;)V",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/entity/AbstractClientPlayer;getLocationSkin(Ljava/lang/String;)Lnet/minecraft/util/ResourceLocation;"
)
)
private ResourceLocation redirect_init(String username) {
return FakeClientPlayer.getLocationSkin(username);
}
@Redirect(
method = "Lnet/minecraft/client/gui/spectator/PlayerMenuObject;<init>(Lcom/mojang/authlib/GameProfile;)V",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/entity/AbstractClientPlayer;getDownloadImageSkin(Lnet/minecraft/util/ResourceLocation;Ljava/lang/String;)Lnet/minecraft/client/renderer/ThreadDownloadImageData;"
)
)
private ThreadDownloadImageData redirect_init(ResourceLocation resourceLocationIn, String username) {
return FakeClientPlayer.getDownloadImageSkin(resourceLocationIn, username);
}
}
@@ -0,0 +1,58 @@
package customskinloader.mixin;
import java.io.File;
import java.util.Map;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import com.mojang.authlib.minecraft.MinecraftSessionService;
import customskinloader.fake.FakeSkinManager;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.resources.SkinManager;
import net.minecraft.util.ResourceLocation;
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 org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(SkinManager.class)
public abstract class MixinSkinManager {
private FakeSkinManager fakeManager;
@Inject(
method = "Lnet/minecraft/client/resources/SkinManager;<init>(Lnet/minecraft/client/renderer/texture/TextureManager;Ljava/io/File;Lcom/mojang/authlib/minecraft/MinecraftSessionService;)V",
at = @At("RETURN")
)
private void inject_init(TextureManager textureManagerInstance, File skinCacheDirectory, MinecraftSessionService sessionService, CallbackInfo callbackInfo) {
this.fakeManager = new FakeSkinManager(textureManagerInstance, skinCacheDirectory, sessionService);
}
@Inject(
method = "Lnet/minecraft/client/resources/SkinManager;loadSkin(Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)Lnet/minecraft/util/ResourceLocation;",
at = @At("HEAD"),
cancellable = true
)
private void inject_loadSkin(MinecraftProfileTexture profileTexture, MinecraftProfileTexture.Type textureType, SkinManager.SkinAvailableCallback skinAvailableCallback, CallbackInfoReturnable<ResourceLocation> callbackInfoReturnable) {
callbackInfoReturnable.setReturnValue(this.fakeManager.loadSkin(profileTexture, textureType, skinAvailableCallback));
}
@Inject(
method = "Lnet/minecraft/client/resources/SkinManager;loadProfileTextures(Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V",
at = @At("HEAD"),
cancellable = true
)
private void inject_loadProfileTextures(GameProfile profile, SkinManager.SkinAvailableCallback skinAvailableCallback, boolean requireSecure, CallbackInfo callbackInfo) {
this.fakeManager.loadProfileTextures(profile, skinAvailableCallback, requireSecure);
callbackInfo.cancel();
}
@Inject(
method = "Lnet/minecraft/client/resources/SkinManager;loadSkinFromCache(Lcom/mojang/authlib/GameProfile;)Ljava/util/Map;",
at = @At("HEAD"),
cancellable = true
)
private void inject_loadSkinFromCache(GameProfile profile, CallbackInfoReturnable<Map<MinecraftProfileTexture.Type, MinecraftProfileTexture>> callbackInfoReturnable) {
callbackInfoReturnable.setReturnValue(this.fakeManager.loadSkinFromCache(profile));
}
}
@@ -0,0 +1,23 @@
package customskinloader.mixin;
import customskinloader.fake.itf.IFakeTextureManager_1;
import customskinloader.fake.itf.IFakeTextureManager_2;
import net.minecraft.client.renderer.texture.TextureManager;
import org.spongepowered.asm.mixin.Implements;
import org.spongepowered.asm.mixin.Interface;
import org.spongepowered.asm.mixin.Mixin;
@Implements({
@Interface(
iface = IFakeTextureManager_1.class,
prefix = "fake1$"
),
@Interface(
iface = IFakeTextureManager_2.class,
prefix = "fake2$"
),
})
@Mixin(TextureManager.class)
public abstract class MixinTextureManager {
}
@@ -0,0 +1,29 @@
package customskinloader.mixin;
import customskinloader.fake.FakeSkinBuffer;
import net.minecraft.client.renderer.ThreadDownloadImageData;
import net.minecraft.client.renderer.texture.NativeImage;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(ThreadDownloadImageData.class)
@SuppressWarnings("target")
public abstract class MixinThreadDownloadImageData {
@Final
@Shadow
private Runnable processTask;
@Redirect(
method = "Lnet/minecraft/client/renderer/ThreadDownloadImageData;loadTexture(Ljava/io/InputStream;)Lnet/minecraft/client/renderer/texture/NativeImage;",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/renderer/ThreadDownloadImageData;processLegacySkin(Lnet/minecraft/client/renderer/texture/NativeImage;)Lnet/minecraft/client/renderer/texture/NativeImage;"
)
)
private NativeImage redirect_loadTexture(NativeImage image) {
return FakeSkinBuffer.processLegacySkin(image, this.processTask);
}
}
@@ -0,0 +1,20 @@
package customskinloader.mixin;
import com.mojang.authlib.GameProfile;
import net.minecraft.tileentity.TileEntitySkull;
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.CallbackInfoReturnable;
@Mixin(TileEntitySkull.class)
public abstract class MixinTileEntitySkull {
@Inject(
method = "Lnet/minecraft/tileentity/TileEntitySkull;updateGameProfile(Lcom/mojang/authlib/GameProfile;)Lcom/mojang/authlib/GameProfile;",
at = @At("HEAD"),
cancellable = true
)
private static void inject_updateGameProfile(GameProfile input, CallbackInfoReturnable<GameProfile> callbackInfoReturnable) {
callbackInfoReturnable.setReturnValue(input);
}
}
@@ -49,7 +49,7 @@ public class ClassTransformer implements IClassTransformer {
continue; continue;
} }
zipFile = tempZipFile; zipFile = tempZipFile;
Enumeration<ZipEntry> entries=(Enumeration<ZipEntry>) zipFile.entries(); Enumeration<? extends ZipEntry> entries=zipFile.entries();
StringBuilder sb=new StringBuilder(); StringBuilder sb=new StringBuilder();
while(entries.hasMoreElements()){ while(entries.hasMoreElements()){
ZipEntry entry=entries.nextElement(); ZipEntry entry=entries.nextElement();
@@ -7,6 +7,9 @@ import java.util.List;
import net.minecraft.launchwrapper.ITweaker; import net.minecraft.launchwrapper.ITweaker;
import net.minecraft.launchwrapper.LaunchClassLoader; import net.minecraft.launchwrapper.LaunchClassLoader;
import org.spongepowered.asm.launch.MixinBootstrap;
import org.spongepowered.asm.mixin.MixinEnvironment;
import org.spongepowered.asm.mixin.Mixins;
public class ModSystemTweaker implements ITweaker { public class ModSystemTweaker implements ITweaker {
@@ -22,8 +25,9 @@ public class ModSystemTweaker implements ITweaker {
public void injectIntoClassLoader(LaunchClassLoader classLoader) { public void injectIntoClassLoader(LaunchClassLoader classLoader) {
logger.info("ModSystemTweaker: injectIntoClassLoader"); logger.info("ModSystemTweaker: injectIntoClassLoader");
classLoader.registerTransformer("customskinloader.tweaker.ClassTransformer"); MixinBootstrap.init();
logger.info("ClassTransformer Registered"); Mixins.addConfiguration("mixins.customskinloader.json");
MixinEnvironment.getDefaultEnvironment().setSide(MixinEnvironment.Side.CLIENT);
} }
public String getLaunchTarget() { public String getLaunchTarget() {
@@ -9,27 +9,33 @@ import org.apache.commons.lang3.ArrayUtils;
import net.minecraft.launchwrapper.ITweaker; import net.minecraft.launchwrapper.ITweaker;
import net.minecraft.launchwrapper.LaunchClassLoader; import net.minecraft.launchwrapper.LaunchClassLoader;
import org.spongepowered.asm.launch.MixinBootstrap;
import org.spongepowered.asm.mixin.MixinEnvironment;
import org.spongepowered.asm.mixin.Mixins;
public class Tweaker implements ITweaker { public class Tweaker implements ITweaker {
private String[] args; private String[] args;
public static Logger logger = new Logger(); public static Logger logger = new Logger();
public void acceptOptions(List<String> args, File gameDir, File assetsDir, String profile) { public void acceptOptions(List<String> args, File gameDir, File assetsDir, String profile) {
File tweakerLogFile = new File(gameDir,"./CustomSkinLoader/Tweaker.log"); File tweakerLogFile = new File(gameDir,"./CustomSkinLoader/Tweaker.log");
logger = new Logger(tweakerLogFile); logger = new Logger(tweakerLogFile);
logger.info("Using Tweaker"); logger.info("Using Tweaker");
logger.info("Tweaker: acceptOptions"); logger.info("Tweaker: acceptOptions");
String[] temp={"--gameDir",gameDir.getAbsolutePath(),"--assetsDir",assetsDir.getAbsolutePath(),"--version",profile}; String[] temp={"--gameDir",gameDir.getAbsolutePath(),"--assetsDir",assetsDir.getAbsolutePath(),"--version",profile};
this.args=ArrayUtils.addAll(args.toArray(new String[args.size()]), temp); this.args=ArrayUtils.addAll(args.toArray(new String[0]), temp);
} }
public void injectIntoClassLoader(LaunchClassLoader classLoader) { public void injectIntoClassLoader(LaunchClassLoader classLoader) {
logger.info("Tweaker: injectIntoClassLoader"); logger.info("Tweaker: injectIntoClassLoader");
logger.info("Loaded as a library."); logger.info("Loaded as a library.");
MixinBootstrap.init();
Mixins.addConfiguration("mixins.customskinloader.json");
MixinEnvironment.getDefaultEnvironment().setSide(MixinEnvironment.Side.CLIENT);
} }
public String getLaunchTarget() { public String getLaunchTarget() {
+6 -1
View File
@@ -14,14 +14,19 @@ buildscript {
name = "forge" name = "forge"
url = "http://files.minecraftforge.net/maven" url = "http://files.minecraftforge.net/maven"
} }
maven {
name = "sponge"
url = "https://repo.spongepowered.org/maven"
}
} }
dependencies { dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
} }
} }
subprojects { subprojects {
if (!project.name.toLowerCase().contains("forge")) if (!project.name.toLowerCase().contains("forge") && !project.name.toLowerCase().contains("fabric"))
apply from: rootProject.file('common.gradle') apply from: rootProject.file('common.gradle')
} }
+2 -2
View File
@@ -1,6 +1,6 @@
name=CustomSkinLoader name=CustomSkinLoader
group=customskinloader group=customskinloader
version=14.10 version=14.12
dev_version= dev_version=
#RELEASE: snapshot=0 #RELEASE: snapshot=0
snapshot=0 snapshot=0
+75 -39
View File
@@ -1,17 +1,5 @@
buildscript {
repositories {
mavenCentral()
jcenter()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge' apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'org.spongepowered.mixin'
ext.configFile = file "build.properties" ext.configFile = file "build.properties"
configFile.withReader { configFile.withReader {
@@ -26,9 +14,9 @@ group = config.group
archivesBaseName = rootProject.ext.config.name + "_" + config.minecraft_version archivesBaseName = rootProject.ext.config.name + "_" + config.minecraft_version
ext.shortVersion = getShortVersion() ext.shortVersion = getShortVersion()
sourceCompatibility = targetCompatibility = 1.6 sourceCompatibility = targetCompatibility = 1.8
compileJava { compileJava {
sourceCompatibility = targetCompatibility = 1.6 sourceCompatibility = targetCompatibility = 1.8
} }
minecraft { minecraft {
@@ -49,20 +37,44 @@ jar {
attributes 'TweakVersion': version attributes 'TweakVersion': version
attributes 'TweakOrder' : '-10' attributes 'TweakOrder' : '-10'
} }
exclude 'net/minecraft/client/renderer/texture/NativeImage.class' exclude 'net/minecraft/client/renderer/texture/**'
exclude 'Profile.json'
}
repositories {
maven {
name = "sponge"
url = "https://repo.spongepowered.org/maven"
}
}
dependencies {
implementation 'org.spongepowered:mixin:0.8'
}
mixin {
add sourceSets.main, "mixins.customskinloader.refmap.json"
reobfSrgFile = "mixin.srg"
reobfNotchSrgFile = "mixin.srg"
} }
sourceSets { sourceSets {
main { main {
java { java {
//Common //Common
srcDir '../Common/source' srcDir "${rootDir}/Common/source"
//Vanilla //Vanilla
srcDir '../Vanilla' srcDir "${rootDir}/Vanilla/source"
//Special
srcDir "source"
} }
resources { resources {
//Common //Common
srcDir '../Common/resource' srcDir "${rootDir}/Common/resource"
//Vanilla
srcDir "${rootDir}/Vanilla/resource"
//Special
srcDir "resource"
} }
} }
} }
@@ -76,20 +88,12 @@ processResources {
mcFullVersions : config.minecraft_full_versions, mcFullVersions : config.minecraft_full_versions,
forgeVersion : config.forge_version, forgeVersion : config.forge_version,
gitVersion : System.getenv("CIRCLE_SHA1"), gitVersion : System.getenv("CIRCLE_SHA1"),
buildUrl : System.getenv("CIRCLE_BUILD_URL") buildUrl : System.getenv("CIRCLE_BUILD_URL"),
releaseTime : new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
]) ])
} }
task copyResources {
doLast { import java.security.MessageDigest
def outputFile = file("src/main/resources")
outputFile.deleteDir()
copy {
from '../Common/resource'
into 'src/main/resources'
}
}
}
processResources.dependsOn copyResources
apply from: rootProject.file("BuildScripts/remap.gradle") apply from: rootProject.file("BuildScripts/remap.gradle")
task afterBuild { task afterBuild {
@@ -104,12 +108,12 @@ task afterBuild {
//copyBuildFile //copyBuildFile
copy { copy {
from 'build/libs' from "build/libs"
into '../build/libs' into "${rootDir}/build/libs"
include '**/*.jar' include "**/*.jar"
exclude '**/*-srg.jar' exclude "**/*-srg.jar"
exclude '**/*-dev.jar' exclude "**/*-dev.jar"
exclude '**/*-sources.jar' exclude "**/*-sources.jar"
} }
//copyProfileJson //copyProfileJson
@@ -117,7 +121,39 @@ task afterBuild {
String of = String.format("build/libs/%s-CSL-%s.json", config.minecraft_version, shortVersion) String of = String.format("build/libs/%s-CSL-%s.json", config.minecraft_version, shortVersion)
File off = rootProject.file(of) File off = rootProject.file(of)
off.parentFile.mkdirs() off.parentFile.mkdirs()
f.renameTo(off)
def digest = MessageDigest.getInstance "SHA1"
digest.update file0.getBytes()
def sha1 = new BigInteger(1, digest.digest()).toString 16 padLeft 40, "0"
off.withWriter "UTF-8", { w ->
f.eachLine "UTF-8", { str ->
w << "${-> str.contains("{SHA1}") ? str.replace("{SHA1}", sha1) : (!(str =~ $/"size":\s*-1/$) ? str : str.replace("-1", file0.size().toString()))}\n"
}
}
} }
} }
build.finalizedBy afterBuild build.finalizedBy afterBuild
apply plugin: 'maven-publish'
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/xfl03/MCCustomSkinLoader")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
groupId 'customskinloader'
artifactId project.archivesBaseName
from(components.java)
}
}
}
tasks.withType(PublishToMavenRepository) {
onlyIf { System.getenv("GITHUB_TOKEN") != null }
}
+7 -1
View File
@@ -1,5 +1,11 @@
//Special Vanilla Edition //Special Vanilla Edition
include "1.13.2" include "Vanilla/1.8.9"
include "Vanilla/1.12.2"
include "Vanilla/1.15.2"
include "Vanilla/1.16.1"
//Universal Forge Edition for [1.8,) //Universal Forge Edition for [1.8,)
include "Forge" include "Forge"
//Fabric Edition for [1.14,)
include "Fabric"