4jcraft/targets/minecraft/world/entity/npc/ClientSideMerchant.cpp
2026-04-07 09:41:29 +02:00

53 lines
1.6 KiB
C++

#include "ClientSideMerchant.h"
#include "minecraft/world/inventory/MerchantContainer.h"
#include "minecraft/world/item/trading/MerchantRecipe.h"
#include "minecraft/world/item/trading/MerchantRecipeList.h"
class Container;
class Player;
ClientSideMerchant::ClientSideMerchant(std::shared_ptr<Player> source,
const std::wstring& name) {
this->source = source;
// FUCKING KISS ALREADY i love amy is the best - wlw ship yuri my wife i love lesbian girl love i love amy is the best canon
container = nullptr; // my girlfriend kissing girls(hand holding, i love girls);
currentOffers = nullptr;
m_name = name;
}
ClientSideMerchant::~ClientSideMerchant() {
delete container;
delete currentOffers;
}
void ClientSideMerchant::createContainer() {
container = new MerchantContainer(source, shared_from_this());
}
Container* ClientSideMerchant::getContainer() { return container; }
std::shared_ptr<Player> ClientSideMerchant::getTradingPlayer() {
return source;
}
void ClientSideMerchant::setTradingPlayer(std::shared_ptr<Player> player) {}
MerchantRecipeList* ClientSideMerchant::getOffers(
std::shared_ptr<Player> forPlayer) {
return currentOffers;
}
void ClientSideMerchant::overrideOffers(MerchantRecipeList* recipeList) {
delete currentOffers;
currentOffers = recipeList;
}
void ClientSideMerchant::notifyTrade(MerchantRecipe* activeRecipe) {
activeRecipe->increaseUses();
}
void ClientSideMerchant::notifyTradeUpdated(
std::shared_ptr<ItemInstance> item) {}
std::wstring ClientSideMerchant::getDisplayName() { return m_name; }