mojira.dev
MC-279601

"test.error.expected_entity_at_pos" translation is missing

The GameTestHelper#findClosestEntity uses the "test.error.expected_entity_at_pos" translation, which is missing on Crowdin.

(The decompiled GameTestHelper#findClosestEntity method)

public <E extends Entity> E findClosestEntity(EntityType<E> entityType, int i, int j, int k, double d) {
  List<E> list = this.findEntities(entityType, i, j, k, d);
  if (list.isEmpty()) {
    throw this.assertionException("test.error.expected_entity_at_pos", entityType.getDescription(), i, j, k);
  } else if (list.size() > 1) {
    throw this.assertionException("test.error.too_many_entities", entityType.toShortString(), i, j, k, list.size());
  } else {
    Vec3 vec3 = this.absoluteVec(new Vec3((double)i, (double)j, (double)k));
    list.sort((entity, entity2) -> {
      double dxx = entity.position().distanceTo(vec3);
      double e = entity2.position().distanceTo(vec3);
      return Double.compare(dxx, e);
    });
    return (E)list.get(0);
  }
}

On Crowdin, there is the "test.error.expected_entity_around" translation, which is missing in the game code. Both strings have the same 4 variables (entity type, X, Y, Z). It seems that one of these was not updated before releasing the snapshot.

Possible solution 1:
Replace the string in the GameTestHelper#findClosestEntity from "test.error.expected_entity_at_pos" to "test.error.expected_entity_around".

Possible solution 2:
Rename the "test.error.expected_entity_around" translation key to "test.error.expected_entity_at_pos".

Comments 2

I am able to reproduce the reported behavior. While testing, I found another string in en_us.json that is also not used anywhere in the code: test.error.invalid_block_type

MrMuskle, that's should get a separate report.

Jerozgen

slicedlime

Community Consensus

Platform

Normal

Text

25w03a

25w04a

Retrieved