Search in sources :

Example 1 with IParamReaderBuf

use of buildcraft.api.statements.StatementManager.IParamReaderBuf in project BuildCraft by BuildCraft.

the class StatementTypeParam method readFromBuffer.

@Override
public IStatementParameter readFromBuffer(PacketBufferBC buffer) throws IOException {
    if (buffer.readBoolean()) {
        String tag = buffer.readString();
        IParamReaderBuf reader = StatementManager.paramsBuf.get(tag);
        if (reader == null) {
            throw new InvalidInputDataException("Unknown paramater type " + tag);
        }
        return reader.readFromBuf(buffer);
    } else {
        return null;
    }
}
Also used : InvalidInputDataException(buildcraft.api.core.InvalidInputDataException) IParamReaderBuf(buildcraft.api.statements.StatementManager.IParamReaderBuf)

Aggregations

InvalidInputDataException (buildcraft.api.core.InvalidInputDataException)1 IParamReaderBuf (buildcraft.api.statements.StatementManager.IParamReaderBuf)1