From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- Minecraft.World/ResultContainer.cpp | 64 +++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Minecraft.World/ResultContainer.cpp (limited to 'Minecraft.World/ResultContainer.cpp') diff --git a/Minecraft.World/ResultContainer.cpp b/Minecraft.World/ResultContainer.cpp new file mode 100644 index 00000000..c28b3cf3 --- /dev/null +++ b/Minecraft.World/ResultContainer.cpp @@ -0,0 +1,64 @@ +#include "stdafx.h" +#include "net.minecraft.world.entity.player.h" +#include "ResultContainer.h" + +ResultContainer::ResultContainer() : Container() +{ + items = new ItemInstanceArray(1); +} + +unsigned int ResultContainer::getContainerSize() +{ + return 1; +} + +shared_ptr ResultContainer::getItem(unsigned int slot) +{ + return (*items)[0]; +} + +int ResultContainer::getName() +{ + return 0; +} + +shared_ptr ResultContainer::removeItem(unsigned int slot, int count) +{ + if ((*items)[0] != NULL) + { + shared_ptr item = (*items)[0]; + (*items)[0] = nullptr; + return item; + } + return nullptr; +} + +shared_ptr ResultContainer::removeItemNoUpdate(int slot) +{ + if ((*items)[0] != NULL) + { + shared_ptr item = (*items)[0]; + (*items)[0] = nullptr; + return item; + } + return nullptr; +} + +void ResultContainer::setItem(unsigned int slot, shared_ptr item) +{ + (*items)[0] = item; +} + +int ResultContainer::getMaxStackSize() +{ + return Container::LARGE_MAX_STACK_SIZE; +} + +void ResultContainer::setChanged() +{ +} + +bool ResultContainer::stillValid(shared_ptr player) +{ + return true; +} \ No newline at end of file -- cgit v1.2.3