obfuscate names, name color
This commit is contained in:
@@ -7,7 +7,7 @@ import org.saturnclient.saturnclient.config.Property;
|
|||||||
|
|
||||||
import net.minecraft.client.render.entity.state.LivingEntityRenderState;
|
import net.minecraft.client.render.entity.state.LivingEntityRenderState;
|
||||||
|
|
||||||
// todo: rendering modes, custom names, hide enemy nametags with §k
|
// todo: rendering modes, custom names
|
||||||
|
|
||||||
public class Nametags extends Module {
|
public class Nametags extends Module {
|
||||||
private static Property<Boolean> enabled = Property.bool(false);
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
@@ -16,6 +16,25 @@ public class Nametags extends Module {
|
|||||||
private static Property<Boolean> hostile = Property.bool(false);
|
private static Property<Boolean> hostile = Property.bool(false);
|
||||||
private static Property<Boolean> passive = Property.bool(false);
|
private static Property<Boolean> passive = Property.bool(false);
|
||||||
private static Property<Boolean> heartEmoji = Property.bool(true);
|
private static Property<Boolean> heartEmoji = Property.bool(true);
|
||||||
|
private static Property<Boolean> obfuscate = Property.bool(false);
|
||||||
|
private static Property<Integer> nameColor = Property.select(15,
|
||||||
|
"Black",
|
||||||
|
"Dark Blue",
|
||||||
|
"Dark Green",
|
||||||
|
"Dark Aqua",
|
||||||
|
"Dark Red",
|
||||||
|
"Dark Purple",
|
||||||
|
"Gold",
|
||||||
|
"Gray",
|
||||||
|
"Dark Gray",
|
||||||
|
"Blue",
|
||||||
|
"Green",
|
||||||
|
"Aqua",
|
||||||
|
"Red",
|
||||||
|
"Light Purple",
|
||||||
|
"Yellow",
|
||||||
|
"White"
|
||||||
|
);
|
||||||
private static Property<Integer> healthColor = Property.select(12,
|
private static Property<Integer> healthColor = Property.select(12,
|
||||||
"Black",
|
"Black",
|
||||||
"Dark Blue",
|
"Dark Blue",
|
||||||
@@ -52,7 +71,9 @@ public class Nametags extends Module {
|
|||||||
hostile.named("Hostile"),
|
hostile.named("Hostile"),
|
||||||
passive.named("Passive"),
|
passive.named("Passive"),
|
||||||
heartEmoji.named("Heart emoji"),
|
heartEmoji.named("Heart emoji"),
|
||||||
healthColor.named("Color")
|
obfuscate.named("Obfuscate enemy names"),
|
||||||
|
nameColor.named("Name color"),
|
||||||
|
healthColor.named("Health color")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,12 +98,17 @@ public class Nametags extends Module {
|
|||||||
|
|
||||||
if (health < 0f || maxHealth < 0f || health > maxHealth) return null;
|
if (health < 0f || maxHealth < 0f || health > maxHealth) return null;
|
||||||
|
|
||||||
String color = COLOR_CODES[healthColor.value];
|
String hpColor = COLOR_CODES[healthColor.value];
|
||||||
String heart = heartEmoji.value? " ❤" : "";
|
String color = COLOR_CODES[nameColor.value];
|
||||||
return state.customName.getString()
|
String heart = heartEmoji.value ? " ❤" : "";
|
||||||
+ " " + color + String.format("%.1f", hrs.saturn$getHealth())
|
String obf = obfuscate.value ? "§k" : "";
|
||||||
|
String reset = "§r";
|
||||||
|
|
||||||
|
String ret = color + obf + state.customName.getString()
|
||||||
|
+ reset + " " + hpColor + String.format("%.1f", hrs.saturn$getHealth())
|
||||||
+ " / " + String.format("%.1f", hrs.saturn$getMaxHealth()) + heart;
|
+ " / " + String.format("%.1f", hrs.saturn$getMaxHealth()) + heart;
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean shouldReplaceName() {
|
public static boolean shouldReplaceName() {
|
||||||
|
|||||||
Reference in New Issue
Block a user