Added API methods for toggle
This commit is contained in:
parent
e97cd5fc69
commit
86579732ca
|
@ -1,6 +1,6 @@
|
|||
name: ActionHealth
|
||||
main: com.zeshanaslam.actionhealth.Main
|
||||
version: 3.4.6
|
||||
version: 3.4.7
|
||||
softdepend: [PlaceholderAPI, MVdWPlaceholderAPI, WorldGuard, mcMMO, MythicMobs, LangUtils]
|
||||
commands:
|
||||
Actionhealth:
|
||||
|
|
|
@ -106,6 +106,8 @@ public class ActionListener implements Listener {
|
|||
|
||||
Player player = event.getPlayer();
|
||||
ItemStack itemStack = event.getItem();
|
||||
if (itemStack == null)
|
||||
return;
|
||||
|
||||
if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||
ActionStore.ActionType actionType = ActionStore.ActionType.RIGHTCLICK;
|
||||
|
|
|
@ -21,6 +21,7 @@ import java.lang.reflect.Field;
|
|||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public class HealthUtil {
|
||||
|
||||
|
@ -371,4 +372,16 @@ public class HealthUtil {
|
|||
|
||||
return plugin.configStore.whitelist.contains(name);
|
||||
}
|
||||
|
||||
public void setActionToggle(UUID uuid, boolean disable) {
|
||||
if (disable) {
|
||||
plugin.toggle.add(uuid);
|
||||
} else {
|
||||
plugin.toggle.remove(uuid);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isActionDisabled(UUID uuid) {
|
||||
return plugin.toggle.contains(uuid);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue