From fb5d2bbb2c678a5d9d2ef47adff21c9044a0e6ec Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Mon, 3 Aug 2020 16:19:51 +0200 Subject: [PATCH 1/9] Update loom version --- BlueMapFabric/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BlueMapFabric/build.gradle b/BlueMapFabric/build.gradle index c94a5520..860b9efc 100644 --- a/BlueMapFabric/build.gradle +++ b/BlueMapFabric/build.gradle @@ -1,7 +1,7 @@ import net.fabricmc.loom.task.RemapJarTask plugins { - id 'fabric-loom' version '0.2.7-SNAPSHOT' + id 'fabric-loom' version '0.4-SNAPSHOT' } configurations { From 60a7491e9f9191ee720a3fa40c2e145c2462a465 Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Mon, 3 Aug 2020 16:43:35 +0200 Subject: [PATCH 2/9] Update github upload-artifact action --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 5360794c..bd008bf7 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -17,7 +17,7 @@ jobs: run: ./gradlew test - name: Build with Gradle run: ./gradlew build - - uses: actions/upload-artifact@v2-preview + - uses: actions/upload-artifact@v2 with: name: artifact path: build/release/* From 2a14718f62b5e218aeccf6b3aa991a851102d6df Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Mon, 3 Aug 2020 17:51:07 +0200 Subject: [PATCH 3/9] Add license-header check and fix all missing or invalid license headers --- .../bluemap/bukkit/JavaLogger.java | 2 +- .../bluecolored/bluemap/common/MapType.java | 2 +- BlueMapCore/build.gradle | 4 ++++ .../bluemap/fabric/FabricEventForwarder.java | 24 +++++++++++++++++++ .../bluecolored/bluemap/fabric/FabricMod.java | 24 +++++++++++++++++++ .../bluemap/fabric/Log4jLogger.java | 2 +- .../fabric/events/ChunkFinalizeCallback.java | 24 +++++++++++++++++++ .../fabric/events/WorldSaveCallback.java | 24 +++++++++++++++++++ .../fabric/mixin/MixinChunkGenerator.java | 24 +++++++++++++++++++ .../fabric/mixin/MixinServerWorld.java | 24 +++++++++++++++++++ .../bluemap/forge/Log4jLogger.java | 2 +- .../bluemap/sponge/Slf4jLogger.java | 2 +- HEADER | 24 +++++++++++++++++++ build.gradle | 12 ++++++++++ 14 files changed, 189 insertions(+), 5 deletions(-) create mode 100644 HEADER diff --git a/BlueMapBukkit/src/main/java/de/bluecolored/bluemap/bukkit/JavaLogger.java b/BlueMapBukkit/src/main/java/de/bluecolored/bluemap/bukkit/JavaLogger.java index 433bf667..6f51e64f 100644 --- a/BlueMapBukkit/src/main/java/de/bluecolored/bluemap/bukkit/JavaLogger.java +++ b/BlueMapBukkit/src/main/java/de/bluecolored/bluemap/bukkit/JavaLogger.java @@ -1,5 +1,5 @@ /* - * This file is part of BlueMapSponge, licensed under the MIT License (MIT). + * This file is part of BlueMap, licensed under the MIT License (MIT). * * Copyright (c) Blue (Lukas Rieger) * Copyright (c) contributors diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/MapType.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/MapType.java index 687fa720..188d0b82 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/MapType.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/MapType.java @@ -1,5 +1,5 @@ /* - * This file is part of BlueMapSponge, licensed under the MIT License (MIT). + * This file is part of BlueMap, licensed under the MIT License (MIT). * * Copyright (c) Blue (Lukas Rieger) * Copyright (c) contributors diff --git a/BlueMapCore/build.gradle b/BlueMapCore/build.gradle index 5d189319..bfd61afe 100644 --- a/BlueMapCore/build.gradle +++ b/BlueMapCore/build.gradle @@ -31,6 +31,10 @@ node { download = true } +license { + exclude('**/AABB.java') +} + task fixPackageLock() { if (!file("./package-lock.json").exists()) { file("./package-lock.json").text = "" diff --git a/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java b/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java index d46fd3e5..cc3f74c0 100644 --- a/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java +++ b/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.fabric; import java.io.IOException; diff --git a/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java b/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java index bf095dba..7f75f262 100644 --- a/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java +++ b/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.fabric; import java.io.File; diff --git a/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/Log4jLogger.java b/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/Log4jLogger.java index 41206a3b..2d298f63 100644 --- a/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/Log4jLogger.java +++ b/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/Log4jLogger.java @@ -1,5 +1,5 @@ /* - * This file is part of BlueMapSponge, licensed under the MIT License (MIT). + * This file is part of BlueMap, licensed under the MIT License (MIT). * * Copyright (c) Blue (Lukas Rieger) * Copyright (c) contributors diff --git a/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/events/ChunkFinalizeCallback.java b/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/events/ChunkFinalizeCallback.java index bf20dd88..49de240d 100644 --- a/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/events/ChunkFinalizeCallback.java +++ b/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/events/ChunkFinalizeCallback.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.fabric.events; import com.flowpowered.math.vector.Vector2i; diff --git a/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/events/WorldSaveCallback.java b/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/events/WorldSaveCallback.java index 56b6eeab..25b2ea9f 100644 --- a/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/events/WorldSaveCallback.java +++ b/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/events/WorldSaveCallback.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.fabric.events; import net.fabricmc.fabric.api.event.Event; diff --git a/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinChunkGenerator.java b/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinChunkGenerator.java index cf15eb34..cb61be07 100644 --- a/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinChunkGenerator.java +++ b/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinChunkGenerator.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.fabric.mixin; import org.spongepowered.asm.mixin.Final; diff --git a/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinServerWorld.java b/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinServerWorld.java index fb9e9bc0..a521f0d6 100644 --- a/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinServerWorld.java +++ b/BlueMapFabric/src/main/java/de/bluecolored/bluemap/fabric/mixin/MixinServerWorld.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.fabric.mixin; import org.spongepowered.asm.mixin.Mixin; diff --git a/BlueMapForge/src/main/java/de/bluecolored/bluemap/forge/Log4jLogger.java b/BlueMapForge/src/main/java/de/bluecolored/bluemap/forge/Log4jLogger.java index 50ae484c..39502606 100644 --- a/BlueMapForge/src/main/java/de/bluecolored/bluemap/forge/Log4jLogger.java +++ b/BlueMapForge/src/main/java/de/bluecolored/bluemap/forge/Log4jLogger.java @@ -1,5 +1,5 @@ /* - * This file is part of BlueMapSponge, licensed under the MIT License (MIT). + * This file is part of BlueMap, licensed under the MIT License (MIT). * * Copyright (c) Blue (Lukas Rieger) * Copyright (c) contributors diff --git a/BlueMapSponge/src/main/java/de/bluecolored/bluemap/sponge/Slf4jLogger.java b/BlueMapSponge/src/main/java/de/bluecolored/bluemap/sponge/Slf4jLogger.java index 9c3787e4..7c873747 100644 --- a/BlueMapSponge/src/main/java/de/bluecolored/bluemap/sponge/Slf4jLogger.java +++ b/BlueMapSponge/src/main/java/de/bluecolored/bluemap/sponge/Slf4jLogger.java @@ -1,5 +1,5 @@ /* - * This file is part of BlueMapSponge, licensed under the MIT License (MIT). + * This file is part of BlueMap, licensed under the MIT License (MIT). * * Copyright (c) Blue (Lukas Rieger) * Copyright (c) contributors diff --git a/HEADER b/HEADER new file mode 100644 index 00000000..0473d5e9 --- /dev/null +++ b/HEADER @@ -0,0 +1,24 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ \ No newline at end of file diff --git a/build.gradle b/build.gradle index fef52440..26457e38 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,7 @@ plugins { id 'java' id 'com.github.johnrengelman.shadow' version '5.1.0' + id 'com.github.hierynomus.license' version '0.15.0' } allprojects { @@ -41,6 +42,17 @@ allprojects { group = 'de.bluecolored.bluemap' version = coreVersion + '-' + targetVersion + + apply plugin: 'license' + license { + header rootProject.file('HEADER') + excludes([ + '*.conf', + '*.yml', + '*.zip', + '*.json' + ]) + } } subprojects { From 62c8306b8c6d1c9764fcfa538feb2b29ae2a272b Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Thu, 6 Aug 2020 17:25:54 +0200 Subject: [PATCH 4/9] Add a button to clear the browsers (tile) cache and reload them --- .../src/main/webroot/js/libs/BlueMap.js | 24 +++++++++++++++---- BlueMapCore/src/main/webroot/js/libs/ui/UI.js | 8 +++++++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/BlueMapCore/src/main/webroot/js/libs/BlueMap.js b/BlueMapCore/src/main/webroot/js/libs/BlueMap.js index b94afaa9..b0fea56e 100644 --- a/BlueMapCore/src/main/webroot/js/libs/BlueMap.js +++ b/BlueMapCore/src/main/webroot/js/libs/BlueMap.js @@ -57,13 +57,14 @@ import SKY_VERTEX_SHADER from './shaders/SkyVertexShader.js'; import SKY_FRAGMENT_SHADER from './shaders/SkyFragmentShader.js'; import { stringToImage, pathFromCoords } from './utils.js'; -import {getCookie, setCookie} from "./utils"; +import {cachePreventionNr, getCookie, setCookie} from "./utils"; export default class BlueMap { constructor(element, dataRoot) { this.element = $('
').appendTo(element)[0]; this.dataRoot = dataRoot; this.locationHash = ''; + this.cacheSuffix = ''; this.hiresViewDistance = 160; this.lowresViewDistance = 3200; @@ -112,6 +113,17 @@ export default class BlueMap { }); } + reloadMap() { + if (this.hiresTileManager !== undefined){ + this.hiresTileManager.removeAllTiles(); + this.hiresTileManager.update(); + } + if (this.lowresTileManager !== undefined){ + this.lowresTileManager.removeAllTiles(); + this.lowresTileManager.update(); + } + } + changeMap(map, loadTiles = true) { if (this.debugInfo) console.debug("changing map: ", map); @@ -310,7 +322,7 @@ export default class BlueMap { async loadSettings() { return new Promise(resolve => { - this.fileLoader.load(this.dataRoot + 'settings.json', settings => { + this.fileLoader.load(this.dataRoot + 'settings.json?' + cachePreventionNr(), settings => { try { this.settings = JSON.parse(settings); this.maps = []; @@ -379,6 +391,7 @@ export default class BlueMap { this.hiresViewDistance = this.loadUserSetting("hiresViewDistance", this.hiresViewDistance); this.lowresViewDistance = this.loadUserSetting("lowresViewDistance", this.lowresViewDistance); this.controls.settings.zoom.max = this.loadUserSetting("maxZoomDistance", this.controls.settings.zoom.max); + this.cacheSuffix = this.loadUserSetting("cacheSuffix", this.cacheSuffix); this.debugInfo = this.loadUserSetting("debugInfo", this.debugInfo); } @@ -393,6 +406,7 @@ export default class BlueMap { this.saveUserSetting("hiresViewDistance", this.hiresViewDistance); this.saveUserSetting("lowresViewDistance", this.lowresViewDistance); this.saveUserSetting("maxZoomDistance", this.controls.settings.zoom.max); + this.saveUserSetting("cacheSuffix", this.cacheSuffix); this.saveUserSetting("debugInfo", this.debugInfo); } @@ -427,7 +441,7 @@ export default class BlueMap { async loadHiresMaterial() { return new Promise(resolve => { - this.fileLoader.load(this.dataRoot + 'textures.json', textures => { + this.fileLoader.load(this.dataRoot + 'textures.json?' + cachePreventionNr(), textures => { textures = JSON.parse(textures); let materials = []; for (let i = 0; i < textures['textures'].length; i++) { @@ -501,7 +515,7 @@ export default class BlueMap { async loadHiresTile(tileX, tileZ) { let path = this.dataRoot + this.map + '/hires/'; path += pathFromCoords(tileX, tileZ); - path += '.json'; + path += '.json?' + this.cacheSuffix; return new Promise((resolve, reject) => { this.bufferGeometryLoader.load(path, geometry => { @@ -522,7 +536,7 @@ export default class BlueMap { async loadLowresTile(tileX, tileZ) { let path = this.dataRoot + this.map + '/lowres/'; path += pathFromCoords(tileX, tileZ); - path += '.json'; + path += '.json?' + this.cacheSuffix; return new Promise((reslove, reject) => { this.bufferGeometryLoader.load(path, geometry => { diff --git a/BlueMapCore/src/main/webroot/js/libs/ui/UI.js b/BlueMapCore/src/main/webroot/js/libs/ui/UI.js index 2a623745..8481d0e4 100644 --- a/BlueMapCore/src/main/webroot/js/libs/ui/UI.js +++ b/BlueMapCore/src/main/webroot/js/libs/ui/UI.js @@ -41,6 +41,8 @@ import NIGHT from '../../../assets/night.svg'; import HudInfo from "../hud/HudInfo"; import MarkerManager from "../hud/MarkerManager"; +import {cachePreventionNr} from "../utils"; + export default class UI { constructor(blueMap) { @@ -101,6 +103,11 @@ export default class UI { this.blueMap.debugInfo = button.isSelected(); }); + let clearCache = new Button("clear tile cache", button => { + this.blueMap.cacheSuffix = cachePreventionNr(); + this.blueMap.reloadMap(); + }); + //toolbar this.toolbar.addElement(menuButton); this.toolbar.addElement(mapSelect); @@ -128,6 +135,7 @@ export default class UI { this.menu.addElement(lowresSlider); this.menu.addElement(extendedZoom); this.menu.addElement(new Separator()); + this.menu.addElement(clearCache); this.menu.addElement(debugInfo); this.menu.update(); } From c23335df7c1e07ae353becff58f9ed27f035fb8c Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Sat, 8 Aug 2020 10:39:22 +0200 Subject: [PATCH 5/9] Add 0.0.0.0 support for webserver and make it the default config value --- BlueMapBukkit/src/main/resources/bluemap-bukkit.conf | 3 ++- BlueMapCLI/src/main/resources/bluemap-cli.conf | 5 +++-- .../java/de/bluecolored/bluemap/core/config/MainConfig.java | 5 ++++- BlueMapFabric/src/main/resources/bluemap-fabric.conf | 3 ++- BlueMapForge/src/main/resources/bluemap-forge.conf | 3 ++- BlueMapSponge/src/main/resources/bluemap-sponge.conf | 3 ++- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/BlueMapBukkit/src/main/resources/bluemap-bukkit.conf b/BlueMapBukkit/src/main/resources/bluemap-bukkit.conf index d5070bb3..c3a60ee9 100644 --- a/BlueMapBukkit/src/main/resources/bluemap-bukkit.conf +++ b/BlueMapBukkit/src/main/resources/bluemap-bukkit.conf @@ -47,8 +47,9 @@ webserver { enabled: true # The IP-Adress that the webserver binds to. - # If this setting is commented out, bluemap tries to find the default ip-adress of your system. + # Use "0.0.0.0" to bind to all available local adresses. # If you only want to access it locally use "localhost". + # Default is "0.0.0.0" #ip: "localhost" #ip: "127.0.0.1" diff --git a/BlueMapCLI/src/main/resources/bluemap-cli.conf b/BlueMapCLI/src/main/resources/bluemap-cli.conf index d2e1ee4f..5ee2904e 100644 --- a/BlueMapCLI/src/main/resources/bluemap-cli.conf +++ b/BlueMapCLI/src/main/resources/bluemap-cli.conf @@ -44,10 +44,11 @@ webserver { # With this setting you can enable the integrated web-server. # Default is disabled enabled: false - + # The IP-Adress that the webserver binds to. - # If this setting is commented out, bluemap tries to find the default ip-adress of your system. + # Use "0.0.0.0" to bind to all available local adresses. # If you only want to access it locally use "localhost". + # Default is "0.0.0.0" #ip: "localhost" #ip: "127.0.0.1" diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/config/MainConfig.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/config/MainConfig.java index 767be0d4..1e1b820e 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/config/MainConfig.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/config/MainConfig.java @@ -27,6 +27,7 @@ import java.io.File; import java.io.IOException; import java.net.InetAddress; +import java.net.InetSocketAddress; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; @@ -109,7 +110,9 @@ private void loadWebConfig(ConfigurationNode node) throws IOException { if (webserverEnabled) { //ip String webserverBindAdressString = node.getNode("ip").getString(""); - if (webserverBindAdressString.isEmpty()) { + if (webserverBindAdressString.isEmpty() || webserverBindAdressString.equals("0.0.0.0") || webserverBindAdressString.equals("::0")) { + webserverBindAdress = new InetSocketAddress(0).getAddress(); // 0.0.0.0 + } else if (webserverBindAdressString.equals("#getLocalHost")) { webserverBindAdress = InetAddress.getLocalHost(); } else { webserverBindAdress = InetAddress.getByName(webserverBindAdressString); diff --git a/BlueMapFabric/src/main/resources/bluemap-fabric.conf b/BlueMapFabric/src/main/resources/bluemap-fabric.conf index 8b740ce2..af9edf92 100644 --- a/BlueMapFabric/src/main/resources/bluemap-fabric.conf +++ b/BlueMapFabric/src/main/resources/bluemap-fabric.conf @@ -47,8 +47,9 @@ webserver { enabled: true # The IP-Adress that the webserver binds to. - # If this setting is commented out, bluemap tries to find the default ip-adress of your system. + # Use "0.0.0.0" to bind to all available local adresses. # If you only want to access it locally use "localhost". + # Default is "0.0.0.0" #ip: "localhost" #ip: "127.0.0.1" diff --git a/BlueMapForge/src/main/resources/bluemap-forge.conf b/BlueMapForge/src/main/resources/bluemap-forge.conf index 8b740ce2..af9edf92 100644 --- a/BlueMapForge/src/main/resources/bluemap-forge.conf +++ b/BlueMapForge/src/main/resources/bluemap-forge.conf @@ -47,8 +47,9 @@ webserver { enabled: true # The IP-Adress that the webserver binds to. - # If this setting is commented out, bluemap tries to find the default ip-adress of your system. + # Use "0.0.0.0" to bind to all available local adresses. # If you only want to access it locally use "localhost". + # Default is "0.0.0.0" #ip: "localhost" #ip: "127.0.0.1" diff --git a/BlueMapSponge/src/main/resources/bluemap-sponge.conf b/BlueMapSponge/src/main/resources/bluemap-sponge.conf index 22784691..c97e6ea8 100644 --- a/BlueMapSponge/src/main/resources/bluemap-sponge.conf +++ b/BlueMapSponge/src/main/resources/bluemap-sponge.conf @@ -42,8 +42,9 @@ webserver { enabled: true # The IP-Adress that the webserver binds to. - # If this setting is commented out, bluemap tries to find the default ip-adress of your system. + # Use "0.0.0.0" to bind to all available local adresses. # If you only want to access it locally use "localhost". + # Default is "0.0.0.0" #ip: "localhost" #ip: "127.0.0.1" From a0e3b0c2af975a0cd23a78feae36977499b39e0a Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Sat, 8 Aug 2020 10:40:14 +0200 Subject: [PATCH 6/9] Small bugfix in the webapp --- BlueMapCore/src/main/webroot/js/libs/BlueMap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BlueMapCore/src/main/webroot/js/libs/BlueMap.js b/BlueMapCore/src/main/webroot/js/libs/BlueMap.js index b0fea56e..e736a919 100644 --- a/BlueMapCore/src/main/webroot/js/libs/BlueMap.js +++ b/BlueMapCore/src/main/webroot/js/libs/BlueMap.js @@ -109,7 +109,7 @@ export default class BlueMap { await this.ui.load(); this.start(); }).catch(error => { - this.onLoadError("Initialization: " + error.toString()); + this.onLoadError("Initialization: " + (error ? error.toString() : "unknown")); }); } From 2421d978dea67d2172bcefc21139b5b9b8689536 Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Sat, 15 Aug 2020 13:42:11 +0200 Subject: [PATCH 7/9] Update readme --- README.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 94c1f666..f4fe0530 100644 --- a/README.md +++ b/README.md @@ -2,21 +2,18 @@ BlueMap is a tool that generates 3d-maps of your Minecraft worlds and displays them in your browser. Take a look at [this demo](https://bluecolored.de/bluemap). It is really easy to set up - almost plug-and-play - if you use the integrated web-server (optional). -The Sponge/Spigot-Plugin automatically updates your map as soon as something changes in your world, as well as rendering newly generated terrain and managing the render-tasks. +The plugins/mods automatically update your map as soon as something changes in your world, as well as rendering newly generated terrain and managing the render-tasks. -**BlueMap is currently in an early development state!** +**BlueMap is currently in a BETA state!** -A lot of features are still missing, and some blocks - especially some tile-entities - will not render correctly/at all. +It is however already quite stable and usable. There are just some features still missing, and some blocks - especially tile-entities - will not render correctly/at all. See below for a list of what is planned for future releases. ### Download You can choose a version and download BlueMap from [here](https://github.com/BlueMap-Minecraft/BlueMap/releases). ### Using BlueMap -BlueMap can be used on the command-line, or as a plugin for your Sponge/Spigot/Paper-Server. Read the [wiki](https://github.com/BlueMap-Minecraft/BlueMap/wiki) to get started! - -### Discord -If you have a question, help others using BlueMap or get the latest news and info you are welcome to join us [on Discord](https://discord.gg/zmkyJa3)! +BlueMap can be used on the command-line, or as a plugin/mod for your Sponge/Spigot/Paper/Forge/Fabric-Server. Read the [wiki](https://github.com/BlueMap-Minecraft/BlueMap/wiki) to get started! ### Clone If you have git installed, simply use the command `git clone --recursive https://github.com/BlueMap-Minecraft/BlueMap.git` to clone BlueMap. @@ -32,17 +29,19 @@ You found a bug, have another issue or a suggestion? Please create an issue [her You are welcome to contribute! Just create a pull request with your changes :) -If you want to have your changes merged faster, make sure they are complete, documented and well tested! +**If you want to have your changes merged, make sure they are complete, documented and well tested!** + +Keep in mind that we have to maintain all new features and keep supporting them in the future. +This means we always can decide to not accept a PR for any reason. The `master`-branch is for the latest version of minecraft. The `mc/xx`-branches are for other minecraft-versions. -Changes that apply to all versions should be made on the `mc/1.13`-branch. This branch can be merged into `master` and every other `mc/xx` branch. +**Changes that apply to all versions should be based on the** `base` **branch.** This branch can be merged into `master` and every other `mc/xx` branch. ### Todo / planned features Here is a *(surely incomplete)* list of things that i want to include in future versions. *(They are not in any specific order. There is no guarantee that any of those things will ever be included.)* - live player positions -- fabric version - render more tile-entities (banners, shulker-chests, etc..) - render entities (armor-stands, item-frames, maybe even cows and such..) - free-flight-controls @@ -51,3 +50,8 @@ Here is a *(surely incomplete)* list of things that i want to include in future - ability to display the world-border - animated textures (if feasible) - add support for models in obj format (if feasible) + +### Links +**Wiki:** https://bluecolo.red/map-wiki
+**Reddit:** https://www.reddit.com/r/BlueMap
+**Discord:** https://bluecolo.red/map-discord
From 9e5d6cb15d6add06fd88fad9cff20f835c77dc71 Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Sat, 15 Aug 2020 13:51:14 +0200 Subject: [PATCH 8/9] Only build on release-branches --- .github/workflows/gradle.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index bd008bf7..1d7253da 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,6 +1,12 @@ name: Java CI -on: [push] +on: + push: + branches: + - master + - mc/1.12 + - mc/1.13 + - mc/1.15 jobs: build: From 51e94f7c2593fb52a9d159ea8f8b2d5ce6b879c1 Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Sat, 15 Aug 2020 13:55:21 +0200 Subject: [PATCH 9/9] All versions are unsupported on base branch --- BlueMapBukkit/build.gradle | 2 +- BlueMapForge/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BlueMapBukkit/build.gradle b/BlueMapBukkit/build.gradle index 279f8461..aaebb326 100644 --- a/BlueMapBukkit/build.gradle +++ b/BlueMapBukkit/build.gradle @@ -21,7 +21,7 @@ dependencies { } build.dependsOn shadowJar { - destinationDir = file '../build/release' + destinationDir = file '../build/unsupported' archiveFileName = "BlueMap-${version}-bukkit.jar" //relocate 'com.flowpowered.math', 'de.bluecolored.shadow.flowpowered.math' //DON'T relocate this, because the API depends on it diff --git a/BlueMapForge/build.gradle b/BlueMapForge/build.gradle index eea31226..6660743a 100644 --- a/BlueMapForge/build.gradle +++ b/BlueMapForge/build.gradle @@ -33,7 +33,7 @@ dependencies { } build.dependsOn shadowJar { - destinationDir = file '../build/release' + destinationDir = file '../build/unsupported' archiveFileName = "BlueMap-${version}-forge.jar" configurations = [project.configurations.include]