Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various changes #29

Merged
merged 2 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.26</version>
<version>1.18.32</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package me.metallicgoat.tweaksaddon.config;

import de.marcely.bedwars.api.arena.Team;
import de.marcely.bedwars.api.game.spawner.DropType;
import de.marcely.bedwars.tools.Helper;
import de.marcely.bedwars.tools.VarParticle;
Expand All @@ -9,7 +8,6 @@
import java.util.List;
import me.metallicgoat.tweaksaddon.utils.Console;
import me.metallicgoat.tweaksaddon.utils.Util;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration;
Expand Down Expand Up @@ -247,30 +245,6 @@ public static void loadOldMain(FileConfiguration config) {
}
}

MainConfig.custom_team_colors_enabled = config.getBoolean("Custom-Team-Chat-Color.Enabled", false);
{
if (config.contains("Custom-Team-Chat-Color.Teams")) {

final HashMap<Team, ChatColor> map = new HashMap<>();

for (String string : config.getStringList("Custom-Team-Chat-Color.Teams")) {

if (!string.contains(":"))
continue;

final String[] strings = string.split(":");
final Team team = Team.getByName(strings[0]);
final ChatColor chatColor = ChatColor.getByChar(strings[1].charAt(0));

if (team != null && chatColor != null) {
map.put(team, chatColor);
}
}

MainConfig.custom_team_colors = map;
}
}

MainConfig.permanent_effects_enabled = config.getBoolean("Permanent-Effects.Enabled", false);
loadPermanentEffects(config, "Permanent-Effects.Effects");

Expand Down
13 changes: 0 additions & 13 deletions src/main/java/me/metallicgoat/tweaksaddon/config/ConfigLoader.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package me.metallicgoat.tweaksaddon.config;

import de.marcely.bedwars.api.arena.Team;
import de.marcely.bedwars.api.configuration.ConfigurationAPI;
import de.marcely.bedwars.api.event.ConfigsLoadEvent;
import de.marcely.bedwars.tools.Helper;
Expand All @@ -10,15 +9,13 @@
import me.metallicgoat.tweaksaddon.gentiers.TierAction;
import me.metallicgoat.tweaksaddon.utils.Console;
import me.metallicgoat.tweaksaddon.utils.Util;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map.Entry;

public class ConfigLoader implements Listener {

Expand Down Expand Up @@ -58,8 +55,6 @@ public static void loadTweaksConfigs(MBedwarsTweaksPlugin plugin) {
ConfigManager.load(plugin, SwordsToolsConfig.class, FileType.SWORDS_TOOLS);
GenTiersConfig.load(); // We load gen tiers a special way

applyCustomTeamColors();

overrideMBedwarsConfigs();

final long end = System.currentTimeMillis();
Expand Down Expand Up @@ -107,14 +102,6 @@ public static HashMap<Integer, GenTierLevel> getDefaultGenTiers() {
}};
}

private static void applyCustomTeamColors() {
if (!MainConfig.custom_team_colors_enabled)
return;

for (Entry<Team, ChatColor> entry : MainConfig.custom_team_colors.entrySet())
entry.getKey().setBungeeChatColor(entry.getValue());
}

private static void overrideMBedwarsConfigs() {
// Configure MBedwars to work like our old feature did
if (MainConfig.personal_ender_chests_enabled) {
Expand Down
13 changes: 0 additions & 13 deletions src/main/java/me/metallicgoat/tweaksaddon/config/MainConfig.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package me.metallicgoat.tweaksaddon.config;

import de.marcely.bedwars.api.arena.Team;
import de.marcely.bedwars.api.game.spawner.DropType;
import de.marcely.bedwars.tools.Helper;
import de.marcely.bedwars.tools.NMSHelper;
Expand All @@ -13,7 +12,6 @@
import lombok.Getter;
import me.metallicgoat.tweaksaddon.config.ConfigManager.Config;
import me.metallicgoat.tweaksaddon.config.ConfigManager.SectionTitle;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.Material;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.potion.PotionEffect;
Expand Down Expand Up @@ -358,17 +356,6 @@ public class MainConfig {
public static boolean block_stat_change_enabled = false;
@Config public static List<String> block_stat_change_arenas = new ArrayList<>();

@Config(
description = {
"Change default team chat colors",
"Add teams like: \"DefaultTeamName: ChatColorName\"",
}
)
public static boolean custom_team_colors_enabled = false;
@Config public static HashMap<Team, ChatColor> custom_team_colors = new HashMap<Team, ChatColor>() {{
put(Team.CYAN, ChatColor.DARK_AQUA);
}};

@Config(
description = {
"Permanent effects players have while playing",
Expand Down
Loading