mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-16 23:55:28 +01:00
Improve FlatItemData#equals
This commit is contained in:
parent
c1c422e03d
commit
2ddde37771
@ -183,8 +183,17 @@ public class FlatItemDbProvider extends ItemDbProvider {
|
||||
return false;
|
||||
}
|
||||
ItemData pairo = (ItemData) o;
|
||||
return this.material == pairo.getMaterial() &&
|
||||
(this.potionData == null && pairo.getPotionData() == null) || this.potionData.equals(pairo.getPotionData());
|
||||
return this.material == pairo.getMaterial() && potionDataEquals(pairo);
|
||||
}
|
||||
|
||||
private boolean potionDataEquals(ItemData o) {
|
||||
if (this.potionData == null && o.getPotionData() == null) {
|
||||
return true;
|
||||
} else if (this.potionData != null && o.getPotionData() != null) {
|
||||
return this.potionData.equals(o.getPotionData());
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user