mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-12-16 10:28:05 +00:00
Handle managing computer inputs/outputs separatly
The Computer class currently has several resposiblities such as storing id/label, managing redstone/peirpherals, handling management of the computer (on/off/events) and updating the output. In order to simplify this a little bit, we move our IAPIEnvironment implementation into a separate file, and store all "world state" (redstone + peripherals) in there. While we still need to have some level of updating them within the main Computer instance, it's substantially simpler.
This commit is contained in:
@@ -9,6 +9,7 @@ package dan200.computercraft.shared.command;
|
||||
import com.google.common.collect.Sets;
|
||||
import dan200.computercraft.ComputerCraft;
|
||||
import dan200.computercraft.api.peripheral.IPeripheral;
|
||||
import dan200.computercraft.core.apis.IAPIEnvironment;
|
||||
import dan200.computercraft.core.computer.Computer;
|
||||
import dan200.computercraft.core.tracking.ComputerTracker;
|
||||
import dan200.computercraft.core.tracking.Tracking;
|
||||
@@ -126,7 +127,7 @@ public final class CommandComputerCraft extends CommandDelegate
|
||||
IPeripheral peripheral = computer.getPeripheral( i );
|
||||
if( peripheral != null )
|
||||
{
|
||||
table.row( header( "Peripheral " + Computer.s_sideNames[i] ), text( peripheral.getType() ) );
|
||||
table.row( header( "Peripheral " + IAPIEnvironment.SIDE_NAMES[i] ), text( peripheral.getType() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user