addressed review comments

This commit is contained in:
Maxicarlos08 2023-09-18 18:29:59 +02:00
parent fd42b3f767
commit 91284565a2
No known key found for this signature in database
3 changed files with 29 additions and 47 deletions

View File

@ -10,7 +10,10 @@ command-uuid-username-unavailable = Unable to determine username for UUID { $uu
command-no-sudo = It's rude to impersonate people
command-entity-dead = Entity { $entity } is dead!
command-error-while-evaluating-request = Encountered an error while validating the request: { $error }
command-give-inventory-full = Player inventory full. Gave { $given } of { $total } items.
command-give-inventory-full = Player inventory full. Gave { $given ->
[1] only one
*[other] { $given }
} of { $total } items.
command-invalid-item = Invalid item: { $item }
command-invalid-block-kind = Invalid block kind { $kind }
command-nof-entities-at-least = Number of entities should be at least 1
@ -39,27 +42,16 @@ command-revoke-build = Permission to build in { $area } revoked
command-revoke-build-all = Your build permissions have been revoked.
command-revoked-all-build = All build permissions revoked
command-no-buid-perms = You do not have permission to build.
command-set-build-status = Toggled build mode { $mode ->
*[true] on
[false] off
}. { $mode ->
*[true] { $persistent ->
[true] Experimental terrain persistence is enabled. The server will attempt to persist
changes, but this is not guaranteed.
*[false] Changes will not be persisted when a chunk unloads.
}
}
command-set-build-mode-off = Toggled build mode off.
command-set-build-mode-on-persistent = Toggled build mode on. Experimental terrain persistence is enabled. The server will attempt to persist changes, but this is not guaranteed
command-set-build-mode-on-unpersistent = Toggled build mode on. Changes will not be persisted when a chunk unloads.
command-invalid-alignment = Invalid alignment: { $alignment }
command-kit-not-enough-slots = Inventory doesn't have enough slots
command-lantern-unequiped = Please equip a lantern first
command-lantern-adjusted = You adjusted { $color ->
*[false] flame strength.
[true] flame strength and color.
}
command-explosion-power-invalid = Explosion power { $more ->
*[true] must
[false] mustn't
} be more than { $power }
command-lantern-adjusted-strength = You adjusted flame strength.
command-lantern-adjusted-strength-color = You adjusted flame strength and color.
command-explosion-power-too-high = Explosion power mustn't be more than { $power }
command-explosion-power-too-low = Explosion power must be more than { $power }
# Note: Do not translate "confirm" here
command-disconnectall-confirm = Please run the command again with the second argument of "confirm" to confirm that
you really want to disconnect all players from the server

View File

@ -2100,16 +2100,16 @@ fn handle_build(
{
can_build.enabled ^= true;
let msg = Content::localized_with_args("command-set-build-status", [
("mode", can_build.enabled.to_string()),
(
"persistent",
server
.settings()
.experimental_terrain_persistence
.to_string(),
),
]);
let msg = Content::localized(
match (
can_build.enabled,
server.settings().experimental_terrain_persistence,
) {
(false, _) => "command-set-build-mode-off",
(true, false) => "command-set-build-mode-on-unpersistent",
(true, true) => "command-set-build-mode-on-persistent",
},
);
let chat_msg = ServerGeneral::server_msg(ChatType::CommandInfo, msg);
if client != target {
@ -2642,9 +2642,7 @@ fn handle_lantern(
client,
ServerGeneral::server_msg(
ChatType::CommandInfo,
Content::localized_with_args("command-lantern-adjusted", [(
"color", "true",
)]),
Content::localized("command-lantern-adjusted-strength-color"),
),
)
} else {
@ -2652,9 +2650,7 @@ fn handle_lantern(
client,
ServerGeneral::server_msg(
ChatType::CommandInfo,
Content::localized_with_args("command-lantern-adjusted", [(
"color", "false",
)]),
Content::localized("command-lantern-adjusted-strength"),
),
)
}
@ -2681,19 +2677,13 @@ fn handle_explosion(
if power > MAX_POWER {
return Err(Content::localized_with_args(
"command-explosion-power-invalid",
[
("power", MAX_POWER.to_string()),
("more", "false".to_string()),
],
"command-explosion-power-too-high",
[("power", MAX_POWER.to_string())],
));
} else if power <= 0.0 {
} else if power <= MIN_POWER {
return Err(Content::localized_with_args(
"command-explosion-power-invalid",
[
("power", MIN_POWER.to_string()),
("more", "true".to_string()),
],
"command-explosion-power-too-low",
[("power", MIN_POWER.to_string())],
));
}

View File

@ -1667,7 +1667,7 @@ pub fn handle_teleport_to_position(server: &mut Server, entity: EcsEntity, posit
.state
.position_mut(entity, true, |pos| pos.0 = position)
{
warn!("Failed to teleport entity: {error:?}");
warn!(?error, "Failed to teleport entity");
}
}