Disable relational MiniPlaceholders by default

With MP v2, we would add "non-relational placeholders for sender (principal)" and then "placeholders for viewer (principal), in relation to sender", as was our understanding of how relational placeholders should generally be used in PlaceholderAPI and MiniPlaceholders.

With MP v3, we must add both tag resolvers and pass a relational audience to MiniMessage. The issue is that the principal audience for non-relational placeholders then becomes the viewer instead of the sender.

Pending any change in how relational MiniPlaceholders work (or how they should be used according to the dev), we will disable them by default to reduce the need for render_for tags to effectively disable this new principal audience swap behavior in formats.

If relational support is desired, you will need to deal with the consequences, including how preprocess tags inherently do not play nice with render_for due to how MiniMessage parsing works.
This commit is contained in:
Jason Penilla committed 2025-12-14 20:30:05 -07:00
1 parent 76e8b69d1c
commit 91f00da371
11 files changed
+96 -24

No files matched your search

@@ -37,7 +37,6 @@ import net.draycia.carbon.common.channels.CarbonChannelRegistry;
import net.draycia.carbon.common.command.ExecutionCoordinatorHolder;
import net.draycia.carbon.common.config.ConfigManager;
import net.draycia.carbon.common.config.MessagingSettings;
import net.draycia.carbon.common.integration.miniplaceholders.MiniPlaceholdersExpansion;
import net.draycia.carbon.common.messages.CarbonMessages;
import net.draycia.carbon.common.messaging.MessagingManager;
import net.draycia.carbon.common.users.PlatformUserManager;
@@ -96,6 +95,7 @@ public final class CarbonChatPaper extends CarbonChatInternal {
void onEnable() {
this.init();
this.initIntegrations();
final Set<Listener> listeners = this.injector().getInstance(Key.get(new TypeLiteral<Set<Listener>>() {}));
for (final Listener listener : listeners) {
@@ -134,8 +134,6 @@ public final class CarbonChatPaper extends CarbonChatInternal {
}
private void registerPlaceholders() {
MiniPlaceholdersExpansion.register(this.injector());
if (papiLoaded()) {
this.injector().getInstance(PAPIChatHook.class);
this.injector().getInstance(CarbonPAPIPlaceholders.class);
@@ -121,6 +121,8 @@ public final class CarbonChatPaperModule extends CarbonPlatformModule {
@Override
protected void configureIntegrations(final Multibinder<Integration> integrations, final Multibinder<Integration.ConfigMeta> configs) {
super.configureIntegrations(integrations, configs);
integrations.addBinding().to(TownyIntegration.class);
configs.addBinding().toInstance(TownyIntegration.configMeta());
@@ -26,6 +26,7 @@ import io.github.miniplaceholders.api.MiniPlaceholders;
import java.util.function.Supplier;
import net.draycia.carbon.api.users.CarbonPlayer;
import net.draycia.carbon.common.config.ConfigManager;
import net.draycia.carbon.common.integration.miniplaceholders.MiniPlaceholdersIntegration;
import net.draycia.carbon.common.integration.miniplaceholders.MiniPlaceholdersUtil;
import net.draycia.carbon.common.messages.CarbonMessageRenderer;
import net.draycia.carbon.common.messages.RenderForTagResolver;
@@ -114,7 +115,10 @@ public class PaperMessageRenderer extends CarbonMessageRenderer {
}
if (MiniPlaceholdersUtil.miniPlaceholdersLoaded()) {
tagResolver.resolver(MiniPlaceholders.relationalPlaceholders());
final MiniPlaceholdersIntegration.Config miniplaceholdersConfig = this.configManager.primaryConfig().integrations().config(MiniPlaceholdersIntegration.configMeta());
if (miniplaceholdersConfig.relationalPlaceholders) {
tagResolver.resolver(MiniPlaceholders.relationalPlaceholders());
}
}
if (this.hasPlaceholderAPI()) {
return this.placeholderApiProcessor.get().parseRelational(recipientBukkitPlayer,