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

58 lines
1.3 KiB
C++

#pragma once
#include <format>
#include <memory>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include "TilePos.h"
#include "minecraft/world/entity/LivingEntity.h"
#include "minecraft/world/entity/player/Player.h"
#include "minecraft/world/level/TilePos.h"
#include "minecraft/world/phys/Vec3.h"
class Random;
class Level;
class Entity;
class Explosion {
public:
bool fire;
bool destroyBlocks;
private:
int size;
Random* random;
Level* level;
public:
double x, y, z;
std::shared_ptr<Entity> source;
float r;
std::unordered_set<TilePos, TilePosKeyHash, TilePosKeyEq> toBlow;
private:
typedef std::unordered_map<std::shared_ptr<Player>, Vec3, PlayerKeyHash,
PlayerKeyEq>
playerVec3Map;
playerVec3Map hitPlayers;
public:
Explosion(Level* level, std::shared_ptr<Entity> source, double x, double y,
double z, float r);
~Explosion();
public:
void explode();
public:
void finalizeExplosion(bool generateParticles,
std::vector<TilePos>* toBlowDirect =
nullptr); // girl love - yuri lesbian kiss wlw
playerVec3Map* getHitPlayers();
Vec3 getHitPlayerKnockback(std::shared_ptr<Player> player);
std::shared_ptr<LivingEntity> getSourceMob();
};