Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/generated/resources/assets/gtceu/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -3903,6 +3903,7 @@
"gtceu.top.buffer_bound_pos": "%s :Z '%s :ʎ '%s :X - o⟘ punoᗺ",
"gtceu.top.buffer_not_bound": "punoᗺ ʎןʇuǝɹɹnƆ ʇoN ɹǝɟɟnᗺ",
"gtceu.top.cable_amperage": " :ǝbɐɹǝdɯⱯ",
"gtceu.top.cable_overloaded": "ɹ§%s%% :⅁NI⟘ⱯƎHᴚƎΛOㄣ§",
"gtceu.top.cable_voltage": " :ǝbɐʇןoΛ",
"gtceu.top.convert_eu": "ɹ§ƎℲɔ§ >- ɹ§∩Ǝǝ§ buıʇɹǝʌuoƆ",
"gtceu.top.convert_fe": "ɹ§∩Ǝǝ§ >- ɹ§ƎℲɔ§ buıʇɹǝʌuoƆ",
Expand Down
1 change: 1 addition & 0 deletions src/generated/resources/assets/gtceu/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -3903,6 +3903,7 @@
"gtceu.top.buffer_bound_pos": "Bound To - X: %s, Y: %s, Z: %s",
"gtceu.top.buffer_not_bound": "Buffer Not Currently Bound",
"gtceu.top.cable_amperage": "Amperage: ",
"gtceu.top.cable_overloaded": "§4OVERHEATING: %s%%§r",
"gtceu.top.cable_voltage": "Voltage: ",
"gtceu.top.convert_eu": "Converting §eEU§r -> §cFE§r",
"gtceu.top.convert_fe": "Converting §cFE§r -> §eEU§r",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class CableBlockEntity extends PipeBlockEntity<Insulation, WireProperties

@SideOnly(Side.CLIENT)
private GTOverheatParticle particle;
private static final int meltTemp = 3000;
public static final int meltTemp = 3000;

private final EnumMap<Direction, EnergyNetHandler> handlers = new EnumMap<>(Direction.class);
private final PerTickLongCounter maxVoltageCounter = new PerTickLongCounter();
Expand Down Expand Up @@ -207,7 +207,7 @@ public long getMaxVoltage() {
return getNodeData().getVoltage();
}

public int getDefaultTemp() {
public static int getDefaultTemp() {
return 293;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ private static void initWailaLikeLang(RegistrateLangProvider provider) {
provider.add("gtceu.top.allow_output_input", "Allow Input");
provider.add("gtceu.top.cable_voltage", "Voltage: ");
provider.add("gtceu.top.cable_amperage", "Amperage: ");
provider.add("gtceu.top.cable_overloaded", "§4OVERHEATING: %s%%§r");
provider.add("gtceu.top.exhaust_vent_direction", "Exhaust Vent: %s");
provider.add("gtceu.top.exhaust_vent_blocked", "Blocked");
provider.add("gtceu.top.machine_mode", "Machine Mode: ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public void appendTooltip(ITooltip iTooltip, BlockAccessor blockAccessor, IPlugi
var tag = data.getCompound("cableData");
long voltage = tag.getLong("currentVoltage");
double amperage = tag.getDouble("currentAmperage");
int temperature = tag.getInt("temperature");
iTooltip.add(Component.translatable("gtceu.top.cable_voltage"));
if (voltage != 0) {
iTooltip.append(Component.literal(GTValues.VNF[GTUtil.getTierByVoltage(voltage)]));
Expand All @@ -42,7 +43,13 @@ public void appendTooltip(ITooltip iTooltip, BlockAccessor blockAccessor, IPlugi
if (amperage != 0) {
iTooltip.append(Component.literal(DECIMAL_FORMAT_1F.format(amperage) + "A / "));
}
iTooltip.append(Component.literal(DECIMAL_FORMAT_1F.format(tag.getDouble("maxAmperage")) + "A"));
iTooltip.append(Component.translatable("gtceu.jade.amperage_use",
DECIMAL_FORMAT_1F.format(tag.getDouble("maxAmperage"))));

if (temperature != CableBlockEntity.getDefaultTemp()) {
iTooltip.add(Component.translatable("gtceu.top.cable_overloaded", progressToFailure(
CableBlockEntity.getDefaultTemp(), CableBlockEntity.getMeltTemp(), temperature)));
}
}
}
}
Expand All @@ -59,6 +66,7 @@ public void appendServerData(CompoundTag compoundTag, BlockAccessor blockAccesso
cableData.putLong("currentVoltage", cable.getCurrentMaxVoltage());
cableData.putDouble("maxAmperage", cable.getMaxAmperage());
cableData.putDouble("currentAmperage", cable.getAverageAmperage());
cableData.putInt("temperature", cable.getTemperature());
data.put("cableData", cableData);
}
}
Expand All @@ -69,4 +77,8 @@ public void appendServerData(CompoundTag compoundTag, BlockAccessor blockAccesso
public ResourceLocation getUid() {
return GTCEu.id("cable_info");
}

private int progressToFailure(int base, int melt, int current) {
return (100 * (current - base)) / (melt - base);
}
}
Loading