mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-08-20 09:57:09 +00:00
fix: slime block inaccurate damage properties + weird ui stuff
This commit is contained in:
parent
fb46ed3005
commit
e2b81cae79
|
|
@ -1486,6 +1486,7 @@ void CMinecraftApp::ApplyGameSettingsChanged(int iPad)
|
||||||
ActionGameSettings(iPad,eGameSetting_ControlScheme );
|
ActionGameSettings(iPad,eGameSetting_ControlScheme );
|
||||||
ActionGameSettings(iPad,eGameSetting_ControlInvertLook);
|
ActionGameSettings(iPad,eGameSetting_ControlInvertLook);
|
||||||
ActionGameSettings(iPad,eGameSetting_ControlSouthPaw);
|
ActionGameSettings(iPad,eGameSetting_ControlSouthPaw);
|
||||||
|
ActionGameSettings(iPad,eGameSetting_ControlType);
|
||||||
ActionGameSettings(iPad,eGameSetting_SplitScreenVertical);
|
ActionGameSettings(iPad,eGameSetting_SplitScreenVertical);
|
||||||
ActionGameSettings(iPad,eGameSetting_GamertagsVisible);
|
ActionGameSettings(iPad,eGameSetting_GamertagsVisible);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -326,11 +326,11 @@ void UIScene::loadMovie()
|
||||||
if(primaryPad < 0 || primaryPad >= XUSER_MAX_COUNT)
|
if(primaryPad < 0 || primaryPad >= XUSER_MAX_COUNT)
|
||||||
primaryPad = 0;
|
primaryPad = 0;
|
||||||
const int controlType = app.GetGameSettings(primaryPad, eGameSetting_ControlType);
|
const int controlType = app.GetGameSettings(primaryPad, eGameSetting_ControlType);
|
||||||
const bool force720ForControlType = (controlType == 3 || controlType == 4 || controlType == 6);
|
const bool force720ForControlType = (controlType == 3 || controlType == 5);
|
||||||
// tutorial popups + HUD elements have inaccuracies + crashes that we need to fix here
|
// tutorial popups + HUD elements have inaccuracies + crashes that we need to fix here
|
||||||
const bool isTutorialPopupMovie = (moviePath.find(L"TutorialPopup") == 0);
|
const bool isTutorialPopupMovie = (moviePath.find(L"TutorialPopup") == 0);
|
||||||
const bool isHUDMovie = (moviePath.find(L"HUD") == 0);
|
const bool isHUDMovie = (moviePath.find(L"HUD") == 0);
|
||||||
const bool use1080 = (ui.getScreenHeight() > 720.0f) && (!force720ForControlType || isTutorialPopupMovie || isHUDMovie);
|
const bool use1080 = (ui.getScreenHeight() > 720.0f) && (!force720ForControlType || isTutorialPopupMovie);
|
||||||
if(use1080)
|
if(use1080)
|
||||||
{
|
{
|
||||||
moviePath.append(L"1080.swf");
|
moviePath.append(L"1080.swf");
|
||||||
|
|
|
||||||
|
|
@ -1510,6 +1510,7 @@ static Minecraft* InitialiseMinecraftRuntime()
|
||||||
|
|
||||||
app.InitGameSettings();
|
app.InitGameSettings();
|
||||||
app.InitialiseTips();
|
app.InitialiseTips();
|
||||||
|
ui.ReloadSkin();
|
||||||
|
|
||||||
return pMinecraft;
|
return pMinecraft;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -356,6 +356,8 @@ void Entity::_init(bool useSmallId, Level *level)
|
||||||
|
|
||||||
// 4J Added
|
// 4J Added
|
||||||
m_ignoreVerticalCollisions = false;
|
m_ignoreVerticalCollisions = false;
|
||||||
|
m_clearFallDamageThisTick = false;
|
||||||
|
m_ignoreFallDamageUntilGround = false;
|
||||||
m_uiAnimOverrideBitmask = 0L;
|
m_uiAnimOverrideBitmask = 0L;
|
||||||
m_ignorePortal = false;
|
m_ignorePortal = false;
|
||||||
}
|
}
|
||||||
|
|
@ -1036,6 +1038,24 @@ bool Entity::makeStepSound()
|
||||||
|
|
||||||
void Entity::checkFallDamage(double ya, bool onGround)
|
void Entity::checkFallDamage(double ya, bool onGround)
|
||||||
{
|
{
|
||||||
|
if (m_clearFallDamageThisTick)
|
||||||
|
{
|
||||||
|
m_clearFallDamageThisTick = false;
|
||||||
|
fallDistance = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (m_ignoreFallDamageUntilGround)
|
||||||
|
{
|
||||||
|
if (ya < 0)
|
||||||
|
{
|
||||||
|
m_ignoreFallDamageUntilGround = false;
|
||||||
|
fallDistance = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (onGround)
|
if (onGround)
|
||||||
{
|
{
|
||||||
if (fallDistance > 0)
|
if (fallDistance > 0)
|
||||||
|
|
@ -1068,6 +1088,13 @@ bool Entity::isFireImmune()
|
||||||
return fireImmune;
|
return fireImmune;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Entity::clearFallDamageQueue()
|
||||||
|
{
|
||||||
|
fallDistance = 0.0f;
|
||||||
|
m_clearFallDamageThisTick = true;
|
||||||
|
m_ignoreFallDamageUntilGround = true;
|
||||||
|
}
|
||||||
|
|
||||||
void Entity::causeFallDamage(float distance)
|
void Entity::causeFallDamage(float distance)
|
||||||
{
|
{
|
||||||
if (rider.lock() != nullptr) rider.lock()->causeFallDamage(distance);
|
if (rider.lock() != nullptr) rider.lock()->causeFallDamage(distance);
|
||||||
|
|
|
||||||
|
|
@ -170,6 +170,8 @@ private:
|
||||||
protected:
|
protected:
|
||||||
// 4J Added so that client side simulations on the host are not affected by zero-lag
|
// 4J Added so that client side simulations on the host are not affected by zero-lag
|
||||||
bool m_ignoreVerticalCollisions;
|
bool m_ignoreVerticalCollisions;
|
||||||
|
bool m_clearFallDamageThisTick;
|
||||||
|
bool m_ignoreFallDamageUntilGround;
|
||||||
|
|
||||||
bool m_ignorePortal;
|
bool m_ignorePortal;
|
||||||
|
|
||||||
|
|
@ -253,6 +255,7 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool isFireImmune();
|
bool isFireImmune();
|
||||||
|
void clearFallDamageQueue();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void causeFallDamage(float distance);
|
virtual void causeFallDamage(float distance);
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ void LivingEntity::checkFallDamage(double ya, bool onGround)
|
||||||
updateInWaterState();
|
updateInWaterState();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (onGround && fallDistance > 0)
|
if (onGround)
|
||||||
{
|
{
|
||||||
int xt = Mth::floor(x);
|
int xt = Mth::floor(x);
|
||||||
int yt = Mth::floor(y - 0.2f - heightOffset);
|
int yt = Mth::floor(y - 0.2f - heightOffset);
|
||||||
|
|
@ -182,8 +182,11 @@ void LivingEntity::checkFallDamage(double ya, bool onGround)
|
||||||
Tile *tile = Tile::tiles[t];
|
Tile *tile = Tile::tiles[t];
|
||||||
if (t > 0 && tile != nullptr) // tu31 tutorial world fix
|
if (t > 0 && tile != nullptr) // tu31 tutorial world fix
|
||||||
{
|
{
|
||||||
auto ent = shared_from_this();
|
if (fallDistance > 0 || t == Tile::slimeBlock->id)
|
||||||
Tile::tiles[t]->fallOn(level, xt, yt, zt, ent, fallDistance);
|
{
|
||||||
|
auto ent = shared_from_this();
|
||||||
|
Tile::tiles[t]->fallOn(level, xt, yt, zt, ent, fallDistance);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,11 @@ void SlimeTile::fallOn(Level *level, int x, int y, int z,
|
||||||
if (entity == nullptr)
|
if (entity == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
entity->clearFallDamageQueue();
|
||||||
|
|
||||||
|
entity->fallDistance = 0.0f;
|
||||||
|
entity->onGround = false;
|
||||||
|
|
||||||
if (entity->isSneaking())
|
if (entity->isSneaking())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -60,13 +65,15 @@ void SlimeTile::fallOn(Level *level, int x, int y, int z,
|
||||||
entity->yd *= 0.8f;
|
entity->yd *= 0.8f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
entity->fallDistance = 0.0f;
|
|
||||||
entity->onGround = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SlimeTile::stepOn(Level *level, int x, int y, int z, shared_ptr<Entity> entity)
|
void SlimeTile::stepOn(Level *level, int x, int y, int z, shared_ptr<Entity> entity)
|
||||||
{
|
{
|
||||||
|
if (entity != nullptr)
|
||||||
|
{
|
||||||
|
entity->clearFallDamageQueue();
|
||||||
|
}
|
||||||
|
|
||||||
if (entity != nullptr &&
|
if (entity != nullptr &&
|
||||||
std::abs(entity->yd) < 0.1f &&
|
std::abs(entity->yd) < 0.1f &&
|
||||||
!entity->isSneaking())
|
!entity->isSneaking())
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue