ViaRewind

ViaRewind

7.4k Downloads

Wrong packetorder

LIWKK opened this issue ยท 6 comments

commented

ViaRewind makes players to send PacketPlayInArmAnimation on post (normally sent on pre) when u place or break blocks.

commented

packetWrapper.cancel();
final PacketWrapper delayedPacket = new PacketWrapper(0x1A, null, packetWrapper.user());
delayedPacket.write(Type.VAR_INT, 0); //Main Hand
//delay packet in order to deal damage to entities
//the cooldown value gets reset by this packet
//1.8 sends it before the use entity packet
//1.9 afterwards
Protocol1_8TO1_9.TIMER.schedule(new TimerTask() {
@Override
public void run() {
PacketUtil.sendToServer(delayedPacket, Protocol1_8TO1_9.class);
}
}, 5);

You're welcome to PR a better solution for this issue.

commented

InArmAnimation when placing or breaking block is sent on pre every version of minecraft.

commented

But the order of packets when hitting entities has changed. There is no information in the animation packet on which action it was triggered by.

commented

I'm unsure if it changed attackEntity is still called pre in 1.12.2 source

commented

Also protocolsupport causes no issues with this, only ViaRewind.

commented

Also protocolsupport causes no issues with this, only ViaRewind.

Protocolsupport does not show tools attack cooldown to 1.8.9- player. I think that is why.