Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Minecraft.Client/Common/UI/UIScene_EndPoem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,19 @@
Minecraft *pMinecraft = Minecraft::GetInstance();

wstring playerName = L"";
if(pMinecraft->localplayers[ui.GetWinUserIndex()] != nullptr)
unsigned int winIdx = ui.GetWinUserIndex();

Check failure on line 53 in Minecraft.Client/Common/UI/UIScene_EndPoem.cpp

View workflow job for this annotation

GitHub Actions / format-check

[clang-format] reported by reviewdog 🐶 Raw Output: Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:53:- unsigned int winIdx = ui.GetWinUserIndex(); Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:54:- if(winIdx < XUSER_MAX_COUNT && pMinecraft->localplayers[winIdx] != nullptr) Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:55:- { Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:56:- playerName = escapeXML( pMinecraft->localplayers[winIdx]->getDisplayName() ); Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:57:- } Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:58:- else if(pMinecraft->localplayers[ProfileManager.GetPrimaryPad()] != nullptr) Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:59:- { Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:53:+ unsigned int winIdx = ui.GetWinUserIndex(); Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:54:+ if (winIdx < XUSER_MAX_COUNT && pMinecraft->localplayers[winIdx] != nullptr) Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:55:+ { Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:56:+ playerName = escapeXML(pMinecraft->localplayers[winIdx]->getDisplayName()); Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:57:+ } Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:58:+ else if (pMinecraft->localplayers[ProfileManager.GetPrimaryPad()] != nullptr) Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:59:+ {
if(winIdx < XUSER_MAX_COUNT && pMinecraft->localplayers[winIdx] != nullptr)
{
playerName = escapeXML( pMinecraft->localplayers[ui.GetWinUserIndex()]->getDisplayName() );
playerName = escapeXML( pMinecraft->localplayers[winIdx]->getDisplayName() );
}
else
else if(pMinecraft->localplayers[ProfileManager.GetPrimaryPad()] != nullptr)
{
playerName = escapeXML( pMinecraft->localplayers[ProfileManager.GetPrimaryPad()]->getDisplayName() );
}
else

Check failure on line 62 in Minecraft.Client/Common/UI/UIScene_EndPoem.cpp

View workflow job for this annotation

GitHub Actions / format-check

[clang-format] reported by reviewdog 🐶 Raw Output: Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:62:- else Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:63:- { Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:64:- playerName = L"Player"; Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:65:- } Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:66:- noNoiseString = replaceAll(noNoiseString,L"{*PLAYER*}",playerName); Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:62:+ else Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:63:+ { Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:64:+ playerName = L"Player"; Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:65:+ } Minecraft.Client/Common/UI/UIScene_EndPoem.cpp:66:+ noNoiseString = replaceAll(noNoiseString,L"{*PLAYER*}",playerName);
{
playerName = L"Player";
}
noNoiseString = replaceAll(noNoiseString,L"{*PLAYER*}",playerName);

Random random(8124371);
Expand Down
4 changes: 1 addition & 3 deletions Minecraft.Client/PlayerConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -816,9 +816,7 @@
{
if ((target->GetType() == eTYPE_ITEMENTITY) || (target->GetType() == eTYPE_EXPERIENCEORB) || (target->GetType() == eTYPE_ARROW) || target == player)
{
//disconnect("Attempting to attack an invalid entity");
//server.warn("Player " + player.getName() + " tried to attack an invalid entity");
return;
return;

Check failure on line 819 in Minecraft.Client/PlayerConnection.cpp

View workflow job for this annotation

GitHub Actions / format-check

[clang-format] reported by reviewdog 🐶 Raw Output: Minecraft.Client/PlayerConnection.cpp:819:- return; Minecraft.Client/PlayerConnection.cpp:820:- } Minecraft.Client/PlayerConnection.cpp:819:+ return; Minecraft.Client/PlayerConnection.cpp:820:+ }
}
player->attack(target);
}
Expand Down
15 changes: 8 additions & 7 deletions Minecraft.Client/PlayerList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -951,15 +951,16 @@
addPlayerToReceiving(player);
}

if (lastDimension != 1)
xt = static_cast<double>(Mth::clamp(static_cast<int>(xt), -Level::MAX_LEVEL_SIZE + 128, Level::MAX_LEVEL_SIZE - 128));

Check failure on line 954 in Minecraft.Client/PlayerList.cpp

View workflow job for this annotation

GitHub Actions / format-check

[clang-format] reported by reviewdog 🐶 Raw Output: Minecraft.Client/PlayerList.cpp:954:- xt = static_cast<double>(Mth::clamp(static_cast<int>(xt), -Level::MAX_LEVEL_SIZE + 128, Level::MAX_LEVEL_SIZE - 128)); Minecraft.Client/PlayerList.cpp:955:- zt = static_cast<double>(Mth::clamp(static_cast<int>(zt), -Level::MAX_LEVEL_SIZE + 128, Level::MAX_LEVEL_SIZE - 128)); Minecraft.Client/PlayerList.cpp:956:- if (entity->isAlive()) Minecraft.Client/PlayerList.cpp:957:- { Minecraft.Client/PlayerList.cpp:958:- newLevel->addEntity(entity); Minecraft.Client/PlayerList.cpp:959:- entity->moveTo(xt, entity->y, zt, entity->yRot, entity->xRot); Minecraft.Client/PlayerList.cpp:960:- newLevel->tick(entity, false); Minecraft.Client/PlayerList.cpp:961:- // Portal forcing only for non-End exits (End exits go to spawn, not a portal) Minecraft.Client/PlayerList.cpp:962:- if (lastDimension != 1) Minecraft.Client/PlayerList.cpp:963:- { Minecraft.Client/PlayerList.cpp:964:- newLevel->cache->autoCreate = true; Minecraft.Client/PlayerList.cpp:954:+ xt = static_cast<double>(Mth::clamp(static_cast<int>(xt), -Level::MAX_LEVEL_SIZE + 128, Level::MAX_LEVEL_SIZE - 128)); Minecraft.Client/PlayerList.cpp:955:+ zt = static_cast<double>(Mth::clamp(static_cast<int>(zt), -Level::MAX_LEVEL_SIZE + 128, Level::MAX_LEVEL_SIZE - 128)); Minecraft.Client/PlayerList.cpp:956:+ if (entity->isAlive()) Minecraft.Client/PlayerList.cpp:957:+ { Minecraft.Client/PlayerList.cpp:958:+ newLevel->addEntity(entity); Minecraft.Client/PlayerList.cpp:959:+ entity->moveTo(xt, entity->y, zt, entity->yRot, entity->xRot); Minecraft.Client/PlayerList.cpp:960:+ newLevel->tick(entity, false); Minecraft.Client/PlayerList.cpp:961:+ // Portal forcing only for non-End exits (End exits go to spawn, not a portal) Minecraft.Client/PlayerList.cpp:962:+ if (lastDimension != 1) Minecraft.Client/PlayerList.cpp:963:+ { Minecraft.Client/PlayerList.cpp:964:+ newLevel->cache->autoCreate = true;
zt = static_cast<double>(Mth::clamp(static_cast<int>(zt), -Level::MAX_LEVEL_SIZE + 128, Level::MAX_LEVEL_SIZE - 128));
if (entity->isAlive())
{
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);
// Portal forcing only for non-End exits (End exits go to spawn, not a portal)
if (lastDimension != 1)
{
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;
Expand Down
5 changes: 5 additions & 0 deletions Minecraft.Client/ServerLevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1052,9 +1052,14 @@
vector<shared_ptr<Entity> > *es = e->getSubEntities();
if (es)
{
// Reassign sub-entity IDs to be sequential from the parent's ID.

Check failure on line 1055 in Minecraft.Client/ServerLevel.cpp

View workflow job for this annotation

GitHub Actions / format-check

[clang-format] reported by reviewdog 🐶 Raw Output: Minecraft.Client/ServerLevel.cpp:1055:- // Reassign sub-entity IDs to be sequential from the parent's ID. Minecraft.Client/ServerLevel.cpp:1056:- // The client assumes this layout when it applies an offset in handleAddMob. Minecraft.Client/ServerLevel.cpp:1057:- int offset = 1; Minecraft.Client/ServerLevel.cpp:1058:- for(auto& i : *es) Minecraft.Client/ServerLevel.cpp:1055:+ // Reassign sub-entity IDs to be sequential from the parent's ID. Minecraft.Client/ServerLevel.cpp:1056:+ // The client assumes this layout when it applies an offset in handleAddMob. Minecraft.Client/ServerLevel.cpp:1057:+ int offset = 1; Minecraft.Client/ServerLevel.cpp:1058:+ for(auto& i : *es)
// The client assumes this layout when it applies an offset in handleAddMob.
int offset = 1;
for(auto& i : *es)
{
i->entityId = e->entityId + offset;

Check failure on line 1060 in Minecraft.Client/ServerLevel.cpp

View workflow job for this annotation

GitHub Actions / format-check

[clang-format] reported by reviewdog 🐶 Raw Output: Minecraft.Client/ServerLevel.cpp:1060:- i->entityId = e->entityId + offset; Minecraft.Client/ServerLevel.cpp:1061:- entitiesById.emplace(i->entityId, i); Minecraft.Client/ServerLevel.cpp:1062:- offset++; Minecraft.Client/ServerLevel.cpp:1063:- } Minecraft.Client/ServerLevel.cpp:1060:+ i->entityId = e->entityId + offset; Minecraft.Client/ServerLevel.cpp:1061:+ entitiesById.emplace(i->entityId, i); Minecraft.Client/ServerLevel.cpp:1062:+ offset++; Minecraft.Client/ServerLevel.cpp:1063:+ }
entitiesById.emplace(i->entityId, i);
offset++;
}
}
entityAddedExtra(e); // 4J added
Expand Down
9 changes: 0 additions & 9 deletions Minecraft.World/EnderDragon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1118,15 +1118,6 @@ 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();
Expand Down
Loading