Skip to content

Commit

Permalink
fix: fix test build
Browse files Browse the repository at this point in the history
  • Loading branch information
OEOTYAN committed Feb 11, 2024
1 parent dee317c commit 5176b3b
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 37 deletions.
3 changes: 2 additions & 1 deletion src/ll/api/memory/MemoryOperators.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once

#ifdef LL_MEMORY_OPERATORS
// This header provides convenient overrides for the new and
// delete operations in C++.
//
Expand Down Expand Up @@ -100,3 +100,4 @@ _NODISCARD _Ret_notnull_ _Success_(return != NULL) _Post_writable_byte_size_(siz
operator new[](std::size_t size, std::align_val_t alignment, std::nothrow_t const& tag) noexcept {
return operator new(size, alignment, tag);
}
#endif
2 changes: 2 additions & 0 deletions src/ll/core/tweak/MemoryOperators.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
#define LL_MEMORY_OPERATORS

#include "ll/api/memory/MemoryOperators.h"
6 changes: 4 additions & 2 deletions src/ll/test/Packet_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// #define GENERATE_PACKET
#define GENERATE_PACKET

#ifdef GENERATE_PACKET

Expand Down Expand Up @@ -110,7 +110,7 @@ LL_AUTO_STATIC_HOOK(GeneratePacketHook, HookPriority::Normal, "main", int, int a
return origin(a, c);
}

#endif // GENERATE_PACKET
#else // GENERATE_PACKET

#pragma region PacketInclude

Expand Down Expand Up @@ -517,3 +517,5 @@ PACKET_SIZE_ASSERT(PlayerToggleCrafterSlotRequestPacket, 0x48);
PACKET_SIZE_ASSERT(SetPlayerInventoryOptionsPacket, 0x48);

#pragma endregion

#endif // GENERATE_PACKET
28 changes: 14 additions & 14 deletions src/ll/test/TestCustomDimension.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#include "ll/api/dimension/SimpleCustomDimension.h"
// #include "ll/api/dimension/SimpleCustomDimension.h"

#include "ll/api/event/EventBus.h"
#include "ll/api/event/server/ServerStartedEvent.h"
// #include "ll/api/event/EventBus.h"
// #include "ll/api/event/server/ServerStartedEvent.h"

static bool reg = [] {
using namespace ll::event;
EventBus::getInstance().emplaceListener<ServerStartedEvent>([](ServerStartedEvent&) {
ll::dimension::CustomDimensionManager::getInstance().addDimension<ll::dimension::SimpleCustomDimension>(
"testNewDimension"
);
ll::dimension::CustomDimensionManager::getInstance()
.addDimension<ll::dimension::SimpleCustomDimension>("testNewVoidDimension", 345, GeneratorType::Void);
});
return true;
}();
// static bool reg = [] {
// using namespace ll::event;
// EventBus::getInstance().emplaceListener<ServerStartedEvent>([](ServerStartedEvent&) {
// ll::dimension::CustomDimensionManager::getInstance().addDimension<ll::dimension::SimpleCustomDimension>(
// "testNewDimension"
// );
// ll::dimension::CustomDimensionManager::getInstance()
// .addDimension<ll::dimension::SimpleCustomDimension>("testNewVoidDimension", 345, GeneratorType::Void);
// });
// return true;
// }();
6 changes: 3 additions & 3 deletions src/ll/test/TestNbt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ LL_AUTO_TYPE_INSTANCE_HOOK(NbtTest, HookPriority::Normal, ServerInstance, &Serve
{"double", 0.3},
{"sdouble", 1.0},
} },
{"bytearray", ByteArrayTag{{1, 2, 3, 4, 5, -2, -3, -6}} },
{"bytearray", ByteArrayTag{{1, 2, 3, 4, 5, 62, 63, 66}} },
{"intarray", IntArrayTag{{1, 2, 3, 4, 5, -2, -3, -6}} },
};

Expand All @@ -49,7 +49,7 @@ LL_AUTO_TYPE_INSTANCE_HOOK(NbtTest, HookPriority::Normal, ServerInstance, &Serve
{
anull = null,
byte = 127b,
bytearray = [B;1b, 2b, 3b, 4b, 5b, -2b, -3b, -6b],
bytearray = [B;1b, 2b, 3b, 4b, 5b, 62b, 63b, 66b],
compound = {
sdouble = 1.0 /*d*/,
double = 0.3D,
Expand All @@ -72,7 +72,7 @@ LL_AUTO_TYPE_INSTANCE_HOOK(NbtTest, HookPriority::Normal, ServerInstance, &Serve
compound = {
anull = null,
"byte" = 127b
"bytearray" = [B;1b, 2b, 3b, 4b, 5b, -2b, -3b, -6b], // orld /**/ /* 34t */
"bytearray" = [B;1b, 2b, 3b, 4b, 5b, 62b, 63b, 66b], // orld /**/ /* 34t */
"compound" = {
"sdouble" = 1.0 /*d*/
"double" = 0.3D
Expand Down
2 changes: 1 addition & 1 deletion src/ll/test/customWorldGenerator/MyFlatWorldGenerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "ll/api/utils/RandomUtils.h"

#include "ll/api/memory/Memory.h"
#include "mc/common/wrapper/FeatureRefTraits.h"
#include "mc/world/level/levelgen/feature/gamerefs_feature/FeatureRefTraits.h"
#include "mc/common/wrapper/WeakRef.h"
#include "mc/deps/core/debug/log/ContentLog.h"
#include "mc/deps/core/string/HashedString.h"
Expand Down
2 changes: 1 addition & 1 deletion src/ll/test/customWorldGenerator/TestWorldGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "ll/api/memory/Hook.h"
#include "ll/api/memory/Memory.h"
#include "ll/core/LeviLamina.h"
#include "ll/test/customWorldGenerator/MyFlatWorldGenerator.hpp"
// #include "ll/test/customWorldGenerator/MyFlatWorldGenerator.hpp"
#include "mc/world/level/dimension/OverworldDimension.h"

// LL_AUTO_TYPE_INSTANCE_HOOK(OverworldDimensionCreateGeneratorHook, ll::memory::HookPriority::Normal,
Expand Down
2 changes: 1 addition & 1 deletion src/mc/entity/systems/ServerPlayerMovementComponent.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "mc/_HeaderOutputPredefine.h"
#include "mc/world/actor/movement/MovementPackets.h"
#include "mc/entity/systems/movement/MovementPackets.h"

// auto generated inclusion list
#include "mc/common/wrapper/optional_ref.h"
Expand Down
9 changes: 0 additions & 9 deletions src/mc/network/packet/LegacyTelemetryEventPacket.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,6 @@ class LegacyTelemetryEventPacket : public ::Packet {
int mThresholdDuration_ms;
} RaidUpdate;

struct {
MovementEventType mEventType;
float mObservedScore;
float mAveragePosDelta;
float mTotalPosDelta;
float mMinPosDelta;
float mMaxPosDelta;
} PlayerMovement;

struct {
int mRedstoneLevel;
} TargetBlockHit;
Expand Down
12 changes: 12 additions & 0 deletions src/mc/resources/PackErrorType.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#pragma once

#include "mc/_HeaderOutputPredefine.h"

enum class PackErrorType : int {
None = 0x0,
IncompletePackError = 0x1,
PackParseError = 0x2,
PackLoadError = 0x3,
UIError = 0x4,
PackSettingsError = 0x5,
};
4 changes: 3 additions & 1 deletion src/mc/server/commands/CommandBlockName.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

class CommandBlockName {
public:
uint64 id;
uint64 id{};

CommandBlockName() = default;

public:
// NOLINTBEGIN
Expand Down
3 changes: 3 additions & 0 deletions src/mc/util/molang/MolangScriptArg.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ struct MolangScriptArg {

MCTAPI MolangScriptArg(MolangMemberArray const&);

template <>
MolangScriptArg(bool const& value) : MolangScriptArg(static_cast<int>(value)) {}

public:
// NOLINTBEGIN
// symbol: ??0MolangScriptArg@@QEAA@XZ
Expand Down
2 changes: 0 additions & 2 deletions src/mc/world/item/NetworkItemStackDescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ class NetworkItemStackDescriptor : public ::ItemDescriptorCount {
ItemStackNetIdVariant mNetIdVariant{}; // this+0x20
uint mBlockRuntimeId{}; // this+0x38
std::string mUserDataBuffer{}; // this+0x40
public:
NetworkItemStackDescriptor() = default;

public:
// NOLINTBEGIN
Expand Down
4 changes: 2 additions & 2 deletions src/mc/world/level/biome/source/FixedBiomeSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class FixedBiomeSource : public ::BiomeSource {
// vIndex: 6, symbol: ?getBiome@FixedBiomeSource@@UEBAPEBVBiome@@AEBUGetBiomeOptions@@@Z
virtual class Biome const* getBiome(struct GetBiomeOptions const&) const;

// vIndex: 7, symbol: ?getBiome@FixedBiomeSource@@UEBAPEBVBiome@@HHH@Z
virtual class Biome const* getBiome(int blockX, int, int blockZ) const;
// vIndex: 7, symbol: ?getBiome@FixedBiomeSource@@UEBAPEBVBiome@@AEBVBlockPos@@@Z
virtual class Biome const* getBiome(class BlockPos const& blockPos) const;

// vIndex: 8, symbol: ?has@FixedBiomeSource@@UEBA_N_K@Z
virtual bool has(uint64) const;
Expand Down

0 comments on commit 5176b3b

Please sign in to comment.