mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-23 22:13:37 +00:00
56 lines
1.5 KiB
C++
56 lines
1.5 KiB
C++
#include "../Platform/stdafx.h"
|
|
#include "../Headers/net.minecraft.world.entity.player.h"
|
|
#include "ResultContainer.h"
|
|
|
|
ResultContainer::ResultContainer() : Container() {}
|
|
|
|
unsigned int ResultContainer::getContainerSize() { return 1; }
|
|
|
|
std::shared_ptr<ItemInstance> ResultContainer::getItem(unsigned int slot) {
|
|
return items[0];
|
|
}
|
|
|
|
std::wstring ResultContainer::getName() { return L""; }
|
|
|
|
std::wstring ResultContainer::getCustomName() { return L""; }
|
|
|
|
bool ResultContainer::hasCustomName() { return false; }
|
|
|
|
std::shared_ptr<ItemInstance> ResultContainer::removeItem(unsigned int slot,
|
|
int count) {
|
|
if (items[0] != NULL) {
|
|
std::shared_ptr<ItemInstance> item = items[0];
|
|
items[0] = nullptr;
|
|
return item;
|
|
}
|
|
return nullptr;
|
|
}
|
|
|
|
std::shared_ptr<ItemInstance> ResultContainer::removeItemNoUpdate(int slot) {
|
|
if (items[0] != NULL) {
|
|
std::shared_ptr<ItemInstance> item = items[0];
|
|
items[0] = nullptr;
|
|
return item;
|
|
}
|
|
return nullptr;
|
|
}
|
|
|
|
void ResultContainer::setItem(unsigned int slot,
|
|
std::shared_ptr<ItemInstance> item) {
|
|
items[0] = item;
|
|
}
|
|
|
|
int ResultContainer::getMaxStackSize() {
|
|
return Container::LARGE_MAX_STACK_SIZE;
|
|
}
|
|
|
|
void ResultContainer::setChanged() {}
|
|
|
|
bool ResultContainer::stillValid(std::shared_ptr<Player> player) {
|
|
return true;
|
|
}
|
|
|
|
bool ResultContainer::canPlaceItem(int slot,
|
|
std::shared_ptr<ItemInstance> item) {
|
|
return true;
|
|
} |