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 cvz
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 Lcvz;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;
    • field_37673

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

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

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

      private final ServerWorld world
      Mappings:
      Namespace Name Mixin selector
      official f Lcvz;f:Laeh;
      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 serverWorld)
  • 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 Lcwb;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 Lcwb;a(Lcwc;)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 Lcwb;b(Lcwc;)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 void dispatch(GameEvent event, @Nullable @Nullable Entity entity, Vec3d vec3d)
      Dispatches an event to all the listeners in this dispatcher.
      Specified by:
      dispatch in interface GameEventDispatcher
      Parameters:
      event - the event
      entity - an entity related to the event
      Mappings:
      Namespace Name Mixin selector
      official a Lcwb;a(Lcwa;Layl;Ldso;)V
      intermediary method_32943 Lnet/minecraft/class_5713;method_32943(Lnet/minecraft/class_5712;Lnet/minecraft/class_1297;Lnet/minecraft/class_243;)V
      named dispatch Lnet/minecraft/world/event/listener/GameEventDispatcher;dispatch(Lnet/minecraft/world/event/GameEvent;Lnet/minecraft/entity/Entity;Lnet/minecraft/util/math/Vec3d;)V
    • dispatchTo

      private static boolean dispatchTo(ServerWorld serverWorld, GameEvent gameEvent, @Nullable @Nullable Entity entity, Vec3d vec3d, GameEventListener gameEventListener)
      Mappings:
      Namespace Name Mixin selector
      official a Lcvz;a(Laeh;Lcwa;Layl;Ldso;Lcwc;)Z
      intermediary method_32936 Lnet/minecraft/class_5711;method_32936(Lnet/minecraft/class_3218;Lnet/minecraft/class_5712;Lnet/minecraft/class_1297;Lnet/minecraft/class_243;Lnet/minecraft/class_5714;)Z
      named dispatchTo Lnet/minecraft/world/event/listener/SimpleGameEventDispatcher;dispatchTo(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/world/event/GameEvent;Lnet/minecraft/entity/Entity;Lnet/minecraft/util/math/Vec3d;Lnet/minecraft/world/event/listener/GameEventListener;)Z