Initial commit

This commit is contained in:
2022-09-17 10:49:36 +02:00
parent 1e8420a83e
commit 59a6e1c423
368 changed files with 26176 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
package eu.mhsl.minenet.minigames;
import eu.mhsl.minenet.minigames.util.ResourceUtils;
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Path;
/**
* Predefined resources which are extracted on Runtime
*/
public enum Resource {
HUB_MAP("maps/hub"),
LOBBY_MAP("maps/lobby"),
RBB("rbb"),
LOCALES("lang"),
SCHEMATICS("schematics");
private final Path path;
private final String name;
Resource(String name) {
this.name = name;
this.path = Path.of("resources/" + name);
try {
System.out.print("extracting resource " + name + " ... ");
ResourceUtils.extractResource(name);
System.out.println("ok");
} catch (URISyntaxException | IOException e) {
throw new RuntimeException(e);
}
}
public Path getPath() {
return path;
}
public String getName() {
return name;
}
}