ComputerCraft icon indicating copy to clipboard operation
ComputerCraft copied to clipboard

Add additional method stubs to the TurtlePlayer

Open SquidDev opened this issue 7 years ago • 2 comments

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.

SquidDev avatar Apr 16 '18 08:04 SquidDev

This seems smart. Why did nobody do this before?

JasonTheKitten avatar Apr 16 '18 14:04 JasonTheKitten

@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.

SquidDev avatar Apr 16 '18 15:04 SquidDev