mirror of
https://github.com/Auxilor/EcoMobs.git
synced 2025-12-20 15:39:31 +00:00
Fixed 2 effects of the same type not working
This commit is contained in:
@@ -442,8 +442,8 @@ public class EcoBoss extends PluginDependent {
|
||||
*
|
||||
* @return The effects.
|
||||
*/
|
||||
public Set<Effect> createEffects() {
|
||||
Set<Effect> effects = new HashSet<>();
|
||||
public List<Effect> createEffects() {
|
||||
List<Effect> effects = new ArrayList<>();
|
||||
this.effectNames.forEach((string, args) -> {
|
||||
effects.add(Effects.getEffect(string, args));
|
||||
});
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public abstract class Effect implements BossTicker {
|
||||
/**
|
||||
@@ -83,4 +84,21 @@ public abstract class Effect implements BossTicker {
|
||||
final long tick) {
|
||||
// Override when needed.
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof Effect)) {
|
||||
return false;
|
||||
}
|
||||
Effect effect = (Effect) o;
|
||||
return Objects.equals(getArgs(), effect.getArgs());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getArgs());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user