-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from aternosorg/fix-paper-remapped-paths
Remove ".paper-remapped/" from plugin path
- Loading branch information
Showing
36 changed files
with
4,754 additions
and
221 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,63 @@ | ||
<?php | ||
|
||
namespace Aternos\Codex\Minecraft\Analysis\Problem\Bukkit; | ||
|
||
use Aternos\Codex\Analysis\InsightInterface; | ||
use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallDifferentVersionSolution; | ||
use Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution; | ||
|
||
/** | ||
* Class PluginFileProblem | ||
* | ||
* Represents a problem with a Bukkit plugin file and provides: | ||
* - The plugins' file path {@see PluginFileProblem::getPluginFilePath()} | ||
* - {@link PluginInstallDifferentVersionSolution} and {@link FileDeleteSolution} | ||
* - All features from {@link PluginProblem} (extends {@link PluginProblem}) | ||
* | ||
* @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit | ||
*/ | ||
abstract class PluginFileProblem extends PluginProblem | ||
{ | ||
protected ?string $pluginFilePath = null; | ||
|
||
/** | ||
* @return string|null | ||
*/ | ||
public function getPluginFilePath(): ?string | ||
{ | ||
return $this->pluginFilePath; | ||
} | ||
|
||
/** | ||
* Apply the matches from the pattern | ||
* | ||
* @param array $matches | ||
* @param mixed $patternKey | ||
* @return void | ||
*/ | ||
public function setMatches(array $matches, mixed $patternKey): void | ||
{ | ||
// worldedit-bukkit-7.3.4-beta-01.jar OR .paper-remapped/worldedit-bukkit-7.3.4-beta-01.jar | ||
$pluginFileName = $this->extractPluginFileName($matches[1]); | ||
// plugins OR plugins/.paper-remapped | ||
$folderPath = $this->correctPluginPath($matches[2]); | ||
|
||
$this->pluginFilePath = $folderPath . '/' . $pluginFileName; | ||
$this->pluginName = $this->extractPluginName($matches[1]); | ||
|
||
$this->addSolution((new PluginInstallDifferentVersionSolution())->setPluginName($this->getPluginName())); | ||
$this->addSolution((new FileDeleteSolution())->setRelativePath($this->getPluginFilePath())); | ||
} | ||
|
||
/** | ||
* @param InsightInterface $insight | ||
* @return bool | ||
*/ | ||
public function isEqual(InsightInterface $insight): bool | ||
{ | ||
return parent::isEqual($insight) | ||
&& $insight instanceof static | ||
&& $this->getPluginFilePath() === $insight->getPluginFilePath(); | ||
} | ||
|
||
} |
This file contains 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 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
Oops, something went wrong.