Only broadcast off record punishments to local server
This commit is contained in:
parent
9ea38d8cdb
commit
6ccd95cb04
|
@ -105,7 +105,9 @@ public class PunishmentEnforcer implements Enableable, MessageListener {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
punishmentService.update(punishment._id(), (PunishmentDoc.Enforce) () -> true);
|
if(!punishment.off_record()) {
|
||||||
|
punishmentService.update(punishment._id(), (PunishmentDoc.Enforce) () -> true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void announce(Punishment punishment) {
|
private void announce(Punishment punishment) {
|
||||||
|
@ -121,7 +123,7 @@ public class PunishmentEnforcer implements Enableable, MessageListener {
|
||||||
public boolean viewable(CommandSender sender, Punishment punishment, boolean announced) {
|
public boolean viewable(CommandSender sender, Punishment punishment, boolean announced) {
|
||||||
if(viewByIdentity(sender, punishment)) {
|
if(viewByIdentity(sender, punishment)) {
|
||||||
if(announced) {
|
if(announced) {
|
||||||
return viewByType(sender, punishment) && viewBySetting(sender, punishment) && viewByIdentity(sender, punishment);
|
return viewByType(sender, punishment) && viewBySetting(sender, punishment) && viewByIdentity(sender, punishment) && viewByRecord(sender, punishment);
|
||||||
} else {
|
} else {
|
||||||
return viewByLookup(sender, punishment);
|
return viewByLookup(sender, punishment);
|
||||||
}
|
}
|
||||||
|
@ -144,6 +146,13 @@ public class PunishmentEnforcer implements Enableable, MessageListener {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean viewByRecord(CommandSender sender, Punishment punishment) {
|
||||||
|
if(punishment.off_record()) {
|
||||||
|
return localServer._id().equals(punishment.server_id());
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private boolean viewByType(CommandSender sender, Punishment punishment) {
|
private boolean viewByType(CommandSender sender, Punishment punishment) {
|
||||||
switch(punishment.type()) {
|
switch(punishment.type()) {
|
||||||
|
|
Loading…
Reference in New Issue