the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 64 lines 1.3 kB view raw
1#include "stdafx.h" 2#include "net.minecraft.world.item.trading.h" 3#include "net.minecraft.world.inventory.h" 4#include "ClientSideMerchant.h" 5 6ClientSideMerchant::ClientSideMerchant(shared_ptr<Player> source, const wstring &name) 7{ 8 this->source = source; 9 // 4J Stu - Need to do this after creating as a shared_ptr 10 container = NULL; //new MerchantContainer(source, this); 11 currentOffers = NULL; 12 m_name = name; 13} 14 15ClientSideMerchant::~ClientSideMerchant() 16{ 17 delete container; 18 delete currentOffers; 19} 20 21void ClientSideMerchant::createContainer() 22{ 23 container = new MerchantContainer(source, shared_from_this()); 24} 25 26Container *ClientSideMerchant::getContainer() 27{ 28 return container; 29} 30 31shared_ptr<Player> ClientSideMerchant::getTradingPlayer() 32{ 33 return source; 34} 35 36void ClientSideMerchant::setTradingPlayer(shared_ptr<Player> player) 37{ 38 39} 40 41MerchantRecipeList *ClientSideMerchant::getOffers(shared_ptr<Player> forPlayer) 42{ 43 return currentOffers; 44} 45 46void ClientSideMerchant::overrideOffers(MerchantRecipeList *recipeList) 47{ 48 delete currentOffers; 49 currentOffers = recipeList; 50} 51 52void ClientSideMerchant::notifyTrade(MerchantRecipe *activeRecipe) 53{ 54 activeRecipe->increaseUses(); 55} 56 57void ClientSideMerchant::notifyTradeUpdated(shared_ptr<ItemInstance> item) 58{ 59} 60 61wstring ClientSideMerchant::getDisplayName() 62{ 63 return m_name; 64}