1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

RegisterItem :/

Discussion in 'Development' started by TheDevBrian, Dec 18, 2017.

  1. TheDevBrian

    TheDevBrian Spider

    Messages:
    8
    GitHub:
    thedevbrian
    Code:
    private function registerItem() {
            foreach (Item::getCreativeItems() as $item) {
                if ($item !== null) {
                    Item::getCreativeItems()[Item::FILLED_MAP ?? 358] = is_string($item) ? FilledMap::class : new FilledMap();
                    break;
                }
            }
        }
     
  2. TheDevBrian

    TheDevBrian Spider

    Messages:
    8
    GitHub:
    thedevbrian
    2017-12-18 [09:02:41] [Server thread/EMERGENCY]: An unrecoverable error has occurred and the server has crashed. Creating a crash dump
    2017-12-18 [09:02:41] [Server thread/EMERGENCY]: Please upload the "C:\Users\Brian\Desktop\Znation Network\Server\crashdumps/Mon_Dec_18-09.02.41-CST_2017.log"
     
  3. TheDevBrian

    TheDevBrian Spider

    Messages:
    8
    GitHub:
    thedevbrian
    BAD PLUGIN: ZnationCore v0.0.8

    Code:
    [72] 'x_block' => $x_block,
    [73] 'y_block' => $y_block
    [74] ]);
    [75] }
    [76]
    [77] public function getMaxStackSize() : int {
    [78] return 1;
    [79] }
    [80]
    [81] }
     
  4. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    EdwardHamHam likes this.
  5. TheDevBrian

    TheDevBrian Spider

    Messages:
    8
    GitHub:
    thedevbrian
    Code:
    private function registerItems() {
            Item::addCreativeItem([Item::FILLED_MAP ?? 358] ? FilledMap::class : new FilledMap());
        }
    it could work?

    Code:
    Item::addCreativeItem(FilledMap::get(358, 0, 1));
     
  6. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    The bottom one should work if you do it after registering the item yes.
     
  7. TheDevBrian

    TheDevBrian Spider

    Messages:
    8
    GitHub:
    thedevbrian
    what I want is to register it! : /

    I used a lot of pocketmine as api
    but never register an item
     
  8. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.