Pocketmine-mp: Method getHighestBlockAt(x, z) always returns the generator block

Created on 20 May 2017  路  5Comments  路  Source: pmmp/PocketMine-MP

Issue description

Using the getHighestBlockAt(x, z) always return the heighest block of level generator.

Steps to reproduce the issue

  1. Generate a level (Default or Flat).
  2. Fly over some generated blocks (such as trees or caves)
  3. Place a block and fly or jump over.
  4. Height will result constant in base of chunk generator

OS and versions

  • PocketMine-MP: 0f174f7
  • PHP: 7.0.16
  • Server OS: Windows 10
  • Game version: PE/Win10 1.0.9/1.0.8

If could be helpful, use this code:

public function onPlayerMove(PlayerMoveEvent $event)
{
    $p = $event->getPlayer();
    $to = $event->getTo();

    $ground = $p->getLevel()->getHighestBlockAt($to->x, $to->z);
    $p->sendMessage("Ground = " . $ground);
}
API Fixed Implemented

Most helpful comment

@matcracker Extracted from CONTRIBUTING.md:

image

All 5 comments

I can confirm getHighestBlockAt often does not return what you expect it to return...

This is because the heightmap is never updated. This issue is fixed on the mcpe-1.1 branch.

@matcracker Extracted from CONTRIBUTING.md:

image

@dktapps In which commit on the mcpe-1.1 branch was this issue fixed?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mal0ne-23 picture mal0ne-23  路  32Comments

MisteFr picture MisteFr  路  18Comments

kenygamer picture kenygamer  路  92Comments

markkrueg picture markkrueg  路  18Comments

Muqsit picture Muqsit  路  23Comments