mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-08 21:43:10 +00:00
Exempt named mobs by default from /remove
Named mobs can be removed using /remove named Killing all mobs now requires /remove all,tamed,named
This commit is contained in:
parent
b145ec59ea
commit
7e8ba9a256
2 changed files with 28 additions and 12 deletions
|
@ -158,21 +158,36 @@ public class Commandremove extends EssentialsCommand
|
|||
for (ToRemove toRemove : removeTypes)
|
||||
{
|
||||
|
||||
if (e instanceof Tameable && ((Tameable)e).isTamed())
|
||||
// We should skip any TAMED animals unless we are specifially targetting them.
|
||||
if (e instanceof Tameable && ((Tameable)e).isTamed()
|
||||
&& !removeTypes.contains(ToRemove.TAMED))
|
||||
{
|
||||
if (toRemove == ToRemove.TAMED)
|
||||
{
|
||||
e.remove();
|
||||
removed++;
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// We should skip any NAMED animals unless we are specifially targetting them.
|
||||
if (e instanceof LivingEntity && ((LivingEntity)e).getCustomName() != null
|
||||
&& !removeTypes.contains(ToRemove.NAMED))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (toRemove)
|
||||
{
|
||||
case TAMED:
|
||||
if (e instanceof Tameable && ((Tameable)e).isTamed())
|
||||
{
|
||||
e.remove();
|
||||
removed++;
|
||||
}
|
||||
break;
|
||||
case NAMED:
|
||||
if (e instanceof LivingEntity && ((LivingEntity)e).getCustomName() != null)
|
||||
{
|
||||
e.remove();
|
||||
removed++;
|
||||
}
|
||||
break;
|
||||
case DROPS:
|
||||
if (e instanceof Item)
|
||||
{
|
||||
|
@ -305,6 +320,7 @@ public class Commandremove extends EssentialsCommand
|
|||
ENTITIES,
|
||||
ALL,
|
||||
CUSTOM,
|
||||
TAMED
|
||||
TAMED,
|
||||
NAMED
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue