illucc / Kontraption

A addon for the Minecraft mod Mekanism that focuses on adding airships that are inspired by various space exploration/combat games (Space Engineers, Elite: Dangerous, etc)
Apache License 2.0
15 stars 8 forks source link

[pro tip] Use setRotation(0,0,0,0) with ComputerCraft to nuke unsuspecting servers! #12

Closed FemFruits closed 8 months ago

FemFruits commented 8 months ago

BEFORE REPORTING MAKE SURE:

Describe the bug When running "setRotation(0,0,0, 0)" on a computer from CC:Tweaked, it has the unfortunate 100% guarantee of ruining the life of whoever runs that server by destroying server TPS and resulting in a VS physics thread crash.

To Reproduce Steps to reproduce the behavior:

  1. Launch Minecraft
  2. Join an unsuspecting multiplayer server or create a single player world
  3. Create a VS ship with an advanced computer, gyro, energy cube and ship control interface
  4. Open up the computer, get the control interface to a variable so you can control it
  5. Enjoy the VS physics thread crashing as well as a lot of TPS lag
  6. Profit?

Expected behavior I expected the ship to rotate so it stays upright (although this might also not be correct as I don't still fully understand CC for this)

Screenshots/videos The ship I made image

Logs latest.log debug.log

Versions

Additional context Since this is a problem with CC:Tweaked support, I have added CC:Tweaked to the pack I was testing with.

illucc commented 8 months ago

Quaternion with a value of 0 0 0 0 is not a valid quaternion and that might be crashing the phys thread. I will implement a thing to prevent that from happening 👍. For now use 0 0 0 1 to set the ship rotation to 0

illucc commented 8 months ago

Fixed in https://github.com/illucc/Kontraption/commit/44e5cd0f5fb14c515702c5ab2d7ff29b26e62d07