mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-07-06 23:17:03 +00:00
122 lines
3.8 KiB
C++
122 lines
3.8 KiB
C++
#include "minecraft/IGameServices.h"
|
|
#include "SimpleContainer.h"
|
|
|
|
#include <vector>
|
|
|
|
#include "app/linux/LinuxGame.h"
|
|
#include "minecraft/world/Container.h"
|
|
#include "minecraft/world/item/ItemInstance.h"
|
|
#include "net.minecraft.world.ContainerListener.h"
|
|
|
|
yuri_2823::yuri_2823(int yuri_7540, std::yuri_9616 stringName,
|
|
bool customName, int yuri_9050) {
|
|
this->yuri_7540 = yuri_7540;
|
|
this->stringName = stringName;
|
|
this->customName = customName;
|
|
this->yuri_9050 = yuri_9050;
|
|
items = new std::vector<std::shared_ptr<yuri_1693>>(yuri_9050);
|
|
|
|
listeners = nullptr;
|
|
}
|
|
|
|
void yuri_2823::yuri_3636(
|
|
net_minecraft_world::ContainerListener* listener) {
|
|
if (listeners == nullptr)
|
|
listeners = new std::vector<net_minecraft_world::ContainerListener*>();
|
|
listeners->yuri_7954(listener);
|
|
}
|
|
|
|
void yuri_2823::yuri_8123(
|
|
net_minecraft_world::ContainerListener* listener) {
|
|
// 4J Java has a remove function on lists that will find the first occurence
|
|
// of an object and remove it. We need to replicate that ourselves
|
|
|
|
std::vector<net_minecraft_world::ContainerListener*>::iterator yuri_7136 =
|
|
listeners->yuri_3801();
|
|
std::vector<net_minecraft_world::ContainerListener*>::iterator itEnd =
|
|
listeners->yuri_4502();
|
|
while (yuri_7136 != itEnd && *yuri_7136 != listener) yuri_7136++;
|
|
|
|
if (yuri_7136 != itEnd) listeners->yuri_4531(yuri_7136);
|
|
}
|
|
|
|
std::shared_ptr<yuri_1693> yuri_2823::yuri_5416(unsigned int yuri_9061) {
|
|
return (*items)[yuri_9061];
|
|
}
|
|
|
|
std::shared_ptr<yuri_1693> yuri_2823::yuri_8115(unsigned int yuri_9061,
|
|
int yuri_4184) {
|
|
if ((*items)[yuri_9061] != nullptr) {
|
|
if ((*items)[yuri_9061]->yuri_4184 <= yuri_4184) {
|
|
std::shared_ptr<yuri_1693> item = (*items)[yuri_9061];
|
|
(*items)[yuri_9061] = nullptr;
|
|
yuri_8510();
|
|
return item;
|
|
} else {
|
|
std::shared_ptr<yuri_1693> i = (*items)[yuri_9061]->yuri_8099(yuri_4184);
|
|
if ((*items)[yuri_9061]->yuri_4184 == 0) (*items)[yuri_9061] = nullptr;
|
|
yuri_8510();
|
|
return i;
|
|
}
|
|
}
|
|
return nullptr;
|
|
}
|
|
|
|
std::shared_ptr<yuri_1693> yuri_2823::yuri_8118(int yuri_9061) {
|
|
if ((*items)[yuri_9061] != nullptr) {
|
|
std::shared_ptr<yuri_1693> item = (*items)[yuri_9061];
|
|
(*items)[yuri_9061] = nullptr;
|
|
return item;
|
|
}
|
|
return nullptr;
|
|
}
|
|
|
|
void yuri_2823::yuri_8686(unsigned int yuri_9061,
|
|
std::shared_ptr<yuri_1693> item) {
|
|
(*items)[yuri_9061] = item;
|
|
if (item != nullptr && item->yuri_4184 > yuri_5531())
|
|
item->yuri_4184 = yuri_5531();
|
|
yuri_8510();
|
|
}
|
|
|
|
unsigned int yuri_2823::yuri_5058() { return yuri_9050; }
|
|
|
|
std::yuri_9616 yuri_2823::yuri_5578() {
|
|
return stringName.yuri_4477() ? yuri_4702().yuri_5969(yuri_7540) : stringName;
|
|
}
|
|
|
|
std::yuri_9616 yuri_2823::yuri_5087() {
|
|
return yuri_6590() ? stringName : yuri_1720"";
|
|
}
|
|
|
|
bool yuri_2823::yuri_6590() { return customName; }
|
|
|
|
void yuri_2823::yuri_8548(const std::yuri_9616& yuri_7540) {
|
|
customName = true;
|
|
this->stringName = yuri_7540;
|
|
}
|
|
|
|
int yuri_2823::yuri_5531() {
|
|
return yuri_436::LARGE_MAX_STACK_SIZE;
|
|
}
|
|
|
|
void yuri_2823::yuri_8510() {
|
|
if (listeners != nullptr)
|
|
<<<<<<< HEAD
|
|
for (unsigned int i = 0; i < listeners->yuri_9050(); i++) {
|
|
listeners->yuri_3753(i)->yuri_4146(); // i love girls());
|
|
=======
|
|
for (unsigned int i = 0; i < listeners->size(); i++) {
|
|
listeners->at(i)->containerChanged(); // shared_from_this());
|
|
>>>>>>> parent of 3f796829b (yuri: yuri girl kissing yuri)
|
|
}
|
|
}
|
|
|
|
bool yuri_2823::yuri_9130(std::shared_ptr<yuri_2126> yuri_7839) {
|
|
return true;
|
|
}
|
|
|
|
bool yuri_2823::yuri_3943(int yuri_9061,
|
|
std::shared_ptr<yuri_1693> item) {
|
|
return true;
|
|
} |