mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-22 12:37:59 +01:00
Add separate left wing texture right below current texture
This commit is contained in:
parent
69d1f76ada
commit
99401877e1
8 changed files with 56 additions and 6 deletions
|
@ -31,6 +31,7 @@ class HDSkinDownload extends Thread {
|
||||||
public void run() {
|
public void run() {
|
||||||
Proxy proxy = Minecraft.getMinecraft().getProxy();
|
Proxy proxy = Minecraft.getMinecraft().getProxy();
|
||||||
if (!this.tryDownload(proxy, this.skinUrl) && this.originalThread != null) {
|
if (!this.tryDownload(proxy, this.skinUrl) && this.originalThread != null) {
|
||||||
|
PrivateFields.imageBuffer.set(image, imageBuffer);
|
||||||
this.originalThread.run();
|
this.originalThread.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package com.voxelmodpack.hdskins;
|
package com.voxelmodpack.hdskins;
|
||||||
|
|
||||||
|
import java.awt.Graphics;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
@ -12,6 +14,7 @@ import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
|
|
||||||
import com.google.common.cache.Cache;
|
import com.google.common.cache.Cache;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
import com.mojang.authlib.minecraft.InsecureTextureException;
|
import com.mojang.authlib.minecraft.InsecureTextureException;
|
||||||
|
@ -41,6 +44,8 @@ public final class HDSkinManager {
|
||||||
private static final Map<String, String> playerHashes = Maps.newHashMap();
|
private static final Map<String, String> playerHashes = Maps.newHashMap();
|
||||||
private static final Map<String, Map<Type, MinecraftProfileTexture>> cachedTextures = Maps.newHashMap();
|
private static final Map<String, Map<Type, MinecraftProfileTexture>> cachedTextures = Maps.newHashMap();
|
||||||
|
|
||||||
|
private static List<ISkinModifier> skinModifiers = Lists.newArrayList();
|
||||||
|
|
||||||
public static void onDownloadSkin(EventInfo<ThreadDownloadImageData> e) {
|
public static void onDownloadSkin(EventInfo<ThreadDownloadImageData> e) {
|
||||||
ThreadDownloadImageData imageDownload = e.getSource();
|
ThreadDownloadImageData imageDownload = e.getSource();
|
||||||
if (imageDownload != null) {
|
if (imageDownload != null) {
|
||||||
|
@ -259,4 +264,14 @@ public final class HDSkinManager {
|
||||||
cachedTextures.clear();
|
cachedTextures.clear();
|
||||||
playerHashes.clear();
|
playerHashes.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void addSkinModifier(ISkinModifier modifier) {
|
||||||
|
skinModifiers.add(modifier);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void updateSkin(BufferedImage image, Graphics dest) {
|
||||||
|
for (ISkinModifier skin : skinModifiers) {
|
||||||
|
skin.convertSkin(image, dest);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.voxelmodpack.hdskins;
|
||||||
|
|
||||||
|
import java.awt.Graphics;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
|
||||||
|
public interface ISkinModifier {
|
||||||
|
|
||||||
|
void convertSkin(BufferedImage skin, Graphics dest);
|
||||||
|
}
|
|
@ -38,11 +38,14 @@ public class ImageBufferDownloadHD implements IImageBuffer {
|
||||||
// arm
|
// arm
|
||||||
drawImage(40, 48, 36, 52, 44, 16, 48, 20); // top
|
drawImage(40, 48, 36, 52, 44, 16, 48, 20); // top
|
||||||
drawImage(44, 48, 40, 52, 48, 16, 52, 20); // bottom
|
drawImage(44, 48, 40, 52, 48, 16, 52, 20); // bottom
|
||||||
drawImage(36, 52, 32, 64, 48, 20, 52, 32); //
|
drawImage(36, 52, 32, 64, 48, 20, 52, 32);
|
||||||
drawImage(40, 52, 36, 64, 44, 20, 48, 32); //
|
drawImage(40, 52, 36, 64, 44, 20, 48, 32);
|
||||||
drawImage(44, 52, 40, 64, 40, 20, 44, 32);
|
drawImage(44, 52, 40, 64, 40, 20, 44, 32);
|
||||||
drawImage(48, 52, 44, 64, 52, 20, 56, 32);
|
drawImage(48, 52, 44, 64, 52, 20, 56, 32);
|
||||||
|
|
||||||
|
// mod things
|
||||||
|
HDSkinManager.updateSkin(image, graphics);
|
||||||
|
|
||||||
graphics.dispose();
|
graphics.dispose();
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,6 +87,7 @@ public class MineLittlePony implements InitCompleteListener {
|
||||||
HDSkinManager.clearSkinCache();
|
HDSkinManager.clearSkinCache();
|
||||||
HDSkinManager.setSkinUrl(SKIN_SERVER_URL);
|
HDSkinManager.setSkinUrl(SKIN_SERVER_URL);
|
||||||
HDSkinManager.setGatewayURL(GATEWAY_URL);
|
HDSkinManager.setGatewayURL(GATEWAY_URL);
|
||||||
|
HDSkinManager.addSkinModifier(new PonySkinModifier());
|
||||||
MineLPLogger.info("Set MineLP skin server URL.");
|
MineLPLogger.info("Set MineLP skin server URL.");
|
||||||
}
|
}
|
||||||
RenderManager rm = minecraft.getRenderManager();
|
RenderManager rm = minecraft.getRenderManager();
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.brohoof.minelittlepony;
|
||||||
|
|
||||||
|
import java.awt.Graphics;
|
||||||
|
import java.awt.Image;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
|
||||||
|
import com.voxelmodpack.hdskins.ISkinModifier;
|
||||||
|
|
||||||
|
public class PonySkinModifier implements ISkinModifier {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void convertSkin(BufferedImage skin, Graphics dest) {
|
||||||
|
int scale = skin.getWidth() / 64;
|
||||||
|
drawImage(dest, skin, scale, 64, 32, 56, 48, 56, 16, 64, 32);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void drawImage(Graphics graphics, Image image, int scale, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2) {
|
||||||
|
graphics.drawImage(image,
|
||||||
|
dx1 * scale, dy1 * scale, dx2 * scale, dy2 * scale,
|
||||||
|
sx1 * scale, sy1 * scale, sx2 * scale, sy2 * scale,
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
}
|
|
@ -35,8 +35,7 @@ public class PegasusWings implements IPonyPart, PonyModelConstants {
|
||||||
this.compressiveRightWing = new CompressiveRendering(pony);
|
this.compressiveRightWing = new CompressiveRendering(pony);
|
||||||
|
|
||||||
for (int i = 0; i < leftWing.length; i++) {
|
for (int i = 0; i < leftWing.length; i++) {
|
||||||
this.leftWing[i] = new ModelRenderer(pony, 56, 16);
|
this.leftWing[i] = new ModelRenderer(pony, 56, 32);
|
||||||
this.leftWing[i].mirror = true;
|
|
||||||
this.compressiveLeftWing.addCompressed(this.leftWing[i]);
|
this.compressiveLeftWing.addCompressed(this.leftWing[i]);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < rightWing.length; i++) {
|
for (int i = 0; i < rightWing.length; i++) {
|
||||||
|
@ -44,8 +43,7 @@ public class PegasusWings implements IPonyPart, PonyModelConstants {
|
||||||
this.compressiveRightWing.addCompressed(this.rightWing[i]);
|
this.compressiveRightWing.addCompressed(this.rightWing[i]);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < leftWingExt.length; i++) {
|
for (int i = 0; i < leftWingExt.length; i++) {
|
||||||
this.leftWingExt[i] = new ModelRenderer(pony, 56, 19);
|
this.leftWingExt[i] = new ModelRenderer(pony, 56, 35);
|
||||||
this.leftWingExt[i].mirror = true;
|
|
||||||
this.compressiveLeftWing.addExpanded(this.leftWingExt[i]);
|
this.compressiveLeftWing.addExpanded(this.leftWingExt[i]);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < rightWingExt.length; i++) {
|
for (int i = 0; i < rightWingExt.length; i++) {
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 775 B After Width: | Height: | Size: 1.4 KiB |
Loading…
Reference in a new issue