mirror of
https://github.com/refactorinqq/SLC-1.8.9.git
synced 2024-11-10 07:31:32 +01:00
Cosmetics
This commit is contained in:
parent
f5af207909
commit
cd44999f7c
@ -244,6 +244,8 @@ public class Client {
|
||||
|
||||
public void shutdown() {
|
||||
logger.info("---------[ Silent Client Stopping ]--------------");
|
||||
logger.info("STOPPING > silent-socket");
|
||||
silentSocket.Disconnect();
|
||||
logger.info("-------------------------------------------------");
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,9 @@ import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import net.silentclient.client.utils.CustomAbstractClientPlayer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.silentclient.client.cosmetics.StaticResourceLocation;
|
||||
import net.silentclient.client.mixin.ducks.AbstractClientPlayerExt;
|
||||
import org.lwjgl.Sys;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
@ -70,16 +72,16 @@ public class AdminRender extends GuiScreen {
|
||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||
super.drawDefaultBackground();
|
||||
|
||||
CustomAbstractClientPlayer.players.get(CustomAbstractClientPlayer.players.get(mc.thePlayer)).setCapeShoulders(true);
|
||||
CustomAbstractClientPlayer.players.get(CustomAbstractClientPlayer.players.get(mc.thePlayer)).setCapeType("Rectangle");
|
||||
if(CustomAbstractClientPlayer.players.get(CustomAbstractClientPlayer.players.get(mc.thePlayer)).getLocationSilentCape() != null) {
|
||||
CustomAbstractClientPlayer.players.get(CustomAbstractClientPlayer.players.get(mc.thePlayer)).getLocationSilentCape().setCurrentFrame(this.currentFrame);
|
||||
((AbstractClientPlayerExt) Minecraft.getMinecraft().thePlayer).silent$setShoulders(true);
|
||||
((AbstractClientPlayerExt) Minecraft.getMinecraft().thePlayer).silent$setCapeType("Rectangle");
|
||||
if(((AbstractClientPlayerExt) Minecraft.getMinecraft().thePlayer).silent$getCape() != null) {
|
||||
((AbstractClientPlayerExt) Minecraft.getMinecraft().thePlayer).silent$getCape().setCurrentFrame(this.currentFrame);
|
||||
}
|
||||
if(CustomAbstractClientPlayer.players.get(CustomAbstractClientPlayer.players.get(mc.thePlayer)).getBandana() != null) {
|
||||
CustomAbstractClientPlayer.players.get(CustomAbstractClientPlayer.players.get(mc.thePlayer)).getBandana().setCurrentFrame(this.currentFrame);
|
||||
if(((AbstractClientPlayerExt) Minecraft.getMinecraft().thePlayer).silent$getBandana() != null) {
|
||||
((AbstractClientPlayerExt) Minecraft.getMinecraft().thePlayer).silent$getBandana().setCurrentFrame(this.currentFrame);
|
||||
}
|
||||
if(CustomAbstractClientPlayer.players.get(CustomAbstractClientPlayer.players.get(mc.thePlayer)).getShield() != null && CustomAbstractClientPlayer.players.get(CustomAbstractClientPlayer.players.get(mc.thePlayer)).getShield().getTexture() != null) {
|
||||
CustomAbstractClientPlayer.players.get(CustomAbstractClientPlayer.players.get(mc.thePlayer)).getShield().getTexture().setCurrentFrame(this.currentFrame);
|
||||
if(((AbstractClientPlayerExt) Minecraft.getMinecraft().thePlayer).silent$getShield() != null && ((AbstractClientPlayerExt) Minecraft.getMinecraft().thePlayer).silent$getShield().getTexture() != null) {
|
||||
((AbstractClientPlayerExt) Minecraft.getMinecraft().thePlayer).silent$getShield().getTexture().setCurrentFrame(this.currentFrame);
|
||||
}
|
||||
|
||||
CustomFontRenderer font = new CustomFontRenderer();
|
||||
@ -208,7 +210,7 @@ public class AdminRender extends GuiScreen {
|
||||
|
||||
twoColumn = false;
|
||||
|
||||
if(CustomAbstractClientPlayer.players.get(CustomAbstractClientPlayer.players.get(mc.thePlayer)).getLocationOfWings() == null) {
|
||||
if(((AbstractClientPlayerExt) Minecraft.getMinecraft().thePlayer).silent$getWings() == null) {
|
||||
settingY += 20;
|
||||
font.drawString("Frames: " + this.frames, 2, settingY, -1, true);
|
||||
settingY += 10;
|
||||
@ -365,7 +367,7 @@ public class AdminRender extends GuiScreen {
|
||||
loadTextureCosmetic("shield", "hexagon_shield");
|
||||
}
|
||||
twoColumn = false;
|
||||
if(CustomAbstractClientPlayer.players.get(CustomAbstractClientPlayer.players.get(mc.thePlayer)).getLocationOfWings() == null) {
|
||||
if(((AbstractClientPlayerExt) Minecraft.getMinecraft().thePlayer).silent$getWings() == null) {
|
||||
settingY += 45;
|
||||
if(StaticButton.isHovered(mouseX, mouseY, 2 + (twoColumn ? 63 : 0), settingY, 60, 12)) {
|
||||
this.currentFrame = (this.currentFrame - 1 >= 0 ? this.currentFrame - 1 : this.frames - 1);
|
||||
@ -397,34 +399,34 @@ public class AdminRender extends GuiScreen {
|
||||
}
|
||||
|
||||
private void loadTextureCosmetic(String type, String model) {
|
||||
CustomAbstractClientPlayer.players.get(mc.thePlayer).setLocationSilentCape(null);
|
||||
CustomAbstractClientPlayer.players.get(mc.thePlayer).setShoulders(null);
|
||||
CustomAbstractClientPlayer.players.get(mc.thePlayer).setBandana(null);
|
||||
CustomAbstractClientPlayer.players.get(mc.thePlayer).setHat(null);
|
||||
CustomAbstractClientPlayer.players.get(mc.thePlayer).setShield(null);
|
||||
CustomAbstractClientPlayer.players.get(mc.thePlayer).setLocationOfWings(null);
|
||||
((AbstractClientPlayerExt) mc.thePlayer).silent$setCape(null);
|
||||
((AbstractClientPlayerExt) mc.thePlayer).silent$setCapeShoulders(null);
|
||||
((AbstractClientPlayerExt) mc.thePlayer).silent$setBandana(null);
|
||||
((AbstractClientPlayerExt) mc.thePlayer).silent$setHat(null);
|
||||
((AbstractClientPlayerExt) mc.thePlayer).silent$setShield(null);
|
||||
((AbstractClientPlayerExt) mc.thePlayer).silent$setWings(null);
|
||||
this.frames = 0;
|
||||
this.currentFrame = 0;
|
||||
switch(type) {
|
||||
case "cape":
|
||||
CustomAbstractClientPlayer.players.get(mc.thePlayer).setLocationSilentCape(new TestAnimatedResourceLocation(adminRenderPath.listFiles().length - 1, 150));
|
||||
CustomAbstractClientPlayer.players.get(mc.thePlayer).setShoulders(FileUtils.fileToResourceLocation(new File(adminRenderPath, "0.png")));
|
||||
this.frames = CustomAbstractClientPlayer.players.get(mc.thePlayer).getLocationSilentCape().getFrames();
|
||||
((AbstractClientPlayerExt) mc.thePlayer).silent$setCape(new TestAnimatedResourceLocation(adminRenderPath.listFiles().length - 1, 150));
|
||||
((AbstractClientPlayerExt) mc.thePlayer).silent$setCapeShoulders(new StaticResourceLocation(FileUtils.fileToResourceLocation(new File(adminRenderPath, "0.png")).getResourcePath()));
|
||||
this.frames = ((AbstractClientPlayerExt) mc.thePlayer).silent$getCape().getFrames();
|
||||
this.currentFrame = 0;
|
||||
break;
|
||||
case "wings":
|
||||
CustomAbstractClientPlayer.players.get(mc.thePlayer).setLocationOfWings(FileUtils.fileToResourceLocation(new File(adminRenderPath, "0.png")));
|
||||
((AbstractClientPlayerExt) mc.thePlayer).silent$setWings(new TestAnimatedResourceLocation(adminRenderPath.listFiles().length - 1, 150));
|
||||
this.frames = 1;
|
||||
this.currentFrame = 0;
|
||||
break;
|
||||
case "bandana":
|
||||
CustomAbstractClientPlayer.players.get(mc.thePlayer).setBandana(new TestAnimatedResourceLocation(adminRenderPath.listFiles().length - 1, 150));
|
||||
this.frames = CustomAbstractClientPlayer.players.get(mc.thePlayer).getBandana().getFrames();
|
||||
((AbstractClientPlayerExt) mc.thePlayer).silent$setBandana(new TestAnimatedResourceLocation(adminRenderPath.listFiles().length - 1, 150));
|
||||
this.frames = ((AbstractClientPlayerExt) mc.thePlayer).silent$getBandana().getFrames();
|
||||
this.currentFrame = 0;
|
||||
break;
|
||||
case "shield":
|
||||
CustomAbstractClientPlayer.players.get(mc.thePlayer).setShield(new ShieldData(new TestAnimatedResourceLocation(adminRenderPath.listFiles().length - 1, 150), model));
|
||||
this.frames = CustomAbstractClientPlayer.players.get(mc.thePlayer).getShield().getTexture().getFrames();
|
||||
((AbstractClientPlayerExt) mc.thePlayer).silent$setShield(new ShieldData(new TestAnimatedResourceLocation(adminRenderPath.listFiles().length - 1, 150), model));
|
||||
this.frames = ((AbstractClientPlayerExt) mc.thePlayer).silent$getShield().getTexture().getFrames();
|
||||
this.currentFrame = 0;
|
||||
break;
|
||||
}
|
||||
|
@ -7,8 +7,8 @@ import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
|
||||
import net.silentclient.client.Client;
|
||||
import net.silentclient.client.blc.BlcGlStateManager;
|
||||
import net.silentclient.client.mixin.ducks.AbstractClientPlayerExt;
|
||||
import net.silentclient.client.mods.settings.CosmeticsMod;
|
||||
import net.silentclient.client.utils.CustomAbstractClientPlayer;
|
||||
|
||||
public class AbstractShieldRenderer extends ModelBase implements LayerRenderer<AbstractClientPlayer> {
|
||||
private final RenderPlayer playerRenderer;
|
||||
@ -21,7 +21,7 @@ public class AbstractShieldRenderer extends ModelBase implements LayerRenderer<A
|
||||
@Override
|
||||
public void doRenderLayer(AbstractClientPlayer entity, float p_177141_2_, float p_177141_3_,
|
||||
float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) {
|
||||
if(CustomAbstractClientPlayer.players.get(entity).getShield() == null || !Client.getInstance().getSettingsManager().getSettingByClass(CosmeticsMod.class, "Shields").getValBoolean() || entity.isInvisible() || !Client.getInstance().getCosmetics().shieldModels.containsKey(CustomAbstractClientPlayer.players.get(entity).getShield().getModel()) || !Client.getInstance().getCosmetics().shieldModels.get(CustomAbstractClientPlayer.players.get(entity).getShield().getModel()).loadModel()) {
|
||||
if(((AbstractClientPlayerExt) entity).silent$getShield() == null || !Client.getInstance().getSettingsManager().getSettingByClass(CosmeticsMod.class, "Shields").getValBoolean() || entity.isInvisible() || !Client.getInstance().getCosmetics().shieldModels.containsKey(((AbstractClientPlayerExt) entity).silent$getShield().getModel()) || !Client.getInstance().getCosmetics().shieldModels.get(((AbstractClientPlayerExt) entity).silent$getShield().getModel()).loadModel()) {
|
||||
return;
|
||||
}
|
||||
BlcGlStateManager.t();
|
||||
@ -43,12 +43,12 @@ public class AbstractShieldRenderer extends ModelBase implements LayerRenderer<A
|
||||
if (playerRenderer.getMainModel().bipedLeftArm.rotateAngleX != 0.0F) {
|
||||
GlStateManager.rotate(playerRenderer.getMainModel().bipedLeftArm.rotateAngleX * (180F / (float) Math.PI), 1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
applyArmTransformations(CustomAbstractClientPlayer.players.get(entity).getShield().getModel(), entity.isSneaking(), entity.getSkinType().equals("slim"));
|
||||
double d = getShieldScale(CustomAbstractClientPlayer.players.get(entity).getShield().getModel());
|
||||
applyArmTransformations(((AbstractClientPlayerExt) entity).silent$getShield().getModel(), entity.isSneaking(), entity.getSkinType().equals("slim"));
|
||||
double d = getShieldScale(((AbstractClientPlayerExt) entity).silent$getShield().getModel());
|
||||
BlcGlStateManager.a(d, d, d);
|
||||
BlcGlStateManager.k();
|
||||
CustomAbstractClientPlayer.players.get(entity).getShield().getTexture().bindTexture();
|
||||
Client.getInstance().getCosmetics().shieldModels.get(CustomAbstractClientPlayer.players.get(entity).getShield().getModel()).renderModel();
|
||||
((AbstractClientPlayerExt) entity).silent$getShield().getTexture().bindTexture();
|
||||
Client.getInstance().getCosmetics().shieldModels.get(((AbstractClientPlayerExt) entity).silent$getShield().getModel()).renderModel();
|
||||
BlcGlStateManager.c();
|
||||
BlcGlStateManager.u();
|
||||
BlcGlStateManager.c(1029);
|
||||
@ -56,7 +56,7 @@ public class AbstractShieldRenderer extends ModelBase implements LayerRenderer<A
|
||||
BlcGlStateManager.r();
|
||||
BlcGlStateManager.u();
|
||||
GlStateManager.enableTexture2D();
|
||||
CustomAbstractClientPlayer.players.get(entity).getShield().getTexture().update(partialTicks);
|
||||
((AbstractClientPlayerExt) entity).silent$getShield().getTexture().update(partialTicks);
|
||||
}
|
||||
|
||||
public double getShieldScale(String model) {
|
||||
|
@ -20,9 +20,9 @@ import net.minecraft.item.ItemStack;
|
||||
import net.silentclient.client.Client;
|
||||
import net.silentclient.client.blc.BlcGlStateManager;
|
||||
import net.silentclient.client.mixin.accessors.MinecraftAccessor;
|
||||
import net.silentclient.client.mixin.ducks.AbstractClientPlayerExt;
|
||||
import net.silentclient.client.mods.settings.CosmeticsMod;
|
||||
import net.silentclient.client.utils.ColorUtils;
|
||||
import net.silentclient.client.utils.CustomAbstractClientPlayer;
|
||||
|
||||
public class BandanaRenderer extends ModelBase implements LayerRenderer<AbstractClientPlayer> {
|
||||
private final RenderPlayer playerRenderer;
|
||||
@ -37,7 +37,7 @@ public class BandanaRenderer extends ModelBase implements LayerRenderer<Abstract
|
||||
@Override
|
||||
public void doRenderLayer(AbstractClientPlayer entityIn, float p_177141_2_, float p_177141_3_,
|
||||
float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) {
|
||||
if(Client.getInstance().getCosmetics().getBandana() == null || !Client.getInstance().getCosmetics().getBandana().loadModel() || !Client.getInstance().getSettingsManager().getSettingByClass(CosmeticsMod.class, "Bandanas").getValBoolean() || CustomAbstractClientPlayer.players.get(entityIn).getBandana() == null || entityIn.isInvisible()) {
|
||||
if(Client.getInstance().getCosmetics().getBandana() == null || !Client.getInstance().getCosmetics().getBandana().loadModel() || !Client.getInstance().getSettingsManager().getSettingByClass(CosmeticsMod.class, "Bandanas").getValBoolean() || ((AbstractClientPlayerExt) entityIn).silent$getBandana() == null || entityIn.isInvisible()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -64,18 +64,18 @@ public class BandanaRenderer extends ModelBase implements LayerRenderer<Abstract
|
||||
GlStateManager.rotate(playerRenderer.getMainModel().bipedHead.rotateAngleX * (180F / (float) Math.PI), 1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
double applyTransformations = this.applyTransformations();
|
||||
if(CustomAbstractClientPlayer.players.get(entityIn).getSilentAccount() != null && CustomAbstractClientPlayer.players.get(entityIn).getBandana().getTexture().getResourcePath().equals("silentclient/cosmetics/bandanas/17/0.png")) {
|
||||
if(CustomAbstractClientPlayer.players.get(entityIn).getSilentAccount().getBandanaColor() == 50) {
|
||||
if(((AbstractClientPlayerExt) entityIn).silent$getAccount() != null && ((AbstractClientPlayerExt) entityIn).silent$getBandana().getTexture().getResourcePath().equals("silentclient/cosmetics/bandanas/17/0.png")) {
|
||||
if(((AbstractClientPlayerExt) entityIn).silent$getAccount().getBandanaColor() == 50) {
|
||||
ColorUtils.setColor(ColorUtils.getChromaColor(0, 0, 1).getRGB());
|
||||
} else {
|
||||
ColorUtils.setColor(CustomAbstractClientPlayer.players.get(entityIn).getSilentAccount().getBandanaColor());
|
||||
ColorUtils.setColor(((AbstractClientPlayerExt) entityIn).silent$getAccount().getBandanaColor());
|
||||
}
|
||||
}
|
||||
|
||||
applyTransformations += this.manipulate(entityIn);
|
||||
|
||||
GlStateManager.scale(applyTransformations, applyTransformations, applyTransformations);
|
||||
CustomAbstractClientPlayer.players.get(entityIn).getBandana().bindTexture();
|
||||
((AbstractClientPlayerExt) entityIn).silent$getBandana().bindTexture();
|
||||
BlcGlStateManager.k();
|
||||
Client.getInstance().getCosmetics().getBandana().renderModel();
|
||||
BlcGlStateManager.c();
|
||||
@ -86,7 +86,7 @@ public class BandanaRenderer extends ModelBase implements LayerRenderer<Abstract
|
||||
BlcGlStateManager.u();
|
||||
GlStateManager.enableTexture2D();
|
||||
GlStateManager.popMatrix();
|
||||
CustomAbstractClientPlayer.players.get(entityIn).getBandana().update(partialTicks);
|
||||
((AbstractClientPlayerExt) entityIn).silent$getBandana().update(partialTicks);
|
||||
}
|
||||
|
||||
private void runSkinProcessing(final UUID uuid, final String s) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package net.silentclient.client.cosmetics;
|
||||
|
||||
import net.silentclient.client.utils.CustomAbstractClientPlayer;
|
||||
import net.silentclient.client.mixin.ducks.AbstractClientPlayerExt;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
@ -31,19 +31,19 @@ public class CapeRenderer extends ModelBase implements LayerRenderer<AbstractCli
|
||||
public void doRenderLayer(AbstractClientPlayer entitylivingbaseIn, float p_177141_2_, float p_177141_3_,
|
||||
float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) {
|
||||
|
||||
if(CustomAbstractClientPlayer.players.get(entitylivingbaseIn).getLocationSilentCape() == null || CustomAbstractClientPlayer.players.get(entitylivingbaseIn).getLocationCustomCape() != null) {
|
||||
if(((AbstractClientPlayerExt) entitylivingbaseIn).silent$getCape() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (entitylivingbaseIn.isInvisible()) {
|
||||
return;
|
||||
}
|
||||
CustomAbstractClientPlayer.players.get(entitylivingbaseIn).getDynamicCape().ticks(System.nanoTime());
|
||||
((AbstractClientPlayerExt) entitylivingbaseIn).silent$getDynamicCape().ticks(System.nanoTime());
|
||||
|
||||
String capeType = CustomAbstractClientPlayer.players.get(entitylivingbaseIn).getCapeType();
|
||||
String capeType = ((AbstractClientPlayerExt) entitylivingbaseIn).silent$getCapeType();
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
CustomAbstractClientPlayer.players.get(entitylivingbaseIn).getLocationSilentCape().bindTexture();
|
||||
((AbstractClientPlayerExt) entitylivingbaseIn).silent$getCape().bindTexture();
|
||||
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP);
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP);
|
||||
@ -99,14 +99,14 @@ public class CapeRenderer extends ModelBase implements LayerRenderer<AbstractCli
|
||||
case "dynamic_curved":
|
||||
final float max = Math.max(Math.min(0.0f, n5), -3.0f);
|
||||
final float min = Math.min(n3 + n5, 90.0f);
|
||||
CustomAbstractClientPlayer.players.get(entitylivingbaseIn).getDynamicCape().renderDynamicCape();
|
||||
CustomAbstractClientPlayer.players.get(entitylivingbaseIn).getDynamicCape().update(min, max, true);
|
||||
((AbstractClientPlayerExt) entitylivingbaseIn).silent$getDynamicCape().renderDynamicCape();
|
||||
((AbstractClientPlayerExt) entitylivingbaseIn).silent$getDynamicCape().update(min, max, true);
|
||||
break;
|
||||
case "curved_rectangle":
|
||||
CustomAbstractClientPlayer.players.get(entitylivingbaseIn).getCurvedCape().renderStaticCape();
|
||||
((AbstractClientPlayerExt) entitylivingbaseIn).silent$getCurvedCape().renderStaticCape();
|
||||
break;
|
||||
default:
|
||||
CustomAbstractClientPlayer.players.get(entitylivingbaseIn).getStaticCape().renderStaticCape();
|
||||
((AbstractClientPlayerExt) entitylivingbaseIn).silent$getStaticCape().renderStaticCape();
|
||||
break;
|
||||
}
|
||||
|
||||
@ -117,8 +117,8 @@ public class CapeRenderer extends ModelBase implements LayerRenderer<AbstractCli
|
||||
GlStateManager.rotate(180.0f, 0.0f, 1.0f, 0.0f);
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
if(CustomAbstractClientPlayer.players.get(entitylivingbaseIn).capeShoulders() && CustomAbstractClientPlayer.players.get(entitylivingbaseIn).getLocationCustomCape() == null) {
|
||||
playerRenderer.bindTexture(CustomAbstractClientPlayer.players.get(entitylivingbaseIn).getShoulders());
|
||||
if(((AbstractClientPlayerExt) entitylivingbaseIn).silent$getShoulders()) {
|
||||
((AbstractClientPlayerExt) entitylivingbaseIn).silent$getCapeShoulders().bindTexture();
|
||||
GlStateManager.pushMatrix();
|
||||
if(entitylivingbaseIn.isSneaking()) {
|
||||
GlStateManager.translate(0.0F, 0.2F, 0.0F);
|
||||
@ -130,8 +130,8 @@ public class CapeRenderer extends ModelBase implements LayerRenderer<AbstractCli
|
||||
}
|
||||
|
||||
GlStateManager.enableLighting();
|
||||
if(CustomAbstractClientPlayer.players.get(entitylivingbaseIn).getLocationSilentCape() != null) {
|
||||
CustomAbstractClientPlayer.players.get(entitylivingbaseIn).getLocationSilentCape().update(partialTicks);
|
||||
if(((AbstractClientPlayerExt) entitylivingbaseIn).silent$getCape() != null) {
|
||||
((AbstractClientPlayerExt) entitylivingbaseIn).silent$getCape().update(partialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,8 +18,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.silentclient.client.Client;
|
||||
import net.silentclient.client.cosmetics.model.ModelBuffer;
|
||||
import net.silentclient.client.mixin.ducks.AbstractClientPlayerExt;
|
||||
import net.silentclient.client.mods.settings.CosmeticsMod;
|
||||
import net.silentclient.client.utils.CustomAbstractClientPlayer;
|
||||
import net.silentclient.client.utils.Players;
|
||||
import net.silentclient.client.utils.types.CosmeticsResponse;
|
||||
import net.silentclient.client.utils.types.PlayerResponse;
|
||||
@ -27,12 +27,12 @@ import net.silentclient.client.utils.types.PlayerResponse.Account.Cosmetics.Cosm
|
||||
|
||||
public class Cosmetics {
|
||||
public Map<Number, AnimatedResourceLocation> capes = new HashMap<>();
|
||||
public Map<Number, ResourceLocation> capesShoulders = new HashMap<>();
|
||||
public Map<Number, ResourceLocation> wings = new HashMap<>();
|
||||
public Map<Number, StaticResourceLocation> capesShoulders = new HashMap<>();
|
||||
public Map<Number, AnimatedResourceLocation> wings = new HashMap<>();
|
||||
public Map<Number, AnimatedResourceLocation> bandanas = new HashMap<>();
|
||||
public Map<Number, HatData> hats = new HashMap<>();
|
||||
public Map<Number, ShieldData> shields = new HashMap<>();
|
||||
public Map<Number, ResourceLocation> icons = new HashMap<>();
|
||||
public Map<Number, StaticResourceLocation> icons = new HashMap<>();
|
||||
|
||||
public ArrayList<CosmeticItem> myIcons = new ArrayList<CosmeticItem>();
|
||||
public ArrayList<CosmeticItem> myWings = new ArrayList<CosmeticItem>();
|
||||
@ -41,9 +41,8 @@ public class Cosmetics {
|
||||
public ArrayList<CosmeticItem> myHats = new ArrayList<CosmeticItem>();
|
||||
public ArrayList<CosmeticItem> myShields = new ArrayList<CosmeticItem>();
|
||||
|
||||
public ArrayList<ResourceLocation> bindTextures = new ArrayList<ResourceLocation>();
|
||||
|
||||
public ResourceLocation defaultIcon;
|
||||
|
||||
public StaticResourceLocation defaultIcon;
|
||||
private ModelBuffer bandana;
|
||||
|
||||
public Map<String, ModelBuffer> hatModels = new HashMap<>();
|
||||
@ -62,7 +61,7 @@ public class Cosmetics {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Client.logger.info("STARTING > cosmeitcs > default_icon");
|
||||
defaultIcon = new ResourceLocation("silentclient/icons/player_icon.png");
|
||||
defaultIcon = new StaticResourceLocation("silentclient/icons/player_icon.png");
|
||||
if(!Client.getInstance().isDebug()) {
|
||||
CosmeticsResponse allCosmetics = getAllCosmetics();
|
||||
Client.logger.info("STARTING > cosmeitcs > capes");
|
||||
@ -72,7 +71,7 @@ public class Cosmetics {
|
||||
if(allCosmetics != null && allCosmetics.getCosmetics() != null && allCosmetics.getCosmetics().getCapes() != null) {
|
||||
allCosmetics.getCosmetics().getCapes().forEach((cape) -> {
|
||||
capes.put(cape.getId(), new AnimatedResourceLocation("silentclient/cosmetics/capes/"+cape.getId(), cape.getFrames(), cape.getFrameDelay(), false, cape.getId() == Client.getInstance().getAccount().getSelectedCape()));
|
||||
capesShoulders.put(cape.getId(), new ResourceLocation("silentclient/cosmetics/capes/"+cape.getId()+"/shoulders.png"));
|
||||
capesShoulders.put(cape.getId(), new StaticResourceLocation("silentclient/cosmetics/capes/"+cape.getId()+"/shoulders.png"));
|
||||
});
|
||||
}
|
||||
|
||||
@ -80,7 +79,7 @@ public class Cosmetics {
|
||||
wings.clear();
|
||||
if(allCosmetics != null && allCosmetics.getCosmetics() != null && allCosmetics.getCosmetics().getWings() != null) {
|
||||
allCosmetics.getCosmetics().getWings().forEach((wing) -> {
|
||||
wings.put(wing.getId(), new ResourceLocation("silentclient/cosmetics/wings/"+ wing.getId() + "/0.png"));
|
||||
wings.put(wing.getId(), new AnimatedResourceLocation("silentclient/cosmetics/wings/"+ wing.getId(), wing.getFrames(), wing.getFrameDelay()));
|
||||
});
|
||||
}
|
||||
|
||||
@ -133,7 +132,7 @@ public class Cosmetics {
|
||||
icons.clear();
|
||||
if(allCosmetics != null && allCosmetics.getCosmetics() != null && allCosmetics.getCosmetics().getIcons() != null) {
|
||||
allCosmetics.getCosmetics().getIcons().forEach((icon) -> {
|
||||
icons.put(icon.getId(), new ResourceLocation("silentclient/cosmetics/icons/"+ icon.getId() + "/0.png"));
|
||||
icons.put(icon.getId(), new StaticResourceLocation("silentclient/cosmetics/icons/"+ icon.getId() + "/0.png"));
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -163,8 +162,8 @@ public class Cosmetics {
|
||||
Client.getInstance().getSettingsManager().getSettingByClass(CosmeticsMod.class, "Cape Shoulders").setValBoolean(cosmetics.getAccount().getCapeShoulders());
|
||||
Client.getInstance().getSettingsManager().getSettingByClass(CosmeticsMod.class, "Cape Type").setValString(cosmetics.getAccount().getCapeType().equals("dynamic_curved") ? "Dynamic Curved" : cosmetics.getAccount().getCapeType().equals("curved_rectangle") ? "Curved Rectangle" : "Rectangle");
|
||||
if(Minecraft.getMinecraft().thePlayer != null) {
|
||||
CustomAbstractClientPlayer.players.get(Minecraft.getMinecraft().thePlayer).setCapeType(cosmetics.getAccount().getCapeType());
|
||||
CustomAbstractClientPlayer.players.get(Minecraft.getMinecraft().thePlayer).setCapeShoulders(cosmetics.getAccount().getCapeShoulders());
|
||||
((AbstractClientPlayerExt) Minecraft.getMinecraft().thePlayer).silent$setCapeType(cosmetics.getAccount().getCapeType());
|
||||
((AbstractClientPlayerExt) Minecraft.getMinecraft().thePlayer).silent$setShoulders(cosmetics.getAccount().getCapeShoulders());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -184,8 +183,8 @@ public class Cosmetics {
|
||||
Client.getInstance().getSettingsManager().getSettingByClass(CosmeticsMod.class, "Cape Shoulders").setValBoolean(cosmetics.getAccount().getCapeShoulders());
|
||||
Client.getInstance().getSettingsManager().getSettingByClass(CosmeticsMod.class, "Cape Type").setValString(cosmetics.getAccount().getCapeType().equals("dynamic_curved") ? "Dynamic Curved" : cosmetics.getAccount().getCapeType().equals("curved_rectangle") ? "Curved Rectangle" : "Rectangle");
|
||||
if(Minecraft.getMinecraft().thePlayer != null) {
|
||||
CustomAbstractClientPlayer.players.get(Minecraft.getMinecraft().thePlayer).setCapeType(cosmetics.getAccount().getCapeType());
|
||||
CustomAbstractClientPlayer.players.get(Minecraft.getMinecraft().thePlayer).setCapeShoulders(cosmetics.getAccount().getCapeShoulders());
|
||||
((AbstractClientPlayerExt) Minecraft.getMinecraft().thePlayer).silent$setCapeType(cosmetics.getAccount().getCapeType());
|
||||
((AbstractClientPlayerExt) Minecraft.getMinecraft().thePlayer).silent$setShoulders(cosmetics.getAccount().getCapeShoulders());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -279,7 +278,7 @@ public class Cosmetics {
|
||||
}
|
||||
}
|
||||
|
||||
public ResourceLocation getWingsById(int id) {
|
||||
public AnimatedResourceLocation getWingsById(int id) {
|
||||
return wings.get(id);
|
||||
}
|
||||
|
||||
@ -299,16 +298,16 @@ public class Cosmetics {
|
||||
return shields.get(id);
|
||||
}
|
||||
|
||||
public ResourceLocation getCapeShoulders(int id) {
|
||||
public StaticResourceLocation getCapeShoulders(int id) {
|
||||
return capesShoulders.get(id);
|
||||
}
|
||||
|
||||
public ResourceLocation getIconById(int id) {
|
||||
ResourceLocation icon = icons.get(id);
|
||||
public StaticResourceLocation getIconById(int id) {
|
||||
StaticResourceLocation icon = icons.get(id);
|
||||
return icon != null ? icon : getDefaultIcon();
|
||||
}
|
||||
|
||||
public ResourceLocation getDefaultIcon() {
|
||||
public StaticResourceLocation getDefaultIcon() {
|
||||
return defaultIcon;
|
||||
}
|
||||
|
||||
@ -333,6 +332,6 @@ public class Cosmetics {
|
||||
Minecraft.getMinecraft().refreshResources();
|
||||
Client.getInstance().getCosmetics().update(true);
|
||||
Players.reload();
|
||||
Players.getPlayerStatus(false, CustomAbstractClientPlayer.players.get(player).getNameClear(), EntityPlayer.getUUID(player.getGameProfile()), player);
|
||||
Players.getPlayerStatus(false, ((AbstractClientPlayerExt) player).silent$getNameClear(), EntityPlayer.getUUID(player.getGameProfile()), player);
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ import javax.vecmath.Vector3f;
|
||||
import javax.vecmath.Vector4f;
|
||||
|
||||
import net.silentclient.client.mixin.accessors.MinecraftAccessor;
|
||||
import net.silentclient.client.utils.CustomAbstractClientPlayer;
|
||||
import net.silentclient.client.mixin.ducks.AbstractClientPlayerExt;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@ -48,13 +48,13 @@ public class HatRenderer extends ModelBase implements LayerRenderer<AbstractClie
|
||||
|
||||
switch(type) {
|
||||
case "hat":
|
||||
data = CustomAbstractClientPlayer.players.get(entityIn).getHat();
|
||||
data = ((AbstractClientPlayerExt) entityIn).silent$getHat();
|
||||
break;
|
||||
case "mask":
|
||||
data = CustomAbstractClientPlayer.players.get(entityIn).getMask();
|
||||
data = ((AbstractClientPlayerExt) entityIn).silent$getMask();
|
||||
break;
|
||||
case "neck":
|
||||
data = CustomAbstractClientPlayer.players.get(entityIn).getNeck();
|
||||
data = ((AbstractClientPlayerExt) entityIn).silent$getNeck();
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,20 @@
|
||||
package net.silentclient.client.cosmetics;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class StaticResourceLocation {
|
||||
private ResourceLocation location;
|
||||
|
||||
public StaticResourceLocation(String path) {
|
||||
this.location = new ResourceLocation(path);
|
||||
}
|
||||
|
||||
public ResourceLocation getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void bindTexture() {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(location);
|
||||
}
|
||||
}
|
@ -320,7 +320,7 @@ public class CosmeticsGui extends SilentScreen {
|
||||
Client.getInstance().getSilentFontRenderer().drawString(error_text, x + ((width - 90) / 2) - 15, y + (height / 3) + 20 - 3, 14, SilentFontRenderer.FontType.TITLE);
|
||||
}
|
||||
if(selectedCategory == "icons" && can_show) {
|
||||
RenderUtil.drawImage(Client.getInstance().getAccount().getSelectedIcon() != 0 && !Client.getInstance().getAccount().plusIcon() ? Client.getInstance().getCosmetics().getIconById(Client.getInstance().getAccount().getSelectedIcon()) : new ResourceLocation(Client.getInstance().getAccount().plusIcon() ? "silentclient/icons/plus_icon.png" : "silentclient/icons/player_icon.png"), x + 285, y + ((height / 2) - 25), 50, 50, false);
|
||||
RenderUtil.drawImage(Client.getInstance().getAccount().getSelectedIcon() != 0 && !Client.getInstance().getAccount().plusIcon() ? Client.getInstance().getCosmetics().getIconById(Client.getInstance().getAccount().getSelectedIcon()).getLocation() : new ResourceLocation(Client.getInstance().getAccount().plusIcon() ? "silentclient/icons/plus_icon.png" : "silentclient/icons/player_icon.png"), x + 285, y + ((height / 2) - 25), 50, 50, false);
|
||||
}
|
||||
|
||||
final Scroll scroll = MouseUtils.scroll();
|
||||
|
@ -1,9 +1,5 @@
|
||||
package net.silentclient.client.cosmetics.wings;
|
||||
|
||||
import net.silentclient.client.mixin.accessors.ModelBaseAccessor;
|
||||
import net.silentclient.client.utils.CustomAbstractClientPlayer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
@ -13,7 +9,9 @@ import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.silentclient.client.Client;
|
||||
import net.silentclient.client.mixin.ducks.AbstractClientPlayerExt;
|
||||
import net.silentclient.client.mods.settings.CosmeticsMod;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class WingsModel implements LayerRenderer<AbstractClientPlayer> {
|
||||
private static ModelRenderer wing;
|
||||
@ -23,10 +21,7 @@ public class WingsModel implements LayerRenderer<AbstractClientPlayer> {
|
||||
|
||||
public WingsModel(RenderPlayer player) {
|
||||
this.flying = false;
|
||||
((ModelBaseAccessor) (this.modelDragonWings = new ModelDragonWings(player))).setTextureOffset("wingTip.bone", 112, 136);
|
||||
((ModelBaseAccessor) this.modelDragonWings).setTextureOffset("wing.skin", -56, 88);
|
||||
((ModelBaseAccessor) this.modelDragonWings).setTextureOffset("wing.bone", 112, 88);
|
||||
((ModelBaseAccessor) this.modelDragonWings).setTextureOffset("wingTip.skin", -56, 144);
|
||||
this.modelDragonWings = new ModelDragonWings(player);
|
||||
final int bw = this.modelDragonWings.textureWidth;
|
||||
final int bh = this.modelDragonWings.textureHeight;
|
||||
this.modelDragonWings.textureWidth = 256;
|
||||
@ -46,7 +41,10 @@ public class WingsModel implements LayerRenderer<AbstractClientPlayer> {
|
||||
|
||||
private class ModelDragonWings extends ModelBase {
|
||||
public ModelDragonWings(RenderPlayer player) {
|
||||
// TODO Auto-generated constructor stub
|
||||
this.setTextureOffset("wingTip.bone", 112, 136);
|
||||
this.setTextureOffset("wing.skin", -56, 88);
|
||||
this.setTextureOffset("wing.bone", 112, 88);
|
||||
this.setTextureOffset("wingTip.skin", -56, 144);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -63,7 +61,7 @@ public class WingsModel implements LayerRenderer<AbstractClientPlayer> {
|
||||
else {
|
||||
f1 = ageInTicks / 80.0f;
|
||||
}
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(CustomAbstractClientPlayer.players.get(entityIn).getLocationOfWings());
|
||||
((AbstractClientPlayerExt) entityIn).silent$getWings().bindTexture();
|
||||
if (!entityIn.onGround || flying) {
|
||||
flying = true;
|
||||
}
|
||||
@ -104,7 +102,7 @@ public class WingsModel implements LayerRenderer<AbstractClientPlayer> {
|
||||
|
||||
@Override
|
||||
public void doRenderLayer(final AbstractClientPlayer player, final float limbSwing, final float limbSwingAmount, final float partialTicks, final float ageInTicks, final float HeadYaw, final float headPitch, final float scale) {
|
||||
if (CustomAbstractClientPlayer.players.get(player).getLocationOfWings() != null && Client.getInstance().getSettingsManager().getSettingByClass(CosmeticsMod.class, "Wings").getValBoolean()) {
|
||||
if (((AbstractClientPlayerExt) player).silent$getWings() != null && Client.getInstance().getSettingsManager().getSettingByClass(CosmeticsMod.class, "Wings").getValBoolean()) {
|
||||
if (!player.isInvisible()) {
|
||||
GlStateManager.pushMatrix();
|
||||
this.modelDragonWings.render(player, limbSwing, limbSwingAmount, ageInTicks, HeadYaw, headPitch, scale);
|
||||
|
@ -58,7 +58,7 @@ public class FriendsListOverlay extends GuiScreen {
|
||||
GlStateManager.translate(this.introAnimation.getValue(), 0, 0);
|
||||
this.introAnimation.setAnimation(0, 30);
|
||||
RenderUtils.drawRect(0, 0, width, height, Theme.backgroundColor().getRGB());
|
||||
RenderUtil.drawImage(Client.getInstance().getAccount().getSelectedIcon() != 0 && !Client.getInstance().getAccount().plusIcon() ? Client.getInstance().getCosmetics().getIconById(Client.getInstance().getAccount().getSelectedIcon()) : new ResourceLocation(Client.getInstance().getAccount().plusIcon() ? "silentclient/icons/plus_icon.png" : "silentclient/icons/player_icon.png"), 3, 5, 18, 18, false);
|
||||
RenderUtil.drawImage(Client.getInstance().getAccount().getSelectedIcon() != 0 && !Client.getInstance().getAccount().plusIcon() ? Client.getInstance().getCosmetics().getIconById(Client.getInstance().getAccount().getSelectedIcon()).getLocation() : new ResourceLocation(Client.getInstance().getAccount().plusIcon() ? "silentclient/icons/plus_icon.png" : "silentclient/icons/player_icon.png"), 3, 5, 18, 18, false);
|
||||
ColorUtils.setColor(new Color(9, 165, 51).getRGB());
|
||||
font.drawString(Client.getInstance().getAccount().original_username, 23, 5 - 2, 12, SilentFontRenderer.FontType.TITLE);
|
||||
ColorUtils.setColor(new Color(255, 255, 255, 127).getRGB());
|
||||
@ -74,7 +74,7 @@ public class FriendsListOverlay extends GuiScreen {
|
||||
GL11.glScissor(0 * s, translatedY * s, width * s, listHeight * s);
|
||||
if(!showRequests) {
|
||||
for(FriendsResponse.Friend friend : Client.getInstance().getFriends().getFriends()) {
|
||||
RenderUtil.drawImage(friend.getIcon(), 3, friendY, 18, 18, false);
|
||||
RenderUtil.drawImage(friend.getIcon().getLocation(), 3, friendY, 18, 18, false);
|
||||
if(friend.isOnline()) {
|
||||
ColorUtils.setColor(new Color(9, 165, 51).getRGB());
|
||||
} else {
|
||||
@ -88,7 +88,7 @@ public class FriendsListOverlay extends GuiScreen {
|
||||
}
|
||||
} else {
|
||||
for(FriendsResponse.Request request : Client.getInstance().getFriends().getRequests()) {
|
||||
RenderUtil.drawImage(request.getIcon(), 3, friendY, 18, 18, false);
|
||||
RenderUtil.drawImage(request.getIcon().getLocation(), 3, friendY, 18, 18, false);
|
||||
ColorUtils.setColor(new Color(255, 255, 255).getRGB());
|
||||
font.drawString(request.getUsername(), 23, friendY - 2, 12, SilentFontRenderer.FontType.TITLE);
|
||||
ColorUtils.setColor(new Color(255, 255, 255, 127).getRGB());
|
||||
|
@ -1,12 +1,15 @@
|
||||
package net.silentclient.client.mixin.accessors;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.TextureOffset;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Mixin(ModelBase.class)
|
||||
public interface ModelBaseAccessor {
|
||||
@Invoker("setTextureOffset")
|
||||
void setTextureOffset(String partName, int x, int y);
|
||||
@Accessor
|
||||
Map<String, TextureOffset> getModelTextureMap();
|
||||
}
|
||||
|
@ -1,13 +0,0 @@
|
||||
package net.silentclient.client.mixin.accessors;
|
||||
|
||||
import net.minecraft.client.renderer.entity.RendererLivingEntity;
|
||||
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||
|
||||
@Mixin(RendererLivingEntity.class)
|
||||
public interface RendererLivingEntityAccessor {
|
||||
// @Invoker("addLayer")
|
||||
// <V extends EntityLivingBase, U extends LayerRenderer<V>> boolean silent$addLayer(U layer);
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package net.silentclient.client.mixin.ducks;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.silentclient.client.cosmetics.*;
|
||||
import net.silentclient.client.cosmetics.dynamiccurved.DynamicCape;
|
||||
import net.silentclient.client.utils.types.PlayerResponse;
|
||||
|
||||
public interface AbstractClientPlayerExt {
|
||||
void silent$setShield(ShieldData a);
|
||||
ShieldData silent$getShield();
|
||||
void silent$setNeck(HatData a);
|
||||
HatData silent$getNeck();
|
||||
void silent$setHat(HatData a);
|
||||
HatData silent$getHat();
|
||||
void silent$setMask(HatData a);
|
||||
HatData silent$getMask();
|
||||
void silent$setAccount(PlayerResponse.Account a);
|
||||
PlayerResponse.Account silent$getAccount();
|
||||
void silent$setCapeType(String a);
|
||||
String silent$getCapeType();
|
||||
void silent$setShoulders(boolean a);
|
||||
boolean silent$getShoulders();
|
||||
void silent$setCapeShoulders(StaticResourceLocation a);
|
||||
StaticResourceLocation silent$getCapeShoulders();
|
||||
void silent$setBandana(AnimatedResourceLocation a);
|
||||
AnimatedResourceLocation silent$getBandana();
|
||||
StaticCape silent$getCurvedCape();
|
||||
StaticCape silent$getStaticCape();
|
||||
DynamicCape silent$getDynamicCape();
|
||||
void silent$setPlayerIcon(StaticResourceLocation a);
|
||||
StaticResourceLocation silent$getPlayerIcon();
|
||||
void silent$setWings(AnimatedResourceLocation a);
|
||||
AnimatedResourceLocation silent$getWings();
|
||||
void silent$setCape(AnimatedResourceLocation a);
|
||||
AnimatedResourceLocation silent$getCape();
|
||||
String silent$getNameClear();
|
||||
void silent$setNameClear(String a);
|
||||
}
|
@ -2,21 +2,197 @@ package net.silentclient.client.mixin.mixins;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.network.NetworkPlayerInfo;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StringUtils;
|
||||
import net.minecraft.world.World;
|
||||
import net.silentclient.client.Client;
|
||||
import net.silentclient.client.utils.CustomAbstractClientPlayer;
|
||||
import net.silentclient.client.cosmetics.*;
|
||||
import net.silentclient.client.cosmetics.dynamiccurved.DynamicCape;
|
||||
import net.silentclient.client.mixin.ducks.AbstractClientPlayerExt;
|
||||
import net.silentclient.client.utils.Players;
|
||||
import net.silentclient.client.utils.types.PlayerResponse;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(AbstractClientPlayer.class)
|
||||
public abstract class AbstractClientPlayerMixin {
|
||||
@Mixin(value = AbstractClientPlayer.class, priority = 2000)
|
||||
public abstract class AbstractClientPlayerMixin implements AbstractClientPlayerExt {
|
||||
@Unique private AnimatedResourceLocation silent$cape;
|
||||
@Unique private AnimatedResourceLocation silent$bandana;
|
||||
@Unique private HatData silent$hat;
|
||||
@Unique private HatData silent$mask;
|
||||
@Unique private HatData silent$neck;
|
||||
@Unique private AnimatedResourceLocation silent$wings;
|
||||
@Unique private StaticResourceLocation silent$playerIcon;
|
||||
@Unique private StaticResourceLocation silent$shoulders;
|
||||
@Unique private String silent$nameClear;
|
||||
@Unique private DynamicCape silent$dynamicCape;
|
||||
@Unique private StaticCape silent$staticCape;
|
||||
@Unique private StaticCape silent$curvedCape;
|
||||
@Unique private ShieldData silent$shield;
|
||||
@Unique private PlayerResponse.Account silent$account;
|
||||
@Unique private String silent$capeType = "dynamic_curved";
|
||||
@Unique private boolean silent$shouldersBool = true;
|
||||
|
||||
@Inject(method = "<init>", at = @At("RETURN"))
|
||||
public void initTest(World worldIn, GameProfile playerProfile, CallbackInfo ci) {
|
||||
CustomAbstractClientPlayer.players.put(((AbstractClientPlayer) (Object) this), new CustomAbstractClientPlayer(worldIn, playerProfile));
|
||||
public void initCustom(World worldIn, GameProfile playerProfile, CallbackInfo ci) {
|
||||
this.silent$nameClear = playerProfile.getName();
|
||||
|
||||
if (this.silent$nameClear != null && !this.silent$nameClear.isEmpty())
|
||||
{
|
||||
this.silent$nameClear = StringUtils.stripControlCodes(this.silent$nameClear);
|
||||
}
|
||||
|
||||
this.silent$dynamicCape = new DynamicCape();
|
||||
this.silent$staticCape = new StaticCape(1.0F, 0.0F, 0.0F);
|
||||
this.silent$curvedCape = new StaticCape(6.0F, 5.0F, 0.0F);
|
||||
|
||||
Players.getPlayerStatus(false, silent$nameClear, playerProfile.getId(), ((AbstractClientPlayer) (Object) this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String silent$getCapeType() {
|
||||
return silent$capeType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void silent$setCapeType(String a) {
|
||||
this.silent$capeType = a;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean silent$getShoulders() {
|
||||
return silent$shouldersBool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void silent$setShoulders(boolean a) {
|
||||
this.silent$shouldersBool = a;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayerResponse.Account silent$getAccount() {
|
||||
return silent$account;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void silent$setAccount(PlayerResponse.Account a) {
|
||||
this.silent$account = a;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AnimatedResourceLocation silent$getBandana() {
|
||||
return silent$bandana;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void silent$setBandana(AnimatedResourceLocation a) {
|
||||
this.silent$bandana = a;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AnimatedResourceLocation silent$getCape() {
|
||||
return silent$cape;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void silent$setCape(AnimatedResourceLocation a) {
|
||||
this.silent$cape = a;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicCape silent$getDynamicCape() {
|
||||
return silent$dynamicCape;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StaticCape silent$getCurvedCape() {
|
||||
return silent$curvedCape;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StaticCape silent$getStaticCape() {
|
||||
return silent$staticCape;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HatData silent$getHat() {
|
||||
return silent$hat;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void silent$setHat(HatData a) {
|
||||
this.silent$hat = a;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HatData silent$getMask() {
|
||||
return silent$mask;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void silent$setMask(HatData a) {
|
||||
this.silent$mask = a;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HatData silent$getNeck() {
|
||||
return silent$neck;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void silent$setNeck(HatData a) {
|
||||
this.silent$neck = a;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShieldData silent$getShield() {
|
||||
return silent$shield;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void silent$setShield(ShieldData a) {
|
||||
this.silent$shield = a;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AnimatedResourceLocation silent$getWings() {
|
||||
return silent$wings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void silent$setWings(AnimatedResourceLocation a) {
|
||||
this.silent$wings = a;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String silent$getNameClear() {
|
||||
return silent$nameClear;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void silent$setNameClear(String a) {
|
||||
this.silent$nameClear = a;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StaticResourceLocation silent$getCapeShoulders() {
|
||||
return silent$shoulders;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void silent$setCapeShoulders(StaticResourceLocation a) {
|
||||
this.silent$shoulders = a;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StaticResourceLocation silent$getPlayerIcon() {
|
||||
return silent$playerIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void silent$setPlayerIcon(StaticResourceLocation a) {
|
||||
this.silent$playerIcon = a;
|
||||
}
|
||||
}
|
||||
|
@ -5,29 +5,30 @@ import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||
import net.minecraft.client.renderer.entity.RendererLivingEntity;
|
||||
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
|
||||
import net.silentclient.client.cosmetics.AbstractShieldRenderer;
|
||||
import net.silentclient.client.cosmetics.BandanaRenderer;
|
||||
import net.silentclient.client.cosmetics.CapeRenderer;
|
||||
import net.silentclient.client.cosmetics.HatRenderer;
|
||||
import net.silentclient.client.cosmetics.wings.WingsModel;
|
||||
import net.silentclient.client.mixin.accessors.RendererLivingEntityAccessor;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(RenderPlayer.class)
|
||||
public class RenderPlayerMixin {
|
||||
public abstract class RenderPlayerMixin extends RendererLivingEntity<AbstractClientPlayer> {
|
||||
public RenderPlayerMixin(RenderManager renderManagerIn, ModelBase modelBaseIn, float shadowSizeIn) {
|
||||
super(renderManagerIn, modelBaseIn, shadowSizeIn);
|
||||
}
|
||||
|
||||
@Inject(method = "<init>(Lnet/minecraft/client/renderer/entity/RenderManager;Z)V", at = @At("RETURN"))
|
||||
public void initComsetics(RenderManager renderManager, boolean useSmallArms, CallbackInfo ci) {
|
||||
// ((RendererLivingEntityAccessor) (Object) this).silent$addLayer(new WingsModel(((RenderPlayer) (Object) this)));
|
||||
// ((RendererLivingEntityAccessor) (Object) this).silent$addLayer(new CapeRenderer(((RenderPlayer) (Object) this)));
|
||||
// ((RendererLivingEntityAccessor) (Object) this).silent$addLayer(new BandanaRenderer(((RenderPlayer) (Object) this)));
|
||||
// ((RendererLivingEntityAccessor) (Object) this).silent$addLayer(new HatRenderer(((RenderPlayer) (Object) this), "hat"));
|
||||
// ((RendererLivingEntityAccessor) (Object) this).silent$addLayer(new HatRenderer(((RenderPlayer) (Object) this), "neck"));
|
||||
// ((RendererLivingEntityAccessor) (Object) this).silent$addLayer(new HatRenderer(((RenderPlayer) (Object) this), "mask"));
|
||||
// ((RendererLivingEntityAccessor) (Object) this).silent$addLayer(new AbstractShieldRenderer(((RenderPlayer) (Object) this)));
|
||||
addLayer(new WingsModel(((RenderPlayer) (Object) this)));
|
||||
addLayer(new CapeRenderer(((RenderPlayer) (Object) this)));
|
||||
addLayer(new BandanaRenderer(((RenderPlayer) (Object) this)));
|
||||
addLayer(new HatRenderer(((RenderPlayer) (Object) this), "hat"));
|
||||
addLayer(new HatRenderer(((RenderPlayer) (Object) this), "neck"));
|
||||
addLayer(new HatRenderer(((RenderPlayer) (Object) this), "mask"));
|
||||
addLayer(new AbstractShieldRenderer(((RenderPlayer) (Object) this)));
|
||||
}
|
||||
}
|
||||
|
@ -1,199 +0,0 @@
|
||||
package net.silentclient.client.utils;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StringUtils;
|
||||
import net.minecraft.world.World;
|
||||
import net.silentclient.client.cosmetics.AnimatedResourceLocation;
|
||||
import net.silentclient.client.cosmetics.HatData;
|
||||
import net.silentclient.client.cosmetics.ShieldData;
|
||||
import net.silentclient.client.cosmetics.StaticCape;
|
||||
import net.silentclient.client.cosmetics.dynamiccurved.DynamicCape;
|
||||
import net.silentclient.client.utils.types.PlayerResponse;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class CustomAbstractClientPlayer {
|
||||
public static final Map<AbstractClientPlayer, CustomAbstractClientPlayer> players = new HashMap<>();
|
||||
|
||||
private AnimatedResourceLocation locationSilentCape = null;
|
||||
private AnimatedResourceLocation bandana = null;
|
||||
private HatData hat = null;
|
||||
private HatData mask = null;
|
||||
private HatData neck = null;
|
||||
private ResourceLocation locationCustomCape = null;
|
||||
private ResourceLocation locationOfWings = null;
|
||||
private ResourceLocation playerIcon = null;
|
||||
private ResourceLocation shoulders = null;
|
||||
private boolean isSilentPlayer = false;
|
||||
private String nameClear = null;
|
||||
private DynamicCape dynamicCape;
|
||||
private StaticCape staticCape;
|
||||
private StaticCape curvedCape;
|
||||
|
||||
private String capeType = "dynamic_curved";
|
||||
private boolean capeShoulders = true;
|
||||
private boolean isSilentStaff = false;
|
||||
|
||||
private ShieldData shield = null;
|
||||
|
||||
private PlayerResponse.Account silentAccount;
|
||||
|
||||
public CustomAbstractClientPlayer(World worldIn, GameProfile playerProfile) {
|
||||
this.nameClear = playerProfile.getName();
|
||||
|
||||
if (this.nameClear != null && !this.nameClear.isEmpty())
|
||||
{
|
||||
this.nameClear = StringUtils.stripControlCodes(this.nameClear);
|
||||
}
|
||||
|
||||
this.dynamicCape = new DynamicCape();
|
||||
this.staticCape = new StaticCape(1.0F, 0.0F, 0.0F);
|
||||
this.curvedCape = new StaticCape(6.0F, 5.0F, 0.0F);
|
||||
}
|
||||
|
||||
public void setShield(ShieldData shield) {
|
||||
this.shield = shield;
|
||||
}
|
||||
|
||||
public HatData getNeck() {
|
||||
return neck;
|
||||
}
|
||||
|
||||
public void setNeck(HatData neck) {
|
||||
this.neck = neck;
|
||||
}
|
||||
|
||||
public HatData getMask() {
|
||||
return mask;
|
||||
}
|
||||
|
||||
public String getNameClear() {
|
||||
return nameClear;
|
||||
}
|
||||
|
||||
public void setMask(HatData mask) {
|
||||
this.mask = mask;
|
||||
}
|
||||
|
||||
public ShieldData getShield() {
|
||||
return shield;
|
||||
}
|
||||
|
||||
public PlayerResponse.Account getSilentAccount() {
|
||||
return silentAccount;
|
||||
}
|
||||
|
||||
public void setSilentAccount(PlayerResponse.Account silentAccount) {
|
||||
this.silentAccount = silentAccount;
|
||||
}
|
||||
|
||||
public HatData getHat() {
|
||||
return hat;
|
||||
}
|
||||
|
||||
public void setHat(HatData hat) {
|
||||
this.hat = hat;
|
||||
}
|
||||
|
||||
public String getCapeType() {
|
||||
return capeType;
|
||||
}
|
||||
|
||||
public void setCapeType(String capeType) {
|
||||
this.capeType = capeType;
|
||||
}
|
||||
|
||||
public boolean capeShoulders() {
|
||||
return capeShoulders;
|
||||
}
|
||||
|
||||
public void setCapeShoulders(boolean capeShoulders) {
|
||||
this.capeShoulders = capeShoulders;
|
||||
}
|
||||
|
||||
public AnimatedResourceLocation getBandana() {
|
||||
return bandana;
|
||||
}
|
||||
|
||||
public void setSilentStaff(boolean silentStaff) {
|
||||
isSilentStaff = silentStaff;
|
||||
}
|
||||
|
||||
public boolean isSilentStaff() {
|
||||
return isSilentStaff;
|
||||
}
|
||||
|
||||
public void setBandana(AnimatedResourceLocation bandana) {
|
||||
this.bandana = bandana;
|
||||
}
|
||||
|
||||
public StaticCape getCurvedCape() {
|
||||
return curvedCape;
|
||||
}
|
||||
|
||||
public StaticCape getStaticCape() {
|
||||
return staticCape;
|
||||
}
|
||||
|
||||
public DynamicCape getDynamicCape() {
|
||||
return dynamicCape;
|
||||
}
|
||||
|
||||
public void setSilentPlayer(boolean isSilent) {
|
||||
this.isSilentPlayer = isSilent;
|
||||
}
|
||||
|
||||
public void setLocationCustomCape(ResourceLocation locationCustomCape) {
|
||||
this.locationCustomCape = locationCustomCape;
|
||||
}
|
||||
|
||||
public ResourceLocation getLocationCustomCape() {
|
||||
// if(!Client.getInstance().getSettingsManager().getSettingByClass(CosmeticsMod.class, "Capes").getValBoolean()) {
|
||||
// return null;
|
||||
// }
|
||||
return locationCustomCape;
|
||||
}
|
||||
|
||||
public boolean isSilentPlayer() {
|
||||
return isSilentPlayer;
|
||||
}
|
||||
|
||||
public void setPlayerIcon(ResourceLocation playerIcon) {
|
||||
this.playerIcon = playerIcon;
|
||||
}
|
||||
|
||||
public ResourceLocation getPlayerIcon() {
|
||||
return playerIcon;
|
||||
}
|
||||
|
||||
public void setLocationOfWings(ResourceLocation locationOfWings) {
|
||||
this.locationOfWings = locationOfWings;
|
||||
}
|
||||
|
||||
public ResourceLocation getLocationOfWings() {
|
||||
return locationOfWings;
|
||||
}
|
||||
|
||||
public AnimatedResourceLocation getLocationSilentCape() {
|
||||
// if(!Client.getInstance().getSettingsManager().getSettingByClass(CosmeticsMod.class, "Capes").getValBoolean()) {
|
||||
// return null;
|
||||
// }
|
||||
|
||||
return locationSilentCape;
|
||||
}
|
||||
|
||||
public void setLocationSilentCape(AnimatedResourceLocation locationSilentCape) {
|
||||
this.locationSilentCape = locationSilentCape;
|
||||
}
|
||||
|
||||
public void setShoulders(ResourceLocation shoulders) {
|
||||
this.shoulders = shoulders;
|
||||
}
|
||||
|
||||
public ResourceLocation getShoulders() {
|
||||
return shoulders;
|
||||
}
|
||||
}
|
@ -7,6 +7,7 @@ import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.silentclient.client.Client;
|
||||
import net.silentclient.client.cosmetics.HatData;
|
||||
import net.silentclient.client.mixin.ducks.AbstractClientPlayerExt;
|
||||
import net.silentclient.client.mods.settings.CosmeticsMod;
|
||||
import net.silentclient.client.utils.types.PlayerResponse;
|
||||
|
||||
@ -28,8 +29,8 @@ public class Players {
|
||||
}
|
||||
|
||||
public static String getPlayerStatus(boolean isMainPlayer, String name, UUID id, AbstractClientPlayer playerRow) {
|
||||
CustomAbstractClientPlayer player = CustomAbstractClientPlayer.players.get(playerRow);
|
||||
if(player.getNameClear().toLowerCase().equals(Client.getInstance().getAccount().getUsername()) && !playersCache.containsKey(name.toLowerCase())) {
|
||||
AbstractClientPlayerExt player = (AbstractClientPlayerExt) playerRow;
|
||||
if(player.silent$getNameClear().toLowerCase().equals(Client.getInstance().getAccount().getUsername()) && !playersCache.containsKey(name.toLowerCase())) {
|
||||
playersCache.put(name.toLowerCase(), Client.getInstance().getAccount());
|
||||
}
|
||||
if(playersCache.containsKey(name.toLowerCase())) {
|
||||
@ -39,68 +40,61 @@ public class Players {
|
||||
}
|
||||
|
||||
if(result.getSelectedCape() != 0) {
|
||||
player.setLocationSilentCape(Client.getInstance().getCosmetics().getCapeById(result.getSelectedCape()));
|
||||
player.setShoulders(Client.getInstance().getCosmetics().getCapeShoulders(result.getSelectedCape()));
|
||||
player.silent$setCape(Client.getInstance().getCosmetics().getCapeById(result.getSelectedCape()));
|
||||
player.silent$setCapeShoulders(Client.getInstance().getCosmetics().getCapeShoulders(result.getSelectedCape()));
|
||||
} else {
|
||||
player.setLocationSilentCape(null);
|
||||
player.setShoulders(null);
|
||||
player.silent$setCape(null);
|
||||
player.silent$setCapeShoulders(null);
|
||||
}
|
||||
|
||||
|
||||
if(result.getSelectedWings() != 0) {
|
||||
player.setLocationOfWings(Client.getInstance().getCosmetics().getWingsById(result.getSelectedWings()));
|
||||
player.silent$setWings(Client.getInstance().getCosmetics().getWingsById(result.getSelectedWings()));
|
||||
} else {
|
||||
player.setLocationOfWings(null);
|
||||
player.silent$setWings(null);
|
||||
}
|
||||
|
||||
if(result.getSelectedHat() != 0 && Client.getInstance().getCosmetics().getHatById(result.getSelectedHat()) != null) {
|
||||
player.setHat(new HatData(Client.getInstance().getCosmetics().getHatById(result.getSelectedHat()).getTexture(), Client.getInstance().getCosmetics().getHatById(result.getSelectedHat()).getModel()));
|
||||
player.silent$setHat(new HatData(Client.getInstance().getCosmetics().getHatById(result.getSelectedHat()).getTexture(), Client.getInstance().getCosmetics().getHatById(result.getSelectedHat()).getModel()));
|
||||
} else {
|
||||
player.setHat(null);
|
||||
player.silent$setHat(null);
|
||||
}
|
||||
|
||||
if(result.getSelectedNeck() != 0 && Client.getInstance().getCosmetics().getHatById(result.getSelectedNeck()) != null) {
|
||||
player.setNeck(new HatData(Client.getInstance().getCosmetics().getHatById(result.getSelectedNeck()).getTexture(), Client.getInstance().getCosmetics().getHatById(result.getSelectedNeck()).getModel()));
|
||||
player.silent$setNeck(new HatData(Client.getInstance().getCosmetics().getHatById(result.getSelectedNeck()).getTexture(), Client.getInstance().getCosmetics().getHatById(result.getSelectedNeck()).getModel()));
|
||||
} else {
|
||||
player.setNeck(null);
|
||||
player.silent$setNeck(null);
|
||||
}
|
||||
|
||||
if(result.getSelectedMask() != 0 && Client.getInstance().getCosmetics().getHatById(result.getSelectedMask()) != null) {
|
||||
player.setMask(new HatData(Client.getInstance().getCosmetics().getHatById(result.getSelectedMask()).getTexture(), Client.getInstance().getCosmetics().getHatById(result.getSelectedMask()).getModel()));
|
||||
player.silent$setMask(new HatData(Client.getInstance().getCosmetics().getHatById(result.getSelectedMask()).getTexture(), Client.getInstance().getCosmetics().getHatById(result.getSelectedMask()).getModel()));
|
||||
} else {
|
||||
player.setMask(null);
|
||||
player.silent$setMask(null);
|
||||
}
|
||||
|
||||
if(result.getSelectedShield() != 0 && Client.getInstance().getCosmetics().getShieldById(result.getSelectedShield()) != null) {
|
||||
player.setShield(Client.getInstance().getCosmetics().getShieldById(result.getSelectedShield()));
|
||||
player.silent$setShield(Client.getInstance().getCosmetics().getShieldById(result.getSelectedShield()));
|
||||
} else {
|
||||
player.setShield(null);
|
||||
player.silent$setShield(null);
|
||||
}
|
||||
|
||||
if(result.getSelectedIcon() != 0) {
|
||||
player.setPlayerIcon(Client.getInstance().getCosmetics().getIconById(result.getSelectedIcon()));
|
||||
player.silent$setPlayerIcon(Client.getInstance().getCosmetics().getIconById(result.getSelectedIcon()));
|
||||
} else {
|
||||
player.setPlayerIcon(Client.getInstance().getCosmetics().getDefaultIcon());
|
||||
player.silent$setPlayerIcon(Client.getInstance().getCosmetics().getDefaultIcon());
|
||||
}
|
||||
|
||||
|
||||
if(result.getSelectedBandana() != 0) {
|
||||
player.setBandana(Client.getInstance().getCosmetics().getBandanaById(result.getSelectedBandana()));
|
||||
player.silent$setBandana(Client.getInstance().getCosmetics().getBandanaById(result.getSelectedBandana()));
|
||||
} else {
|
||||
player.setBandana(null);
|
||||
player.silent$setBandana(null);
|
||||
}
|
||||
|
||||
player.setCapeShoulders(result.getCapeShoulders());
|
||||
player.setCapeType(result.getCapeType());
|
||||
player.silent$setShoulders(result.getCapeShoulders());
|
||||
player.silent$setCapeType(result.getCapeType());
|
||||
|
||||
|
||||
if(result.isStaff() || result.isAdmin() || result.isTester()) {
|
||||
player.setSilentStaff(true);
|
||||
} else {
|
||||
player.setSilentStaff(false);
|
||||
}
|
||||
|
||||
player.setSilentAccount(result);
|
||||
player.silent$setAccount(result);
|
||||
|
||||
return result.isOnline() ? "true" : "false";
|
||||
} else {
|
||||
@ -124,9 +118,9 @@ public class Players {
|
||||
Client.getInstance().getSettingsManager().getSettingByClass(CosmeticsMod.class, "Cape Shoulders").setValBoolean(account.getCapeShoulders());
|
||||
Client.getInstance().getSettingsManager().getSettingByClass(CosmeticsMod.class, "Cape Type").setValString(account.getCapeType().equals("dynamic_curved") ? "Dynamic Curved" : account.getCapeType().equals("curved_rectangle") ? "Curved Rectangle" : "Rectangle");
|
||||
if(Minecraft.getMinecraft().thePlayer != null) {
|
||||
CustomAbstractClientPlayer.players.get(Minecraft.getMinecraft().thePlayer).setCapeType(account.getCapeType());
|
||||
CustomAbstractClientPlayer.players.get(Minecraft.getMinecraft().thePlayer).setCapeShoulders(account.getCapeShoulders());
|
||||
Players.getPlayerStatus(false, CustomAbstractClientPlayer.players.get(Minecraft.getMinecraft().thePlayer).getNameClear(), EntityPlayer.getUUID(Minecraft.getMinecraft().thePlayer.getGameProfile()), Minecraft.getMinecraft().thePlayer);
|
||||
((AbstractClientPlayerExt) Minecraft.getMinecraft().thePlayer).silent$setCapeType(account.getCapeType());
|
||||
((AbstractClientPlayerExt) Minecraft.getMinecraft().thePlayer).silent$setShoulders(account.getCapeShoulders());
|
||||
Players.getPlayerStatus(false, ((AbstractClientPlayerExt) Minecraft.getMinecraft().thePlayer).silent$getNameClear(), EntityPlayer.getUUID(Minecraft.getMinecraft().thePlayer.getGameProfile()), Minecraft.getMinecraft().thePlayer);
|
||||
}
|
||||
}
|
||||
if(playersCache.containsKey(account.getUsername())) {
|
||||
|
@ -12,6 +12,7 @@ import javax.net.ssl.HttpsURLConnection;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.silentclient.client.Client;
|
||||
import net.silentclient.client.cosmetics.StaticResourceLocation;
|
||||
import net.silentclient.client.utils.reply.AbstractReply;
|
||||
|
||||
public class FriendsResponse extends AbstractReply {
|
||||
@ -54,7 +55,7 @@ public class FriendsResponse extends AbstractReply {
|
||||
return username;
|
||||
}
|
||||
|
||||
public ResourceLocation getIcon() {
|
||||
public StaticResourceLocation getIcon() {
|
||||
if(selected_icon == 0) {
|
||||
return Client.getInstance().getCosmetics().getDefaultIcon();
|
||||
}
|
||||
@ -115,7 +116,7 @@ public class FriendsResponse extends AbstractReply {
|
||||
return username;
|
||||
}
|
||||
|
||||
public ResourceLocation getIcon() {
|
||||
public StaticResourceLocation getIcon() {
|
||||
if(selected_icon == 0) {
|
||||
return Client.getInstance().getCosmetics().getDefaultIcon();
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ import javax.net.ssl.HttpsURLConnection;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.silentclient.client.Client;
|
||||
import net.silentclient.client.utils.CustomAbstractClientPlayer;
|
||||
import net.silentclient.client.mixin.ducks.AbstractClientPlayerExt;
|
||||
import net.silentclient.client.utils.Players;
|
||||
import net.silentclient.client.utils.reply.AbstractReply;
|
||||
|
||||
@ -117,7 +117,7 @@ public class PlayerResponse extends AbstractReply {
|
||||
this.plus_icon_color = plus_icon_color;
|
||||
Players.reload();
|
||||
if(Minecraft.getMinecraft().thePlayer != null) {
|
||||
Players.getPlayerStatus(false, CustomAbstractClientPlayer.players.get(Minecraft.getMinecraft().thePlayer).getNameClear(), EntityPlayer.getUUID(Minecraft.getMinecraft().thePlayer.getGameProfile()), Minecraft.getMinecraft().thePlayer);
|
||||
Players.getPlayerStatus(false, ((AbstractClientPlayerExt) Minecraft.getMinecraft().thePlayer).silent$getNameClear(), EntityPlayer.getUUID(Minecraft.getMinecraft().thePlayer.getGameProfile()), Minecraft.getMinecraft().thePlayer);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
@ -331,7 +331,7 @@ public class PlayerResponse extends AbstractReply {
|
||||
this.cape_shoulders = shoulders ? 1 : 0;
|
||||
Players.reload();
|
||||
if(Minecraft.getMinecraft().thePlayer != null) {
|
||||
Players.getPlayerStatus(false, CustomAbstractClientPlayer.players.get(Minecraft.getMinecraft().thePlayer).getNameClear(), EntityPlayer.getUUID(Minecraft.getMinecraft().thePlayer.getGameProfile()), Minecraft.getMinecraft().thePlayer);
|
||||
Players.getPlayerStatus(false, ((AbstractClientPlayerExt) Minecraft.getMinecraft().thePlayer).silent$getNameClear(), EntityPlayer.getUUID(Minecraft.getMinecraft().thePlayer.getGameProfile()), Minecraft.getMinecraft().thePlayer);
|
||||
}
|
||||
(new Thread("setShoulders") {
|
||||
public void run() {
|
||||
|
@ -22,6 +22,5 @@
|
||||
"mixins.EffectRendererMixin",
|
||||
"accessors.RenderManagerAccessor",
|
||||
"mixins.RenderPlayerMixin",
|
||||
"accessors.RendererLivingEntityAccessor"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user