Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/LiteLDev/LiteLoaderBDS i…
Browse files Browse the repository at this point in the history
…nto develop
  • Loading branch information
OEOTYAN committed Mar 27, 2023
2 parents d58086c + 68d14e9 commit 6821071
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 112 deletions.
52 changes: 2 additions & 50 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,9 @@ jobs:
if: steps.cache-bds-lib.outputs.cache-hit != 'true'
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: |
mkdir LiteLoader\lib
cd Tools
LibraryBuilder.exe Server
mkdir ..\LiteLoader\lib
move bedrock_server_api.lib ..\LiteLoader\lib
move bedrock_server_var.lib ..\LiteLoader\lib
LLPeEditor.exe -l --pdb Server/bedrock_server.pdb -o ../LiteLoader/lib
shell: cmd

- name: Set LITELOADER_VERSION_COMMIT_SHA
Expand Down Expand Up @@ -133,52 +131,6 @@ jobs:
${{ github.workspace }}\build\output\plugins\LiteLoader\ResourcePacks\LiteLoaderBDS-CUI.tar
${{ github.workspace }}\build\output\plugins\LiteLoader\PermissionAPI.dll
- name: Upload PeEditor
uses: actions/[email protected]
with:
name: PeEditor
path: ${{ github.workspace }}\build\output\LLPeEditor.exe

- name: Upload PreLoader
uses: actions/[email protected]
with:
name: PreLoader
path: ${{ github.workspace }}\build\output\LLPreLoader.dll

- name: Upload LiteLoader
uses: actions/[email protected]
with:
name: LiteLoader
path: |
${{ github.workspace }}\build\output\LiteLoader.dll
${{ github.workspace }}\build\output\plugins\lib\*.dll
${{ github.workspace }}\build\output\plugins\LiteLoader\LangPack\
${{ github.workspace }}\build\output\plugins\LiteLoader\7z\
${{ github.workspace }}\build\output\plugins\LiteLoader\CrashLogger_Daemon.exe
- name: Upload ScriptEngine
uses: actions/[email protected]
with:
name: ScriptEngine
path: |
${{ github.workspace }}\build\output\plugins\LiteLoader\LiteLoader.*.dll
${{ github.workspace }}\build\output\plugins\lib\*.zip
${{ github.workspace }}\build\output\plugins\lib\package.json
- name: Upload LLParticle
uses: actions/[email protected]
with:
name: LLParticle
path: |
${{ github.workspace }}\build\output\plugins\LiteLoader\ParticleAPI.dll
${{ github.workspace }}\build\output\plugins\LiteLoader\ResourcePacks\LiteLoaderBDS-CUI.tar
- name: Upload LLPermission
uses: actions/[email protected]
with:
name: LLPermission
path: ${{ github.workspace }}\build\output\plugins\LiteLoader\PermissionAPI.dll

- name: Upload PDB files
uses: actions/[email protected]
with:
Expand Down
54 changes: 3 additions & 51 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@ jobs:
if: steps.cache-bds-lib.outputs.cache-hit != 'true'
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: |
mkdir LiteLoader\lib
cd Tools
LibraryBuilder.exe Server
mkdir ..\LiteLoader\lib
move bedrock_server_api.lib ..\LiteLoader\lib
move bedrock_server_var.lib ..\LiteLoader\lib
LLPeEditor.exe -l --pdb Server/bedrock_server.pdb -o ../LiteLoader/lib
shell: cmd

- name: Set LITELOADER_VERSION_COMMIT_SHA
Expand Down Expand Up @@ -159,52 +157,6 @@ jobs:
${{ github.workspace }}\build\output\plugins\LiteLoader\ResourcePacks\LiteLoaderBDS-CUI.tar
${{ github.workspace }}\build\output\plugins\LiteLoader\PermissionAPI.dll
- name: Upload PeEditor
uses: actions/[email protected]
with:
name: PeEditor
path: ${{ github.workspace }}\build\output\LLPeEditor.exe

- name: Upload PreLoader
uses: actions/[email protected]
with:
name: PreLoader
path: ${{ github.workspace }}\build\output\LLPreLoader.dll

- name: Upload LiteLoader
uses: actions/[email protected]
with:
name: LiteLoader
path: |
${{ github.workspace }}\build\output\LiteLoader.dll
${{ github.workspace }}\build\output\plugins\lib\*.dll
${{ github.workspace }}\build\output\plugins\LiteLoader\LangPack\
${{ github.workspace }}\build\output\plugins\LiteLoader\7z\
${{ github.workspace }}\build\output\plugins\LiteLoader\CrashLogger_Daemon.exe
- name: Upload ScriptEngine
uses: actions/[email protected]
with:
name: ScriptEngine
path: |
${{ github.workspace }}\build\output\plugins\LiteLoader\LiteLoader.*.dll
${{ github.workspace }}\build\output\plugins\lib\*.zip
${{ github.workspace }}\build\output\plugins\lib\package.json
- name: Upload LLParticle
uses: actions/[email protected]
with:
name: LLParticle
path: |
${{ github.workspace }}\build\output\plugins\LiteLoader\ParticleAPI.dll
${{ github.workspace }}\build\output\plugins\LiteLoader\ResourcePacks\LiteLoaderBDS-CUI.tar
- name: Upload LLPermission
uses: actions/[email protected]
with:
name: LLPermission
path: ${{ github.workspace }}\build\output\plugins\LiteLoader\PermissionAPI.dll

- name: Upload PDB files
uses: actions/[email protected]
with:
Expand All @@ -229,7 +181,7 @@ jobs:
cd build/
zip -9r LiteLoaderBDS.zip LiteLoaderBDS/*
zip -9r PDB.zip PDB/*
zip -9r Modules.zip PeEditor PreLoader LiteLoader ScriptEngine LLParticle LLPermission
zip -9r Modules.zip PreLoader LiteLoader ScriptEngine LLParticle LLPermission
shell: bash

- name: Create release
Expand Down
1 change: 0 additions & 1 deletion CMake/PackSDK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ add_custom_command(
TARGET PackSDK POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LiteLoader_SOURCE_DIR}/include/llapi ${CMAKE_BINARY_DIR}/sdk/include/llapi
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LiteLoader_SOURCE_DIR}/third-party/include ${CMAKE_BINARY_DIR}/sdk/include
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Tools/LibraryBuilder.exe ${CMAKE_BINARY_DIR}/sdk/tools/
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Tools/LLPeEditor.exe ${CMAKE_BINARY_DIR}/sdk/tools/
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Tools/SDK-submodule-add.cmd ${CMAKE_BINARY_DIR}/sdk/tools/
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Tools/SDK-submodule-update.cmd ${CMAKE_BINARY_DIR}/sdk/tools/
Expand Down
18 changes: 13 additions & 5 deletions LiteLoader/include/llapi/mc/RecipeUnlockingRequirement.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,27 @@
#pragma once
#define AUTO_GENERATED
#include "llapi/Global.h"

#include "RecipeIngredient.hpp"
#define BEFORE_EXTRA

#undef BEFORE_EXTRA


class RecipeUnlockingRequirement {

#define AFTER_EXTRA
char filler[32];
public:
enum class UnlockingContext : int {
None = 0x0,
AlwaysUnlocked = 0x1,
PlayerInWater = 0x2,
PlayerHasManyItems = 0x3,
};

int unk0;
UnlockingContext mContext;
std::vector<RecipeIngredient> mValid;

public:
enum class UnlockingContext;
#undef AFTER_EXTRA
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_RECIPEUNLOCKINGREQUIREMENT
public:
Expand Down Expand Up @@ -51,4 +59,4 @@ class RecipeUnlockingRequirement {
*/
MCAPI static enum class RecipeUnlockingRequirement::UnlockingContext unlockingContextFromString(std::string const &);

};
};
Binary file modified Tools/LLPeEditor.exe
Binary file not shown.
Binary file removed Tools/LibraryBuilder.exe
Binary file not shown.
15 changes: 14 additions & 1 deletion Tools/ScriptX/backend/QuickJs/QjsEngine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ QjsEngine::QjsEngine(std::shared_ptr<utils::MessageQueue> queue, const QjsFactor
}

initEngineResource();

/* set default loader for ES6 modules */
JS_SetModuleLoaderFunc(runtime_, NULL, js_module_loader, NULL);
}

void QjsEngine::initEngineResource() {
Expand Down Expand Up @@ -270,6 +273,7 @@ Local<Value> QjsEngine::eval(const Local<String>& script, const Local<Value>& so
}

Local<Value> QjsEngine::loadFile(const Local<String>& scriptFile) {
Tracer trace(this, "QjsEngine::loadFile");
if(scriptFile.toString().empty())
throw Exception("script file no found");
Local<Value> content = internal::readAllFileContent(scriptFile);
Expand All @@ -287,7 +291,16 @@ Local<Value> QjsEngine::loadFile(const Local<String>& scriptFile) {
sourceFilePath = sourceFilePath.substr(pathSymbol + 1);
}
Local<String> sourceFileName = String::newString(sourceFilePath);
return eval(content.asString(), sourceFileName);

StringHolder contentStr(content.asString());
StringHolder fileNameStr(sourceFileName);
JSValue ret = JS_Eval(context_, contentStr.c_str(), contentStr.length(), fileNameStr.c_str(),
JS_EVAL_TYPE_MODULE);

qjs_backend::checkException(ret);
scheduleTick();

return Local<Value>(ret);
}

std::shared_ptr<utils::MessageQueue> QjsEngine::messageQueue() { return queue_; }
Expand Down
1 change: 1 addition & 0 deletions Tools/ScriptX/backend/QuickJs/QjsHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

SCRIPTX_BEGIN_INCLUDE_LIBRARY
#include <quickjs.h>
#include <quickjs-libc.h>
SCRIPTX_END_INCLUDE_LIBRARY

namespace script::qjs_backend {
Expand Down
6 changes: 2 additions & 4 deletions scripts/PrepareLibraries.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ if not exist %1\LiteLoader\lib\bedrock_server_var.lib goto process
goto end

:process
cd /d %1\Tools
LibraryBuilder.exe
if not exist %1\LiteLoader\lib\ mkdir %1\LiteLoader\lib
move %1\Tools\bedrock_server_api.lib %1\LiteLoader\lib\
move %1\Tools\bedrock_server_var.lib %1\LiteLoader\lib\
cd /d %1\Tools
LLPeEditor.exe -c -l -o ../LiteLoader/lib

:end

0 comments on commit 6821071

Please sign in to comment.