mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-07-12 00:11:26 +00:00
TU19: merge Minecraft.World/Commands
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "../Platform/stdafx.h"
|
||||
#include "../Headers/net.minecraft.commands.h"
|
||||
#include "../Headers/net.minecraft.world.entity.item.h"
|
||||
#include "../Headers/net.minecraft.world.item.h"
|
||||
#include "../Headers/net.minecraft.network.packet.h"
|
||||
#include "../../Minecraft.Client/Player/ServerPlayer.h"
|
||||
@@ -7,6 +8,8 @@
|
||||
|
||||
EGameCommand GiveItemCommand::getId() { return eGameCommand_Give; }
|
||||
|
||||
int GiveItemCommand::getPermissionLevel() { return LEVEL_GAMEMASTERS; }
|
||||
|
||||
void GiveItemCommand::execute(std::shared_ptr<CommandSender> source,
|
||||
byteArray commandData) {
|
||||
ByteArrayInputStream bais(commandData);
|
||||
@@ -24,7 +27,8 @@ void GiveItemCommand::execute(std::shared_ptr<CommandSender> source,
|
||||
if (player != NULL && item > 0 && Item::items[item] != NULL) {
|
||||
std::shared_ptr<ItemInstance> itemInstance =
|
||||
std::shared_ptr<ItemInstance>(new ItemInstance(item, amount, aux));
|
||||
player->drop(itemInstance);
|
||||
std::shared_ptr<ItemEntity> drop = player->drop(itemInstance);
|
||||
drop->throwTime = 0;
|
||||
// logAdminAction(source, L"commands.give.success",
|
||||
// ChatPacket::e_ChatCustom, Item::items[item]->getName(itemInstance),
|
||||
// item, amount, player->getAName());
|
||||
@@ -49,4 +53,4 @@ std::shared_ptr<GameCommandPacket> GiveItemCommand::preparePacket(
|
||||
|
||||
return std::shared_ptr<GameCommandPacket>(
|
||||
new GameCommandPacket(eGameCommand_Give, baos.toByteArray()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user