Interface MinecartComparatorLogic<T extends net.minecraft.entity.vehicle.AbstractMinecartEntity>

Type Parameters:
T - the handled minecart type
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface MinecartComparatorLogic<T extends net.minecraft.entity.vehicle.AbstractMinecartEntity>
Provides custom comparator output for minecarts resting on detector rails.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    getComparatorValue(T minecart, net.minecraft.block.BlockState state, net.minecraft.util.math.BlockPos pos)
    Compute the comparator output of a detector rail when a minecart is resting on top of it.
  • Method Details

    • getComparatorValue

      int getComparatorValue(T minecart, net.minecraft.block.BlockState state, net.minecraft.util.math.BlockPos pos)
      Compute the comparator output of a detector rail when a minecart is resting on top of it. Called from DetectorRailBlock.getComparatorOutput(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos).
      Parameters:
      minecart - The minecart on the rail
      state - Block state of the rail
      pos - Position of the rail
      Returns:
      A redstone power value >= 0 to use, else a value < 0 to try the next minecart with a registered logic. If no logic chooses to provide a value, vanilla's logic is invoked.