Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: BT-Pluginz/StatusPlugin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.5.1-release
Choose a base ref
...
head repository: BT-Pluginz/StatusPlugin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.5.2-release
Choose a head ref
  • 5 commits
  • 6 files changed
  • 2 contributors

Commits on Dec 15, 2024

  1. changed Plugin name for alerting admin for new updates

    Took 19 minutes
    TubYoub committed Dec 15, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    TubYoub Jörn
    Copy the full SHA
    fe7f787 View commit details
  2. there will no empty brackets when someone has no status and sends a m…

    …essage when chatformatter is turned on
    
    Took 49 minutes
    TubYoub committed Dec 15, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    TubYoub Jörn
    Copy the full SHA
    d23a320 View commit details
  3. version bump

    Took 38 seconds
    TubYoub committed Dec 15, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    TubYoub Jörn
    Copy the full SHA
    c856714 View commit details
  4. typo

    Took 4 minutes
    TubYoub committed Dec 15, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    TubYoub Jörn
    Copy the full SHA
    ab28867 View commit details
  5. Merge pull request #12 from BT-Pluginz/1.5

    1.5
    TubYoub authored Dec 15, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    4ffde5d View commit details
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@

<groupId>de.tubyoub</groupId>
<artifactId>StatusPlugin</artifactId>
<version>1.5.1</version>
<version>1.5.2</version>
<packaging>jar</packaging>

<name>Tub's Status Plugin</name>
Original file line number Diff line number Diff line change
@@ -50,12 +50,14 @@ public void onPlayerChat(PlayerChatEvent event) {
status = PlaceholderAPI.setPlaceholders(player, status);
}

// message = plugin.getStatusManager().translateColorsAndFormatting(message,player);

// Format the broadcast message
String broadcastMessage;
if (status == null) {
broadcastMessage = player.getName() + ": " + message;
if (status.isEmpty()) {
broadcastMessage = player.getName() + ": " + plugin.getStatusManager().translateColorsAndFormatting(message,player);
} else {
broadcastMessage = "[" + ColourUtils.format(status) + ChatColor.RESET + "] " + player.getName() + ": " + message;
broadcastMessage = configManager.getOpeningCharacter() + ColourUtils.format(status) + ChatColor.RESET + configManager.getClosingCharacter() + " " + player.getName() + ": " + plugin.getStatusManager().translateColorsAndFormatting(message,player);
}

// Broadcast the message and cancel the original event
Original file line number Diff line number Diff line change
@@ -49,9 +49,9 @@ public void onPlayerJoin(PlayerJoinEvent event) {
if (player.hasPermission("StatusPlugin.admin") && plugin.getConfigManager().isCheckUpdate()) {
// Alert if a critical update is available
if (this.versionInfo.isNewVersionAvailable && this.versionInfo.urgency == UpdateUrgency.CRITICAL || this.versionInfo.urgency == UpdateUrgency.HIGH) {
player.sendMessage(plugin.getPluginPrefix() + ChatColor.RED + "A critical update for BT Grave is available!");
player.sendMessage(plugin.getPluginPrefix() + ChatColor.RED + "Please update to version: " + this.versionInfo.latestVersion);
player.sendMessage(plugin.getPluginPrefix() + ChatColor.RED + "Backup your config");
player.sendMessage(plugin.getPluginPrefix() + ChatColor.RED + " A critical update for Tubs StatusPlugin is available!");
player.sendMessage(plugin.getPluginPrefix() + ChatColor.RED + " Please update to version: " + this.versionInfo.latestVersion);
player.sendMessage(plugin.getPluginPrefix() + ChatColor.RED + " Backup your config");
// only works this way and idk why
TextComponent modrinthLink = new TextComponent(ChatColor.GREEN + "" + ChatColor.UNDERLINE + "Modrinth");
modrinthLink.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://modrinth.com/plugin/bt-graves/version/" + this.versionInfo.latestVersion));
Original file line number Diff line number Diff line change
@@ -120,7 +120,7 @@ public String getStatus(Player player) {
public void updateDisplayName(Player player) {
String status = getStatus(player);

if (status != "") {
if (status.isEmpty()) {
String translatedStatus = translateColorsAndFormatting(status, player);
if (plugin.isLuckPermsPresent() && player.hasPermission("StatusPlugin.placeholders")) {
translatedStatus.replace("%LP_prefix%", Objects.requireNonNull(plugin.getLuckPerms().getPlayerAdapter(Player.class).getUser(player).getCachedData().getMetaData().getPrefix()));
@@ -216,7 +216,7 @@ public String translateColorsAndFormatting(String status, CommandSender sender)
status = status.replace(codes[i], "");
}
}
return ChatColor.translateAlternateColorCodes('§', status);
return ChatColor.translateAlternateColorCodes('&', status);
}

/**
Original file line number Diff line number Diff line change
@@ -76,7 +76,7 @@ public String getVersion(){
@Override
public String onPlaceholderRequest(Player player, String identifier){
if(player == null){
return "";
return null;
}
if (Objects.equals(identifier, "status")){
return plugin.getStatusManager().getStatus(player);
2 changes: 1 addition & 1 deletion src/main/java/de/tubyoub/statusplugin/StatusPlugin.java
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
* This class extends JavaPlugin and represents the main entry point for the plugin.
*/
public class StatusPlugin extends JavaPlugin {
private final String version = "1.5.1";
private final String version = "1.5.2";
private final String project = "km0yAITg";
private int pluginId = 20463;
private StatusManager statusManager;