Code Monkey home page Code Monkey logo

libcustompack's Introduction

libCustomPack

Poggit-Ci

A small library for building and registering resource packs with PocketMine-MP

Usage

This viron was made for developers to build resource packs from plugin resources or from files on the disk, and allows adding new resource packs to the stack without requiring a server restart. NOTE: New resource packs are not automatically updated for previously loaded players. Only new players will see new resource packs.

Required imports

The following imports are necessary to use the virion library:

use libCustomPack\libCustomPack;

API

Building a resource pack

2 methods are added which allow build a resource pack using the plugin's resource directory or any other given path.

libCustomPack::generatePackFromResources($plugin);
//OR
libCustomPack::generatePackFromPath($plugin, $MyFullFolderPath);

Registering a resource pack

A resource pack can be added to the resource stack using the registerResourcePack() method.

libCustomPack::registerResourcePack($resoucePackInstance);

Unregistering a resource pack

During a plugin's onDisable() method, it is recommended to call the unregisterResourcePack() method to be removed from the resource stack.

libCustomPack::unregisterResourcePack($resoucePackInstance);

SubFolders

If the resource pack is a folder we don't know the exact location of within the given folder, we can use the $packFolderName parameter to specify the name of the folder to be found. The default subfolder name is the plugin's name followed by " Pack".

libCustomPack::generatePackFromResources($plugin, $packFolderName);
//OR
libCustomPack::generatePackFromPath($plugin, $MyFullFolderPath, $packFolderName);

libcustompack's People

Contributors

dependabot[bot] avatar jasonw4331 avatar poggit-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.