Skip to content

Commit 51abda7

Browse files
committed
Update EntityPacketRewriter1_9.java
1 parent e22a8ad commit 51abda7

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

common/src/main/java/com/viaversion/viarewind/protocol/v1_9to1_8/rewriter/EntityPacketRewriter1_9.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,11 @@ public void register() {
258258
wrapper.cancel();
259259
return;
260260
}
261+
// 1.8 drops its own inventory on its player's death event; the death screen still shows from health
262+
if (status == 3 && wrapper.get(Types.INT, 0) == tracker(wrapper.user()).clientEntityId()) {
263+
wrapper.cancel();
264+
return;
265+
}
261266
wrapper.write(Types.BYTE, status);
262267
});
263268
}
@@ -409,7 +414,10 @@ public void register() {
409414
public void register() {
410415
map(Types.VAR_INT); // Entity id
411416
handler(wrapper -> {
412-
// todo check if this is correct for the own player
417+
// 1.8 never gets its own equipment (viewer-only); a modern self-send would clobber the render
418+
if (wrapper.get(Types.VAR_INT, 0) == tracker(wrapper.user()).clientEntityId()) {
419+
wrapper.cancel();
420+
}
413421
int slot = wrapper.read(Types.VAR_INT);
414422
if (slot == 1) {
415423
wrapper.cancel();

0 commit comments

Comments
 (0)