mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-23 09:37:51 +01:00
Fix Cause#isKnown() (#1768)
* Fix Cause#isKnown() * Grammar Co-authored-by: wizjany <wizjany@gmail.com>
This commit is contained in:
parent
c1c26360e3
commit
c4e76af5f4
@ -90,26 +90,15 @@ public boolean isIndirect() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether a cause is known. This method will return true if
|
||||
* the list of causes is empty or the list of causes only contains
|
||||
* objects that really are not root causes (i.e primed TNT).
|
||||
* Return whether a cause is known. This method will return false if
|
||||
* the list of causes is empty or the root cause is really not known
|
||||
* (e.g. primed TNT).
|
||||
*
|
||||
* @return true if known
|
||||
*/
|
||||
public boolean isKnown() {
|
||||
if (causes.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean found = false;
|
||||
for (Object object : causes) {
|
||||
if (!(object instanceof TNTPrimed) && !(object instanceof Vehicle)) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return found;
|
||||
Object object = getRootCause();
|
||||
return !(object == null || object instanceof TNTPrimed || object instanceof Vehicle);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
Loading…
Reference in New Issue
Block a user