Skip to content

Commit

Permalink
Merge pull request #77 from outercloudstudio/main
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederoxDev authored Apr 7, 2024
2 parents 7119838 + 5f2af54 commit 3b9c40d
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
1 change: 1 addition & 0 deletions AmethystAPI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${AmethystFolder}/lib")

# C++ Compile Options
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /await")
set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo" CACHE STRING "Build configurations" FORCE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: RelWithDebInfo" FORCE)

Expand Down
19 changes: 19 additions & 0 deletions AmethystAPI/src/minecraft/src-deps/core/debug/log/ContentLog.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once
#include <cstdint>
#include "amethyst/Memory.hpp"
#include "ContentLogTypes.hpp"

class ContentLog {
public:
uintptr_t** vtable;

// 1.20.72.1 - 48 89 5C 24 ? 48 89 4C 24 ? 57 48 83 EC ? 48 8B F9 48 8D 05 ? ? ? ? 48 89 01 48 89 4C 24 ? 48 83 C1 ? 48 8D 54 24 ? E8 ? ? ? ? 90 48 8D 05 ? ? ? ? 48 89 07 C6 47
ContentLog() {};

template<typename... Strings>
int Log(bool doNotRepeat, LogLevel logLevel, LogArea logArea, Strings... strings) {
using function = decltype(&ContentLog::Log);
auto func = std::bit_cast<function>(SigScan("44 89 4C 24 ? 48 83 EC"));
return (this->*func)(doNotRepeat, logLevel, logArea, strings...);
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#pragma once

enum class LogLevel : unsigned int {
Verbose = 0,
Inform = 1,
Warning = 2,
Error = 3,
_COUNT = 4,
};

// Note the old ones we found from 1.19 are out of date
enum class LogArea : unsigned int {
Actor = 0,
Addon = 1,
AI = 2,
Animation = 3,
AutomatedTests = 4,
BiomeRegistry = 5,
Blocks = 6,
Camera = 7,
Commands = 8,
Components = 9,
Dialogue = 10,
Effects = 11,
Entity = 12,
FeatureRegistry = 13,
Geometry = 14,
Item = 15,
Json = 16,
LevelStorage = 17,
Lightning = 18,
Localization = 19,
Log = 20,
Molang = 21,
Messaging = 22,
Recipes = 23,
Rendering = 24,
RuntimeCamera = 25,
Scripting = 26,
Sound = 27,
Store = 28,
Structure = 29,
Texture = 30,
TexturUI = 31,
Volumes = 32,
LootTable = 33,
Packs = 34,
_COUNT = 35,
};
1 change: 1 addition & 0 deletions AmethystRuntime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set(MOD_TARGET_VERSION_PATCH 7101)


# C++ Build Settings
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /await")
set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo" CACHE STRING "Build configurations" FORCE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo" FORCE)
set(CMAKE_CXX_STANDARD 23)
Expand Down

0 comments on commit 3b9c40d

Please sign in to comment.