use of mcjty.rftoolscontrol.api.parameters.Tuple in project RFToolsControl by McJty.
the class TupleEditor method writeConstantValue.
@Override
protected void writeConstantValue(ParameterValue value) {
if (value == null || value.getValue() == null) {
fieldX.setText("");
fieldY.setText("");
} else {
Tuple tuple = (Tuple) value.getValue();
try {
fieldX.setText(Integer.toString(tuple.getX()));
fieldY.setText(Integer.toString(tuple.getY()));
} catch (Exception e) {
fieldX.setText("");
fieldY.setText("");
}
}
}
use of mcjty.rftoolscontrol.api.parameters.Tuple 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.api.parameters.Tuple in project RFToolsControl by McJty.
the class TupleEditor method readConstantValue.
@Override
protected ParameterValue readConstantValue() {
Integer x = parseIntSafe(fieldX.getText());
Integer y = parseIntSafe(fieldY.getText());
return ParameterValue.constant(new Tuple(x == null ? 0 : x, y == null ? 0 : y));
}
Aggregations