disableVoice()

disableVoice Method in MelodyManager Class

The disableVoice method is a part of the MelodyManager class in the MelodyMine plugin. This method is used to disable the voice functionality for a specific player on a specific server. It requires the player's name, UUID, the server they're on, and the target socket ID as parameters.

Method Signature

public void disableVoice(String playerName, String playerUuid, String playerServer, String targetSocketID)

Parameters

ParameterTypeDescription

playerName

String

The name of the player for whom the voice functionality is to be disabled.

playerUuid

String

The UUID of the player for whom the voice functionality is to be disabled.

playerServer

String

The server on which the player is currently playing.

targetSocketID

String

The ID of the socket that is to be targeted for the operation.

Example Usage

Here is an example of how you might use the disableVoice method in another plugin:

import ir.taher7.melodymine.core.MelodyManager;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;

public class ExamplePlugin {

    public void disablePlayerVoice(Player player) {
        String playerName = player.getName();
        String playerUuid = player.getUniqueId().toString();
        String playerServer = Bukkit.getServer().getName();
        String targetSocketID = "exampleSocketID"; // Replace with actual socket ID

        MelodyManager.INSTANCE.disableVoice(playerName, playerUuid, playerServer, targetSocketID);

        Bukkit.getLogger().info("Voice functionality has been disabled for player: " + playerName + " to SocketID:" + targetSocketID);
    }
}

In this example, we're disabling the voice functionality for a specific player and then logging this action to the console.

Last updated