mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-01-12 23:37:29 +01:00
Made LuaFunction's final
This commit is contained in:
parent
56a1210fff
commit
7d47fdcd06
6 changed files with 19 additions and 23 deletions
|
@ -24,34 +24,34 @@ public class DisplayLinkPeripheral extends PeripheralBase<DisplayLinkTileEntity>
|
|||
}
|
||||
|
||||
@LuaFunction
|
||||
public void setCursorPos(int x, int y) {
|
||||
public final void setCursorPos(int x, int y) {
|
||||
cursorX.set(x - 1);
|
||||
cursorY.set(y - 1);
|
||||
}
|
||||
|
||||
@LuaFunction
|
||||
public Object[] getCursorPos() {
|
||||
public final Object[] getCursorPos() {
|
||||
return new Object[] {cursorX.get() + 1, cursorY.get() + 1};
|
||||
}
|
||||
|
||||
@LuaFunction(mainThread = true)
|
||||
public Object[] getSize() {
|
||||
public final Object[] getSize() {
|
||||
DisplayTargetStats stats = tile.activeTarget.provideStats(new DisplayLinkContext(tile.getLevel(), tile));
|
||||
return new Object[]{stats.maxRows(), stats.maxColumns()};
|
||||
}
|
||||
|
||||
@LuaFunction
|
||||
public boolean isColor() {
|
||||
public final boolean isColor() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@LuaFunction
|
||||
public boolean isColour() {
|
||||
public final boolean isColour() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@LuaFunction
|
||||
public void write(String text) {
|
||||
public final void write(String text) {
|
||||
ListTag tag = tile.getSourceConfig().getList(TAG_KEY, Tag.TAG_STRING);
|
||||
|
||||
int x = cursorX.get();
|
||||
|
@ -74,7 +74,7 @@ public class DisplayLinkPeripheral extends PeripheralBase<DisplayLinkTileEntity>
|
|||
}
|
||||
|
||||
@LuaFunction
|
||||
public void clearLine() {
|
||||
public final void clearLine() {
|
||||
ListTag tag = tile.getSourceConfig().getList(TAG_KEY, Tag.TAG_STRING);
|
||||
|
||||
if (tag.size() > cursorY.get())
|
||||
|
@ -86,14 +86,14 @@ public class DisplayLinkPeripheral extends PeripheralBase<DisplayLinkTileEntity>
|
|||
}
|
||||
|
||||
@LuaFunction
|
||||
public void clear() {
|
||||
public final void clear() {
|
||||
synchronized (tile) {
|
||||
tile.getSourceConfig().put(TAG_KEY, new ListTag());
|
||||
}
|
||||
}
|
||||
|
||||
@LuaFunction(mainThread = true)
|
||||
public void update() {
|
||||
public final void update() {
|
||||
tile.tickSource();
|
||||
}
|
||||
|
||||
|
|
|
@ -18,17 +18,17 @@ public class SequencedGearshiftPeripheral extends PeripheralBase<SequencedGearsh
|
|||
}
|
||||
|
||||
@LuaFunction(mainThread = true)
|
||||
public void rotate(IArguments arguments) throws LuaException {
|
||||
public final void rotate(IArguments arguments) throws LuaException {
|
||||
runInstruction(arguments, SequencerInstructions.TURN_ANGLE);
|
||||
}
|
||||
|
||||
@LuaFunction(mainThread = true)
|
||||
public void move(IArguments arguments) throws LuaException {
|
||||
public final void move(IArguments arguments) throws LuaException {
|
||||
runInstruction(arguments, SequencerInstructions.TURN_DISTANCE);
|
||||
}
|
||||
|
||||
@LuaFunction
|
||||
public boolean isRunning() {
|
||||
public final boolean isRunning() {
|
||||
return !this.tile.isIdle();
|
||||
}
|
||||
|
||||
|
|
|
@ -17,12 +17,12 @@ public class SpeedControllerPeripheral extends PeripheralBase<SpeedControllerTil
|
|||
}
|
||||
|
||||
@LuaFunction(mainThread = true)
|
||||
public void setTargetSpeed(int speed) {
|
||||
public final void setTargetSpeed(int speed) {
|
||||
this.targetSpeed.setValue(speed);
|
||||
}
|
||||
|
||||
@LuaFunction
|
||||
public float getTargetSpeed() {
|
||||
public final float getTargetSpeed() {
|
||||
return this.targetSpeed.getValue();
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ public class SpeedGaugePeripheral extends PeripheralBase<SpeedGaugeTileEntity> {
|
|||
}
|
||||
|
||||
@LuaFunction
|
||||
public float getSpeed() {
|
||||
public final float getSpeed() {
|
||||
return this.tile.getSpeed();
|
||||
}
|
||||
|
||||
|
|
|
@ -4,11 +4,9 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import com.simibubi.create.compat.computercraft.CreateLuaTable;
|
||||
import com.simibubi.create.compat.computercraft.peripherals.PeripheralBase;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import com.simibubi.create.compat.computercraft.CreateLuaTable;
|
||||
import com.simibubi.create.content.logistics.trains.entity.Train;
|
||||
import com.simibubi.create.content.logistics.trains.management.edgePoint.station.GlobalStation;
|
||||
import com.simibubi.create.content.logistics.trains.management.edgePoint.station.StationTileEntity;
|
||||
|
@ -32,7 +30,7 @@ public class StationPeripheral extends PeripheralBase<StationTileEntity> {
|
|||
}
|
||||
|
||||
@LuaFunction(mainThread = true)
|
||||
public void setSchedule(IArguments arguments) throws LuaException {
|
||||
public final void setSchedule(IArguments arguments) throws LuaException {
|
||||
GlobalStation station = tile.getStation();
|
||||
if (station == null)
|
||||
throw new LuaException("train station does not exist");
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.simibubi.create.compat.computercraft.peripherals;
|
||||
|
||||
import com.simibubi.create.compat.computercraft.peripherals.PeripheralBase;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import com.simibubi.create.content.contraptions.relays.gauge.StressGaugeTileEntity;
|
||||
|
@ -15,12 +13,12 @@ public class StressGaugePeripheral extends PeripheralBase<StressGaugeTileEntity>
|
|||
}
|
||||
|
||||
@LuaFunction
|
||||
public float getStress() {
|
||||
public final float getStress() {
|
||||
return this.tile.getNetworkStress();
|
||||
}
|
||||
|
||||
@LuaFunction
|
||||
public float getStressCapacity() {
|
||||
public final float getStressCapacity() {
|
||||
return this.tile.getNetworkCapacity();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue