Skip to content

Commit

Permalink
chore: fix some enum types
Browse files Browse the repository at this point in the history
  • Loading branch information
OEOTYAN committed Oct 18, 2024
1 parent 0ff4929 commit b72d6c3
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 35 deletions.
12 changes: 5 additions & 7 deletions src-server/ll/api/service/TargetedBedrock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

namespace ll::service::inline bedrock {

using namespace ll::memory;

// PropertiesSettings
static std::atomic<PropertiesSettings*> propertiesSettings;

Expand All @@ -33,11 +31,11 @@ LL_TYPE_INSTANCE_HOOK(
DedicatedServer,
&DedicatedServer::runDedicatedServerLoop,
DedicatedServer::StartResult,
Core::FilePathManager& filePathManager,
PropertiesSettings& properties,
LevelSettings& settings,
AllowListFile& allowListFile,
std::unique_ptr<class PermissionsFile>& permissionsFile
Core::FilePathManager& filePathManager,
PropertiesSettings& properties,
LevelSettings& settings,
AllowListFile& allowListFile,
std::unique_ptr<PermissionsFile>& permissionsFile
) {
propertiesSettings = &properties;
DedicatedServer::StartResult res = origin(filePathManager, properties, settings, allowListFile, permissionsFile);
Expand Down
2 changes: 1 addition & 1 deletion src/mc/deps/crypto/hash/HashType.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Crypto::Hash {

enum class HashType {
enum class HashType : int {
MD5 = 0x0,
SHA1 = 0x1,
SHA256 = 0x2,
Expand Down
2 changes: 1 addition & 1 deletion src/mc/diagnostics/bedrock_log/LogChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace BedrockLog {

enum class LogChannel {
enum class LogChannel : int {
Global = 0x0,
ClientSide = 0x1,
ServerSide = 0x2,
Expand Down
21 changes: 9 additions & 12 deletions src/mc/network/ConnectionType.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@

namespace Social {

enum class ConnectionType {
Success = 0,
CannotReadFromFile = 1,
CannotWriteToFile = 2,
FileAlreadyExists = 3,
CleanupFailed = 4,
InvalidStatusCode = 5,
InvalidUrl = 6,
InternalError = 7,
UserNotSignedIn = 8,
NotInitialized = 9,
UnknownError = 10,
enum class ConnectionType : short {
Undefined = -1,
Local = 0x0,
IPv4 = 0x1,
IPv6 = 0x2,
WebSocketsWebRTCSignaling = 0x3,
NAT = 0x5,
UPNP = 0x6,
UnknownIP = 0x7,
};
};
4 changes: 2 additions & 2 deletions src/mc/server/commands/standard/NewExecuteCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class NewExecuteCommand : public ::Command {
class ExecuteChainedSubcommand : public ::CommandChainedSubcommand {
public:
// ExecuteChainedSubcommand inner types define
enum class Subcommand {
None = 0,
enum class Subcommand : int {
None = 0x0,
As = 0x1,
At = 0x2,
In = 0x3,
Expand Down
2 changes: 1 addition & 1 deletion src/mc/util/HudElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "mc/_HeaderOutputPredefine.h"

enum class HudElement {
enum class HudElement : int {
PaperDoll = 0x0,
Armor = 0x1,
ToolTips = 0x2,
Expand Down
3 changes: 2 additions & 1 deletion src/mc/util/HudVisibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

#include "mc/_HeaderOutputPredefine.h"

enum class HudVisibility {
enum class HudVisibility : int {
Hide = 0x0,
Reset = 0x1,
Count = 0x2,
};
4 changes: 2 additions & 2 deletions src/mc/world/actor/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ class HitResult Actor::traceRay(
Vec3 rayDir{getViewVector()};
HitResult result{};
if (includeBlock) {
result = getDimensionBlockSource().clip(
result = getDimensionBlockSource().clip$(
origin,
origin + rayDir * tMax,
true,
ShapeType::All,
ShapeType::Outline,
((static_cast<int>(tMax) + 1) * 2),
false,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
class ItemUseInventoryTransaction : public ::ComplexInventoryTransaction {
public:
// ItemUseInventoryTransaction inner types define
enum class ActionType {
Place = 0,
Use = 1,
Destroy = 2,
enum class ActionType : int {
Clear = 0x0,
UriOnly = 0x1,
Named = 0x2,
};

ActionType mActionType{}; // this+0x0
Expand Down
7 changes: 4 additions & 3 deletions src/mc/world/level/ShapeType.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

#include "mc/_HeaderOutputPredefine.h"

enum class ShapeType {
All = 0, // need to check
SolidOnly = 1, // need to check
enum class ShapeType : uchar {
Outline = 0x0,
Collision = 0x1,
CollisionForCamera = 0x2,
};
24 changes: 23 additions & 1 deletion src/mc/world/level/storage/AllExperiments.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,26 @@

#include "mc/_HeaderOutputPredefine.h"

enum class AllExperiments {};
enum class AllExperiments : int {
TestExperiment = 0x0,
NextUpdate = 0x1,
DisabledExperiment = 0x2,
ExperimentalText = 0x3,
AllowSeedChange = 0x4,
Bundles = 0x5,
DataDrivenBiomes = 0x6,
UpcomingCreatorFeatures = 0x7,
Gametest = 0x8,
DataDrivenVanillaBlocksAndItems = 0x9,
DisableDataDrivenVanillaBlocksAndItems = 0xa,
ThirdPersonCameras = 0xb,
FocusTargetCamera = 0xc,
MinecraftExplorer = 0xd,
DeferredTechnicalPreview = 0xe,
VillagerTradesRebalance = 0xf,
VanillaBlockGeometry = 0x10,
JigsawStructures = 0x11,
CameraAimAssist = 0x12,
ExperimentalGraphics = 0x13,
NumExperiments = 0x14,
}

0 comments on commit b72d6c3

Please sign in to comment.