use of mcjty.rftoolscontrol.blocks.processor.ProcessorTileEntity in project RFToolsControl by McJty.
the class VectorArtScreenModule method getData.
@Override
public ModuleDataVectorArt getData(IScreenDataHelper h, World worldObj, long millis) {
World world = DimensionManager.getWorld(dim);
if (world == null) {
return null;
}
if (!WorldTools.chunkLoaded(world, coordinate)) {
return null;
}
Block block = world.getBlockState(coordinate).getBlock();
if (block != ModBlocks.processorBlock) {
return null;
}
TileEntity te = world.getTileEntity(coordinate);
if (te instanceof ProcessorTileEntity) {
ProcessorTileEntity processor = (ProcessorTileEntity) te;
return new ModuleDataVectorArt(processor.getGfxOps(), processor.getOrderedOps());
}
return null;
}
use of mcjty.rftoolscontrol.blocks.processor.ProcessorTileEntity in project RFToolsControl by McJty.
the class VectorArtScreenModule method mouseClick.
@Override
public void mouseClick(World world, int x, int y, boolean clicked, EntityPlayer player) {
int xoffset = 0;
if (x >= xoffset) {
if (coordinate.getY() != -1) {
if (!WorldTools.chunkLoaded(world, coordinate)) {
return;
}
Block block = world.getBlockState(coordinate).getBlock();
if (block != ModBlocks.processorBlock) {
return;
}
if (clicked) {
TileEntity te = world.getTileEntity(coordinate);
if (te instanceof ProcessorTileEntity) {
ProcessorTileEntity processor = (ProcessorTileEntity) te;
processor.signal(new Tuple(x, y + 7));
}
}
} else if (player != null) {
player.sendStatusMessage(new TextComponentString(TextFormatting.RED + "Module is not linked to a processor!"), false);
}
}
}
use of mcjty.rftoolscontrol.blocks.processor.ProcessorTileEntity in project RFToolsControl by McJty.
the class ConsoleScreenModule method getData.
@Override
public ModuleDataLog getData(IScreenDataHelper h, World worldObj, long millis) {
World world = DimensionManager.getWorld(dim);
if (world == null) {
return null;
}
if (!WorldTools.chunkLoaded(world, coordinate)) {
return null;
}
Block block = world.getBlockState(coordinate).getBlock();
if (block != ModBlocks.processorBlock) {
return null;
}
TileEntity te = world.getTileEntity(coordinate);
if (te instanceof ProcessorTileEntity) {
ProcessorTileEntity processor = (ProcessorTileEntity) te;
List<String> lastMessages = processor.getLastMessages(12);
return new ModuleDataLog(lastMessages);
}
return null;
}
use of mcjty.rftoolscontrol.blocks.processor.ProcessorTileEntity in project RFToolsControl by McJty.
the class NodeTileEntity method setPowerInput.
@Override
public void setPowerInput(int powered) {
if (powerLevel != powered) {
if (processor != null) {
TileEntity te = getWorld().getTileEntity(processor);
if (te instanceof ProcessorTileEntity) {
ProcessorTileEntity processorTileEntity = (ProcessorTileEntity) te;
processorTileEntity.redstoneNodeChange(prevIn, powered, node);
}
}
prevIn = powered;
}
super.setPowerInput(powered);
}
use of mcjty.rftoolscontrol.blocks.processor.ProcessorTileEntity in project RFToolsControl by McJty.
the class InteractionScreenModule method mouseClick.
@Override
public void mouseClick(World world, int x, int y, boolean clicked, EntityPlayer player) {
int xoffset;
if (!line.isEmpty()) {
xoffset = 80;
} else {
xoffset = 5;
}
if (x >= xoffset) {
if (coordinate.getY() != -1) {
if (!WorldTools.chunkLoaded(world, coordinate)) {
return;
}
Block block = world.getBlockState(coordinate).getBlock();
if (block != ModBlocks.processorBlock) {
return;
}
if (clicked) {
TileEntity te = world.getTileEntity(coordinate);
if (te instanceof ProcessorTileEntity) {
ProcessorTileEntity processor = (ProcessorTileEntity) te;
processor.signal(signal);
}
}
} else if (player != null) {
player.sendStatusMessage(new TextComponentString(TextFormatting.RED + "Module is not linked to a processor!"), false);
}
}
}
Aggregations