Skip to content

Commit ebb0f90

Browse files
committed
Merge branch 'master' into mc1.20
2 parents 416ea8d + e84909a commit ebb0f90

File tree

153 files changed

+2464
-1008
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+2464
-1008
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ FROM eclipse-temurin:21-jre-jammy
22

33
WORKDIR /app
44

5+
ENV BLUEMAP_COMMAND="docker run --rm -it ghcr.io/bluemap-minecraft/bluemap"
6+
57
COPY build/release/*-cli.jar cli.jar
68

79
ENTRYPOINT [ "java", "-jar", "cli.jar" ]

build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// adding this helps intellij with resolving repositories to be able to download library docs and sources
2+
plugins {
3+
bluemap.base
4+
}

buildSrc/src/main/kotlin/bluemap.base.gradle.kts

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
plugins {
2-
java
3-
`java-library`
42
`maven-publish`
5-
id ( "com.diffplug.spotless" )
63
}
74

85
group = "de.bluecolored"
@@ -33,47 +30,6 @@ repositories {
3330
maven ( "https://maven.neoforged.net/releases" )
3431
}
3532

36-
tasks.withType(JavaCompile::class).configureEach {
37-
options.encoding = "utf-8"
38-
}
39-
40-
tasks.withType(AbstractArchiveTask::class).configureEach {
41-
isReproducibleFileOrder = true
42-
isPreserveFileTimestamps = false
43-
}
44-
45-
java {
46-
toolchain.languageVersion = JavaLanguageVersion.of(21)
47-
withSourcesJar()
48-
withJavadocJar()
49-
}
50-
51-
tasks.javadoc {
52-
(options as StandardJavadocDocletOptions).apply {
53-
links(
54-
"https://docs.oracle.com/en/java/javase/21/docs/api/",
55-
"https://javadoc.io/doc/com.flowpowered/flow-math/1.0.3/",
56-
"https://javadoc.io/doc/com.google.code.gson/gson/2.8.9/",
57-
)
58-
addStringOption("Xdoclint:none", "-quiet")
59-
addBooleanOption("html5", true)
60-
}
61-
}
62-
63-
tasks.test {
64-
useJUnitPlatform()
65-
}
66-
67-
spotless {
68-
java {
69-
target ("src/*/java/**/*.java")
70-
71-
licenseHeaderFile(rootProject.file("LICENSE_HEADER"))
72-
indentWithSpaces()
73-
trimTrailingWhitespace()
74-
}
75-
}
76-
7733
publishing {
7834
repositories {
7935
maven {

buildSrc/src/main/kotlin/bluemap.implementation.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id ( "bluemap.base" )
2+
id ( "bluemap.java" )
33
id ( "com.gradleup.shadow" )
44
}
55

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
plugins {
2+
id ( "bluemap.base" )
3+
java
4+
`java-library`
5+
id ( "com.diffplug.spotless" )
6+
}
7+
8+
tasks.withType(JavaCompile::class).configureEach {
9+
options.encoding = "utf-8"
10+
}
11+
12+
tasks.withType(AbstractArchiveTask::class).configureEach {
13+
isReproducibleFileOrder = true
14+
isPreserveFileTimestamps = false
15+
}
16+
17+
java {
18+
toolchain.languageVersion = JavaLanguageVersion.of(21)
19+
withSourcesJar()
20+
withJavadocJar()
21+
}
22+
23+
tasks.javadoc {
24+
(options as StandardJavadocDocletOptions).apply {
25+
links(
26+
"https://docs.oracle.com/en/java/javase/21/docs/api/",
27+
"https://javadoc.io/doc/com.flowpowered/flow-math/1.0.3/",
28+
"https://javadoc.io/doc/com.google.code.gson/gson/2.8.9/",
29+
)
30+
addStringOption("Xdoclint:none", "-quiet")
31+
addBooleanOption("html5", true)
32+
}
33+
}
34+
35+
tasks.test {
36+
useJUnitPlatform()
37+
}
38+
39+
spotless {
40+
java {
41+
target ("src/*/java/**/*.java")
42+
43+
licenseHeaderFile(rootProject.file("LICENSE_HEADER"))
44+
indentWithSpaces()
45+
trimTrailingWhitespace()
46+
}
47+
}

buildSrc/src/main/kotlin/curseforge.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import com.matthewprenger.cursegradle.CurseProject
2-
import gradle.kotlin.dsl.accessors._94345610689fa610403700b47edcf23c.curseforge
32
import org.gradle.api.Action
43
import org.gradle.api.Project
54
import org.gradle.kotlin.dsl.closureOf
65

76
fun Project.curseforgeBlueMap (configuration: Action<CurseProject>) {
7+
val curseforge = extensions.getByName("curseforge")
8+
as com.matthewprenger.cursegradle.CurseExtension
9+
810
curseforge.project(closureOf<CurseProject> {
911
id = "406463"
1012
changelogType = "markdown"

common/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import com.github.gradle.node.npm.task.NpmTask
22
import java.io.IOException
33

44
plugins {
5-
bluemap.base
5+
bluemap.java
66
alias ( libs.plugins.node.gradle )
77
}
88

common/src/main/java/de/bluecolored/bluemap/common/config/CoreConfig.java

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@
2424
*/
2525
package de.bluecolored.bluemap.common.config;
2626

27+
import lombok.Getter;
2728
import org.spongepowered.configurate.objectmapping.ConfigSerializable;
2829

2930
import java.nio.file.Path;
3031

3132
@SuppressWarnings({"FieldMayBeFinal", "FieldCanBeLocal"})
3233
@ConfigSerializable
34+
@Getter
3335
public class CoreConfig {
3436

3537
private boolean acceptDownload = false;
@@ -39,54 +41,22 @@ public class CoreConfig {
3941
private boolean metrics = true;
4042

4143
private Path data = Path.of("bluemap");
42-
4344
private boolean scanForModResources = true;
4445

4546
private LogConfig log = new LogConfig();
4647

47-
public boolean isAcceptDownload() {
48-
return acceptDownload;
49-
}
50-
51-
public int getRenderThreadCount() {
52-
return renderThreadCount;
53-
}
54-
5548
public int resolveRenderThreadCount() {
5649
if (renderThreadCount > 0) return renderThreadCount;
5750
return Math.max(Runtime.getRuntime().availableProcessors() + renderThreadCount, 1);
5851
}
5952

60-
public boolean isMetrics() {
61-
return metrics;
62-
}
63-
64-
public Path getData() {
65-
return data;
66-
}
67-
68-
public boolean isScanForModResources() {
69-
return scanForModResources;
70-
}
71-
72-
public LogConfig getLog() {
73-
return log;
74-
}
75-
7653
@ConfigSerializable
54+
@Getter
7755
public static class LogConfig {
7856

7957
private String file = null;
8058
private boolean append = false;
8159

82-
public String getFile() {
83-
return file;
84-
}
85-
86-
public boolean isAppend() {
87-
return append;
88-
}
89-
9060
}
9161

9262
}

common/src/main/java/de/bluecolored/bluemap/common/config/PluginConfig.java

Lines changed: 8 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,16 @@
2424
*/
2525
package de.bluecolored.bluemap.common.config;
2626

27+
import lombok.Getter;
2728
import org.spongepowered.configurate.objectmapping.ConfigSerializable;
2829

30+
import java.time.Duration;
2931
import java.util.ArrayList;
3032
import java.util.List;
3133

3234
@SuppressWarnings({"FieldMayBeFinal", "FieldCanBeLocal"})
3335
@ConfigSerializable
36+
@Getter
3437
public class PluginConfig {
3538

3639
private boolean livePlayerMarkers = true;
@@ -50,58 +53,15 @@ public class PluginConfig {
5053

5154
private int playerRenderLimit = -1;
5255

56+
private int updateCooldown = 60;
5357
private int fullUpdateInterval = 1440;
5458

55-
public boolean isLivePlayerMarkers() {
56-
return livePlayerMarkers;
59+
public Duration getUpdateCooldown() {
60+
return Duration.ofSeconds(updateCooldown);
5761
}
5862

59-
public List<String> getHiddenGameModes() {
60-
return hiddenGameModes;
61-
}
62-
63-
public boolean isHideVanished() {
64-
return hideVanished;
65-
}
66-
67-
public boolean isHideInvisible() {
68-
return hideInvisible;
69-
}
70-
71-
public boolean isHideSneaking() {
72-
return hideSneaking;
73-
}
74-
75-
public boolean isHideDifferentWorld() {
76-
return hideDifferentWorld;
77-
}
78-
79-
public int getHideBelowSkyLight() {
80-
return hideBelowSkyLight;
81-
}
82-
83-
public int getHideBelowBlockLight() {
84-
return hideBelowBlockLight;
85-
}
86-
87-
public int getWriteMarkersInterval() {
88-
return writeMarkersInterval;
89-
}
90-
91-
public int getWritePlayersInterval() {
92-
return writePlayersInterval;
93-
}
94-
95-
public boolean isSkinDownload() {
96-
return skinDownload;
97-
}
98-
99-
public int getPlayerRenderLimit() {
100-
return playerRenderLimit;
101-
}
102-
103-
public int getFullUpdateInterval() {
104-
return fullUpdateInterval;
63+
public Duration getFullUpdateInterval() {
64+
return Duration.ofMinutes(fullUpdateInterval);
10565
}
10666

10767
}

common/src/main/java/de/bluecolored/bluemap/common/config/WebappConfig.java

Lines changed: 2 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
*/
2525
package de.bluecolored.bluemap.common.config;
2626

27+
import lombok.Getter;
2728
import org.spongepowered.configurate.objectmapping.ConfigSerializable;
2829

2930
import java.nio.file.Path;
@@ -33,6 +34,7 @@
3334

3435
@SuppressWarnings({"FieldMayBeFinal", "FieldCanBeLocal"})
3536
@ConfigSerializable
37+
@Getter
3638
public class WebappConfig {
3739

3840
private boolean enabled = true;
@@ -65,80 +67,8 @@ public class WebappConfig {
6567
private Set<String> scripts = new HashSet<>();
6668
private Set<String> styles = new HashSet<>();
6769

68-
public boolean isEnabled() {
69-
return enabled;
70-
}
71-
72-
public Path getWebroot() {
73-
return webroot;
74-
}
75-
76-
public boolean isUpdateSettingsFile() {
77-
return updateSettingsFile;
78-
}
79-
80-
public boolean isUseCookies() {
81-
return useCookies;
82-
}
83-
84-
public boolean isDefaultToFlatView() {
85-
return defaultToFlatView;
86-
}
87-
8870
public Optional<String> getStartLocation() {
8971
return Optional.ofNullable(startLocation);
9072
}
9173

92-
public float getResolutionDefault() {
93-
return resolutionDefault;
94-
}
95-
96-
public int getMinZoomDistance() {
97-
return minZoomDistance;
98-
}
99-
100-
public int getMaxZoomDistance() {
101-
return maxZoomDistance;
102-
}
103-
104-
public int getHiresSliderMax() {
105-
return hiresSliderMax;
106-
}
107-
108-
public int getHiresSliderDefault() {
109-
return hiresSliderDefault;
110-
}
111-
112-
public int getHiresSliderMin() {
113-
return hiresSliderMin;
114-
}
115-
116-
public int getLowresSliderMax() {
117-
return lowresSliderMax;
118-
}
119-
120-
public int getLowresSliderDefault() {
121-
return lowresSliderDefault;
122-
}
123-
124-
public int getLowresSliderMin() {
125-
return lowresSliderMin;
126-
}
127-
128-
public String getMapDataRoot() {
129-
return mapDataRoot;
130-
}
131-
132-
public String getLiveDataRoot() {
133-
return liveDataRoot;
134-
}
135-
136-
public Set<String> getScripts() {
137-
return scripts;
138-
}
139-
140-
public Set<String> getStyles() {
141-
return styles;
142-
}
143-
14474
}

0 commit comments

Comments
 (0)