mirror of
https://github.com/xfl03/MCCustomSkinLoader.git
synced 2026-11-18 17:19:15 +00:00
Add Support for 1.13!
Thanks for MinecraftForge/MCPConfig.
This commit is contained in:
1 parent
ca8b0ba185
commit
f669d095b6
15 files changed
+44562
-475
No files matched your search
@@ -1,6 +0,0 @@
|
||||
minecraft_version=1.12.2
|
||||
minecraft_full_versions=1.12.1,1.12.2
|
||||
#forge gradle needs forge version
|
||||
forge_mc_version=1.12.2
|
||||
forge_version=14.23.3.2655
|
||||
mappings_version=snapshot_20180505
|
||||
@@ -1,3 +0,0 @@
|
||||
/build/
|
||||
/src/main/
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
minecraft_version=1.12
|
||||
minecraft_full_versions=1.12
|
||||
#forge gradle needs forge version
|
||||
forge_mc_version=1.12
|
||||
forge_version=14.21.1.2387
|
||||
mappings_version=snapshot_20180505
|
||||
File renamed without changes.
+44420
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,7 @@
|
||||
minecraft_version=1.13
|
||||
minecraft_full_versions=1.13
|
||||
#forge gradle needs forge version
|
||||
forge_mc_version=1.12.2
|
||||
forge_version=14.23.3.2655
|
||||
mappings_version=snapshot_20180505
|
||||
srg_notch_map=1.13.srg
|
||||
@@ -3,6 +3,7 @@ package customskinloader.fake;
|
||||
import customskinloader.CustomSkinLoader;
|
||||
import customskinloader.fake.texture.FakeBufferedImage;
|
||||
import customskinloader.fake.texture.FakeImage;
|
||||
import customskinloader.fake.texture.FakeNativeImage;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
@@ -11,6 +12,20 @@ public class FakeSkinBuffer implements net.minecraft.client.renderer.IImageBuffe
|
||||
private int ratio = 1;
|
||||
private FakeImage image = null;
|
||||
|
||||
//parseUserSkin for 1.13+
|
||||
public net.minecraft.client.renderer.texture.NativeImage func_195786_a(net.minecraft.client.renderer.texture.NativeImage image) {
|
||||
if (image == null)
|
||||
return null;
|
||||
|
||||
FakeImage img = parseUserSkin(new FakeNativeImage(image));
|
||||
if (img instanceof FakeNativeImage)
|
||||
return ((FakeNativeImage) img).getImage();
|
||||
|
||||
CustomSkinLoader.logger.warning("Failed to parseUserSkin(func_195786_a).");
|
||||
return null;
|
||||
}
|
||||
|
||||
//parseUserSkin for 1.12.2-
|
||||
public BufferedImage parseUserSkin(BufferedImage image) {
|
||||
if (image == null)
|
||||
return null;
|
||||
|
||||
@@ -95,7 +95,10 @@ public class FakeSkinManager{
|
||||
this.location=location;
|
||||
this.texture=texture;
|
||||
}
|
||||
|
||||
|
||||
public net.minecraft.client.renderer.texture.NativeImage func_195786_a(net.minecraft.client.renderer.texture.NativeImage image){
|
||||
return buffer instanceof FakeSkinBuffer ? ((FakeSkinBuffer) buffer).func_195786_a(image) : image;
|
||||
}
|
||||
public BufferedImage parseUserSkin(BufferedImage image){
|
||||
return buffer==null?image:buffer.parseUserSkin(image);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package customskinloader.fake.texture;
|
||||
|
||||
import net.minecraft.client.renderer.texture.NativeImage;
|
||||
|
||||
public class FakeNativeImage implements FakeImage {
|
||||
private NativeImage image;
|
||||
|
||||
public FakeNativeImage(int width, int height) {
|
||||
this(new NativeImage(width, height, true));
|
||||
}
|
||||
|
||||
public FakeNativeImage(NativeImage image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
public NativeImage getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public FakeImage createImage(int width, int height) {
|
||||
return new FakeNativeImage(width, height);
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return image.func_195702_a();
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return image.func_195714_b();
|
||||
}
|
||||
|
||||
public int getRGBA(int x, int y) {
|
||||
return image.func_195709_a(x, y);
|
||||
}
|
||||
|
||||
public void setRGBA(int x, int y, int rgba) {
|
||||
image.func_195700_a(x, y, rgba);
|
||||
}
|
||||
|
||||
public void copyImageData(FakeImage image) {
|
||||
if (!(image instanceof FakeNativeImage)) return;
|
||||
this.image.func_195703_a(((FakeNativeImage) image).getImage());
|
||||
}
|
||||
|
||||
public void fillArea(int x0, int y0, int width, int height) {
|
||||
image.func_195715_a(x0, y0, width, height, 0);
|
||||
}
|
||||
|
||||
public void copyArea(int x0, int y0, int dx, int dy, int width, int height, boolean reversex, boolean reversey) {
|
||||
image.func_195699_a(x0, y0, dx, dy, width, height, reversex, reversey);
|
||||
}
|
||||
|
||||
public void close() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package net.minecraft.client.renderer.texture;
|
||||
|
||||
/**
|
||||
* Empty stack for NativeImage
|
||||
*/
|
||||
public class NativeImage {
|
||||
public NativeImage(int p_i48122_1_, int p_i48122_2_, boolean p_i48122_3_) {
|
||||
}
|
||||
|
||||
/**
|
||||
* getWidth
|
||||
*/
|
||||
public int func_195702_a() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* getHeight
|
||||
*/
|
||||
public int func_195714_b() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* copyImage image
|
||||
*/
|
||||
public void func_195703_a(NativeImage p_195703_1_) {
|
||||
}
|
||||
|
||||
/**
|
||||
* fillAreaRGBA x0 y0 weight height rgba
|
||||
*/
|
||||
public void func_195715_a(int p_195715_1_, int p_195715_2_, int p_195715_3_, int p_195715_4_, int p_195715_5_) {
|
||||
}
|
||||
|
||||
/**
|
||||
* copyAreaRGBA x0 y0 dx dy weight height reversex reversey
|
||||
*/
|
||||
public void func_195699_a(int p_195699_1_, int p_195699_2_, int p_195699_3_, int p_195699_4_, int p_195699_5_, int p_195699_6_, boolean p_195699_7_, boolean p_195699_8_) {
|
||||
}
|
||||
|
||||
/**
|
||||
* getPixelRGBA x y
|
||||
*/
|
||||
public int func_195709_a(int p_195709_1_, int p_195709_2_) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* setPixelRGBA x y rgba
|
||||
*/
|
||||
public void func_195700_a(int p_195700_1_, int p_195700_2_, int p_195700_3_) {
|
||||
}
|
||||
|
||||
public void close() {
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,7 @@ jar {
|
||||
attributes 'FMLCorePlugin': 'customskinloader.forge.ForgePlugin'
|
||||
attributes 'FMLCorePluginContainsFMLMod': true
|
||||
}
|
||||
exclude 'net/minecraft/client/renderer/texture/NativeImage.class'
|
||||
}
|
||||
sourceSets {
|
||||
main {
|
||||
|
||||
@@ -1,402 +0,0 @@
|
||||
package net.minecraft.client.gui;
|
||||
|
||||
import com.google.common.collect.ComparisonChain;
|
||||
import com.google.common.collect.Ordering;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.network.NetHandlerPlayClient;
|
||||
import net.minecraft.client.network.NetworkPlayerInfo;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EnumPlayerModelParts;
|
||||
import net.minecraft.scoreboard.IScoreCriteria;
|
||||
import net.minecraft.scoreboard.ScoreObjective;
|
||||
import net.minecraft.scoreboard.ScorePlayerTeam;
|
||||
import net.minecraft.scoreboard.Scoreboard;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.GameType;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiPlayerTabOverlay extends Gui
|
||||
{
|
||||
private static final Ordering<NetworkPlayerInfo> ENTRY_ORDERING = Ordering.from(new GuiPlayerTabOverlay.PlayerComparator());
|
||||
private final Minecraft mc;
|
||||
private final GuiIngame guiIngame;
|
||||
private ITextComponent footer;
|
||||
private ITextComponent header;
|
||||
/** The last time the playerlist was opened (went from not being renderd, to being rendered) */
|
||||
private long lastTimeOpened;
|
||||
/** Weither or not the playerlist is currently being rendered */
|
||||
private boolean isBeingRendered;
|
||||
|
||||
public GuiPlayerTabOverlay(Minecraft mcIn, GuiIngame guiIngameIn)
|
||||
{
|
||||
this.mc = mcIn;
|
||||
this.guiIngame = guiIngameIn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name that should be renderd for the player supplied
|
||||
*/
|
||||
public String getPlayerName(NetworkPlayerInfo networkPlayerInfoIn)
|
||||
{
|
||||
return networkPlayerInfoIn.getDisplayName() != null ? networkPlayerInfoIn.getDisplayName().getFormattedText() : ScorePlayerTeam.formatPlayerName(networkPlayerInfoIn.getPlayerTeam(), networkPlayerInfoIn.getGameProfile().getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by GuiIngame to update the information stored in the playerlist, does not actually render the list,
|
||||
* however.
|
||||
*/
|
||||
public void updatePlayerList(boolean willBeRendered)
|
||||
{
|
||||
if (willBeRendered && !this.isBeingRendered)
|
||||
{
|
||||
this.lastTimeOpened = Minecraft.getSystemTime();
|
||||
}
|
||||
|
||||
this.isBeingRendered = willBeRendered;
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the playerlist, its background, headers and footers.
|
||||
*/
|
||||
public void renderPlayerlist(int width, Scoreboard scoreboardIn, @Nullable ScoreObjective scoreObjectiveIn)
|
||||
{
|
||||
NetHandlerPlayClient nethandlerplayclient = this.mc.player.connection;
|
||||
List<NetworkPlayerInfo> list = ENTRY_ORDERING.<NetworkPlayerInfo>sortedCopy(nethandlerplayclient.getPlayerInfoMap());
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
|
||||
for (NetworkPlayerInfo networkplayerinfo : list)
|
||||
{
|
||||
int k = this.mc.fontRenderer.getStringWidth(this.getPlayerName(networkplayerinfo));
|
||||
i = Math.max(i, k);
|
||||
|
||||
if (scoreObjectiveIn != null && scoreObjectiveIn.getRenderType() != IScoreCriteria.EnumRenderType.HEARTS)
|
||||
{
|
||||
k = this.mc.fontRenderer.getStringWidth(" " + scoreboardIn.getOrCreateScore(networkplayerinfo.getGameProfile().getName(), scoreObjectiveIn).getScorePoints());
|
||||
j = Math.max(j, k);
|
||||
}
|
||||
}
|
||||
|
||||
list = list.subList(0, Math.min(list.size(), 80));
|
||||
int l3 = list.size();
|
||||
int i4 = l3;
|
||||
int j4;
|
||||
|
||||
for (j4 = 1; i4 > 20; i4 = (l3 + j4 - 1) / j4)
|
||||
{
|
||||
++j4;
|
||||
}
|
||||
|
||||
//boolean flag = this.mc.isIntegratedServerRunning() || this.mc.getConnection().getNetworkManager().isEncrypted();
|
||||
boolean flag = true;//Modified
|
||||
int l;
|
||||
|
||||
if (scoreObjectiveIn != null)
|
||||
{
|
||||
if (scoreObjectiveIn.getRenderType() == IScoreCriteria.EnumRenderType.HEARTS)
|
||||
{
|
||||
l = 90;
|
||||
}
|
||||
else
|
||||
{
|
||||
l = j;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
l = 0;
|
||||
}
|
||||
|
||||
int i1 = Math.min(j4 * ((flag ? 9 : 0) + i + l + 13), width - 50) / j4;
|
||||
int j1 = width / 2 - (i1 * j4 + (j4 - 1) * 5) / 2;
|
||||
int k1 = 10;
|
||||
int l1 = i1 * j4 + (j4 - 1) * 5;
|
||||
List<String> list1 = null;
|
||||
|
||||
if (this.header != null)
|
||||
{
|
||||
list1 = this.mc.fontRenderer.listFormattedStringToWidth(this.header.getFormattedText(), width - 50);
|
||||
|
||||
for (String s : list1)
|
||||
{
|
||||
l1 = Math.max(l1, this.mc.fontRenderer.getStringWidth(s));
|
||||
}
|
||||
}
|
||||
|
||||
List<String> list2 = null;
|
||||
|
||||
if (this.footer != null)
|
||||
{
|
||||
list2 = this.mc.fontRenderer.listFormattedStringToWidth(this.footer.getFormattedText(), width - 50);
|
||||
|
||||
for (String s1 : list2)
|
||||
{
|
||||
l1 = Math.max(l1, this.mc.fontRenderer.getStringWidth(s1));
|
||||
}
|
||||
}
|
||||
|
||||
if (list1 != null)
|
||||
{
|
||||
drawRect(width / 2 - l1 / 2 - 1, k1 - 1, width / 2 + l1 / 2 + 1, k1 + list1.size() * this.mc.fontRenderer.FONT_HEIGHT, Integer.MIN_VALUE);
|
||||
|
||||
for (String s2 : list1)
|
||||
{
|
||||
int i2 = this.mc.fontRenderer.getStringWidth(s2);
|
||||
this.mc.fontRenderer.drawStringWithShadow(s2, (float)(width / 2 - i2 / 2), (float)k1, -1);
|
||||
k1 += this.mc.fontRenderer.FONT_HEIGHT;
|
||||
}
|
||||
|
||||
++k1;
|
||||
}
|
||||
|
||||
drawRect(width / 2 - l1 / 2 - 1, k1 - 1, width / 2 + l1 / 2 + 1, k1 + i4 * 9, Integer.MIN_VALUE);
|
||||
|
||||
for (int k4 = 0; k4 < l3; ++k4)
|
||||
{
|
||||
int l4 = k4 / i4;
|
||||
int i5 = k4 % i4;
|
||||
int j2 = j1 + l4 * i1 + l4 * 5;
|
||||
int k2 = k1 + i5 * 9;
|
||||
drawRect(j2, k2, j2 + i1, k2 + 8, 553648127);
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GlStateManager.enableAlpha();
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
||||
|
||||
if (k4 < list.size())
|
||||
{
|
||||
NetworkPlayerInfo networkplayerinfo1 = list.get(k4);
|
||||
GameProfile gameprofile = networkplayerinfo1.getGameProfile();
|
||||
|
||||
if (flag)
|
||||
{
|
||||
EntityPlayer entityplayer = ((net.minecraft.world.World)this.mc.world).getPlayerEntityByUUID(gameprofile.getId());//Modified
|
||||
boolean flag1 = entityplayer != null && entityplayer.isWearing(EnumPlayerModelParts.CAPE) && ("Dinnerbone".equals(gameprofile.getName()) || "Grumm".equals(gameprofile.getName()));
|
||||
this.mc.getTextureManager().bindTexture(networkplayerinfo1.getLocationSkin());
|
||||
int l2 = 8 + (flag1 ? 8 : 0);
|
||||
int i3 = 8 * (flag1 ? -1 : 1);
|
||||
Gui.drawScaledCustomSizeModalRect(j2, k2, 8.0F, (float)l2, 8, i3, 8, 8, 64.0F, 64.0F);
|
||||
|
||||
if (entityplayer != null && entityplayer.isWearing(EnumPlayerModelParts.HAT))
|
||||
{
|
||||
int j3 = 8 + (flag1 ? 8 : 0);
|
||||
int k3 = 8 * (flag1 ? -1 : 1);
|
||||
Gui.drawScaledCustomSizeModalRect(j2, k2, 40.0F, (float)j3, 8, k3, 8, 8, 64.0F, 64.0F);
|
||||
}
|
||||
|
||||
j2 += 9;
|
||||
}
|
||||
|
||||
String s4 = this.getPlayerName(networkplayerinfo1);
|
||||
|
||||
if (networkplayerinfo1.getGameType() == GameType.SPECTATOR)
|
||||
{
|
||||
this.mc.fontRenderer.drawStringWithShadow(TextFormatting.ITALIC + s4, (float)j2, (float)k2, -1862270977);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.mc.fontRenderer.drawStringWithShadow(s4, (float)j2, (float)k2, -1);
|
||||
}
|
||||
|
||||
if (scoreObjectiveIn != null && networkplayerinfo1.getGameType() != GameType.SPECTATOR)
|
||||
{
|
||||
int k5 = j2 + i + 1;
|
||||
int l5 = k5 + l;
|
||||
|
||||
if (l5 - k5 > 5)
|
||||
{
|
||||
this.drawScoreboardValues(scoreObjectiveIn, k2, gameprofile.getName(), k5, l5, networkplayerinfo1);
|
||||
}
|
||||
}
|
||||
|
||||
this.drawPing(i1, j2 - (flag ? 9 : 0), k2, networkplayerinfo1);
|
||||
}
|
||||
}
|
||||
|
||||
if (list2 != null)
|
||||
{
|
||||
k1 = k1 + i4 * 9 + 1;
|
||||
drawRect(width / 2 - l1 / 2 - 1, k1 - 1, width / 2 + l1 / 2 + 1, k1 + list2.size() * this.mc.fontRenderer.FONT_HEIGHT, Integer.MIN_VALUE);
|
||||
|
||||
for (String s3 : list2)
|
||||
{
|
||||
int j5 = this.mc.fontRenderer.getStringWidth(s3);
|
||||
this.mc.fontRenderer.drawStringWithShadow(s3, (float)(width / 2 - j5 / 2), (float)k1, -1);
|
||||
k1 += this.mc.fontRenderer.FONT_HEIGHT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawPing(int p_175245_1_, int p_175245_2_, int p_175245_3_, NetworkPlayerInfo networkPlayerInfoIn)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(ICONS);
|
||||
int i = 0;
|
||||
int j;
|
||||
|
||||
if (networkPlayerInfoIn.getResponseTime() < 0)
|
||||
{
|
||||
j = 5;
|
||||
}
|
||||
else if (networkPlayerInfoIn.getResponseTime() < 150)
|
||||
{
|
||||
j = 0;
|
||||
}
|
||||
else if (networkPlayerInfoIn.getResponseTime() < 300)
|
||||
{
|
||||
j = 1;
|
||||
}
|
||||
else if (networkPlayerInfoIn.getResponseTime() < 600)
|
||||
{
|
||||
j = 2;
|
||||
}
|
||||
else if (networkPlayerInfoIn.getResponseTime() < 1000)
|
||||
{
|
||||
j = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
j = 4;
|
||||
}
|
||||
|
||||
this.zLevel += 100.0F;
|
||||
this.drawTexturedModalRect(p_175245_2_ + p_175245_1_ - 11, p_175245_3_, 0, 176 + j * 8, 10, 8);
|
||||
this.zLevel -= 100.0F;
|
||||
}
|
||||
|
||||
private void drawScoreboardValues(ScoreObjective objective, int p_175247_2_, String name, int p_175247_4_, int p_175247_5_, NetworkPlayerInfo info)
|
||||
{
|
||||
int i = objective.getScoreboard().getOrCreateScore(name, objective).getScorePoints();
|
||||
|
||||
if (objective.getRenderType() == IScoreCriteria.EnumRenderType.HEARTS)
|
||||
{
|
||||
this.mc.getTextureManager().bindTexture(ICONS);
|
||||
|
||||
if (this.lastTimeOpened == info.getRenderVisibilityId())
|
||||
{
|
||||
if (i < info.getLastHealth())
|
||||
{
|
||||
info.setLastHealthTime(Minecraft.getSystemTime());
|
||||
info.setHealthBlinkTime((long)(this.guiIngame.getUpdateCounter() + 20));
|
||||
}
|
||||
else if (i > info.getLastHealth())
|
||||
{
|
||||
info.setLastHealthTime(Minecraft.getSystemTime());
|
||||
info.setHealthBlinkTime((long)(this.guiIngame.getUpdateCounter() + 10));
|
||||
}
|
||||
}
|
||||
|
||||
if (Minecraft.getSystemTime() - info.getLastHealthTime() > 1000L || this.lastTimeOpened != info.getRenderVisibilityId())
|
||||
{
|
||||
info.setLastHealth(i);
|
||||
info.setDisplayHealth(i);
|
||||
info.setLastHealthTime(Minecraft.getSystemTime());
|
||||
}
|
||||
|
||||
info.setRenderVisibilityId(this.lastTimeOpened);
|
||||
info.setLastHealth(i);
|
||||
int j = MathHelper.ceil((float)Math.max(i, info.getDisplayHealth()) / 2.0F);
|
||||
int k = Math.max(MathHelper.ceil((float)(i / 2)), Math.max(MathHelper.ceil((float)(info.getDisplayHealth() / 2)), 10));
|
||||
boolean flag = info.getHealthBlinkTime() > (long)this.guiIngame.getUpdateCounter() && (info.getHealthBlinkTime() - (long)this.guiIngame.getUpdateCounter()) / 3L % 2L == 1L;
|
||||
|
||||
if (j > 0)
|
||||
{
|
||||
float f = Math.min((float)(p_175247_5_ - p_175247_4_ - 4) / (float)k, 9.0F);
|
||||
|
||||
if (f > 3.0F)
|
||||
{
|
||||
for (int l = j; l < k; ++l)
|
||||
{
|
||||
this.drawTexturedModalRect((float)p_175247_4_ + (float)l * f, (float)p_175247_2_, flag ? 25 : 16, 0, 9, 9);
|
||||
}
|
||||
|
||||
for (int j1 = 0; j1 < j; ++j1)
|
||||
{
|
||||
this.drawTexturedModalRect((float)p_175247_4_ + (float)j1 * f, (float)p_175247_2_, flag ? 25 : 16, 0, 9, 9);
|
||||
|
||||
if (flag)
|
||||
{
|
||||
if (j1 * 2 + 1 < info.getDisplayHealth())
|
||||
{
|
||||
this.drawTexturedModalRect((float)p_175247_4_ + (float)j1 * f, (float)p_175247_2_, 70, 0, 9, 9);
|
||||
}
|
||||
|
||||
if (j1 * 2 + 1 == info.getDisplayHealth())
|
||||
{
|
||||
this.drawTexturedModalRect((float)p_175247_4_ + (float)j1 * f, (float)p_175247_2_, 79, 0, 9, 9);
|
||||
}
|
||||
}
|
||||
|
||||
if (j1 * 2 + 1 < i)
|
||||
{
|
||||
this.drawTexturedModalRect((float)p_175247_4_ + (float)j1 * f, (float)p_175247_2_, j1 >= 10 ? 160 : 52, 0, 9, 9);
|
||||
}
|
||||
|
||||
if (j1 * 2 + 1 == i)
|
||||
{
|
||||
this.drawTexturedModalRect((float)p_175247_4_ + (float)j1 * f, (float)p_175247_2_, j1 >= 10 ? 169 : 61, 0, 9, 9);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
float f1 = MathHelper.clamp((float)i / 20.0F, 0.0F, 1.0F);
|
||||
int i1 = (int)((1.0F - f1) * 255.0F) << 16 | (int)(f1 * 255.0F) << 8;
|
||||
String s = "" + (float)i / 2.0F;
|
||||
|
||||
if (p_175247_5_ - this.mc.fontRenderer.getStringWidth(s + "hp") >= p_175247_4_)
|
||||
{
|
||||
s = s + "hp";
|
||||
}
|
||||
|
||||
this.mc.fontRenderer.drawStringWithShadow(s, (float)((p_175247_5_ + p_175247_4_) / 2 - this.mc.fontRenderer.getStringWidth(s) / 2), (float)p_175247_2_, i1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
String s1 = TextFormatting.YELLOW + "" + i;
|
||||
this.mc.fontRenderer.drawStringWithShadow(s1, (float)(p_175247_5_ - this.mc.fontRenderer.getStringWidth(s1)), (float)p_175247_2_, 16777215);
|
||||
}
|
||||
}
|
||||
|
||||
public void setFooter(@Nullable ITextComponent footerIn)
|
||||
{
|
||||
this.footer = footerIn;
|
||||
}
|
||||
|
||||
public void setHeader(@Nullable ITextComponent headerIn)
|
||||
{
|
||||
this.header = headerIn;
|
||||
}
|
||||
|
||||
public void resetFooterHeader()
|
||||
{
|
||||
this.header = null;
|
||||
this.footer = null;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
static class PlayerComparator implements Comparator<NetworkPlayerInfo>
|
||||
{
|
||||
private PlayerComparator()
|
||||
{
|
||||
}
|
||||
|
||||
public int compare(NetworkPlayerInfo p_compare_1_, NetworkPlayerInfo p_compare_2_)
|
||||
{
|
||||
ScorePlayerTeam scoreplayerteam = p_compare_1_.getPlayerTeam();
|
||||
ScorePlayerTeam scoreplayerteam1 = p_compare_2_.getPlayerTeam();
|
||||
return ComparisonChain.start().compareTrueFirst(p_compare_1_.getGameType() != GameType.SPECTATOR, p_compare_2_.getGameType() != GameType.SPECTATOR).compare(scoreplayerteam != null ? scoreplayerteam.getName() : "", scoreplayerteam1 != null ? scoreplayerteam1.getName() : "").compare(p_compare_1_.getGameProfile().getName(), p_compare_2_.getGameProfile().getName()).result();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package net.minecraft.client.gui.spectator;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.network.play.client.CPacketSpectate;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class PlayerMenuObject implements ISpectatorMenuObject
|
||||
{
|
||||
private final GameProfile profile;
|
||||
private final ResourceLocation resourceLocation;
|
||||
|
||||
public PlayerMenuObject(GameProfile profileIn)
|
||||
{
|
||||
this.profile = profileIn;
|
||||
/*
|
||||
this.resourceLocation = AbstractClientPlayer.getLocationSkin(profileIn.getName());
|
||||
AbstractClientPlayer.getDownloadImageSkin(this.resourceLocation, profileIn.getName());
|
||||
*/
|
||||
this.resourceLocation = customskinloader.fake.FakeClientPlayer.getLocationSkin(profileIn.getName());
|
||||
customskinloader.fake.FakeClientPlayer.getDownloadImageSkin(this.resourceLocation, profileIn.getName());
|
||||
}
|
||||
|
||||
public void selectItem(SpectatorMenu menu)
|
||||
{
|
||||
Minecraft.getMinecraft().getConnection().sendPacket(new CPacketSpectate(this.profile.getId()));
|
||||
}
|
||||
|
||||
public ITextComponent getSpectatorName()
|
||||
{
|
||||
return new TextComponentString(this.profile.getName());
|
||||
}
|
||||
|
||||
public void renderIcon(float brightness, int alpha)
|
||||
{
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(this.resourceLocation);
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, (float)alpha / 255.0F);
|
||||
Gui.drawScaledCustomSizeModalRect(2, 2, 8.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
|
||||
Gui.drawScaledCustomSizeModalRect(2, 2, 40.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
|
||||
}
|
||||
|
||||
public boolean isEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -50,6 +50,7 @@ jar {
|
||||
attributes 'TweakVersion': version
|
||||
attributes 'TweakOrder' : '-10'
|
||||
}
|
||||
exclude 'net/minecraft/client/renderer/texture/NativeImage.class'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
+2
-3
@@ -1,6 +1,5 @@
|
||||
//Special Vanilla Edition
|
||||
include "1.12"
|
||||
include "1.12.2"
|
||||
include "1.13"
|
||||
|
||||
//Universal Forge Edition for [1.8,)
|
||||
include "Forge"
|
||||
//include "Forge"
|
||||
Reference in new issue
Block a user