Class SimpleGameEventDispatcher

java.lang.Object
net.minecraft.world.event.listener.SimpleGameEventDispatcher
All Implemented Interfaces:
GameEventDispatcher

public class SimpleGameEventDispatcher extends Object implements 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 ddb
intermediary net/minecraft/class_5711
named net/minecraft/world/event/listener/SimpleGameEventDispatcher
  • Field Details

    • listeners

      private final List<GameEventListener> listeners
      Mappings:
      Namespace Name Mixin selector
      official b Lddb;b:Ljava/util/List;
      intermediary field_28142 Lnet/minecraft/class_5711;field_28142:Ljava/util/List;
      named listeners Lnet/minecraft/world/event/listener/SimpleGameEventDispatcher;listeners:Ljava/util/List;
    • toRemove

      private final Set<GameEventListener> toRemove
      Mappings:
      Namespace Name Mixin selector
      official c Lddb;c:Ljava/util/Set;
      intermediary field_37673 Lnet/minecraft/class_5711;field_37673:Ljava/util/Set;
      named toRemove Lnet/minecraft/world/event/listener/SimpleGameEventDispatcher;toRemove:Ljava/util/Set;
    • toAdd

      private final List<GameEventListener> toAdd
      Mappings:
      Namespace Name Mixin selector
      official d Lddb;d:Ljava/util/List;
      intermediary field_37674 Lnet/minecraft/class_5711;field_37674:Ljava/util/List;
      named toAdd Lnet/minecraft/world/event/listener/SimpleGameEventDispatcher;toAdd:Ljava/util/List;
    • dispatching

      private boolean dispatching
      Mappings:
      Namespace Name Mixin selector
      official e Lddb;e:Z
      intermediary field_37675 Lnet/minecraft/class_5711;field_37675:Z
      named dispatching Lnet/minecraft/world/event/listener/SimpleGameEventDispatcher;dispatching:Z
    • world

      private final ServerWorld world
      Mappings:
      Namespace Name Mixin selector
      official f Lddb;f:Lahm;
      intermediary field_28143 Lnet/minecraft/class_5711;field_28143:Lnet/minecraft/class_3218;
      named world Lnet/minecraft/world/event/listener/SimpleGameEventDispatcher;world:Lnet/minecraft/server/world/ServerWorld;
  • Constructor Details

    • SimpleGameEventDispatcher

      public SimpleGameEventDispatcher(ServerWorld world)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lddb;<init>(Lahm;)V
      intermediary <init> Lnet/minecraft/class_5711;<init>(Lnet/minecraft/class_3218;)V
      named <init> Lnet/minecraft/world/event/listener/SimpleGameEventDispatcher;<init>(Lnet/minecraft/server/world/ServerWorld;)V
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Returns whether this dispatcher has no listeners.
      Specified by:
      isEmpty in interface GameEventDispatcher
      Mappings:
      Namespace Name Mixin selector
      official a Lddf;a()Z
      intermediary method_32942 Lnet/minecraft/class_5713;method_32942()Z
      named isEmpty Lnet/minecraft/world/event/listener/GameEventDispatcher;isEmpty()Z
    • addListener

      public void addListener(GameEventListener listener)
      Adds a listener to this dispatcher.
      Specified by:
      addListener in interface GameEventDispatcher
      Parameters:
      listener - the listener to add
      Mappings:
      Namespace Name Mixin selector
      official a Lddf;a(Ldde;)V
      intermediary method_32944 Lnet/minecraft/class_5713;method_32944(Lnet/minecraft/class_5714;)V
      named addListener Lnet/minecraft/world/event/listener/GameEventDispatcher;addListener(Lnet/minecraft/world/event/listener/GameEventListener;)V
    • removeListener

      public void removeListener(GameEventListener listener)
      Removes a listener from this dispatcher if it is present.
      Specified by:
      removeListener in interface GameEventDispatcher
      Parameters:
      listener - the listener to remove
      Mappings:
      Namespace Name Mixin selector
      official b Lddf;b(Ldde;)V
      intermediary method_32945 Lnet/minecraft/class_5713;method_32945(Lnet/minecraft/class_5714;)V
      named removeListener Lnet/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:
      dispatch in interface GameEventDispatcher
      Parameters:
      event - the event
      Mappings:
      Namespace Name Mixin selector
      official a Lddf;a(Lddc;Leae;Lddc$a;Lddf$a;)Z
      intermediary method_32943 Lnet/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;)Z
      named dispatch Lnet/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 a Lddb;a(Lahm;Leae;Ldde;)Ljava/util/Optional;
      intermediary method_32936 Lnet/minecraft/class_5711;method_32936(Lnet/minecraft/class_3218;Lnet/minecraft/class_243;Lnet/minecraft/class_5714;)Ljava/util/Optional;
      named dispatchTo Lnet/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;