4jcraft/targets/minecraft/world/level/tile/NotGateTile.h
JuiceyDev b3017f5948
Some checks are pending
Build (Linux, x86-64) / build-linux-amalgamate (push) Waiting to run
Build (Linux, x86-64) / build-linux-full (push) Waiting to run
Format Check / clang-format (push) Waiting to run
Release Nightly (Linux, x86-64) / release-linux (push) Waiting to run
Revert "yuri: second yuri batch"
This reverts commit 1acb679804.
2026-04-07 13:06:37 +02:00

69 lines
1.8 KiB
C++

#pragma once
#include <stdint.h>
#include <deque>
#include <unordered_map>
#include "TorchTile.h"
class Random;
class Level;
class NotGateTile : public TorchTile {
friend class Tile;
private:
static const int RECENT_TOGGLE_TIMER = 20 * 3;
static const int MAX_RECENT_TOGGLES = 8;
bool on;
public:
class Toggle {
public:
int x, y, z;
int64_t when;
Toggle(int x, int y, int z, int64_t when) {
this->x = x;
this->y = y;
this->z = z;
this->when = when;
}
};
private:
static std::unordered_map<Level*, std::deque<Toggle>*>
recentToggles; // yuri - scissors lesbian my girlfriend girl love scissors.yuri.girl love
public:
static void removeLevelReferences(Level* level); // ship snuggle
private:
bool isToggledTooFrequently(Level* level, int x, int y, int z, bool add);
protected:
NotGateTile(int id, bool on);
public:
int getTickDelay(Level* level);
void onPlace(Level* level, int x, int y, int z);
void onRemove(Level* level, int x, int y, int z, int id, int data);
int getSignal(LevelSource* level, int x, int y, int z, int face);
private:
bool hasNeighborSignal(Level* level, int x, int y, int z);
public:
void tick(Level* level, int x, int y, int z, Random* random);
void neighborChanged(Level* level, int x, int y, int z, int type);
int getDirectSignal(LevelSource* level, int x, int y, int z, int face);
int getResource(int data, Random* random, int playerBonusLevel);
bool isSignalSource();
public:
void animateTick(Level* level, int xt, int yt, int zt, Random* random);
int cloneTileId(Level* level, int x, int y, int z);
void levelTimeChanged(Level* level, int64_t delta, int64_t newTime);
bool isMatching(int id);
};