Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

skh6075/libMiniGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiniGameAPI

Tools that make it easy for developers to create MiniGames.

PHP Version: 8.0.9

Usage

Write the code below in the onEnable method of the minigame plugin you are creating.

public function onEnable() : void{
    if(!MiniGameHandler::isRegistered()){
        MiniGameHandler::register($this);
    }
}


Team overrides are as follows:

final class ColorMatchRoom extends MiniGameRoom{
	
	public function __construct(
		string $name,
		int $minPlayerCount, 
		int $maxPlayerCount, 
		Plugin $plugin, 
		int $gamemode = self::GAMEMODE_DEFAULT, 
		array $players = [], 
		?MiniGameTeamManager $teamManager = null){
		parent::__construct($name, $minPlayerCount, $maxPlayerCount, $plugin, $gamemode, $players, $teamManager);
	}
}


This plugin supports team features. If you create a game room without using the team feature.

final class RedTeam extends MiniGameTeam{}
final class BlueTeam extends MiniGameteam{}

$teamManager = new MiniGameTeamManager(
    new RedTeam("RED", []),
    new BlueTeam("BLUE", [])
);


This library manages the player's inventory.

$invManager = PlayerInventoryManager::getInstance();

You can save or load the player's inventory.

public function onPlayerJoinEvent(PlayerJoinEvent $event) : void{
    $invManager = PlayerInventoryManager::getInstance();
    $invManager->send($event->getPlayer());
}
public function onPlayerQuitEvent(PlayerQuitEvent $event) : void{
    $invManager = PlayerInventoryManager::getInstance();
    $invManager->save($event->getPlayer());
}

About

[Plugin][lib] This plugin is an API that makes it easy to implement MiniGame.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages