Skip to content

Commit

Permalink
Correctly handle the Loofah ClientType
Browse files Browse the repository at this point in the history
  • Loading branch information
nelind3 committed Oct 20, 2024
1 parent 2326992 commit b83a80a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
public abstract class MinecraftMixin_Fabric implements MinecraftBridge, FabricClient {
@Override
public ClientType bridge$getClientType() {
// TODO(loofah): proper loofah client type since parts of
// SpongeCommon use it to check for sponge enabled clients
return ClientType.from("fabric/loofah");
return ClientType.LOOFAH;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public final class ClientType {
public static final ClientType SPONGE_VANILLA = new ClientType("sponge_vanilla");
public static final ClientType FORGE = new ClientType("forge");
public static final ClientType SPONGE_FORGE = new ClientType("sponge_forge");
// Loofah start
public static final ClientType LOOFAH = new ClientType("loofah");
// Loofah end

private final String name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,9 @@ public abstract class ServerPlayerMixin extends PlayerMixin implements SubjectBr
return;
}
final ClientType clientType = this.bridge$getClientType();
if (clientType == ClientType.SPONGE_VANILLA || clientType == ClientType.SPONGE_FORGE) {
// Loofah start
if (clientType == ClientType.SPONGE_VANILLA || clientType == ClientType.SPONGE_FORGE || clientType == ClientType.LOOFAH) {
// Loofah end
SpongePacketHandler.getChannel().sendTo((ServerPlayer) this, packet);
}
}
Expand Down

0 comments on commit b83a80a

Please sign in to comment.