Closed MrHoller closed 3 years ago
It does, maybe you have something wrong in your code or some sort of plugin that resets the creative inventory
Could you show me your code and plugin list?
Could you show me your code and plugin list?
Не могли бы вы показать мне свой код и список плагинов?
`<?php
declare(strict_types = 1);
namespace JavierLeon9966\ExtendedBlocks\block;
use pocketmine\block\BlockFactory; use JavierLeon9966\ExtendedBlocks\item\ItemFactory; use pocketmine\item\ItemBlock;
class BlockManager { public static function init(){
$blocks = [257 => new PrismarineStairs, // -2
258 => new DarkPrismarineStairs, // -3
259 => new PrismarineBrickStairs, // -4
260 => new StrippedSpruceLog, // -5
261 => new StrippedBirchLog, // -6
262 => new StrippedJungleLog, // -7
263 => new StrippedAcaciaLog, // -8
264 => new StrippedDarkOakLog, // -9
265 => new StrippedOakLog, // -10
266 => new BlueIce, // -11
387 => new TubeCoralBlock, // -132
394 => new DriedKelpBlock, // -139
395 => new AcaciaButton, // -140
396 => new BirchButton, // -141
397 => new DarkOakButton, // -142
398 => new JungleButton, // -143
399 => new SpruceButton, // -144
400 => new AcaciaTrapdoor, // -145
401 => new BirchTrapdoor, // -146
402 => new DarkOakTrapdoor, // -147
403 => new JungleTrapdoor, // -148
404 => new SpruceTrapdoor, // -149
458 => new Barrel, // -203
461 => new Bell, // -206
463 => new Lantern, // -208
471 => new WitherRose, // -216
485 => new ShroomLight, // -230
501 => new CrimsonTrapdoor, // -246
502 => new WarpedTrapdoor, // -247
509 => new CrimsonStairs, // -254
510 => new WarpedStairs, // -255
511 => new CrimsonFence, // -256
512 => new WarpedFence, // -257
513 => new CrimsonFenceGate, // -258
514 => new WarpedFenceGate, // -259
523 => new SoulTorch, // -268
524 => new SoulLantern, // -269
525 => new NetheriteBlock, // -270
541 => new Chain, // -286
545 => new SoulCampfire]; // -290
foreach($blocks as $id => $block){
BlockFactory::registerBlock($block);
ItemFactory::addCreativeItem(ItemFactory::get(255 - $id));
}
}
} `
Yeah some plugins are resetting the creative inventory, so try to add them in OnEnable
Да, некоторые плагины сбрасывают творческий инвентарь, поэтому попробуйте добавить их в OnEnable
Thanks a lot! Moved the registration of blocks to event onEnable() and the blocks appeared in the inventory!
ItemFactory::addCreativeItem does not add new blocks to creative inventory. no errors.