fix mobs spawning in water

* Fixed underwater under lava mob spawn issue #17

* made comment changes

* minor fix

* method name change

* method change

* fixed
This commit is contained in:
anmol-patankar
2025-09-12 22:23:08 +05:30
committed by GitHub
parent dabb202c13
commit ba03d92ad0
3 changed files with 13 additions and 3 deletions

View File

@@ -355,10 +355,10 @@ void handlePacket (int client_fd, int length, int packet_id, int state) {
uint8_t b_mid = getBlockAt(mob_x, mob_y, mob_z);
uint8_t b_top = getBlockAt(mob_x, mob_y + 1, mob_z);
while (mob_y < 255) {
if ( // Solid block below, non-solid at feet and above
if ( // Solid block below, non-solid(spawnable) at feet and above
!isPassableBlock(b_low) &&
isPassableBlock(b_mid) &&
isPassableBlock(b_top)
isPassableSpawnBlock(b_mid) &&
isPassableSpawnBlock(b_top)
) break;
b_low = b_mid;
b_mid = b_top;