1
0
Fork 0

item retexture - most fixed

This commit is contained in:
Sen 2025-07-29 14:10:19 +02:00
parent ff4b41acc1
commit 9c4287dcad
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
132 changed files with 757 additions and 746 deletions

View file

@ -168,7 +168,7 @@ import common.util.HitPosition;
import common.util.IntHashMap;
import common.util.LongHashMap;
import common.util.ParticleType;
import common.util.TextColor;
import common.util.Color;
import common.util.Util;
import common.util.Var;
import common.util.HitPosition.ObjectType;
@ -1036,7 +1036,7 @@ public class Client implements IThreadListener {
private int drawStat(int x, int y, String name, int value, int max, int color) {
int w = (int)(246.0f * (float)value / (float)max);
Drawing.drawTextboxRight(name, x + 250, y, 0x3f000000);
Drawing.drawTextbox(String.format(TextColor.GREEN + "%d " + TextColor.GRAY + "/ " + TextColor.NEON + "%d", value, max), x, y, 0x3f000000);
Drawing.drawTextbox(String.format(Color.GREEN + "%d " + Color.GRAY + "/ " + Color.NEON + "%d", value, max), x, y, 0x3f000000);
Drawing.drawRectBorder(x, y + 20, 250, 10, 0xff000000, 0xff202020, 0xffcfcfcf, 0xff6f6f6f);
Drawing.drawGradient(x + 2 + 246 - w, y + 20 + 2, w, 6, color | 0xff000000, Util.mixColor(color | 0xff000000, 0xff000000));
return y + 40;
@ -1085,10 +1085,10 @@ public class Client implements IThreadListener {
Entity ent;
if(this.player != null && now - status.getValue() < 10000L && (ent = this.player.worldObj.getEntityByID(status.getKey())) instanceof EntityLiving) {
EntityLiving entity = (EntityLiving)ent;
String s = entity.getName() + TextColor.GRAY + " [" +
String s = entity.getName() + Color.GRAY + " [" +
EntityLiving.getHealthColor(entity.getHealth(), entity.getMaxHealth()) +
entity.getHealth() + TextColor.GRAY + " / " + EntityLiving.getMaxHpColor(entity.getMaxHealth()) +
entity.getMaxHealth() + TextColor.GRAY + "]";
entity.getHealth() + Color.GRAY + " / " + EntityLiving.getMaxHpColor(entity.getMaxHealth()) +
entity.getMaxHealth() + Color.GRAY + "]";
Drawing.drawTextboxCentered(s, x, y, 0x3f000000);
Drawing.drawRectBorder(x - 200, y + 20, 400, 10, 0xff000000, 0xff202020, 0xffcfcfcf, 0xff6f6f6f);
Drawing.drawGradient(x - 200 + 2, y + 20 + 2, (int)(396.0f * ((float)entity.getHealth() / (float)entity.getMaxHealth())), 6, entity.getColor() | 0xff000000, Util.mixColor(entity.getColor() | 0xff000000, 0xff000000));
@ -1105,8 +1105,8 @@ public class Client implements IThreadListener {
for(StatusEffect effect : this.player.getEffects()) {
Effect potion = effect.getPotion();
int color = potion.getColor();
String name = (potion.isBadEffect() ? TextColor.ORANGE : TextColor.ACID) + effect.getEffectName();
String desc = TextColor.NEON + effect.getDurationString();
String name = (potion.isBadEffect() ? Color.ORANGE : Color.ACID) + effect.getEffectName();
String desc = Color.NEON + effect.getDurationString();
Drawing.drawRectBorder(x, y, 250, Font.YGLYPH + 6, 0xff000000, 0xff202020, 0xffcfcfcf, 0xff6f6f6f);
Drawing.drawGradient(x + 2, y + 2, effect.isInfinite() ? 246 : ((int)(246.0f * ((float)effect.getRemaining() / (float)effect.getDuration()))), Font.YGLYPH + 2, color | 0xff000000, Util.mixColor(color | 0xff000000, 0xff000000));
Drawing.drawText(name, x + 4, y + 3, 0xffffffff);
@ -1128,16 +1128,16 @@ public class Client implements IThreadListener {
y = this.fbY - 40 - stats * 40;
int hp = entity.getHealth();
int max = entity.getMaxHealth();
y = this.drawStat(x, y, TextColor.RED + "Schaden", hp, max, 0xff0000);
y = this.drawStat(x, y, Color.RED + "Schaden", hp, max, 0xff0000);
if(absorb > 0)
y = this.drawStat(x, y, TextColor.YELLOW + "Schadenspuffer", absorb, 1024, 0xffff00);
y = this.drawStat(x, y, Color.YELLOW + "Schadenspuffer", absorb, 1024, 0xffff00);
if(entity instanceof EntityWaterNPC npc) {
int moist = npc.getMoisture();
int maxm = npc.getMaxMoisture();
y = this.drawStat(x, y, TextColor.BLUE + "Feuchtigkeit", moist, maxm, 0x4f4fff);
y = this.drawStat(x, y, Color.BLUE + "Feuchtigkeit", moist, maxm, 0x4f4fff);
}
if(armor > 0)
y = this.drawStat(x, y, TextColor.GRAY + "Rüstung", armor, 1024, 0x707070);
y = this.drawStat(x, y, Color.GRAY + "Rüstung", armor, 1024, 0x707070);
if(entity.vehicle instanceof EntityLiving living) {
int vh = living.getHealth();
int vhMax = living.getMaxHealth();
@ -1146,23 +1146,23 @@ public class Client implements IThreadListener {
if(entity.getManaPoints() > 0) {
int mana = entity.getManaPoints();
int maxm = entity.getMaxMana();
y = this.drawStat(x, y, TextColor.CYAN + "Mana", mana, maxm, 0x0000ff);
y = this.drawStat(x, y, Color.CYAN + "Mana", mana, maxm, 0x0000ff);
}
for(int z = 0; z < Energy.values().length; z++) {
Energy type = Energy.values()[z];
int energy = entity.getEnergy(type);
if(energy > 0) {
int emax = entity.getEnergyCap(type);
y = this.drawStat(x, y, TextColor.LIGHT_GRAY + type.display, energy, emax, entity.hasEnergyEffect(type) ? type.effect : type.color);
y = this.drawStat(x, y, Color.LIGHT_GRAY + type.display, energy, emax, entity.hasEnergyEffect(type) ? type.effect : type.color);
}
}
x = 40;
y = this.fbY - 40 - (this.player.isRidingHorse() && this.player.getHorseJumpPower() != 0.0f ? 2 : 1) * 40;
if(this.player.isRidingHorse() && this.player.getHorseJumpPower() != 0.0f) // {
y = this.drawBar(x, y, String.format(TextColor.NEON + "Sprungkraft: " + TextColor.CYAN + "%d %%", (int)(this.player.getHorseJumpPower() * 100.0f)),
y = this.drawBar(x, y, String.format(Color.NEON + "Sprungkraft: " + Color.CYAN + "%d %%", (int)(this.player.getHorseJumpPower() * 100.0f)),
this.player.getHorseJumpPower(), 0x4040ff);
y = this.drawBar(x, y, String.format(TextColor.ACID + "EXP: " + TextColor.GREEN + "Level %d, %d/%d", this.player.experienceLevel, (int)((float)this.player.xpBarCap() * this.player.experience), this.player.xpBarCap()), this.player.experience, 0x40ff40);
y = this.drawBar(x, y, String.format(Color.ACID + "EXP: " + Color.GREEN + "Level %d, %d/%d", this.player.experienceLevel, (int)((float)this.player.xpBarCap() * this.player.experience), this.player.xpBarCap()), this.player.experience, 0x40ff40);
}
GlState.bindTexture(0);
@ -1239,9 +1239,9 @@ public class Client implements IThreadListener {
this.renderLagometer();
}
else {
Drawing.drawText(String.format("%s%.2f" + TextColor.RESET + " %s [%s" + TextColor.RESET + "], %.3f ms, W %d x %d%s",
Drawing.drawText(String.format("%s%.2f" + Color.RESET + " %s [%s" + Color.RESET + "], %.3f ms, W %d x %d%s",
this.framecode(), this.framerate < 1.0f ? 1.0f / this.framerate : this.framerate, this.framerate < 1.0f ? "SPF" : "FPS",
this.vsync ? TextColor.DARK_GRAY + "VSYNC" : (this.syncLimited ? TextColor.GREEN + "" + this.syncLimit : TextColor.RED + "UNL"),
this.vsync ? Color.DARK_GRAY + "VSYNC" : (this.syncLimited ? Color.GREEN + "" + this.syncLimit : Color.RED + "UNL"),
(float)PerfSection.getTotal(false) / 1000.0f, this.fbRawX, this.fbRawY,
this.fullscreen ? " @ " + (this.vidMode == null ? "?" : this.vidMode.refresh()) + " Hz" : ""),
0, 0, 0xffffffff);
@ -1264,14 +1264,14 @@ public class Client implements IThreadListener {
String draw = String.format(
"OpenGL: %s\n" +
"Renderer: %s (%s)\n" +
"Bildrate: %s%.2f" + TextColor.RESET + " %s [%s" + TextColor.RESET + "], %.3f ms, W %d x %d%s\n" +
"Tickrate: %s%.2f" + TextColor.RESET + " %s [" + TextColor.GREEN + "%.1f" + TextColor.RESET + "], %.3f ms, E %d ms" +
"Bildrate: %s%.2f" + Color.RESET + " %s [%s" + Color.RESET + "], %.3f ms, W %d x %d%s\n" +
"Tickrate: %s%.2f" + Color.RESET + " %s [" + Color.GREEN + "%.1f" + Color.RESET + "], %.3f ms, E %d ms" +
"%s%s"
,
GL11.glGetString(GL11.GL_VERSION),
GL11.glGetString(GL11.GL_RENDERER), GL11.glGetString(GL11.GL_VENDOR),
this.framecode(), this.framerate < 1.0f ? 1.0f / this.framerate : this.framerate, this.framerate < 1.0f ? "SPF" : "FPS",
this.vsync ? TextColor.DARK_GRAY + "VSYNC" : (this.syncLimited ? TextColor.GREEN + "" + this.syncLimit : TextColor.RED + "UNL"),
this.vsync ? Color.DARK_GRAY + "VSYNC" : (this.syncLimited ? Color.GREEN + "" + this.syncLimit : Color.RED + "UNL"),
(float)PerfSection.getTotal(false) / 1000.0f, this.fbRawX, this.fbRawY,
this.fullscreen ? " @ " + (this.vidMode == null ? "?" : this.vidMode.refresh()) + " Hz" : "",
this.tpscode(), this.tickrate < 1.0f ? 1.0f / this.tickrate : this.tickrate,
@ -1856,7 +1856,7 @@ public class Client implements IThreadListener {
String.format("Richtung: %s (%.1f / %.1f)", dirStr,
ExtMath.wrapf(this.viewEntity.rotYaw), ExtMath.wrapf(this.viewEntity.rotPitch)) + "\n" +
String.format("Biom: %.2f K, N: %.2f K, D: %s (%s)", chunk.getTemperature(pos), chunk.getOffset(pos),
TextColor.stripCodes(this.world.dimension.getDisplay()),
Color.stripCodes(this.world.dimension.getDisplay()),
this.dimensionName) + "\n" +
"Licht: " + chunk.getLightSub(pos, 0) + " (" + chunk.getLight(LightType.SKY, pos) + " Himmel, "
+ chunk.getLight(LightType.BLOCK, pos) + " Blöcke, " + String.format(
@ -1905,7 +1905,7 @@ public class Client implements IThreadListener {
String.format("Position: %d %d %d", pos.getX(), pos.getY(), pos.getZ())
);
for(Entry<Property, Comparable> entry : block.getProperties().entrySet()) {
str.append("\n" + (block.getBlock().getSavedProperties().contains(entry.getKey()) ? TextColor.NEON : TextColor.LIGHT_GRAY) + entry.getKey().getName() + TextColor.RESET + ": " + (entry.getValue() instanceof Boolean bool ? (bool ? TextColor.GREEN : TextColor.RED) + "" + entry.getValue() + TextColor.RESET : entry.getValue()));
str.append("\n" + (block.getBlock().getSavedProperties().contains(entry.getKey()) ? Color.NEON : Color.LIGHT_GRAY) + entry.getKey().getName() + Color.RESET + ": " + (entry.getValue() instanceof Boolean bool ? (bool ? Color.GREEN : Color.RED) + "" + entry.getValue() + Color.RESET : entry.getValue()));
}
return str.toString();
@ -1936,7 +1936,7 @@ public class Client implements IThreadListener {
+ (entity.isWet() ? "W" : "") + (entity.canAttackWithItem() ? "A" : "")
+ (entity.passenger != null ? "H" : "") + (entity.vehicle != null ? "R" : "")
+ (entity.doesEntityNotTriggerPressurePlate() ? "L" : "") + "\n" +
(entity.hasCustomName() ? "Name: '" + TextColor.stripCodes(entity.getCustomNameTag()) + "'" : "Name: n/a")
(entity.hasCustomName() ? "Name: '" + Color.stripCodes(entity.getCustomNameTag()) + "'" : "Name: n/a")
;
}
@ -2286,7 +2286,7 @@ public class Client implements IThreadListener {
public void disconnected(String msg) {
Log.NETWORK.info("Getrennt: %s", msg);
this.unload(true);
this.show(new GuiInfo("Von Server getrennt", TextColor.RED + "Verbindung zum Server wurde getrennt\n\n" + TextColor.RESET + msg));
this.show(new GuiInfo("Von Server getrennt", Color.RED + "Verbindung zum Server wurde getrennt\n\n" + Color.RESET + msg));
}
@ -2397,13 +2397,13 @@ public class Client implements IThreadListener {
}, "Screenshot writer").start();
}
public TextColor framecode() {
return (this.framerate >= 59.0f) ? TextColor.GREEN : ((this.framerate >= 29.0f) ? TextColor.YELLOW : ((this.framerate >= 14.0f) ? TextColor.ORANGE : TextColor.RED));
public Color framecode() {
return (this.framerate >= 59.0f) ? Color.GREEN : ((this.framerate >= 29.0f) ? Color.YELLOW : ((this.framerate >= 14.0f) ? Color.ORANGE : Color.RED));
}
public TextColor tpscode() {
return (this.tickrate >= (((float)this.tickTarget / 1000.0f) - 1.0f)) ? TextColor.GREEN : ((this.tickrate >= (((float)this.tickTarget / 1000.0f) / 2.0f - 1.0f)) ? TextColor.YELLOW :
((this.tickrate >= (((float)this.tickTarget / 1000.0f) / 4.0f - 1.0f)) ? TextColor.ORANGE : TextColor.RED));
public Color tpscode() {
return (this.tickrate >= (((float)this.tickTarget / 1000.0f) - 1.0f)) ? Color.GREEN : ((this.tickrate >= (((float)this.tickTarget / 1000.0f) / 2.0f - 1.0f)) ? Color.YELLOW :
((this.tickrate >= (((float)this.tickTarget / 1000.0f) / 4.0f - 1.0f)) ? Color.ORANGE : Color.RED));
}
private void doTicks() {
@ -2490,10 +2490,10 @@ public class Client implements IThreadListener {
this.registerDebug(Keysym.H, "Hilfe zu Tastenkombinationen anzeigen", new DebugRunner() {
public void execute(Keysym key) {
String bind = Bind.CHEAT.getInput() == null ? "n/a" : Bind.CHEAT.getInput().getDisplay();
Client.this.show(new GuiInfo("Hilfe zu Tastenkombinationen", TextColor.DARK_GREEN + "" + Client.this.debug.size() + " Tastenkombinationen stehen zur Verfügung:\n" +
Client.this.show(new GuiInfo("Hilfe zu Tastenkombinationen", Color.DARK_GREEN + "" + Client.this.debug.size() + " Tastenkombinationen stehen zur Verfügung:\n" +
Util.buildLines(new Function<DebugFunction, String>() {
public String apply(DebugFunction func) {
return TextColor.CYAN + bind + TextColor.RED + "+" + TextColor.GREEN + func.key.getDisplay() + TextColor.GRAY + " - " + TextColor.YELLOW + func.help;
return Color.CYAN + bind + Color.RED + "+" + Color.GREEN + func.key.getDisplay() + Color.GRAY + " - " + Color.YELLOW + func.help;
}
}, Client.this.debug.values())));
}
@ -2623,7 +2623,7 @@ public class Client implements IThreadListener {
}
else {
this.lastUsed = System.currentTimeMillis();
Client.this.logFeed(TextColor.RED + "VORSICHT: Debug-Absturz nach mehrmaligem Drücken innerhalb einer Sekunde");
Client.this.logFeed(Color.RED + "VORSICHT: Debug-Absturz nach mehrmaligem Drücken innerhalb einer Sekunde");
}
}
});
@ -2862,9 +2862,9 @@ public class Client implements IThreadListener {
private void printVar(CVar cv) {
String values = cv.getValues();
this.logConsole("%s " + TextColor.NEON + "%s " + TextColor.DARK_GRAY + "[%s" + TextColor.DARK_GRAY + "]" + TextColor.GRAY + " = " + TextColor.WHITE + "%s " + TextColor.DARK_GRAY +
"[" + TextColor.GRAY + "D " + TextColor.CRIMSON + "%s" + TextColor.DARK_GRAY + "]%s", cv.getType(), cv.getCVarName(), cv.getCategory(), cv.format(), cv.getDefault(),
values != null ? " [" + TextColor.LIGHT_GRAY + values + TextColor.DARK_GRAY + "]" : "");
this.logConsole("%s " + Color.NEON + "%s " + Color.DARK_GRAY + "[%s" + Color.DARK_GRAY + "]" + Color.GRAY + " = " + Color.WHITE + "%s " + Color.DARK_GRAY +
"[" + Color.GRAY + "D " + Color.CRIMSON + "%s" + Color.DARK_GRAY + "]%s", cv.getType(), cv.getCVarName(), cv.getCategory(), cv.format(), cv.getDefault(),
values != null ? " [" + Color.LIGHT_GRAY + values + Color.DARK_GRAY + "]" : "");
}
public void exec(String line) {
@ -2872,7 +2872,7 @@ public class Client implements IThreadListener {
for(CVar cv : this.cvars.values()) {
printVar(cv);
}
this.logConsole(TextColor.GREEN + "CVARs insgesamt registriert: %d", this.cvars.size());
this.logConsole(Color.GREEN + "CVARs insgesamt registriert: %d", this.cvars.size());
return;
}
else if(line.startsWith("#")) {
@ -2890,7 +2890,7 @@ public class Client implements IThreadListener {
this.logConsole("%s -> %s", cv.getCVarName(), cv.format());
}
else {
this.logConsole(TextColor.RED + "Kann CVAR '%s' nicht auf '%s' setzen", cv.getCVarName(), value);
this.logConsole(Color.RED + "Kann CVAR '%s' nicht auf '%s' setzen", cv.getCVarName(), value);
}
return;
}
@ -2900,7 +2900,7 @@ public class Client implements IThreadListener {
}
public void reset() {
this.buffer = TextColor.NEON + "*** " + VERSION + " ***";
this.buffer = Color.NEON + "*** " + VERSION + " ***";
this.console.clear();
this.chat.clear();
this.feed.clear();
@ -3015,30 +3015,30 @@ public class Client implements IThreadListener {
private void drawPing(int x, int y, int ping) {
int bars;
TextColor color;
Color color;
if(ping < 0 || ping >= 20000) {
bars = 0;
color = ping < 0 ? TextColor.GRAY : TextColor.DARK_RED;
color = ping < 0 ? Color.GRAY : Color.DARK_RED;
}
else if(ping < 80) {
bars = ping < 50 ? 8 : 7;
color = TextColor.GREEN;
color = Color.GREEN;
}
else if(ping < 160) {
bars = ping < 120 ? 6 : 5;
color = TextColor.DARK_GREEN;
color = Color.DARK_GREEN;
}
else if(ping < 350) {
bars = ping < 220 ? 4 : 3;
color = TextColor.YELLOW;
color = Color.YELLOW;
}
else if(ping < 700) {
bars = ping < 500 ? 2 : 1;
color = TextColor.RED;
color = Color.RED;
}
else {
bars = 1;
color = TextColor.DARK_RED;
color = Color.DARK_RED;
}
Drawing.drawTextRight(color + (ping < 10000 ? String.format("%d", ping) + "ms" : String.format("%.1f", ((float)ping) / 1000.0f) + "s"), x - 18, y, 0xffffffff);
for(int z = 0; z < bars; z++) {