- Joined
- Jul 11, 2020
- Messages
- 0
- Reaction score
- 26
- Points
- 0
Wie das ganze aussieht (DO NOT CLICK @ImFrozen_ , Full Code)
Code:
public static void downloadCape(final AbstractClientPlayer player) {
String s = player.getNameClear();
if (s != null && !s.isEmpty()) { String s1 = "http://s.optifine.net/capes/" + s + ".png";
String s2 = FilenameUtils.getBaseName(s1);
final ResourceLocation resourcelocation = new ResourceLocation("capeof/" + s2);
TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
ITextureObject itextureobject = texturemanager.getTexture(resourcelocation);
if (itextureobject != null && itextureobject instanceof ThreadDownloadImageData)
{
ThreadDownloadImageData threaddownloadimagedata = (ThreadDownloadImageData)itextureobject;
if (threaddownloadimagedata.imageFound != null)
{
if (threaddownloadimagedata.imageFound.booleanValue()) {
player.setLocationOfCape(resourcelocation);
}
return;
}
}
IImageBuffer iimagebuffer = new IImageBuffer()
{
ImageBufferDownload ibd = new ImageBufferDownload();
public BufferedImage parseUserSkin(BufferedImage image) {
return CapeUtils.parseCape(image);
}
public void skinAvailable() {
player.setLocationOfCape(resourcelocation);
}
};
ThreadDownloadImageData threaddownloadimagedata1 = new ThreadDownloadImageData((File)null, s1, (ResourceLocation)null, iimagebuffer);
threaddownloadimagedata1.pipeline = true;
texturemanager.loadTexture(resourcelocation, threaddownloadimagedata1);
}
}
public static void downloadCapeAC(final AbstractClientPlayer player) {
String s = player.getNameClear();
if (s != null && !s.isEmpty())
{
String s1 = "https://alpha-centauri.tk/capes/" + s + ".png";
String s2 = FilenameUtils.getBaseName(s1);
final ResourceLocation resourcelocation = new ResourceLocation("capeac/" + s2);
TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
ITextureObject itextureobject = texturemanager.getTexture(resourcelocation);
if (itextureobject != null && itextureobject instanceof ThreadDownloadImageData)
{
ThreadDownloadImageData threaddownloadimagedata = (ThreadDownloadImageData)itextureobject;
if (threaddownloadimagedata.imageFound != null)
{
if (threaddownloadimagedata.imageFound.booleanValue()) {
player.setLocationOfCape(resourcelocation);
}
return;
}
}
IImageBuffer iimagebuffer = new IImageBuffer()
{
ImageBufferDownload ibd = new ImageBufferDownload();
public BufferedImage parseUserSkin(BufferedImage image) {
return CapeUtils.parseCape(image);
}
public void skinAvailable() {
player.setLocationOfCape(resourcelocation);
}
};
ThreadDownloadImageData threaddownloadimagedata1 = new ThreadDownloadImageData((File)null, s1, (ResourceLocation)null, iimagebuffer);
threaddownloadimagedata1.pipeline = true;
texturemanager.loadTexture(resourcelocation, threaddownloadimagedata1);
}
}