-
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.
Added support for Clip's placeholder API
- Loading branch information
Showing
12 changed files
with
203 additions
and
40 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
18 changes: 18 additions & 0 deletions
18
src/main/java/me/bramhaag/guilds/placeholders/mvdwplaceholderapi/MVdWGuild.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,18 @@ | ||
package me.bramhaag.guilds.placeholders.mvdwplaceholderapi; | ||
|
||
import be.maximvdw.placeholderapi.PlaceholderReplaceEvent; | ||
import be.maximvdw.placeholderapi.PlaceholderReplacer; | ||
import me.bramhaag.guilds.guild.Guild; | ||
|
||
public class MVdWGuild implements PlaceholderReplacer { | ||
|
||
@Override | ||
public String onPlaceholderReplace(PlaceholderReplaceEvent event) { | ||
Guild guild = Guild.getGuild(event.getPlayer().getUniqueId()); | ||
if (guild == null) { | ||
return "N/A"; | ||
} | ||
|
||
return guild.getPrefix(); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/me/bramhaag/guilds/placeholders/mvdwplaceholderapi/MVdWGuildMaster.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,18 @@ | ||
package me.bramhaag.guilds.placeholders.mvdwplaceholderapi; | ||
|
||
import be.maximvdw.placeholderapi.PlaceholderReplaceEvent; | ||
import be.maximvdw.placeholderapi.PlaceholderReplacer; | ||
import me.bramhaag.guilds.guild.Guild; | ||
import org.bukkit.Bukkit; | ||
|
||
public class MVdWGuildMaster implements PlaceholderReplacer { | ||
@Override | ||
public String onPlaceholderReplace(PlaceholderReplaceEvent event) { | ||
Guild guild = Guild.getGuild(event.getPlayer().getUniqueId()); | ||
if (guild == null) { | ||
return "N/A"; | ||
} | ||
|
||
return Bukkit.getPlayer(guild.getGuildMaster().getUniqueId()).getName(); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/me/bramhaag/guilds/placeholders/mvdwplaceholderapi/MVdWGuildMemberCount.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,18 @@ | ||
package me.bramhaag.guilds.placeholders.mvdwplaceholderapi; | ||
|
||
import be.maximvdw.placeholderapi.PlaceholderReplaceEvent; | ||
import be.maximvdw.placeholderapi.PlaceholderReplacer; | ||
import me.bramhaag.guilds.guild.Guild; | ||
|
||
public class MVdWGuildMemberCount implements PlaceholderReplacer { | ||
|
||
@Override | ||
public String onPlaceholderReplace(PlaceholderReplaceEvent event) { | ||
Guild guild = Guild.getGuild(event.getPlayer().getUniqueId()); | ||
if (guild == null) { | ||
return "N/A"; | ||
} | ||
|
||
return String.valueOf(guild.getMembers().size()); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/me/bramhaag/guilds/placeholders/mvdwplaceholderapi/MVdWGuildPrefix.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,18 @@ | ||
package me.bramhaag.guilds.placeholders.mvdwplaceholderapi; | ||
|
||
import be.maximvdw.placeholderapi.PlaceholderReplaceEvent; | ||
import be.maximvdw.placeholderapi.PlaceholderReplacer; | ||
import me.bramhaag.guilds.guild.Guild; | ||
|
||
public class MVdWGuildPrefix implements PlaceholderReplacer { | ||
|
||
@Override | ||
public String onPlaceholderReplace(PlaceholderReplaceEvent event) { | ||
Guild guild = Guild.getGuild(event.getPlayer().getUniqueId()); | ||
if (guild == null) { | ||
return "N/A"; | ||
} | ||
|
||
return guild.getPrefix(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/me/bramhaag/guilds/placeholders/placeholderapi/ClipGuild.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,23 @@ | ||
package me.bramhaag.guilds.placeholders.placeholderapi; | ||
|
||
import me.bramhaag.guilds.guild.Guild; | ||
import me.clip.placeholderapi.external.EZPlaceholderHook; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.plugin.Plugin; | ||
|
||
public class ClipGuild extends EZPlaceholderHook { | ||
|
||
public ClipGuild(Plugin plugin) { | ||
super(plugin, "guild"); | ||
} | ||
|
||
@Override | ||
public String onPlaceholderRequest(Player player, String s) { | ||
Guild guild = Guild.getGuild(player.getUniqueId()); | ||
if (guild == null) { | ||
return "N/A"; | ||
} | ||
|
||
return guild.getName(); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/me/bramhaag/guilds/placeholders/placeholderapi/ClipGuildMaster.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,24 @@ | ||
package me.bramhaag.guilds.placeholders.placeholderapi; | ||
|
||
import me.bramhaag.guilds.guild.Guild; | ||
import me.clip.placeholderapi.external.EZPlaceholderHook; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.plugin.Plugin; | ||
|
||
public class ClipGuildMaster extends EZPlaceholderHook { | ||
|
||
public ClipGuildMaster(Plugin plugin) { | ||
super(plugin, "guild-master"); | ||
} | ||
|
||
@Override | ||
public String onPlaceholderRequest(Player player, String s) { | ||
Guild guild = Guild.getGuild(player.getUniqueId()); | ||
if (guild == null) { | ||
return "N/A"; | ||
} | ||
|
||
return Bukkit.getPlayer(guild.getGuildMaster().getUniqueId()).getName(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/me/bramhaag/guilds/placeholders/placeholderapi/ClipGuildMemberCount.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,23 @@ | ||
package me.bramhaag.guilds.placeholders.placeholderapi; | ||
|
||
import me.bramhaag.guilds.guild.Guild; | ||
import me.clip.placeholderapi.external.EZPlaceholderHook; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.plugin.Plugin; | ||
|
||
public class ClipGuildMemberCount extends EZPlaceholderHook { | ||
|
||
public ClipGuildMemberCount(Plugin plugin) { | ||
super(plugin, "guild-member-count"); | ||
} | ||
|
||
@Override | ||
public String onPlaceholderRequest(Player player, String s) { | ||
Guild guild = Guild.getGuild(player.getUniqueId()); | ||
if (guild == null) { | ||
return "N/A"; | ||
} | ||
|
||
return String.valueOf(guild.getMembers().size()); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/me/bramhaag/guilds/placeholders/placeholderapi/ClipGuildPrefix.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,22 @@ | ||
package me.bramhaag.guilds.placeholders.placeholderapi; | ||
|
||
import me.bramhaag.guilds.guild.Guild; | ||
import me.clip.placeholderapi.external.EZPlaceholderHook; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.plugin.Plugin; | ||
|
||
public class ClipGuildPrefix extends EZPlaceholderHook { | ||
|
||
public ClipGuildPrefix(Plugin plugin) { | ||
super(plugin, "guild-prefix"); | ||
} | ||
|
||
@Override | ||
public String onPlaceholderRequest(Player player, String s) { | ||
Guild guild = Guild.getGuild(player.getUniqueId()); | ||
if (guild == null) { | ||
return "N/A"; | ||
} | ||
|
||
return guild.getPrefix(); } | ||
} |
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