Skip to content
This repository has been archived by the owner on Dec 26, 2021. It is now read-only.

Added EnderChests to ChestAura #4502

Merged
merged 4 commits into from
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Horion/Module/Modules/ChestAura.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

ChestAura::ChestAura() : IModule(0, Category::PLAYER, "Aura for opening chests") {
registerIntSetting("Range", &this->range, this->range, 1, 10);
registerBoolSetting("EnderChests", &this->enderchests, this->enderchests);
}

ChestAura::~ChestAura() {
Expand All @@ -22,13 +23,16 @@ void ChestAura::onTick(C_GameMode* gm) {
vec3_ti pos = vec3_ti(x, y, z);
C_Block* block = gm->player->region->getBlock(pos);
if (block != nullptr && g_Data.canUseMoveKeys()) {
if (block->toLegacy()->blockId == 54) {
auto id = gm->player->region->getBlock(pos)->toLegacy()->blockId;
bool open = false;
if (id == 54) open = true; // Chests
if (id == 130 && enderchests) open = true; // EnderCheats
if (open)
if (!(std::find(chestlist.begin(), chestlist.end(), pos) != chestlist.end())) {
gm->buildBlock(&pos, 0);
chestlist.push_back(pos);
return;
}
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions Horion/Module/Modules/ChestAura.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
class ChestAura : public IModule {
private:
int range = 3;
bool enderchests = false;

public:
C_MoveInputHandler* inputHandler = nullptr;
Expand Down