Skip to content

Commit 433f46e

Browse files
Handle DEBUG_SAMPLE_SUBSCRIPTION structure change in 1.21.9 ->1.21.7 (#1111)
1 parent fbe6a67 commit 433f46e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

common/src/main/java/com/viaversion/viabackwards/protocol/v1_21_9to1_21_7/Protocol1_21_9To1_21_7.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,19 @@ protected void registerPackets() {
185185
}
186186
});
187187

188+
registerServerbound(ServerboundPackets1_21_6.DEBUG_SAMPLE_SUBSCRIPTION, wrapper -> {
189+
final int sampleType = wrapper.read(Types.VAR_INT);
190+
if (sampleType == 0) { // TICK_TIME
191+
wrapper.write(Types.VAR_INT, 1); // Subscription count
192+
wrapper.write(Types.VAR_INT, 0); // Subscription registry id (DEDICATED_SERVER_TICK_TIME)
193+
}
194+
});
195+
188196
cancelClientbound(ClientboundPackets1_21_9.DEBUG_BLOCK_VALUE);
189197
cancelClientbound(ClientboundPackets1_21_9.DEBUG_CHUNK_VALUE);
190198
cancelClientbound(ClientboundPackets1_21_9.DEBUG_ENTITY_VALUE);
191199
cancelClientbound(ClientboundPackets1_21_9.DEBUG_EVENT);
192200
cancelClientbound(ClientboundPackets1_21_9.GAME_EVENT_TEST_HIGHLIGHT_POS);
193-
cancelServerbound(ServerboundPackets1_21_6.DEBUG_SAMPLE_SUBSCRIPTION);
194201
}
195202

196203
@Override

0 commit comments

Comments
 (0)