Skip to content

Commit cc7df5a

Browse files
committed
Fix serverbound beacon secondary effect
1 parent 8e6727c commit cc7df5a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20to1_20_2/rewriter/BlockItemPacketRewriter1_20_2.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,11 @@ public void registerPackets() {
112112
});
113113

114114
protocol.registerServerbound(ServerboundPackets1_19_4.SET_BEACON_EFFECT, wrapper -> {
115-
if (wrapper.passthrough(Type.BOOLEAN)) {
116-
// Effects start at 1 before 1.20.2
115+
// Effects start at 1 before 1.20.2
116+
if (wrapper.passthrough(Type.BOOLEAN)) { // Primary effect
117+
wrapper.write(Type.VAR_INT, wrapper.read(Type.VAR_INT) - 1);
118+
}
119+
if (wrapper.passthrough(Type.BOOLEAN)) { // Secondary effect
117120
wrapper.write(Type.VAR_INT, wrapper.read(Type.VAR_INT) - 1);
118121
}
119122
});

0 commit comments

Comments
 (0)