Skip to content

Commit 1d1dd7d

Browse files
Catch exceptions in custom payload handling
Closes #192
1 parent cb4ef9f commit 1d1dd7d

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

common/src/main/java/com/viaversion/viarewind/protocol/protocol1_7_6_10to1_8/packets/PlayerPackets1_8.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ public void register() {
366366
@Override
367367
public void register() {
368368
map(Type.STRING);
369-
handler(wrapper -> {
369+
handlerSoftFail(wrapper -> {
370370
String channel = wrapper.get(Type.STRING, 0);
371371
if (channel.equals("MC|TrList")) {
372372
wrapper.passthrough(Type.INT); //Window Id

common/src/main/java/com/viaversion/viarewind/protocol/protocol1_8to1_9/packets/PlayerPackets1_9.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ public void register() {
504504
@Override
505505
public void register() {
506506
map(Type.STRING);
507-
handler(wrapper -> {
507+
handlerSoftFail(wrapper -> {
508508
String channel = wrapper.get(Type.STRING, 0);
509509
if (channel.equals("MC|BEdit") || channel.equals("MC|BSign")) {
510510
Item book = wrapper.passthrough(Type.ITEM);

common/src/main/java/com/viaversion/viarewind/protocol/protocol1_8to1_9/packets/WorldPackets1_9.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ public void register() {
5555
final CompoundTag tag = wrapper.get(Type.NAMED_COMPOUND_TAG, 0);
5656

5757
final CompoundTag spawnData = tag.remove("SpawnData");
58-
if (spawnData != null && spawnData.contains("id")) {
58+
if (spawnData != null) {
5959
final StringTag id = spawnData.remove("id");
60-
if (id == null) return;
61-
tag.put("EntityId", id);
60+
if (id != null) {
61+
tag.put("EntityId", id);
62+
}
6263
}
6364
});
6465
}

0 commit comments

Comments
 (0)