diff --git a/common/src/main/java/net/draycia/carbon/common/messages/CarbonMessages.java b/common/src/main/java/net/draycia/carbon/common/messages/CarbonMessages.java index fa8bbda8..79bffcbb 100644 --- a/common/src/main/java/net/draycia/carbon/common/messages/CarbonMessages.java +++ b/common/src/main/java/net/draycia/carbon/common/messages/CarbonMessages.java @@ -549,4 +549,13 @@ public interface CarbonMessages { @Message("integrations.mcmmo.cannot_use_party_channel") Component cannotUseMcmmoPartyChannel(Audience audience); + @Message("integrations.fuuid.cannot_use_faction_channel") + Component cannotUseFactionChannel(Audience audience); + + @Message("integrations.fuuid.cannot_use_alliance_channel") + Component cannotUseFactionAllianceChannel(Audience audience); + + @Message("integrations.fuuid.cannot_use_truce_channel") + Component cannotUseTruceChannel(Audience audience); + } diff --git a/common/src/main/resources/locale/messages-en_US.properties b/common/src/main/resources/locale/messages-en_US.properties index 5bd0d427..3148c6bc 100644 --- a/common/src/main/resources/locale/messages-en_US.properties +++ b/common/src/main/resources/locale/messages-en_US.properties @@ -153,3 +153,6 @@ integrations.towny.cannot_use_alliance_channel=You must join an alliance to integrations.towny.cannot_use_nation_channel=You must join a nation to use this channel. integrations.towny.cannot_use_town_channel=You must join a town to use this channel. integrations.mcmmo.cannot_use_party_channel=You must join an mcMMO party to use this channel. +integrations.fuuid.cannot_use_faction_channel=You must join a faction to use this channel. +integrations.fuuid.cannot_use_alliance_channel=You must join an alliance to use this channel. +integrations.fuuid.cannot_use_truce_channel=You must have a truce with another faction to use this channel. diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ae773114..49c0bb73 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -51,6 +51,7 @@ nats = "2.16.14" h2 = "2.2.224" towny = "0.100.0.2" mcmmo = "2.1.225" +fuuid = "1.6.9.5-U0.6.33" # synced with version used by lowest supported mc (currently 1.19.4 on paper) gson = "2.10" @@ -139,3 +140,4 @@ placeholderapi = { group = "me.clip", name = "placeholderapi", version.ref = "pl miniplaceholders = { group = "io.github.miniplaceholders", name = "miniplaceholders-api", version.ref = "miniplaceholders" } towny = { group = "com.palmergames.bukkit.towny", name = "towny", version.ref = "towny" } mcmmo = { group = "com.gmail.nossr50.mcMMO", name = "mcMMO", version.ref = "mcmmo" } +factionsUuid = { group = "com.massivecraft", name = "Factions", version.ref = "fuuid" } diff --git a/paper/build.gradle.kts b/paper/build.gradle.kts index d5951eea..07467d51 100644 --- a/paper/build.gradle.kts +++ b/paper/build.gradle.kts @@ -35,6 +35,7 @@ dependencies { compileOnly(libs.mcmmo) { isTransitive = false } + compileOnly(libs.factionsUuid) runtimeDownload(libs.guice) { exclude("com.google.guava") @@ -43,6 +44,7 @@ dependencies { configurablePlugins.dependency(libs.towny) configurablePlugins.dependency(libs.mcmmo) +configurablePlugins.dependency(libs.factionsUuid) tasks { shadowJar { @@ -86,6 +88,7 @@ paper { // Integrations dependency("Towny", PaperPluginDescription.Load.BEFORE, false) dependency("mcMMO", PaperPluginDescription.Load.BEFORE, false) + dependency("Factions", PaperPluginDescription.Load.BEFORE, false) } bukkit { diff --git a/paper/src/main/java/net/draycia/carbon/paper/CarbonChatPaperModule.java b/paper/src/main/java/net/draycia/carbon/paper/CarbonChatPaperModule.java index f8da0d06..da19e740 100644 --- a/paper/src/main/java/net/draycia/carbon/paper/CarbonChatPaperModule.java +++ b/paper/src/main/java/net/draycia/carbon/paper/CarbonChatPaperModule.java @@ -43,6 +43,7 @@ import net.draycia.carbon.common.users.ProfileResolver; import net.draycia.carbon.common.util.CloudUtils; import net.draycia.carbon.paper.command.PaperCommander; import net.draycia.carbon.paper.command.PaperPlayerCommander; +import net.draycia.carbon.paper.integration.fuuid.FactionsIntegration; import net.draycia.carbon.paper.integration.mcmmo.McmmoIntegration; import net.draycia.carbon.paper.integration.towny.TownyIntegration; import net.draycia.carbon.paper.listeners.PaperChatListener; @@ -132,6 +133,9 @@ public final class CarbonChatPaperModule extends CarbonPlatformModule { integrations.addBinding().to(McmmoIntegration.class); configs.addBinding().toInstance(McmmoIntegration.configMeta()); + + integrations.addBinding().to(FactionsIntegration.class); + configs.addBinding().toInstance(FactionsIntegration.configMeta()); } private void configureListeners() { diff --git a/paper/src/main/java/net/draycia/carbon/paper/integration/fuuid/AbstractFactionsChannel.java b/paper/src/main/java/net/draycia/carbon/paper/integration/fuuid/AbstractFactionsChannel.java new file mode 100644 index 00000000..08240416 --- /dev/null +++ b/paper/src/main/java/net/draycia/carbon/paper/integration/fuuid/AbstractFactionsChannel.java @@ -0,0 +1,51 @@ +/* + * CarbonChat + * + * Copyright (c) 2023 Josua Parks (Vicarious) + * 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 . + */ +package net.draycia.carbon.paper.integration.fuuid; + +import com.massivecraft.factions.FPlayer; +import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.Faction; +import com.massivecraft.factions.perms.Relation; +import net.draycia.carbon.api.users.CarbonPlayer; +import net.draycia.carbon.common.channels.ConfigChatChannel; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.checkerframework.framework.qual.DefaultQualifier; +import org.jspecify.annotations.NonNull; + +@DefaultQualifier(NonNull.class) +abstract class AbstractFactionsChannel extends ConfigChatChannel { + + protected final @Nullable Faction faction(final CarbonPlayer player) { + final FPlayer fPlayer = FPlayers.getInstance().getById(player.uuid().toString()); + + if (fPlayer == null || !fPlayer.hasFaction()) { + return null; + } + + return fPlayer.getFaction(); + } + + protected final boolean hasRelations(final CarbonPlayer player, final Relation relation) { + final @Nullable Faction faction = this.faction(player); + + return faction != null && faction.getRelationCount(relation) > 0; + } + +} diff --git a/paper/src/main/java/net/draycia/carbon/paper/integration/fuuid/AllianceChannel.java b/paper/src/main/java/net/draycia/carbon/paper/integration/fuuid/AllianceChannel.java new file mode 100644 index 00000000..b0dcdcf7 --- /dev/null +++ b/paper/src/main/java/net/draycia/carbon/paper/integration/fuuid/AllianceChannel.java @@ -0,0 +1,126 @@ +/* + * CarbonChat + * + * Copyright (c) 2023 Josua Parks (Vicarious) + * 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 . + */ +package net.draycia.carbon.paper.integration.fuuid; + +import com.google.inject.Inject; +import com.massivecraft.factions.FPlayer; +import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.Faction; +import com.massivecraft.factions.perms.Relation; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import net.draycia.carbon.api.channels.ChannelPermissionResult; +import net.draycia.carbon.api.users.CarbonPlayer; +import net.draycia.carbon.api.users.UserManager; +import net.draycia.carbon.common.channels.messages.ConfigChannelMessageSource; +import net.draycia.carbon.common.messages.CarbonMessages; +import net.kyori.adventure.audience.Audience; +import net.kyori.adventure.key.Key; +import org.bukkit.entity.Player; +import org.checkerframework.checker.nullness.qual.MonotonicNonNull; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.checkerframework.framework.qual.DefaultQualifier; +import org.spongepowered.configurate.objectmapping.ConfigSerializable; + +import static net.draycia.carbon.api.channels.ChannelPermissionResult.channelPermissionResult; + +@DefaultQualifier(NonNull.class) +@ConfigSerializable +public class AllianceChannel extends AbstractFactionsChannel { + + public static final String FILE_NAME = "factionsuuid-alliancechat.conf"; + + private transient @MonotonicNonNull @Inject CarbonMessages messages; + private transient @MonotonicNonNull @Inject UserManager users; + + public AllianceChannel() { + this.key = Key.key("carbon", "alliancechat"); + this.commandAliases = List.of("ac"); + + this.messageSource = new ConfigChannelMessageSource(); + this.messageSource.defaults = Map.of( + "default_format", "(alliance: %factionsuuid_faction_name%) : ", + "console", "[alliance: %factionsuuid_faction_name%] : " + ); + } + + @Override + public ChannelPermissionResult speechPermitted(final CarbonPlayer player) { + return channelPermissionResult( + this.hasRelations(player, Relation.ALLY), + () -> this.messages.cannotUseFactionAllianceChannel(player) + ); + } + + @Override + public ChannelPermissionResult hearingPermitted(final CarbonPlayer player) { + return channelPermissionResult( + this.hasRelations(player, Relation.ALLY), + () -> this.messages.cannotUseFactionAllianceChannel(player) + ); + } + + @Override + public List recipients(final CarbonPlayer sender) { + if (!this.hasRelations(sender, Relation.ALLY)) { + if (sender.online()) { + sender.sendMessage(this.messages.cannotUseFactionAllianceChannel(sender)); + } + + return Collections.emptyList(); + } + + final List recipients = new ArrayList<>(); + for (final Player player : this.alliedPlayersTo(sender)) { + final @Nullable CarbonPlayer carbon = this.users.user(player.getUniqueId()).getNow(null); + if (carbon != null) { + recipients.add(carbon); + } + } + + recipients.add(this.server.console()); + + return recipients; + } + + private List alliedPlayersTo(final CarbonPlayer player) { + final @Nullable Faction faction = this.faction(player); + + if (faction == null) { + return List.of(); + } + + final List alliedPlayers = new ArrayList<>(); + + for (final FPlayer onlinePlayer : FPlayers.getInstance().getOnlinePlayers()) { + final Relation relation = faction.getRelationTo(onlinePlayer); + + if (relation.isAtLeast(Relation.ALLY)) { + alliedPlayers.add(onlinePlayer.getPlayer()); + } + } + + return alliedPlayers; + } + +} diff --git a/paper/src/main/java/net/draycia/carbon/paper/integration/fuuid/FactionChannel.java b/paper/src/main/java/net/draycia/carbon/paper/integration/fuuid/FactionChannel.java new file mode 100644 index 00000000..f975fa1b --- /dev/null +++ b/paper/src/main/java/net/draycia/carbon/paper/integration/fuuid/FactionChannel.java @@ -0,0 +1,105 @@ +/* + * CarbonChat + * + * Copyright (c) 2023 Josua Parks (Vicarious) + * 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 . + */ +package net.draycia.carbon.paper.integration.fuuid; + +import com.google.inject.Inject; +import com.massivecraft.factions.Faction; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import net.draycia.carbon.api.channels.ChannelPermissionResult; +import net.draycia.carbon.api.users.CarbonPlayer; +import net.draycia.carbon.api.users.UserManager; +import net.draycia.carbon.common.channels.messages.ConfigChannelMessageSource; +import net.draycia.carbon.common.messages.CarbonMessages; +import net.kyori.adventure.audience.Audience; +import net.kyori.adventure.key.Key; +import org.bukkit.entity.Player; +import org.checkerframework.checker.nullness.qual.MonotonicNonNull; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.checkerframework.framework.qual.DefaultQualifier; +import org.spongepowered.configurate.objectmapping.ConfigSerializable; + +import static net.draycia.carbon.api.channels.ChannelPermissionResult.channelPermissionResult; + +@DefaultQualifier(NonNull.class) +@ConfigSerializable +public class FactionChannel extends AbstractFactionsChannel { + + public static final String FILE_NAME = "factionsuuid-factionchat.conf"; + + private transient @MonotonicNonNull @Inject CarbonMessages messages; + private transient @MonotonicNonNull @Inject UserManager users; + + public FactionChannel() { + this.key = Key.key("carbon", "factionchat"); + this.commandAliases = List.of("fc"); + + this.messageSource = new ConfigChannelMessageSource(); + this.messageSource.defaults = Map.of( + "default_format", "(faction: %factionsuuid_faction_name%) : ", + "console", "[faction: %factionsuuid_faction_name%] : " + ); + } + + @Override + public ChannelPermissionResult speechPermitted(final CarbonPlayer player) { + return channelPermissionResult( + this.faction(player) != null, + () -> this.messages.cannotUseFactionChannel(player) + ); + } + + @Override + public ChannelPermissionResult hearingPermitted(final CarbonPlayer player) { + return channelPermissionResult( + this.faction(player) != null, + () -> this.messages.cannotUseFactionChannel(player) + ); + } + + @Override + public List recipients(final CarbonPlayer sender) { + final @Nullable Faction faction = this.faction(sender); + + if (faction == null) { + if (sender.online()) { + sender.sendMessage(this.messages.cannotUseFactionChannel(sender)); + } + + return Collections.emptyList(); + } + + final List recipients = new ArrayList<>(); + for (final Player player : faction.getOnlinePlayers()) { + final @Nullable CarbonPlayer carbon = this.users.user(player.getUniqueId()).getNow(null); + if (carbon != null) { + recipients.add(carbon); + } + } + + recipients.add(this.server.console()); + + return recipients; + } + +} diff --git a/paper/src/main/java/net/draycia/carbon/paper/integration/fuuid/FactionsIntegration.java b/paper/src/main/java/net/draycia/carbon/paper/integration/fuuid/FactionsIntegration.java new file mode 100644 index 00000000..6b4f0571 --- /dev/null +++ b/paper/src/main/java/net/draycia/carbon/paper/integration/fuuid/FactionsIntegration.java @@ -0,0 +1,79 @@ +/* + * CarbonChat + * + * Copyright (c) 2023 Josua Parks (Vicarious) + * 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 . + */ +package net.draycia.carbon.paper.integration.fuuid; + +import com.google.inject.Inject; +import net.draycia.carbon.common.channels.CarbonChannelRegistry; +import net.draycia.carbon.common.config.ConfigManager; +import net.draycia.carbon.common.integration.Integration; +import org.bukkit.Bukkit; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.framework.qual.DefaultQualifier; +import org.spongepowered.configurate.objectmapping.ConfigSerializable; + +@DefaultQualifier(NonNull.class) +public final class FactionsIntegration implements Integration { + + private final CarbonChannelRegistry channelRegistry; + private final Config config; + + @Inject + public FactionsIntegration( + final CarbonChannelRegistry channelRegistry, + final ConfigManager configManager + ) { + this.channelRegistry = channelRegistry; + this.config = this.config(configManager, configMeta()); + } + + @Override + public boolean eligible() { + return this.config.enabled && Bukkit.getPluginManager().isPluginEnabled("Factions"); + } + + @Override + public void register() { + if (this.config.factionChannel) { + this.channelRegistry.registerSpecialConfigChannel(FactionChannel.FILE_NAME, FactionChannel.class); + } + if (this.config.allianceChannel) { + this.channelRegistry.registerSpecialConfigChannel(AllianceChannel.FILE_NAME, AllianceChannel.class); + } + if (this.config.truceChannel) { + this.channelRegistry.registerSpecialConfigChannel(TruceChannel.FILE_NAME, TruceChannel.class); + } + } + + public static ConfigMeta configMeta() { + return Integration.configMeta("factionsuuid", FactionsIntegration.Config.class); + } + + @ConfigSerializable + public static final class Config { + + boolean enabled = true; + + boolean factionChannel = true; + boolean allianceChannel = true; + boolean truceChannel = true; + + } + +} diff --git a/paper/src/main/java/net/draycia/carbon/paper/integration/fuuid/TruceChannel.java b/paper/src/main/java/net/draycia/carbon/paper/integration/fuuid/TruceChannel.java new file mode 100644 index 00000000..7fa8fcaa --- /dev/null +++ b/paper/src/main/java/net/draycia/carbon/paper/integration/fuuid/TruceChannel.java @@ -0,0 +1,126 @@ +/* + * CarbonChat + * + * Copyright (c) 2023 Josua Parks (Vicarious) + * 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 . + */ +package net.draycia.carbon.paper.integration.fuuid; + +import com.google.inject.Inject; +import com.massivecraft.factions.FPlayer; +import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.Faction; +import com.massivecraft.factions.perms.Relation; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import net.draycia.carbon.api.channels.ChannelPermissionResult; +import net.draycia.carbon.api.users.CarbonPlayer; +import net.draycia.carbon.api.users.UserManager; +import net.draycia.carbon.common.channels.messages.ConfigChannelMessageSource; +import net.draycia.carbon.common.messages.CarbonMessages; +import net.kyori.adventure.audience.Audience; +import net.kyori.adventure.key.Key; +import org.bukkit.entity.Player; +import org.checkerframework.checker.nullness.qual.MonotonicNonNull; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.checkerframework.framework.qual.DefaultQualifier; +import org.spongepowered.configurate.objectmapping.ConfigSerializable; + +import static net.draycia.carbon.api.channels.ChannelPermissionResult.channelPermissionResult; + +@DefaultQualifier(NonNull.class) +@ConfigSerializable +public class TruceChannel extends AbstractFactionsChannel { + + public static final String FILE_NAME = "factionsuuid-trucechat.conf"; + + private transient @MonotonicNonNull @Inject CarbonMessages messages; + private transient @MonotonicNonNull @Inject UserManager users; + + public TruceChannel() { + this.key = Key.key("carbon", "trucechat"); + this.commandAliases = List.of("tc"); + + this.messageSource = new ConfigChannelMessageSource(); + this.messageSource.defaults = Map.of( + "default_format", "(truce: %factionsuuid_faction_name%) : ", + "console", "[truce: %factionsuuid_faction_name%] : " + ); + } + + @Override + public ChannelPermissionResult speechPermitted(final CarbonPlayer player) { + return channelPermissionResult( + this.hasRelations(player, Relation.TRUCE), + () -> this.messages.cannotUseTruceChannel(player) + ); + } + + @Override + public ChannelPermissionResult hearingPermitted(final CarbonPlayer player) { + return channelPermissionResult( + this.hasRelations(player, Relation.TRUCE), + () -> this.messages.cannotUseTruceChannel(player) + ); + } + + @Override + public List recipients(final CarbonPlayer sender) { + if (!this.hasRelations(sender, Relation.TRUCE)) { + if (sender.online()) { + sender.sendMessage(this.messages.cannotUseTruceChannel(sender)); + } + + return Collections.emptyList(); + } + + final List recipients = new ArrayList<>(); + for (final Player player : this.hasTruceWith(sender)) { + final @Nullable CarbonPlayer carbon = this.users.user(player.getUniqueId()).getNow(null); + if (carbon != null) { + recipients.add(carbon); + } + } + + recipients.add(this.server.console()); + + return recipients; + } + + private List hasTruceWith(final CarbonPlayer player) { + final @Nullable Faction faction = this.faction(player); + + if (faction == null) { + return List.of(); + } + + final List alliedPlayers = new ArrayList<>(); + + for (final FPlayer onlinePlayer : FPlayers.getInstance().getOnlinePlayers()) { + final Relation relation = faction.getRelationTo(onlinePlayer); + + if (relation.isAtLeast(Relation.TRUCE)) { + alliedPlayers.add(onlinePlayer.getPlayer()); + } + } + + return alliedPlayers; + } + +} diff --git a/paper/src/main/java/net/draycia/carbon/paper/integration/towny/AllianceChannel.java b/paper/src/main/java/net/draycia/carbon/paper/integration/towny/AllianceChannel.java index f171b2e6..04db850a 100644 --- a/paper/src/main/java/net/draycia/carbon/paper/integration/towny/AllianceChannel.java +++ b/paper/src/main/java/net/draycia/carbon/paper/integration/towny/AllianceChannel.java @@ -37,7 +37,7 @@ import org.spongepowered.configurate.objectmapping.ConfigSerializable; @ConfigHeader(ResidentListChannel.TOWNY_CHANNEL_HEADER) public class AllianceChannel extends NationChannel { - public static final String FILE_NAME = "alliancechat.conf"; + public static final String FILE_NAME = "towny-alliancechat.conf"; public AllianceChannel() { this.key = Key.key("carbon", "alliancechat"); diff --git a/paper/src/main/java/net/draycia/carbon/paper/integration/towny/NationChannel.java b/paper/src/main/java/net/draycia/carbon/paper/integration/towny/NationChannel.java index 6c45367e..e494517a 100644 --- a/paper/src/main/java/net/draycia/carbon/paper/integration/towny/NationChannel.java +++ b/paper/src/main/java/net/draycia/carbon/paper/integration/towny/NationChannel.java @@ -38,7 +38,7 @@ import org.spongepowered.configurate.objectmapping.ConfigSerializable; @ConfigHeader(ResidentListChannel.TOWNY_CHANNEL_HEADER) public class NationChannel extends ResidentListChannel { - public static final String FILE_NAME = "nationchat.conf"; + public static final String FILE_NAME = "towny-nationchat.conf"; public NationChannel() { this.key = Key.key("carbon", "nationchat"); diff --git a/paper/src/main/java/net/draycia/carbon/paper/integration/towny/TownChannel.java b/paper/src/main/java/net/draycia/carbon/paper/integration/towny/TownChannel.java index c5143296..0bf208c8 100644 --- a/paper/src/main/java/net/draycia/carbon/paper/integration/towny/TownChannel.java +++ b/paper/src/main/java/net/draycia/carbon/paper/integration/towny/TownChannel.java @@ -38,7 +38,7 @@ import org.spongepowered.configurate.objectmapping.ConfigSerializable; @ConfigHeader(ResidentListChannel.TOWNY_CHANNEL_HEADER) public class TownChannel extends ResidentListChannel { - public static final String FILE_NAME = "townchat.conf"; + public static final String FILE_NAME = "towny-townchat.conf"; public TownChannel() { this.key = Key.key("carbon", "townchat"); diff --git a/renovate.json b/renovate.json index 4464a77a..eeb55e05 100644 --- a/renovate.json +++ b/renovate.json @@ -20,6 +20,11 @@ "matchPackageNames": ["net.fabricmc.fabric-api:fabric-api", "net.fabricmc.fabric-api:fabric-api-deprecated"], "versioning": "regex:^(?\\d+)(\\.(?\\d+))?(\\.(?\\d+))?(?:\\+(?.*))?$" }, + { + "description": "Correct FactionsUUID version handling", + "matchPackageNames": ["com.massivecraft:Factions"], + "versioning": "regex:^1\\.6\\.9\\.5\\-U(?\\d+)(\\.(?\\d+))?(\\.(?\\d+))?$" + }, { "matchManagers": ["github-actions", "gradle-wrapper"], "groupName": "gradle and github actions" diff --git a/settings.gradle.kts b/settings.gradle.kts index 0fc3955a..30c087fc 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -53,6 +53,10 @@ dependencyResolutionManagement { maven("https://repo.glaremasters.me/repository/towny/") { content { includeGroup("com.palmergames.bukkit.towny") } } + // FactionsUUID + maven("https://ci.ender.zone/plugin/repository/everything/") { + content { includeGroup("com.massivecraft") } + } } repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) } @@ -78,7 +82,7 @@ plugins { rootProject.name = "CarbonChat" -sequenceOf( +listOf( "api", "common", "paper",