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.
|
* @return The effects.
|
||||||
*/
|
*/
|
||||||
public Set<Effect> createEffects() {
|
public List<Effect> createEffects() {
|
||||||
Set<Effect> effects = new HashSet<>();
|
List<Effect> effects = new ArrayList<>();
|
||||||
this.effectNames.forEach((string, args) -> {
|
this.effectNames.forEach((string, args) -> {
|
||||||
effects.add(Effects.getEffect(string, args));
|
effects.add(Effects.getEffect(string, args));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public abstract class Effect implements BossTicker {
|
public abstract class Effect implements BossTicker {
|
||||||
/**
|
/**
|
||||||
@@ -83,4 +84,21 @@ public abstract class Effect implements BossTicker {
|
|||||||
final long tick) {
|
final long tick) {
|
||||||
// Override when needed.
|
// 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