CreateMod/src/main/java/com/simibubi/create/compat/computercraft/SpeedGaugePeripheral.java
caelwarner 1420406ab7
Added Speedometer and Stressometer as peripherals
- Speedometer can get current speed
- Stressometer can get current stress level as well as network stress capacity
- Made GaugeTileEntity abstract
2022-10-03 16:38:12 -07:00

36 lines
766 B
Java

package com.simibubi.create.compat.computercraft;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import com.simibubi.create.content.contraptions.relays.gauge.SpeedGaugeTileEntity;
import dan200.computercraft.api.lua.LuaFunction;
import dan200.computercraft.api.peripheral.IPeripheral;
public class SpeedGaugePeripheral implements IPeripheral {
private final SpeedGaugeTileEntity tile;
public SpeedGaugePeripheral(SpeedGaugeTileEntity tile) {
this.tile = tile;
}
@LuaFunction
public float getSpeed() {
return this.tile.getSpeed();
}
@NotNull
@Override
public String getType() {
return "Create_Speedometer";
}
@Override
public boolean equals(@Nullable IPeripheral other) {
return this == other;
}
}