Skip to content

Commit 4d6ae0a

Browse files
committed
Separated Bosses from Main Clear
1 parent ab348a2 commit 4d6ae0a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/main/java/io/github/axle2005/clearmob/clearers/ClearEntity.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.spongepowered.api.entity.EntityType;
2626
import org.spongepowered.api.entity.Item;
2727
import org.spongepowered.api.entity.living.animal.Animal;
28+
import org.spongepowered.api.entity.living.monster.Boss;
2829
import org.spongepowered.api.entity.living.monster.Monster;
2930
import org.spongepowered.api.entity.living.player.Player;
3031
import org.spongepowered.api.world.World;
@@ -53,10 +54,16 @@ public static void run(CommandSource src) {
5354
//Skip players and Nametags
5455
if (!(entity instanceof Player || entity.get(DisplayNameData.class).isPresent())) {
5556
//Kills all Monsters
56-
if (instance.getGlobalConfig().options.get(0).killAllMonsters && entity instanceof Monster) {
57+
if (instance.getGlobalConfig().options.get(0).killAllMonsters && entity instanceof Monster && !(entity instanceof Boss)) {
5758
removedEntities++;
5859
entity.remove();
5960
}
61+
//Kills all Bosses
62+
if (instance.getGlobalConfig().options.get(0).killAllBosses && entity instanceof Boss) {
63+
removedEntities++;
64+
entity.remove();
65+
}
66+
6067
//Removes all Drops
6168
if (instance.getGlobalConfig().options.get(0).killAllDrops && entity instanceof Item) {
6269
if (!Util.getItemType(instance.getGlobalConfig().options.get(0).listItemEntitys).contains(((Item) entity).getItemType())) {

src/main/java/io/github/axle2005/clearmob/configuration/OptionsConfig.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public class OptionsConfig {
2929

3030
@Setting(value = "Enable Kill All Monsters", comment = "")
3131
public Boolean killAllMonsters;
32+
@Setting(value = "Enable Kill All Bosses", comment = "")
33+
public Boolean killAllBosses;
3234
@Setting(value = "Enable Kill All Dropped Items", comment = "")
3335
public Boolean killAllDrops;
3436
@Setting(value = "Enable Kill Grouped Animals", comment = "")
@@ -42,6 +44,7 @@ public class OptionsConfig {
4244

4345
void initializeDefaults() {
4446
killAllMonsters = false;
47+
killAllBosses = false;
4548
killAllDrops = false;
4649
killAnimalGroups = false;
4750
listEntitys = new ArrayList<String>(Arrays.asList("minecraft:zombie", "minecraft:witch",

0 commit comments

Comments
 (0)