Architectury API (Fabric/Forge/NeoForge)

Architectury API (Fabric/Forge/NeoForge)

158M Downloads

PlayerHooks.isFake always returns false on fabric

TropheusJ opened this issue ยท 3 comments

commented

FTB Teams uses this hook to check if a player is fake. Create uses Fake Player API for the fake players of several blocks. Since the result is always false, FTB Teams believes the players are not fake, and crashes.
Create issue: Fabricators-of-Create/Create#307

commented

Depends on #202

commented

This is the check we use in AE2 btw:

    public static boolean isFakePlayer(Player player) {
        return player instanceof ServerPlayer && player.getClass() != ServerPlayer.class;
    }
commented

This is the check we use in AE2 btw:

    public static boolean isFakePlayer(Player player) {
        return player instanceof ServerPlayer && player.getClass() != ServerPlayer.class;
    }

I would say that this is a reasonable "default" expectation, and if mods have custom ServerPlayer subclasses that are not fake players, they can use the event described in 202