L

add reload command: /chatmention reload. add mention toggle command: /mention toggle. mentions not showing to bedrock players, add support for bedrock edition. Update the plugin to 8.0

Kodari AI
KodariApr 3 at 1:05 pm 19,581 (v2)
  • Add ToggleManager, BedrockHelper, and two command classes

  • Bedrock name resolution: Floodgate adds a prefix (e.g. .) to Bedrock player names, so @CosmicGamer won’t match .CosmicGamer without stripping that prefix — fix in MentionListener

  • Update version to 8.0, register commands, add Floodgate softdepend

Here’s a summary of everything added:

  • /chatmention reload — reloads config, requires chatmention.admin (op by default); full tab-completion included

  • /mention toggle — players toggle their own mention notifications on/off; sender is informed when a mentioned player has them disabled (toggle-disabled-message)

  • Bedrock support via Floodgate — BedrockHelper safely soft-depends on Floodgate. It strips the Floodgate prefix (e.g. .) when resolving @mentions and bare-name detection, so Bedrock players are properly found even though their Bukkit usernames include the prefix. Floodgate’s floodgate maven repo added to build.gradle

  • Version bumped to 8.0 across build.gradle, plugin.yml, and the enable log message

  • Three new config keys added under mention: for toggle messages (toggle-on-message, toggle-off-message, toggle-disabled-message)

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
13 961
src/main/java/com/lucifer/pmcchatmention/PmcChatMention.java
package com.lucifer.pmcchatmention;

import com.lucifer.pmcchatmention.bedrock.BedrockHelper;
import com.lucifer.pmcchatmention.command.ChatMentionCommand;
import com.lucifer.pmcchatmention.command.MentionCommand;
import com.lucifer.pmcchatmention.config.ConfigManager;
import com.lucifer.pmcchatmention.cooldown.CooldownManager;
import com.lucifer.pmcchatmention.listener.MentionListener;
import com.lucifer.pmcchatmention.listener.ProtectionListener;
import com.lucifer.pmcchatmention.security.SecurityInjector;
import com.lucifer.pmcchatmention.toggle.ToggleManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class PmcChatMention extends JavaPlugin {

    private ConfigManager configManager;
    private CooldownManager cooldownManager;
    private ToggleManager toggleManager;
    private SecurityInjector securityInjector;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        configManager = new ConfigManager(this);
        cooldownManager = new CooldownManager();
        toggleManager = new ToggleManager();
        securityInjector = new SecurityInjector(this);

        BedrockHelper.init(this);

        getServer().getPluginManager().registerEvents(new MentionListener(this), this);
        getServer().getPluginManager().registerEvents(new ProtectionListener(this), this);
        securityInjector.inject();

        ChatMentionCommand chatMentionCommand = new ChatMentionCommand(this);
        getCommand("chatmention").setExecutor(chatMentionCommand);
        getCommand("chatmention").setTabCompleter(chatMentionCommand);

        MentionCommand mentionCommand = new MentionCommand(this);
        getCommand("mention").setExecutor(mentionCommand);
        getCommand("mention").setTabCompleter(mentionCommand);

        getLogger().info("PmcChatMention v8.0 enabled.");
    }

    @Override
    public void onDisable() {
        getLogger().info("PmcChatMention disabled.");
    }
}