forked from Clones/Controlify
➕ Battery level warning + update SDL with macOS ARM support
This commit is contained in:
@ -0,0 +1,21 @@
|
||||
package dev.isxander.controlify.controller;
|
||||
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
|
||||
public enum BatteryLevel {
|
||||
EMPTY, LOW, MEDIUM, FULL, MAX,
|
||||
WIRED, UNKNOWN;
|
||||
|
||||
public MutableComponent getFriendlyName() {
|
||||
return Component.translatable("controlify.battery_level." + name().toLowerCase()).withStyle(
|
||||
switch (this) {
|
||||
case EMPTY, LOW -> ChatFormatting.RED;
|
||||
case MEDIUM -> ChatFormatting.YELLOW;
|
||||
case FULL, MAX -> ChatFormatting.GREEN;
|
||||
default -> ChatFormatting.WHITE;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user