pothud
This commit is contained in:
parent
6403cea7cf
commit
9aa3a90ac3
24399
javascript/classes.js
24399
javascript/classes.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,6 @@
|
||||||
package dev.resent.cosmetic.impl;
|
package dev.resent.cosmetic.impl;
|
||||||
|
|
||||||
import dev.resent.cosmetic.CosmeticBase;
|
import dev.resent.cosmetic.CosmeticBase;
|
||||||
import dev.resent.cosmetic.CosmeticController;
|
|
||||||
import dev.resent.cosmetic.CosmeticModelBase;
|
import dev.resent.cosmetic.CosmeticModelBase;
|
||||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||||
|
@ -11,15 +10,14 @@ import net.minecraft.entity.Entity;
|
||||||
|
|
||||||
public class Glasses extends CosmeticBase {
|
public class Glasses extends CosmeticBase {
|
||||||
private final GlassesRenderer glassesModel;
|
private final GlassesRenderer glassesModel;
|
||||||
|
|
||||||
public Glasses(RenderPlayer renderPlayer) {
|
public Glasses(RenderPlayer renderPlayer) {
|
||||||
super(renderPlayer);
|
super(renderPlayer);
|
||||||
this.glassesModel = new GlassesRenderer(renderPlayer);
|
this.glassesModel = new GlassesRenderer(renderPlayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(AbstractClientPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float headYaw, float headPitch, float scale) {
|
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();
|
GlStateManager.pushMatrix();
|
||||||
if(player.isSneaking()) {
|
if(player.isSneaking()) {
|
||||||
GlStateManager.translate(0, 0.225, 0);
|
GlStateManager.translate(0, 0.225, 0);
|
||||||
|
@ -29,10 +27,9 @@ public class Glasses extends CosmeticBase {
|
||||||
this.glassesModel.render(player, limbSwing, limbSwingAmount, ageInTicks, headYaw, headPitch, scale);
|
this.glassesModel.render(player, limbSwing, limbSwingAmount, ageInTicks, headYaw, headPitch, scale);
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public class GlassesRenderer extends CosmeticModelBase{
|
public class GlassesRenderer extends CosmeticModelBase{
|
||||||
|
|
||||||
ModelRenderer Glasses1;
|
ModelRenderer Glasses1;
|
||||||
ModelRenderer Glasses2;
|
ModelRenderer Glasses2;
|
||||||
ModelRenderer Glasses3;
|
ModelRenderer Glasses3;
|
||||||
|
@ -42,12 +39,12 @@ public class Glasses extends CosmeticBase {
|
||||||
ModelRenderer Glasses7;
|
ModelRenderer Glasses7;
|
||||||
ModelRenderer Glasses8;
|
ModelRenderer Glasses8;
|
||||||
ModelRenderer Glasses9;
|
ModelRenderer Glasses9;
|
||||||
|
|
||||||
public GlassesRenderer(RenderPlayer player) {
|
public GlassesRenderer(RenderPlayer player) {
|
||||||
super(player);
|
super(player);
|
||||||
textureWidth = 64;
|
textureWidth = 64;
|
||||||
textureHeight = 32;
|
textureHeight = 32;
|
||||||
|
|
||||||
Glasses1 = new ModelRenderer(this, 0, 0);
|
Glasses1 = new ModelRenderer(this, 0, 0);
|
||||||
Glasses1.addBox(0F, 0F, 0F, 4, 2, 1);
|
Glasses1.addBox(0F, 0F, 0F, 4, 2, 1);
|
||||||
Glasses1.setRotationPoint(-5F, -3F, -5F);
|
Glasses1.setRotationPoint(-5F, -3F, -5F);
|
||||||
|
@ -106,6 +103,7 @@ public class Glasses extends CosmeticBase {
|
||||||
|
|
||||||
public void render(Entity entityIn, float limbSwing, float limbSwingAmout, float ageInTicks, float headYaw, float headPitch, float scale) {
|
public void render(Entity entityIn, float limbSwing, float limbSwingAmout, float ageInTicks, float headYaw, float headPitch, float scale) {
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
|
GlStateManager.translate(0, -1, 0);
|
||||||
GlStateManager.color(0, 0, 0);
|
GlStateManager.color(0, 0, 0);
|
||||||
Glasses1.render(scale);
|
Glasses1.render(scale);
|
||||||
Glasses2.render(scale);
|
Glasses2.render(scale);
|
||||||
|
@ -116,10 +114,11 @@ public class Glasses extends CosmeticBase {
|
||||||
Glasses7.render(scale);
|
Glasses7.render(scale);
|
||||||
Glasses8.render(scale);
|
Glasses8.render(scale);
|
||||||
Glasses9.render(scale);
|
Glasses9.render(scale);
|
||||||
|
GlStateManager.color(1, 1, 1);
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||||
{
|
{
|
||||||
model.rotateAngleX = x;
|
model.rotateAngleX = x;
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
package dev.resent.module.impl.hud;
|
package dev.resent.module.impl.hud;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
import dev.resent.module.base.Category;
|
import dev.resent.module.base.Category;
|
||||||
import dev.resent.module.base.RenderModule;
|
import dev.resent.module.base.RenderModule;
|
||||||
import java.util.Collection;
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiIngame;
|
import net.minecraft.client.gui.GuiIngame;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.potion.Potion;
|
import net.minecraft.potion.Potion;
|
||||||
import net.minecraft.potion.PotionEffect;
|
import net.minecraft.potion.PotionEffect;
|
||||||
|
@ -29,38 +33,39 @@ public class PotionHUD extends RenderModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void draw() {
|
public void draw() {
|
||||||
|
int i = 80;
|
||||||
|
int i2 = 16;
|
||||||
Collection<PotionEffect> collection = mc.thePlayer.getActivePotionEffects();
|
Collection<PotionEffect> collection = mc.thePlayer.getActivePotionEffects();
|
||||||
if (!collection.isEmpty()) {
|
if (!collection.isEmpty()) {
|
||||||
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
GlStateManager.disableLighting();
|
||||||
|
GlStateManager.enableAlpha();
|
||||||
int l = 33;
|
int l = 33;
|
||||||
if (collection.size() > 5) l = 132 / (collection.size() - 1);
|
if (collection.size() > 5)
|
||||||
|
l = 132 / (collection.size() - 1);
|
||||||
for (PotionEffect potioneffect : mc.thePlayer.getActivePotionEffects()) {
|
for (PotionEffect potioneffect : mc.thePlayer.getActivePotionEffects()) {
|
||||||
Potion potion = Potion.potionTypes[potioneffect.getPotionID()];
|
Potion potion = Potion.potionTypes[potioneffect.getPotionID()];
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
GlStateManager.disableLighting();
|
|
||||||
GlStateManager.enableAlpha();
|
|
||||||
|
|
||||||
if (potion.hasStatusIcon()) {
|
if (potion.hasStatusIcon()) {
|
||||||
GuiIngame guiIngame = new GuiIngame(mc);
|
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/inventory.png"));
|
||||||
mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/inventory.png"));
|
|
||||||
int i3 = potion.getStatusIconIndex();
|
int i3 = potion.getStatusIconIndex();
|
||||||
//GlStateManager.tryBlendFuncSeparate(1, 1, 1, 0);
|
GuiIngame guiIngame = new GuiIngame(mc);
|
||||||
guiIngame.drawTexturedModalRect(getX() + 1, getY() + i2 - 14, 0 + i3 % 8 * 18, 198 + i3 / 8 * 18, 18, 18);
|
guiIngame.drawTexturedModalRect(getX() + 21 - 20, getY() + i2 - 14, 0 + i3 % 8 * 18, 198 + i3 / 8 * 18, 18, 18);
|
||||||
}
|
}
|
||||||
|
|
||||||
String s1 = I18n.format(potion.getName(), new Object[0]);
|
String s1 = I18n.format(potion.getName(), new Object[0]);
|
||||||
if (potioneffect.getAmplifier() == 1) {
|
if (potioneffect.getAmplifier() == 1) {
|
||||||
s1 = s1 + I18n.format("enchantment.level.2", new Object[0]);
|
s1 = String.valueOf(String.valueOf(s1)) + " " + I18n.format("enchantment.level.2", new Object[0]);
|
||||||
} else if (potioneffect.getAmplifier() == 2) {
|
} else if (potioneffect.getAmplifier() == 2) {
|
||||||
s1 = s1 + I18n.format("enchantment.level.3", new Object[0]);
|
s1 = String.valueOf(String.valueOf(s1)) + " " + I18n.format("enchantment.level.3", new Object[0]);
|
||||||
} else if (potioneffect.getAmplifier() == 3) {
|
} else if (potioneffect.getAmplifier() == 3) {
|
||||||
s1 = s1 + I18n.format("enchantment.level.4", new Object[0]);
|
s1 = String.valueOf(String.valueOf(s1)) + " " + I18n.format("enchantment.level.4", new Object[0]);
|
||||||
}
|
}
|
||||||
|
mc.fontRendererObj.drawString(s1, (getX() + 21), (getY() + i2 - 14), 16777215, true);
|
||||||
mc.fontRendererObj.drawString(s1, (getX() + 21), (getY() + i2 - 14), -1, true);
|
|
||||||
String s2 = Potion.getDurationString(potioneffect);
|
String s2 = Potion.getDurationString(potioneffect);
|
||||||
mc.fontRendererObj.drawString(s2, (getX() + 21), (getY() + i2 + 10 - 14), -1, true);
|
mc.fontRendererObj.drawString(s2, (getX() + 21), (getY() + i2 + 10 - 14), 8355711, true);
|
||||||
i2 += l;
|
i2 += l;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
super.draw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user