接口 ICapabilityInvalidationListener

函数接口:
这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。

@FunctionalInterface public interface ICapabilityInvalidationListener
A listener for block capability invalidation.

Register with ServerLevel.registerCapabilityListener(net.minecraft.core.BlockPos, net.neoforged.neoforge.capabilities.ICapabilityInvalidationListener).

The listener will be held by a weak reference, so it is important to keep a strong reference to it as long as you need it.

  • 方法概要

    修饰符和类型
    方法
    说明
    boolean
    Called when capabilities are invalidated.
  • 方法详细资料

    • onInvalidate

      boolean onInvalidate()
      Called when capabilities are invalidated.

      The listener should check that it is valid before reacting to this notification, and if it is not valid anymore, it should return false.

      返回:
      true if the listener is still valid, false if it should be removed from the list of listeners.