1 Commits

Author SHA1 Message Date
itsRevela 071c11d1f7 Fix pistons permanently breaking server-wide on dedicated servers
triggerEvent() set ignoreUpdate to true at the start but three early
return paths skipped the reset at the end. Once any of these paths was
hit, the TLS flag stayed true permanently, blocking all piston neighbor
updates for the rest of the server session.
2026-03-26 10:56:33 -05:00
6 changed files with 23 additions and 24 deletions
@@ -50,18 +50,13 @@ UIScene_EndPoem::UIScene_EndPoem(int iPad, void *initData, UILayer *parentLayer)
Minecraft *pMinecraft = Minecraft::GetInstance();
wstring playerName = L"";
unsigned int winIdx = ui.GetWinUserIndex();
if(winIdx < XUSER_MAX_COUNT && pMinecraft->localplayers[winIdx] != nullptr)
if(pMinecraft->localplayers[ui.GetWinUserIndex()] != nullptr)
{
playerName = escapeXML( pMinecraft->localplayers[winIdx]->getDisplayName() );
}
else if(pMinecraft->localplayers[ProfileManager.GetPrimaryPad()] != nullptr)
{
playerName = escapeXML( pMinecraft->localplayers[ProfileManager.GetPrimaryPad()]->getDisplayName() );
playerName = escapeXML( pMinecraft->localplayers[ui.GetWinUserIndex()]->getDisplayName() );
}
else
{
playerName = L"Player";
playerName = escapeXML( pMinecraft->localplayers[ProfileManager.GetPrimaryPad()]->getDisplayName() );
}
noNoiseString = replaceAll(noNoiseString,L"{*PLAYER*}",playerName);
-1
View File
@@ -1795,7 +1795,6 @@ void MinecraftServer::run(int64_t seed, void *lpParameter)
chunkPacketManagement_PostTick();
}
lastTime = getCurrentTimeMillis();
// int64_t afterall = System::currentTimeMillis();
// PIXReportCounter(L"Server time all",(float)(afterall-beforeall));
// PIXReportCounter(L"Server ticks",(float)tickcount);
+3 -1
View File
@@ -816,7 +816,9 @@ void PlayerConnection::handleInteract(shared_ptr<InteractPacket> packet)
{
if ((target->GetType() == eTYPE_ITEMENTITY) || (target->GetType() == eTYPE_EXPERIENCEORB) || (target->GetType() == eTYPE_ARROW) || target == player)
{
return;
//disconnect("Attempting to attack an invalid entity");
//server.warn("Player " + player.getName() + " tried to attack an invalid entity");
return;
}
player->attack(target);
}
+7 -8
View File
@@ -951,16 +951,15 @@ void PlayerList::repositionAcrossDimension(shared_ptr<Entity> entity, int lastDi
addPlayerToReceiving(player);
}
xt = static_cast<double>(Mth::clamp(static_cast<int>(xt), -Level::MAX_LEVEL_SIZE + 128, Level::MAX_LEVEL_SIZE - 128));
zt = static_cast<double>(Mth::clamp(static_cast<int>(zt), -Level::MAX_LEVEL_SIZE + 128, Level::MAX_LEVEL_SIZE - 128));
if (entity->isAlive())
if (lastDimension != 1)
{
newLevel->addEntity(entity);
entity->moveTo(xt, entity->y, zt, entity->yRot, entity->xRot);
newLevel->tick(entity, false);
// Portal forcing only for non-End exits (End exits go to spawn, not a portal)
if (lastDimension != 1)
xt = static_cast<double>(Mth::clamp(static_cast<int>(xt), -Level::MAX_LEVEL_SIZE + 128, Level::MAX_LEVEL_SIZE - 128));
zt = static_cast<double>(Mth::clamp(static_cast<int>(zt), -Level::MAX_LEVEL_SIZE + 128, Level::MAX_LEVEL_SIZE - 128));
if (entity->isAlive())
{
newLevel->addEntity(entity);
entity->moveTo(xt, entity->y, zt, entity->yRot, entity->xRot);
newLevel->tick(entity, false);
newLevel->cache->autoCreate = true;
newLevel->getPortalForcer()->force(entity, xOriginal, yOriginal, zOriginal, yRotOriginal);
newLevel->cache->autoCreate = false;
+1 -6
View File
@@ -678,7 +678,7 @@ bool ServerLevel::tickPendingTicks(bool force)
}
else
{
forceAddTileTick(td.x, td.y, td.z, td.tileId, 0, td.priorityTilt);
addToTickNextTick(td.x, td.y, td.z, td.tileId, 0);
}
}
@@ -1052,14 +1052,9 @@ void ServerLevel::entityAdded(shared_ptr<Entity> e)
vector<shared_ptr<Entity> > *es = e->getSubEntities();
if (es)
{
// Reassign sub-entity IDs to be sequential from the parent's ID.
// The client assumes this layout when it applies an offset in handleAddMob.
int offset = 1;
for(auto& i : *es)
{
i->entityId = e->entityId + offset;
entitiesById.emplace(i->entityId, i);
offset++;
}
}
entityAddedExtra(e); // 4J added
+9
View File
@@ -1118,6 +1118,15 @@ bool EnderDragon::hurt(shared_ptr<MultiEntityMobPart> MultiEntityMobPart, Damage
damage = damage / 4 + 1;
}
//float rot1 = yRot * PI / 180;
//float ss1 = sin(rot1);
//float cc1 = cos(rot1);
//xTarget = x + ss1 * 5 + (random->nextFloat() - 0.5f) * 2;
//yTarget = y + random->nextFloat() * 3 + 1;
//zTarget = z - cc1 * 5 + (random->nextFloat() - 0.5f) * 2;
//attackTarget = nullptr;
if ( source->getEntity() != nullptr && source->getEntity()->instanceof(eTYPE_PLAYER) || source->isExplosion() )
{
int healthBefore = getHealth();