# Server Platform Compatibility in PlugSnatcher

## Overview

PlugSnatcher now has enhanced platform compatibility checking to ensure that plugins you download and update are compatible with your specific server type. This feature prevents potential issues like downloading a NeoForge version of a plugin for a Paper server or vice versa.

## Supported Server Types

PlugSnatcher automatically detects and supports the following server types:

- **Paper** - Can use plugins built for Paper, Spigot, and Bukkit
- **Spigot** - Can use plugins built for Spigot and Bukkit
- **Bukkit** - Can use plugins built for Bukkit only
- **Forge** - Can use plugins built for Forge
- **Fabric** - Can use plugins built for Fabric
- **Velocity** - Can use plugins built for Velocity
- **BungeeCord** - Can use plugins built for BungeeCord
- **Waterfall** - Can use plugins built for Waterfall and BungeeCord

## How It Works

1. **Server Type Detection**: When you scan a server directory, PlugSnatcher automatically determines the server type based on file patterns and configuration files.

2. **Platform-Aware Updates**: When checking for updates, PlugSnatcher filters plugin versions based on your server type. For example, if you're running a Paper server, PlugSnatcher will prioritize Paper/Spigot/Bukkit versions and avoid Forge/Fabric versions.

3. **Compatible Version Selection**: When multiple versions of a plugin are available (e.g., Paper, Forge, and Fabric versions), PlugSnatcher automatically selects the one compatible with your server.

4. **Warning System**: If no compatible version is found, PlugSnatcher will warn you before allowing you to proceed with an update that might not work on your server.

## Examples

- **Plugin with multiple versions**: For plugins like LuckPerms that have versions for various platforms (Paper, Forge, NeoForge, Fabric), PlugSnatcher will automatically select the version that matches your server type.

- **Universal plugins**: Some plugins work across multiple platforms without specific builds. In these cases, PlugSnatcher will consider them compatible with all server types.

## Technical Details

This feature primarily affects plugins downloaded from repositories that provide platform information, such as:

- **Modrinth**: Provides detailed platform compatibility information through "loaders" metadata
- **Hangar**: Includes platform tags for each plugin version
- **GitHub**: May or may not include platform information depending on the repository structure

For repositories without explicit platform tagging (like SpigotMC), PlugSnatcher will use the general repository focus (e.g., SpigotMC is for Bukkit/Spigot/Paper servers) to determine compatibility.

## Current Limitations

- Some repositories don't provide structured platform compatibility information
- Plugin naming conventions aren't always consistent, making it difficult to determine platform compatibility from filenames alone
- Some custom/niche server types may not be properly detected or matched

## Future Improvements

- Allow manual override of detected server type
- Add compatibility visualization in the UI
- Improve detection of platform from plugin filename patterns
- Support for more server types and platforms