PALib - Placeholder Annotation Library
1.3.1 SNAPSHOTSimplify placeholder creation for developers | Inspired by ACF and others !
Placeholder Annotation Processor
Do you find it tiring to create placeholders again and again? Does this task eat up a lot of your time set aside for development?
Let me introduce PAP (Placeholder Annotation Processor) . This tool is designed to make the process of creating placeholders much easier and faster for you.
COMPATIBILITY
At present, PAP is designed to work conjointly with PlaceholderAPI but is intended to work with other plugin in the future.
USAGE
A step by step guide is available HERE
EXAMPLES
@Placeholder(identifier = "done")
@RequireOnlinePlayer
public String onDone(RequestIssuer issuer) {
final QuestPlayer questPlayer = QuestPlayer.getQuestPlayer(issuer.getPlayer().getUniqueId());
return String.valueOf(questPlayer.getNumberOfQuestsDone());
}
@DefaultPlaceholder
@Placeholder(identifier = "quest")
@RequireOnlinePlayer
public String onQuest(RequestIssuer issuer, String serviceId, Integer index, @Optional(defaultArg = "display") String param) {
final QuestPlayer questPlayer = QuestPlayer.getQuestPlayer(issuer.getPlayer().getUniqueId());
final List<ActiveQuest> activeQuests = questPlayer.getActiveQuests(serviceId);
if(activeQuests.size() <= index) {
return null;
}
final ActiveQuest activeQuest = activeQuests.get(index);
final Quest quest = plugin.getQuestManager().fromId(activeQuest.getQuestId());
switch (param.toLowerCase(Locale.ROOT)) {
case "display":
return quest.getDisplay();
case "type":
return quest.getType().name().toLowerCase(Locale.ROOT);
case "progress":
return String.valueOf(activeQuest.getProgress());
case "required":
return String.valueOf(quest.getRequiredAmount());
case "progressbar":
return ProgressUtil.getProcessBar(activeQuest.getProgress(), quest.getRequiredAmount());
default:
return null;
}
}
INSTALLATION
MAVEN
<repositories>
<!-- Other repositories... -->
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<!-- Other dependencies... -->
<dependency>
<groupId>com.github.Robotv2</groupId>
<artifactId>PlaceholderAnnotationProcessor</artifactId>
<version>[VERSION]</version>
</dependency>
</dependencies>
GRADLE
repositories {
// Other repositories...
maven { url = 'https://jitpack.io' }
}
dependencies {
// Other dependencies...
implementation 'com.github.Robotv2:PlaceholderAnnotationProcessor:[VERSION]'
}Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta