1.2-pre2
Add option to change when a:inventory is logged
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>AuxProtect</groupId>
|
||||
<artifactId>AuxProtect</artifactId>
|
||||
<version>1.2-pre1</version>
|
||||
<version>1.2-pre2</version>
|
||||
<name>AuxProtect</name>
|
||||
<build>
|
||||
<finalName>${project.artifactId}-${project.version}</finalName>
|
||||
|
||||
@@ -60,7 +60,10 @@ public class APConfig {
|
||||
skipV6Migration = config.getBoolean("skipv6migration");
|
||||
for (EntryAction action : EntryAction.values()) {
|
||||
boolean enabled = config.getBoolean("Actions." + action.toString().toLowerCase() + ".Enabled", true);
|
||||
boolean priority = config.getBoolean("Actions." + action.toString().toLowerCase() + ".LowestPriority",
|
||||
false);
|
||||
action.setEnabled(enabled);
|
||||
action.setLowestpriority(priority);
|
||||
}
|
||||
overrideCommands = config.getBoolean("OverrideCommands");
|
||||
}
|
||||
|
||||
@@ -107,6 +107,7 @@ public class EntryAction {
|
||||
public final int idPos;
|
||||
public final String name;
|
||||
private boolean enabled;
|
||||
private boolean lowestpriority;
|
||||
|
||||
private String overridePText;
|
||||
private String overrideNText;
|
||||
@@ -256,4 +257,13 @@ public class EntryAction {
|
||||
EntryAction other = (EntryAction) other_;
|
||||
return this.id == other.id && this.idPos == other.idPos;
|
||||
}
|
||||
|
||||
public boolean isLowestpriority() {
|
||||
return lowestpriority;
|
||||
}
|
||||
|
||||
public void setLowestpriority(boolean lowestpriority) {
|
||||
this.lowestpriority = lowestpriority;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -218,9 +218,18 @@ public class EntityListener implements Listener {
|
||||
plugin.add(entry);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onPlayerDeathLowest(PlayerDeathEvent e) {
|
||||
if (EntryAction.INVENTORY.isLowestpriority()) {
|
||||
plugin.getAPPlayer(e.getEntity()).logInventory("death");
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onPlayerDeath(PlayerDeathEvent e) {
|
||||
plugin.getAPPlayer(e.getEntity()).logInventory("death");
|
||||
public void onPlayerDeathMonitor(PlayerDeathEvent e) {
|
||||
if (!EntryAction.INVENTORY.isLowestpriority()) {
|
||||
plugin.getAPPlayer(e.getEntity()).logInventory("death");
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
|
||||
Reference in New Issue
Block a user