Search in sources :

Example 1 with BlockSpec

use of com.microsoft.Malmo.Schemas.BlockSpec in project malmo by Microsoft.

the class AgentQuitFromTouchingBlockTypeImplementation method parseParameters.

@Override
public boolean parseParameters(Object params) {
    if (params == null || !(params instanceof AgentQuitFromTouchingBlockType))
        return false;
    this.params = (AgentQuitFromTouchingBlockType) params;
    // Flatten all the possible block type names for ease of matching later:
    this.blockTypeNames = new ArrayList<String>();
    for (BlockSpec bs : this.params.getBlock()) {
        for (BlockType bt : bs.getType()) {
            Block b = Block.getBlockFromName(bt.value());
            this.blockTypeNames.add(b.getUnlocalizedName().toLowerCase());
        }
    }
    return true;
}
Also used : BlockType(com.microsoft.Malmo.Schemas.BlockType) AgentQuitFromTouchingBlockType(com.microsoft.Malmo.Schemas.AgentQuitFromTouchingBlockType) Block(net.minecraft.block.Block) BlockSpec(com.microsoft.Malmo.Schemas.BlockSpec) AgentQuitFromTouchingBlockType(com.microsoft.Malmo.Schemas.AgentQuitFromTouchingBlockType)

Aggregations

AgentQuitFromTouchingBlockType (com.microsoft.Malmo.Schemas.AgentQuitFromTouchingBlockType)1 BlockSpec (com.microsoft.Malmo.Schemas.BlockSpec)1 BlockType (com.microsoft.Malmo.Schemas.BlockType)1 Block (net.minecraft.block.Block)1