2026-03-01 12:16:08 +08:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
#include "net.minecraft.world.entity.player.h"
|
|
|
|
|
#include "ResultContainer.h"
|
|
|
|
|
|
|
|
|
|
ResultContainer::ResultContainer() : Container()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unsigned int ResultContainer::getContainerSize()
|
|
|
|
|
{
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-02 17:37:16 +07:00
|
|
|
shared_ptr<ItemInstance> ResultContainer::getItem(unsigned int slot)
|
2026-03-01 12:16:08 +08:00
|
|
|
{
|
2026-03-03 03:04:10 +08:00
|
|
|
return items[0];
|
2026-03-01 12:16:08 +08:00
|
|
|
}
|
|
|
|
|
|
2026-03-03 03:04:10 +08:00
|
|
|
wstring ResultContainer::getName()
|
2026-03-01 12:16:08 +08:00
|
|
|
{
|
2026-03-03 03:04:10 +08:00
|
|
|
return L"";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
wstring ResultContainer::getCustomName()
|
|
|
|
|
{
|
|
|
|
|
return L"";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool ResultContainer::hasCustomName()
|
|
|
|
|
{
|
|
|
|
|
return false;
|
2026-03-01 12:16:08 +08:00
|
|
|
}
|
|
|
|
|
|
2026-03-02 17:37:16 +07:00
|
|
|
shared_ptr<ItemInstance> ResultContainer::removeItem(unsigned int slot, int count)
|
2026-03-01 12:16:08 +08:00
|
|
|
{
|
2026-03-03 03:04:10 +08:00
|
|
|
if (items[0] != NULL)
|
2026-03-01 12:16:08 +08:00
|
|
|
{
|
2026-03-03 03:04:10 +08:00
|
|
|
shared_ptr<ItemInstance> item = items[0];
|
|
|
|
|
items[0] = nullptr;
|
2026-03-01 12:16:08 +08:00
|
|
|
return item;
|
|
|
|
|
}
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-02 17:37:16 +07:00
|
|
|
shared_ptr<ItemInstance> ResultContainer::removeItemNoUpdate(int slot)
|
2026-03-01 12:16:08 +08:00
|
|
|
{
|
2026-03-03 03:04:10 +08:00
|
|
|
if (items[0] != NULL)
|
2026-03-01 12:16:08 +08:00
|
|
|
{
|
2026-03-03 03:04:10 +08:00
|
|
|
shared_ptr<ItemInstance> item = items[0];
|
|
|
|
|
items[0] = nullptr;
|
2026-03-01 12:16:08 +08:00
|
|
|
return item;
|
|
|
|
|
}
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-02 17:37:16 +07:00
|
|
|
void ResultContainer::setItem(unsigned int slot, shared_ptr<ItemInstance> item)
|
2026-03-01 12:16:08 +08:00
|
|
|
{
|
2026-03-03 03:04:10 +08:00
|
|
|
items[0] = item;
|
2026-03-01 12:16:08 +08:00
|
|
|
}
|
|
|
|
|
|
2026-03-03 06:14:34 +07:00
|
|
|
int ResultContainer::getMaxStackSize() const
|
2026-03-01 12:16:08 +08:00
|
|
|
{
|
|
|
|
|
return Container::LARGE_MAX_STACK_SIZE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ResultContainer::setChanged()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-02 17:37:16 +07:00
|
|
|
bool ResultContainer::stillValid(shared_ptr<Player> player)
|
2026-03-03 03:04:10 +08:00
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool ResultContainer::canPlaceItem(int slot, shared_ptr<ItemInstance> item)
|
2026-03-01 12:16:08 +08:00
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|