-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add minimessage support for tab, and few improvements
- Loading branch information
Showing
8 changed files
with
26 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 8 additions & 18 deletions
26
plugin/src/main/java/com/xism4/sternalboard/managers/tab/list/ModernTabExecutor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,24 @@ | ||
package com.xism4.sternalboard.managers.tab.list; | ||
|
||
import com.xism4.sternalboard.SternalBoardPlugin; | ||
import com.xism4.sternalboard.managers.tab.TabExecutor; | ||
import com.xism4.sternalboard.utils.color.ColorHandler; | ||
import com.xism4.sternalboard.utils.placeholders.PlaceholderParser; | ||
import com.xism4.sternalboard.utils.TextUtils; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.plugin.java.JavaPlugin; | ||
|
||
public class ModernTabExecutor extends TabExecutor { | ||
private final JavaPlugin plugin; | ||
private final SternalBoardPlugin plugin; | ||
private TextUtils textUtils; | ||
|
||
public ModernTabExecutor(JavaPlugin plugin) { | ||
public ModernTabExecutor(SternalBoardPlugin plugin) { | ||
this.plugin = plugin; | ||
} | ||
|
||
@Override | ||
public void sendTab(Player player, String header, String footer) { | ||
if (plugin.getServer().getPluginManager().isPluginEnabled("PlaceholderAPI")) { | ||
player.setPlayerListHeaderFooter( | ||
ColorHandler.convert( | ||
PlaceholderParser.parse(player, check(header)) | ||
), | ||
ColorHandler.convert( | ||
PlaceholderParser.parse(player, check(footer)) | ||
) | ||
); | ||
return; | ||
} | ||
plugin.getServer().getPluginManager().isPluginEnabled("PlaceholderAPI"); | ||
player.setPlayerListHeaderFooter( | ||
ColorHandler.convert(check(header)), | ||
ColorHandler.convert(check(footer)) | ||
TextUtils.processPlaceholders(plugin, player, check(header)), | ||
TextUtils.processPlaceholders(plugin, player, check(footer)) | ||
); | ||
} | ||
} |
11 changes: 0 additions & 11 deletions
11
plugin/src/main/java/com/xism4/sternalboard/utils/color/BukkitColor.java
This file was deleted.
Oops, something went wrong.
54 changes: 0 additions & 54 deletions
54
plugin/src/main/java/com/xism4/sternalboard/utils/color/BungeeColor.java
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
plugin/src/main/java/com/xism4/sternalboard/utils/color/ColorHandler.java
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
plugin/src/main/java/com/xism4/sternalboard/utils/placeholders/PlaceholderParser.java
This file was deleted.
Oops, something went wrong.