9
0
mirror of https://github.com/Auxilor/EcoMobs.git synced 2026-01-04 15:41:33 +00:00

Added disabled world names to spawn totem

This commit is contained in:
Auxilor
2021-03-13 14:02:03 +00:00
parent 40301d5c08
commit 26e0187132
3 changed files with 19 additions and 8 deletions

View File

@@ -48,6 +48,7 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
public class EcoBoss extends PluginDependent {
/**
@@ -97,6 +98,12 @@ public class EcoBoss extends PluginDependent {
@Getter
private final SpawnTotem spawnTotem;
/**
* Disabled world names for spawn totem.
*/
@Getter
private final List<String> spawnTotemDisabledWorldNames;
/**
* The max health.
*/
@@ -254,6 +261,7 @@ public class EcoBoss extends PluginDependent {
Material.getMaterial(this.getConfig().getString("spawn-totem.middle").toUpperCase()),
Material.getMaterial(this.getConfig().getString("spawn-totem.top").toUpperCase())
);
this.spawnTotemDisabledWorldNames = this.getConfig().getStrings("spawn-totem.world-blacklist").stream().map(String::toLowerCase).collect(Collectors.toList());
// Rewards
this.drops = new HashMap<>();

View File

@@ -51,12 +51,14 @@ public class SpawnListeners extends PluginDependent implements Listener {
for (EcoBoss boss : EcoBosses.values()) {
if (boss.isSpawnTotemEnabled()) {
if (boss.getSpawnTotem().equals(placedTotem)) {
block1.setType(Material.AIR);
block2.setType(Material.AIR);
block3.setType(Material.AIR);
if (!boss.getSpawnTotemDisabledWorldNames().contains(event.getBlock().getWorld().getName().toLowerCase())) {
if (boss.getSpawnTotem().equals(placedTotem)) {
block1.setType(Material.AIR);
block2.setType(Material.AIR);
block3.setType(Material.AIR);
boss.spawn(event.getBlock().getLocation());
boss.spawn(event.getBlock().getLocation());
}
}
}
}

View File

@@ -16,6 +16,7 @@ spawn-totem:
top: carved_pumpkin
middle: beacon
bottom: diamond_block
world-blacklist: []
rewards:
xp:
@@ -49,9 +50,9 @@ broadcast:
- ""
- "&fThe &9&lIllusioner&r&f has been killed!"
- "&fMost Damage:"
- "&f - &9%top%&f: &9%top_damage% &fDamage"
- "&f - &9%second%&f: &9%second_damage% &fDamage"
- "&f - &9%third%&f: &9%third_damage% &fDamage"
- "&f - &9%top%&f (%top_damage% Damage)"
- "&f - &9%second%&f (%second_damage% Damage)"
- "&f - &9%third%&f (%third_damage% Damage)"
- ""