接口 GameEventDispatcher
-
- 所有已知实现类:
SimpleGameEventDispatcher
public interface GameEventDispatcherA game event dispatcher dispatches game events to its listeners.- Mappings:
Namespace Name official cnuintermediary net/minecraft/class_5713named net/minecraft/world/event/listener/GameEventDispatcher
-
-
字段概要
字段 修饰符和类型 字段 说明 static GameEventDispatcherEMPTYAn unmodifiable, empty (non-operative) dispatcher.
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 voidaddListener(GameEventListener listener)Adds a listener to this dispatcher.voiddispatch(GameEvent event, @Nullable Entity entity, BlockPos pos)Dispatches an event to all the listeners in this dispatcher.booleanisEmpty()Returns whether this dispatcher has no listeners.voidremoveListener(GameEventListener listener)Removes a listener from this dispatcher if it is present.
-
-
-
字段详细资料
-
EMPTY
static final GameEventDispatcher EMPTY
An unmodifiable, empty (non-operative) dispatcher.- Mappings:
Namespace Name Mixin selector official aLcnu;a:Lcnu;intermediary field_28181Lnet/minecraft/class_5713;field_28181:Lnet/minecraft/class_5713;named EMPTYLnet/minecraft/world/event/listener/GameEventDispatcher;EMPTY:Lnet/minecraft/world/event/listener/GameEventDispatcher;
-
-
方法详细资料
-
isEmpty
boolean isEmpty()
Returns whether this dispatcher has no listeners.- Mappings:
Namespace Name Mixin selector official aLcnu;a()Zintermediary method_32942Lnet/minecraft/class_5713;method_32942()Znamed isEmptyLnet/minecraft/world/event/listener/GameEventDispatcher;isEmpty()Z
-
addListener
void addListener(GameEventListener listener)
Adds a listener to this dispatcher.- 参数:
listener- the listener to add- Mappings:
Namespace Name Mixin selector official aLcnu;a(Lcnv;)Vintermediary method_32944Lnet/minecraft/class_5713;method_32944(Lnet/minecraft/class_5714;)Vnamed addListenerLnet/minecraft/world/event/listener/GameEventDispatcher;addListener(Lnet/minecraft/world/event/listener/GameEventListener;)V
-
removeListener
void removeListener(GameEventListener listener)
Removes a listener from this dispatcher if it is present.- 参数:
listener- the listener to remove- Mappings:
Namespace Name Mixin selector official bLcnu;b(Lcnv;)Vintermediary method_32945Lnet/minecraft/class_5713;method_32945(Lnet/minecraft/class_5714;)Vnamed removeListenerLnet/minecraft/world/event/listener/GameEventDispatcher;removeListener(Lnet/minecraft/world/event/listener/GameEventListener;)V
-
dispatch
void dispatch(GameEvent event, @Nullable @Nullable Entity entity, BlockPos pos)
Dispatches an event to all the listeners in this dispatcher.- 参数:
event- the evententity- an entity related to the eventpos- the block position of the event- Mappings:
Namespace Name Mixin selector official aLcnu;a(Lcnt;Lasl;Lgb;)Vintermediary method_32943Lnet/minecraft/class_5713;method_32943(Lnet/minecraft/class_5712;Lnet/minecraft/class_1297;Lnet/minecraft/class_2338;)Vnamed dispatchLnet/minecraft/world/event/listener/GameEventDispatcher;dispatch(Lnet/minecraft/world/event/GameEvent;Lnet/minecraft/entity/Entity;Lnet/minecraft/util/math/BlockPos;)V
-
-