mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-27 23:33:00 +00:00
add kill count to butterfly kill command (#2174)
This commit is contained in:
1 parent
8a431e56ef
commit
b92a1a10e9
2 files changed
+9
-5
No files matched your search
@@ -10,13 +10,15 @@
|
||||
******************************************************************************/
|
||||
package forestry.lepidopterology.commands;
|
||||
|
||||
import forestry.core.commands.CommandHelpers;
|
||||
import forestry.core.commands.SubCommand;
|
||||
import forestry.lepidopterology.entities.EntityButterfly;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.command.WrongUsageException;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.EntitySelectors;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
|
||||
import forestry.core.commands.CommandHelpers;
|
||||
import forestry.core.commands.SubCommand;
|
||||
import forestry.lepidopterology.entities.EntityButterfly;
|
||||
|
||||
/**
|
||||
* @author CovertJaguar <http://www.railcraft.info/>
|
||||
@@ -42,12 +44,13 @@ public class CommandButterfly extends SubCommand {
|
||||
if (args.length > 1) {
|
||||
CommandHelpers.throwWrongUsage(sender, this);
|
||||
}
|
||||
|
||||
int killCount = 0;
|
||||
for (EntityButterfly butterfly : sender.getEntityWorld().getEntities(EntityButterfly.class, EntitySelectors.IS_ALIVE)) {
|
||||
butterfly.setDead();
|
||||
killCount++;
|
||||
}
|
||||
sender.sendMessage(new TextComponentTranslation("for.chat.command.forestry.butterfly.kill.response", killCount));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1496,6 +1496,7 @@ for.chat.command.forestry.butterfly.format=Format: /%s <sub-command>
|
||||
for.chat.command.forestry.butterfly.kill.desc=- %s : Kills all Butterflies
|
||||
for.chat.command.forestry.butterfly.kill.help=Kills all Butterflies in loaded chunks
|
||||
for.chat.command.forestry.butterfly.kill.format=Format: /%s [<dimension#>]
|
||||
for.chat.command.forestry.butterfly.kill.response=Killed %d butterflies
|
||||
|
||||
for.butterflies.hybrid=Hybrid: %PRIMARY-%SECONDARY
|
||||
|
||||
|
||||
Reference in new issue
Block a user