Create Crafts & Additions

Create Crafts & Additions

61M Downloads

Cannot read precise speedometer values

Closed this issue ยท 0 comments

commented

Describe the bug
traying to read a value form a speedometer doesn't work if the value is below one, from what I can tell this is because the value is being cast to an integer, this is especially an issue when you want to reead somethhing the is moving very slowly. As a side note it reads as a negative value, though I have no idea if the behaviour is intentional or not.

https://github.com/mrh0/createaddition/blob/1.20.1/src/main/java/com/mrh0/createaddition/compat/computercraft/DigitalAdapterPeripheral.java#L133

To Reproduce
Steps to reproduce the behavior:

Connect a speedometer to a motor using cods/chain drives to reduce the speed to a vaery small value (e.g. 0.5)

da = peripheral.wrap("top")
speed = da.getKineticSpeed("top")

output will always read as zero.

Image

Image

Additional context

  • Mod version: neoforge-1.21.1-1.4.2
  • Forge version: neoforge 21.1.170
  • Create version: 1.21.1-6.0.4