-
Notifications
You must be signed in to change notification settings - Fork 56
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 #360 from Lapzupi/issue/ia-addon
Fixed an issue with addons
- Loading branch information
Showing
8 changed files
with
149 additions
and
23 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
41 changes: 41 additions & 0 deletions
41
...c/main/java/com/oheers/fish/api/addons/exceptions/IncorrectAssignedMaterialException.java
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,41 @@ | ||
package com.oheers.fish.api.addons.exceptions; | ||
|
||
|
||
/** | ||
* This exception is thrown when an incorrect assigned material is encountered. | ||
* It provides information about the configuration location and the ID of the incorrect material. | ||
*/ | ||
public class IncorrectAssignedMaterialException extends Exception { | ||
private final String id; | ||
private final String configLocation; | ||
|
||
/** | ||
* Constructs a new IncorrectAssignedMaterialException with the specified configuration location and ID. | ||
* | ||
* @param configLocation the location of the configuration file where the incorrect material is assigned | ||
* @param id the ID of the incorrect material | ||
*/ | ||
public IncorrectAssignedMaterialException(String configLocation, String id) { | ||
super(String.format("%s has an incorrect assigned material: %s", configLocation, id)); | ||
this.id = id; | ||
this.configLocation = configLocation; | ||
} | ||
|
||
/** | ||
* Returns the ID of the incorrect material. | ||
* | ||
* @return the ID of the incorrect material | ||
*/ | ||
public String getId() { | ||
return id; | ||
} | ||
|
||
/** | ||
* Returns the location of the configuration file where the incorrect material is assigned. | ||
* | ||
* @return the location of the configuration file | ||
*/ | ||
public String getConfigLocation() { | ||
return configLocation; | ||
} | ||
} |
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
31 changes: 31 additions & 0 deletions
31
...-more-fish-api/src/main/java/com/oheers/fish/api/addons/exceptions/NoPrefixException.java
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,31 @@ | ||
package com.oheers.fish.api.addons.exceptions; | ||
|
||
|
||
/** | ||
* This exception is thrown when a prefix is not found. | ||
*/ | ||
public class NoPrefixException extends Exception { | ||
/** | ||
* The prefix causing the exception. | ||
*/ | ||
private final String prefix; | ||
|
||
/** | ||
* Constructs a new `NoPrefixException` with the specified prefix. | ||
* | ||
* @param prefix the prefix causing the exception | ||
*/ | ||
public NoPrefixException(String prefix) { | ||
super(String.format("No such prefix: %s, did you install the addon?", prefix)); | ||
this.prefix = prefix; | ||
} | ||
|
||
/** | ||
* Returns the prefix causing the exception. | ||
* | ||
* @return the prefix causing the exception | ||
*/ | ||
public String getPrefix() { | ||
return prefix; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...ish-api/src/main/java/com/oheers/fish/api/addons/exceptions/PluginNotLoadedException.java
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,30 @@ | ||
package com.oheers.fish.api.addons.exceptions; | ||
|
||
|
||
/** | ||
* Custom exception class for when a plugin has not been loaded. | ||
*/ | ||
public class PluginNotLoadedException extends Exception { | ||
|
||
/** The name of the plugin that has not been loaded. */ | ||
private final String pluginName; | ||
|
||
/** | ||
* Constructs a PluginNotLoadedException with the specified plugin name. | ||
* | ||
* @param pluginName the name of the plugin that has not been loaded | ||
*/ | ||
public PluginNotLoadedException(String pluginName) { | ||
super(String.format("%s has not loaded yet.", pluginName)); | ||
this.pluginName = pluginName; | ||
} | ||
|
||
/** | ||
* Gets the name of the plugin associated with this exception. | ||
* | ||
* @return the name of the plugin | ||
*/ | ||
public String getPluginName() { | ||
return pluginName; | ||
} | ||
} |
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