Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
Release 2.12.3 (LiteLDev#1173)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrBox authored Mar 29, 2023
2 parents 4a1561f + 4235159 commit 6dd902b
Show file tree
Hide file tree
Showing 20 changed files with 683 additions and 592 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ jobs:
shell: cmd

- name: Build SymDBHelper
run: cmake --build ${{github.workspace}}/build_clang --config ${{env.BUILD_TYPE}} --target SymDBHelper
run: |
cmake --build ${{github.workspace}}/build_clang --config ${{env.BUILD_TYPE}} --target SymDBHelper
cp .\build_clang\sdk\lib\SymDBHelper.lib .\build\sdk\lib\SymDBHelper.lib
- name: Compress resource packs for LiteLoaderBDS CUI on push event
if: github.event_name == 'push'
Expand Down
4 changes: 2 additions & 2 deletions LiteLoader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ target_include_directories(

add_custom_command(
TARGET LiteLoader PRE_BUILD
COMMAND ${CMAKE_SOURCE_DIR}/scripts/PrepareLibraries.cmd ${CMAKE_SOURCE_DIR}
COMMAND ${CMAKE_SOURCE_DIR}/scripts/PrepareLibraries.bat ${CMAKE_SOURCE_DIR}
)

# Copy the built DLL and PDB to the output directory
Expand Down Expand Up @@ -102,4 +102,4 @@ if(NOT "${BDS_LOCAL_DEV_ENVIRONMENT_DIR}" STREQUAL "")
COMMENT "Copying ${PROJECT_NAME} DLL and PDB to local bds dev directory"
VERBATIM
)
endif()
endif()
2 changes: 1 addition & 1 deletion LiteLoader/include/liteloader/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#define LITELOADER_VERSION_MAJOR 2
#define LITELOADER_VERSION_MINOR 12
#define LITELOADER_VERSION_REVISION 2
#define LITELOADER_VERSION_REVISION 3
#define LITELOADER_VERSION_COMMIT_SHA UNKNOWN
#define LITELOADER_VERSION_STATUS LITELOADER_VERSION_DEV
#define LITELOADER_VERSION_STATUS_VERSION 0
Expand Down
3 changes: 2 additions & 1 deletion LiteLoader/include/llapi/mc/BaseCircuitComponent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// Include Headers or Declare Types Here
#include "BlockPos.hpp"
// clang-format off
enum class CircuitComponentType {
enum class CircuitComponentType : int64_t {
Unknown = 0x0,
Undefined = 0x1,
Mask = 0xFFFF0000,
Expand Down Expand Up @@ -56,6 +56,7 @@ class BaseCircuitComponent {
bool mRemoved;
bool mConsumePowerAnyDirection;
CircuitComponentType mCircuitComponentType;
#define ENABLE_VIRTUAL_FAKESYMBOL_BASECIRCUITCOMPONENT
#undef AFTER_EXTRA
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_BASECIRCUITCOMPONENT
public:
Expand Down
2 changes: 1 addition & 1 deletion LiteLoader/include/llapi/mc/Block.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Block {
}

inline class BlockLegacy const* getLegacyBlockPtr() const {
return &dAccess<BlockLegacy, 16>(this);
return dAccess<BlockLegacy*, 16>(this);
}

inline bool operator==(class Block const& block) const {
Expand Down
37 changes: 6 additions & 31 deletions LiteLoader/include/llapi/mc/BlockPos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class Vec3;

class BlockPos {
class BlockPos : public VectorBase<BlockPos, int, int, int> {
public:
int x, y, z;
inline BlockPos() : BlockPos(0, 0, 0){};
Expand Down Expand Up @@ -33,7 +33,8 @@ class BlockPos {

MCAPI static void bindType();

[[nodiscard]] constexpr int& operator[](size_t index) {
template <typename T>
[[nodiscard]] constexpr T& get(size_t index) {
switch (index) {
case 1:
return y;
Expand All @@ -44,7 +45,8 @@ class BlockPos {
}
}

[[nodiscard]] constexpr int operator[](size_t index) const {
template <typename T>
[[nodiscard]] constexpr T get(size_t index) const {
switch (index) {
case 1:
return y;
Expand All @@ -65,41 +67,14 @@ class BlockPos {
[[nodiscard]] LIAPI Vec3 bottomCenter() const;
[[nodiscard]] LIAPI Vec3 center() const;
[[nodiscard]] LIAPI bool containedWithin(class BoundingBox const&) const;

FAKE_CRTP(BlockPos, int, 3);
};

namespace std {

template <>
struct hash<BlockPos> {
std::size_t operator()(BlockPos const& pos) const noexcept {
//??$hash3@HHH@Math@mce@@SA_KAEBH00@Z
unsigned __int64 t1; // r8
unsigned __int64 t2; // r8

t1 = *((unsigned __int8*)&pos.x + 3) ^
(0x100000001B3i64 *
(*((unsigned __int8*)&pos.x + 2) ^
(0x100000001B3i64 * (*((unsigned __int8*)&pos.x + 1) ^
(0x100000001B3i64 * (*(unsigned __int8*)&pos.x ^ 0xCBF29CE484222325ui64))))));
t2 =
(((0x100000001B3i64 * t1 + 2654435769u) >> 2) + 2654435769u + ((0x100000001B3i64 * t1 + 2654435769u) << 6) +
0x100000001B3i64 * (*((unsigned __int8*)&pos.y + 3) ^
(0x100000001B3i64 *
(*((unsigned __int8*)&pos.y + 2) ^
(0x100000001B3i64 *
(*((unsigned __int8*)&pos.y + 1) ^
(0x100000001B3i64 * (*(unsigned __int8*)&pos.y ^ 0xCBF29CE484222325ui64)))))))) ^
(0x100000001B3i64 * t1 + 2654435769u);
return t2 ^ ((t2 << 6) +
0x100000001B3i64 *
(*((unsigned __int8*)&pos.z + 3) ^
(0x100000001B3i64 * (*((unsigned __int8*)&pos.z + 2) ^
(0x100000001B3i64 * (*((unsigned __int8*)&pos.z + 1) ^
(0x100000001B3i64 * (*(unsigned __int8*)&pos.z ^
0xCBF29CE484222325ui64))))))) +
(t2 >> 2) + 2654435769u);
return pos.hash();
}
};

Expand Down
49 changes: 37 additions & 12 deletions LiteLoader/include/llapi/mc/ChunkBlockPos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
*/
#pragma once
#define AUTO_GENERATED

#include "llapi/Global.h"

#define BEFORE_EXTRA
Expand All @@ -23,8 +23,7 @@ class ChunkLocalHeight {
* @brief MC class ChunkBlockPos.
*
*/
class ChunkBlockPos {

class ChunkBlockPos : public VectorBase<ChunkBlockPos, char, short, char> {
#define AFTER_EXTRA
// Add Member There
#define DISABLE_CONSTRUCTOR_PREVENTION_CHUNKBLOCKPOS
Expand All @@ -40,13 +39,29 @@ class ChunkBlockPos {
return (y.mVal & 0xF) + 16 * (z + 16 * x);
}

#undef AFTER_EXTRA
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_CHUNKBLOCKPOS
public:
class ChunkBlockPos& operator=(class ChunkBlockPos const &) = delete;
ChunkBlockPos(class ChunkBlockPos const &) = delete;
ChunkBlockPos() = delete;
#endif
template <typename T>
[[nodiscard]] constexpr T& get(size_t index) {
switch (index) {
case 1:
return (T&)y.mVal;
case 2:
return (T&)z;
default:
return (T&)x;
}
}

template <typename T>
[[nodiscard]] constexpr T get(size_t index) const {
switch (index) {
case 1:
return (T)y.mVal;
case 2:
return (T)z;
default:
return (T)x;
}
}

public:
/**
Expand All @@ -56,11 +71,11 @@ class ChunkBlockPos {
/**
* @symbol ??0ChunkBlockPos\@\@QEAA\@AEBVBlockPos\@\@F\@Z
*/
MCAPI ChunkBlockPos(class BlockPos const &, short);
MCAPI ChunkBlockPos(class BlockPos const&, short);
/**
* @symbol ?toPos\@ChunkBlockPos\@\@QEBA?AVPos\@\@XZ
*/
MCAPI class Pos toPos() const;
// MCAPI class Pos toPos() const;
/**
* @symbol ?from2D\@ChunkBlockPos\@\@SA?AV1\@EE\@Z
*/
Expand All @@ -69,5 +84,15 @@ class ChunkBlockPos {
* @symbol ?fromLegacyIndex\@ChunkBlockPos\@\@SA?AV1\@G\@Z
*/
MCAPI static class ChunkBlockPos fromLegacyIndex(unsigned short);
};

namespace std {

template <>
struct hash<ChunkBlockPos> {
std::size_t operator()(ChunkBlockPos const& pos) const noexcept {
return pos.hash();
}
};

} // namespace std
38 changes: 19 additions & 19 deletions LiteLoader/include/llapi/mc/ChunkPos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
*/
#pragma once
#define AUTO_GENERATED

#include "llapi/Global.h"

#define BEFORE_EXTRA
Expand All @@ -16,16 +16,16 @@
* @brief MC class ChunkPos.
*
*/
class ChunkPos {

class ChunkPos : public VectorBase<ChunkPos, int, int> {
#define AFTER_EXTRA
// Add Member There
public:
int x, z;
ChunkPos() = default;
ChunkPos(int ix, int iz) : x(ix), z(iz){};

[[nodiscard]] constexpr int& operator[](size_t index) {
template <typename T>
[[nodiscard]] constexpr T& get(size_t index) {
switch (index) {
case 1:
return z;
Expand All @@ -34,7 +34,8 @@ class ChunkPos {
}
}

[[nodiscard]] constexpr int operator[](size_t index) const {
template <typename T>
[[nodiscard]] constexpr T get(size_t index) const {
switch (index) {
case 1:
return z;
Expand All @@ -43,30 +44,19 @@ class ChunkPos {
}
}

#define DISABLE_CONSTRUCTOR_PREVENTION_CHUNKPOS

FAKE_CRTP(ChunkPos, int, 2);
#undef AFTER_EXTRA
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_CHUNKPOS
public:
class ChunkPos& operator=(class ChunkPos const &) = delete;
ChunkPos(class ChunkPos const &) = delete;
ChunkPos() = delete;
#endif

public:
/**
* @symbol ??0ChunkPos\@\@QEAA\@AEBVVec3\@\@\@Z
*/
MCAPI ChunkPos(class Vec3 const &);
MCAPI ChunkPos(class Vec3 const&);
/**
* @symbol ??0ChunkPos\@\@QEAA\@AEBVBlockPos\@\@\@Z
*/
MCAPI ChunkPos(class BlockPos const &);
MCAPI ChunkPos(class BlockPos const&);
/**
* @symbol ?isWithinBounds\@ChunkPos\@\@QEBA_NAEBV1\@0\@Z
*/
MCAPI bool isWithinBounds(class ChunkPos const &, class ChunkPos const &) const;
MCAPI bool isWithinBounds(class ChunkPos const&, class ChunkPos const&) const;
/**
* @symbol ?toBlockSpaceVec3\@ChunkPos\@\@QEBA?AVVec3\@\@M\@Z
*/
Expand All @@ -87,5 +77,15 @@ class ChunkPos {
* @symbol ?ONE\@ChunkPos\@\@2V1\@B
*/
MCAPI static class ChunkPos const ONE;
};

namespace std {

template <>
struct hash<ChunkPos> {
std::size_t operator()(ChunkPos const& pos) const noexcept {
return pos.hash();
}
};

} // namespace std
11 changes: 4 additions & 7 deletions LiteLoader/include/llapi/mc/CircuitTrackingInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ class CircuitTrackingInfo {

inline Entry(class BaseCircuitComponent* component, const BlockPos& pos) {
mComponent = component;
mDirection = component->getDirection();
mDirection = (FaceID)component->getDirection();
mPos = pos;
mTypeID = component->getBaseType();
mTypeID = component->getCircuitComponentGroupType();
}
};

Expand All @@ -29,11 +29,8 @@ class CircuitTrackingInfo {
bool mDirectlyPowered;
int mData;

inline CircuitTrackingInfo(class BaseCircuitComponent* component, const BlockPos& pos, int dampening) {
mCurrent = std::move(Entry(component, pos));
mPower = std::move(Entry(component, pos));
mNearest = std::move(Entry(component, pos));
m2ndNearest = std::move(Entry(component, pos));
CircuitTrackingInfo(class BaseCircuitComponent* component, const BlockPos& pos, int dampening)
: mCurrent{component, pos}, mPower{component, pos}, mNearest{component, pos}, m2ndNearest{component, pos} {
this->mDampening = dampening;
this->mDirectlyPowered = true;
this->mData = 0;
Expand Down
Loading

0 comments on commit 6dd902b

Please sign in to comment.