Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load 1.12+ ItemBlocks obtained in PM4 #6008

Closed
diamond-gold opened this issue Aug 21, 2023 · 8 comments
Closed

Unable to load 1.12+ ItemBlocks obtained in PM4 #6008

diamond-gold opened this issue Aug 21, 2023 · 8 comments
Labels
Category: Core Related to internal functionality Resolution: Duplicate

Comments

@diamond-gold
Copy link
Contributor

Link to crashdump: https://crash.pmmp.io/view/9112014

Steps to reproduce

  1. Use PM 4.23.5 and https://github.com/ipad54/INether
  2. Give yourself warped_nylium or any of the blocks added by the plugin
  3. Stop server and copy player.dat to PM 5.4.2 server
  4. Use a plugin that registers the block warped_nylium such as https://github.com/diamond-gold/DummyItemsBlocks
  5. Start and join PM5 server
@justin-eckenweber
Copy link

Can confirm, also happens to me. Would be great if it either would be replaced with an update block or if it would accept the deserializer from the plugin.

@DavyCraft648
Copy link
Contributor

from what i see it's because pm 4 doesn't save block tag on items so pm creates 1.12.0_item_id_to_block_id_map.json file to read pm4 block items. The file is used in R12ItemIdToBlockIdMap

You can use reflection to add your item -> block map for >1.12 blocks

@dktapps
Copy link
Member

dktapps commented Aug 21, 2023

This is the fault of the plugin for using IDs and meta in PM4 that weren't supported by vanilla. You need a plugin that registers the proper upgrade mappings in BlockIdMetaUpgrader in PM5.

@dktapps
Copy link
Member

dktapps commented Aug 21, 2023

The server crashing issue is a duplicate of #5128

@dktapps dktapps added Resolution: Duplicate Category: Core Related to internal functionality and removed Resolution: Invalid labels Aug 21, 2023
@diamond-gold
Copy link
Contributor Author

This issue seems to be fixed by registering the itemblocks as items, so there really is something wrong in the way PM4 saves the itemblocks
For blocks that are implemented by PM like shroomlight, it won't get fixed by this workaround in the plugin

    /**
     * https://github.com/diamond-gold/DummyItemsBlocks/issues/5
     * Doesn't work for blocks already taken over by pmmp since they can't exist in config
     * @param string[] $blocks
     * @param string[] $items
     * @return void
     */
    private function workaroundIssue5(array $blocks, array $items): void
    {
        foreach (array_diff($blocks, $items) as $block) {
            //$this->getLogger()->debug("Block $block registering workaround...");
            try {
                self::registerSimpleItem($block, StringToItemParser::getInstance()->parse($block), [], false);
            } catch (Throwable $e) {
                //$this->getLogger()->debug("Failed to register block $block as item: " . $e->getMessage());
            }
        }
    }

@dktapps
Copy link
Member

dktapps commented Aug 23, 2023

This is not the fault of PM. There is a very good reason none of the >1.12 blocks were implemented in PM4. I warned people this would happen...

@justin-eckenweber
Copy link

This is not the fault of PM. There is a very good reason none of the >1.12 blocks were implemented in PM4. I warned people this would happen...

Can’t you just replace these blocks with update blocks or just don’t load them (air)? Otherwise servers with this blocks are bricked for ever. I think this will help to at least not lose everything from PM4… who cares about these nether items blocks if you can keep the rest.

@justin-eckenweber
Copy link

This is not the fault of PM. There is a very good reason none of the >1.12 blocks were implemented in PM4. I warned people this would happen...

Can’t you just replace these blocks with update blocks or just don’t load them (air)? Otherwise servers with this blocks are bricked for ever. I think this will help to at least not lose everything from PM4… who cares about these nether items blocks if you can keep the rest.

Or just with the base block if it exists? There has to be a solution otherwise I won’t be able to use my servers anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Core Related to internal functionality Resolution: Duplicate
Projects
None yet
Development

No branches or pull requests

4 participants