architectury-api icon indicating copy to clipboard operation
architectury-api copied to clipboard

PlayerEvent.PlayerClone reversed parameters on Fabric.

Open RedPxnda opened this issue 2 years ago • 1 comments

As the title says, the player clone event reversed the parameters specifically on fabric. Forge still works fine.

Fabric's Player Clone Event Mixin:

@Inject(method = "copyFrom", at = @At("TAIL"))
   private void onCopyFrom(ServerPlayer oldPlayer, boolean alive, CallbackInfo ci) {
       ServerPlayerEvents.COPY_FROM.invoker().copyFromPlayer(oldPlayer, (ServerPlayer) (Object) this, alive);
   }

Arch's:

    private void restoreFrom(ServerPlayer serverPlayer, boolean bl, CallbackInfo ci) {
        PlayerEvent.PLAYER_CLONE.invoker().clone((ServerPlayer) (Object) this, serverPlayer, bl);
    }

https://github.com/architectury/architectury-api/blob/cca739db53e9e451a74435c21c9b4cefd0d8d538/fabric/src/main/java/dev/architectury/mixin/fabric/MixinServerPlayer.java#L40

Edit: fixed code blocks

RedPxnda avatar Mar 14 '23 23:03 RedPxnda

#391

RedPxnda avatar Mar 15 '23 00:03 RedPxnda

This was fixed in https://github.com/architectury/architectury-api/commit/b1e7c89ffb3d2ba95799748cd1ab4ef67e68cbe4

Jab125 avatar Apr 13 '24 05:04 Jab125