Skip to content
Permalink
Browse files

Start of simpleclans support

untested!
  • Loading branch information...
mcmonkey4eva committed Aug 30, 2017
1 parent d2d3041 commit c73cdf7ce766b5db3841838256a40942c8b4aa6f
@@ -43,6 +43,7 @@ Sentinel integrations with a few external plugins, including:
- Vault, for permission group targets! (Use group:GROUP_HERE)
- Towny, for town targets! (Use towny:TOWN_HERE)
- Factions, for faction targets! (Use factions:FACTION_HERE)
- SimpleClans, for clan targets! (Use simpleclan:CLAN_NAME_HERE)

### Commands

BIN +250 KB lib/SimpleClans.jar
Binary file not shown.
@@ -92,6 +92,13 @@
<scope>system</scope>
<systemPath>${basedir}/lib/CrackShot.jar</systemPath>
</dependency>
<dependency>
<groupId>net.sacredlabyrinth.phaed.simpleclans</groupId>
<artifactId>SimpleClans</artifactId>
<version>2.7.3</version>
<scope>system</scope>
<systemPath>${basedir}/lib/SimpleClans.jar</systemPath>
</dependency>
</dependencies>

<ciManagement>
@@ -147,6 +147,15 @@ public void run() {
ex.printStackTrace();
}
}
if (Bukkit.getPluginManager().getPlugin("SimpleClans") != null) {
try {
integrations.add(new SentinelSimpleClans());
getLogger().info("Sentinel found SimpleClans! Adding support for it!");
}
catch (Exception ex) {
ex.printStackTrace();
}
}
}

final static String InvPrefix = ChatColor.GREEN + "Sentinel ";
@@ -0,0 +1,35 @@
package org.mcmonkey.sentinel.integration;

import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.mcmonkey.sentinel.SentinelIntegration;

public class SentinelSimpleClans extends SentinelIntegration {

@Override
public String getTargetHelp() {
return "simpleclan:CLAN_NAME";
}

@Override
public boolean isTarget(LivingEntity ent, String text) {
try {
if (text.startsWith("simpleclan:") && ent instanceof Player) {
String clanName = text.substring("simpleclan:".length());
Clan clan = SimpleClans.getInstance().getClanManager().getClanByPlayerUniqueId(ent.getUniqueId());
if (clan.getName().equalsIgnoreCase(clanName)) {
return true;
}
else {
return false;
}
}
}
catch (Exception ex) {
ex.printStackTrace();
}
return false;
}
}

This file was deleted.

0 comments on commit c73cdf7

Please sign in to comment.
You can’t perform that action at this time.