#pragma once
#include "Mod.h"

#include "Datas/LanguageDatas.h"
#include "SDK/ContainerID.h"

class InventorySync : public Mod {
public:
	InventorySync() : Mod(Datas::Language::get().module.player.inventorysync.name, Datas::Language::get().module.player.inventorysync.description, Category::PLAYER) {
		enabled = false;
	}

private:
	std::queue<ContainerID> containerQueue;
	std::mutex queueMutex;
	bool inventoryOpen;
	bool inventoryOpenServerside;
	bool sendingClosePacket;
	int desyncTicks = 0;

	virtual auto onPacketSendAfter2(Packet* packet, bool* cancel) -> void override;
	virtual auto onPacketReceive(Packet* packet, bool* cancel) -> void;
	virtual auto onClient() -> void override;
	virtual auto onClient4() -> void override;
};
