Merge branch 'smartcmd:main' into main

This commit is contained in:
Matthew Toro 2026-04-02 23:01:38 -04:00 committed by GitHub
commit 79ecd186c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 75 additions and 18 deletions

View file

@ -557,8 +557,8 @@ int UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback(LPVOID lpParam,b
uint16_t pchText[128];
ZeroMemory(pchText, 128 * sizeof(uint16_t));
Win64_GetKeyboardText(pchText, 128);
pClass->m_editSeed.setLabel((wchar_t *)pchText);
pClass->m_params->seed = (wchar_t *)pchText;
pClass->m_editSeed.setLabel(reinterpret_cast<wchar_t*>(pchText));
pClass->m_params->seed = static_cast<wstring>(reinterpret_cast<wchar_t*>(pchText));
#else
#ifdef __PSVITA__
uint16_t pchText[2048];
@ -584,7 +584,7 @@ void UIScene_LaunchMoreOptionsMenu::getDirectEditInputs(vector<UIControl_TextInp
void UIScene_LaunchMoreOptionsMenu::onDirectEditFinished(UIControl_TextInput *input, UIControl_TextInput::EDirectEditResult result)
{
if (result == UIControl_TextInput::eDirectEdit_Confirmed)
m_params->seed = input->getEditBuffer();
m_params->seed = static_cast<wstring>(input->getEditBuffer());
}
#endif

View file

@ -241,7 +241,7 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
if (riding)
{
if(uiBitmaskOverrideAnim&(1<<eAnim_SmallModel) == 0)
if ((uiBitmaskOverrideAnim&(1<<eAnim_SmallModel)) == 0)
{
arm0->xRot += -HALF_PI * 0.4f;
arm1->xRot += -HALF_PI * 0.4f;

View file

@ -286,6 +286,20 @@ void ItemInHandRenderer::renderItem(shared_ptr<LivingEntity> mob, shared_ptr<Ite
float xo = 0.0f;
float yo = 0.3f;
// Re position height of held item if skin is small
if (mob->getAnimOverrideBitmask() & (1 << HumanoidModel::eAnim_SmallModel))
{
if (mob->isRiding())
{
std::shared_ptr<Entity> ridingEntity = mob->riding;
if (ridingEntity != nullptr) // Safety check;
{
yo += 0.3f; // reverts the change in Boat.cpp for smaller models.
}
}
}
glEnable(GL_RESCALE_NORMAL);
glTranslatef(-xo, -yo, 0);

View file

@ -199,11 +199,26 @@ void PlayerRenderer::render(shared_ptr<Entity> _mob, double x, double y, double
armorParts1->sneaking = armorParts2->sneaking = humanoidModel->sneaking = mob->isSneaking();
double yp = y - mob->heightOffset;
if (mob->isSneaking() && !mob->instanceof(eTYPE_LOCALPLAYER))
if (mob->isSneaking())
{
yp -= 2 / 16.0f;
}
if (mob->getAnimOverrideBitmask() & (1 << HumanoidModel::eAnim_SmallModel))
{
if (mob->isRiding())
{
std::shared_ptr<Entity> ridingEntity = mob->riding;
if (ridingEntity != nullptr) // Safety check;
{
if (ridingEntity->instanceof(eTYPE_BOAT))
{
yp += 0.25f; // reverts the change in Boat.cpp for smaller models.
}
}
}
}
// Check if an idle animation is needed
if(mob->getAnimOverrideBitmask()&(1<<HumanoidModel::eAnim_HasIdle))
{
@ -519,6 +534,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 +618,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()));
}
}

View file

@ -87,7 +87,7 @@ Boat::Boat(Level *level, double x, double y, double z) : Entity( level )
double Boat::getRideHeight()
{
return heightOffset;
return heightOffset - 0.4f;
}
bool Boat::hurt(DamageSource *source, float hurtDamage)

View file

@ -1,12 +1,12 @@
services:
minecraft-lce-dedicated-server:
image: ghcr.io/kuwacom/minecraft-lce-dedicated-server:nightly
image: ghcr.io/smartcmd/minecraft-lce-dedicated-server:nightly
container_name: minecraft-lce-dedicated-server
restart: unless-stopped
tty: true
stdin_open: true
environment:
TZ: ${TZ:-Asia/Tokyo}
TZ: ${TZ:-Etc/UTC}
WINEARCH: win64
WINEPREFIX: /var/opt/wineprefix64
WINEDEBUG: -all
@ -15,12 +15,15 @@ services:
# minimum required virtual screen
XVFB_DISPLAY: ${XVFB_DISPLAY:-:99}
XVFB_SCREEN: ${XVFB_SCREEN:-720x1280x16}
# ip & port the server will run on
SERVER_BIND_IP: ${SERVER_BIND_IP:-0.0.0.0}
SERVER_PORT: ${SERVER_PORT:-25565}
volumes:
# - wineprefix64:/var/opt/wineprefix64
- ./server-data:/srv/persist
ports:
- "25565:25565/tcp"
- "25565:25565/udp"
- "$SERVER_PORT:$SERVER_PORT/tcp"
- "$SERVER_PORT:$SERVER_PORT/udp"
stop_grace_period: 30s
# volumes:

View file

@ -10,7 +10,7 @@ services:
tty: true
stdin_open: true
environment:
TZ: ${TZ:-Asia/Tokyo}
TZ: ${TZ:-Etc/UTC}
WINEARCH: win64
WINEPREFIX: /var/opt/wineprefix64
WINEDEBUG: -all
@ -18,13 +18,16 @@ services:
SERVER_CLI_INPUT_MODE: ${SERVER_CLI_INPUT_MODE:-stream}
# minimum required virtual screen
XVFB_DISPLAY: ${XVFB_DISPLAY:-:99}
XVFB_SCREEN: ${XVFB_SCREEN:-64x64x16}
XVFB_SCREEN: ${XVFB_SCREEN:-720x1280x16}
# ip & port the server will run on
SERVER_BIND_IP: ${SERVER_BIND_IP:-0.0.0.0}
SERVER_PORT: ${SERVER_PORT:-25565}
volumes:
# - wineprefix64:/var/opt/wineprefix64
- ./server-data:/srv/persist
ports:
- "25565:25565/tcp"
- "25565:25565/udp"
- "$SERVER_PORT:$SERVER_PORT/tcp"
- "$SERVER_PORT:$SERVER_PORT/udp"
stop_grace_period: 30s
# volumes:

View file

@ -3,9 +3,8 @@ set -euo pipefail
SERVER_DIR="/srv/mc"
SERVER_EXE="Minecraft.Server.exe"
# ip & port are fixed since they run inside the container
SERVER_PORT="25565"
SERVER_BIND_IP="0.0.0.0"
SERVER_PORT="${SERVER_PORT:-25565}"
SERVER_BIND_IP="${SERVER_BIND_IP:-0.0.0.0}"
PERSIST_DIR="/srv/persist"
WINE_CMD=""