mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-04-25 00:17:42 +00:00
Merge remote-tracking branch 'smartcmd/main' into feature/plugin-api
This commit is contained in:
commit
abbe007492
48
.github/workflows/clang-format.yml
vendored
Normal file
48
.github/workflows/clang-format.yml
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
name: Check formatting
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '**'
|
||||
- '!.gitignore'
|
||||
- '!*.md'
|
||||
- '!.github/**'
|
||||
- '.github/workflows/clang-format.yml'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
format-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Fetch base commit
|
||||
run: git fetch origin ${{ github.event.pull_request.base.sha }}
|
||||
|
||||
- name: Install clang-format-20
|
||||
run: |
|
||||
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
|
||||
sudo add-apt-repository -y "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-20 main"
|
||||
sudo apt-get install -y -qq clang-format-20
|
||||
|
||||
- uses: reviewdog/action-setup@v1
|
||||
|
||||
- name: Check formatting on changed lines
|
||||
env:
|
||||
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
git clang-format-20 --binary clang-format-20 \
|
||||
--diff ${{ github.event.pull_request.base.sha }} -- \
|
||||
'*.c' '*.cpp' '*.cc' '*.h' '*.hpp' \
|
||||
| reviewdog \
|
||||
-name="clang-format" \
|
||||
-f=diff \
|
||||
-reporter=github-pr-check \
|
||||
-fail-level=error \
|
||||
-filter-mode=added
|
||||
11
.github/workflows/nightly-server.yml
vendored
11
.github/workflows/nightly-server.yml
vendored
|
|
@ -6,11 +6,12 @@ on:
|
|||
branches:
|
||||
- 'main'
|
||||
- 'feature/plugin-api'
|
||||
paths-ignore:
|
||||
- '.gitignore'
|
||||
- '*.md'
|
||||
- '.github/**'
|
||||
- '!.github/workflows/nightly-server.yml'
|
||||
paths:
|
||||
- '**'
|
||||
- '!.gitignore'
|
||||
- '!*.md'
|
||||
- '!.github/**'
|
||||
- '.github/workflows/nightly-server.yml'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
|
|
|||
11
.github/workflows/nightly.yml
vendored
11
.github/workflows/nightly.yml
vendored
|
|
@ -5,11 +5,12 @@ on:
|
|||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
paths-ignore:
|
||||
- '.gitignore'
|
||||
- '*.md'
|
||||
- '.github/**'
|
||||
- '!.github/workflows/nightly.yml'
|
||||
paths:
|
||||
- '**'
|
||||
- '!.gitignore'
|
||||
- '!*.md'
|
||||
- '!.github/**'
|
||||
- '.github/workflows/nightly.yml'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
|
|
|||
10
.github/workflows/pull-request.yml
vendored
10
.github/workflows/pull-request.yml
vendored
|
|
@ -4,10 +4,12 @@ on:
|
|||
workflow_dispatch:
|
||||
pull_request:
|
||||
types: [opened, reopened, synchronize]
|
||||
paths-ignore:
|
||||
- '.gitignore'
|
||||
- '*.md'
|
||||
- '.github/*.md'
|
||||
paths:
|
||||
- '**'
|
||||
- '!.gitignore'
|
||||
- '!*.md'
|
||||
- '!.github/**'
|
||||
- '.github/workflows/pull-request.yml'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
const WCHAR *DLCManager::wchTypeNamesA[]=
|
||||
{
|
||||
L"XMLVERSION",
|
||||
L"DISPLAYNAME",
|
||||
L"THEMENAME",
|
||||
L"FREE",
|
||||
|
|
@ -387,41 +388,65 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
|
|||
// // unsigned long, p = number of parameters
|
||||
// // p * DLC_FILE_PARAM describing each parameter for this file
|
||||
// // ulFileSize bytes of data blob of the file added
|
||||
unsigned int uiVersion=*(unsigned int *)pbData;
|
||||
unsigned int uiVersion=readUInt32(pbData, false);
|
||||
uiCurrentByte+=sizeof(int);
|
||||
|
||||
if(uiVersion < CURRENT_DLC_VERSION_NUM)
|
||||
{
|
||||
if(pbData!=nullptr) delete [] pbData;
|
||||
app.DebugPrintf("DLC version of %d is too old to be read\n", uiVersion);
|
||||
bool bSwapEndian = false;
|
||||
unsigned int uiVersionSwapped = SwapInt32(uiVersion);
|
||||
if (uiVersion >= 0 && uiVersion <= CURRENT_DLC_VERSION_NUM) {
|
||||
bSwapEndian = false;
|
||||
} else if (uiVersionSwapped >= 0 && uiVersionSwapped <= CURRENT_DLC_VERSION_NUM) {
|
||||
bSwapEndian = true;
|
||||
} else {
|
||||
if(pbData!=nullptr) delete [] pbData;
|
||||
app.DebugPrintf("Unknown DLC version of %d\n", uiVersion);
|
||||
return false;
|
||||
}
|
||||
pack->SetDataPointer(pbData);
|
||||
unsigned int uiParameterCount=*(unsigned int *)&pbData[uiCurrentByte];
|
||||
unsigned int uiParameterCount=readUInt32(&pbData[uiCurrentByte], bSwapEndian);
|
||||
uiCurrentByte+=sizeof(int);
|
||||
C4JStorage::DLC_FILE_PARAM *pParams = (C4JStorage::DLC_FILE_PARAM *)&pbData[uiCurrentByte];
|
||||
bool bXMLVersion = false;
|
||||
//DWORD dwwchCount=0;
|
||||
for(unsigned int i=0;i<uiParameterCount;i++)
|
||||
{
|
||||
pParams->dwType = bSwapEndian ? SwapInt32(pParams->dwType) : pParams->dwType;
|
||||
pParams->dwWchCount = bSwapEndian ? SwapInt32(pParams->dwWchCount) : pParams->dwWchCount;
|
||||
char16_t* wchData = reinterpret_cast<char16_t*>(pParams->wchData);
|
||||
if (bSwapEndian) {
|
||||
SwapUTF16Bytes(wchData, pParams->dwWchCount);
|
||||
}
|
||||
|
||||
// Map DLC strings to application strings, then store the DLC index mapping to application index
|
||||
wstring parameterName(static_cast<WCHAR *>(pParams->wchData));
|
||||
EDLCParameterType type = getParameterType(parameterName);
|
||||
if( type != e_DLCParamType_Invalid )
|
||||
{
|
||||
parameterMapping[pParams->dwType] = type;
|
||||
|
||||
if (type == e_DLCParamType_XMLVersion)
|
||||
{
|
||||
bXMLVersion = true;
|
||||
}
|
||||
}
|
||||
uiCurrentByte+= sizeof(C4JStorage::DLC_FILE_PARAM)+(pParams->dwWchCount*sizeof(WCHAR));
|
||||
pParams = (C4JStorage::DLC_FILE_PARAM *)&pbData[uiCurrentByte];
|
||||
}
|
||||
//ulCurrentByte+=ulParameterCount * sizeof(C4JStorage::DLC_FILE_PARAM);
|
||||
|
||||
unsigned int uiFileCount=*(unsigned int *)&pbData[uiCurrentByte];
|
||||
if (bXMLVersion)
|
||||
{
|
||||
uiCurrentByte += sizeof(int);
|
||||
}
|
||||
|
||||
unsigned int uiFileCount=readUInt32(&pbData[uiCurrentByte], bSwapEndian);
|
||||
uiCurrentByte+=sizeof(int);
|
||||
C4JStorage::DLC_FILE_DETAILS *pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
|
||||
|
||||
DWORD dwTemp=uiCurrentByte;
|
||||
for(unsigned int i=0;i<uiFileCount;i++)
|
||||
{
|
||||
pFile->dwWchCount = bSwapEndian ? SwapInt32(pFile->dwWchCount) : pFile->dwWchCount;
|
||||
dwTemp+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(WCHAR);
|
||||
pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp];
|
||||
}
|
||||
|
|
@ -430,6 +455,13 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
|
|||
|
||||
for(unsigned int i=0;i<uiFileCount;i++)
|
||||
{
|
||||
pFile->dwType = bSwapEndian ? SwapInt32(pFile->dwType) : pFile->dwType;
|
||||
pFile->uiFileSize = bSwapEndian ? SwapInt32(pFile->uiFileSize) : pFile->uiFileSize;
|
||||
char16_t* wchFile = reinterpret_cast<char16_t*>(pFile->wchFile);
|
||||
if (bSwapEndian) {
|
||||
SwapUTF16Bytes(wchFile, pFile->dwWchCount);
|
||||
}
|
||||
|
||||
EDLCType type = static_cast<EDLCType>(pFile->dwType);
|
||||
|
||||
DLCFile *dlcFile = nullptr;
|
||||
|
|
@ -445,12 +477,18 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
|
|||
}
|
||||
|
||||
// Params
|
||||
uiParameterCount=*(unsigned int *)pbTemp;
|
||||
uiParameterCount=readUInt32(pbTemp, bSwapEndian);
|
||||
pbTemp+=sizeof(int);
|
||||
pParams = (C4JStorage::DLC_FILE_PARAM *)pbTemp;
|
||||
for(unsigned int j=0;j<uiParameterCount;j++)
|
||||
{
|
||||
//DLCManager::EDLCParameterType paramType = DLCManager::e_DLCParamType_Invalid;
|
||||
pParams->dwType = bSwapEndian ? SwapInt32(pParams->dwType) : pParams->dwType;
|
||||
pParams->dwWchCount = bSwapEndian ? SwapInt32(pParams->dwWchCount) : pParams->dwWchCount;
|
||||
char16_t* wchData = reinterpret_cast<char16_t*>(pParams->wchData);
|
||||
if (bSwapEndian) {
|
||||
SwapUTF16Bytes(wchData, pParams->dwWchCount);
|
||||
}
|
||||
|
||||
auto it = parameterMapping.find(pParams->dwType);
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,8 @@ public:
|
|||
{
|
||||
e_DLCParamType_Invalid = -1,
|
||||
|
||||
e_DLCParamType_DisplayName = 0,
|
||||
e_DLCParamType_XMLVersion = 0,
|
||||
e_DLCParamType_DisplayName,
|
||||
e_DLCParamType_ThemeName,
|
||||
e_DLCParamType_Free, // identify free skins
|
||||
e_DLCParamType_Credit, // legal credits for DLC
|
||||
|
|
@ -94,6 +95,30 @@ public:
|
|||
bool readDLCDataFile(DWORD &dwFilesProcessed, const string &path, DLCPack *pack, bool fromArchive = false);
|
||||
DWORD retrievePackIDFromDLCDataFile(const string &path, DLCPack *pack);
|
||||
|
||||
static unsigned short SwapInt16(unsigned short value) {
|
||||
return (value >> 8) | (value << 8);
|
||||
}
|
||||
|
||||
static unsigned int SwapInt32(unsigned int value) {
|
||||
return ((value & 0xFF) << 24) |
|
||||
((value & 0xFF00) << 8) |
|
||||
((value & 0xFF0000) >> 8) |
|
||||
((value & 0xFF000000) >> 24);
|
||||
}
|
||||
|
||||
static void SwapUTF16Bytes(char16_t* buffer, size_t count) {
|
||||
for (size_t i = 0; i < count; ++i) {
|
||||
char16_t& c = buffer[i];
|
||||
c = (c >> 8) | (c << 8);
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned int readUInt32(unsigned char* ptr, bool endian) {
|
||||
unsigned int val = *(unsigned int*)ptr;
|
||||
if (endian) val = SwapInt32(val);
|
||||
return val;
|
||||
}
|
||||
|
||||
private:
|
||||
bool processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD dwLength, DLCPack *pack);
|
||||
|
||||
|
|
|
|||
|
|
@ -519,6 +519,29 @@ void PlayerRenderer::renderHand()
|
|||
{
|
||||
humanoidModel->arm0->render(1 / 16.0f,true);
|
||||
}
|
||||
|
||||
|
||||
//Render custom skin boxes on viewmodel - Botch
|
||||
vector<ModelPart*>* additionalModelParts = Minecraft::GetInstance()->player->GetAdditionalModelParts();
|
||||
if (!additionalModelParts) return; //If there are no custom boxes, return. This fixes bug where the game will crash if you select a skin with no additional boxes.
|
||||
vector<ModelPart*> armchildren = humanoidModel->arm0->children;
|
||||
std::unordered_set<ModelPart*> additionalModelPartSet(additionalModelParts->begin(), additionalModelParts->end());
|
||||
for (const auto& x : armchildren) {
|
||||
if (x) {
|
||||
if (additionalModelPartSet.find(x) != additionalModelPartSet.end()) { //This is to verify box is still actually on current skin - Botch
|
||||
glPushMatrix();
|
||||
//We need to transform to match offset of arm - Botch
|
||||
glTranslatef(-5 * 0.0625f, 2 * 0.0625f, 0);
|
||||
glRotatef(0.1 * (180.0f / PI), 0, 0, 1);
|
||||
x->visible = true;
|
||||
x->render(1.0f / 16.0f, true);
|
||||
x->visible = false;
|
||||
glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void PlayerRenderer::setupPosition(shared_ptr<LivingEntity> _mob, double x, double y, double z)
|
||||
|
|
@ -580,4 +603,4 @@ ResourceLocation *PlayerRenderer::getTextureLocation(shared_ptr<Entity> entity)
|
|||
{
|
||||
shared_ptr<Player> player = dynamic_pointer_cast<Player>(entity);
|
||||
return new ResourceLocation(static_cast<_TEXTURE_NAME>(player->getTexture()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ This page covers every event that FourKit provides, with descriptions of what th
|
|||
|
||||
Events that implement \ref Minecraft.Server.FourKit.Event.Cancellable "Cancellable" can be cancelled by calling `setCancelled(true)`. A cancelled event will not execute its default server action (such as preventing chatting), but will still be passed to other plugins (unless IgnoreCancelled is set to true for a certain event handler)
|
||||
|
||||
> **Theres no guarantee this will be fully up to date as new events get added. Be sure to check the actual API documentation. Also some of these functions may not work as intended, as we are still in the process of rewriting everything. If something doesnt work, let us know on the discord.**
|
||||
> **Theres no guarantee this will be fully up to date as new events get added. Be sure to check the actual API documentation. Also some of these functions may not work as intended, as we are still in the process of rewriting everything. If something doesnt work, let us know on github.**
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ If you're looking for Dedicated Server software, download its [Nightly Build her
|
|||
|
||||
- **Windows**: Supported for building and running the project
|
||||
- **macOS / Linux**: The Windows nightly build will run through Wine or CrossOver based on community reports, but this is unofficial and not currently tested by the maintainers when pushing updates
|
||||
- **Android**: The Windows nightly build does run but has stability / frametime pacing issues frequently reported
|
||||
- **Android**: VIA x86 EMULATORS (like GameNative) ONLY! The Windows nightly build does run but has stability / frametime pacing issues frequently reported
|
||||
- **iOS**: No current support
|
||||
- **All Consoles**: Console support remains in the code, but maintainers are not currently verifying console functionality / porting UI Changes to the console builds at this time.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue