Actually restrict velocity change to fishing hooks

This commit is contained in:
Nassim Jahnke 2024-06-28 15:28:07 +02:00
parent f4d6659760
commit c5dc5b2bf8
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F

View File

@ -146,8 +146,10 @@ public class EntityPacketRewriter1_11 extends EntityRewriter<ClientboundPackets1
});
protocol.registerClientbound(ClientboundPackets1_9_3.SET_ENTITY_MOTION, wrapper -> {
wrapper.passthrough(Types.VAR_INT); // Entity id
tryFixFishingHookVelocity(wrapper);
final int entityId = wrapper.passthrough(Types.VAR_INT);
if (tracker(wrapper.user()).entityType(entityId) == EntityTypes1_10.EntityType.FISHING_HOOK) {
tryFixFishingHookVelocity(wrapper);
}
});
registerRemoveEntities(ClientboundPackets1_9_3.REMOVE_ENTITIES);