Skip to content

Commit

Permalink
update crowdin sync and apply()
Browse files Browse the repository at this point in the history
  • Loading branch information
sakura-ryoko committed Nov 22, 2024
1 parent bd763d2 commit 21cd14c
Show file tree
Hide file tree
Showing 48 changed files with 34,144 additions and 315 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ author = masa
mod_file_name = minihud-fabric

# Current mod version
mod_version = 0.32.52-sakura.2
mod_version = 0.32.52

# Required malilib version
malilib_version = 0.21.2-sakura.2
malilib_id = 21481c3732
malilib_version = 0.21.2
malilib_id = 51dd186f89

# Minecraft, Fabric Loader and API and mappings versions
minecraft_version_out = 1.21
Expand Down
258 changes: 130 additions & 128 deletions src/main/java/fi/dy/masa/minihud/config/Configs.java

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/main/java/fi/dy/masa/minihud/config/InfoToggle.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public enum InfoToggle implements IConfigInteger, IHotkeyTogglable
;

public static final ImmutableList<InfoToggle> VALUES = ImmutableList.copyOf(values());
private static final String translateNameBase = Reference.MOD_ID+".config.info_toggle";
private static final String INFO_KEY = Reference.MOD_ID+".config.info_toggle";

private final String name;
private final String comment;
Expand Down Expand Up @@ -222,7 +222,7 @@ public String getTranslatedName()

private static String buildTranslateName(String name, String type)
{
return translateNameBase + "." + type + "." + name;
return INFO_KEY + "." + type + "." + name;
}

@Override
Expand Down
15 changes: 13 additions & 2 deletions src/main/java/fi/dy/masa/minihud/config/RendererToggle.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import fi.dy.masa.malilib.util.InfoUtils;
import fi.dy.masa.malilib.util.StringUtils;
import fi.dy.masa.minihud.MiniHUD;
import fi.dy.masa.minihud.Reference;

import javax.annotation.Nullable;

Expand Down Expand Up @@ -70,7 +71,7 @@ public enum RendererToggle implements IHotkeyTogglable, IConfigNotifiable<IConfi
DEBUG_WORLDGEN ("debugWorldGenEnabled", "");

public static final ImmutableList<RendererToggle> VALUES = ImmutableList.copyOf(values());
private static final String translateNameBase = "minihud.config.render_toggle";
private static final String RENDER_KEY = Reference.MOD_ID+".config.render_toggle";

private final String name;
private final String comment;
Expand All @@ -86,6 +87,11 @@ public enum RendererToggle implements IHotkeyTogglable, IConfigNotifiable<IConfi
this(name, defaultHotkey, KeybindSettings.DEFAULT, buildTranslateName(name, "comment"), buildTranslateName(name, "prettyName"), buildTranslateName(name, "name"));
}

RendererToggle(String name, String defaultHotkey, String comment)
{
this(name, defaultHotkey, KeybindSettings.DEFAULT, comment, StringUtils.splitCamelCase(name), name);
}

RendererToggle(String name, String defaultHotkey, String comment, String prettyName)
{
this(name, defaultHotkey, KeybindSettings.DEFAULT, comment, prettyName, name);
Expand All @@ -101,6 +107,11 @@ public enum RendererToggle implements IHotkeyTogglable, IConfigNotifiable<IConfi
this(name, defaultHotkey, settings, buildTranslateName(name, "comment"), buildTranslateName(name, "prettyName"), buildTranslateName(name, "name"));
}

RendererToggle(String name, String defaultHotkey, KeybindSettings settings, String comment)
{
this(name, defaultHotkey, settings, comment, StringUtils.splitCamelCase(name), name);
}

RendererToggle(String name, String defaultHotkey, KeybindSettings settings, String comment, String prettyName)
{
this(name, defaultHotkey, settings, comment, prettyName, name);
Expand Down Expand Up @@ -233,7 +244,7 @@ public void resetToDefault()

private static String buildTranslateName(String name, String type)
{
return translateNameBase + "." + type + "." + name;
return RENDER_KEY + "." + type + "." + name;
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/fi/dy/masa/minihud/config/StructureToggle.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public enum StructureToggle
private final ConfigColor colorMain;
private final ConfigColor colorComponents;
private final IHotkey hotkey;
private static final String translateNameBase = Reference.MOD_ID+".config.structure_toggle";
private static final String STRUCTURES_KEY = Reference.MOD_ID+".config.structure_toggle";

StructureToggle(String name, String defaultHotkey, String colorMain, String colorComponents, String comment, String prettyName)
{
Expand Down Expand Up @@ -102,6 +102,6 @@ private static ImmutableList<ConfigColor> getColorConfigs()

private String buildTranslateName(String name, String type)
{
return translateNameBase + "." + type + "." + name;
return STRUCTURES_KEY + "." + type + "." + name;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public void reset(boolean isLogout)

private long getCacheTimeout()
{
return (long) (MathHelper.clamp(Configs.Generic.ENTITY_DATA_SYNC_CACHE_TIMEOUT.getDoubleValue(), 0.25f, 25.0f) * 1000L);
return (long) (MathHelper.clamp(Configs.Generic.ENTITY_DATA_SYNC_CACHE_TIMEOUT.getFloatValue(), 0.25f, 25.0f) * 1000L);
}

private void tickCache()
Expand Down Expand Up @@ -415,7 +415,7 @@ public void onPacketFailure()
else if (world.getBlockState(pos).getBlock() instanceof BlockEntityProvider)
{
if (!DataStorage.getInstance().hasIntegratedServer() &&
Configs.Generic.ENTITY_DATA_SYNC.getBooleanValue())
Configs.Generic.ENTITY_DATA_SYNC.getBooleanValue())
{
this.pendingBlockEntitiesQueue.add(pos);
}
Expand Down Expand Up @@ -446,7 +446,7 @@ else if (world.getBlockState(pos).getBlock() instanceof BlockEntityProvider)
}

if (!DataStorage.getInstance().hasIntegratedServer() &&
Configs.Generic.ENTITY_DATA_SYNC.getBooleanValue())
Configs.Generic.ENTITY_DATA_SYNC.getBooleanValue())
{
this.pendingEntitiesQueue.add(entityId);
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/fi/dy/masa/minihud/renderer/RenderUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,6 @@ else if (value == 0.0)
}
}

//public static void renderInventoryOverlay(RayTraceUtils.InventoryPreviewData inventory, DrawContext drawContext)
public static void renderInventoryOverlay(InventoryOverlay.Context inventory, DrawContext drawContext)
{
var screen = new InventoryOverlayScreen(inventory);
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/fi/dy/masa/minihud/util/RayTraceUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,16 @@ else if (trace.getType() == HitResult.Type.ENTITY)
lastEntityContext = Pair.of(entity.getId(), ctx);
return ctx;
}
// Non-Inventory/Empty Entity
else if (ctx != null &&
(ctx.type() == InventoryOverlay.InventoryRenderType.WOLF ||
ctx.type() == InventoryOverlay.InventoryRenderType.VILLAGER ||
ctx.type() == InventoryOverlay.InventoryRenderType.HORSE ||
ctx.type() == InventoryOverlay.InventoryRenderType.PLAYER))
{
lastEntityContext = Pair.of(entity.getId(), ctx);
return ctx;
}
else if (lastEntityContext != null && lastEntityContext.getLeft().equals(entity.getId()))
{
return lastEntityContext.getRight();
Expand Down
Loading

0 comments on commit 21cd14c

Please sign in to comment.