Wertzui123 / PMMP5Converter

Automatically convert your PocketMine-MP 4 plugins to API 5
MIT License
12 stars 1 forks source link

the error `Undefined ` #4

Closed GabBiswajit closed 1 year ago

GabBiswajit commented 1 year ago

Can't to update this :

protected function register(Block $block, int $cost, bool $allStates = true): void {
        if($allStates) {
            for($meta = 0; $meta <= 15; $meta++) {
                $fullId = ($block->getId() << Block::INTERNAL_METADATA_BITS) | $meta;
                self::$BLOCK_COSTS[$fullId] = $cost;
            }
            return;
        }
        self::$BLOCK_COSTS[$block->getFullId()] = $cost;
    }

Thread: Main Error: Undefined constant pocketmine\block\Block::INTERNAL_METADATA_BITS Please Fix this And Give me a Sulution For Now @Wertzui123 also getId in undefined

Wertzui123 commented 1 year ago

This code cannot easily be updated as it doesn't really make sense on PocketMine-MP 5 (because metas have been removed).

getId() should be getTypeId(), but the converter is (and will not be) able to do that.