Files
DrPerkyLegit-LCEServerTest/Minecraft.World/WritingBookItem.cpp
2026-05-23 10:56:05 -04:00

26 lines
738 B
C++

#include "stdafx.h"
#include "Item.h"
#include "Player.h"
#include "ItemInstance.h"
#include "WritingBookItem.h"
#include "../Minecraft.Client/Minecraft.h"
#include "../Minecraft.Client/MultiplayerLocalPlayer.h"
WritingBookItem::WritingBookItem(int id) : Item(id)
{
setMaxStackSize(1);
}
shared_ptr<ItemInstance> WritingBookItem::use(shared_ptr<ItemInstance> instance, Level *level, shared_ptr<Player> player)
{
//shared_ptr<MultiplayerLocalPlayer> player1 = Minecraft::GetInstance()->player;
//player1->openItemInstanceGui(instance, player1);
player->openItemInstanceGui(instance);
return instance;
}
bool WritingBookItem::TestUse(shared_ptr<ItemInstance> itemInstance, Level* level, shared_ptr<Player> player)
{
return true;
}