请教,把这段 Java 的代码转为 Kotlin 的

如题。看起来是Java lumbda,可是 idea 转 kotlin 和自己转都很多错误,请教正确的转换写法:

public interface SheepShearCallback {
 
    Event<SheepShearCallback> EVENT = EventFactory.createArrayBacked(SheepShearCallback.class,
        (listeners) -> (player, sheep) -> {
            for (SheepShearCallback listener : listeners) {
                ActionResult result = listener.interact(player, sheep);
 
                if(result != ActionResult.PASS) {
                    return result;
                }
            }
 
        return ActionResult.PASS;
    });
 
    ActionResult interact(PlayerEntity player, SheepEntity sheep);
}

 

interface SheepShearCallback {
    fun interact(player: PlayerEntity?, sheep: SheepEntity?): ActionResult

    companion object {
        val EVENT: Event<SheepShearCallback> = EventFactory.createArrayBacked(
            SheepShearCallback::class.java
        ) { listeners ->
            label@{ player, sheep ->
                for (listener in listeners) {
                    val result: ActionResult = listener.interact(player, sheep)
                    if (result !== ActionResult.PASS) {
                        return@label result
                    }
                }
                ActionResult.PASS
            }
        }
    }
}