This commit is contained in:
UnknownUser1789 2023-01-15 18:22:40 +00:00
parent 14141af969
commit c3b6baf6c9
9 changed files with 27048 additions and 27090 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 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

@ -19,13 +19,14 @@ 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 boolean renderHalo(AbstractClientPlayer player){
return ModManager.cosmetics.isEnabled() && Cosmetics.show.getValue() && shouldRender(player) && Cosmetics.halo.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 float[] getDragonWingsColor = new float[]{1f,1f,1f,1f};
public static boolean shouldRender(AbstractClientPlayer player){
switch(Cosmetics.who.getValue()){

View File

@ -1,117 +0,0 @@
//
// 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

@ -0,0 +1,77 @@
package dev.resent.cosmetic.impl;
import dev.resent.cosmetic.CosmeticBase;
import dev.resent.cosmetic.CosmeticController;
import dev.resent.cosmetic.CosmeticModelBase;
import dev.resent.util.render.Color;
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 Halo extends CosmeticBase {
private final ModelHalo modelHalo;
private static final ResourceLocation HALOBLUE;
static {
HALOBLUE = new ResourceLocation("eagler:gui/blue.jpeg");
}
public Halo(final RenderPlayer renderPlayer) {
super(renderPlayer);
this.modelHalo = new ModelHalo(renderPlayer);
}
@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.renderHalo(player)) {
GlStateManager.pushMatrix();
this.playerRenderer.bindTexture(Halo.HALOBLUE);
GlStateManager.color(1, 1, 1);
this.modelHalo.render(player, limbSwing, limbSwingAmount, ageInTicks, headYaw, headPitch, scale);
GlStateManager.color(1.0f, 1.0f, 1.0f);
GlStateManager.popMatrix();
}
}
private class ModelHalo extends CosmeticModelBase
{
private ModelRenderer halo;
private boolean hat;
public ModelHalo(final RenderPlayer player) {
super(player);
(this.halo = new ModelRenderer(this.playerModel).setTextureSize(14, 2)).addBox(-3.0f, -12.5f, -4.0f, 6, 1, 1, 0.15f);
this.halo.isHidden = true;
}
@Override
public void render(final Entity entityIn, final float limbSwing, final float limbSwingAmount, final float ageInTicks, final float headYaw, final float headPitch, final float scale) {
GlStateManager.pushMatrix();
final float f = (float)Math.cos(ageInTicks / 10.0) / 20.0f;
GlStateManager.rotate(headYaw + ageInTicks / 2.0f, 0.0f, 1.0f, 0.0f);
GlStateManager.translate(0.0f, f, 0.0f);
Minecraft.getMinecraft().getTextureManager().bindTexture(Halo.HALOBLUE);
GlStateManager.disableLighting();
final ModelRenderer modelrenderer = bindTextureAndColor(Color.WHITE, Halo.HALOBLUE, this.halo, null);
modelrenderer.isHidden = false;
for (int i = 0; i < 4; ++i) {
modelrenderer.render(scale);
GlStateManager.rotate(90.0f, 0.0f, 1.0f, 0.0f);
}
modelrenderer.isHidden = true;
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
public ModelRenderer bindTextureAndColor(final Color color, final ResourceLocation resourceLocation, final ModelRenderer colorModel, final ModelRenderer playerSkinModel) {
final boolean flag = false;
Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation);
return colorModel;
}
}
}

View File

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

View File

@ -1,8 +1,8 @@
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.Halo;
import dev.resent.cosmetic.impl.TopHat;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.minecraft.client.entity.AbstractClientPlayer;
@ -64,7 +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));
this.addLayer(new Halo(this));
}
public ModelBiped getMainModel() {