-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from TWME-TW/dev
Fix: Resolve issue with CustomModelData not working.
- Loading branch information
Showing
7 changed files
with
68 additions
and
9 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
37 changes: 37 additions & 0 deletions
37
src/main/java/dev/twme/debugstickpro/hook/PlaceholderAPIUtil.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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package dev.twme.debugstickpro.hook; | ||
|
||
import me.clip.placeholderapi.PlaceholderAPI; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.entity.Player; | ||
|
||
import java.util.List; | ||
|
||
public class PlaceholderAPIUtil { | ||
private static boolean isPlaceholderAPILoaded = false; | ||
|
||
public static boolean initPlaceholderAPI() { | ||
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) { | ||
isPlaceholderAPILoaded = true; | ||
return true; | ||
} else { | ||
isPlaceholderAPILoaded = false; | ||
return false; | ||
} | ||
} | ||
|
||
public static String insertPAPI(Player player, String text) { | ||
if (isPlaceholderAPILoaded && player != null) { | ||
return PlaceholderAPI.setPlaceholders(player, text); | ||
} else { | ||
return text; | ||
} | ||
} | ||
|
||
public static List<String> insertPAPI(Player player, List<String> list) { | ||
if (isPlaceholderAPILoaded && player != null) { | ||
return PlaceholderAPI.setPlaceholders(player, list); | ||
} else { | ||
return list; | ||
} | ||
} | ||
} |
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