Pre-ClickGUI screen. Add wings cosmetic

This commit is contained in:
UnknownUser1789 2023-01-15 15:35:55 +00:00
parent 7941ed0bd7
commit d828b919ce
11 changed files with 30826 additions and 30735 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

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

@ -4,12 +4,9 @@ import net.minecraft.client.entity.AbstractClientPlayer;
public class CosmeticController {
public static boolean renderTopHat(AbstractClientPlayer player){
return true;
}
public static float[] getTopHatColor(AbstractClientPlayer player){
return new float[]{1, 0, 0};
}
public static boolean renderTopHat(AbstractClientPlayer player){ return true; }
public static boolean renderCrystalWings(AbstractClientPlayer player){ return true; }
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,107 @@
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.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
public class CrystalWings extends CosmeticBase {
private CrytsalWingsModel crytsalWingsModel;
public CrystalWings(RenderPlayer playerRenderer) {
super(playerRenderer);
this.crytsalWingsModel = new CrytsalWingsModel(playerRenderer);
}
@Override
public void render(AbstractClientPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
if(CosmeticController.renderCrystalWings(player)){
GlStateManager.pushMatrix();
float[] color = CosmeticController.getCrystalWingsColor(player);
GlStateManager.color(color[0], color[1], color[2]);
this.crytsalWingsModel.render(player, limbSwing, limbSwingAmount, ageInTicks, headPitch, headPitch, scale);
GlStateManager.color(1, 1, 1);
GlStateManager.popMatrix();
}
}
public class CrytsalWingsModel extends CosmeticModelBase {
private ModelRenderer model;
ResourceLocation resourceLocation = new ResourceLocation("eagler:gui/crystal.png");
public CrytsalWingsModel(RenderPlayer player) {
super(player);
int i = 30;
int j = 24;
this.model = (new ModelRenderer((ModelBase)this)).setTextureSize(i, j).setTextureOffset(0, 8);
this.model.setRotationPoint(-0.0F, 1.0F, 0.0F);
this.model.addBox(0.0F, -3.0F, 0.0F, 14, 7, 1);
this.model.isHidden = true;
ModelRenderer modelrenderer = (new ModelRenderer((ModelBase)this)).setTextureSize(i, j).setTextureOffset(0, 16);
modelrenderer.setRotationPoint(-0.0F, 0.0F, 0.2F);
modelrenderer.addBox(0.0F, -3.0F, 0.0F, 14, 7, 1);
this.model.addChild(modelrenderer);
ModelRenderer modelrenderer1 = (new ModelRenderer((ModelBase)this)).setTextureSize(i, j).setTextureOffset(0, 0);
modelrenderer1.setRotationPoint(-0.0F, 0.0F, 0.2F);
modelrenderer1.addBox(0.0F, -3.0F, 0.0F, 14, 7, 1);
modelrenderer.addChild(modelrenderer1);
}
public void render(Entity entityIn, float p_78088_2_, float walkingSpeed, float tickValue, float p_78088_5_, float p_78088_6_, float scale) {
float f = (float)Math.cos((tickValue / 10.0F)) / 20.0F - 0.03F - walkingSpeed / 20.0F;
ModelRenderer modelrenderer = (ModelRenderer) this.model.childModels.get(0);
ModelRenderer modelrenderer1 = (ModelRenderer) modelrenderer.childModels.get(0);
this.model.rotateAngleZ = f * 3.0F;
modelrenderer.rotateAngleZ = f / 2.0F;
modelrenderer1.rotateAngleZ = f / 2.0F;
this.model.rotateAngleY = -0.3F - walkingSpeed / 3.0F;
this.model.rotateAngleX = 0.3F;
GlStateManager.pushMatrix();
GlStateManager.scale(1.6D, 1.6D, 1.0D);
GlStateManager.translate(0.0D, 0.05000000074505806D, 0.05000000074505806D);
if (entityIn.isSneaking()) {
GlStateManager.translate(0.0D, 0.07999999821186066D, 0.029999999329447746D);
GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
this.model.rotateAngleZ = 0.8F;
modelrenderer.rotateAngleZ = 0.0F;
modelrenderer1.rotateAngleZ = 0.0F;
} else {
RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
if (rendermanager != null)
GlStateManager.rotate(rendermanager.playerViewX / 3.0F, 1.0F, 0.0F, 0.0F);
}
this.model.isHidden = false;
for (int i = -1; i <= 1; i += 2) {
GlStateManager.pushMatrix();
GlStateManager.depthMask(false);
GlStateManager.enableBlend();
GlStateManager.blendFunc(770, 771);
GlStateManager.alphaFunc(516, 0.003921569F);
GlStateManager.disableLighting();
Minecraft.getMinecraft().getTextureManager().bindTexture(this.resourceLocation);
if (i == 1)
GlStateManager.scale(-1.0F, 1.0F, 1.0F);
GlStateManager.translate(0.05D, 0.0D, 0.0D);
this.model.render(scale);
GlStateManager.disableBlend();
GlStateManager.alphaFunc(516, 0.1F);
GlStateManager.popMatrix();
GlStateManager.depthMask(true);
GlStateManager.color(1,1,1);
}
this.model.isHidden = true;
GlStateManager.popMatrix();
}
}
}

View File

@ -0,0 +1,40 @@
package dev.resent.ui;
import dev.resent.util.render.RenderUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.util.ResourceLocation;
public class PreGUI extends GuiScreen{
@Override
public void drawScreen(int i, int j, float var3) {
Minecraft.getMinecraft().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-40, GuiScreen.height/2+10, GuiScreen.width/2+40, GuiScreen.height/2+30, isMouseInside(i, j, GuiScreen.width/2-25, GuiScreen.height/2-10, GuiScreen.width/2+25, GuiScreen.height/2+10) ? 0x30FFFFFF : 0x40FFFFFF);
RenderUtils.drawRectOutline(GuiScreen.width/2-40, GuiScreen.height/2+10, GuiScreen.width/2+40, GuiScreen.height/2+30, 0x80FFFFFF);
Minecraft.getMinecraft().fontRendererObj.drawString("Settings", GuiScreen.width/2-Minecraft.getMinecraft().fontRendererObj.getStringWidth("Settings")/2, GuiScreen.height/2+30-Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT/2, -1);
super.drawScreen(i, j, var3);
}
@Override
protected void mouseClicked(int parInt1, int parInt2, int parInt3) {
super.mouseClicked(parInt1, parInt2, parInt3);
}
@Override
protected void keyTyped(char parChar1, int parInt1) {
if (parInt1 == 0x01 || parInt1 == Minecraft.getMinecraft().gameSettings.keyBindClickGui.keyCode) {
mc.displayGuiScreen(null);
}
super.keyTyped(parChar1, parInt1);
}
public boolean isMouseInside(int mouseX, int mouseY, int x, int y, int width, int height) {
return (mouseX >= x && mouseX <= width) && (mouseY >= y && mouseY <= height);
}
}

View File

@ -11,6 +11,7 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_SMOOTH;
import com.google.common.collect.Lists;
import dev.resent.Resent;
import dev.resent.ui.ClickGUI;
import dev.resent.ui.PreGUI;
import dev.resent.util.misc.W;
import java.io.IOException;
import java.io.InputStream;
@ -1406,7 +1407,7 @@ public class Minecraft implements IThreadListener {
}
if (this.gameSettings.keyBindClickGui.isPressed()) {
this.displayGuiScreen(new ClickGUI());
this.displayGuiScreen(new PreGUI());
}
while (this.gameSettings.keyBindDrop.isPressed()) {

View File

@ -1,5 +1,6 @@
package net.minecraft.client.renderer.entity;
import dev.resent.cosmetic.impl.CrystalWings;
import dev.resent.cosmetic.impl.TopHat;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.minecraft.client.entity.AbstractClientPlayer;
@ -59,6 +60,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 CrystalWings(this));
}
public ModelBiped getMainModel() {