Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,19 @@ protected void registerPackets() {
wrapper.write(Types.ENTITY_DATA_LIST1_8, entityData);
});

// 1.8 tracks arrows and fireballs with sendVelocity=false (EntityTracker: EntityArrow/EntityFireball ->
// (.., false)), so the client predicts their trajectory locally from the spawn velocity. Modern servers send
// periodic velocity (trackDeltas) that overwrites this prediction and desyncs the client's block-collision
// raytrace (arrows visibly stick to / slide off block edges). Drop in-flight velocity for them to match 1.8.
protocol.registerClientbound(ClientboundPackets1_9.SET_ENTITY_MOTION, wrapper -> {
final int entityId = wrapper.passthrough(Types.VAR_INT);
final EntityType type = wrapper.user().getEntityTracker(Protocol1_9To1_8.class).entityType(entityId);
if (type != null && (type.isOrHasParent(EntityTypes1_9.EntityType.ARROW)
|| type.isOrHasParent(EntityTypes1_9.EntityType.HURTING_PROJECTILE))) {
wrapper.cancel();
}
});

protocol.registerClientbound(ClientboundPackets1_9.ADD_ENTITY, new PacketHandlers() {
@Override
public void register() {
Expand Down