Move resource files to avoid conflicts

This commit is contained in:
Blue (Lukas Rieger) 2020-08-25 01:39:21 +02:00
parent 8adf2eaccf
commit 72adc573b2
49 changed files with 18 additions and 18 deletions

4
.gitignore vendored
View File

@ -31,8 +31,8 @@ node_modules/
package-lock.json
# exclude generated resource
BlueMapCore/src/main/resources/webroot.zip
BlueMapCore/src/main/resources/resourceExtensions.zip
BlueMapCore/src/main/resources/de/bluecolored/bluemap/webroot.zip
BlueMapCore/src/main/resources/de/bluecolored/bluemap/resourceExtensions.zip
#exclude-test-data
data/test-render

View File

@ -239,7 +239,7 @@ public synchronized ResourcePack getResourcePack() throws IOException, MissingRe
Logger.global.logInfo("Loading resources...");
resourceExtensionsFile.delete();
FileUtils.copyURLToFile(Plugin.class.getResource("/resourceExtensions.zip"), resourceExtensionsFile, 10000, 10000);
FileUtils.copyURLToFile(Plugin.class.getResource("/de/bluecolored/bluemap/resourceExtensions.zip"), resourceExtensionsFile, 10000, 10000);
//find more resource packs
File resourcePackFolder = new File(configFolder, "resourcepacks");
@ -283,8 +283,8 @@ public synchronized CoreConfig getCoreConfig() throws IOException {
if (coreConfig == null) {
coreConfig = new CoreConfig(configManager.loadOrCreate(
getCoreConfigFile(),
Plugin.class.getResource("/core.conf"),
Plugin.class.getResource("/core-defaults.conf"),
Plugin.class.getResource("/de/bluecolored/bluemap/core.conf"),
Plugin.class.getResource("/de/bluecolored/bluemap/core-defaults.conf"),
true,
true
));
@ -301,8 +301,8 @@ public synchronized RenderConfig getRenderConfig() throws IOException {
if (renderConfig == null) {
renderConfig = new RenderConfig(configManager.loadOrCreate(
getRenderConfigFile(),
Plugin.class.getResource("/render.conf"),
Plugin.class.getResource("/render-defaults.conf"),
Plugin.class.getResource("/de/bluecolored/bluemap/render.conf"),
Plugin.class.getResource("/de/bluecolored/bluemap/render-defaults.conf"),
true,
true
));
@ -319,8 +319,8 @@ public synchronized WebServerConfig getWebServerConfig() throws IOException {
if (webServerConfig == null) {
webServerConfig = new WebServerConfig(configManager.loadOrCreate(
getWebServerConfigFile(),
Plugin.class.getResource("/webserver.conf"),
Plugin.class.getResource("/webserver-defaults.conf"),
Plugin.class.getResource("/de/bluecolored/bluemap/webserver.conf"),
Plugin.class.getResource("/de/bluecolored/bluemap/webserver-defaults.conf"),
true,
true
));

View File

@ -54,7 +54,7 @@ task webpackWebroot(type: NpmTask) {
task zipWebroot(type: Zip) {
from fileTree('build/generated/webroot/')
archiveName 'webroot.zip'
destinationDir(file('src/main/resources/'))
destinationDir(file('src/main/resources/de/bluecolored/bluemap/'))
outputs.upToDateWhen { false }
}
@ -70,7 +70,7 @@ task buildWebroot {
task zipResourceExtensions(type: Zip) {
from fileTree('src/main/resourceExtensions')
archiveName 'resourceExtensions.zip'
destinationDir(file('src/main/resources/'))
destinationDir(file('src/main/resources/de/bluecolored/bluemap/'))
outputs.upToDateWhen { false }
}

View File

@ -35,9 +35,9 @@ public class BlueMap {
static {
String version = "DEV";
try {
version = GsonConfigurationLoader.builder().setURL(BlueMap.class.getResource("/version.json")).build().load().getNode("version").getString("DEV");
version = GsonConfigurationLoader.builder().setURL(BlueMap.class.getResource("/de/bluecolored/bluemap/version.json")).build().load().getNode("version").getString("DEV");
} catch (IOException ex) {
Logger.global.logError("Failed to load core.json from resources!", ex);
Logger.global.logError("Failed to load version.json from resources!", ex);
}
if (version.equals("${version}")) version = "DEV";

View File

@ -125,7 +125,7 @@ public ConfigurationNode loadOrCreate(File configFile, URL defaultConfig, URL de
public void loadResourceConfigs(File configFolder, ResourcePack resourcePack) throws IOException {
//load blockColors.json from resources, config-folder and resourcepack
URL blockColorsConfigUrl = BlueMap.class.getResource("/blockColors.json");
URL blockColorsConfigUrl = BlueMap.class.getResource("/de/bluecolored/bluemap/blockColors.json");
File blockColorsConfigFile = new File(configFolder, "blockColors.json");
ConfigurationNode blockColorsConfigNode = loadOrCreate(
blockColorsConfigFile,
@ -138,7 +138,7 @@ public void loadResourceConfigs(File configFolder, ResourcePack resourcePack) th
resourcePack.getBlockColorCalculator().loadColorConfig(blockColorsConfigNode);
//load blockIds.json from resources, config-folder and resourcepack
URL blockIdsConfigUrl = BlueMap.class.getResource("/blockIds.json");
URL blockIdsConfigUrl = BlueMap.class.getResource("/de/bluecolored/bluemap/blockIds.json");
File blockIdsConfigFile = new File(configFolder, "blockIds.json");
ConfigurationNode blockIdsConfigNode = loadOrCreate(
blockIdsConfigFile,
@ -154,7 +154,7 @@ public void loadResourceConfigs(File configFolder, ResourcePack resourcePack) th
);
//load blockProperties.json from resources, config-folder and resourcepack
URL blockPropertiesConfigUrl = BlueMap.class.getResource("/blockProperties.json");
URL blockPropertiesConfigUrl = BlueMap.class.getResource("/de/bluecolored/bluemap/blockProperties.json");
File blockPropertiesConfigFile = new File(configFolder, "blockProperties.json");
ConfigurationNode blockPropertiesConfigNode = loadOrCreate(
blockPropertiesConfigFile,
@ -171,7 +171,7 @@ public void loadResourceConfigs(File configFolder, ResourcePack resourcePack) th
);
//load biomes.json from resources, config-folder and resourcepack
URL biomeConfigUrl = BlueMap.class.getResource("/biomes.json");
URL biomeConfigUrl = BlueMap.class.getResource("/de/bluecolored/bluemap/biomes.json");
File biomeConfigFile = new File(configFolder, "biomes.json");
ConfigurationNode biomeConfigNode = loadOrCreate(
biomeConfigFile,

View File

@ -48,7 +48,7 @@ public boolean needsUpdate() {
}
public void updateFiles() throws IOException {
URL fileResource = getClass().getResource("/webroot.zip");
URL fileResource = getClass().getResource("/de/bluecolored/bluemap/webroot.zip");
File tempFile = File.createTempFile("bluemap_webroot_extraction", null);
try {