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 additional method stubs to the TurtlePlayer #540

Open
wants to merge 1 commit into
base: master
from

Conversation

@SquidDev
Copy link
Contributor

@SquidDev SquidDev commented Apr 16, 2018

Forge's default fake player implementation doesn't override all methods which use the connection. As it is not set, we get an NPE and thus crash the server. We simply stub those methods out ourselves to prevent such an issue.

Closes #539

I'm going to look into submitting a similar PR into Forge, but it's worth adding it here first.

Forge's default fake player implementation doesn't override all methods
which use the connection. As it is not set, we get an NPE and thus crash
the server. We simply stub those methods out ourselves to prevent such
an issue.
@JasonTheKitten
Copy link

@JasonTheKitten JasonTheKitten commented Apr 16, 2018

This seems smart. Why did nobody do this before?

@SquidDev
Copy link
Contributor Author

@SquidDev SquidDev commented Apr 16, 2018

@JasonTheKitten Because they really shouldn't be needed - ideally these methods would be stubbed in Forge instead. The alternative would be to do what Plethora does and provide a "fake" connection, which just voids all packets.

I suspect it's not been done before as nobody has encountered such issues and thus a fix has not been needed.

ccserver pushed a commit to ccserver/ComputerCraft that referenced this pull request Sep 16, 2019
…akeplayer-stubs

Add additional method stubs to the TurtlePlayer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.