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 dfzintermediary net/minecraft/class_5711named net/minecraft/world/event/listener/SimpleGameEventDispatcher
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.minecraft.world.event.listener.GameEventDispatcher
GameEventDispatcher.DispatchCallback -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate final intprivate final SimpleGameEventDispatcher.class_8512private final List<GameEventListener>private final List<GameEventListener>private final Set<GameEventListener>private final ServerWorldFields inherited from interface net.minecraft.world.event.listener.GameEventDispatcher
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionSimpleGameEventDispatcher(ServerWorld world, int int2, SimpleGameEventDispatcher.class_8512 class_8512) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(GameEventListener listener) Adds a listener to this dispatcher.booleandispatch(GameEvent event, Vec3d pos, GameEvent.Emitter emitter, GameEventDispatcher.DispatchCallback callback) Dispatches an event to all the listeners in this dispatcher.dispatchTo(ServerWorld world, Vec3d listenerPos, 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 bLdfz;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;
-
toRemove
- Mappings:
Namespace Name Mixin selector official cLdfz;c:Ljava/util/Set;intermediary field_37673Lnet/minecraft/class_5711;field_37673:Ljava/util/Set;named toRemoveLnet/minecraft/world/event/listener/SimpleGameEventDispatcher;toRemove:Ljava/util/Set;
-
toAdd
- Mappings:
Namespace Name Mixin selector official dLdfz;d:Ljava/util/List;intermediary field_37674Lnet/minecraft/class_5711;field_37674:Ljava/util/List;named toAddLnet/minecraft/world/event/listener/SimpleGameEventDispatcher;toAdd:Ljava/util/List;
-
dispatching
private boolean dispatching- Mappings:
Namespace Name Mixin selector official eLdfz;e:Zintermediary field_37675Lnet/minecraft/class_5711;field_37675:Znamed dispatchingLnet/minecraft/world/event/listener/SimpleGameEventDispatcher;dispatching:Z
-
world
- Mappings:
Namespace Name Mixin selector official fLdfz;f:Laid;intermediary field_28143Lnet/minecraft/class_5711;field_28143:Lnet/minecraft/class_3218;named worldLnet/minecraft/world/event/listener/SimpleGameEventDispatcher;world:Lnet/minecraft/server/world/ServerWorld;
-
field_44636
private final int field_44636- Mappings:
Namespace Name Mixin selector official gLdfz;g:Iintermediary field_44636Lnet/minecraft/class_5711;field_44636:Inamed field_44636Lnet/minecraft/world/event/listener/SimpleGameEventDispatcher;field_44636:I
-
field_44637
- Mappings:
Namespace Name Mixin selector official hLdfz;h:Ldfz$a;intermediary field_44637Lnet/minecraft/class_5711;field_44637:Lnet/minecraft/class_5711$class_8512;named field_44637Lnet/minecraft/world/event/listener/SimpleGameEventDispatcher;field_44637:Lnet/minecraft/world/event/listener/SimpleGameEventDispatcher$class_8512;
-
-
Constructor Details
-
SimpleGameEventDispatcher
public SimpleGameEventDispatcher(ServerWorld world, int int2, SimpleGameEventDispatcher.class_8512 class_8512) - Mappings:
Namespace Name Mixin selector official <init>Ldfz;<init>(Laid;ILdfz$a;)Vintermediary <init>Lnet/minecraft/class_5711;<init>(Lnet/minecraft/class_3218;ILnet/minecraft/class_5711$class_8512;)Vnamed <init>Lnet/minecraft/world/event/listener/SimpleGameEventDispatcher;<init>(Lnet/minecraft/server/world/ServerWorld;ILnet/minecraft/world/event/listener/SimpleGameEventDispatcher$class_8512;)V
-
-
Method Details
-
isEmpty
public boolean isEmpty()Returns whether this dispatcher has no listeners.- Specified by:
isEmptyin interfaceGameEventDispatcher- Mappings:
Namespace Name Mixin selector official aLdgd;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 aLdgd;a(Ldgc;)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 bLdgd;b(Ldgc;)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
public boolean dispatch(GameEvent event, Vec3d pos, GameEvent.Emitter emitter, GameEventDispatcher.DispatchCallback callback) Dispatches an event to all the listeners in this dispatcher.- Specified by:
dispatchin interfaceGameEventDispatcher- Parameters:
event- the event- Mappings:
Namespace Name Mixin selector official aLdgd;a(Ldga;Ledp;Ldga$a;Ldgd$a;)Zintermediary method_32943Lnet/minecraft/class_5713;method_32943(Lnet/minecraft/class_5712;Lnet/minecraft/class_243;Lnet/minecraft/class_5712$class_7397;Lnet/minecraft/class_5713$class_7721;)Znamed dispatchLnet/minecraft/world/event/listener/GameEventDispatcher;dispatch(Lnet/minecraft/world/event/GameEvent;Lnet/minecraft/util/math/Vec3d;Lnet/minecraft/world/event/GameEvent$Emitter;Lnet/minecraft/world/event/listener/GameEventDispatcher$DispatchCallback;)Z
-
dispatchTo
private static Optional<Vec3d> dispatchTo(ServerWorld world, Vec3d listenerPos, GameEventListener listener) - Mappings:
Namespace Name Mixin selector official aLdfz;a(Laid;Ledp;Ldgc;)Ljava/util/Optional;intermediary method_32936Lnet/minecraft/class_5711;method_32936(Lnet/minecraft/class_3218;Lnet/minecraft/class_243;Lnet/minecraft/class_5714;)Ljava/util/Optional;named dispatchToLnet/minecraft/world/event/listener/SimpleGameEventDispatcher;dispatchTo(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/Vec3d;Lnet/minecraft/world/event/listener/GameEventListener;)Ljava/util/Optional;
-