-
Notifications
You must be signed in to change notification settings - Fork 33
MC Modrinth: Implement mod/plugin management with update and uninstall capabilities #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
H1ghSyst3m
wants to merge
12
commits into
pelican-dev:main
Choose a base branch
from
H1ghSyst3m:featcomplete-mod-plugin-management
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7a74e0a
Add mod/plugin update and uninstall features with metadata tracking
H1ghSyst3m eb2e0c3
Remove unused download strings from language files
H1ghSyst3m f2d3bb3
Fix: Validate filenames and improve file save checks
H1ghSyst3m 0b92108
Fix: Add checks for Modrinth project type support
H1ghSyst3m eef0dd2
Remove unused Section import
H1ghSyst3m 938ad6a
Improve mod install/update rollback and cache handling
H1ghSyst3m 57d5603
Add installed mods view and handle unavailable mods
H1ghSyst3m 2da4031
Add optional author field to installed mod metadata
H1ghSyst3m 657e972
Use informal German and revert version
H1ghSyst3m 7b62073
Add uninstall success messages
H1ghSyst3m c713f81
Add tabs component and integrate into project page
H1ghSyst3m 3ed22f8
Translate uninstall notification body
H1ghSyst3m File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,41 @@ | ||
| # Minecraft Modrinth (by Boy132) | ||
|
|
||
| Easily download and install Minecraft mods and plugins directly from Modrinth within the server panel. | ||
| Easily download, update, and manage Minecraft mods and plugins directly from Modrinth within the server panel. | ||
|
|
||
| ## Setup | ||
|
|
||
| Add `modrinth_mods` or `modrinth_plugins` to the _features_ of your egg to enable the mod/plugins page. | ||
| Add `modrinth_mods` or `modrinth_plugins` to the _features_ of your egg to enable the mod/plugins page. | ||
| Also make sure your egg has the `minecraft` _tag_ and a _tag_ for the [mod loader](https://github.com/pelican-dev/plugins/blob/main/minecraft-modrinth/src/Enums/MinecraftLoader.php#L10-L16). (e.g. `paper` or `neoforge`) | ||
|
|
||
| ## Features | ||
|
|
||
| - Browse and search Modrinth's extensive mod library | ||
| - Download mods and plugins directly to your server | ||
| - Automatic version compatibility checking | ||
| - Seamless installation to the correct server directory | ||
| - **Browse and Search**: Access Modrinth's extensive mod library with search and pagination | ||
| - **Smart Installation**: One-click install with automatic latest version selection | ||
| - **Status Tracking**: See which mods are installed directly in the Modrinth list | ||
| - **Update Detection**: Automatic detection of available updates with one-click upgrade | ||
| - **Easy Uninstall**: Remove mods/plugins with confirmation and automatic file cleanup | ||
| - **Metadata Management**: Tracks installed versions, filenames, and installation dates | ||
| - **Version Compatibility**: Automatic filtering by Minecraft version and mod loader | ||
| - **Seamless Installation**: Downloads to the correct server directory (mods/ or plugins/) | ||
| - **Multilingual**: Supports English and German translations | ||
|
|
||
| ## How It Works | ||
|
|
||
| ### Installing Mods/Plugins | ||
| 1. Browse or search for mods in the Modrinth list | ||
| 2. Click the **Install** button (download icon) | ||
| 3. The latest compatible version is automatically downloaded and tracked | ||
|
|
||
| ### Managing Installed Mods | ||
| - **Installed** (green check): Mod is installed and up-to-date | ||
| - **Update** (orange refresh): Newer version available - click to upgrade | ||
| - **Uninstall** (red trash): Remove mod from server | ||
|
|
||
| ### Metadata Tracking | ||
| The plugin maintains a `.modrinth-metadata.json` file in your mods/plugins folder that tracks: | ||
| - Project ID and name | ||
| - Installed version ID and number | ||
| - Filename | ||
| - Installation date | ||
|
|
||
| This enables accurate update detection and prevents duplicate installations |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
minecraft-modrinth/resources/views/components/tabs.blade.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <div class="flex justify-center"> | ||
| <x-filament::tabs class="w-auto"> | ||
| <x-filament::tabs.item | ||
| alpine-active="$wire.activeTab === 'all'" | ||
| x-on:click="$wire.setActiveTab('all')" | ||
| > | ||
| {{ trans('minecraft-modrinth::strings.page.view_all') }} | ||
| </x-filament::tabs.item> | ||
|
|
||
| <x-filament::tabs.item | ||
| alpine-active="$wire.activeTab === 'installed'" | ||
| x-on:click="$wire.setActiveTab('installed')" | ||
| > | ||
| {{ trans('minecraft-modrinth::strings.page.view_installed') }} | ||
| </x-filament::tabs.item> | ||
| </x-filament::tabs> | ||
| </div> |
3 changes: 3 additions & 0 deletions
3
minecraft-modrinth/resources/views/modrinth-project-page.blade.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <x-filament-panels::page> | ||
| {{ $this->content }} | ||
| </x-filament-panels::page> |
15 changes: 15 additions & 0 deletions
15
minecraft-modrinth/src/Filament/Components/TabsComponent.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <?php | ||
|
|
||
| namespace Boy132\MinecraftModrinth\Filament\Components; | ||
|
|
||
| use Filament\Schemas\Components\Component; | ||
|
|
||
| class TabsComponent extends Component | ||
| { | ||
| protected string $view = 'minecraft-modrinth::components.tabs'; | ||
|
|
||
| public static function make(): static | ||
| { | ||
| return app(static::class); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
German translations should use "Du" instead of "Sie". (if you don't speak german leave it as is and I will update the translations before merging)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 657e972