3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-09-19 18:40:05 +02:00
ViaBackwards/common/src/main/java/com/viaversion/viabackwards/ViaBackwardsConfig.java

86 Zeilen
2.5 KiB
Java

2021-03-20 23:12:25 +01:00
/*
2021-03-23 11:11:01 +01:00
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
2021-03-20 23:12:25 +01:00
* Copyright (C) 2016-2021 ViaVersion and 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/>.
*/
2021-04-26 23:31:29 +02:00
package com.viaversion.viabackwards;
2021-04-26 23:24:49 +02:00
import com.viaversion.viaversion.util.Config;
import java.io.File;
import java.net.URL;
import java.util.Collections;
import java.util.List;
import java.util.Map;
2021-04-26 23:31:29 +02:00
public class ViaBackwardsConfig extends Config implements com.viaversion.viabackwards.api.ViaBackwardsConfig {
2019-12-24 09:57:11 +01:00
private boolean addCustomEnchantsToLore;
private boolean addTeamColorToPrefix;
2020-01-12 10:07:22 +01:00
private boolean fix1_13FacePlayer;
private boolean alwaysShowOriginalMobName;
public ViaBackwardsConfig(File configFile) {
super(configFile);
}
2019-12-24 09:57:11 +01:00
@Override
public void reloadConfig() {
super.reloadConfig();
loadFields();
}
private void loadFields() {
addCustomEnchantsToLore = getBoolean("add-custom-enchants-into-lore", true);
addTeamColorToPrefix = getBoolean("add-teamcolor-to-prefix", true);
fix1_13FacePlayer = getBoolean("fix-1_13-face-player", false);
alwaysShowOriginalMobName = getBoolean("always-show-original-mob-name", true);
2019-12-24 09:57:11 +01:00
}
@Override
public boolean addCustomEnchantsToLore() {
2019-12-24 09:57:11 +01:00
return addCustomEnchantsToLore;
}
@Override
public boolean addTeamColorTo1_13Prefix() {
return addTeamColorToPrefix;
}
2020-01-12 10:07:22 +01:00
@Override
public boolean isFix1_13FacePlayer() {
return fix1_13FacePlayer;
}
@Override
public boolean alwaysShowOriginalMobName() {
return alwaysShowOriginalMobName;
}
@Override
public URL getDefaultConfigURL() {
return getClass().getClassLoader().getResource("assets/viabackwards/config.yml");
}
@Override
protected void handleConfig(Map<String, Object> map) {
}
@Override
public List<String> getUnsupportedOptions() {
return Collections.emptyList();
}
}