|
|
@ -1,16 +1,13 @@
|
|
|
|
package net.brokenmoon.redcontrol.blockentities;
|
|
|
|
package net.brokenmoon.redcontrol.blockentities;
|
|
|
|
|
|
|
|
|
|
|
|
import com.simon816.j65el02.device.ByteDiskDriver;
|
|
|
|
|
|
|
|
import com.simon816.j65el02.device.DiskDriver;
|
|
|
|
import com.simon816.j65el02.device.DiskDriver;
|
|
|
|
import com.simon816.j65el02.device.FileDiskDriver;
|
|
|
|
|
|
|
|
import net.brokenmoon.redcontrol.RedControl;
|
|
|
|
import net.brokenmoon.redcontrol.RedControl;
|
|
|
|
|
|
|
|
import net.brokenmoon.redcontrol.api.DriveFactory;
|
|
|
|
import net.minecraft.block.BlockState;
|
|
|
|
import net.minecraft.block.BlockState;
|
|
|
|
import net.minecraft.block.entity.BlockEntityType;
|
|
|
|
|
|
|
|
import net.minecraft.util.math.BlockPos;
|
|
|
|
import net.minecraft.util.math.BlockPos;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.net.URI;
|
|
|
|
import java.nio.ByteBuffer;
|
|
|
|
import java.nio.ByteBuffer;
|
|
|
|
import java.nio.file.Paths;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class DriveEntity extends Peripheral{
|
|
|
|
public class DriveEntity extends Peripheral{
|
|
|
|
|
|
|
|
|
|
|
@ -27,7 +24,7 @@ public class DriveEntity extends Peripheral{
|
|
|
|
public DriveEntity(BlockPos pos, BlockState state) {
|
|
|
|
public DriveEntity(BlockPos pos, BlockState state) {
|
|
|
|
super(RedControl.DRIVE_BLOCK_ENTITY, pos, state, 2);
|
|
|
|
super(RedControl.DRIVE_BLOCK_ENTITY, pos, state, 2);
|
|
|
|
|
|
|
|
|
|
|
|
this.driver = new ByteDiskDriver(RedControl.images.get("basic.img"), "Forth", "FORTH");
|
|
|
|
this.driver = DriveFactory.INSTANCE.createDriver(URI.create("img://basic.img"),"Basic","BASIC");
|
|
|
|
this.buffer = ByteBuffer.allocateDirect(SECTOR_SIZE);
|
|
|
|
this.buffer = ByteBuffer.allocateDirect(SECTOR_SIZE);
|
|
|
|
byte[] name = driver.getDriveName();
|
|
|
|
byte[] name = driver.getDriveName();
|
|
|
|
byte[] serial = driver.getDriveSerial();
|
|
|
|
byte[] serial = driver.getDriveSerial();
|
|
|
@ -115,7 +112,7 @@ public class DriveEntity extends Peripheral{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
this.command = 0xff;
|
|
|
|
this.command = 0xff;
|
|
|
|
e.printStackTrace();
|
|
|
|
//e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|