Class SimpleGameEventDispatcher
java.lang.Object
net.minecraft.world.event.listener.SimpleGameEventDispatcher
- All Implemented Interfaces:
GameEventDispatcher
A simple game event dispatcher implementation that has hooks to
debug info senders.
- API Note:
- Vanilla Minecraft creates it on a per-chunk-section basis.
- Mappings:
Namespace Name official cupintermediary net/minecraft/class_5711named net/minecraft/world/event/listener/SimpleGameEventDispatcher
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Set<GameEventListener>private final List<GameEventListener>private booleanprivate final List<GameEventListener>private final WorldFields inherited from interface net.minecraft.world.event.listener.GameEventDispatcher
EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(GameEventListener listener) Adds a listener to this dispatcher.voidDispatches an event to all the listeners in this dispatcher.private booleandispatchTo(World world, GameEvent event, @Nullable Entity entity, BlockPos pos, GameEventListener listener) booleanisEmpty()Returns whether this dispatcher has no listeners.voidremoveListener(GameEventListener listener) Removes a listener from this dispatcher if it is present.
-
Field Details
-
listeners
- Mappings:
Namespace Name Mixin selector official bLcup;b:Ljava/util/List;intermediary field_28142Lnet/minecraft/class_5711;field_28142:Ljava/util/List;named listenersLnet/minecraft/world/event/listener/SimpleGameEventDispatcher;listeners:Ljava/util/List;
-
field_37673
- Mappings:
Namespace Name Mixin selector official cLcup;c:Ljava/util/Set;intermediary field_37673Lnet/minecraft/class_5711;field_37673:Ljava/util/Set;named field_37673Lnet/minecraft/world/event/listener/SimpleGameEventDispatcher;field_37673:Ljava/util/Set;
-
field_37674
- Mappings:
Namespace Name Mixin selector official dLcup;d:Ljava/util/List;intermediary field_37674Lnet/minecraft/class_5711;field_37674:Ljava/util/List;named field_37674Lnet/minecraft/world/event/listener/SimpleGameEventDispatcher;field_37674:Ljava/util/List;
-
field_37675
private boolean field_37675- Mappings:
Namespace Name Mixin selector official eLcup;e:Zintermediary field_37675Lnet/minecraft/class_5711;field_37675:Znamed field_37675Lnet/minecraft/world/event/listener/SimpleGameEventDispatcher;field_37675:Z
-
world
- Mappings:
Namespace Name Mixin selector official fLcup;f:Lcbz;intermediary field_28143Lnet/minecraft/class_5711;field_28143:Lnet/minecraft/class_1937;named worldLnet/minecraft/world/event/listener/SimpleGameEventDispatcher;world:Lnet/minecraft/world/World;
-
-
Constructor Details
-
SimpleGameEventDispatcher
- Mappings:
Namespace Name Mixin selector official <init>Lcup;<init>(Lcbz;)Vintermediary <init>Lnet/minecraft/class_5711;<init>(Lnet/minecraft/class_1937;)Vnamed <init>Lnet/minecraft/world/event/listener/SimpleGameEventDispatcher;<init>(Lnet/minecraft/world/World;)V
-
-
Method Details
-
isEmpty
public boolean isEmpty()Returns whether this dispatcher has no listeners.- Specified by:
isEmptyin interfaceGameEventDispatcher- Mappings:
Namespace Name Mixin selector official aLcur;a()Zintermediary method_32942Lnet/minecraft/class_5713;method_32942()Znamed isEmptyLnet/minecraft/world/event/listener/GameEventDispatcher;isEmpty()Z
-
addListener
Adds a listener to this dispatcher.- Specified by:
addListenerin interfaceGameEventDispatcher- Parameters:
listener- the listener to add- Mappings:
Namespace Name Mixin selector official aLcur;a(Lcus;)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
Removes a listener from this dispatcher if it is present.- Specified by:
removeListenerin interfaceGameEventDispatcher- Parameters:
listener- the listener to remove- Mappings:
Namespace Name Mixin selector official bLcur;b(Lcus;)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
Dispatches an event to all the listeners in this dispatcher.- Specified by:
dispatchin interfaceGameEventDispatcher- Parameters:
event- the evententity- an entity related to the eventpos- the block position of the event- Mappings:
Namespace Name Mixin selector official aLcur;a(Lcuq;Layb;Lgk;)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
-
dispatchTo
private boolean dispatchTo(World world, GameEvent event, @Nullable @Nullable Entity entity, BlockPos pos, GameEventListener listener) - Mappings:
Namespace Name Mixin selector official aLcup;a(Lcbz;Lcuq;Layb;Lgk;Lcus;)Zintermediary method_32936Lnet/minecraft/class_5711;method_32936(Lnet/minecraft/class_1937;Lnet/minecraft/class_5712;Lnet/minecraft/class_1297;Lnet/minecraft/class_2338;Lnet/minecraft/class_5714;)Znamed dispatchToLnet/minecraft/world/event/listener/SimpleGameEventDispatcher;dispatchTo(Lnet/minecraft/world/World;Lnet/minecraft/world/event/GameEvent;Lnet/minecraft/entity/Entity;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/event/listener/GameEventListener;)Z
-