mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-02-22 23:31:34 +01:00
better groups match checking for globalgroups
This commit is contained in:
parent
317b0833ef
commit
000d060ea6
@ -39,10 +39,19 @@ public abstract class DataUnit {
|
|||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (o instanceof DataUnit) {
|
if (o instanceof DataUnit) {
|
||||||
DataUnit go = (DataUnit) o;
|
DataUnit go = (DataUnit) o;
|
||||||
if (this.getName().equalsIgnoreCase(go.getName())
|
if (this.getName().equalsIgnoreCase(go.getName())) {
|
||||||
&& ((this.dataSource == null && go.getDataSource() == null)
|
// Global Group match.
|
||||||
|| (this.dataSource.getName().equalsIgnoreCase(go.getDataSource().getName())))) {
|
if (this.dataSource == null && go.getDataSource() == null)
|
||||||
return true;
|
return true;
|
||||||
|
// This is a global group, the object to test isn't.
|
||||||
|
if (this.dataSource == null && go.getDataSource() != null)
|
||||||
|
return false;
|
||||||
|
// This is not a global group, but the object to test is.
|
||||||
|
if (this.dataSource != null && go.getDataSource() == null)
|
||||||
|
return false;
|
||||||
|
// Match on group name and world name.
|
||||||
|
if (this.dataSource.getName().equalsIgnoreCase(go.getDataSource().getName()))
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user