Cosmetics mod. Glasses cosmetic. Options for cosmetics.

This commit is contained in:
UnknownUser1789 2023-01-15 16:42:41 +00:00
parent 69595d3c32
commit 8923d434de
8 changed files with 30574 additions and 30367 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,12 +1,41 @@
package dev.resent.cosmetic;
import dev.resent.module.base.ModManager;
import dev.resent.module.impl.misc.Cosmetics;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
public class CosmeticController {
public static boolean renderTopHat(AbstractClientPlayer player){ return true; }
public static boolean renderCrystalWings(AbstractClientPlayer player){ return true; }
public static boolean renderTopHat(AbstractClientPlayer player){
return ModManager.cosmetics.isEnabled() && Cosmetics.show.getValue() && shouldRender(player) && Cosmetics.hat.getValue();
}
public static boolean renderCrystalWings(AbstractClientPlayer player){
return ModManager.cosmetics.isEnabled() && Cosmetics.show.getValue() && shouldRender(player) && Cosmetics.crystalwings.getValue();
}
public static boolean renderGlasses(AbstractClientPlayer player){
return ModManager.cosmetics.isEnabled() && Cosmetics.show.getValue() && shouldRender(player) && Cosmetics.glasses.getValue();
}
public static float[] getTopHatColor(AbstractClientPlayer player){ return new float[]{1, 0, 0}; }
public static float[] getCrystalWingsColor(AbstractClientPlayer player){ return new float[]{1, 1, 1}; }
public static boolean shouldRender(AbstractClientPlayer player){
switch(Cosmetics.who.getValue()){
case "Only you":
return player == Minecraft.getMinecraft().thePlayer;
case "Everyone":
return true;
case "Everyone else":
return player != Minecraft.getMinecraft().thePlayer;
}
return false;
}
}

View File

@ -0,0 +1,129 @@
package dev.resent.cosmetic.impl;
import dev.resent.cosmetic.CosmeticBase;
import dev.resent.cosmetic.CosmeticController;
import dev.resent.cosmetic.CosmeticModelBase;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.entity.Entity;
public class Glasses extends CosmeticBase {
private final GlassesRenderer glassesModel;
public Glasses(RenderPlayer renderPlayer) {
super(renderPlayer);
this.glassesModel = new GlassesRenderer(renderPlayer);
}
@Override
public void render(AbstractClientPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float headYaw, float headPitch, float scale) {
if(CosmeticController.renderGlasses(player)){
GlStateManager.pushMatrix();
if(player.isSneaking()) {
GlStateManager.translate(0, 0.225, 0);
}
GlStateManager.rotate(headYaw, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(headPitch, 1.0F, 0.0F, 0.0F);
this.glassesModel.render(player, limbSwing, limbSwingAmount, ageInTicks, headYaw, headPitch, scale);
GlStateManager.popMatrix();
}
}
public class GlassesRenderer extends CosmeticModelBase{
ModelRenderer Glasses1;
ModelRenderer Glasses2;
ModelRenderer Glasses3;
ModelRenderer Glasses4;
ModelRenderer Glasses5;
ModelRenderer Glasses6;
ModelRenderer Glasses7;
ModelRenderer Glasses8;
ModelRenderer Glasses9;
public GlassesRenderer(RenderPlayer player) {
super(player);
textureWidth = 64;
textureHeight = 32;
Glasses1 = new ModelRenderer(this, 0, 0);
Glasses1.addBox(0F, 0F, 0F, 4, 2, 1);
Glasses1.setRotationPoint(-5F, -3F, -5F);
Glasses1.setTextureSize(64, 32);
Glasses1.mirror = true;
setRotation(Glasses1, 0F, 0F, 0F);
Glasses2 = new ModelRenderer(this, 0, 0);
Glasses2.addBox(0F, 0F, 0F, 10, 1, 1);
Glasses2.setRotationPoint(-5F, -3F, -5F);
Glasses2.setTextureSize(64, 32);
Glasses2.mirror = true;
setRotation(Glasses2, 0F, 0F, 0F);
Glasses3 = new ModelRenderer(this, 0, 0);
Glasses3.addBox(0F, 0F, 0F, 4, 2, 1);
Glasses3.setRotationPoint(1F, -3F, -5F);
Glasses3.setTextureSize(64, 32);
Glasses3.mirror = true;
setRotation(Glasses3, 0F, 0F, 0F);
Glasses4 = new ModelRenderer(this, 0, 0);
Glasses4.addBox(-3F, 0F, -2F, 1, 1, 6);
Glasses4.setRotationPoint(-2F, -3F, -3F);
Glasses4.setTextureSize(64, 32);
Glasses4.mirror = true;
setRotation(Glasses4, 0F, 0F, 0F);
Glasses5 = new ModelRenderer(this, 0, 0);
Glasses5.addBox(0F, 0F, 0F, 1, 1, 6);
Glasses5.setRotationPoint(4F, -3F, -5F);
Glasses5.setTextureSize(64, 32);
Glasses5.mirror = true;
setRotation(Glasses5, 0F, 0F, 0F);
Glasses6 = new ModelRenderer(this, 0, 0);
Glasses6.addBox(0F, 0F, 0F, 1, 1, 1);
Glasses6.setRotationPoint(4F, -2F, 1F);
Glasses6.setTextureSize(64, 32);
Glasses6.mirror = true;
setRotation(Glasses6, 0F, 0F, 0F);
Glasses7 = new ModelRenderer(this, 0, 0);
Glasses7.addBox(0F, 0F, 0F, 1, 1, 1);
Glasses7.setRotationPoint(-5F, -2F, 1F);
Glasses7.setTextureSize(64, 32);
Glasses7.mirror = true;
setRotation(Glasses7, 0F, 0F, 0F);
Glasses8 = new ModelRenderer(this, 0, 0);
Glasses8.addBox(0F, 0F, 0F, 4, 2, 1);
Glasses8.setRotationPoint(-5F, -3F, -5F);
Glasses8.setTextureSize(64, 32);
Glasses8.mirror = true;
setRotation(Glasses8, 0F, 0F, 0F);
Glasses9 = new ModelRenderer(this, 0, 0);
Glasses9.addBox(1F, -3F, -5F, 4, 2, 1);
Glasses9.setRotationPoint(0F, 0F, 0F);
Glasses9.setTextureSize(64, 32);
Glasses9.mirror = true;
setRotation(Glasses9, 0F, 0F, 0F);
}
public void render(Entity entityIn, float limbSwing, float limbSwingAmout, float ageInTicks, float headYaw, float headPitch, float scale) {
GlStateManager.pushMatrix();
GlStateManager.color(0, 0, 0);
Glasses1.render(scale);
Glasses2.render(scale);
Glasses3.render(scale);
Glasses4.render(scale);
Glasses5.render(scale);
Glasses6.render(scale);
Glasses7.render(scale);
Glasses8.render(scale);
Glasses9.render(scale);
GlStateManager.popMatrix();
}
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View File

@ -19,6 +19,7 @@ import dev.resent.module.impl.misc.Animations;
import dev.resent.module.impl.misc.AutoGG;
import dev.resent.module.impl.misc.AutoRespawn;
import dev.resent.module.impl.misc.ClearChat;
import dev.resent.module.impl.misc.Cosmetics;
import dev.resent.module.impl.misc.Crosshair;
import dev.resent.module.impl.misc.DynamicFOV;
import dev.resent.module.impl.misc.FPSB;
@ -40,8 +41,7 @@ public class ModManager {
public List<Mod> modules = new ArrayList<>();
public Minecraft mc = Minecraft.getMinecraft();
public static String currentModDragging = null;
public static Cosmetics cosmetics = new Cosmetics();
public static Sprint sprint;
public static CPS cps;
public static KeyStrokes keyStrokes;
@ -78,6 +78,7 @@ public class ModManager {
public ModManager() {
//Hud
register(cosmetics);
register(ping = new Ping());
register(serverInfo = new ServerInfo());
register(watermark = new Watermark());

View File

@ -0,0 +1,20 @@
package dev.resent.module.impl.misc;
import dev.resent.module.base.Category;
import dev.resent.module.base.Mod;
import dev.resent.setting.BooleanSetting;
import dev.resent.setting.ModeSetting;
public class Cosmetics extends Mod{
public Cosmetics(){
super("Cosmetics", Category.MISC, true);
}
public static BooleanSetting show = new BooleanSetting("Show cosmetics", "", true);
public static BooleanSetting crystalwings = new BooleanSetting("Crystal wings", "", true);
public static BooleanSetting hat = new BooleanSetting("Top hat", "", true);
public static BooleanSetting glasses = new BooleanSetting("Glasses", "", true);
public static ModeSetting who = new ModeSetting("Who to render on:", "", "Only you", "Everyone", "Everyone else");
}

View File

@ -14,13 +14,17 @@ public class PreGUI extends GuiScreen{
public void drawScreen(int i, int j, float var3) {
GlStateManager.pushMatrix();
GlStateManager.translate(0, 0.75f, 0);
GlStateManager.translate(0, 0.5f, 0);
mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/logo.png"));
Gui.drawModalRectWithCustomSizedTexture(GuiScreen.width/2-20, GuiScreen.height/2-50, 0, 0, 60, 60, 60, 60);
Gui.drawRect(GuiScreen.width/2-30, GuiScreen.height/2+20, GuiScreen.width/2+50, GuiScreen.height/2+50, isMouseInside(i, j, GuiScreen.width/2-30, GuiScreen.height/2+20, GuiScreen.width/2+50, GuiScreen.height/2+50) ? 0x40FFFFFF : 0x50FFFFFF);
RenderUtils.drawRectOutline(GuiScreen.width/2-30, GuiScreen.height/2+20, GuiScreen.width/2+50, GuiScreen.height/2+50, 0x080FFFFFF);
RenderUtils.drawCenteredScaledString("Settings", GuiScreen.width/2+10, GuiScreen.height/2+35-mc.fontRendererObj.FONT_HEIGHT/2, -1, 1.5f);
RenderUtils.drawCenteredScaledString("Settings", GuiScreen.width/2+10, GuiScreen.height/2+35-mc.fontRendererObj.FONT_HEIGHT/2, -1, 1.25f);
Gui.drawRect(GuiScreen.width/2-30, GuiScreen.height/2+55, GuiScreen.width/2+50, GuiScreen.height/2+85, isMouseInside(i, j, GuiScreen.width/2-30, GuiScreen.height/2+55, GuiScreen.width/2+50, GuiScreen.height/2+85) ? 0x40FFFFFF : 0x50FFFFFF);
RenderUtils.drawRectOutline(GuiScreen.width/2-30, GuiScreen.height/2+55, GuiScreen.width/2+50, GuiScreen.height/2+85, 0x080FFFFFF);
RenderUtils.drawCenteredScaledString("Cosmetics", GuiScreen.width/2+10, GuiScreen.height/2+70-mc.fontRendererObj.FONT_HEIGHT/2, -1, 1.25f);
super.drawScreen(i, j, var3);
GlStateManager.popMatrix();
}

View File

@ -1,6 +1,7 @@
package net.minecraft.client.renderer.entity;
import dev.resent.cosmetic.impl.CrystalWings;
import dev.resent.cosmetic.impl.Glasses;
import dev.resent.cosmetic.impl.TopHat;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.minecraft.client.entity.AbstractClientPlayer;
@ -60,6 +61,7 @@ public class RenderPlayer extends RendererLivingEntity<AbstractClientPlayer> {
this.addLayer(new LayerCape(this));
this.addLayer(new LayerCustomHead(this.getMainModel().bipedHead));
this.addLayer(new TopHat(this));
this.addLayer(new Glasses(this));
this.addLayer(new CrystalWings(this));
}