diff options
author | embeddedt <42941056+embeddedt@users.noreply.github.com> | 2022-07-11 12:17:35 -0400 |
---|---|---|
committer | embeddedt <42941056+embeddedt@users.noreply.github.com> | 2022-07-11 12:17:35 -0400 |
commit | 9e477ace0acb3ba3f8d48841922b9b1eb2d2bf1e (patch) | |
tree | 799200e997f98da276792f16b6f12e3c6f1483b5 /spark-fabric/src/main/java/me/lucko/spark/fabric/FabricServerConfigProvider.java | |
parent | ecc3714e6441ace0eb78156b2b4475ca050280db (diff) | |
parent | a10f966a443d56845a5efb1e65232e6b87eabb96 (diff) | |
download | spark-9e477ace0acb3ba3f8d48841922b9b1eb2d2bf1e.tar.gz spark-9e477ace0acb3ba3f8d48841922b9b1eb2d2bf1e.tar.bz2 spark-9e477ace0acb3ba3f8d48841922b9b1eb2d2bf1e.zip |
Merge remote-tracking branch 'lucko/master' into forge-1.7.10
Diffstat (limited to 'spark-fabric/src/main/java/me/lucko/spark/fabric/FabricServerConfigProvider.java')
-rw-r--r-- | spark-fabric/src/main/java/me/lucko/spark/fabric/FabricServerConfigProvider.java | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricServerConfigProvider.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricServerConfigProvider.java new file mode 100644 index 0000000..18079d3 --- /dev/null +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricServerConfigProvider.java @@ -0,0 +1,57 @@ +/* + * This file is part of spark. + * + * Copyright (c) lucko (Luck) <luck@lucko.me> + * Copyright (c) contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package me.lucko.spark.fabric; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; + +import me.lucko.spark.common.platform.serverconfig.AbstractServerConfigProvider; +import me.lucko.spark.common.platform.serverconfig.ConfigParser; +import me.lucko.spark.common.platform.serverconfig.PropertiesConfigParser; + +import java.util.Collection; +import java.util.Map; + +public class FabricServerConfigProvider extends AbstractServerConfigProvider { + + /** A map of provided files and their type */ + private static final Map<String, ConfigParser> FILES; + /** A collection of paths to be excluded from the files */ + private static final Collection<String> HIDDEN_PATHS; + + public FabricServerConfigProvider() { + super(FILES, HIDDEN_PATHS); + } + + static { + ImmutableSet.Builder<String> hiddenPaths = ImmutableSet.<String>builder() + .add("server-ip") + .add("motd") + .add("resource-pack") + .add("rcon<dot>password") + .add("level-seed") + .addAll(getSystemPropertyList("spark.serverconfigs.hiddenpaths")); + + FILES = ImmutableMap.of("server.properties", PropertiesConfigParser.INSTANCE); + HIDDEN_PATHS = hiddenPaths.build(); + } + +} |