Yarn: EntitySize -> EntityDimensions

Created on 27 May 2019  ·  12Comments  ·  Source: FabricMC/yarn

EntityDimensions and all the fields there-in are indirectly confirmed by Mojang through string constants in their code:

   public String toString() {
      return "EntityDimensions w=" + this.width + ", h=" + this.height + ", fixed=" + this.constant;
   }

EntitySize -> EntityDimensions
EntitySize.constant -> EntityDimensions.constant

In addition to that, I would also change these two methods to be more in line with what they seem to be doing:

EntitySize.resizeable(...) -> EntityDimensions.changing(...)
EntitySize.constant(...) -> EntityDimensions.fixed(...)

Most helpful comment

EntitySize is wrong. The word "size" means only one value, and using it to refer to the dimensions of an object is bad English.

This class represents the dimensions of an entity (width, height), not the size of the entity (big, small). In fact, I think we already have another getEntitySize method somewhere (in the slime entity?) that returns a single number.

All 12 comments

It was decided after discussion that EntitySize better represents this data class. I believe constant is fine too, representing an immutable size. Imo fixed doesn't really imply that well.

I am personally not fond of having class names differ from the string representation, especially when the name is not particularly bad. It's just confusing to have blatant conflicting information.

this mojang is indeed a bad obe. we have dimensions for worlds already! but the rename from constant to fixed i support.

on a side note, i initially mapped this class before mojang overrode the toString method. we should add to the guideline about whether we are mapping to mojang names (which are sometimes incorrect or off) or correct names.

EntitySize is wrong. The word "size" means only one value, and using it to refer to the dimensions of an object is bad English.

This class represents the dimensions of an entity (width, height), not the size of the entity (big, small). In fact, I think we already have another getEntitySize method somewhere (in the slime entity?) that returns a single number.

This would be a good issue to get a PR going for

EntityDimensions should be good as long as we call it Dimensions instead of Dimension. See the second definition at https://www.dictionary.com/browse/dimension

Yes, Dimensions, since it's a pair of two dimensions (width and height).

EntityDimensions is literally what it says in the issue name and string...

If everyone is on the side of doing a PR I can get one going later today.

Abd yes, I mean to say Dimensions not Dimension.

Yup, go for it

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Sollace picture Sollace  ·  5Comments

Runemoro picture Runemoro  ·  4Comments

asiekierka picture asiekierka  ·  4Comments

Runemoro picture Runemoro  ·  4Comments

Boundarybreaker picture Boundarybreaker  ·  3Comments