so like if i downloaded pmmp from poggit and changed i dunno a couple lines of code pertaining to an item u guys automatically opt out of helping said person persay
When they ask for help pertaining to said edit only, yes. We have no idea what may be changed/possibly broken in his software. Pocketmine is open source for a reason. Supporting unofficial edits of PM has caused the creation of forks and spoons, which have themselves created enmity. If you want something reasonable added to the software, you have the option to create a pull request and add it yourself, or ask somebody else to. On a helpful note, you could use ChestInventory(AFAIK), however, you would need to implement a method of saving and loading the inventory for each player, and this requires a lot of data management. If you are certain that you want to do this, I strongly suggest you implement the Ender Chest in a plugin rather than the software. This would provide several advantages over editing the software.
no i understand what your saying is completely logical since messing with a few lines of code could screw up the server completely
This is not a support forum for Genisys is it? If said spoons implementation works fine why not port it to a plugin or make a pr to add it directly to PMMP?
No, you can't. A lot of files are intertwined in the software. You need to register the class, add use statements, etc. in other files, so it isn't nearly as simple as just copying a file in. You also have to consider the differences in the rest of the software that may break/change things.
Well heres my code for pvs (player vaults: like multiple enderchests inventories that can be accessed with a command) to save the items: PHP: public function savePv(Player $player, $pvnumber, Inventory $inventory){ $cfg = $this->getPvConfig($player); $content = []; for($i = 0;$i < $inventory->getSize();$i++){ $item = $inventory->getItem($i); $cfg->setNested($pvnumber.".".$i, [$item->getId(), $item->getDamage(), $item->getCount(), utf8_encode($item->getCompoundTag())]); // utf8_encode is required because some item names hasnt utf8 supported symbols so this fixed it, reverse it with utf8_decode } $cfg->save(); return true; } Also, you gotta make the getPvConfig function. just make a config for each player when they join and get it using this function. yes, maybe its too much to store in 1 config, lol. to open the inventory with items: PHP: public function getPv(Player $player, $pvnumber){ if(!is_numeric($pvnumber)){ $pvnumber = 1; } $cfg = $this->getPvConfig($player); if(isset($cfg->getAll()[$pvnumber])){ return $cfg->get($pvnumber); }else{ $cfg->set($pvnumber, []); $cfg->save(); $player->sendMessage(TF::RESET.TF::YELLOW."PV {$pvnumber} has been created!"); } return []; } public function getItemFromArray(Array $array){ $itemId = $array[0]; $itemDamage = $array[1]; $itemCount = $array[2]; $itemNbt = utf8_decode($array[3]); // reverting the utf8_encode, item's nbt is back to normal $item = Item::get($itemId, $itemDamage, $itemCount); $item->setCompoundTag($itemNbt); return $item; } public function openPv(Player $player, $pvnumber){ $inventory = $this->getPv($player, $pvnumber); $block = Block::get(54); $block->x = floor($player->x); $block->y = floor($player->y)-2; $block->z = floor($player->z); $block->level = $player->level; $player->level->sendBlocks([$player],[$block]); $nbt = new CompoundTag("", [ new ListTag("Items", []), new StringTag("id", Tile::CHEST), new IntTag("x", $block->x), new IntTag("y", $block->y), new IntTag("z", $block->z) ]); $nbt->Items->setTagType(NBT::TAG_Compound); $tile = Tile::createTile('Chest', $player->chunk, $nbt); $customInv = new ChestInventory($tile); $tile->setName(TF::DARK_GRAY."Vault #".$pvnumber); $customInv->setSize(54); $this->openingPV[$player->getName()] = $pvnumber; foreach($inventory as $slot=>$itemArray){ $customInv->setItem($slot, $this->getItemFromArray($itemArray)); } $player->addWindow($customInv); } public function onopenPV(InventoryOpenEvent $event){ if(isset($this->openingPV[$event->getPlayer()->getName()])){ $this->openingPVInventory[$event->getPlayer()->getName()] = $event->getInventory(); } } public function onclosePV(InventoryCloseEvent $event){ if(isset($this->openingPV[$event->getPlayer()->getName()])){ unset($this->openingPVInventory[$event->getPlayer()->getName()]); $this->savePv($event->getPlayer(), $this->openingPV[$event->getPlayer()->getName()], $event->getInventory()); unset($this->openingPV[$event->getPlayer()->getName()]); } } public function onpvQuit(PlayerQuitEvent $event){ if(isset($this->openingPV[$event->getPlayer()->getName()])){ $this->savePv($event->getPlayer(), $this->openingPV[$event->getPlayer()->getName()], $this->openingPVInventory[$event->getPlayer()->getName()]); unset($this->openingPV[$event->getPlayer()->getName()]); unset($this->openingPVInventory[$event->getPlayer()->getName()]); } }