Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Body position methods are inconsistently named #3791

Open
haykam821 opened this issue Feb 14, 2024 · 0 comments
Open

Body position methods are inconsistently named #3791

haykam821 opened this issue Feb 14, 2024 · 0 comments
Labels
bug Fixes or discusses a bug within the mappings

Comments

@haykam821
Copy link
Contributor

The Entity#offsetX and Entity#offsetY methods correspond to the Entity#getBodyY method but are not named as such:

public double offsetX(double widthScale) {
	return this.pos.x + this.getWidth() * widthScale;
}

public double getBodyY(double heightScale) {
	return this.pos.y + this.getHeight() * heightScale;
}

public double offsetZ(double widthScale) {
	return this.pos.z + this.getWidth() * widthScale;
}

Note that the Entity#getParticleX and Entity#getParticleZ methods correctly are not named like the Entity#getRandomBodyY method because their implementation differs:

public double getParticleX(double widthScale) {
	return this.offsetX((2.0 * this.random.nextDouble() - 1.0) * widthScale);
}

public double getRandomBodyY() {
	return this.getBodyY(this.random.nextDouble());
}

public double getParticleZ(double widthScale) {
	return this.offsetZ((2.0 * this.random.nextDouble() - 1.0) * widthScale);
}
@haykam821 haykam821 added the bug Fixes or discusses a bug within the mappings label Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes or discusses a bug within the mappings
Projects
None yet
Development

No branches or pull requests

1 participant