-
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #136 from Awoo-industries/placeholder-api
LGTM :^)
- Loading branch information
Showing
6 changed files
with
89 additions
and
2 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package dev.beeps.plugins.Depends; | ||
|
||
import dev.beeps.plugins.BetterConfig; | ||
import dev.beeps.plugins.BetterKeepInventory; | ||
import me.clip.placeholderapi.expansion.PlaceholderExpansion; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class Papi extends PlaceholderExpansion { | ||
|
||
|
||
|
||
@Override | ||
public @NotNull String getIdentifier() { | ||
return "BetterKeepInventory"; | ||
} | ||
|
||
@Override | ||
public @NotNull String getAuthor() { | ||
return "Beepsterr"; | ||
} | ||
|
||
@Override | ||
public @NotNull String getVersion() { | ||
return "1.0.0"; | ||
} | ||
|
||
@Override | ||
public String onPlaceholderRequest(org.bukkit.entity.Player player, @NotNull String identifier) { | ||
|
||
identifier = identifier.toLowerCase(); | ||
|
||
// Seconds left on grace | ||
if (identifier.equals("grace_timer_seconds")) { | ||
return String.valueOf(BetterKeepInventory.instance.graceMap.get(player.getUniqueId())); | ||
} | ||
|
||
// If grace is active | ||
if(identifier.equals("grace_timer_active")) { | ||
return BetterKeepInventory.instance.graceMap.get(player.getUniqueId()) != null ? "true" : "false"; | ||
} | ||
|
||
// Overrides! | ||
for(BetterConfig.OverrideTypes key : BetterConfig.OverrideTypes.values()) { | ||
if(identifier.equals("is_active_" + key.toString().toLowerCase())) { | ||
if(BetterKeepInventory.instance.config.GetOverrideForMode("ALL", player)){ | ||
return "true"; | ||
} | ||
return BetterKeepInventory.instance.config.GetOverrideForMode(key.toString().toUpperCase(), player) ? "true" : "false"; | ||
} | ||
} | ||
|
||
return null; | ||
} | ||
} |
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