2026-03-01 12:16:08 +08:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
#include "net.minecraft.commands.h"
|
|
|
|
|
#include "net.minecraft.world.entity.player.h"
|
|
|
|
|
#include "net.minecraft.world.damagesource.h"
|
2026-03-03 03:04:10 +08:00
|
|
|
#include "BasicTypeContainers.h"
|
2026-03-01 12:16:08 +08:00
|
|
|
#include "KillCommand.h"
|
|
|
|
|
|
|
|
|
|
EGameCommand KillCommand::getId()
|
|
|
|
|
{
|
|
|
|
|
return eGameCommand_Kill;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-03 03:04:10 +08:00
|
|
|
int KillCommand::getPermissionLevel()
|
|
|
|
|
{
|
|
|
|
|
return LEVEL_ALL;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-02 17:37:16 +07:00
|
|
|
void KillCommand::execute(shared_ptr<CommandSender> source, byteArray commandData)
|
2026-03-01 12:16:08 +08:00
|
|
|
{
|
2026-03-02 17:37:16 +07:00
|
|
|
shared_ptr<Player> player = dynamic_pointer_cast<Player>(source);
|
2026-03-01 12:16:08 +08:00
|
|
|
|
2026-03-03 03:04:10 +08:00
|
|
|
player->hurt(DamageSource::outOfWorld, Float::MAX_VALUE);
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
source->sendMessage(L"Ouch. That look like it hurt.");
|
2026-03-03 03:04:10 +08:00
|
|
|
//source.sendMessage(ChatMessageComponent.forTranslation("commands.kill.success"));
|
2026-03-01 12:16:08 +08:00
|
|
|
}
|