Game events stuff. Map 2 unmapped top level classes (#2045)

* Game events stuff. Map 2 unmapped top level classes

Signed-off-by: liach <liach@users.noreply.github.com>

* Update mappings/net/minecraft/world/event/listener/EntityGameEventHandler.mapping

Co-authored-by: YanisBft <doublecraft.official@gmail.com>

* Update mappings/net/minecraft/world/event/PositionSource.mapping

Co-authored-by: liach <liach@users.noreply.github.com>
Co-authored-by: YanisBft <doublecraft.official@gmail.com>
This commit is contained in:
liach 2021-02-13 11:01:00 -06:00 committed by GitHub
parent 288f20b7d5
commit 3b23315115
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 130 additions and 27 deletions

View File

@ -1,5 +0,0 @@
CLASS net/minecraft/class_5711
FIELD field_28142 listeners Ljava/util/List;
FIELD field_28143 world Lnet/minecraft/class_1937;
METHOD <init> (Lnet/minecraft/class_1937;)V
ARG 1 world

View File

@ -1,11 +0,0 @@
CLASS net/minecraft/class_5713
FIELD field_28181 EMPTY Lnet/minecraft/class_5713;
METHOD method_32942 isEmpty ()Z
METHOD method_32943 listen (Lnet/minecraft/class_5712;Lnet/minecraft/class_1297;Lnet/minecraft/class_2338;)V
ARG 1 event
ARG 2 entity
ARG 3 pos
METHOD method_32944 addListener (Lnet/minecraft/class_5714;)V
ARG 1 listener
METHOD method_32945 removeListener (Lnet/minecraft/class_5714;)V
ARG 1 listener

View File

@ -1,9 +1,18 @@
CLASS net/minecraft/class_5739 net/minecraft/client/render/debug/GameEventDebugRenderer
FIELD field_28255 client Lnet/minecraft/class_310;
FIELD field_28256 entries Ljava/util/List;
FIELD field_28257 listeners Ljava/util/List;
METHOD <init> (Lnet/minecraft/class_310;)V
ARG 1 client
CLASS class_5740 Listener
CLASS class_5741
METHOD method_33086 (Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_5739$class_5741;)Z
ARG 2 listener
METHOD method_33091 (Lnet/minecraft/class_5739$class_5741;Lnet/minecraft/class_4587;Lnet/minecraft/class_4588;DDDLnet/minecraft/class_2338;)V
ARG 9 pos
CLASS class_5740 Entry
FIELD field_28258 startingMs J
FIELD field_28259 event Lnet/minecraft/class_5712;
METHOD method_33093 hasExpired ()Z
CLASS class_5741 Listener
FIELD field_28261 positionSource Lnet/minecraft/class_5716;
FIELD field_28262 range I
METHOD <init> (Lnet/minecraft/class_5716;I)V
@ -11,3 +20,6 @@ CLASS net/minecraft/class_5739 net/minecraft/client/render/debug/GameEventDebugR
ARG 2 range
METHOD method_33094 getPos (Lnet/minecraft/class_1937;)Ljava/util/Optional;
ARG 1 world
METHOD method_33095 isTooFar (Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Z
ARG 1 world
ARG 2 pos

View File

@ -306,8 +306,27 @@ CLASS net/minecraft/class_1297 net/minecraft/entity/Entity
METHOD method_32319 setInPowderSnow (Z)V
ARG 1 inPowderSnow
METHOD method_32875 emitGameEvent (Lnet/minecraft/class_5712;Lnet/minecraft/class_1297;)V
ARG 1 event
ARG 2 entity
METHOD method_32876 emitGameEvent (Lnet/minecraft/class_5712;)V
ARG 1 event
METHOD method_32877 getGameEventHandler ()Lnet/minecraft/class_5715;
COMMENT Returns the game event handler for this entity.
COMMENT
COMMENT <p>Subclasses interested in listening to game events as an entity should return a
COMMENT handler so the {@link net.minecraft.world.event.listener.GameEventListener listener}
COMMENT used to receive game events can be registered to the correct dispatchers.
COMMENT
COMMENT @implNote The vanilla implementation always returns {@code null}.
METHOD method_33189 occludeVibrationSignals ()Z
METHOD method_33568 emitGameEvent (Lnet/minecraft/class_5712;Lnet/minecraft/class_1297;Lnet/minecraft/class_2338;)V
ARG 1 event
ARG 2 entity
ARG 3 pos
METHOD method_33569 emitGameEvent (Lnet/minecraft/class_5712;Lnet/minecraft/class_2338;)V
ARG 1 event
ARG 2 pos
METHOD method_33571 getEyePos ()Lnet/minecraft/class_243;
METHOD method_33572 setOnFire (Z)V
ARG 1 onFire
METHOD method_5621 getMountedHeightOffset ()D

View File

@ -53,10 +53,10 @@ CLASS net/minecraft/class_4209 net/minecraft/server/network/DebugInfoSender
METHOD method_24819 (Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;)V
ARG 0 world
ARG 1 pos
METHOD method_33139 (Lnet/minecraft/class_1937;Lnet/minecraft/class_5712;Lnet/minecraft/class_2338;)V
METHOD method_33139 sendGameEvent (Lnet/minecraft/class_1937;Lnet/minecraft/class_5712;Lnet/minecraft/class_2338;)V
ARG 0 world
ARG 1 event
ARG 2 pos
METHOD method_33140 (Lnet/minecraft/class_1937;Lnet/minecraft/class_5714;)V
METHOD method_33140 sendGameEventListener (Lnet/minecraft/class_1937;Lnet/minecraft/class_5714;)V
ARG 0 world
ARG 1 eventListener

View File

@ -61,3 +61,7 @@ CLASS net/minecraft/class_2791 net/minecraft/world/chunk/Chunk
ARG 2 upperHeight
METHOD method_20598 getPackedBlockEntityTag (Lnet/minecraft/class_2338;)Lnet/minecraft/class_2487;
ARG 1 pos
METHOD method_32914 getGameEventDispatcher (I)Lnet/minecraft/class_5713;
ARG 1 ySectionCoord
METHOD method_33729 getSection (I)Lnet/minecraft/class_2826;
ARG 1 yIndex

View File

@ -22,6 +22,7 @@ CLASS net/minecraft/class_2818 net/minecraft/world/chunk/WorldChunk
FIELD field_20655 biomeArray Lnet/minecraft/class_4548;
FIELD field_27221 EMPTY_BLOCK_ENTITY_TICKER Lnet/minecraft/class_5562;
FIELD field_27222 blockEntityTickers Ljava/util/Map;
FIELD field_28129 gameEventDispatchers Lit/unimi/dsi/fastutil/ints/Int2ObjectMap;
METHOD <init> (Lnet/minecraft/class_1937;Lnet/minecraft/class_1923;Lnet/minecraft/class_4548;)V
ARG 1 world
ARG 2 pos
@ -90,6 +91,8 @@ CLASS net/minecraft/class_2818 net/minecraft/world/chunk/WorldChunk
METHOD method_31724 canTickBlockEntity (Lnet/minecraft/class_2338;)Z
ARG 1 pos
METHOD method_31725 removeBlockEntityTicker (Lnet/minecraft/class_2338;)V
METHOD method_32917 (I)Lnet/minecraft/class_5713;
ARG 1 sectionCoord
CLASS 1 EmptyBlockEntityTickInvoker
CLASS class_2819 CreationType
CLASS class_5563 DirectBlockEntityTickInvoker

View File

@ -1,5 +1,11 @@
CLASS net/minecraft/class_5716 net/minecraft/world/event/PositionSource
FIELD field_28184 TYPE_CODEC Lcom/mojang/serialization/Codec;
COMMENT A position source is a property of a game event listener.
COMMENT
COMMENT @see net.minecraft.world.event.listener.GameEventListener#getPositionSource()
FIELD field_28184 CODEC Lcom/mojang/serialization/Codec;
COMMENT A codec for encoding and decoding any position source whose {@link #getType() type}
COMMENT is in the {@link net.minecraft.util.registry.Registry#POSITION_SOURCE_TYPE registry}.
METHOD method_32955 getType ()Lnet/minecraft/class_5717;
COMMENT Returns the type of this position source.
METHOD method_32956 getPos (Lnet/minecraft/class_1937;)Ljava/util/Optional;
ARG 1 world

View File

@ -0,0 +1,27 @@
CLASS net/minecraft/class_5715 net/minecraft/world/event/listener/EntityGameEventHandler
COMMENT A game event handler for an entity so that the listener stored can be
COMMENT moved to the correct dispatcher or unregistered as the entity moves or
COMMENT gets removed.
COMMENT
COMMENT @apiNote This implementation is currently unused by vanilla as vanilla
COMMENT doesn't have any entity that listens to game events.
COMMENT
COMMENT @see net.minecraft.entity.Entity#getGameEventHandler()
FIELD field_28182 listener Lnet/minecraft/class_5714;
FIELD field_28183 sectionPos Lnet/minecraft/class_4076;
METHOD <init> (Lnet/minecraft/class_5714;)V
ARG 1 listener
METHOD method_32949 onEntityRemoval (Lnet/minecraft/class_1937;)V
ARG 1 world
METHOD method_32950 updateDispatcher (Lnet/minecraft/class_1937;Lnet/minecraft/class_4076;Ljava/util/function/Consumer;)V
ARG 1 world
ARG 2 sectionPos
ARG 3 action
METHOD method_32951 (Lnet/minecraft/class_5713;)V
ARG 1 dispatcher
METHOD method_32952 onEntitySetPos (Lnet/minecraft/class_1937;)V
ARG 1 world
METHOD method_32953 (Lnet/minecraft/class_5713;)V
ARG 1 dispatcher
METHOD method_32954 (Lnet/minecraft/class_5713;)V
ARG 1 dispatcher

View File

@ -0,0 +1,22 @@
CLASS net/minecraft/class_5713 net/minecraft/world/event/listener/GameEventDispatcher
COMMENT A game event dispatcher dispatches game events to its listeners.
FIELD field_28181 EMPTY Lnet/minecraft/class_5713;
COMMENT An unmodifiable, empty (non-operative) dispatcher.
METHOD method_32942 isEmpty ()Z
COMMENT Returns whether this dispatcher has no listeners.
METHOD method_32943 dispatch (Lnet/minecraft/class_5712;Lnet/minecraft/class_1297;Lnet/minecraft/class_2338;)V
COMMENT Dispatches an event to all the listeners in this dispatcher.
ARG 1 event
COMMENT the event
ARG 2 entity
COMMENT an entity related to the event
ARG 3 pos
COMMENT the block position of the event
METHOD method_32944 addListener (Lnet/minecraft/class_5714;)V
COMMENT Adds a listener to this dispatcher.
ARG 1 listener
COMMENT the listener to add
METHOD method_32945 removeListener (Lnet/minecraft/class_5714;)V
COMMENT Removes a listener from this dispatcher if it is present.
ARG 1 listener
COMMENT the listener to remove

View File

@ -1,8 +1,14 @@
CLASS net/minecraft/class_5714 net/minecraft/world/event/listener/GameEventListener
COMMENT A game event listener listens to game events from {@link GameEventDispatcher}s.
METHOD method_32946 getPositionSource ()Lnet/minecraft/class_5716;
COMMENT Returns the position source of this listener.
METHOD method_32947 listen (Lnet/minecraft/class_1937;Lnet/minecraft/class_5712;Lnet/minecraft/class_1297;Lnet/minecraft/class_2338;)Z
COMMENT Listens to an incoming game event.
COMMENT
COMMENT @return {@code true} if the game event has been accepted by this listener
ARG 1 world
ARG 2 event
ARG 3 entity
ARG 4 pos
METHOD method_32948 getRange ()I
COMMENT Returns the range, in blocks, of the listener.

View File

@ -1,15 +1,15 @@
CLASS net/minecraft/class_5718 net/minecraft/world/event/listener/SculkSensorListener
FIELD field_28187 positionSource Lnet/minecraft/class_5716;
FIELD field_28188 range I
FIELD field_28189 listener Lnet/minecraft/class_5718$class_5719;
FIELD field_28189 callback Lnet/minecraft/class_5718$class_5719;
FIELD field_28190 event Ljava/util/Optional;
FIELD field_28191 distance I
FIELD field_28192 cooldown I
FIELD field_28192 delay I
METHOD <init> (Lnet/minecraft/class_5716;ILnet/minecraft/class_5718$class_5719;)V
ARG 1 positionSource
ARG 2 range
ARG 3 listener
METHOD method_32964 listen (Lnet/minecraft/class_1937;)V
METHOD method_32964 tick (Lnet/minecraft/class_1937;)V
ARG 1 world
METHOD method_32965 listen (Lnet/minecraft/class_1937;Lnet/minecraft/class_5712;Lnet/minecraft/class_2338;Lnet/minecraft/class_2338;)V
ARG 1 world
@ -25,12 +25,15 @@ CLASS net/minecraft/class_5718 net/minecraft/world/event/listener/SculkSensorLis
METHOD method_32968 shouldActivate (Lnet/minecraft/class_5712;Lnet/minecraft/class_1297;)Z
ARG 1 event
ARG 2 entity
CLASS class_5719 Listener
METHOD method_32969 listen (Lnet/minecraft/class_1937;Lnet/minecraft/class_5714;Lnet/minecraft/class_5712;I)V
CLASS class_5719 Callback
METHOD method_32969 accept (Lnet/minecraft/class_1937;Lnet/minecraft/class_5714;Lnet/minecraft/class_5712;I)V
COMMENT Accepts a game event after delay.
ARG 1 world
ARG 2 listener
ARG 3 event
METHOD method_32970 shouldListen (Lnet/minecraft/class_1937;Lnet/minecraft/class_5714;Lnet/minecraft/class_2338;Lnet/minecraft/class_5712;Lnet/minecraft/class_1297;)Z
ARG 4 distance
METHOD method_32970 accepts (Lnet/minecraft/class_1937;Lnet/minecraft/class_5714;Lnet/minecraft/class_2338;Lnet/minecraft/class_5712;Lnet/minecraft/class_1297;)Z
COMMENT Returns whether the callback wants to accept this event.
ARG 1 world
ARG 2 listener
ARG 3 pos

View File

@ -0,0 +1,17 @@
CLASS net/minecraft/class_5711 net/minecraft/world/event/listener/SimpleGameEventDispatcher
COMMENT A simple game event dispatcher implementation that has hooks to
COMMENT debug info senders.
COMMENT
COMMENT @apiNote Vanilla Minecraft creates it on a per-chunk-section basis.
FIELD field_28142 listeners Ljava/util/List;
FIELD field_28143 world Lnet/minecraft/class_1937;
METHOD <init> (Lnet/minecraft/class_1937;)V
ARG 1 world
METHOD method_32936 dispatchTo (Lnet/minecraft/class_1937;Lnet/minecraft/class_5712;Lnet/minecraft/class_1297;Lnet/minecraft/class_2338;Lnet/minecraft/class_5714;)Z
ARG 1 world
ARG 2 event
ARG 3 entity
ARG 4 pos
ARG 5 listener
METHOD method_32942 isEmpty ()Z
COMMENT Returns whether this dispatcher has no listeners.