I noticed that when porting pc worlds into PocketMine, many blocks and their metadata are changed. I have started work on a plugin to allow the blocks to be corrected, but I have yet to find all the block ids and meta data that needs changed. Any help in finding the needed data would be much appreciated. The project repo is here: https://github.com/jasonwynn10/BlockTypeCorrector
I've worked on the same idea and I made a list. However I'm really not sure if the list is correct and up to date. The list is json encoded and follows this structure: pcId => peId Code: { "3:2": "243:0", "31:1": "2:0", "43:7": "43:6", "44:7": "44:6", "82:0": "337:0", "112:0": "405:0", "115:0": "372:0", "157:0": "126:0", "158:0": "125:0", "188:0": "85:1", "189:0": "85:2", "190:0": "85:3", "191:0": "85:5", "192:0": "85:4", "198:0": "208:0", "199:0": "240:0", "202:0": "201:2", "205:0": "44:7", "207:0": "244:0", "208:0": "198:0", "214:0": "115:0", "322:1": "466:0", "410:0": "422:0", "434:0": "457:0", "435:0": "458:0", "436:0": "459:0", "450:0": "445:0" } Edit: After looking at your code, I also used the way you let the server do other things by breaking the conversion into multiple tasks. I was planning to make it public, but I stopped working on it, so I'm really glad you're doing this. Less coding for me when I need this again!
That list is great! Those will be the default blocks to change, but I think there may be other things needed also. I noticed that trapdoors change state and direction in converted worlds too.
I just want to really clarify the list could be wrong, I autogenerated it. It wasn't created manually.
Maybe, but I can't (although I don't know what it's file name would be if it's there). Keep in mind though, that MiNET is written in another programming language, and something like this conversation list might not be structured exactly like that.
Possibly here? https://github.com/NiclasOlofsson/M...T/MiNET/Worlds/AnvilWorldProvider.cs#L57-L164 Yeah, I'm just bringing this up because a bunch of servers do use MiNET; so you should have a tested/working conversion list to work with somewhere in that project. Easier than starting from scratch.
emmm... There's a plugin written by boybook earlier than yours The delnull plugin here I've done more features to this plugins It's the modyfied here PHP: <?phpnamespace DelNull;use pocketmine\command\Command;use pocketmine\command\CommandExecutor;use pocketmine\command\CommandSender;use pocketmine\utils\TextFormat;use pocketmine\plugin\PluginBase;use pocketmine\event\Listener;use pocketmine\event\player\PlayerInteractEvent;use pocketmine\block\Block;use pocketmine\item\Item;use pocketmine\math\Vector3;use pocketmine\tile\Sign;use pocketmine\tile\Tile;use pocketmine\block\Air;use pocketmine\block\Glowstone;class Main extends PluginBase implements Listener, CommandExecutor { public $pos1 = array(); public $pos2 = array(); public function onLoad() { } public function onEnable() { $this->getServer()->getPluginManager()->registerEvents($this, $this); } //玩家触碰方块 public function playerBlockTouch(PlayerInteractEvent $event){ $block = $event->getBlock(); $x = $block->getX(); $y = $block->getY(); $z = $block->getZ(); $player = $event->getPlayer(); $name = $player->getName(); } public function onCommand(CommandSender $sender, Command $cmd, $label, array $args){ switch($cmd->getName()){ case "dnull": if ($args[0] == "pos1") { $x = $sender->getX(); $y = $sender->getY(); $z = $sender->getZ(); $level = $sender->getLevel(); $this->pos1["x"] = $x; $this->pos1["y"] = $y; $this->pos1["z"] = $z; $this->pos1["l"] = $level; $sender->sendMessage("Position1 setted"); return true; } elseif ($args[0] == "pos2") { $x = $sender->getX(); $y = $sender->getY(); $z = $sender->getZ(); $level = $sender->getLevel(); $this->pos2["x"] = $x; $this->pos2["y"] = $y; $this->pos2["z"] = $z; $this->pos2["l"] = $level; $sender->sendMessage("Position2 setted"); return true; } elseif ($args[0] == "delnull") { if ((count($this->pos1) == 0) or (count($this->pos2) == 0)) { $sender->sendMessage("Please set the position first!"); } else { if ($this->pos1["l"]->getName() != $this->pos2["l"]->getName()) { $sender->sendMessage("2 Positions are not in the same level!"); } else { $sender->sendMessage("Start, please wait!"); $num = $this->delnall($this->pos1,$this->pos2); $sender->sendMessage("Done! Handled $num blocks."); } } return true; } else { return false; } break; } } public function delnall($pos1,$pos2) { $n = 0; $startX = min($pos1["x"], $pos2["x"]); $endX = max($pos1["x"], $pos2["x"]); $startY = min($pos1["y"], $pos2["y"]); $endY = max($pos1["y"], $pos2["y"]); $startZ = min($pos1["z"], $pos2["z"]); $endZ = max($pos1["z"], $pos2["z"]); $level = $pos1["l"]; for($x = $startX; $x <= $endX; ++$x){ for($y = $startY; $y <= $endY; ++$y){ for($z = $startZ; $z <= $endZ; ++$z){ $v3 = new Vector3($x,$y,$z); $block = $level->getBlock($v3); $id = $block->getID(); $name = $block->getName(); $meta = $block->getDamage(); switch($id){ case 126: //pc上的木板台阶 $newblock = new Item(158,$meta); $newblock = $newblock->getBlock(); $level->setBlock($v3,$newblock); $n = $n + 1; break; case 125: //pc上的双木板台阶 $newblock = new Item(5,$meta); $newblock = $newblock->getBlock(); $level->setBlock($v3,$newblock); $n = $n + 1; break; case 28: //机关铁轨 $newblock = new Item(66); //普通铁轨 $newblock = $newblock->getBlock(); $level->setBlock($v3,$newblock); $n = $n + 1; break; case 95: //彩色玻璃 $newblock = new Item(35,$meta); //羊毛 $newblock = $newblock->getBlock(); $level->setBlock($v3,$newblock); $n = $n + 1; break; case 160: //彩色玻璃片 $newblock = new Item(35,$meta); //羊毛 $newblock = $newblock->getBlock(); $level->setBlock($v3,$newblock); $n = $n + 1; break; case 51: //去除火 $newblock = new Air; //获取空气方块对象 //$level->setBlock($v3,$newblock); //替换为空气 break; default: if ($name == "Unknown") { //为pe不存在的方块 $newblock = new Air; //获取空气方块对象 $level->setBlock($v3,$newblock); //替换为空气 $n = $n + 1; } break; } } } } return $n; }}
doubt or not /dnull <pos1|pos2|delnull> The plugin is here just run and replace yourself http://zxda.mudegg.net/DelNull.phar
That code does not have all wrong IDs nor is the code very fancy. Furthermore, this doesn't really contribute to the thread.
@jasonwynn10 I don’t know if this would be helpful or not but there is a website that shows MCPE ids:meta and MCPC ids:meta (https://www.digminecraft.com/lists/item_id_list_pe.php).