Added API methods for toggle

This commit is contained in:
Zeshan Aslam 2020-04-24 19:22:44 -04:00
parent e97cd5fc69
commit 86579732ca
3 changed files with 16 additions and 1 deletions

View File

@ -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:

View File

@ -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;

View File

@ -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);
}
}