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

Add legacy support to use current methods for packets on 1.8 #59

Closed
JarvisCraft opened this issue Feb 25, 2019 · 3 comments
Closed

Add legacy support to use current methods for packets on 1.8 #59

JarvisCraft opened this issue Feb 25, 2019 · 3 comments

Comments

@JarvisCraft
Copy link

It seems that after some commits (due to update from legacy protocol of 47) some packets such as RelativeEntityMoveLook seem to be unavailable through PacketWrapper as the NMS-objects' signatures differ from those being now.
At current I am working on a PR to fix this issues whose idea is to check version (in optimized way) when using getters/setters and so allow current wrapper clases with their current signatures be used for older versions too.
This Issue's target is to ask whether this will (if done) be merged into PacketWrapper's master?

@JarvisCraft
Copy link
Author

To be fair, I am not a big fan of legacy support but it unfortunately happens that 1.8 is still very popular among server-owners.

@JarvisCraft
Copy link
Author

JarvisCraft commented Feb 25, 2019

At current it looks like this (WrapperPlayServerEntityTeleport)

public double getX() {
	return MINOR_VERSION > 8 ? handle.getDoubles().read(0) : handle.getIntegers().read(1) / 32.0D;
}

public void setX(double value) {
	if (MINOR_VERSION > 8) handle.getDoubles().write(0, value);
	else handle.getIntegers().write(1, (int) Math.floor(value * 32.0D));
}

@JarvisCraft
Copy link
Author

JarvisCraft commented Feb 26, 2019

Migrated to #60.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant