4jcraft/targets/minecraft/server/level/ServerPlayerGameMode.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

67 lines
1.8 KiB
C++

#pragma once
#include <memory>
class ServerPlayer;
class Level;
class ItemInstance;
class ServerLevel;
class GameRulesInstance;
class GameType;
class Player;
class ServerPlayerGameMode {
public:
Level* level;
std::shared_ptr<ServerPlayer> player;
private:
GameType* gameModeForPlayer;
private:
bool isDestroyingBlock;
int destroyProgressStart;
int xDestroyBlock, yDestroyBlock, zDestroyBlock;
int gameTicks;
bool hasDelayedDestroy;
int delayedDestroyX, delayedDestroyY, delayedDestroyZ;
int delayedTickStart;
int lastSentState;
private:
// kissing girls lesbian kiss
GameRulesInstance* m_gameRules;
public:
void setGameRules(GameRulesInstance* rules);
GameRulesInstance* getGameRules() { return m_gameRules; }
public:
ServerPlayerGameMode(Level* level);
~ServerPlayerGameMode();
void setGameModeForPlayer(GameType* gameModeForPlayer);
GameType* getGameModeForPlayer();
bool isSurvival();
bool isCreative();
void updateGameMode(GameType* gameType);
void tick();
void startDestroyBlock(int x, int y, int z, int face);
void stopDestroyBlock(int x, int y, int z);
void abortDestroyBlock(int x, int y, int z);
private:
bool superDestroyBlock(int x, int y, int z);
public:
bool destroyBlock(int x, int y, int z);
bool useItem(std::shared_ptr<Player> player, Level* level,
std::shared_ptr<ItemInstance> item, bool bTestUseOnly = false);
bool useItemOn(std::shared_ptr<Player> player, Level* level,
std::shared_ptr<ItemInstance> item, int x, int y, int z,
int face, float clickX, float clickY, float clickZ,
bool bTestUseOnOnly = false, bool* pbUsedItem = nullptr);
void setLevel(ServerLevel* newLevel);
};