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 package-lock.json
# exclude generated resource # exclude generated resource
BlueMapCore/src/main/resources/webroot.zip BlueMapCore/src/main/resources/de/bluecolored/bluemap/webroot.zip
BlueMapCore/src/main/resources/resourceExtensions.zip BlueMapCore/src/main/resources/de/bluecolored/bluemap/resourceExtensions.zip
#exclude-test-data #exclude-test-data
data/test-render data/test-render

View File

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

View File

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

View File

@ -35,9 +35,9 @@ public class BlueMap {
static { static {
String version = "DEV"; String version = "DEV";
try { 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) { } 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"; 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 { public void loadResourceConfigs(File configFolder, ResourcePack resourcePack) throws IOException {
//load blockColors.json from resources, config-folder and resourcepack //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"); File blockColorsConfigFile = new File(configFolder, "blockColors.json");
ConfigurationNode blockColorsConfigNode = loadOrCreate( ConfigurationNode blockColorsConfigNode = loadOrCreate(
blockColorsConfigFile, blockColorsConfigFile,
@ -138,7 +138,7 @@ public void loadResourceConfigs(File configFolder, ResourcePack resourcePack) th
resourcePack.getBlockColorCalculator().loadColorConfig(blockColorsConfigNode); resourcePack.getBlockColorCalculator().loadColorConfig(blockColorsConfigNode);
//load blockIds.json from resources, config-folder and resourcepack //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"); File blockIdsConfigFile = new File(configFolder, "blockIds.json");
ConfigurationNode blockIdsConfigNode = loadOrCreate( ConfigurationNode blockIdsConfigNode = loadOrCreate(
blockIdsConfigFile, blockIdsConfigFile,
@ -154,7 +154,7 @@ public void loadResourceConfigs(File configFolder, ResourcePack resourcePack) th
); );
//load blockProperties.json from resources, config-folder and resourcepack //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"); File blockPropertiesConfigFile = new File(configFolder, "blockProperties.json");
ConfigurationNode blockPropertiesConfigNode = loadOrCreate( ConfigurationNode blockPropertiesConfigNode = loadOrCreate(
blockPropertiesConfigFile, blockPropertiesConfigFile,
@ -171,7 +171,7 @@ public void loadResourceConfigs(File configFolder, ResourcePack resourcePack) th
); );
//load biomes.json from resources, config-folder and resourcepack //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"); File biomeConfigFile = new File(configFolder, "biomes.json");
ConfigurationNode biomeConfigNode = loadOrCreate( ConfigurationNode biomeConfigNode = loadOrCreate(
biomeConfigFile, biomeConfigFile,

View File

@ -48,7 +48,7 @@ public boolean needsUpdate() {
} }
public void updateFiles() throws IOException { 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); File tempFile = File.createTempFile("bluemap_webroot_extraction", null);
try { try {