|
18 | 18 | package com.viaversion.viarewind.protocol.v1_8to1_7_6_10.rewriter;
|
19 | 19 |
|
20 | 20 | import com.viaversion.viarewind.ViaRewind;
|
| 21 | +import com.viaversion.viarewind.api.minecraft.entitydata.EntityDataTypes1_7_6_10; |
21 | 22 | import com.viaversion.viarewind.protocol.v1_7_6_10to1_7_2_5.packet.ClientboundPackets1_7_2_5;
|
22 | 23 | import com.viaversion.viarewind.protocol.v1_8to1_7_6_10.Protocol1_8To1_7_6_10;
|
23 | 24 | import com.viaversion.viarewind.protocol.v1_7_6_10to1_7_2_5.packet.ServerboundPackets1_7_2_5;
|
|
31 | 32 | import com.viaversion.viarewind.api.minecraft.math.Vector3d;
|
32 | 33 | import com.viaversion.viaversion.api.Via;
|
33 | 34 | import com.viaversion.viaversion.api.minecraft.GameProfile;
|
| 35 | +import com.viaversion.viaversion.api.minecraft.entitydata.EntityData; |
34 | 36 | import com.viaversion.viaversion.api.minecraft.item.Item;
|
35 | 37 | import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
36 | 38 | import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
|
|
49 | 51 | import io.netty.buffer.Unpooled;
|
50 | 52 |
|
51 | 53 | import java.nio.charset.StandardCharsets;
|
| 54 | +import java.util.ArrayList; |
52 | 55 | import java.util.List;
|
53 | 56 | import java.util.Objects;
|
54 | 57 | import java.util.UUID;
|
@@ -121,10 +124,15 @@ public void register() {
|
121 | 124 | if (tracker.getEntityData().isEmpty()) {
|
122 | 125 | return;
|
123 | 126 | }
|
124 |
| - // 1.8 clients do keep entity data after respawn, 1.7 clients don't |
| 127 | + |
| 128 | + // TODO figure out why this is needed |
| 129 | + final List<EntityData> entityDataList = new ArrayList<>(tracker.getEntityData()); |
| 130 | + entityDataList.removeIf(entityData -> entityData.id() == 6); |
| 131 | + |
| 132 | + // 1.8 clients do keep entity data after respawn, 1.7 clients don't |
125 | 133 | final PacketWrapper setEntityData = PacketWrapper.create(ClientboundPackets1_7_2_5.SET_ENTITY_DATA, wrapper.user());
|
126 | 134 | setEntityData.write(Types.INT, tracker.clientEntityId());
|
127 |
| - setEntityData.write(RewindTypes.ENTITY_DATA_LIST1_7, tracker.getEntityData()); |
| 135 | + setEntityData.write(RewindTypes.ENTITY_DATA_LIST1_7, entityDataList); |
128 | 136 | setEntityData.send(Protocol1_8To1_7_6_10.class);
|
129 | 137 | });
|
130 | 138 | }
|
|
0 commit comments