Skip to content

Commit

Permalink
replace hard coded strings part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
strubium committed Feb 19, 2024
1 parent ff8407d commit 1c9050b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void addProbeEntityInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlaye
probeInfo.progress(health, maxHealth, probeInfo.defaultProgressStyle().lifeBar(true).showText(false).width(150).height(10));

if (mode == ProbeMode.EXTENDED) {
probeInfo.text(LABEL + "Health: " + INFOIMP + health + " / " + maxHealth);
probeInfo.text(LABEL + "{*theoneprobe.probe.health_indicator*} " + INFOIMP + health + " / " + maxHealth);
}

if (armor > 0) {
Expand All @@ -79,7 +79,7 @@ public void addProbeEntityInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlaye
if (Tools.show(mode, config.getShowMobGrowth()) && entity instanceof EntityAgeable) {
int age = ((EntityAgeable) entity).getGrowingAge();
if (age < 0) {
probeInfo.text(LABEL + "Growing time: " + ((age * -1) / 20) + "s");
probeInfo.text(LABEL + "{*theoneprobe.probe.growing_time_indicator*} " + ((age * -1) / 20) + "s");
}
}

Expand Down Expand Up @@ -115,7 +115,7 @@ public void addProbeEntityInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlaye
.item(stack, new ItemStyle().width(16).height(16))
.text(INFO + stack.getDisplayName());
if (mode == ProbeMode.EXTENDED) {
probeInfo.text(LABEL + "Rotation: " + INFO + itemFrame.getRotation());
probeInfo.text(LABEL + "{*theoneprobe.probe.rotation_indicator*} " + INFO + itemFrame.getRotation());
}
} else {
probeInfo.text(LABEL + "Empty");
Expand All @@ -135,7 +135,7 @@ public void addProbeEntityInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlaye
if (username == null) {
probeInfo.text(WARNING + "Unknown owner");
} else {
probeInfo.text(LABEL + "Owned by: " + INFO + username);
probeInfo.text(LABEL + "{*theoneprobe.probe.owned_by_indicator*} " + INFO + username);
}
} else if (entity instanceof EntityTameable) {
probeInfo.text(LABEL + "Tameable");
Expand All @@ -146,16 +146,16 @@ public void addProbeEntityInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlaye
if (entity instanceof EntityHorse) {
double jumpStrength = ((EntityHorse) entity).getHorseJumpStrength();
double jumpHeight = -0.1817584952 * jumpStrength * jumpStrength * jumpStrength + 3.689713992 * jumpStrength * jumpStrength + 2.128599134 * jumpStrength - 0.343930367;
probeInfo.text(LABEL + "Jump height: " + INFO + dfCommas.format(jumpHeight));
probeInfo.text(LABEL + "{*theoneprobe.probe.jump_height_indicator*} " + INFO + dfCommas.format(jumpHeight));
IAttributeInstance iattributeinstance = ((EntityHorse) entity).getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED);
probeInfo.text(LABEL + "Speed: " + INFO + dfCommas.format(iattributeinstance.getAttributeValue()));
probeInfo.text(LABEL + "{*theoneprobe.probe.speed_indicator*} " + INFO + dfCommas.format(iattributeinstance.getAttributeValue()));
}
}

if (entity instanceof EntityWolf && ConfigSetup.showCollarColor) {
if (((EntityWolf) entity).isTamed()) {
EnumDyeColor collarColor = ((EntityWolf) entity).getCollarColor();
probeInfo.text(LABEL + "Collar: " + INFO + collarColor.getName());
probeInfo.text(LABEL + "{*theoneprobe.probe.collar_color_indicator*} " + INFO + collarColor.getName());
}
}
}
Expand Down
9 changes: 9 additions & 0 deletions src/main/resources/assets/theoneprobe/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ item.theoneprobe.creativeprobe.name=The Creative Probe
item.theoneprobe.probenote.name=The One Probe Read Me
theoneprobe.probe.enchanting_power=Enchanting Power:
theoneprobe.probe.tnt_fuse=TNT Fuse:

theoneprobe.probe.fuel_indicator=Fuel:
theoneprobe.probe.time_indicator=Time:
theoneprobe.probe.growing_time_indicator=Growing Time:
theoneprobe.probe.health_indicator=Health:
theoneprobe.probe.rotation_indicator=Rotation:
theoneprobe.probe.owned_by_indicator=Owned by:
theoneprobe.probe.jump_height_indicator=Jump height:
theoneprobe.probe.speed_indicator=Speed:
theoneprobe.probe.collar_color_indicator=Collar Color:


itemGroup.Probe=The One Probe

0 comments on commit 1c9050b

Please sign in to comment.