Skip to content

LoonyRules/Notices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Please be aware that this code isn't the most efficient or reliable, I personally hate it and I will be recoding the project soon.

Notices

Send a dismissible notice to specific players on your server/proxy.

Downloads

Documentation

I'm sorry for the lack of documentation, it's simply code to follow for the API side of things so you should be able to follow along. But I will gradually add documentation to it at some point.

When retrieving the API instance, simply do

NoticeAPI api = Notices.getAPI();

We don't use the Bukkit/BungeeCord event system. We wanted a system that would work in both plugins, so I made my own. Extend our EventListener class in your listener class and you'll be able to override our event methods.

public class Listener extends EventListener
{
    
    // Override event methods in here.

}

That's the basic stuff. Now onto the NoticeAPI class itself.

Get the Notice a player is creating.

    api.getCreation(uuid);

Discard a player's creation Notice.

    api.removeCreation(uuid);

Insert a player's Notice creation. (This will start the creation process).

    api.addCreation(uuid, notice);

Get a player's data.

    api.getPlayer(uuid);

Cache a player's data (automatically managed for you).

    api.cachePlayer(uuid, toSave);

Remove a player's data from the cache

    api.removePlayer(uuid);

Update a MiniNotice (assigned to a player via their UUID).

    api.updatePlayer(miniNotice);

Get all cached Notices.

   api.getNotices()

Get notices associated via a player's UUID.

    api.getNotices(uuid);

Get notices associated via a player's NoticePlayer data

    api.getNoticed(uuid, noticePlayer);

Get a notice from the cache via its ID. - Throws NoSuchElementException if no cache found.

    api.getNotice(id);

Add a notice to the cache.

    api.addNotice(notice);

Remove a notice from the cache.

    api.removeNotice(notice);

Save a notice's data.

    api.saveNotice(notice);

Delete a notice's data. (From the database)

    api.deleteNotice(notice);

Update notice (Get data from the database)

    api.updateNotice(notice);

Clear notices cache

    api.clearNotices();

Clear notices without calling events

    api.forceClearNotices();

Load notices from the database (automatically done every 30 seconds Asynchronously).

    api.loadNotices();

Add event listener

    api.addEventListener(eventListenerInstance);

Remove event listener

    api.removeEventListener(eventListenerInstance);

About

Send a dismissible notice to specific players on your server/proxy.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages