File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
src/main/java/io/github/axle2005/clearmob Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 2525import org .spongepowered .api .entity .EntityType ;
2626import org .spongepowered .api .entity .Item ;
2727import org .spongepowered .api .entity .living .animal .Animal ;
28+ import org .spongepowered .api .entity .living .monster .Boss ;
2829import org .spongepowered .api .entity .living .monster .Monster ;
2930import org .spongepowered .api .entity .living .player .Player ;
3031import 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 ())) {
Original file line number Diff line number Diff 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" ,
You can’t perform that action at this time.
0 commit comments