mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-02-22 07:11:49 +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) {
|
||||
if (o instanceof DataUnit) {
|
||||
DataUnit go = (DataUnit) o;
|
||||
if (this.getName().equalsIgnoreCase(go.getName())
|
||||
&& ((this.dataSource == null && go.getDataSource() == null)
|
||||
|| (this.dataSource.getName().equalsIgnoreCase(go.getDataSource().getName())))) {
|
||||
return true;
|
||||
if (this.getName().equalsIgnoreCase(go.getName())) {
|
||||
// Global Group match.
|
||||
if (this.dataSource == null && go.getDataSource() == null)
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user