|
|
@ -3,6 +3,7 @@ package net.brokenmoon.redcontrol.blockentities;
|
|
|
|
import com.simon816.j65el02.device.RedBus;
|
|
|
|
import com.simon816.j65el02.device.RedBus;
|
|
|
|
import net.brokenmoon.redcontrol.RedControl;
|
|
|
|
import net.brokenmoon.redcontrol.RedControl;
|
|
|
|
import net.brokenmoon.redcontrol.api.Emulator;
|
|
|
|
import net.brokenmoon.redcontrol.api.Emulator;
|
|
|
|
|
|
|
|
import net.brokenmoon.redcontrol.api.RCWorldBus;
|
|
|
|
import net.minecraft.block.BlockState;
|
|
|
|
import net.minecraft.block.BlockState;
|
|
|
|
import net.minecraft.util.math.BlockPos;
|
|
|
|
import net.minecraft.util.math.BlockPos;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
import net.minecraft.world.World;
|
|
|
@ -15,7 +16,7 @@ public class CpuEntity extends Peripheral{
|
|
|
|
public int i = 0;
|
|
|
|
public int i = 0;
|
|
|
|
|
|
|
|
|
|
|
|
public boolean notTicked = true;
|
|
|
|
public boolean notTicked = true;
|
|
|
|
public Emulator core;
|
|
|
|
public Emulator core = new Emulator(new RedBus());
|
|
|
|
private Path bootloader;
|
|
|
|
private Path bootloader;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -31,10 +32,6 @@ public class CpuEntity extends Peripheral{
|
|
|
|
|
|
|
|
|
|
|
|
public static void tick(World world, BlockPos pos, BlockState state, CpuEntity be) {
|
|
|
|
public static void tick(World world, BlockPos pos, BlockState state, CpuEntity be) {
|
|
|
|
if(be.notTicked) {
|
|
|
|
if(be.notTicked) {
|
|
|
|
if (be.core == null){
|
|
|
|
|
|
|
|
RedControl.LOGGER.info("Making CpuEntity");
|
|
|
|
|
|
|
|
be.core = new Emulator(new RedBus());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
be.reset();
|
|
|
|
be.reset();
|
|
|
|
be.notTicked = false;
|
|
|
|
be.notTicked = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -86,4 +83,12 @@ public class CpuEntity extends Peripheral{
|
|
|
|
public void update() {
|
|
|
|
public void update() {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void setBus(RCWorldBus bus){
|
|
|
|
|
|
|
|
this.bus = bus.getRedBus();
|
|
|
|
|
|
|
|
this.core.setBus(this.bus);
|
|
|
|
|
|
|
|
this.bus.setPeripheral(id, this);
|
|
|
|
|
|
|
|
this.worldBus = bus;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|