/
SentinelIntegration.java
48 lines (41 loc) · 1.44 KB
/
SentinelIntegration.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package org.mcmonkey.sentinel;
import org.bukkit.entity.LivingEntity;
/**
* Represents an integration of an external plugin or system into Sentinel.
*/
public class SentinelIntegration {
/**
* Gets the 'target help' data for this integration (empty string if not relevant).
* Example format is: "myintegration:MY_TARGET_IDENTIFIER" like "squad:SQUAD_NAME" or "healthabove:PERCENTAGE"
*/
public String getTargetHelp() {
return "";
}
/**
* Gets the list of target prefixes that this integration handles.
* For a "squad:SQUAD_NAME" target, this should return: new String[] { "squad" }
*/
public String[] getTargetPrefixes() {
return new String[0];
}
/**
* Returns whether an entity is a target of the integration label.
*/
public boolean isTarget(LivingEntity ent, String prefix, String value) {
return isTarget(ent, prefix + ":" + value);
}
/**
* Returns whether an entity is a target of the integration label.
*/
@Deprecated
public boolean isTarget(LivingEntity ent, String text) {
return false;
}
/**
* Runs when an NPC intends to attack a target - return 'true' to indicate the integration ran its own attack methodology
* (and no default attack handling is needed).
*/
public boolean tryAttack(SentinelTrait st, LivingEntity ent) {
return false;
}
}