fix(C-01): review fixes — missing keys, duplicate, GPS shock i18n

- Add missing keephead_enabled/disabled translation keys (BUG-001)
- Remove duplicate gui.tiedup.close key at line 403 (RISK-004)
- Fix GPS shock: use null addon + send GPS_ZONE_VIOLATION separately (RISK-001)
This commit is contained in:
NotEvil
2026-04-15 14:08:41 +02:00
parent fa5cfb913c
commit c34bac11b0
2 changed files with 8 additions and 4 deletions

View File

@@ -56,7 +56,8 @@ public class PlayerShockCollar {
* Triggers a visual and auditory shock effect.
* Damage is applied (shock can kill).
*
* @param messageAddon Optional message addon for HUD (e.g., GPS violation)
* @param messageAddon Optional message addon for HUD (e.g., GPS violation).
* For translatable messages, prefer calling shockKidnapped() then sending the message separately.
* @param damage Shock damage amount
*/
public void shockKidnapped(@Nullable String messageAddon, float damage) {
@@ -100,7 +101,7 @@ public class PlayerShockCollar {
// HUD Message via SystemMessageManager
if (messageAddon != null) {
// Custom message with addon (e.g., GPS violation)
// Legacy addon path: append literal text to SLAVE_SHOCK message
MutableComponent msg = Component.translatable(
SystemMessageManager.getTranslationKey(MessageCategory.SLAVE_SHOCK)
).append(Component.literal(messageAddon));
@@ -197,9 +198,11 @@ public class PlayerShockCollar {
if (shouldShockGPS && gpsStackCopy != null) {
this.shockKidnapped(
" Return back to your allowed area!",
null,
GameConstants.DEFAULT_SHOCK_DAMAGE
);
// GPS-specific message (replaces hardcoded " Return back to your allowed area!")
SystemMessageManager.sendToPlayer(host.getPlayer(), MessageCategory.GPS_ZONE_VIOLATION);
warnOwnersGPSViolation(gpsStackCopy);
}
}