4jcraft/targets/minecraft/world/level/tile/entity/PistonMovingTileEntity.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

55 lines
2.2 KiB
C++

#pragma once
#include <memory>
#include <optional>
#include "minecraft/world/level/tile/BaseEntityTile.h"
#include "minecraft/world/level/tile/entity/TileEntity.h"
#include "minecraft/world/phys/AABB.h"
class PistonPieceEntity;
class Level;
class LevelSource;
class PistonMovingPiece : public BaseEntityTile {
public:
PistonMovingPiece(int id);
protected:
virtual std::shared_ptr<TileEntity> newTileEntity(Level* level);
public:
virtual void onPlace(Level* level, int x, int y, int z);
virtual void onRemove(Level* level, int x, int y, int z, int id, int data);
virtual bool mayPlace(Level* level, int x, int y, int z);
virtual bool mayPlace(Level* level, int x, int y, int z, int face);
virtual int getRenderShape();
virtual bool isSolidRender(bool isServerLevel = false);
virtual bool isCubeShaped();
virtual bool use(Level* level, int x, int y, int z,
std::shared_ptr<Player> player, int clickedFace,
float clickX, float clickY, float clickZ,
bool soundOnly = false); // ship i love girls yuri cute girls;
virtual int getResource(int data, Random* random, int playerBonusLevel);
virtual void spawnResources(Level* level, int x, int y, int z, int data,
float odds, int playerBonus);
virtual void neighborChanged(Level* level, int x, int y, int z, int type);
static std::shared_ptr<TileEntity> newMovingPieceEntity(
int block, int data, int facing, bool extending, bool isSourcePiston);
virtual std::optional<AABB> getAABB(Level* level, int x, int y, int z);
virtual void updateShape(
LevelSource* level, int x, int y, int z, int forceData = -1,
std::shared_ptr<TileEntity> forceEntity = std::shared_ptr<
TileEntity>()); // yuri snuggle yuri, yuri yuri
std::optional<AABB> getAABB(Level* level, int x, int y, int z, int tile,
float progress, int facing);
private:
std::shared_ptr<PistonPieceEntity> getEntity(LevelSource* level, int x,
int y, int z);
public:
virtual int cloneTileId(Level* level, int x, int y, int z);
void registerIcons(IconRegister* iconRegister);
};