Skip to content

Commit

Permalink
Improve a bunch of the config comments. Add a "day + 1" MC time format.
Browse files Browse the repository at this point in the history
  • Loading branch information
maruohon committed Jul 20, 2019
1 parent 875ae3a commit aa036fe
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 26 deletions.
52 changes: 27 additions & 25 deletions src/main/java/fi/dy/masa/minihud/config/Configs.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ public static class Generic
public static final ConfigInteger DROPPED_CHUNKS_HASH_SIZE = new ConfigInteger("droppedChunksHashSize", -1, -1, Integer.MAX_VALUE, "The HashSet size for the chunk unload bucket calculation,\nif 'chunkUnloadBucketWithSize' is true.\nUse -1 for automatically getting the current value in single player.");
public static final ConfigInteger CHUNK_UNLOAD_BUCKET_OVERLAY_RADIUS = new ConfigInteger("chunkUnloadBucketOverlayChunkRadius", -1, "The radius of chunks to render the text for in the overlay.\nValid range: -1 - 40, where -1 = render distance");
public static final ConfigBoolean CHUNK_UNLOAD_BUCKET_WITH_SIZE = new ConfigBoolean("chunkUnloadBucketWithSize", false, "If enabled, uses the more accurate (but still experimental)\nchunk unload bucket calculations, taken from the Carpet mod");
public static final ConfigString COORDINATE_FORMAT_STRING = new ConfigString("coordinateFormat", "x: %.1f y: %.1f z: %.1f", "The format string for the coordinate line.\nNeeds to have three %f format strings!\nDefault: x: %.1f y: %.1f z: %.1f");
public static final ConfigString COORDINATE_FORMAT_STRING = new ConfigString("coordinateFormat", "x: %.1f y: %.1f z: %.1f", "The format string for the coordinate line ('infoCoordinates').\nNeeds to have three %f format strings!\nDefault: x: %.1f y: %.1f z: %.1f");
public static final ConfigString DATE_FORMAT_REAL = new ConfigString("dateFormatReal", "yyyy-MM-dd HH:mm:ss", "The format string for real time, see the Java SimpleDateFormat\nclass for the format patterns, if needed.");
public static final ConfigString DATE_FORMAT_MINECRAFT = new ConfigString("dateFormatMinecraft", "MC time: (day {DAY}) {HOUR}:{MIN}:xx", "The format string for the Minecraft time.\nThe supported placeholders are: {DAY}, {HOUR}, {MIN},;{SEC}");
public static final ConfigString DATE_FORMAT_MINECRAFT = new ConfigString("dateFormatMinecraft", "MC time: (day {DAY}) {HOUR}:{MIN}:xx", "The format string for the Minecraft time.\nThe supported placeholders are: {DAY_1}, {DAY}, {HOUR}, {MIN}, {SEC}.\n{DAY_1} starts the day counter from 1, {DAY} starts from 0.");
public static final ConfigBoolean DEBUG_RENDERER_PATH_MAX_DIST = new ConfigBoolean("debugRendererPathFindingEnablePointWidth", true, "If true, then the vanilla pathfinding debug renderer\nwill render the path point width boxes.");
public static final ConfigBoolean DONT_RESET_SEED_ON_DIMENSION_CHANGE = new ConfigBoolean("dontResetSeedOnDimensionChange", false, "Don't reset the world seed when just changing dimensions.\nSome mods may use per-dimension seeds, so by default the seed\nis reset every time the player changes dimensions.");
public static final ConfigBoolean ENABLED = new ConfigBoolean("enabled", true, "If true, the HUD will be rendered");
public static final ConfigBoolean ENABLED = new ConfigBoolean("enabled", true, "The main rendering toggle for all MiniHUD rendering");
public static final ConfigBoolean FIX_VANILLA_DEBUG_RENDERERS = new ConfigBoolean("enableVanillaDebugRendererFix", true, "If true, then the vanilla debug renderer OpenGL state is fixed.");
public static final ConfigDouble FONT_SCALE = new ConfigDouble("fontScale", 0.5, 0.0, 100.0, "Font scale factor. Default: 0.5\n");
public static final ConfigOptionList HUD_ALIGNMENT = new ConfigOptionList("hudAlignment", HudAlignment.TOP_LEFT, "The alignment of the HUD.");
public static final ConfigDouble FONT_SCALE = new ConfigDouble("fontScale", 0.5, 0.0, 100.0, "Font scale factor for the info line HUD. Default: 0.5\n");
public static final ConfigOptionList HUD_ALIGNMENT = new ConfigOptionList("hudAlignment", HudAlignment.TOP_LEFT, "The alignment of the info line HUD");
public static final ConfigBoolean LIGHT_LEVEL_COLORED_NUMBERS = new ConfigBoolean("lightLevelColoredNumbers", true, "Whether to use colored or white numbers\nfor the Light Level overlay numbers");
public static final ConfigOptionList LIGHT_LEVEL_MARKER_MODE = new ConfigOptionList("lightLevelMarkers", LightLevelMarkerMode.SQUARE, "Which type of colored marker to use in the\nLight Level overlay, if any");
public static final ConfigDouble LIGHT_LEVEL_MARKER_SIZE = new ConfigDouble("lightLevelMarkerSize", 0.84, 0.0, 1.0, "The size of the light level colored marker.\nRange: 0.0 - 1.0");
Expand All @@ -57,27 +57,27 @@ public static class Generic
public static final ConfigBoolean MAP_PREVIEW = new ConfigBoolean("mapPreview", false, "Enables rendering a preview of the map,\nwhen you hold shift while hovering over a map item");
public static final ConfigInteger MAP_PREVIEW_SIZE = new ConfigInteger("mapPreviewSize", 160, 16, 512, "The size of the rendered map previews");
public static final ConfigHotkey OPEN_CONFIG_GUI = new ConfigHotkey("openConfigGui", "H,C", "A hotkey to open the in-game Config GUI");
public static final ConfigBoolean REQUIRE_SNEAK = new ConfigBoolean("requireSneak", false, "Require the player to be sneaking to render the HUD");
public static final ConfigBoolean REQUIRE_SNEAK = new ConfigBoolean("requireSneak", false, "Require the player to be sneaking to render the info line HUD");
public static final ConfigHotkey REQUIRED_KEY = new ConfigHotkey("requiredKey", "", KeybindSettings.MODIFIER_INGAME_EMPTY, "Require holding this key to render the HUD");
public static final ConfigHotkey SET_DISTANCE_REFERENCE_POINT = new ConfigHotkey("setDistanceReferencePoint", "", "A htokey to store the player's current position\nas the reference point for the distance info line type");
public static final ConfigHotkey SET_DISTANCE_REFERENCE_POINT = new ConfigHotkey("setDistanceReferencePoint", "", "A hotkey to store the player's current position\nas the reference point for the distance info line type");
public static final ConfigHotkey SHAPE_EDITOR = new ConfigHotkey("shapeEditor", "", "Opens the Shape Editor GUI for the selected shape");
public static final ConfigBoolean SHULKER_BOX_PREVIEW = new ConfigBoolean("shulkerBoxPreview", false, "Enables rendering a preview of the Shulker Box contents,\nwhen you hold shift while hovering over a Shulker Box item");
public static final ConfigBoolean SHULKER_DISPLAY_BACKGROUND_COLOR = new ConfigBoolean("shulkerDisplayBgColor", true, "Enables tinting/coloring the Shulker Box display\nbackground texture with the dye color of the box");
public static final ConfigBoolean SHULKER_DISPLAY_REQUIRE_SHIFT = new ConfigBoolean("shulkerDisplayRequireShift", true, "Whether or not holding shift is required for the Shulker Box preview");
public static final ConfigInteger SLIME_CHUNK_OVERLAY_RADIUS = new ConfigInteger("slimeChunkOverlayRadius", -1, "The radius of chunks to render the slime chunk overlay in.\nValid range: 0 - 40, where -1 = render distance");
public static final ConfigInteger SLIME_CHUNK_OVERLAY_RADIUS = new ConfigInteger("slimeChunkOverlayRadius", -1, -1, 40, "The radius of chunks to render the slime chunk overlay in.\nValid range: -1 ... 40, where -1 = render distance");
public static final ConfigBoolean SORT_LINES_BY_LENGTH = new ConfigBoolean("sortLinesByLength", false, "Sort the lines by their text's length");
public static final ConfigBoolean SORT_LINES_REVERSED = new ConfigBoolean("sortLinesReversed", false, "Reverse the line sorting order");
public static final ConfigInteger SPAWNABLE_COLUMNS_OVERLAY_RADIUS = new ConfigInteger("spawnableColumnHeightsOverlayRadius", 40, 0, 128, "The radius (in blocks) to render the spawnable\ncolumn heights overlay in. Valid range: 0 - 128");
public static final ConfigInteger SPAWNABLE_COLUMNS_OVERLAY_RADIUS = new ConfigInteger("spawnableColumnHeightsOverlayRadius", 40, 0, 128, "The radius (in blocks) to render the spawnable\ncolumn heights overlay in. Valid range: 0 ... 128");
public static final ConfigInteger SPAWNABLE_SUB_CHUNK_CHECK_INTERVAL = new ConfigInteger("spawnableSubChunkCheckInterval", 20, 1, 10000, "The interval in game ticks for the spawnable sub-chunk heightmap checks");
public static final ConfigInteger SPAWNABLE_SUB_CHUNKS_OVERLAY_RADIUS = new ConfigInteger("spawnableSubChunksOverlayRadius", -1, "The radius of chunks to render the spawnable sub-chunks\noverlay in. Valid range: -1 - 40, where -1 = render distance");
public static final ConfigInteger TEXT_POS_X = new ConfigInteger("textPosX", 4, "Text X position from the screen edge (default: 4)");
public static final ConfigInteger TEXT_POS_Y = new ConfigInteger("textPosY", 4, "Text Y position from the screen edge (default: 4)");
public static final ConfigInteger TIME_DAY_DIVISOR = new ConfigInteger("timeDayDivisor", 24000, 1, Integer.MAX_VALUE, "The divisor value for the modulo of the day time");
public static final ConfigInteger TIME_TOTAL_DIVISOR = new ConfigInteger("timeTotalDivisor", 24000, 1, Integer.MAX_VALUE, "The divisor value for the modulo of the total world time");
public static final ConfigHotkey TOGGLE_KEY = new ConfigHotkey("toggleKey", "H", KeybindSettings.RELEASE_EXCLUSIVE, "The main toggle key");
public static final ConfigBoolean USE_CUSTOMIZED_COORDINATES = new ConfigBoolean("useCustomizedCoordinateFormat", true, "Use the customized coordinate format string");
public static final ConfigBoolean USE_FONT_SHADOW = new ConfigBoolean("useFontShadow", false, "Use font shadow");
public static final ConfigBoolean USE_TEXT_BACKGROUND = new ConfigBoolean("useTextBackground", true, "Use a solid background color behind the text");
public static final ConfigInteger SPAWNABLE_SUB_CHUNKS_OVERLAY_RADIUS = new ConfigInteger("spawnableSubChunksOverlayRadius", -1, -1, 40, "The radius of chunks to render the spawnable sub-chunks\noverlay in. Valid range: -1 ... 40, where -1 = render distance");
public static final ConfigInteger TEXT_POS_X = new ConfigInteger("textPosX", 4, "Info line text X position from the screen edge (default: 4)");
public static final ConfigInteger TEXT_POS_Y = new ConfigInteger("textPosY", 4, "Info line text Y position from the screen edge (default: 4)");
public static final ConfigInteger TIME_DAY_DIVISOR = new ConfigInteger("timeDayDivisor", 24000, 1, Integer.MAX_VALUE, "The divisor value for the modulo of the day time,\nused for 'infoTimeDayModulo' info line");
public static final ConfigInteger TIME_TOTAL_DIVISOR = new ConfigInteger("timeTotalDivisor", 24000, 1, Integer.MAX_VALUE, "The divisor value for the modulo of the total world time,\nused for 'infoTimeTotalModulo' info line");
public static final ConfigHotkey TOGGLE_KEY = new ConfigHotkey("toggleKey", "H", KeybindSettings.RELEASE_EXCLUSIVE, "The main rendering toggle key");
public static final ConfigBoolean USE_CUSTOMIZED_COORDINATES = new ConfigBoolean("useCustomizedCoordinateFormat", true, "Use the customized coordinate format string from 'coordinateFormat'");
public static final ConfigBoolean USE_FONT_SHADOW = new ConfigBoolean("useFontShadow", false, "Use font shadow for the info line HUD text");
public static final ConfigBoolean USE_TEXT_BACKGROUND = new ConfigBoolean("useTextBackground", true, "Use a solid background color behind the text\nfor the info line HUD text");

public static final ImmutableList<IConfigBase> OPTIONS = ImmutableList.of(
ENABLED,
Expand All @@ -98,22 +98,24 @@ public static class Generic
USE_FONT_SHADOW,
USE_TEXT_BACKGROUND,

TOGGLE_KEY,
OPEN_CONFIG_GUI,
REQUIRED_KEY,
SET_DISTANCE_REFERENCE_POINT,
SHAPE_EDITOR,
OPEN_CONFIG_GUI,
TOGGLE_KEY,

BLOCK_GRID_OVERLAY_MODE,
LIGHT_LEVEL_MARKER_MODE,
LIGHT_LEVEL_NUMBER_MODE,
HUD_ALIGNMENT,

BLOCK_GRID_OVERLAY_RADIUS,
CHUNK_UNLOAD_BUCKET_FONT_SCALE,
CHUNK_UNLOAD_BUCKET_OVERLAY_RADIUS,
COORDINATE_FORMAT_STRING,
DATE_FORMAT_REAL,
DATE_FORMAT_MINECRAFT,

BLOCK_GRID_OVERLAY_RADIUS,
CHUNK_UNLOAD_BUCKET_FONT_SCALE,
CHUNK_UNLOAD_BUCKET_OVERLAY_RADIUS,
DROPPED_CHUNKS_HASH_SIZE,
FONT_SCALE,
LIGHT_LEVEL_MARKER_SIZE,
Expand Down Expand Up @@ -146,7 +148,7 @@ public static class Generic
public static class Colors
{
public static final ConfigColor BLOCK_GRID_OVERLAY_COLOR = new ConfigColor("blockGrid", "0x80FFFFFF", "Color for the block grid overlay");
public static final ConfigColor DESPAWN_SPHERE_OVERLAY_COLOR = new ConfigColor("despawnSphereDefault", "0x60A04050", "Color for the despawn sphere overlay");
public static final ConfigColor DESPAWN_SPHERE_OVERLAY_COLOR = new ConfigColor("despawnSphereDefault", "0x60A04050", "Default color for the despawn sphere overlay.\nThe color can be changed for each Despawn Sphere via its configuration GUI.");
public static final ConfigColor LIGHT_LEVEL_MARKER_DARK = new ConfigColor("lightLevelMarkerDark", "0xFFFF4848", "The color for the spawnable spots marker");
public static final ConfigColor LIGHT_LEVEL_MARKER_LIT = new ConfigColor("lightLevelMarkerLit", "0xFFFFFF33", "The color for the safe (during day) spots marker");
public static final ConfigColor LIGHT_LEVEL_NUMBER_BLOCK_DARK = new ConfigColor("lightLevelNumberBlockDark", "0xFFC03030", "The color for the spawnable spots number of the block light value");
Expand All @@ -164,7 +166,7 @@ public static class Colors
public static final ConfigColor SPAWNABLE_CHUNKS_FIXED = new ConfigColor("spawnableChunkFixed", "0x40FF2090", "Color for the location-fixed spawnable chunks overlay");
public static final ConfigColor SPAWNABLE_CHUNKS_PLAYER = new ConfigColor("spawnableChunksPlayer", "0x40FF3030", "Color for the player-following spawnable chunks overlay");
public static final ConfigColor SPAWNABLE_COLUMNS_OVERLAY_COLOR = new ConfigColor("spawnableColumnHeights", "0xA0FF00FF", "Color for the spawnable sub-chunks overlay");
public static final ConfigColor TEXT_BACKGROUND_COLOR = new ConfigColor("textBackgroundColor", "0xA0505050", "Text background color");
public static final ConfigColor TEXT_BACKGROUND_COLOR = new ConfigColor("textBackgroundColor", "0xA0505050", "Info line HUD text background color");
public static final ConfigColor TEXT_COLOR = new ConfigColor("textColor", "0xFFE0E0E0", "Info line text color");

public static final ImmutableList<IConfigValue> OPTIONS = ImmutableList.of(
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/fi/dy/masa/minihud/event/RenderHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ else if (type == InfoToggle.TIME_WORLD_FORMATTED)
try
{
long timeDay = world.getWorldTime();
long day = (int) (timeDay / 24000) + 1;
long day = (int) (timeDay / 24000);
// 1 tick = 3.6 seconds in MC (0.2777... seconds IRL)
int dayTicks = (int) (timeDay % 24000);
int hour = (int) ((dayTicks / 1000) + 6) % 24;
Expand All @@ -316,6 +316,7 @@ else if (type == InfoToggle.TIME_WORLD_FORMATTED)

String str = Configs.Generic.DATE_FORMAT_MINECRAFT.getStringValue();
str = str.replace("{DAY}", String.format("%d", day));
str = str.replace("{DAY_1}",String.format("%d", day + 1));
str = str.replace("{HOUR}", String.format("%02d", hour));
str = str.replace("{MIN}", String.format("%02d", min));
str = str.replace("{SEC}", String.format("%02d", sec));
Expand Down

0 comments on commit aa036fe

Please sign in to comment.