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
|
* Return whether a cause is known. This method will return false if
|
||||||
* the list of causes is empty or the list of causes only contains
|
* the list of causes is empty or the root cause is really not known
|
||||||
* objects that really are not root causes (i.e primed TNT).
|
* (e.g. primed TNT).
|
||||||
*
|
*
|
||||||
* @return true if known
|
* @return true if known
|
||||||
*/
|
*/
|
||||||
public boolean isKnown() {
|
public boolean isKnown() {
|
||||||
if (causes.isEmpty()) {
|
Object object = getRootCause();
|
||||||
return false;
|
return !(object == null || object instanceof TNTPrimed || object instanceof Vehicle);
|
||||||
}
|
|
||||||
|
|
||||||
boolean found = false;
|
|
||||||
for (Object object : causes) {
|
|
||||||
if (!(object instanceof TNTPrimed) && !(object instanceof Vehicle)) {
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return found;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
Loading…
Reference in New Issue
Block a user