Compare commits

...
48 Commits
Author SHA1 Message Date
33 299c8f53cf feat: update Java version in action 2023-07-14 01:10:18 +08:00
33 13fb0a4f92 feat: update README.md 2023-07-14 00:56:30 +08:00
33 921374f24f feat: remove illegal EOF 2023-07-14 00:30:14 +08:00
33 d2d244c70e feat: tweak into multi line output 2023-07-14 00:23:16 +08:00
33 f201f344a2 feat: use multiple version in action 2023-07-14 00:16:10 +08:00
33 76d6ed9a41 feat: add multiple version in release 2023-07-13 23:56:55 +08:00
33 b807aa1fb1 feat: remove snapshot Minecraft version in release 2023-07-13 23:35:35 +08:00
33 d797ed378a feat: remove development version 2023-07-13 21:54:36 +08:00
33 c3f8f1eb8f fix: mod version in action 2023-07-13 21:18:24 +08:00
33 226d953012 fix: GitHub pre-release in action 2023-07-13 21:05:47 +08:00
33 d1ab2fbf43 fix: CurseForge and Modrinth upload 2023-07-13 20:47:41 +08:00
33 00a14010c6 fix: CurseForge and Modrinth upload 2023-07-13 19:49:35 +08:00
33 a198e40fc7 fix: CurseForge upload 2023-07-13 19:39:06 +08:00
33 5b820c537d feat: remove GitHub release action 2023-07-13 18:39:23 +08:00
8Mi_Yile 6e1be02cf0 Update common.yml (#258) 2023-07-13 18:37:42 +08:00
33 9abf9eb779 fix: curseforge and modrinth release 2023-06-28 13:56:03 +08:00
33 fbc95314ad fix: use correct environment in upload task 2023-06-27 14:45:30 +08:00
33 d4576249ac fix: pull request won't run upload 2023-06-27 14:31:22 +08:00
33 dfe47f7c64 fix: publish snapshot and canary to Tencent COS 2023-06-27 14:25:42 +08:00
33 1199e10ca4 feat: bump 14.17 2023-06-27 14:19:40 +08:00
8Mi_Yileandgithub-actions[bot] 61287cf64c Add: common.yaml: CI Build Sync to Github Pre-Release (#256)
* Auto Sync From 8MiYile / MCCustomSkinLoader / 15-develop

* Auto Sync From 8MiYile / MCCustomSkinLoader / 15-develop

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-27 14:05:57 +08:00
8Mi_Yileandgithub-actions[bot] b16058340c add: common.yml: use matrix to multi-process upload file (#252)
* Auto Sync From 8MiYile / MCCustomSkinLoader / 15-develop

* Auto Sync From 8MiYile / MCCustomSkinLoader / 15-develop

* Auto Sync From 8MiYile / MCCustomSkinLoader / 15-develop

* Auto Sync From 8MiYile / MCCustomSkinLoader / 15-develop

* Auto Sync From 8MiYile / MCCustomSkinLoader / 15-develop

* Auto Sync From 8MiYile / MCCustomSkinLoader / 15-develop

* Auto Sync From 8MiYile / MCCustomSkinLoader / 15-develop

* Auto Sync From 8MiYile / MCCustomSkinLoader / 15-develop

* Auto Sync From 8MiYile / MCCustomSkinLoader / 15-develop

* Auto Sync From 8MiYile / MCCustomSkinLoader / 15-develop

* Auto Sync From 8MiYile / MCCustomSkinLoader / 15-develop

* Auto Sync From 8MiYile / MCCustomSkinLoader / 15-develop

* Auto Sync From 8MiYile / MCCustomSkinLoader / 15-develop

* Auto Sync From 8MiYile / MCCustomSkinLoader / 15-develop

* Auto Sync From 8MiYile / MCCustomSkinLoader / 15-develop

* Auto Sync From 8MiYile / MCCustomSkinLoader / 15-develop

* Auto Sync From 8MiYile / MCCustomSkinLoader / 15-develop

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-27 14:05:55 +08:00
33 ac09a51f48 Fix: GitHub Action Release 2023-06-27 14:05:46 +08:00
8Mi_Yileandgithub-actions[bot] 3e5bd83b5c issues-template: add option / common.yml: add support github release (#251)
* Auto Sync From

* Auto Sync From8MiYile/15-develop.zip

* Auto Sync From 8MiYile / 15-develop

* Auto Sync From 8MiYile / 15-develop

* Auto Sync From 8MiYile / MCCustomSkinLoader / 15-develop

* Auto Sync From 8MiYile / MCCustomSkinLoader / 15-develop

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-27 14:05:42 +08:00
ZekerZhayard 4ce00d07b5 Fix crash when the URL of skull profiles is not valid. (#255)
* Fix crash when the URL of skull profiles is not valid.

* Fix crash when the URL of skull profiles is not valid.
2023-06-27 14:02:45 +08:00
ZekerZhayard 6e9380be49 Support Fabric 23w16a. (#253) 2023-06-27 14:01:14 +08:00
33 53050a63f5 feat: Minecraft 1.20 2023-06-27 13:45:25 +08:00
33 34ac3ac4f2 Bump: 14.16 2023-04-08 22:01:55 +08:00
ZekerZhayard f5b1989453 Fix: Skull textures not loading when using local skins. 2023-03-18 11:07:34 +08:00
ZekerZhayard 85923855d8 Support 1.19.4. Remove Vanilla 1.19.3. 2023-03-15 23:34:05 +08:00
8Mi_Yile c8e96c11cd Add Github Issue Template's options in Report Bug (#242)
* Update report_bug.en_US.yml

* Update report_bug.zh_CN.yml

* Update report_bug.zh_CN.yml

* Update report_bug.en_US.yml

* Update report_bug.zh_CN.yml

* Update report_bug.en_US.yml

* Update report_bug.en_US.yml

* Update report_bug.zh_CN.yml

* Update report_bug.zh_CN.yml

* Update report_bug.zh_CN.yml

* Update report_bug.en_US.yml

* Update report_bug.zh_CN.yml
2023-01-28 12:42:38 +08:00
33 32e3e2e5a2 Add: GameProfile cache for Mojang API 2023-01-26 19:34:58 +08:00
33 b7b5e9d6c8 Add: LogManager 2023-01-26 18:51:38 +08:00
ZekerZhayard dfa7db1731 Fix: Modrinth release for Fabric edition 2023-01-26 16:26:08 +08:00
33 b645fd1665 Fix: Modrinth release 2023-01-26 15:39:37 +08:00
33 28fc81cb9a Fix: release build 2023-01-26 15:21:26 +08:00
33 bb0a47de4b Release: 14.15.2 2023-01-26 14:46:52 +08:00
33 d09b1d9807 Tweak: log file format 2023-01-24 18:43:17 +08:00
33 c207bdfc0e Fix: build action 2023-01-13 15:43:38 +08:00
33 69d35a69b7 Tweak: release build action 2023-01-13 15:22:29 +08:00
8Mi_Yile d767f40d32 添加 Issue Template (#238) 2023-01-13 15:12:40 +08:00
ZekerZhayard 5329a27d1a Fix: #199 2023-01-12 22:12:40 +08:00
33 ddefe00ac0 Add: more cape 2023-01-12 00:09:57 +08:00
33 dd4b706827 Add: support WynntilsAPI cape 2023-01-11 22:06:58 +08:00
33 84072c62f3 Add: support OptiFine cape 2023-01-11 18:51:44 +08:00
33 2d00e12f0a Update: README.md 2023-01-07 04:33:22 +08:00
33 b2b56f5be5 Add: GitHub Action for Pull Request 2023-01-07 01:24:12 +08:00
33 43c8ceb21e Add: show Quilt loader in CurseForge and Modrinth 2023-01-07 01:09:08 +08:00
53 changed files with 1360 additions and 449 deletions

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Telegram
url: https://t.me/customskinloader
about: Gugugu
- name: QQ
url: https://jq.qq.com/?_wv=1027&k=vF16R5tg
about: Gugugu
+124
View File
@@ -0,0 +1,124 @@
name: Report Bug
description: Report a bug and help us improve CustomSkinLoader
labels: [ bug ]
title: "[Bug] "
body:
- type: markdown
attributes:
value: |
Here is the Report Bug issue for CustomSkinLoader
With a red asterisk for the mandatory items
Please keep the work order content neat and tidy, do not paste the contents of the log file directly onto the work order, it will look very messy and unattractive work orders
- type: textarea
id: description
attributes:
label: Describe the bug
description: |
A clear and concise description of what the issue is.
Provide as much information as possible, videos, crash reports, etc.
DO NOT PASTE A CRASH REPORT HERE!!!
validations:
required: true
- type: textarea
id: reproducing
attributes:
label: Steps to reproduce
description: How do you trigger this bug?
render: bash
value: |
1.
2.
3.
validations:
required: true
- type: input
id: crash-report
attributes:
label: Link to crash-report if applicable
description: |
The files are in the folder `<minecraft-directory>/crash-reports`
[Generate URL](https://mclo.gs)
placeholder: "Ex: https://mclo.gs/xxxxxx"
- type: input
id: csl-log
attributes:
label: Link to CustomSkinLoader.log if applicable
description: |
The path to the file is `<minecraft-directory>/CustomSkinLoader/CustomSkinLoader.log`.
[Generate URL](https://mclo.gs)
placeholder: "Ex: https://mclo.gs/xxxxxx"
- type: input
id: latest-log
attributes:
label: Link to latest.log if applicable
description: |
The path to the file is `<minecraft-directory>/logs/latest.log`.
[Generate URL](https://mclo.gs)
placeholder: "Ex: https://mclo.gs/xxxxxx"
- type: input
id: forge-log
attributes:
label: "[Only Forge User] Link to Forge Log if applicable"
description: |
The path to the file is `<minecraft-directory>/logs/debug.log` or `<minecraft-directory>/logs/fml-client-latest.log`.
if your mod loader isn't `Forge`, URL can set empty
[Generate URL](https://mclo.gs)
placeholder: "Ex: https://mclo.gs/xxxxxx"
- type: input
id: mod-version
attributes:
label: Mod Version
placeholder: "Ex: 14.16"
validations:
required: true
- type: input
id: mc-version
attributes:
label: Minecraft Version
placeholder: "Ex: 1.19.4"
validations:
required: true
- type: input
id: mc-launcher-version
attributes:
label: Minecraft Launcher Name and Version
placeholder: "Ex: HMCL v3.5.4.232"
description: |
If you don't know the version of the game, you can just fill in the name of the game launcher
- type: dropdown
id: loader-type
attributes:
label: Mod Loader
options:
- Quilt
- Fabric
- Forge
- <without mod loader>
validations:
required: true
- type: dropdown
id: operating-systems
attributes:
label: Operating System
options:
- Windows
- Linux
- macOS
- Other
validations:
required: true
- type: checkboxes
id: prerequisites
attributes:
label: Before submitting a bug report
options:
- label: |
This bug wasn't already reported (I have searched bug reports on GitHub).
required: true
- label: |
This is a valid bug (I am able to reproduce this on the latest dev build).
required: true
- label: |
This problem is triggered in the latest version of the mod (if not the latest please upgrade the mod first)
required: true
+125
View File
@@ -0,0 +1,125 @@
name: 提交问题
description: 报告问题以帮助我们改进CustomSkinLoader
labels: [ bug ]
title: "[Bug] "
body:
- type: markdown
attributes:
value: |
你好,这里是 `CustomSkinLoader`
标注红色星号的为必填项
以及,保持工单干净整洁,不要直接将日志内容粘贴到工单上,比如粘贴到描述内是不行的
- type: textarea
id: description
attributes:
label: 描述问题
description: |
简单的描述问题, 并提供类似图片、视频,以更好的报告错误(如果可以)
!注意:请不要在这里放日志文件或崩溃报告文件的内容
validations:
required: true
- type: textarea
id: reproducing
attributes:
label: 复现步骤
description: 请问你是如何触发这个问题的
render: bash
value: |
1.
2.
3.
validations:
required: true
- type: input
id: crash-report
attributes:
label: 崩溃报告查看地址
description: |
在游戏目录下的 `crash-reports` 文件夹下,里面找最近的报告生成时间
客户端若无崩溃则直接填写 `客户端无崩溃`
[生成连接](https://mclo.gs)
placeholder: "示例: https://mclo.gs/xxxxxx"
- type: input
id: csl-log
attributes:
label: CustomSkinLoader.log 查看地址
description: |
文件路径:`<游戏路径>/CustomSkinLoader/CustomSkinLoader.log`.
[生成连接](https://mclo.gs)
placeholder: "示例: https://mclo.gs/xxxxxx"
- type: input
id: latest-log
attributes:
label: latest.log 查看地址
description: |
文件路径:`<游戏路径>/logs/latest.log`.
[生成连接](https://mclo.gs)
placeholder: "示例: https://mclo.gs/xxxxxx"
- type: input
id: forge-log
attributes:
label: "[仅Forge用户] Forge Log 查看地址"
description: |
文件路径:`<游戏路径>/logs/debug.log` 或者 `<游戏路径>/logs/fml-client-latest.log`.
若没有使用 `Forge` 加载器的,可以不填写
[生成连接](https://mclo.gs)
placeholder: "示例: https://mclo.gs/xxxxxx"
- type: input
id: mod-version
attributes:
label: 模组版本
placeholder: "示例: 14.16"
validations:
required: true
- type: input
id: mc-version
attributes:
label: Minecraft游戏版本
placeholder: "示例: 1.19.4"
validations:
required: true
- type: input
id: mc-launcher-version
attributes:
label: Minecraft启动器 名称 及 版本
placeholder: "示例: HMCL v3.5.4.232"
description: |
若不知道游戏版本 可以只填写游戏启动器的名称
validations:
required: true
- type: dropdown
id: loader-type
attributes:
label: 模组加载器
options:
- Quilt
- Fabric
- Forge
- 不使用加载器
validations:
required: true
- type: dropdown
id: operating-systems
attributes:
label: 操作系统
options:
- Windows
- Linux
- macOS
- 其他操作系统
validations:
required: true
- type: checkboxes
id: prerequisites
attributes:
label: 在提交错误报告之前,有没有做到...
options:
- label: |
先尝试搜索issues里面, 查看并确认打开或关闭的工单, 是否搜索不到
required: true
- label: |
确认你的模组版本是最新的开发版本,且文件下载正确,没有出现类似forge下载了fabric版的这类基础问题
required: true
- label: |
这个问题是在最新的mod版本触发(若不是最新的请先升级mod)
required: true
@@ -0,0 +1,22 @@
name: Suggestion
description: Suggest a new feature or change for CustomSkinLoader.
labels: [ enhancement ]
body:
- type: textarea
id: description
attributes:
label: Describe the feature
description: A clear and concise description of what the feature/change is.
validations:
required: true
- type: checkboxes
id: prerequisites
attributes:
label: Before submitting a suggestion
options:
- label: |
This feature doesn't already exist in the client. (I have checked every module and their settings on the **latest dev build**)
required: true
- label: |
This wasn't already suggested. (I have searched suggestions on GitHub and read the FAQ)
required: true
@@ -0,0 +1,22 @@
name: 反馈或建议
description: 给CustomSkinLoader这个模组提个建议
labels: [ enhancement ]
body:
- type: textarea
id: description
attributes:
label: 描述一下
description: 简单描述一下该功能/变化是什么。
validations:
required: true
- type: checkboxes
id: prerequisites
attributes:
label: 在提交反馈或建议之前,请先确认...
options:
- label: |
你要提交的反馈或者建议不存在于本模组的最新开发版下.
required: true
- label: |
以及在issues或者Wiki内搜索过, 并且无结果
required: true
+1 -1
View File
@@ -7,7 +7,7 @@ on:
jobs: jobs:
build-beta: build-beta:
name: Build Beta name: Build Beta
uses: xfl03/MCCustomSkinLoader/.github/workflows/common.yml@14-develop uses: ./.github/workflows/common.yml
with: with:
type: Beta type: Beta
publish-task: uploadBeta publish-task: uploadBeta
+1 -1
View File
@@ -7,7 +7,7 @@ on:
jobs: jobs:
build-canary: build-canary:
name: Build Canary name: Build Canary
uses: xfl03/MCCustomSkinLoader/.github/workflows/common.yml@15-develop uses: ./.github/workflows/common.yml
with: with:
type: Canary type: Canary
publish-task: uploadCanary publish-task: uploadCanary
+162 -8
View File
@@ -6,12 +6,16 @@ on:
required: true required: true
type: string type: string
publish-task: publish-task:
required: true required: false
type: string type: string
is-snapshot:
required: false
type: boolean
default: true
jobs: jobs:
build-common: build-common:
name: Build Common name: Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment: Build environment: Build
steps: steps:
@@ -29,23 +33,173 @@ jobs:
name: Build name: Build
env: env:
KEY_PASS: ${{ secrets.KEY_PASS }} KEY_PASS: ${{ secrets.KEY_PASS }}
IS_SNAPSHOT: ${{ inputs.is-snapshot }}
run: | run: |
echo Snapshot: $IS_SNAPSHOT
export GIT_COMMIT_DESC=$(git log --format=%B -n 1 $GITHUB_SHA) export GIT_COMMIT_DESC=$(git log --format=%B -n 1 $GITHUB_SHA)
./gradlew clean build --stacktrace ./gradlew clean build --stacktrace
- -
name: Publish uses: actions/upload-artifact@v3
name: Publish to Github Artifact
with:
name: CustomSkinLoader-${{ inputs.type }}-${{ github.run_number }}
path: build/libs
Upload:
if: inputs.publish-task
needs: build-common
continue-on-error: true
environment: Build
strategy:
matrix:
website: [CurseForge_Modrinth]
modtype: [Fabric,Forge-Active,Forge-Legacy]
include:
-
website: TencentCOS
modtype: All
# -
# website: GitHub-Release
# modtype: All
-
website: GitHub-PreRelease
modtype: All
name: ${{ matrix.website }} (${{ matrix.modtype}})
runs-on: ubuntu-latest
steps:
-
name: Checkout Git Repository
uses: actions/checkout@v3
-
uses: actions/download-artifact@v3
name: Download Artifact Zips
with:
path: build
-
name: Preparation Folder
run: |
rsync -avz "build/$(ls build|grep "CustomSkinLoader")/" build/libs/
ls -lh build
-
if: ${{ matrix.modtype != 'All' }}
name: Checking and setting the environment
id: cslenv
run: |
output="$(ls build/libs | grep -v "sources")"
if [[ "${{ matrix.modtype }}" == "Forge"* ]]; then
modloader="Forge"
path=$(echo ${{ matrix.modtype }} | sed "s#-#/#")
else
modloader=${{ matrix.modtype }}
path=${{ matrix.modtype }}
fi
echo "path=$path" >> $GITHUB_OUTPUT
echo "modloader=$modloader" >> $GITHUB_OUTPUT
echo "filename=$(echo "$output"|grep $(echo ${{ matrix.modtype }}|sed "s#-##") )" >> $GITHUB_OUTPUT
echo "version=$(grep "version=" build.properties | grep -v "#" | sed "s/version=//")" >> $GITHUB_OUTPUT
echo "edition=$(echo ${{ matrix.modtype }} | sed "s/-//")" >> $GITHUB_OUTPUT
echo "minecraft_vers<<EOF" >> $GITHUB_OUTPUT
grep "minecraft_full_versions=" "$path"/build.properties | grep -v "#" | sed "s/minecraft_full_versions=//" | sed "s/,/\n/g" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "java_vers<<EOF" >> $GITHUB_OUTPUT
grep "java_full_versions=" "$path"/build.properties | grep -v "#" | sed "s/java_full_versions=//" | sed "s/,/\n/g" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
-
if: startsWith(matrix.website, 'GitHub-')
name: Settings more strings to Environment
id: cslenv-github
run: |
#展开
echo "buildtime=$(TZ=Asia/Shanghai date "+%Y.%m.%d %H:%M")" >> $GITHUB_OUTPUT
echo "pathlist="$(find build/libs -type f|grep -v "sources"|grep -v "json")"" >> $GITHUB_OUTPUT
-
if: ${{ matrix.website == 'GitHub-PreRelease' && startsWith(github.ref, 'refs/heads') }}
name: 【GitHub Pre-Release】 Delete
uses: 8Mi-Tech/delete-release-assets-action@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: CI-Build
deleteOnlyFromDrafts: false
-
if: ${{ matrix.website == 'GitHub-PreRelease' && startsWith(github.ref, 'refs/heads') }}
name: 【GitHub Pre-Release】 Set CI-Build Text
run: |
cat > build/ci-build.md << 'EOF'
Build Time / 构建时间 : ${{ steps.cslenv-github.outputs.buildtime }}
自动同步分支 ${{ github.ref_name }} 的代码,以保持最新
Synchronize ${{ github.ref_name }} branch code updates, keeping only the latest version
<br>
[如何使用 / How to uses?](https://github.com/xfl03/MCCustomSkinLoader/wiki/How-to-Use)
EOF
-
if: ${{ matrix.website == 'GitHub-PreRelease' && startsWith(github.ref, 'refs/heads') }}
name: 【GitHub Pre-Release】 Upload Tag
uses: richardsimko/update-tag@v1
with:
tag_name: CI-Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
if: ${{ matrix.website == 'GitHub-PreRelease' && startsWith(github.ref, 'refs/heads') }}
name: 【GitHub Pre-Release】 Publish
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: CustomSkinLoader CI-Build
tag_name: CI-Build
prerelease: true
body_path: build/ci-build.md
files: build/libs/*
#iles: "${{ steps.cslenv-github.outputs.pathlist }}"
-
if: ${{ matrix.website == 'GitHub-Release' && inputs.type == 'Release' }}
uses: softprops/action-gh-release@v1
name: 【GitHub Release】 Publish
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: CustomSkinLoader ${{ github.ref }}
tag_name: ${{ github.ref }}
#generate_release_notes: true
files: ${{ steps.cslenv-github.outputs.pathlist }}
-
if: ${{ matrix.website == 'TencentCOS' }}
name: 【TencentCOS】 Publish
env: env:
COS_BUCKET: ${{ secrets.COS_BUCKET }} COS_BUCKET: ${{ secrets.COS_BUCKET }}
COS_SECRET_ID: ${{ secrets.COS_SECRET_ID }} COS_SECRET_ID: ${{ secrets.COS_SECRET_ID }}
COS_SECRET_KEY: ${{ secrets.COS_SECRET_KEY }} COS_SECRET_KEY: ${{ secrets.COS_SECRET_KEY }}
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }} IS_SNAPSHOT: ${{ inputs.is-snapshot }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
run: | run: |
export GIT_COMMIT_DESC=$(git log --format=%B -n 1 $GITHUB_SHA) export GIT_COMMIT_DESC=$(git log --format=%B -n 1 $GITHUB_SHA)
./gradlew ${{ inputs.publish-task }} --info --stacktrace ./gradlew ${{ inputs.publish-task }} --info --stacktrace
# ./gradlew publishGprPublicationToGitHubPackagesRepository # ./gradlew publishGprPublicationToGitHubPackagesRepository
- -
uses: actions/upload-artifact@v3 if: ${{ matrix.website == 'CurseForge_Modrinth' && inputs.type == 'Release' }}
name: 【CurseForge & Modrinth】 Publish
uses: Kir-Antipov/[email protected]
with: with:
name: CustomSkinLoader-${{ inputs.type }}-${{ github.run_number }} modrinth-id: idMHQ4n2
path: build/libs modrinth-featured: true
modrinth-unfeature-mode: subset
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
curseforge-id: 286924
curseforge-token: ${{ secrets.CURSEFORGE_API_KEY }}
name: CustomSkinLoader_${{ steps.cslenv.outputs.edition }}_${{ steps.cslenv.outputs.version }}
version: ${{ steps.cslenv.outputs.version }}-${{ steps.cslenv.outputs.edition }}
version-type: release
loaders: ${{ steps.cslenv.outputs.modloader }}
game-versions: |
${{ steps.cslenv.outputs.minecraft_vers }}
game-version-filter: releases
java: |
${{ steps.cslenv.outputs.java_vers }}
retry-attempts: 2
retry-delay: 10000
fail-mode: fail
files: |
build/libs/${{ steps.cslenv.outputs.filename }}
+17
View File
@@ -0,0 +1,17 @@
name: Pull Request
on:
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- '14-develop'
- '15-develop'
jobs:
build-pull-request:
name: Build Pull Request
uses: ./.github/workflows/common.yml
with:
type: PullRequest
+4 -4
View File
@@ -1,14 +1,14 @@
name: Release name: Release
on: on:
push: release:
tags: types: [released]
- '*'
jobs: jobs:
build-release: build-release:
name: Build Release name: Build Release
uses: xfl03/MCCustomSkinLoader/.github/workflows/common.yml@14-develop uses: ./.github/workflows/common.yml
with: with:
type: Release type: Release
publish-task: upload publish-task: upload
is-snapshot: false
secrets: inherit secrets: inherit
+2 -5
View File
@@ -13,7 +13,7 @@ There are the available versions in different environments below:
| | Forge | Fabric | | | Forge | Fabric |
|:-----------------------:|:-----------------------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------:| |:-----------------------:|:-----------------------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------:|
| Runtime Environment | forge-1.8-11.14.0.1237 ~ 1.13.2-25.0.22<br/> forge-1.13.2-25.0.42 ~ latest | fabric-loader-0.4.3+build.134 ~ latest<br/> Minecraft 18w43b ~ latest<br/> *fabric-api is not required* | | Runtime Environment | forge-1.8-11.14.0.1237 ~ 1.13.2-25.0.22<br/> forge-1.13.2-25.0.42 ~ latest | fabric-loader-0.4.3+build.134 ~ latest<br/> Minecraft 18w43b ~ latest<br/> *fabric-api is not required* |
| Development Environment | ForgeGradle-2.1-SNAPSHOT ~ latest<br/> forge-1.8-11.14.3.1503 ~ 1.12.2-14.23.5.2855<br/> forge-1.13.2-25.0.198 ~ latest | fabric-loom-(?) ~ latest<br/> fabric-loader-0.12.0 ~ latest<br/> Minecraft 18w49a ~ latest<br/> *fabric-api is not required* | | Development Environment | ForgeGradle-2.1-SNAPSHOT ~ latest<br/> forge-1.8-11.14.3.1503 ~ 1.12.2-14.23.5.2860<br/> forge-1.13.2-25.0.198 ~ latest | fabric-loom-(?) ~ latest<br/> fabric-loader-0.12.0 ~ latest<br/> Minecraft 18w49a ~ latest<br/> *fabric-api is not required* |
### Preliminary steps for testing local builds ### Preliminary steps for testing local builds
1. Create a new empty minecraft development environment. 1. Create a new empty minecraft development environment.
@@ -78,10 +78,7 @@ There are the available versions in different environments below:
clientRunArgs += ["--tweakClass", "customskinloader.forge.ForgeDevTweaker", "--username", "<Your username>"] clientRunArgs += ["--tweakClass", "customskinloader.forge.ForgeDevTweaker", "--username", "<Your username>"]
} }
``` ```
1. Run `./gradlew setupDecompWorkspace eclipse` command. 1. Run `./gradlew setupDecompWorkspace` command.
1. Due to the run configurations which generated by ForgeGradle 2 has not been compatible with IntelliJ IDEA 2020 and above, we recommend to install [Eclipser](https://plugins.jetbrains.com/plugin/7153-eclipser) plugin. It can convert Eclipse run configurations to IDEA. (Right click to `*.launch` file in project folder, then select `Convert with Eclipser`, then a new IDEA run configuration will be created.)
1. For IDEA, open `Run/Debug Configurations` dialog, change classpath of module to the name contains `.main`.
1. Add `--tweakClass customskinloader.forge.ForgeDevTweaker --username <Your username>` to CLI arguments in `Run/Debug Configurations` dialog.
1. Then you can debug the mod in IDE or through `./gradlew runClient` command. 1. Then you can debug the mod in IDE or through `./gradlew runClient` command.
### For ForgeGradle 3.x ~ 5.x ( forge-1.12.2-14.23.5.2851 ~ latest ) ### For ForgeGradle 3.x ~ 5.x ( forge-1.12.2-14.23.5.2851 ~ latest )
@@ -18,6 +18,8 @@ import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import customskinloader.config.Config; import customskinloader.config.Config;
import customskinloader.config.SkinSiteProfile; import customskinloader.config.SkinSiteProfile;
import customskinloader.loader.ProfileLoader; import customskinloader.loader.ProfileLoader;
import customskinloader.log.LogManager;
import customskinloader.log.Logger;
import customskinloader.profile.DynamicSkullManager; import customskinloader.profile.DynamicSkullManager;
import customskinloader.profile.ModelManager0; import customskinloader.profile.ModelManager0;
import customskinloader.profile.ProfileCache; import customskinloader.profile.ProfileCache;
@@ -224,7 +226,8 @@ public class CustomSkinLoader {
} }
private static Logger initLogger() { private static Logger initLogger() {
Logger logger = new Logger(LOG_FILE); LogManager.setLogFile(LOG_FILE.toPath());
Logger logger = LogManager.getLogger("Core");
logger.info("CustomSkinLoader " + CustomSkinLoader_FULL_VERSION); logger.info("CustomSkinLoader " + CustomSkinLoader_FULL_VERSION);
logger.info("DataDir: " + DATA_DIR.getAbsolutePath()); logger.info("DataDir: " + DATA_DIR.getAbsolutePath());
logger.info("Operating System: " + System.getProperty("os.name") + logger.info("Operating System: " + System.getProperty("os.name") +
+5 -147
View File
@@ -1,150 +1,8 @@
package customskinloader; package customskinloader;
import java.io.BufferedWriter; /**
import java.io.File; * @deprecated From 14.16, use <code>customskinloader.log.Logger</code> instead.
import java.io.OutputStreamWriter; */
import java.io.PrintWriter; @Deprecated
import java.io.StringWriter; public class Logger extends customskinloader.log.Logger {
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.text.SimpleDateFormat;
import java.util.Date;
@SuppressWarnings("ResultOfMethodCallIgnored")
public class Logger {
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
/**
* A copy of <code>Config.enableLogStdOut</code>.
* Because <code>Config.loadConfig0()</code> will use <code>Logger.log()</code>,
* which means cannot access <code>CustomSkinLoader.config</code> here.
*
* @see customskinloader.config.Config#enableLogStdOut
* @since 14.15
*/
public boolean enableLogStdOut = false;
public enum Level {
DEBUG("DEBUG", false),
INFO("INFO", true),
WARNING("WARNING", true);
final String name;
final boolean display;
Level(String name, boolean display) {
this.name = name;
this.display = display;
}
public String getName() {
return name;
}
public boolean display() {
return display;
}
}
private BufferedWriter writer = null;
public Logger() {
//Logger isn't created.
}
public Logger(String logFile) {
this(new File(logFile));
}
public Logger(File logFile) {
try {
if (!logFile.getParentFile().exists()) {
logFile.getParentFile().mkdirs();
}
if (!logFile.exists()) {
logFile.createNewFile();
}
writer = new BufferedWriter(new OutputStreamWriter(
Files.newOutputStream(logFile.toPath()), StandardCharsets.UTF_8));
System.out.println("Log Path: " + logFile.getAbsolutePath());
} catch (Exception e) {
e.printStackTrace();
}
}
public void close() {
if (writer != null) {
try {
writer.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
/**
* Judge if a level can be printed to standard output(System.out) with config.
*
* @param level log level
* @return true - print
*/
private boolean canPrintToStdOut(Level level) {
return level.display() && enableLogStdOut;
}
public void log(Level level, String msg) {
//When it neither be printed to standard output nor write to file
if (!canPrintToStdOut(level) && writer == null) {
return;
}
//Format, print and write
String sb = String.format("[%s %s] %s", Thread.currentThread().getName(), level.getName(), msg);
if (canPrintToStdOut(level)) {
System.out.println(sb);
}
if (writer == null) {
return;
}
try {
String sb2 = String.format("[%s] %s\r\n", DATE_FORMAT.format(new Date()), sb);
writer.write(sb2);
writer.flush();
} catch (Exception e) {
e.printStackTrace();
}
}
public void debug(String msg) {
log(Level.DEBUG, msg);
}
public void debug(String format, Object... objs) {
debug(String.format(format, objs));
}
public void info(String msg) {
log(Level.INFO, msg);
}
public void info(String format, Object... objs) {
info(String.format(format, objs));
}
public void warning(String msg) {
log(Level.WARNING, msg);
}
public void warning(String format, Object... objs) {
warning(String.format(format, objs));
}
public void warning(Throwable e) {
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));
log(Level.WARNING, "Exception: " + sw);
}
} }
@@ -2,11 +2,7 @@ package customskinloader.config;
import java.io.File; import java.io.File;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.ArrayList; import java.util.*;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Objects;
import customskinloader.CustomSkinLoader; import customskinloader.CustomSkinLoader;
import customskinloader.loader.ProfileLoader; import customskinloader.loader.ProfileLoader;
@@ -29,9 +25,9 @@ public class Config {
public boolean enableDynamicSkull = true; public boolean enableDynamicSkull = true;
public boolean enableTransparentSkin = true; public boolean enableTransparentSkin = true;
public boolean forceIgnoreHttpsCertificate = false; public boolean forceIgnoreHttpsCertificate = false;
public boolean forceLoadAllTextures = false; public boolean forceLoadAllTextures = true;
public boolean enableCape = true; public boolean enableCape = true;
public int threadPoolSize = 3; public int threadPoolSize = 8;
/** /**
* Can logger write message to standard output(System.out). * Can logger write message to standard output(System.out).
* Because standard output won't write to latest.log after Forge 1.17, * Because standard output won't write to latest.log after Forge 1.17,
@@ -233,7 +229,7 @@ public class Config {
profiles.addAll(defaultProfiles); profiles.addAll(defaultProfiles);
} }
} }
profiles.sort((c1, c2) -> Integer.compare(c1.getPriority(), c2.getPriority())); profiles.sort(Comparator.comparingInt(ICustomSkinLoaderPlugin.IDefaultProfile::getPriority));
List<SkinSiteProfile> loadlist = new ArrayList<>(); List<SkinSiteProfile> loadlist = new ArrayList<>();
for (ICustomSkinLoaderPlugin.IDefaultProfile profile : profiles) { for (ICustomSkinLoaderPlugin.IDefaultProfile profile : profiles) {
@@ -30,14 +30,15 @@ public class FakeCapeBuffer extends FakeSkinBuffer {
image = resetImageFormat(image, 22, 0, 46, 22); image = resetImageFormat(image, 22, 0, 46, 22);
return image; return image;
} }
} catch (IOException | NoSuchElementException ignored) { } } catch (IOException | NoSuchElementException ignored) {
}
return null; return null;
} }
private int loaded = 0; private int loaded = 0;
private double ratioX = -1; private double ratioX = -1;
private double ratioY = -1; private double ratioY = -1;
private ResourceLocation location; private final ResourceLocation location;
private String type = null; private String type = null;
public FakeCapeBuffer(ResourceLocation location) { public FakeCapeBuffer(ResourceLocation location) {
@@ -47,11 +48,19 @@ public class FakeCapeBuffer extends FakeSkinBuffer {
@Override @Override
public FakeImage parseUserSkin(FakeImage image) { public FakeImage parseUserSkin(FakeImage image) {
if (image == null) return null; if (image == null) return null;
this.image = image; if (isOptiFineCape(image)) {
//OptiFine cape should be converted to standard cape
this.image = convertOptiFineCape(image);
//OptiFine cape contains elytra texture
//this.type = "elytra";//But its elytra texture doesn't work
} else {
this.image = image;
}
// When resource packs were changed, the elytra image needs to be reloaded, and here will be entered again // When resource packs were changed, the elytra image needs to be reloaded, and here will be entered again
// The first cape which find elytra texture is outdated will reload it
if (this.loaded == loadedGlobal) { if (this.loaded == loadedGlobal) {
elytraImage = loadElytra(image); elytraImage = loadElytra(this.image);
} }
this.loaded = loadedGlobal; this.loaded = loadedGlobal;
if (elytraImage != null) { if (elytraImage != null) {
@@ -126,15 +135,16 @@ public class FakeCapeBuffer extends FakeSkinBuffer {
/** /**
* Traverse every elytra pixel * Traverse every elytra pixel
* @param predicate the predicate with x and y *
* @param returnValue if the condition flag equals the condition, then return this value * @param predicate the predicate with x and y
* @param returnValue if the condition flag equals the condition, then return this value
* @param defaultReturnValue otherwise return this value * @param defaultReturnValue otherwise return this value
*/ */
private <R> R withElytraPixels(BiPredicate<Integer, Integer> predicate, R returnValue, R defaultReturnValue) { private <R> R withElytraPixels(BiPredicate<Integer, Integer> predicate, R returnValue, R defaultReturnValue) {
int startX = (int) Math.ceil(22 * ratioX), endX = (int) Math.ceil(46 * ratioX); int startX = (int) Math.ceil(22 * ratioX), endX = (int) Math.ceil(46 * ratioX);
int startY = (int) Math.ceil(0 * ratioY), endY = (int) Math.ceil(22 * ratioY); int startY = (int) Math.ceil(0 * ratioY), endY = (int) Math.ceil(22 * ratioY);
int excludeX0 = (int) Math.ceil(24 * ratioX), excludeX1 = (int) Math.ceil(44 * ratioX); int excludeX0 = (int) Math.ceil(24 * ratioX), excludeX1 = (int) Math.ceil(44 * ratioX);
int excludeY = (int) Math.ceil(2 * ratioY); int excludeY = (int) Math.ceil(2 * ratioY);
for (int x = startX; x < endX; ++x) { for (int x = startX; x < endX; ++x) {
for (int y = startY; y < endY; ++y) { for (int y = startY; y < endY; ++y) {
if (y < excludeY && (x < excludeX0 || x >= excludeX1)) continue; if (y < excludeY && (x < excludeX0 || x >= excludeX1)) continue;
@@ -167,24 +177,27 @@ public class FakeCapeBuffer extends FakeSkinBuffer {
/** /**
* Scale image * Scale image
* @param image the image to scale. *
* @param image the image to scale.
* @param closeOldImage whether close old image * @param closeOldImage whether close old image
* @param scaleWidth width enlargement ratio * @param scaleWidth width enlargement ratio
* @param scaleHeight height enlargement ratio * @param scaleHeight height enlargement ratio
* @param ratioX the ratio of 64 of the old image width * @param ratioX the ratio of 64 of the old image width
* @param ratioY the ratio of 32 of the old image height * @param ratioY the ratio of 32 of the old image height
* @param width the width after scaling. * @param width the width after scaling.
* @param height the height after scaling. * @param height the height after scaling.
* @param startX the x where start to copy. * @param startX the x where start to copy.
* @param startY the y where start to copy. * @param startY the y where start to copy.
* @param endX the x where end to copy. * @param endX the x where end to copy.
* @param endY the y where end to copy. * @param endY the y where end to copy.
* @return the image after scaling. * @return the image after scaling.
*/ */
private static FakeImage scaleImage(FakeImage image, boolean closeOldImage, double scaleWidth, double scaleHeight, double ratioX, double ratioY, int width, int height, int startX, int startY, int endX, int endY) { private static FakeImage scaleImage(FakeImage image, boolean closeOldImage, double scaleWidth, double scaleHeight, double ratioX, double ratioY, int width, int height, int startX, int startY, int endX, int endY) {
FakeImage newImage = image.createImage(width, height); FakeImage newImage = image.createImage(width, height);
startX = (int) (startX * ratioX); endX = (int) (endX * ratioX); startX = (int) (startX * ratioX);
startY = (int) (startY * ratioY); endY = (int) (endY * ratioY); endX = (int) (endX * ratioX);
startY = (int) (startY * ratioY);
endY = (int) (endY * ratioY);
int x0 = (int) (startX * scaleWidth), x1 = (int) ((startX + 1) * scaleWidth), dx0 = x1 - x0; int x0 = (int) (startX * scaleWidth), x1 = (int) ((startX + 1) * scaleWidth), dx0 = x1 - x0;
for (int x = startX; x < endX; ++x) { for (int x = startX; x < endX; ++x) {
@@ -196,12 +209,61 @@ public class FakeCapeBuffer extends FakeSkinBuffer {
newImage.setRGBA(x0 + dx, y0 + dy, rgba); newImage.setRGBA(x0 + dx, y0 + dy, rgba);
} }
} }
y0 = y1; y1 = (int) ((y + 2) * scaleHeight); dy0 = y1 - y0; y0 = y1;
y1 = (int) ((y + 2) * scaleHeight);
dy0 = y1 - y0;
} }
x0 = x1; x1 = (int) ((x + 2) * scaleWidth); dx0 = x1 - x0; x0 = x1;
x1 = (int) ((x + 2) * scaleWidth);
dx0 = x1 - x0;
} }
if (closeOldImage) if (closeOldImage)
image.close(); image.close();
return newImage; return newImage;
} }
/**
* Judge OptiFine cape.
* OptiFine cape is 46*22 or 92*44 pixels.
* <a href="https://optifine.net/capes/Notch.png">46*22 example</a>
* <a href="https://optifine.net/capes/OptiFineCape.png">92*44 example</a>
*
* @param image cape image
* @return true if is OptiFine cape
* @since 14.16
*/
private static boolean isOptiFineCape(FakeImage image) {
int ratio = image.getWidth() / 46;
return image.getHeight() == 22 * ratio && image.getWidth() == 46 * ratio;
}
/**
* Convert OptiFine cape to standard cape
*
* @param image OptiFine cape image
* @return standard cape image
* @since 14.16
*/
private static FakeImage convertOptiFineCape(FakeImage image) {
int ratio = image.getWidth() / 46;
FakeImage newImage = image.createImage(64 * ratio, 32 * ratio);
copyImageData(image, newImage);
return newImage;
}
/**
* Copy image data to another image
*
* @param from from image
* @param to to image
*/
private static void copyImageData(FakeImage from, FakeImage to) {
int width = Math.min(from.getWidth(), to.getWidth());
int height = Math.min(from.getHeight(), to.getHeight());
for (int x = 0; x < width; ++x) {
for (int y = 0; y < height; ++y) {
to.setRGBA(x, y, from.getRGBA(x, y));
}
}
}
} }
@@ -2,6 +2,7 @@ package customskinloader.fake;
import java.io.File; import java.io.File;
import java.util.Map; import java.util.Map;
import java.util.Optional;
import com.mojang.authlib.minecraft.MinecraftProfileTexture; import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import customskinloader.utils.HttpTextureUtil; import customskinloader.utils.HttpTextureUtil;
@@ -29,9 +30,13 @@ public class FakeMinecraftProfileTexture extends MinecraftProfileTexture {
return this.info.url; return this.info.url;
} }
public String getRawUrl() {
return super.getUrl();
}
@Override @Override
public String getHash() { public String getHash() {
return this.info.hash; return this.info.hash == null ? super.getHash() : this.info.hash;
} }
public File getCacheFile() { public File getCacheFile() {
@@ -61,11 +61,11 @@ public class FakeSkinManager {
FakeMinecraftProfileTexture fakeProfileTexture = (FakeMinecraftProfileTexture) profileTexture; FakeMinecraftProfileTexture fakeProfileTexture = (FakeMinecraftProfileTexture) profileTexture;
ResourceLocation resourcelocation = fakeProfileTexture.getResourceLocation(); ResourceLocation resourcelocation = fakeProfileTexture.getResourceLocation();
if (fakeProfileTexture.getResourceLocation() != null) { if (fakeProfileTexture.getResourceLocation() != null) {
params[0] = ((FakeMinecraftProfileTexture) profileTexture).getCacheFile(); params[0] = fakeProfileTexture.getCacheFile();
if (params[params.length - 2] instanceof Boolean) { if (params[params.length - 2] instanceof Boolean) {
params[params.length - 2] = true; params[params.length - 2] = true;
} }
params[params.length - 1] = fakeManager.new BaseBuffer(skinAvailableCallback, textureType, resourcelocation, profileTexture); params[params.length - 1] = fakeManager.new BaseBuffer(skinAvailableCallback, textureType, resourcelocation, fakeProfileTexture);
} }
} }
return params; return params;
@@ -138,9 +138,9 @@ public class FakeSkinManager {
private SkinManager.SkinAvailableCallback callback; private SkinManager.SkinAvailableCallback callback;
private MinecraftProfileTexture.Type type; private MinecraftProfileTexture.Type type;
private ResourceLocation location; private ResourceLocation location;
private MinecraftProfileTexture texture; private FakeMinecraftProfileTexture texture;
public BaseBuffer(SkinManager.SkinAvailableCallback callback, MinecraftProfileTexture.Type type, ResourceLocation location, MinecraftProfileTexture texture) { public BaseBuffer(SkinManager.SkinAvailableCallback callback, MinecraftProfileTexture.Type type, ResourceLocation location, FakeMinecraftProfileTexture texture) {
switch (type) { switch (type) {
case SKIN: this.buffer = new FakeSkinBuffer(); break; case SKIN: this.buffer = new FakeSkinBuffer(); break;
case CAPE: this.buffer = new FakeCapeBuffer(location); break; case CAPE: this.buffer = new FakeCapeBuffer(location); break;
@@ -168,7 +168,7 @@ public class FakeSkinManager {
Map<String, String> metadata = Maps.newHashMap(); Map<String, String> metadata = Maps.newHashMap();
String type = ((FakeSkinBuffer) buffer).judgeType(); String type = ((FakeSkinBuffer) buffer).judgeType();
metadata.put("model", type); metadata.put("model", type);
texture = new MinecraftProfileTexture(texture.getUrl(), metadata); texture = new FakeMinecraftProfileTexture(texture.getRawUrl(), metadata);
FakeSkinManager.this.modelCache.put(location, texture); FakeSkinManager.this.modelCache.put(location, texture);
} }
} }
@@ -22,7 +22,21 @@ public class JsonAPILoader implements ICustomSkinLoaderPlugin, ProfileLoader.IPr
String toJsonUrl(String root, String username); String toJsonUrl(String root, String username);
String getPayload(SkinSiteProfile ssp); default String getPayload(SkinSiteProfile ssp) {
return null;
}
/**
* get JSON API payload, which will make a POST request
*
* @param ssp skin site profile
* @param username username
* @return JSON payload
* @since 14.16
*/
default String getPayload(SkinSiteProfile ssp, String username) {
return getPayload(ssp);
}
UserProfile toUserProfile(String root, String json, boolean local); UserProfile toUserProfile(String root, String json, boolean local);
@@ -93,8 +107,15 @@ public class JsonAPILoader implements ICustomSkinLoaderPlugin, ProfileLoader.IPr
} }
json = IOUtils.toString(Files.newInputStream(jsonFile.toPath()), StandardCharsets.UTF_8); json = IOUtils.toString(Files.newInputStream(jsonFile.toPath()), StandardCharsets.UTF_8);
} else { } else {
HttpRequestUtil.HttpResponce responce = HttpRequestUtil.makeHttpRequest(new HttpRequestUtil.HttpRequest(jsonUrl).setCacheTime(90).setUserAgent(ssp.userAgent).setPayload(this.jsonAPI.getPayload(ssp))); try {
json = responce.content; HttpRequestUtil.HttpResponce responce = HttpRequestUtil
.makeHttpRequest(new HttpRequestUtil.HttpRequest(jsonUrl).setCacheTime(90)
.setUserAgent(ssp.userAgent).setPayload(this.jsonAPI.getPayload(ssp, username)));
json = responce.content;
} catch (ProfileNotFoundException ignored) {
CustomSkinLoader.logger.info("Profile not found.");
return null;
}
} }
if (json == null || json.equals("")) { if (json == null || json.equals("")) {
CustomSkinLoader.logger.info("Profile not found."); CustomSkinLoader.logger.info("Profile not found.");
@@ -135,4 +156,11 @@ public class JsonAPILoader implements ICustomSkinLoaderPlugin, ProfileLoader.IPr
f.mkdirs(); f.mkdirs();
} }
} }
/**
* When getting payload, this exception can end skin loading
* @since 14.16
*/
public static class ProfileNotFoundException extends RuntimeException {
}
} }
@@ -1,11 +1,11 @@
package customskinloader.loader; package customskinloader.loader;
import java.io.File; import java.io.File;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.function.Consumer; import java.util.function.Consumer;
import com.google.common.collect.Lists;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import customskinloader.CustomSkinLoader; import customskinloader.CustomSkinLoader;
import customskinloader.config.SkinSiteProfile; import customskinloader.config.SkinSiteProfile;
@@ -24,7 +24,12 @@ public class LegacyLoader implements ICustomSkinLoaderPlugin, ProfileLoader.IPro
@Override @Override
public List<IDefaultProfile> getDefaultProfiles() { public List<IDefaultProfile> getDefaultProfiles() {
return Collections.singletonList(new LocalSkin(this)); return Lists.newArrayList(new LocalSkin(this),
getCapeProfile(this, "OptiFine", "https://optifine.net/capes/{USERNAME}.png", 810),
getCapeProfile(this, "CloakPlus", "http://161.35.130.99/capes/{USERNAME}.png", 840),
getCapeProfile(this, "LabyMod", "https://dl.labymod.net/capes/{STANDARD_UUID}", 850),
getCapeProfile(this, "Cosmetica", "https://api.cosmetica.cc/get/cloak?username={USERNAME}&uuid={STANDARD_UUID}&nothirdparty", 860)
);
} }
public abstract static class DefaultProfile implements ICustomSkinLoaderPlugin.IDefaultProfile { public abstract static class DefaultProfile implements ICustomSkinLoaderPlugin.IDefaultProfile {
@@ -75,7 +80,7 @@ public class LegacyLoader implements ICustomSkinLoaderPlugin, ProfileLoader.IPro
@Override @Override
public int getPriority() { public int getPriority() {
return 600; return 710;
} }
@Override @Override
@@ -94,18 +99,48 @@ public class LegacyLoader implements ICustomSkinLoaderPlugin, ProfileLoader.IPro
} }
} }
// // Minecrack could not load skin correctly /**
// public static class Minecrack extends LegacyLoader.DefaultProfile { * Get cape Profile¬
// public Minecrack(LegacyLoader loader) { super(loader); } *
// @Override public String getName() { return "Minecrack"; } * @since 14.16
// @Override public int getPriority() { return 600; } */
// @Override public String getSkinRoot() { return "http://minecrack.fr.nf/mc/skinsminecrackd/{USERNAME}.png"; } public static LegacyLoader.DefaultProfile getCapeProfile(LegacyLoader loader, String name, String capeRoot, int priority) {
// @Override public String getCapeRoot() { return "http://minecrack.fr.nf/mc/cloaksminecrackd/{USERNAME}.png"; } return new DefaultProfile(loader) {
// @Override public String getElytraRoot() { return null; } @Override
// } public String getSkinRoot() {
return null;
}
@Override
public String getCapeRoot() {
return capeRoot;
}
@Override
public String getElytraRoot() {
return null;
}
@Override
public String getName() {
return name;
}
@Override
public int getPriority() {
return priority;
}
};
}
public static final String USERNAME_PLACEHOLDER = "{USERNAME}"; public static final String USERNAME_PLACEHOLDER = "{USERNAME}";
public static final String UUID_PLACEHOLDER = "{UUID}"; public static final String UUID_PLACEHOLDER = "{UUID}";
/**
* Mojang UUID with -
*
* @since 14.16
*/
public static final String STANDARD_UUID_PLACEHOLDER = "{STANDARD_UUID}";
@Override @Override
public UserProfile loadProfile(SkinSiteProfile ssp, GameProfile gameProfile) { public UserProfile loadProfile(SkinSiteProfile ssp, GameProfile gameProfile) {
@@ -187,14 +222,15 @@ public class LegacyLoader implements ICustomSkinLoaderPlugin, ProfileLoader.IPro
private String expandURL(String url, String username) { private String expandURL(String url, String username) {
String t = url.replace(USERNAME_PLACEHOLDER, username); String t = url.replace(USERNAME_PLACEHOLDER, username);
if (!t.contains(UUID_PLACEHOLDER)) { if (!t.contains(UUID_PLACEHOLDER) && !t.contains(STANDARD_UUID_PLACEHOLDER)) {
return t; return t;
} }
String uuid = MojangAPILoader.getMojangUuidByUsername(username); String uuid = MojangAPILoader.getMojangUuidByUsername(username, true);
//If Mojang uuid not found, won't load the texture //If Mojang uuid not found, won't load the texture
if (uuid == null) { if (uuid == null) {
return null; return null;
} }
return t.replace(UUID_PLACEHOLDER, uuid); String styledUuid = uuid.replace("-", "");
return t.replace(UUID_PLACEHOLDER, styledUuid).replace(STANDARD_UUID_PLACEHOLDER, uuid);
} }
} }
@@ -5,6 +5,7 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
@@ -24,7 +25,6 @@ import customskinloader.plugin.ICustomSkinLoaderPlugin;
import customskinloader.profile.ModelManager0; import customskinloader.profile.ModelManager0;
import customskinloader.profile.UserProfile; import customskinloader.profile.UserProfile;
import customskinloader.utils.HttpRequestUtil; import customskinloader.utils.HttpRequestUtil;
import org.apache.commons.codec.Charsets;
import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@@ -93,7 +93,7 @@ public class MojangAPILoader implements ICustomSkinLoaderPlugin, ProfileLoader.I
return ModelManager0.toUserProfile(map); return ModelManager0.toUserProfile(map);
} }
String username = gameProfile.getName(); String username = gameProfile.getName();
GameProfile newGameProfile = loadGameProfile(ssp.apiRoot, username); GameProfile newGameProfile = loadGameProfileCached(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;
@@ -108,6 +108,13 @@ public class MojangAPILoader implements ICustomSkinLoaderPlugin, ProfileLoader.I
return null; return null;
} }
private static final Map<String, GameProfile> gameProfileCache = new ConcurrentHashMap<>();
public static GameProfile loadGameProfileCached(String apiRoot, String username) {
return gameProfileCache.computeIfAbsent(apiRoot + " " + username,
ignored -> loadGameProfile(apiRoot, username));
}
//Username -> UUID //Username -> UUID
public static GameProfile loadGameProfile(String apiRoot, String username) { public static GameProfile loadGameProfile(String apiRoot, String username) {
//Doc (https://wiki.vg/Mojang_API#Playernames_-.3E_UUIDs) //Doc (https://wiki.vg/Mojang_API#Playernames_-.3E_UUIDs)
@@ -137,14 +144,16 @@ public class MojangAPILoader implements ICustomSkinLoaderPlugin, ProfileLoader.I
* Get Mojang UUID by username. * Get Mojang UUID by username.
* *
* @param username username to query * @param username username to query
* @param standard if - in UUID
* @return UUID in Mojang API style string. Returns {@code null} if username not found in Mojang API. * @return UUID in Mojang API style string. Returns {@code null} if username not found in Mojang API.
*/ */
public static String getMojangUuidByUsername(String username) { public static String getMojangUuidByUsername(String username, boolean standard) {
GameProfile profile = loadGameProfile(getMojangApiRoot(), username); GameProfile profile = loadGameProfileCached(getMojangApiRoot(), username);
if (profile == null) { if (profile == null) {
return null; return null;
} }
return UUIDTypeAdapter.fromUUID(profile.getId()); UUID id = profile.getId();
return standard ? id.toString() : UUIDTypeAdapter.fromUUID(id);
} }
//UUID -> Profile //UUID -> Profile
@@ -6,7 +6,6 @@ import java.util.Map;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import customskinloader.CustomSkinLoader; import customskinloader.CustomSkinLoader;
import customskinloader.config.SkinSiteProfile;
import customskinloader.loader.JsonAPILoader; import customskinloader.loader.JsonAPILoader;
import customskinloader.plugin.ICustomSkinLoaderPlugin; import customskinloader.plugin.ICustomSkinLoaderPlugin;
import customskinloader.profile.ModelManager0; import customskinloader.profile.ModelManager0;
@@ -17,17 +16,45 @@ import org.apache.commons.lang3.StringUtils;
public class CustomSkinAPI implements JsonAPILoader.IJsonAPI { public class CustomSkinAPI implements JsonAPILoader.IJsonAPI {
public static class LittleSkin extends JsonAPILoader.DefaultProfile { public static class LittleSkin extends JsonAPILoader.DefaultProfile {
public LittleSkin(JsonAPILoader loader) { super(loader); } public LittleSkin(JsonAPILoader loader) {
@Override public String getName() { return "LittleSkin"; } super(loader);
@Override public int getPriority() { return 200; } }
@Override public String getRoot() { return "https://littleskin.cn/csl/"; }
@Override
public String getName() {
return "LittleSkin";
}
@Override
public int getPriority() {
return 200;
}
@Override
public String getRoot() {
return "https://littleskin.cn/csl/";
}
} }
public static class BlessingSkin extends JsonAPILoader.DefaultProfile { public static class BlessingSkin extends JsonAPILoader.DefaultProfile {
public BlessingSkin(JsonAPILoader loader) { super(loader); } public BlessingSkin(JsonAPILoader loader) {
@Override public String getName() { return "BlessingSkin"; } super(loader);
@Override public int getPriority() { return 300; } }
@Override public String getRoot() { return "https://skin.prinzeugen.net/"; }
@Override
public String getName() {
return "BlessingSkin";
}
@Override
public int getPriority() {
return 300;
}
@Override
public String getRoot() {
return "https://skin.prinzeugen.net/";
}
} }
// // OneSkin has been removed temporarily // // OneSkin has been removed temporarily
@@ -38,8 +65,8 @@ public class CustomSkinAPI implements JsonAPILoader.IJsonAPI {
// @Override public String getRoot() { return "http://fleey.cn/skin/skin_user/skin_json.php/"; } // @Override public String getRoot() { return "http://fleey.cn/skin/skin_user/skin_json.php/"; }
// } // }
private static final String TEXTURES="textures/"; private static final String TEXTURES = "textures/";
private static final String SUFFIX=".json"; private static final String SUFFIX = ".json";
@Override @Override
public List<ICustomSkinLoaderPlugin.IDefaultProfile> getDefaultProfiles(JsonAPILoader loader) { public List<ICustomSkinLoaderPlugin.IDefaultProfile> getDefaultProfiles(JsonAPILoader loader) {
@@ -53,65 +80,63 @@ public class CustomSkinAPI implements JsonAPILoader.IJsonAPI {
@Override @Override
public UserProfile toUserProfile(String root, String json, boolean local) { public UserProfile toUserProfile(String root, String json, boolean local) {
CustomSkinAPIProfile profile=CustomSkinLoader.GSON.fromJson(json, CustomSkinAPIProfile.class); CustomSkinAPIProfile profile = CustomSkinLoader.GSON.fromJson(json, CustomSkinAPIProfile.class);
UserProfile p=new UserProfile(); UserProfile p = new UserProfile();
if(StringUtils.isNotBlank(profile.skin)){ if (StringUtils.isNotBlank(profile.skin)) {
p.skinUrl=root+TEXTURES+profile.skin; p.skinUrl = root + TEXTURES + profile.skin;
if(local) if (local)
p.skinUrl=HttpTextureUtil.getLocalFakeUrl(p.skinUrl); p.skinUrl = HttpTextureUtil.getLocalFakeUrl(p.skinUrl);
} }
if(StringUtils.isNotBlank(profile.cape)){ if (StringUtils.isNotBlank(profile.cape)) {
p.capeUrl=root+TEXTURES+profile.cape; p.capeUrl = root + TEXTURES + profile.cape;
if(local) if (local)
p.capeUrl=HttpTextureUtil.getLocalFakeUrl(p.capeUrl); p.capeUrl = HttpTextureUtil.getLocalFakeUrl(p.capeUrl);
} }
if(StringUtils.isNotBlank(profile.elytra)){ if (StringUtils.isNotBlank(profile.elytra)) {
p.elytraUrl=root+TEXTURES+profile.elytra; p.elytraUrl = root + TEXTURES + profile.elytra;
if(local) if (local)
p.elytraUrl=HttpTextureUtil.getLocalFakeUrl(p.elytraUrl); p.elytraUrl = HttpTextureUtil.getLocalFakeUrl(p.elytraUrl);
} }
Map<String,String> textures=new LinkedHashMap<>(); Map<String, String> textures = new LinkedHashMap<>();
if(profile.skins!=null) if (profile.skins != null)
textures.putAll(profile.skins); textures.putAll(profile.skins);
if(profile.textures!=null) if (profile.textures != null)
textures.putAll(profile.textures); textures.putAll(profile.textures);
if(textures.isEmpty()) if (textures.isEmpty())
return p; return p;
boolean hasSkin=false; boolean hasSkin = false;
for(String model:textures.keySet()){ for (String model : textures.keySet()) {
ModelManager0.Model enumModel=ModelManager0.getEnumModel(model); ModelManager0.Model enumModel = ModelManager0.getEnumModel(model);
if(enumModel==null||StringUtils.isEmpty(textures.get(model))) if (enumModel == null || StringUtils.isEmpty(textures.get(model)))
continue; continue;
if(ModelManager0.isSkin(enumModel)) if (ModelManager0.isSkin(enumModel))
if(hasSkin) if (hasSkin)
continue; continue;
else else
hasSkin=true; hasSkin = true;
String url=root+TEXTURES+textures.get(model); String url = root + TEXTURES + textures.get(model);
if(local) if (local)
url=HttpTextureUtil.getLocalFakeUrl(url); url = HttpTextureUtil.getLocalFakeUrl(url);
p.put(enumModel, url); p.put(enumModel, url);
} }
return p; return p;
} }
private static class CustomSkinAPIProfile{
public String username;
public LinkedHashMap<String,String> textures;
public LinkedHashMap<String,String> skins; private static class CustomSkinAPIProfile {
public String username;
public LinkedHashMap<String, String> textures;
public LinkedHashMap<String, String> skins;
public String skin; public String skin;
public String cape; public String cape;
public String elytra; public String elytra;
} }
@Override
public String getPayload(SkinSiteProfile ssp) {
return null;
}
@Override @Override
public String getName() { public String getName() {
return "CustomSkinAPI"; return "CustomSkinAPI";
@@ -7,7 +7,6 @@ import com.google.common.collect.Lists;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import com.mojang.authlib.minecraft.MinecraftProfileTexture; import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import customskinloader.config.SkinSiteProfile;
import customskinloader.loader.JsonAPILoader; import customskinloader.loader.JsonAPILoader;
import customskinloader.plugin.ICustomSkinLoaderPlugin; import customskinloader.plugin.ICustomSkinLoaderPlugin;
import customskinloader.profile.ModelManager0; import customskinloader.profile.ModelManager0;
@@ -16,17 +15,45 @@ import customskinloader.profile.UserProfile;
public class ElyByAPI implements JsonAPILoader.IJsonAPI { public class ElyByAPI implements JsonAPILoader.IJsonAPI {
public static class ElyBy extends JsonAPILoader.DefaultProfile { public static class ElyBy extends JsonAPILoader.DefaultProfile {
public ElyBy(JsonAPILoader loader) { super(loader); } public ElyBy(JsonAPILoader loader) {
@Override public String getName() { return "ElyBy"; } super(loader);
@Override public int getPriority() { return 400; } }
@Override public String getRoot() { return "http://skinsystem.ely.by/textures/"; }
@Override
public String getName() {
return "ElyBy";
}
@Override
public int getPriority() {
return 400;
}
@Override
public String getRoot() {
return "http://skinsystem.ely.by/textures/";
}
} }
public static class TLauncher extends JsonAPILoader.DefaultProfile { public static class TLauncher extends JsonAPILoader.DefaultProfile {
public TLauncher(JsonAPILoader loader) { super(loader); } public TLauncher(JsonAPILoader loader) {
@Override public String getName() { return "TLauncher"; } super(loader);
@Override public int getPriority() { return 550; } }
@Override public String getRoot() { return "https://auth.tlauncher.org/skin/profile/texture/login/"; }
@Override
public String getName() {
return "TLauncher";
}
@Override
public int getPriority() {
return 550;
}
@Override
public String getRoot() {
return "https://auth.tlauncher.org/skin/profile/texture/login/";
}
} }
@Override @Override
@@ -41,15 +68,11 @@ public class ElyByAPI implements JsonAPILoader.IJsonAPI {
@Override @Override
public UserProfile toUserProfile(String root, String json, boolean local) { public UserProfile toUserProfile(String root, String json, boolean local) {
Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> result = new Gson().fromJson(json, new TypeToken<Map<MinecraftProfileTexture.Type, MinecraftProfileTexture>>() { }.getType()); Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> result = new Gson().fromJson(json, new TypeToken<Map<MinecraftProfileTexture.Type, MinecraftProfileTexture>>() {
}.getType());
return ModelManager0.toUserProfile(result); return ModelManager0.toUserProfile(result);
} }
@Override
public String getPayload(SkinSiteProfile ssp) {
return null;
}
@Override @Override
public String getName() { public String getName() {
return "ElyByAPI"; return "ElyByAPI";
@@ -6,7 +6,6 @@ import java.util.Map;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.mojang.authlib.minecraft.MinecraftProfileTexture; import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import customskinloader.config.SkinSiteProfile;
import customskinloader.loader.JsonAPILoader; import customskinloader.loader.JsonAPILoader;
import customskinloader.plugin.ICustomSkinLoaderPlugin; import customskinloader.plugin.ICustomSkinLoaderPlugin;
import customskinloader.profile.ModelManager0; import customskinloader.profile.ModelManager0;
@@ -15,10 +14,24 @@ import customskinloader.profile.UserProfile;
public class GlitchlessAPI implements JsonAPILoader.IJsonAPI { public class GlitchlessAPI implements JsonAPILoader.IJsonAPI {
public static class GlitchlessGames extends JsonAPILoader.DefaultProfile { public static class GlitchlessGames extends JsonAPILoader.DefaultProfile {
public GlitchlessGames(JsonAPILoader loader) { super(loader); } public GlitchlessGames(JsonAPILoader loader) {
@Override public String getName() { return "GlitchlessGames"; } super(loader);
@Override public int getPriority() { return 700; } }
@Override public String getRoot() { return "https://games.glitchless.ru/api/minecraft/users/profiles/textures/?nickname="; }
@Override
public String getName() {
return "GlitchlessGames";
}
@Override
public int getPriority() {
return 700;
}
@Override
public String getRoot() {
return "https://games.glitchless.ru/api/minecraft/users/profiles/textures/?nickname=";
}
} }
@Override @Override
@@ -40,11 +53,6 @@ public class GlitchlessAPI implements JsonAPILoader.IJsonAPI {
return ModelManager0.toUserProfile(result.textures); return ModelManager0.toUserProfile(result.textures);
} }
@Override
public String getPayload(SkinSiteProfile ssp) {
return null;
}
@Override @Override
public String getName() { public String getName() {
return "GlitchlessAPI"; return "GlitchlessAPI";
@@ -2,22 +2,15 @@ package customskinloader.loader.jsonapi;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import customskinloader.CustomSkinLoader;
import customskinloader.Logger;
import customskinloader.config.SkinSiteProfile; import customskinloader.config.SkinSiteProfile;
import customskinloader.loader.JsonAPILoader; import customskinloader.loader.JsonAPILoader;
import customskinloader.loader.MojangAPILoader; import customskinloader.loader.MojangAPILoader;
import customskinloader.plugin.ICustomSkinLoaderPlugin; import customskinloader.plugin.ICustomSkinLoaderPlugin;
import customskinloader.profile.ModelManager0;
import customskinloader.profile.UserProfile; import customskinloader.profile.UserProfile;
import customskinloader.utils.HttpTextureUtil; import customskinloader.utils.TextureUtil;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.List; import java.util.List;
import java.util.Map;
public class MinecraftCapesAPI implements JsonAPILoader.IJsonAPI { public class MinecraftCapesAPI implements JsonAPILoader.IJsonAPI {
@@ -49,7 +42,7 @@ public class MinecraftCapesAPI implements JsonAPILoader.IJsonAPI {
@Override @Override
public String toJsonUrl(String root, String username) { public String toJsonUrl(String root, String username) {
String uuid = MojangAPILoader.getMojangUuidByUsername(username); String uuid = MojangAPILoader.getMojangUuidByUsername(username, false);
//If uuid cannot be found, we won't load profile in this API. //If uuid cannot be found, we won't load profile in this API.
if (uuid == null) { if (uuid == null) {
return null; return null;
@@ -65,23 +58,8 @@ public class MinecraftCapesAPI implements JsonAPILoader.IJsonAPI {
return null; return null;
} }
String capeBase64 = result.textures.cape;
byte[] capeBytes = Base64.decodeBase64(capeBase64);
String hash = HttpTextureUtil.getHash(capeBytes);
File cacheFile = HttpTextureUtil.getCacheFile(hash);
String fakeUrl = HttpTextureUtil.getBase64FakeUrl(hash);
//Save base64 image to cache file
try {
FileUtils.writeByteArrayToFile(cacheFile, capeBytes);
CustomSkinLoader.logger.info("Saved base64 image to " + cacheFile);
} catch (Exception e) {
CustomSkinLoader.logger.warning("Error parsing base64 image: " + capeBase64);
return null;
}
UserProfile profile = new UserProfile(); UserProfile profile = new UserProfile();
profile.capeUrl = fakeUrl; profile.capeUrl = TextureUtil.parseBase64Texture(result.textures.cape);
return profile; return profile;
} }
@@ -5,7 +5,6 @@ import java.util.Map;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import customskinloader.CustomSkinLoader; import customskinloader.CustomSkinLoader;
import customskinloader.config.SkinSiteProfile;
import customskinloader.loader.JsonAPILoader; import customskinloader.loader.JsonAPILoader;
import customskinloader.plugin.ICustomSkinLoaderPlugin; import customskinloader.plugin.ICustomSkinLoaderPlugin;
import customskinloader.profile.ModelManager0; import customskinloader.profile.ModelManager0;
@@ -16,14 +15,28 @@ import org.apache.commons.lang3.StringUtils;
public class UniSkinAPI implements JsonAPILoader.IJsonAPI { public class UniSkinAPI implements JsonAPILoader.IJsonAPI {
public static class SkinMe extends JsonAPILoader.DefaultProfile { public static class SkinMe extends JsonAPILoader.DefaultProfile {
public SkinMe(JsonAPILoader loader) { super(loader); } public SkinMe(JsonAPILoader loader) {
@Override public String getName() { return "SkinMe"; } super(loader);
@Override public int getPriority() { return 500; } }
@Override public String getRoot() { return "http://www.skinme.cc/uniskin/"; }
@Override
public String getName() {
return "SkinMe";
}
@Override
public int getPriority() {
return 500;
}
@Override
public String getRoot() {
return "http://www.skinme.cc/uniskin/";
}
} }
private static final String TEXTURES="textures/"; private static final String TEXTURES = "textures/";
private static final String SUFFIX=".json"; private static final String SUFFIX = ".json";
@Override @Override
public List<ICustomSkinLoaderPlugin.IDefaultProfile> getDefaultProfiles(JsonAPILoader loader) { public List<ICustomSkinLoaderPlugin.IDefaultProfile> getDefaultProfiles(JsonAPILoader loader) {
@@ -37,55 +50,54 @@ public class UniSkinAPI implements JsonAPILoader.IJsonAPI {
@Override @Override
public UserProfile toUserProfile(String root, String json, boolean local) { public UserProfile toUserProfile(String root, String json, boolean local) {
UniSkinAPIProfile profile=CustomSkinLoader.GSON.fromJson(json, UniSkinAPIProfile.class); UniSkinAPIProfile profile = CustomSkinLoader.GSON.fromJson(json, UniSkinAPIProfile.class);
UserProfile p=new UserProfile(); UserProfile p = new UserProfile();
if(StringUtils.isNotBlank(profile.cape)){ if (StringUtils.isNotBlank(profile.cape)) {
p.capeUrl=root+TEXTURES+profile.cape; p.capeUrl = root + TEXTURES + profile.cape;
if(local) if (local)
p.capeUrl=HttpTextureUtil.getLocalFakeUrl(p.capeUrl); p.capeUrl = HttpTextureUtil.getLocalFakeUrl(p.capeUrl);
} }
if(profile.skins==null||profile.skins.isEmpty()) if (profile.skins == null || profile.skins.isEmpty())
return p; return p;
if(profile.model_preference==null||profile.model_preference.isEmpty()) if (profile.model_preference == null || profile.model_preference.isEmpty())
return p; return p;
boolean hasSkin=false; boolean hasSkin = false;
for(String model:profile.model_preference){ for (String model : profile.model_preference) {
ModelManager0.Model enumModel=ModelManager0.getEnumModel(model); ModelManager0.Model enumModel = ModelManager0.getEnumModel(model);
if(enumModel==null||StringUtils.isEmpty(profile.skins.get(model))) if (enumModel == null || StringUtils.isEmpty(profile.skins.get(model)))
continue; continue;
if(ModelManager0.isSkin(enumModel)) if (ModelManager0.isSkin(enumModel))
if(hasSkin) if (hasSkin)
continue; continue;
else else
hasSkin=true; hasSkin = true;
String url=root+TEXTURES+profile.skins.get(model); String url = root + TEXTURES + profile.skins.get(model);
if(local) if (local)
url=HttpTextureUtil.getLocalFakeUrl(url); url = HttpTextureUtil.getLocalFakeUrl(url);
p.put(enumModel, url); p.put(enumModel, url);
} }
return p; return p;
} }
/** /**
* Json profile for UniSkinAPI * Json profile for UniSkinAPI
* Source Code: https://github.com/RecursiveG/UniSkinMod/blob/master/src/main/java/org/devinprogress/uniskinmod/UniSkinApiProfile.java#L18-L22 * <a href="https://github.com/RecursiveG/UniSkinMod/blob/master/src/main/java/org/devinprogress/uniskinmod/UniSkinApiProfile.java#L18-L22">Source Code</a>
*
* @author RecursiveG * @author RecursiveG
*/ */
private class UniSkinAPIProfile{ private static class UniSkinAPIProfile {
public String player_name; public String player_name;
public long last_update; public long last_update;
public List<String> model_preference; public List<String> model_preference;
public Map<String,String> skins; public Map<String, String> skins;
public String cape; public String cape;
} }
@Override
public String getPayload(SkinSiteProfile ssp) {
return null;
}
@Override @Override
public String getName() { public String getName() {
return "UniSkinAPI"; return "UniSkinAPI";
@@ -0,0 +1,110 @@
package customskinloader.loader.jsonapi;
import com.google.common.collect.Lists;
import com.google.gson.Gson;
import customskinloader.CustomSkinLoader;
import customskinloader.config.SkinSiteProfile;
import customskinloader.loader.JsonAPILoader;
import customskinloader.loader.MojangAPILoader;
import customskinloader.plugin.ICustomSkinLoaderPlugin;
import customskinloader.profile.UserProfile;
import customskinloader.utils.TextureUtil;
import java.util.List;
/**
* Wynntils cape API
* <a href="https://wynntils.com/">Home</a>
* Test player: Cael
*
* @since 14.16
*/
public class WynntilsAPI implements JsonAPILoader.IJsonAPI {
public static class Wynntils extends JsonAPILoader.DefaultProfile {
public Wynntils(JsonAPILoader loader) {
super(loader);
}
@Override
public String getName() {
return "Wynntils";
}
@Override
public int getPriority() {
return 820;
}
@Override
public String getRoot() {
return "https://athena.wynntils.com/user/getInfo";
}
}
@Override
public List<ICustomSkinLoaderPlugin.IDefaultProfile> getDefaultProfiles(JsonAPILoader loader) {
return Lists.newArrayList(new Wynntils(loader));
}
@Override
public String toJsonUrl(String root, String username) {
return root;
}
@Override
public UserProfile toUserProfile(String root, String json, boolean local) {
WynntilsApiResponse result = new Gson().fromJson(json, WynntilsApiResponse.class);
if (result.user == null || result.user.cosmetics == null || result.user.cosmetics.texture == null) {
return null;
}
UserProfile profile = new UserProfile();
String fakeUrl = TextureUtil.parseBase64Texture(result.user.cosmetics.texture);
if (result.user.cosmetics.hasCape) {
profile.capeUrl = fakeUrl;
} else if (result.user.cosmetics.hasElytra) {
profile.elytraUrl = fakeUrl;
} else {
CustomSkinLoader.logger.warning("Illegal response found in Wynntils");
return null;
}
return profile;
}
@Override
public String getPayload(SkinSiteProfile ssp, String username) {
WynntilsApiRequest req = new WynntilsApiRequest();
req.uuid = MojangAPILoader.getMojangUuidByUsername(username, true);
if (req.uuid == null) {
throw new JsonAPILoader.ProfileNotFoundException();
}
return new Gson().toJson(req);
}
@Override
public String getName() {
return "WynntilsAPI";
}
public static class WynntilsApiRequest {
public String uuid;
}
public static class WynntilsApiResponse {
public User user;
public static class User {
public String accountType;
public Cosmetics cosmetics;
public static class Cosmetics {
public boolean hasCape;
public boolean hasElytra;
public boolean hasEars;
public String texture;
}
}
}
}
@@ -0,0 +1,44 @@
package customskinloader.log;
import java.io.Writer;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* @since 14.16
*/
public class LogManager {
private static Path logFile;
private static Writer logWriter;
private static final Map<String, Logger> loggers = new ConcurrentHashMap<>();
public static void setLogFile(Path logFile) {
//Not updated
if (logFile == null || logFile.equals(LogManager.logFile)) {
return;
}
LogManager.logFile = logFile;
try {
//Close previous writer
if (logWriter != null) {
logWriter.close();
}
//Set new writer
Files.createDirectories(logFile.getParent());
logWriter = Files.newBufferedWriter(logFile, StandardCharsets.UTF_8, StandardOpenOption.CREATE);
loggers.forEach((k, v) -> v.setWriter(logWriter));
} catch (Exception e) {
e.printStackTrace();
}
}
public static Logger getLogger(String loggerName) {
return loggers.computeIfAbsent(loggerName,
it -> new Logger(logWriter, "CustomSkinLoader " + loggerName));
}
}
@@ -0,0 +1,185 @@
package customskinloader.log;
import javax.annotation.Nullable;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* the Logger
* Moved from <code>customskinloader.Logger</code>
*
* @since 14.16
*/
@SuppressWarnings("ResultOfMethodCallIgnored")
public class Logger {
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
/**
* A copy of <code>Config.enableLogStdOut</code>.
* Because <code>Config.loadConfig0()</code> will use <code>Logger.log()</code>,
* which means cannot access <code>CustomSkinLoader.config</code> here.
*
* @see customskinloader.config.Config#enableLogStdOut
* @since 14.15
*/
public boolean enableLogStdOut = false;
public enum Level {
DEBUG("DEBUG", false),
INFO("INFO", true),
WARNING("WARNING", true);
final String name;
final boolean display;
Level(String name, boolean display) {
this.name = name;
this.display = display;
}
public String getName() {
return name;
}
public boolean display() {
return display;
}
}
private Writer writer = null;
public void setWriter(Writer writer) {
this.writer = writer;
}
public Logger() {
//Logger isn't created.
}
public Logger(String logFile) {
this(new File(logFile));
}
public Logger(File logFile) {
this(logFile, "Unknown");
}
/**
* Create Logger with File
*
* @since 14.16
*/
public Logger(File logFile, String loggerName) {
this.loggerName = loggerName;
try {
if (!logFile.getParentFile().exists()) {
logFile.getParentFile().mkdirs();
}
if (!logFile.exists()) {
logFile.createNewFile();
}
writer = new BufferedWriter(new OutputStreamWriter(
Files.newOutputStream(logFile.toPath()), StandardCharsets.UTF_8));
System.out.println("Log Path: " + logFile.getAbsolutePath());
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Create Logger with special Writer
*
* @since 14.16
*/
public Logger(@Nullable Writer writer, String loggerName) {
this.loggerName = loggerName;
this.writer = writer;
}
/**
* Logger name in log
*
* @since 14.16
*/
String loggerName;
public void close() {
if (writer != null) {
try {
writer.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
/**
* Judge if a level can be printed to standard output(System.out) with config.
*
* @param level log level
* @return true - print
*/
private boolean canPrintToStdOut(Level level) {
return level.display() && enableLogStdOut;
}
public void log(Level level, String msg) {
//When it neither be printed to standard output nor write to file
if (!canPrintToStdOut(level) && writer == null) {
return;
}
//Format, print and write
String sb = String.format("[%s] [%s/%s] [%s]: %s",
DATE_FORMAT.format(new Date()), Thread.currentThread().getName(), level.getName(), loggerName, msg);
if (canPrintToStdOut(level)) {
System.out.println(sb);
}
if (writer == null) {
return;
}
try {
String sb2 = String.format("%s\r\n", sb);
writer.write(sb2);//Writer.write has lock
writer.flush();
} catch (Exception e) {
e.printStackTrace();
}
}
public void debug(String msg) {
log(Level.DEBUG, msg);
}
public void debug(String format, Object... objs) {
debug(String.format(format, objs));
}
public void info(String msg) {
log(Level.INFO, msg);
}
public void info(String format, Object... objs) {
info(String.format(format, objs));
}
public void warning(String msg) {
log(Level.WARNING, msg);
}
public void warning(String format, Object... objs) {
warning(String.format(format, objs));
}
public void warning(Throwable e) {
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));
log(Level.WARNING, "Exception: " + sw);
}
}
@@ -24,7 +24,8 @@ public class PluginLoader {
new JsonAPILoader(new UniSkinAPI()), new JsonAPILoader(new UniSkinAPI()),
new JsonAPILoader(new ElyByAPI()), new JsonAPILoader(new ElyByAPI()),
new JsonAPILoader(new GlitchlessAPI()), new JsonAPILoader(new GlitchlessAPI()),
new JsonAPILoader(new MinecraftCapesAPI()) new JsonAPILoader(new MinecraftCapesAPI()),
new JsonAPILoader(new WynntilsAPI()),
}; };
public static final ArrayList<ICustomSkinLoaderPlugin> PLUGINS = loadPlugins(); public static final ArrayList<ICustomSkinLoaderPlugin> PLUGINS = loadPlugins();
@@ -161,6 +161,7 @@ public class HttpRequestUtil {
} }
if (StringUtils.isNotEmpty(request.payload)) { if (StringUtils.isNotEmpty(request.payload)) {
CustomSkinLoader.logger.info("Payload: " + request.payload); CustomSkinLoader.logger.info("Payload: " + request.payload);
c.setRequestMethod("POST");
c.setRequestProperty("Content-Type", "application/json"); c.setRequestProperty("Content-Type", "application/json");
c.setDoOutput(true); c.setDoOutput(true);
OutputStream os = c.getOutputStream(); OutputStream os = c.getOutputStream();
@@ -0,0 +1,33 @@
package customskinloader.utils;
import customskinloader.CustomSkinLoader;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.FileUtils;
import java.io.File;
public class TextureUtil {
/**
* Save and get fake url of base64 texture
*
* @param base64 texture in base64 string
* @return base64 fake url
* @since 14.16
*/
public static String parseBase64Texture(String base64) {
byte[] capeBytes = Base64.decodeBase64(base64);
String hash = HttpTextureUtil.getHash(capeBytes);
File cacheFile = HttpTextureUtil.getCacheFile(hash);
String fakeUrl = HttpTextureUtil.getBase64FakeUrl(hash);
//Save base64 image to cache file
try {
FileUtils.writeByteArrayToFile(cacheFile, capeBytes);
CustomSkinLoader.logger.info("Saved base64 image to " + cacheFile);
return fakeUrl;
} catch (Exception e) {
CustomSkinLoader.logger.warning("Error parsing base64 image: " + base64);
return null;
}
}
}
+1 -1
View File
@@ -49,7 +49,7 @@ net/minecraft/client/resources/IResourceManager net/minecraft/class_3300
getResource (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/resources/IResource; method_14486 getResource (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/resources/IResource; method_14486
net/minecraft/client/resources/SkinManager net/minecraft/class_1071 net/minecraft/client/resources/SkinManager net/minecraft/class_1071
loadProfileTextures (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V method_4652 loadProfileTextures (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V method_4652
loadSkin (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;)Lnet/minecraft/util/ResourceLocation; method_4651 loadSkin (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;)Lnet/minecraft/util/ResourceLocation; method_4656
net/minecraft/client/resources/SkinManager$3 net/minecraft/class_1071$3 net/minecraft/client/resources/SkinManager$3 net/minecraft/class_1071$3
field_152801_c field_152801_c field_152801_c field_152801_c
field_152802_d field_152802_d field_152802_d field_152802_d
+3 -4
View File
@@ -49,11 +49,10 @@ tasks.publishModrinth.doFirst {
// https://github.com/MinecraftForge/ForgeGradle/blob/fc67182a61926f0bdb0d12da5fba7f4322f64d86/src/main/java/net/minecraftforge/gradle/common/BasePlugin.java#L229 // https://github.com/MinecraftForge/ForgeGradle/blob/fc67182a61926f0bdb0d12da5fba7f4322f64d86/src/main/java/net/minecraftforge/gradle/common/BasePlugin.java#L229
jsonSlurper.parse(plugin.cacheFile("McManifest.json")).versions.each { version -> jsonSlurper.parse(plugin.cacheFile("McManifest.json")).versions.each { version ->
if (version.type == "snapshot") { if (version.type == "snapshot") {
// If the first version is a snapshot, assume the target release version is the same as the assets version. // If the first version is a snapshot, since Mojang no longer provides the target version for snapshots,
// we assume that new snapshots will not be supported until the next release.
if (currentRelease == null) { if (currentRelease == null) {
currentRelease = jsonSlurper.parse(new URL(version.url)).assets.with { return
it.toString().split($/\./$).with { "${it[0]}.${it[1]}" }
}
} }
} else if (version.type == "release") { } else if (version.type == "release") {
currentRelease = version.id.with { currentRelease = version.id.with {
+1 -1
View File
@@ -1,5 +1,5 @@
minecraft_version=1.14 minecraft_version=1.14
minecraft_full_versions=1.14-Snapshot,1.14,1.14.1,1.14.2,1.14.3,1.14.4,1.15-Snapshot,1.15,1.15.1,1.15.2,1.16-Snapshot,1.16,1.16.1,1.16.2,1.16.3,1.16.4,1.16.5,1.17-Snapshot,1.17,1.17.1,1.18-Snapshot,1.18,1.18.1,1.18.2,1.19-Snapshot,1.19,1.19.1,1.19.2,1.19.3 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,1.16.2,1.16.3,1.16.4,1.16.5,1.17,1.17.1,1.18,1.18.1,1.18.2,1.19,1.19.1,1.19.2,1.19.3,1.19.4,1.20,1.20.1
java_full_versions=8,9,10,11,12,13,14,15,16,17,18 java_full_versions=8,9,10,11,12,13,14,15,16,17,18
#forge gradle needs forge version #forge gradle needs forge version
forge_mc_version=1.12.2 forge_mc_version=1.12.2
+2
View File
@@ -4,9 +4,11 @@ net/minecraft/client/Minecraft net/minecraft/class_310
net/minecraft/client/entity/AbstractClientPlayer net/minecraft/class_742 net/minecraft/client/entity/AbstractClientPlayer net/minecraft/class_742
getDownloadImageSkin (Lnet/minecraft/util/ResourceLocation;Ljava/lang/String;)Lnet/minecraft/client/renderer/ThreadDownloadImageData; method_3120 getDownloadImageSkin (Lnet/minecraft/util/ResourceLocation;Ljava/lang/String;)Lnet/minecraft/client/renderer/ThreadDownloadImageData; method_3120
getLocationSkin (Ljava/lang/String;)Lnet/minecraft/util/ResourceLocation; method_3124 getLocationSkin (Ljava/lang/String;)Lnet/minecraft/util/ResourceLocation; method_3124
net/minecraft/client/gui/Gui net/minecraft/class_332
net/minecraft/client/gui/GuiPlayerTabOverlay net/minecraft/class_355 net/minecraft/client/gui/GuiPlayerTabOverlay net/minecraft/class_355
renderPlayerlist (ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V method_1919 renderPlayerlist (ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V method_1919
renderPlayerlist (Lcom/mojang/blaze3d/matrix/MatrixStack;ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V method_1919 renderPlayerlist (Lcom/mojang/blaze3d/matrix/MatrixStack;ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V method_1919
renderPlayerlist (Lnet/minecraft/client/gui/Gui;ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V method_1919
net/minecraft/client/gui/spectator/PlayerMenuObject net/minecraft/class_530 net/minecraft/client/gui/spectator/PlayerMenuObject net/minecraft/class_530
net/minecraft/client/model/ModelRenderer net/minecraft/class_630 net/minecraft/client/model/ModelRenderer net/minecraft/class_630
net/minecraft/client/renderer/IImageBuffer net/minecraft/class_760 net/minecraft/client/renderer/IImageBuffer net/minecraft/class_760
@@ -35,13 +35,6 @@ public class DevEnvRemapper extends SimpleRemapper {
Lists.newArrayList("customskinloader.fake.itf.FakeInterfaceManager") Lists.newArrayList("customskinloader.fake.itf.FakeInterfaceManager")
) )
); );
remappedClasses.put(
"net.minecraft.class_1060",
new AbstractMap.SimpleEntry<>(
Lists.newArrayList("customskinloader.fake.itf.IFakeTextureManager$V1", "customskinloader.fake.itf.IFakeTextureManager$V2"),
Lists.newArrayList("customskinloader.fake.itf.FakeInterfaceManager")
)
);
remappedClasses.put( remappedClasses.put(
"net.minecraft.class_3298", "net.minecraft.class_3298",
new AbstractMap.SimpleEntry<>( new AbstractMap.SimpleEntry<>(
@@ -1,27 +1,28 @@
package customskinloader.fabric; package customskinloader.fabric;
import java.io.File;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.net.URL; import java.net.URL;
import java.nio.file.Paths;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.JsonParser; import com.google.gson.JsonParser;
import customskinloader.Logger; import customskinloader.log.LogManager;
import customskinloader.log.Logger;
import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.ClassNode;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
import org.spongepowered.asm.mixin.extensibility.IMixinInfo; import org.spongepowered.asm.mixin.extensibility.IMixinInfo;
public class MixinConfigPlugin implements IMixinConfigPlugin { public class MixinConfigPlugin implements IMixinConfigPlugin {
public static Logger logger = new Logger(new File("./CustomSkinLoader/FabricPlugin.log")); public static Logger logger = LogManager.getLogger("Fabric");
private long world_version; private long world_version;
private long protocol_version; private long protocol_version;
@Override @Override
public void onLoad(String mixinPackage) { public void onLoad(String mixinPackage) {
LogManager.setLogFile(Paths.get("./CustomSkinLoader/CustomSkinLoader.log"));
URL versionJson = this.getClass().getResource("/version.json"); URL versionJson = this.getClass().getResource("/version.json");
if (versionJson != null) { if (versionJson != null) {
logger.info("\"version.json\": " + versionJson.toString()); logger.info("\"version.json\": " + versionJson.toString());
+1 -1
View File
@@ -1,5 +1,5 @@
minecraft_version=1.17.1 minecraft_version=1.17.1
minecraft_full_versions=1.17.1,1.18,1.18.1,1.18.2,1.19,1.19.1,1.19.2,1.19.3 minecraft_full_versions=1.17.1,1.18,1.18.1,1.18.2,1.19,1.19.1,1.19.2,1.19.3,1.19.4,1.20,1.20.1
java_full_versions=16,17,18 java_full_versions=16,17,18
#forge gradle needs forge version #forge gradle needs forge version
forge_mc_version=1.12.2 forge_mc_version=1.12.2
@@ -5,13 +5,14 @@ import java.lang.reflect.Field;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import customskinloader.Logger; import customskinloader.log.LogManager;
import customskinloader.log.Logger;
import net.minecraft.launchwrapper.ITweaker; import net.minecraft.launchwrapper.ITweaker;
import net.minecraft.launchwrapper.Launch; import net.minecraft.launchwrapper.Launch;
import net.minecraft.launchwrapper.LaunchClassLoader; import net.minecraft.launchwrapper.LaunchClassLoader;
public class ForgeTweaker implements ITweaker { public class ForgeTweaker implements ITweaker {
public static Logger logger = new Logger(new File("./CustomSkinLoader/ForgePlugin.log")); public static Logger logger = LogManager.getLogger("Forge");
private final static String FML_PLATFORM_INITIALIZER = "customskinloader.forge.platform.IFMLPlatform$FMLPlatformInitializer"; private final static String FML_PLATFORM_INITIALIZER = "customskinloader.forge.platform.IFMLPlatform$FMLPlatformInitializer";
@@ -32,7 +33,7 @@ public class ForgeTweaker implements ITweaker {
@Override @Override
public void acceptOptions(List<String> args, File gameDir, File assetsDir, String profile) { public void acceptOptions(List<String> args, File gameDir, File assetsDir, String profile) {
LogManager.setLogFile(gameDir.toPath().resolve("CustomSkinLoader/CustomSkinLoader.log"));
} }
@Override @Override
+17 -2
View File
@@ -1,4 +1,13 @@
# CustomSkinLoader # CustomSkinLoader
[![Version](https://img.shields.io/github/v/release/xfl03/MCCustomSkinLoader?label=&logo=V&labelColor=E1F5FE&color=5D87BF&style=for-the-badge)](https://github.com/xfl03/MCCustomSkinLoader/tags)
[![CurseForge](https://cf.way2muchnoise.eu/short_CustomSkinLoader.svg?badge_style=for_the_badge)](https://www.curseforge.com/minecraft/mc-mods/customskinloader)
[![Modrinth](https://img.shields.io/modrinth/dt/idMHQ4n2?label=&logo=Modrinth&labelColor=white&color=00AF5C&style=for-the-badge)](https://modrinth.com/mod/customskinloader)
[![License](https://img.shields.io/github/license/xfl03/MCCustomSkinLoader?label=&logo=c&style=for-the-badge&color=A8B9CC&labelColor=455A64)](https://github.com/xfl03/MCCustomSkinLoader/blob/14-develop/LICENSE)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/xfl03/MCCustomSkinLoader/beta.yml?style=for-the-badge&label=&logo=Gradle&labelColor=388E3C)](https://github.com/xfl03/MCCustomSkinLoader/actions)
[![Star](https://img.shields.io/github/stars/xfl03/MCCustomSkinLoader?label=&logo=GitHub&labelColor=black&color=FAFAFA&style=for-the-badge)](https://github.com/xfl03/MCCustomSkinLoader/stargazers)
[![Minecraft Version](https://img.shields.io/badge/Minecraft-1.20%20|%201.19%20|%201.18%20|%201.17%20|%201.16%20|%201.15%20|%201.14%20|%201.13%20|%201.12%20|%201.11%20|%201.10%20|%201.9%20|%201.8-green?style=for-the-badge&labelColor=388E3C&color=8BC34A)](https://github.com/xfl03/MCCustomSkinLoader)
## What's this? ## What's this?
Custom Skin Loader mod for Minecraft. Custom Skin Loader mod for Minecraft.
It's a mod which can load skins and capes from any online source or from your local. It's a mod which can load skins and capes from any online source or from your local.
@@ -30,6 +39,7 @@ Supported special skin sites:
- **ANY SITE** implements skin loading API above - **ANY SITE** implements skin loading API above
- [Glitchless](https://games.glitchless.ru/games/minecraft/) - [Glitchless](https://games.glitchless.ru/games/minecraft/)
- [MinecraftCapes](https://minecraftcapes.net/) - [MinecraftCapes](https://minecraftcapes.net/)
- [Wynntils](https://wynntils.com/)
You can use this feature to customize your skin load list so as to load your skins from any skin server you want. You can use this feature to customize your skin load list so as to load your skins from any skin server you want.
If you are the owner of skin server, you can use CustomSkinLoader to load skins from your server if one of the APIs has been actualized by your server. If you are the owner of skin server, you can use CustomSkinLoader to load skins from your server if one of the APIs has been actualized by your server.
@@ -67,13 +77,18 @@ By using this mod, you can see correct avatar of players in Spectator Menu rathe
## Default Load List ## Default Load List
- [Mojang](http://www.minecraft.net/) (MojangAPI) - [Mojang](http://www.minecraft.net/) (MojangAPI)
- [LittleSkin](https://littleskin.cn/) (CustomSkinAPI) - [LittleSkin](https://littleskin.cn/) (CustomSkinAPI)
- [Blessing Skin](http://skin.prinzeugen.net/) (CustomSkinAPI) - [BlessingSkin](http://skin.prinzeugen.net/) (CustomSkinAPI)
- [ElyBy](http://docs.ely.by/) (ElyByAPI) - [ElyBy](http://docs.ely.by/) (ElyByAPI)
- SkinMe (UniSkinAPI) - SkinMe (UniSkinAPI)
- [TLauncher](https://tlauncher.org/) (ElyByAPI) - [TLauncher](https://tlauncher.org/) (ElyByAPI)
- LocalSkin (Legacy)
- [Glitchless](https://games.glitchless.ru/games/minecraft/) - [Glitchless](https://games.glitchless.ru/games/minecraft/)
- LocalSkin (Legacy)
- [MinecraftCapes](https://minecraftcapes.net/) - [MinecraftCapes](https://minecraftcapes.net/)
- [OptiFineCape](https://optifine.net/home)
- [Wynntils](https://wynntils.com/)
- [Cloaks+](https://cloaksplus.com/)
- [LabyMod](https://www.labymod.net/en)
- [Cosmetica](https://cosmetica.cc/)
If you want to apply to add other skin server to default list, please go to [issue](https://github.com/JLChnToZ/MCCustomSkinLoader/issues). If you want to apply to add other skin server to default list, please go to [issue](https://github.com/JLChnToZ/MCCustomSkinLoader/issues).
@@ -7,28 +7,28 @@ customskinloader/fake/itf/IFakeIResourceManager customskinloader/fake/itf/IFakeI
getResource (Lnet/minecraft/util/ResourceLocation;)Ljava/util/Optional; getResource getResource (Lnet/minecraft/util/ResourceLocation;)Ljava/util/Optional; getResource
customskinloader/fake/itf/IFakeMinecraft customskinloader/fake/itf/IFakeMinecraft customskinloader/fake/itf/IFakeMinecraft customskinloader/fake/itf/IFakeMinecraft
func_195551_G ()Lnet/minecraft/resources/IResourceManager; Y func_195551_G ()Lnet/minecraft/resources/IResourceManager; Y
net/minecraft/client/Minecraft ejf net/minecraft/client/Minecraft emh
gameDir p gameDir p
getCurrentServerData ()Lnet/minecraft/client/multiplayer/ServerData; P getCurrentServerData ()Lnet/minecraft/client/multiplayer/ServerData; P
getMinecraft ()Lnet/minecraft/client/Minecraft; N getMinecraft ()Lnet/minecraft/client/Minecraft; N
getResourceManager ()Lnet/minecraft/client/resources/IResourceManager; Y getResourceManager ()Lnet/minecraft/client/resources/IResourceManager; Y
getSkinManager ()Lnet/minecraft/client/resources/SkinManager; ak getSkinManager ()Lnet/minecraft/client/resources/SkinManager; ak
getTextureManager ()Lnet/minecraft/client/renderer/texture/TextureManager; X getTextureManager ()Lnet/minecraft/client/renderer/texture/TextureManager; X
net/minecraft/client/gui/GuiPlayerTabOverlay elx net/minecraft/client/gui/GuiPlayerTabOverlay eoz
net/minecraft/client/gui/spectator/PlayerMenuObject ett net/minecraft/client/gui/spectator/PlayerMenuObject eya
net/minecraft/client/multiplayer/ServerData ezg net/minecraft/client/multiplayer/ServerData fdq
serverIP b serverIP b
net/minecraft/client/renderer/RenderType fed net/minecraft/client/renderer/RenderType fio
func_228644_e_ (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/renderer/RenderType; h func_228644_e_ (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/renderer/RenderType; h
net/minecraft/client/renderer/IImageBuffer net/minecraft/client/renderer/IImageBuffer net/minecraft/client/renderer/IImageBuffer net/minecraft/client/renderer/IImageBuffer
func_195786_a (Lnet/minecraft/client/renderer/texture/NativeImage;)Lnet/minecraft/client/renderer/texture/NativeImage; func_195786_a func_195786_a (Lnet/minecraft/client/renderer/texture/NativeImage;)Lnet/minecraft/client/renderer/texture/NativeImage; func_195786_a
parseUserSkin (Ljava/awt/image/BufferedImage;)Ljava/awt/image/BufferedImage; func_78432_a parseUserSkin (Ljava/awt/image/BufferedImage;)Ljava/awt/image/BufferedImage; func_78432_a
skinAvailable ()V func_152634_a skinAvailable ()V func_152634_a
net/minecraft/client/renderer/ThreadDownloadImageData fnz net/minecraft/client/renderer/ThreadDownloadImageData fsq
net/minecraft/client/renderer/entity/RenderPlayer fnp net/minecraft/client/renderer/entity/RenderPlayer fsf
net/minecraft/client/renderer/entity/layers/LayerCape flx net/minecraft/client/renderer/entity/layers/LayerCape fqn
net/minecraft/client/renderer/texture/ITextureObject net/minecraft/client/renderer/texture/ITextureObject net/minecraft/client/renderer/texture/ITextureObject net/minecraft/client/renderer/texture/ITextureObject
net/minecraft/client/renderer/texture/NativeImage ede net/minecraft/client/renderer/texture/NativeImage egf
func_195699_a (IIIIIIZZ)V a func_195699_a (IIIIIIZZ)V a
func_195700_a (III)V a func_195700_a (III)V a
func_195702_a ()I a func_195702_a ()I a
@@ -37,26 +37,26 @@ net/minecraft/client/renderer/texture/NativeImage ede
func_195713_a (Ljava/io/InputStream;)Lnet/minecraft/client/renderer/texture/NativeImage; a func_195713_a (Ljava/io/InputStream;)Lnet/minecraft/client/renderer/texture/NativeImage; a
func_195714_b ()I b func_195714_b ()I b
func_195715_a (IIIII)V a func_195715_a (IIIII)V a
net/minecraft/client/renderer/texture/SimpleTexture foe net/minecraft/client/renderer/texture/SimpleTexture fsv
net/minecraft/client/renderer/texture/TextureManager fom net/minecraft/client/renderer/texture/TextureManager ftd
getTexture (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/renderer/texture/ITextureObject; func_110581_b getTexture (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/renderer/texture/ITextureObject; func_110581_b
loadTexture (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/ITextureObject;)Z func_110579_a loadTexture (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/ITextureObject;)Z func_110579_a
net/minecraft/client/resources/DefaultPlayerSkin fpb net/minecraft/client/resources/DefaultPlayerSkin ftt
getDefaultSkin (Ljava/util/UUID;)Lnet/minecraft/util/ResourceLocation; a getDefaultSkin (Ljava/util/UUID;)Lnet/minecraft/util/ResourceLocation; a
net/minecraft/client/resources/IResource akc net/minecraft/client/resources/IResource alf
getInputStream ()Ljava/io/InputStream; d getInputStream ()Ljava/io/InputStream; d
net/minecraft/client/resources/IResourceManager ake net/minecraft/client/resources/IResourceManager alh
getResource (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/resources/IResource; getResource getResource (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/resources/IResource; getResource
net/minecraft/client/resources/SkinManager fpj net/minecraft/client/resources/SkinManager fub
loadProfileTextures (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V a loadProfileTextures (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V a
loadSkin (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;)Lnet/minecraft/util/ResourceLocation; a loadSkin (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;)Lnet/minecraft/util/ResourceLocation; a
net/minecraft/client/resources/SkinManager$3 fpj$3 net/minecraft/client/resources/SkinManager$3 fub$3
field_152801_c field_152801_c field_152801_c field_152801_c
field_152802_d field_152802_d field_152802_d field_152802_d
net/minecraft/client/resources/SkinManager$SkinAvailableCallback fpj$a net/minecraft/client/resources/SkinManager$SkinAvailableCallback fub$a
skinAvailable (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/util/ResourceLocation;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;)V onSkinTextureAvailable skinAvailable (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/util/ResourceLocation;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;)V onSkinTextureAvailable
net/minecraft/resources/IResource akc net/minecraft/resources/IResource alf
net/minecraft/resources/IResourceManager ake net/minecraft/resources/IResourceManager alh
net/minecraft/util/ResourceLocation acf net/minecraft/util/ResourceLocation add
net/minecraft/util/StringUtils aos net/minecraft/util/StringUtils aqb
stripControlCodes (Ljava/lang/String;)Ljava/lang/String; a stripControlCodes (Ljava/lang/String;)Ljava/lang/String; a
@@ -1,8 +1,8 @@
minecraft_version=1.19.3 minecraft_version=1.19.4
minecraft_full_versions=1.19.3 minecraft_full_versions=1.19.4
java_full_versions=16,17,18 java_full_versions=16,17,18
#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.19.3.tsrg srg_notch_map=1.19.4.tsrg
@@ -1,46 +1,46 @@
com/mojang/blaze3d/matrix/MatrixStack eed com/mojang/blaze3d/matrix/MatrixStack ehe
net/minecraft/client/Minecraft ejf net/minecraft/client/Minecraft emh
isIntegratedServerRunning ()Z Q isIntegratedServerRunning ()Z Q
net/minecraft/client/entity/AbstractClientPlayer fcw net/minecraft/client/entity/AbstractClientPlayer fhh
getDownloadImageSkin (Lnet/minecraft/util/ResourceLocation;Ljava/lang/String;)Lnet/minecraft/client/renderer/ThreadDownloadImageData; a getDownloadImageSkin (Lnet/minecraft/util/ResourceLocation;Ljava/lang/String;)Lnet/minecraft/client/renderer/ThreadDownloadImageData; a
getLocationSkin (Ljava/lang/String;)Lnet/minecraft/util/ResourceLocation; c getLocationSkin (Ljava/lang/String;)Lnet/minecraft/util/ResourceLocation; c
net/minecraft/client/gui/GuiPlayerTabOverlay elx net/minecraft/client/gui/GuiPlayerTabOverlay eoz
renderPlayerlist (ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V func_175249_a renderPlayerlist (ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V a
renderPlayerlist (Lcom/mojang/blaze3d/matrix/MatrixStack;ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V a renderPlayerlist (Lcom/mojang/blaze3d/matrix/MatrixStack;ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V a
net/minecraft/client/gui/spectator/PlayerMenuObject ett net/minecraft/client/gui/spectator/PlayerMenuObject eya
net/minecraft/client/model/ModelRenderer eyh net/minecraft/client/model/ModelRenderer fcr
net/minecraft/client/renderer/IImageBuffer net/minecraft/client/renderer/IImageBuffer net/minecraft/client/renderer/IImageBuffer net/minecraft/client/renderer/IImageBuffer
net/minecraft/client/renderer/IRenderTypeBuffer fdv net/minecraft/client/renderer/IRenderTypeBuffer fig
net/minecraft/client/renderer/RenderType fed net/minecraft/client/renderer/RenderType fio
getEntitySolid (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/renderer/RenderType; b getEntitySolid (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/renderer/RenderType; b
net/minecraft/client/renderer/ThreadDownloadImageData fnz net/minecraft/client/renderer/ThreadDownloadImageData fsq
bufferedImage field_110560_d bufferedImage field_110560_d
textureUploaded o textureUploaded o
processTask m processTask m
loadTexture (Ljava/io/InputStream;)Lnet/minecraft/client/renderer/texture/NativeImage; a loadTexture (Ljava/io/InputStream;)Lnet/minecraft/client/renderer/texture/NativeImage; a
processLegacySkin (Lnet/minecraft/client/renderer/texture/NativeImage;)Lnet/minecraft/client/renderer/texture/NativeImage; c processLegacySkin (Lnet/minecraft/client/renderer/texture/NativeImage;)Lnet/minecraft/client/renderer/texture/NativeImage; c
net/minecraft/client/renderer/entity/RenderPlayer fnp net/minecraft/client/renderer/entity/RenderPlayer fsf
renderItem (Lcom/mojang/blaze3d/matrix/MatrixStack;Lnet/minecraft/client/renderer/IRenderTypeBuffer;ILnet/minecraft/client/entity/AbstractClientPlayer;Lnet/minecraft/client/model/ModelRenderer;Lnet/minecraft/client/model/ModelRenderer;)V a renderItem (Lcom/mojang/blaze3d/matrix/MatrixStack;Lnet/minecraft/client/renderer/IRenderTypeBuffer;ILnet/minecraft/client/entity/AbstractClientPlayer;Lnet/minecraft/client/model/ModelRenderer;Lnet/minecraft/client/model/ModelRenderer;)V a
renderItem (Lcom/mojang/blaze3d/matrix/MatrixStack;Lnet/minecraft/client/renderer/IRenderTypeBuffer;Lnet/minecraft/client/entity/AbstractClientPlayer;Lnet/minecraft/client/model/ModelRenderer;Lnet/minecraft/client/model/ModelRenderer;)V func_229145_a_ renderItem (Lcom/mojang/blaze3d/matrix/MatrixStack;Lnet/minecraft/client/renderer/IRenderTypeBuffer;Lnet/minecraft/client/entity/AbstractClientPlayer;Lnet/minecraft/client/model/ModelRenderer;Lnet/minecraft/client/model/ModelRenderer;)V func_229145_a_
net/minecraft/client/renderer/entity/layers/LayerCape flx net/minecraft/client/renderer/entity/layers/LayerCape fqn
doRenderLayer (Lcom/mojang/blaze3d/matrix/MatrixStack;Lnet/minecraft/client/renderer/IRenderTypeBuffer;ILnet/minecraft/client/entity/AbstractClientPlayer;FFFFFF)V a doRenderLayer (Lcom/mojang/blaze3d/matrix/MatrixStack;Lnet/minecraft/client/renderer/IRenderTypeBuffer;ILnet/minecraft/client/entity/AbstractClientPlayer;FFFFFF)V a
doRenderLayer (Lcom/mojang/blaze3d/matrix/MatrixStack;Lnet/minecraft/client/renderer/IRenderTypeBuffer;ILnet/minecraft/client/entity/AbstractClientPlayer;FFFFFFF)V func_225628_a_ doRenderLayer (Lcom/mojang/blaze3d/matrix/MatrixStack;Lnet/minecraft/client/renderer/IRenderTypeBuffer;ILnet/minecraft/client/entity/AbstractClientPlayer;FFFFFFF)V func_225628_a_
net/minecraft/client/renderer/texture/NativeImage ede net/minecraft/client/renderer/texture/NativeImage egf
net/minecraft/client/renderer/texture/TextureManager fom net/minecraft/client/renderer/texture/TextureManager ftd
net/minecraft/client/resources/SkinManager fpj net/minecraft/client/resources/SkinManager fub
func_210275_a (Lcom/mojang/authlib/GameProfile;ZLnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)V a func_210275_a (Lcom/mojang/authlib/GameProfile;ZLnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)V a
func_229297_b_ (Ljava/util/Map;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)V b func_229297_b_ (Ljava/util/Map;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)V b
loadProfileTextures (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V a loadProfileTextures (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V a
loadSkin (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)Lnet/minecraft/util/ResourceLocation; a loadSkin (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)Lnet/minecraft/util/ResourceLocation; a
loadSkinFromCache (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map; a loadSkinFromCache (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map; a
net/minecraft/client/resources/SkinManager$3 fpj$3 net/minecraft/client/resources/SkinManager$3 fub$3
run ()V run run ()V run
net/minecraft/client/resources/SkinManager$3$1 fpj$3$1 net/minecraft/client/resources/SkinManager$3$1 fub$3$1
field_152803_a field_152803_a field_152803_a field_152803_a
field_152804_b field_152804_b field_152804_b field_152804_b
run ()V run run ()V run
net/minecraft/client/resources/SkinManager$SkinAvailableCallback fpj$a net/minecraft/client/resources/SkinManager$SkinAvailableCallback fub$a
skinAvailable (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/util/ResourceLocation;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;)V onSkinTextureAvailable skinAvailable (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/util/ResourceLocation;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;)V onSkinTextureAvailable
net/minecraft/scoreboard/ScoreObjective eaz net/minecraft/scoreboard/ScoreObjective edz
net/minecraft/scoreboard/Scoreboard ebc net/minecraft/scoreboard/Scoreboard eec
net/minecraft/util/ResourceLocation acf net/minecraft/util/ResourceLocation add
@@ -11,8 +11,9 @@ import org.spongepowered.asm.mixin.injection.Redirect;
public abstract class MixinGuiPlayerTabOverlay { public abstract class MixinGuiPlayerTabOverlay {
@Redirect( @Redirect(
method = { method = {
"Lnet/minecraft/client/gui/GuiPlayerTabOverlay;renderPlayerlist(ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V", "Lnet/minecraft/client/gui/GuiPlayerTabOverlay;renderPlayerlist(ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V", // 20w16a-
"Lnet/minecraft/client/gui/GuiPlayerTabOverlay;renderPlayerlist(Lcom/mojang/blaze3d/matrix/MatrixStack;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", // 20w17a ~ 23w14a
"Lnet/minecraft/client/gui/GuiPlayerTabOverlay;renderPlayerlist(Lnet/minecraft/client/gui/Gui;ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V" // 23w16a+
}, },
at = @At( at = @At(
value = "INVOKE", value = "INVOKE",
@@ -3,7 +3,8 @@ package customskinloader.tweaker;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import customskinloader.Logger; import customskinloader.log.LogManager;
import customskinloader.log.Logger;
import net.minecraft.launchwrapper.ITweaker; import net.minecraft.launchwrapper.ITweaker;
import net.minecraft.launchwrapper.LaunchClassLoader; import net.minecraft.launchwrapper.LaunchClassLoader;
import org.spongepowered.asm.mixin.MixinEnvironment; import org.spongepowered.asm.mixin.MixinEnvironment;
@@ -14,8 +15,8 @@ public class ModSystemTweaker implements ITweaker {
public static Logger logger = new Logger(); public static Logger logger = new Logger();
public void acceptOptions(List args, File gameDir, File assetsDir, String profile) { public void acceptOptions(List args, File gameDir, File assetsDir, String profile) {
File tweakerLogFile = new File(gameDir,"./CustomSkinLoader/Tweaker.log"); LogManager.setLogFile(gameDir.toPath().resolve("CustomSkinLoader/CustomSkinLoader.log"));
logger = new Logger(tweakerLogFile); logger = LogManager.getLogger("ModSystemTweaker");
logger.info("Using ModSystemTweaker"); logger.info("Using ModSystemTweaker");
logger.info("ModSystemTweaker: acceptOptions"); logger.info("ModSystemTweaker: acceptOptions");
@@ -3,7 +3,8 @@ package customskinloader.tweaker;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import customskinloader.Logger; import customskinloader.log.LogManager;
import customskinloader.log.Logger;
import net.minecraft.launchwrapper.ITweaker; import net.minecraft.launchwrapper.ITweaker;
import net.minecraft.launchwrapper.LaunchClassLoader; import net.minecraft.launchwrapper.LaunchClassLoader;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
@@ -17,8 +18,8 @@ public class Tweaker implements ITweaker {
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"); LogManager.setLogFile(gameDir.toPath().resolve("CustomSkinLoader/CustomSkinLoader.log"));
logger = new Logger(tweakerLogFile); logger = LogManager.getLogger("VanillaTweaker");
logger.info("Using Tweaker"); logger.info("Using Tweaker");
logger.info("Tweaker: acceptOptions"); logger.info("Tweaker: acceptOptions");
+1 -4
View File
@@ -1,6 +1,3 @@
name=CustomSkinLoader name=CustomSkinLoader
group=customskinloader group=customskinloader
version=14.15 version=14.17
dev_version=.1
#RELEASE: snapshot=0
snapshot=0
@@ -31,6 +31,10 @@ public abstract class UploadBaseTask extends DefaultTask {
return null; return null;
} }
for (File file : files) { for (File file : files) {
if (file.getName().endsWith("-sources.jar")) {
//Don't upload sources jar to cos
continue;
}
String key = CosUtil.getKey(file.getName()); String key = CosUtil.getKey(file.getName());
if (key == null) { if (key == null) {
continue; continue;
@@ -40,7 +40,7 @@ public class CurseForgeUtil {
gameVersionStrings.add("Java " + javaVersion); // Java Versions gameVersionStrings.add("Java " + javaVersion); // Java Versions
} }
}); });
gameVersionStrings.add(project.getName().split("/")[0]); // Loader Version gameVersionStrings.addAll(VersionUtil.getLoaders(project));
artifact.setGameVersionStrings(gameVersionStrings); artifact.setGameVersionStrings(gameVersionStrings);
artifact.setChangelogType("text"); artifact.setChangelogType("text");
artifact.setChangelog(System.getenv("GIT_COMMIT_DESC")); artifact.setChangelog(System.getenv("GIT_COMMIT_DESC"));
@@ -1,6 +1,5 @@
package customskinloader.gradle.util; package customskinloader.gradle.util;
import java.util.Locale;
import java.util.Optional; import java.util.Optional;
import com.modrinth.minotaur.TaskModrinthUpload; import com.modrinth.minotaur.TaskModrinthUpload;
@@ -33,7 +32,7 @@ public class ModrinthUtil {
task.addGameVersion(gameVersion); // Minecraft Versions task.addGameVersion(gameVersion); // Minecraft Versions
} }
}); });
task.addLoader(project.getName().split("/")[0].toLowerCase(Locale.ENGLISH)); // Loader Version VersionUtil.getLoaders(project).stream().map(String::toLowerCase).forEach(task::addLoader);
TaskUtil.withTask(project.getRootProject(), "upload", task0 -> task0.finalizedBy(task)); TaskUtil.withTask(project.getRootProject(), "upload", task0 -> task0.finalizedBy(task));
}); });
@@ -3,15 +3,17 @@ package customskinloader.gradle.util;
import org.gradle.api.Project; import org.gradle.api.Project;
import org.gradle.util.VersionNumber; import org.gradle.util.VersionNumber;
import java.util.Arrays; import java.util.*;
import java.util.Collection;
import java.util.Collections;
import java.util.stream.Collectors; import java.util.stream.Collectors;
public class VersionUtil { public class VersionUtil {
public static boolean isRelease(Project rootProject) { public static boolean isRelease(Project rootProject) {
String s = ConfigUtil.getConfigString(rootProject, "snapshot"); String s = System.getenv("IS_SNAPSHOT");
return s == null || s.equals("") || s.equals("0"); // When we cannot find environment variable, it means we are in development, so it is not a release
if (s == null) {
return false;
}
return s.equals("0") || s.equals("false");
} }
public static boolean isSnapshot(Project rootProject) { public static boolean isSnapshot(Project rootProject) {
@@ -31,8 +33,7 @@ public class VersionUtil {
//Example: 14.10a-SNAPSHOT-33 //Example: 14.10a-SNAPSHOT-33
public static String getCSLVersion(Project rootProject) { public static String getCSLVersion(Project rootProject) {
return ConfigUtil.getConfigString(rootProject, "version") + return ConfigUtil.getConfigString(rootProject, "version") +
ConfigUtil.getConfigString(rootProject, "dev_version") +
(isRelease(rootProject) ? "" : ("-SNAPSHOT-" + getBuildNum())); (isRelease(rootProject) ? "" : ("-SNAPSHOT-" + getBuildNum()));
} }
@@ -63,4 +64,14 @@ public class VersionUtil {
ConfigUtil.getConfigString(project, "minecraft_version") : ConfigUtil.getConfigString(project, "minecraft_version") :
project.getName().replace("/", ""); project.getName().replace("/", "");
} }
public static List<String> getLoaders(Project project) {
String loaderName = project.getName().split("/")[0];
List<String> loaders = new ArrayList<>(2);
loaders.add(loaderName);
if (loaderName.equals("Fabric")) {
loaders.add("Quilt");
}
return loaders;
}
} }
+1 -1
View File
@@ -10,7 +10,7 @@ include "Vanilla/1.8.9"
include "Vanilla/1.12.2" include "Vanilla/1.12.2"
include "Vanilla/1.16.5" include "Vanilla/1.16.5"
include "Vanilla/1.18.2" include "Vanilla/1.18.2"
include "Vanilla/1.19.3" include "Vanilla/1.19.4"
//Forge Base Project //Forge Base Project
include "Forge/Common" include "Forge/Common"