#pragma once
#include "Mod.h"

class Breaker : public Mod {
public:
	bool lootbox = true;
	bool bed = true;
	float delay = 1.f;

	Breaker() : Mod(_("Breaker"), _("Destroy surrounding objects."), Category::OTHER) {
		settings.push_back(new Setting{ _("Loot Box"), &lootbox, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Bed"), &bed, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Delay"), &delay, new float(10.f), new float(0.f), 2, {}, true, 5.f});
		
		enabled = false;
		onlyenabled = false;
	}

private:
	glm::ivec3 pos = glm::vec3();
	long long start = 0, delstart = 0;
	bool founded = false;
	bool doRot = false;

	bool startfoundp1 = false;
	bool startfoundp2 = false;
	glm::ivec3 teambed = glm::ivec3();

	std::vector<Actor*> targets;
	virtual auto onBaseTick(Player* _this) -> void;
	virtual auto onWorldTick(Player* _this) -> void override;
	virtual auto onPacketSendBefore(Packet* packet) -> void override;
	virtual auto onPacketReceive(Packet* packet, bool* cancel) -> void override;
	virtual auto onDimensionChanged() -> void override;
	virtual auto getMode() -> std::string override;
};
