mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 22:31:52 +00:00
ignore hidden files when loading addons
This commit is contained in:
+7
-5
@@ -65,7 +65,7 @@ public class ManifestAddonLoader implements BootstrapBaseAddon<ManifestAddon> {
|
|||||||
AddonManifest manifest = manifestLoader.load(new AddonManifest(),
|
AddonManifest manifest = manifestLoader.load(new AddonManifest(),
|
||||||
new YamlConfiguration(jar.getInputStream(manifestEntry),
|
new YamlConfiguration(jar.getInputStream(manifestEntry),
|
||||||
"terra.addon.yml"));
|
"terra.addon.yml"));
|
||||||
|
|
||||||
logger.debug("Loading addon {}@{}", manifest.getID(), manifest.getVersion().getFormatted());
|
logger.debug("Loading addon {}@{}", manifest.getID(), manifest.getVersion().getFormatted());
|
||||||
|
|
||||||
if(manifest.getSchemaVersion() != 1) {
|
if(manifest.getSchemaVersion() != 1) {
|
||||||
@@ -107,10 +107,12 @@ public class ManifestAddonLoader implements BootstrapBaseAddon<ManifestAddon> {
|
|||||||
logger.debug("Loading addons...");
|
logger.debug("Loading addons...");
|
||||||
|
|
||||||
try(Stream<Path> files = Files.walk(addonsFolder, 1, FileVisitOption.FOLLOW_LINKS)) {
|
try(Stream<Path> files = Files.walk(addonsFolder, 1, FileVisitOption.FOLLOW_LINKS)) {
|
||||||
List<Path> addons = files.filter(path -> path.toFile().isFile())
|
List<Path> addons = files
|
||||||
.filter(path -> path.toFile().canRead())
|
.filter(path -> path.toFile().isFile())
|
||||||
.filter(path -> path.toString().endsWith(".jar"))
|
.filter(path -> path.toFile().canRead())
|
||||||
.toList();
|
.filter(path -> !path.getFileName().startsWith(".")) // ignore hidden files.
|
||||||
|
.filter(path -> path.toString().endsWith(".jar"))
|
||||||
|
.toList();
|
||||||
|
|
||||||
ManifestAddonClassLoader loader = new ManifestAddonClassLoader(addons.stream().map(path -> {
|
ManifestAddonClassLoader loader = new ManifestAddonClassLoader(addons.stream().map(path -> {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user