Search all resource domains for skins and add task to zip the defaults.
1
.gitignore
vendored
|
@ -8,3 +8,4 @@ run/
|
||||||
*.launch
|
*.launch
|
||||||
/.apt_generated/
|
/.apt_generated/
|
||||||
.factorypath
|
.factorypath
|
||||||
|
logs/
|
|
@ -100,6 +100,11 @@ task srgJar(type: Jar) {
|
||||||
classifier "mc$minecraft.version-srg"
|
classifier "mc$minecraft.version-srg"
|
||||||
baseName "mod-${project.name.toLowerCase()}"
|
baseName "mod-${project.name.toLowerCase()}"
|
||||||
}
|
}
|
||||||
|
task skinZip(type: Zip) {
|
||||||
|
from fileTree('skins')
|
||||||
|
baseName 'Pony Skin Resources'
|
||||||
|
version 'v1'
|
||||||
|
}
|
||||||
|
|
||||||
reobf {
|
reobf {
|
||||||
srgJar {
|
srgJar {
|
||||||
|
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 736 B After Width: | Height: | Size: 736 B |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 844 B After Width: | Height: | Size: 844 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 746 B After Width: | Height: | Size: 746 B |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 719 B After Width: | Height: | Size: 719 B |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 924 B After Width: | Height: | Size: 924 B |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 797 B After Width: | Height: | Size: 797 B |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 1,022 B After Width: | Height: | Size: 1,022 B |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 790 B After Width: | Height: | Size: 790 B |
Before Width: | Height: | Size: 558 B After Width: | Height: | Size: 558 B |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 991 B After Width: | Height: | Size: 991 B |
Before Width: | Height: | Size: 781 B After Width: | Height: | Size: 781 B |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 796 B After Width: | Height: | Size: 796 B |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 826 B After Width: | Height: | Size: 826 B |
Before Width: | Height: | Size: 812 B After Width: | Height: | Size: 812 B |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 769 B After Width: | Height: | Size: 769 B |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
6
skins/pack.mcmeta
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"pack": {
|
||||||
|
"pack_format": 2,
|
||||||
|
"description": "Custom Pony NPC Skins"
|
||||||
|
}
|
||||||
|
}
|
BIN
skins/pack.png
Normal file
After Width: | Height: | Size: 54 KiB |
|
@ -5,7 +5,6 @@ import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.ExecutionException;
|
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
|
@ -23,7 +22,6 @@ import com.google.gson.JsonParseException;
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
|
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
|
||||||
import com.mumfrey.liteloader.util.log.LiteLoaderLogger;
|
import com.mumfrey.liteloader.util.log.LiteLoaderLogger;
|
||||||
import com.voxelmodpack.hdskins.HDSkinManager;
|
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.resources.IResource;
|
import net.minecraft.client.resources.IResource;
|
||||||
|
@ -42,34 +40,36 @@ public class SkinResourceManager implements IResourceManagerReloadListener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResourceManagerReload(IResourceManager resourceManager) {
|
public void onResourceManagerReload(IResourceManager resourceManager) {
|
||||||
try {
|
uuidSkins.clear();
|
||||||
uuidSkins.clear();
|
namedSkins.clear();
|
||||||
namedSkins.clear();
|
for (Future<ResourceLocation> loc : inProgress.values()) {
|
||||||
for (Future<ResourceLocation> loc : inProgress.values()) {
|
loc.cancel(true);
|
||||||
loc.cancel(true);
|
}
|
||||||
}
|
inProgress.clear();
|
||||||
inProgress.clear();
|
for (ResourceLocation res : converted.values()) {
|
||||||
for (ResourceLocation res : converted.values()) {
|
Minecraft.getMinecraft().getTextureManager().deleteTexture(res);
|
||||||
Minecraft.getMinecraft().getTextureManager().deleteTexture(res);
|
}
|
||||||
}
|
converted.clear();
|
||||||
converted.clear();
|
for (String domain : resourceManager.getResourceDomains()) {
|
||||||
for (IResource res : resourceManager.getAllResources(new ResourceLocation("hdskins", "textures/skins/skins.json"))) {
|
try {
|
||||||
try {
|
for (IResource res : resourceManager.getAllResources(new ResourceLocation(domain, "textures/skins/skins.json"))) {
|
||||||
SkinData data = getSkinData(res.getInputStream());
|
try {
|
||||||
for (Skin s : data.skins) {
|
SkinData data = getSkinData(res.getInputStream());
|
||||||
if (s.uuid != null) {
|
for (Skin s : data.skins) {
|
||||||
uuidSkins.put(s.uuid, s);
|
if (s.uuid != null) {
|
||||||
}
|
uuidSkins.put(s.uuid, s);
|
||||||
if (s.name != null) {
|
}
|
||||||
namedSkins.put(s.name, s);
|
if (s.name != null) {
|
||||||
|
namedSkins.put(s.name, s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (JsonParseException je) {
|
||||||
|
LiteLoaderLogger.warning(je, "Invalid skins.json in %s", res.getResourcePackName());
|
||||||
}
|
}
|
||||||
} catch (JsonParseException je) {
|
|
||||||
LiteLoaderLogger.warning(je, "Invalid skins.json in %s", res.getResourcePackName());
|
|
||||||
}
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
// ignore
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
|
||||||
// ignore
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"pack": {
|
|
||||||
"pack_format": 2,
|
|
||||||
"description": "Custom Pony NCP Skins"
|
|
||||||
}
|
|
||||||
}
|
|