Huge update; Add more cosmetics and settings.

This commit is contained in:
UnknownUser1789 2023-01-15 17:15:25 +00:00
parent 8923d434de
commit 14141af969
11 changed files with 29163 additions and 29025 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -10,7 +10,7 @@ public class Resent {
}
public static String NAME = "Resent";
public static String VERSION = "3.3.1";
public static String VERSION = "3.3.2";
public static Minecraft mc = Minecraft.getMinecraft();
public static Resent INSTANCE;
public ModManager modManager;

View File

@ -19,6 +19,11 @@ public class CosmeticController {
return ModManager.cosmetics.isEnabled() && Cosmetics.show.getValue() && shouldRender(player) && Cosmetics.glasses.getValue();
}
public static boolean renderDragonWings(AbstractClientPlayer player){
return ModManager.cosmetics.isEnabled() && Cosmetics.show.getValue() && shouldRender(player) && Cosmetics.dragonwings.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}; }

View File

@ -0,0 +1,117 @@
//
// Decompiled by Procyon v0.5.36
//
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.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
public class DragonWings extends CosmeticBase{
private static ModelRenderer wing;
private static ModelRenderer wingTip;
boolean flying;
private final ModelDragonWings modelDragonWings;
@Override
public void render(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 (CosmeticController.renderDragonWings(player)) {
GlStateManager.pushMatrix();
this.modelDragonWings.render(player, limbSwing, limbSwingAmount, ageInTicks, HeadYaw, headPitch, scale);
this.modelDragonWings.setRotationAngles(scale, limbSwing, limbSwingAmount, ageInTicks, HeadYaw, headPitch, player);
GlStateManager.popMatrix();
}
}
public DragonWings(final RenderPlayer renderPlayer) {
super(renderPlayer);
this.flying = false;
(this.modelDragonWings = new ModelDragonWings(renderPlayer)).setTextureOffset("wingTip.bone", 112, 136);
this.modelDragonWings.setTextureOffset("wing.skin", -56, 88);
this.modelDragonWings.setTextureOffset("wing.bone", 112, 88);
this.modelDragonWings.setTextureOffset("wingTip.skin", -56, 144);
final int bw = this.modelDragonWings.textureWidth;
final int bh = this.modelDragonWings.textureHeight;
this.modelDragonWings.textureWidth = 256;
this.modelDragonWings.textureHeight = 256;
(DragonWings.wing = new ModelRenderer(this.modelDragonWings, "wing")).setRotationPoint(-12.0f, 5.0f, 2.0f);
DragonWings.wing.addBox("bone", -56.0f, -4.0f, -4.0f, 56, 8, 8);
DragonWings.wing.addBox("skin", -56.0f, 0.0f, 2.0f, 56, 0, 56);
DragonWings.wing.isHidden = true;
(DragonWings.wingTip = new ModelRenderer(this.modelDragonWings, "wingTip")).setRotationPoint(-56.0f, 0.0f, 0.0f);
DragonWings.wingTip.isHidden = true;
DragonWings.wingTip.addBox("bone", -56.0f, -2.0f, -2.0f, 56, 4, 4);
DragonWings.wingTip.addBox("skin", -56.0f, 0.0f, 2.0f, 56, 0, 56);
DragonWings.wing.addChild(DragonWings.wingTip);
this.modelDragonWings.textureWidth = bw;
this.modelDragonWings.textureWidth = bh;
}
public void setRotationAngles(final float f, final float f1, final float f2, final float f3, final float f4, final float f5, final Entity entity) {
}
private class ModelDragonWings extends CosmeticModelBase
{
public ModelDragonWings(final RenderPlayer player) {
super(player);
}
@Override
public void render(final Entity entityIn, final float limbSwing, final float limbSwingAmount, final float ageInTicks, final float netHeadYaw, final float headPitch, final float scale) {
super.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
GlStateManager.pushMatrix();
float f1 = 0.0f;
if (Minecraft.getMinecraft().thePlayer.capabilities.isFlying) {
f1 = ageInTicks / 200.0f;
}
else {
f1 = ageInTicks / 80.0f;
}
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("eagler:gui/wings.png"));
float anSpeed = 100.0f;
if (!entityIn.onGround || DragonWings.this.flying) {
anSpeed = 50.0f;
DragonWings.this.flying = true;
}
GlStateManager.scale(0.15, 0.15, 0.15);
GlStateManager.translate(0.0, -0.3, 1.1);
GlStateManager.rotate(50.0f, -50.0f, 0.0f, 0.0f);
final int x = 0;
final int index = 0;
for (int i = 0; i < 2; ++i) {
final float f2 = f1 * 9.141593f * 2.0f;
DragonWings.wing.rotateAngleX = 0.125f - (float)Math.cos(f2) * 0.2f;
DragonWings.wing.rotateAngleY = 0.25f;
DragonWings.wing.rotateAngleZ = (float)(Math.sin(f2) + 1.225) * 0.3f;
DragonWings.wingTip.rotateAngleZ = -(float)(Math.sin(f2 + 2.0f) + 0.5) * 0.75f;
DragonWings.wing.isHidden = false;
DragonWings.wingTip.isHidden = false;
if (!entityIn.isInvisible()) {
GlStateManager.pushMatrix();
GlStateManager.disableLighting();
DragonWings.wing.render(scale);
GlStateManager.blendFunc(1, 1);
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
DragonWings.wing.isHidden = false;
DragonWings.wingTip.isHidden = false;
if (i == 0) {
GlStateManager.scale(-1.0f, 1.0f, 1.0f);
}
}
GlStateManager.popMatrix();
}
}
}

View File

@ -8,13 +8,14 @@ import dev.resent.setting.ModeSetting;
public class Cosmetics extends Mod{
public Cosmetics(){
super("Cosmetics", Category.MISC, true);
addSetting(who, show, dragonwings, crystalwings, glasses, hat);
}
public static BooleanSetting show = new BooleanSetting("Show cosmetics", "", true);
public static BooleanSetting crystalwings = new BooleanSetting("Crystal wings", "", true);
public static BooleanSetting crystalwings = new BooleanSetting("Crystal wings", "", false);
public static BooleanSetting dragonwings = new BooleanSetting("Dragon 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");
public static ModeSetting who = new ModeSetting("Who to render on", "", "Only you", "Everyone", "Everyone else");
}

View File

@ -22,9 +22,9 @@ public class PreGUI extends GuiScreen{
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.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);
/*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);
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

@ -48,7 +48,7 @@ public abstract class ModelBase {
return (ModelRenderer) this.boxList.get(rand.nextInt(this.boxList.size()));
}
protected void setTextureOffset(String partName, int x, int y) {
public void setTextureOffset(String partName, int x, int y) {
this.modelTextureMap.put(partName, new TextureOffset(x, y));
}

View File

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