- Notifications
You must be signed in to change notification settings - Fork8
Adds nether and end portals (without nether and end generator) to PocketMine-MP
License
Muqsit/DimensionPortals
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This plugin lets players build nether portals and end portals, and use them to teleport between worlds. This plugin supports
Although this plugin does not generate nether and end dimension terrain, various plugins that do so exist.Therefore, you may want to supplement DimensionPortals with the following plugins:
- BetterGen - Generates more enhanced-looking biomes (if you are looking to build custom dimensions)
- MultiWorld - Generates overworld, nether, and end terrain (and a few kinds of custom terrain)
- VanillaGenerator - Generates overworld and nether terrain
As of Minecraft Bedrock Edition v1.19.0, the following plugin(s)are required as a fix:
- DimensionFix - Fixes appearance of "ghost" blocks in nether and end dimensions. Simply install this plugin and DimensionPortals integrates seamlessly with it. No additional configuration needed.
Multiple worlds supported: Have a
nether
world? Have anether2
as well? No worries, configure them both as nether.Extremely fast loading screen: Do not keep players waiting longer than they need to with near-instantaneous dimension switches!
loading-screen-is-so-fast.mp4
usemuqsit\dimensionportals\event\PlayerDimensionScreenChangeEvent;usemuqsit\dimensionportals\Loader;usemuqsit\dimensionportals\WorldManager;usepocketmine\player\Player;usepocketmine\Server;// Method 1: query current state/** @var Loader $plugin */$plugin = Server::getInstance()->getPluginManager()->getPlugin("DimensionPortals");$player = Server::getInstance()->getPlayerExact("BoxierChimera37")$manager =$plugin->getPlayerManager();$changing_dimension =$manager->get($player)->getChangingDimension();if($changing_dimension !==null){echo$player->getName()," is changing dimension to",$changing_dimension,"!",PHP_EOL;}else{echo$player->getName()," is not changing dimensions!",PHP_EOL;}// Method 2: event-driven solutionpublicfunctiononDimensionScreenChange(PlayerDimensionScreenChangeEvent$event) :void{if($event->state === PlayerDimensionScreenChangeEvent::STATE_BEGIN){echo$player->getName()," is now on dimension change screen (dimension=",$event->dimension,")",PHP_EOL;}elseif($event->state === PlayerDimensionScreenChangeEvent::STATE_END){echo$player->getName()," is no longer on dimension change screen (dimension=",$event->dimension,")",PHP_EOL;}}
usemuqsit\dimensionportals\Loader;usemuqsit\dimensionportals\WorldManager;usepocketmine\Server;/** @var Loader $plugin */$plugin = Server::getInstance()->getPluginManager()->getPlugin("DimensionPortals");$manager =$plugin->getWorldManager();$manager->world_dimensions["ruins"] = WorldManager::DIMENSION_END;// set dimension of 'ruins' world to end$manager->world_dimensions["nether2"] = WorldManager::DIMENSION_NETHER;$manager->default_worlds[WorldManager::DIMENSION_OVERWORLD] ="world2";// portals tp players back to this world$manager->default_worlds[WorldManager::DIMENSION_NETHER] ="nether2";// nether portal tps to this world$manager->default_dimension = WorldManager::DIMENSION_NETHER;// default dimension of the server is nether
usemuqsit\dimensionportals\event\PlayerPortalCreateEvent;usemuqsit\dimensionportals\WorldManager;usepocketmine\math\Vector3;publicfunctiononPortalCreate(PlayerPortalCreateEvent$event) :void{if($event->dimension !== WorldManager::WORLD_NETHER){// did not create nether portalreturn;}$player =$event->getPlayer();$spawn =$player->getWorld()->getSpawnLocation();foreach($event->frame_blocksas$block){// the obsidian block// these blocks already exist in the worldif($block->getPosition()->distance($spawn) <=64){$event->cancel();return;}}foreach($event->transaction->getBlocks()as [$x,$y,$z,$block]){// the pink portal block// these are the blocks that will be created$pos =newVector3($x,$y,$z);if($pos->distance($spawn) <=64){$event->cancel();return;}}}
usemuqsit\dimensionportals\event\PlayerPortalEnterEvent;publicfunctiononPortalEnter(PlayerPortalEnterEvent$event) :void{if($event->getPlayer()->hasPermission("rank.vip")){$event->teleport_duration =0;}}
usemuqsit\dimensionportals\event\PlayerPortalTeleportEvent;usemuqsit\dimensionportals\WorldManager;usepocketmine\entity\Location;publicfunctiononPortalTeleport(PlayerPortalTeleportEvent$event) :void{if($event->dimension !== WorldManager::DIMENSION_END){return;}$player =$event->getPlayer();if($player->hasPermission("rank.vip")){return;}$pos =$player->getServer()->getWorldManager()->getWorldByName("boring_end")->getSpawnLocation();$event->target = Location::fromObject($pos,$pos->world);}
- GlowstoneMC - End portal creation and destruction logic
- MiNET - Nether portal creation and destruction logic
About
Adds nether and end portals (without nether and end generator) to PocketMine-MP