chore: make slime block more accurate to decomp

This commit is contained in:
Fireblade
2026-08-02 15:06:34 -04:00
parent 30d7291310
commit 2c42b0cea3
6 changed files with 67 additions and 47 deletions
+13 -11
View File
@@ -898,17 +898,15 @@ void Entity::move(double xa, double ya, double za, bool noEntityCubes) // 4J -
checkFallDamage(ya, onGround);
if (xaOrg != xa) xd = 0;
if (yaOrg != ya) {
// Fireblade - updated logic here cause previous check completely broke head hitter logic
bool isSlimeBlock = false;
if (level != nullptr) {
int blockBelowX = Mth::floor(x);
int blockBelowY = Mth::floor(y - 0.1f - heightOffset);
int blockBelowZ = Mth::floor(z);
int blockId = level->getTile(blockBelowX, blockBelowY, blockBelowZ);
isSlimeBlock = (blockId == Tile::slimeBlock->id);
}
if (!isSlimeBlock) {
if (yaOrg != ya)
{
int xt = Mth::floor(x);
int yt = Mth::floor(y - 0.2f - heightOffset);
int zt = Mth::floor(z);
Tile *tile = Tile::tiles[level->getTile(xt, yt, zt)];
if (tile != nullptr) {
tile->updateEntityAfterFallOn(level, self);
} else {
yd = 0;
}
}
@@ -1117,6 +1115,10 @@ void Entity::causeFallDamage(float distance)
if (rider.lock() != nullptr) rider.lock()->causeFallDamage(distance);
}
void Entity::causeFallDamage(float distance, float multiplier)
{
if (rider.lock() != nullptr) rider.lock()->causeFallDamage(distance, multiplier);
}
bool Entity::isInWaterOrRain()
{