File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
common/src/main/java/com/viaversion/viaversion/rewriter Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -112,20 +112,22 @@ public void registerOpenScreen(C packetType) {
112112 @ Override
113113 public void register () {
114114 map (Types .VAR_INT ); // Container id
115- handler (wrapper -> {
116- final int windowType = wrapper .read (Types .VAR_INT );
117- final int mappedId = protocol .getMappingData ().getMenuMappings ().getNewId (windowType );
118- if (mappedId == -1 ) {
119- wrapper .cancel ();
120- return ;
121- }
122-
123- wrapper .write (Types .VAR_INT , mappedId );
124- });
115+ handler (wrapper -> handleMenuType (wrapper ));
125116 }
126117 });
127118 }
128119
120+ public void handleMenuType (final PacketWrapper wrapper ) {
121+ final int windowType = wrapper .read (Types .VAR_INT );
122+ final int mappedId = protocol .getMappingData ().getMenuMappings ().getNewId (windowType );
123+ if (mappedId == -1 ) {
124+ wrapper .cancel ();
125+ return ;
126+ }
127+
128+ wrapper .write (Types .VAR_INT , mappedId );
129+ }
130+
129131 public void registerSetSlot (C packetType ) {
130132 protocol .registerClientbound (packetType , new PacketHandlers () {
131133 @ Override
You can’t perform that action at this time.
0 commit comments