mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-04 23:47:59 +01:00
Inline nullable and nonnull annotations
This commit is contained in:
parent
51409705e1
commit
a749f07a3f
@ -133,8 +133,7 @@ public final class DiscoveredExtension {
|
|||||||
return originalJar;
|
return originalJar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
public @NotNull Path getDataDirectory() {
|
||||||
public Path getDataDirectory() {
|
|
||||||
return dataDirectory;
|
return dataDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,8 +85,7 @@ public abstract class Extension {
|
|||||||
return logger;
|
return logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
public @NotNull Path getDataDirectory() {
|
||||||
public Path getDataDirectory() {
|
|
||||||
return getOrigin().getDataDirectory();
|
return getOrigin().getDataDirectory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,8 +100,7 @@ public abstract class Extension {
|
|||||||
* @param fileName The file to read
|
* @param fileName The file to read
|
||||||
* @return The file contents, or null if there was an issue reading the file.
|
* @return The file contents, or null if there was an issue reading the file.
|
||||||
*/
|
*/
|
||||||
@Nullable
|
public @Nullable InputStream getResource(@NotNull String fileName) {
|
||||||
public InputStream getResource(@NotNull String fileName) {
|
|
||||||
return getResource(Paths.get(fileName));
|
return getResource(Paths.get(fileName));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,8 +115,7 @@ public abstract class Extension {
|
|||||||
* @param target The file to read
|
* @param target The file to read
|
||||||
* @return The file contents, or null if there was an issue reading the file.
|
* @return The file contents, or null if there was an issue reading the file.
|
||||||
*/
|
*/
|
||||||
@Nullable
|
public @Nullable InputStream getResource(@NotNull Path target) {
|
||||||
public InputStream getResource(@NotNull Path target) {
|
|
||||||
final Path targetFile = getDataDirectory().resolve(target);
|
final Path targetFile = getDataDirectory().resolve(target);
|
||||||
try {
|
try {
|
||||||
// Copy from jar if the file does not exist in the extension data directory.
|
// Copy from jar if the file does not exist in the extension data directory.
|
||||||
@ -141,7 +138,7 @@ public abstract class Extension {
|
|||||||
* @param fileName The file to read
|
* @param fileName The file to read
|
||||||
* @return The file contents, or null if there was an issue reading the file.
|
* @return The file contents, or null if there was an issue reading the file.
|
||||||
*/
|
*/
|
||||||
public InputStream getPackagedResource(@NotNull String fileName) {
|
public @Nullable InputStream getPackagedResource(@NotNull String fileName) {
|
||||||
return getPackagedResource(Paths.get(fileName));
|
return getPackagedResource(Paths.get(fileName));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,8 +150,7 @@ public abstract class Extension {
|
|||||||
* @param target The file to read
|
* @param target The file to read
|
||||||
* @return The file contents, or null if there was an issue reading the file.
|
* @return The file contents, or null if there was an issue reading the file.
|
||||||
*/
|
*/
|
||||||
@Nullable
|
public @Nullable InputStream getPackagedResource(@NotNull Path target) {
|
||||||
public InputStream getPackagedResource(@NotNull Path target) {
|
|
||||||
try {
|
try {
|
||||||
final URL url = getOrigin().getMinestomExtensionClassLoader().getResource(target.toString());
|
final URL url = getOrigin().getMinestomExtensionClassLoader().getResource(target.toString());
|
||||||
if (url == null) {
|
if (url == null) {
|
||||||
|
@ -574,8 +574,7 @@ public class ExtensionManager {
|
|||||||
return extensionFolder;
|
return extensionFolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
public @NotNull Path getExtensionDataRoot() {
|
||||||
public Path getExtensionDataRoot() {
|
|
||||||
return extensionDataRoot;
|
return extensionDataRoot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user