Skip to content
Permalink
Browse files

cleanings, docs, reorg - part 1: SentinelTrait

  • Loading branch information...
mcmonkey4eva committed Oct 9, 2018
1 parent 98a0a7a commit cfdb3ecd6a17c8ac80e6f8590e1596fc639ba2a4
@@ -71,6 +71,8 @@

public boolean workaroundEntityChasePathfinder;

public boolean protectFromIgnores;

public void tryGetPerms() {
if (Bukkit.getServer().getPluginManager().getPlugin("Vault") == null) {
return;
@@ -146,6 +148,7 @@ else if (confVer == -1) {
guardDistanceMargin = getConfig().getInt("random.guard follow distance.selction range", 4);
guardDistanceSelectionRange = getConfig().getInt("random.guard follow distance.margin", 2);
workaroundEntityChasePathfinder = getConfig().getBoolean("random.workaround entity chase pathfinder", false);
protectFromIgnores = getConfig().getBoolean("random.protected", false);
BukkitRunnable postLoad = new BukkitRunnable() {
@Override
public void run() {
@@ -64,6 +64,19 @@

public static final boolean v1_8, v1_9, v1_10, v1_11, v1_12, v1_13;

/**
* Returns whether an item material is a valid weapon type.
*/
public static boolean isWeapon(Material mat) {
return SentinelTarget.WEAPON_DAMAGE_MULTIPLIERS.containsKey(mat)
|| SentinelTarget.POTION_MATERIALS.contains(mat)
|| SentinelTarget.BOW_MATERIALS.contains(mat)
|| SentinelTarget.SKULL_MATERIALS.contains(mat)
|| mat == SentinelTarget.MATERIAL_SNOW_BALL
|| mat == SentinelTarget.MATERIAL_BLAZE_ROD
|| mat == SentinelTarget.MATERIAL_NETHER_STAR;
}

static {
String vers = Bukkit.getBukkitVersion(); // Returns in format like: 1.12.2-R0.1-SNAPSHOT
v1_13 = vers.startsWith("1.13");

0 comments on commit cfdb3ec

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