Map chest state managers. (#1838)

* Map chest state managers.

* Update lid animator mappings.

* Update ChestStateManager.mapping

* Removed unused mapping file.

* Apply suggestions from code review

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

Co-authored-by: YanisBft <doublecraft.official@gmail.com>
This commit is contained in:
Thalia Nero 2020-11-07 18:17:37 -05:00 committed by GitHub
parent b0078fdaeb
commit 7180076edd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 93 additions and 0 deletions

View File

@ -1,6 +1,12 @@
CLASS net/minecraft/class_3719 net/minecraft/block/entity/BarrelBlockEntity
FIELD field_16410 inventory Lnet/minecraft/class_2371;
FIELD field_27207 stateManager Lnet/minecraft/class_5561;
METHOD <init> (Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
ARG 1 pos
ARG 2 state
METHOD method_17764 playSound (Lnet/minecraft/class_2680;Lnet/minecraft/class_3414;)V
ARG 1 state
ARG 2 soundEvent
METHOD method_18318 setOpen (Lnet/minecraft/class_2680;Z)V
ARG 1 state
ARG 2 open

View File

@ -1,5 +1,7 @@
CLASS net/minecraft/class_5558 net/minecraft/block/entity/BlockEntityTicker
METHOD tick (Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_2586;)V
COMMENT Runs this action on the given block entity. The world, block position, and block state are passed
COMMENT as context.
ARG 1 world
ARG 2 pos
ARG 3 state

View File

@ -1,5 +1,10 @@
CLASS net/minecraft/class_2595 net/minecraft/block/entity/ChestBlockEntity
FIELD field_11927 inventory Lnet/minecraft/class_2371;
FIELD field_27209 stateManager Lnet/minecraft/class_5561;
FIELD field_27210 lidAnimator Lnet/minecraft/class_5560;
METHOD <init> (Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
ARG 1 pos
ARG 2 state
METHOD method_11047 copyInventory (Lnet/minecraft/class_2595;Lnet/minecraft/class_2595;)V
ARG 0 from
ARG 1 to
@ -7,5 +12,19 @@ CLASS net/minecraft/class_2595 net/minecraft/block/entity/ChestBlockEntity
ARG 0 world
ARG 1 pos
METHOD method_11049 onInvOpenOrClose (Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;II)V
ARG 1 world
ARG 2 pos
ARG 3 state
ARG 4 oldViewerCount
ARG 5 newViewerCount
METHOD method_11050 playSound (Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_3414;)V
ARG 0 world
ARG 1 pos
ARG 2 state
ARG 3 soundEvent
METHOD method_31670 clientTick (Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_2595;)V
ARG 0 world
ARG 1 pos
ARG 2 state
ARG 3 blockEntity
METHOD method_31671 onScheduledTick ()V

View File

@ -0,0 +1,10 @@
CLASS net/minecraft/class_5560 net/minecraft/block/entity/ChestLidAnimator
COMMENT Handles the animation for opening and closing chests and ender chests.
FIELD field_27212 open Z
FIELD field_27213 progress F
FIELD field_27214 lastProgress F
METHOD method_31672 step ()V
METHOD method_31673 getProgress (F)F
ARG 1 delta
METHOD method_31674 setOpen (Z)V
ARG 1 open

View File

@ -0,0 +1,43 @@
CLASS net/minecraft/class_5561 net/minecraft/block/entity/ChestStateManager
COMMENT Handles the viewer count for chest-like block entities.
FIELD field_27215 viewerCount I
METHOD method_31678 getViewerCount ()I
METHOD method_31679 isPlayerViewing (Lnet/minecraft/class_1657;)Z
COMMENT Determines whether the given player is currently viewing this chest.
ARG 1 player
METHOD method_31680 getInRangeViewerCount (Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)I
ARG 1 world
ARG 2 pos
METHOD method_31681 onChestOpened (Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
COMMENT Run when this chest is opened (when the viewer count becomes nonzero).
ARG 1 world
ARG 2 pos
ARG 3 state
METHOD method_31682 onInteracted (Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;II)V
COMMENT Run when a player interacts with this chest.
ARG 1 world
ARG 2 pos
ARG 3 state
ARG 4 oldViewerCount
ARG 5 newViewerCount
METHOD method_31683 onChestClosed (Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
COMMENT Run when this chest closes (when the viewer count reaches zero).
ARG 1 world
ARG 2 pos
ARG 3 state
METHOD method_31684 openChest (Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
ARG 1 world
ARG 2 pos
ARG 3 state
METHOD method_31685 closeChest (Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
ARG 1 world
ARG 2 pos
ARG 3 state
METHOD method_31686 updateViewerCount (Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
ARG 1 world
ARG 2 pos
ARG 3 state
METHOD method_31687 scheduleBlockTick (Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
ARG 0 world
ARG 1 pos
ARG 2 state

View File

@ -1,5 +1,18 @@
CLASS net/minecraft/class_2611 net/minecraft/block/entity/EnderChestBlockEntity
FIELD field_27216 lidAnimator Lnet/minecraft/class_5560;
FIELD field_27217 stateManager Lnet/minecraft/class_5561;
METHOD <init> (Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
ARG 1 pos
ARG 2 state
METHOD method_11218 canPlayerUse (Lnet/minecraft/class_1657;)Z
ARG 1 player
METHOD method_11219 onOpen (Lnet/minecraft/class_1657;)V
ARG 1 player
METHOD method_11220 onClose (Lnet/minecraft/class_1657;)V
ARG 1 player
METHOD method_31689 clientTick (Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_2611;)V
ARG 0 world
ARG 1 pos
ARG 2 state
ARG 3 blockEntity
METHOD method_31690 onScheduledTick ()V