mirror of
https://github.com/ViaVersion/ViaLegacy.git
synced 2024-09-28 04:17:40 +02:00
Fixed being able to sprint on servers that aren't sending the health
This commit is contained in:
parent
01e3c0e13b
commit
ec1b88627b
@ -80,9 +80,13 @@ public class Protocolb1_8_0_1tob1_7_0_3 extends AbstractProtocol<ClientboundPack
|
|||||||
playerListEntry.write(Type.BOOLEAN, true); // online
|
playerListEntry.write(Type.BOOLEAN, true); // online
|
||||||
playerListEntry.write(Type.SHORT, (short) 0); // ping
|
playerListEntry.write(Type.SHORT, (short) 0); // ping
|
||||||
|
|
||||||
|
final PacketWrapper updateHealth = PacketWrapper.create(ClientboundPacketsb1_7.UPDATE_HEALTH, wrapper.user());
|
||||||
|
updateHealth.write(Type.SHORT, (short) 20); // health
|
||||||
|
|
||||||
wrapper.send(Protocolb1_8_0_1tob1_7_0_3.class);
|
wrapper.send(Protocolb1_8_0_1tob1_7_0_3.class);
|
||||||
playerListEntry.send(Protocolb1_8_0_1tob1_7_0_3.class);
|
|
||||||
wrapper.cancel();
|
wrapper.cancel();
|
||||||
|
playerListEntry.send(Protocolb1_8_0_1tob1_7_0_3.class);
|
||||||
|
updateHealth.send(Protocolb1_8_0_1tob1_7_0_3.class, false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -299,11 +303,9 @@ public class Protocolb1_8_0_1tob1_7_0_3 extends AbstractProtocol<ClientboundPack
|
|||||||
} else {
|
} else {
|
||||||
final Position pos = wrapper.get(Types1_7_6.POSITION_UBYTE, 0);
|
final Position pos = wrapper.get(Types1_7_6.POSITION_UBYTE, 0);
|
||||||
if (wrapper.user().get(ChunkTracker.class).getBlockNotNull(pos).id == BlockList1_6.cake.blockID) {
|
if (wrapper.user().get(ChunkTracker.class).getBlockNotNull(pos).id == BlockList1_6.cake.blockID) {
|
||||||
final PacketWrapper updateHealth = PacketWrapper.create(ClientboundPacketsb1_8.UPDATE_HEALTH, wrapper.user());
|
final PacketWrapper updateHealth = PacketWrapper.create(ClientboundPacketsb1_7.UPDATE_HEALTH, wrapper.user());
|
||||||
updateHealth.write(Type.SHORT, wrapper.user().get(PlayerHealthTracker.class).getHealth()); // health
|
updateHealth.write(Type.SHORT, wrapper.user().get(PlayerHealthTracker.class).getHealth()); // health
|
||||||
updateHealth.write(Type.SHORT, (short) 6); // food
|
updateHealth.send(Protocolb1_8_0_1tob1_7_0_3.class, false);
|
||||||
updateHealth.write(Type.FLOAT, 0F); // saturation
|
|
||||||
updateHealth.send(Protocolb1_8_0_1tob1_7_0_3.class);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user