StaffChat/README.md

72 lines
3.1 KiB
Markdown
Raw Permalink Normal View History

2022-03-21 01:14:00 +01:00
[![Travis-CI](https://img.shields.io/travis/com/oskar3123/StaffChat.svg?style=flat)](https://app.travis-ci.com/github/oskar3123/StaffChat)
2022-03-21 03:12:53 +01:00
[![Downloads](https://img.shields.io/github/downloads/oskar3123/StaffChat/total.svg?style=flat)](https://github.com/oskar3123/StaffChat/releases/latest)
[![Latest Release](https://img.shields.io/github/v/release/oskar3123/StaffChat.svg?style=flat)](https://github.com/oskar3123/StaffChat/releases/latest)
2018-01-29 21:32:09 +01:00
[![Github commits (since latest release)](https://img.shields.io/github/commits-since/oskar3123/StaffChat/latest.svg?style=flat)](https://github.com/oskar3123/StaffChat/commits/master)
2022-03-21 03:12:53 +01:00
[![Latest Pre-release](https://img.shields.io/github/v/release/oskar3123/StaffChat.svg?style=flat&include_prereleases)](https://github.com/oskar3123/StaffChat/releases)
[![Github commits (since latest pre-release)](https://img.shields.io/github/commits-since/oskar3123/StaffChat/latest.svg?style=flat&include_prereleases)](https://github.com/oskar3123/StaffChat/commits/master)
[![Open Issues](https://img.shields.io/github/issues/oskar3123/StaffChat)](https://github.com/oskar3123/StaffChat/issues?q=is%3Aopen+is%3Aissue)
[![Closed Issues](https://img.shields.io/github/issues-closed/oskar3123/StaffChat)](https://github.com/oskar3123/StaffChat/issues?q=is%3Aissue+is%3Aclosed)
[![Open Pull requests](https://img.shields.io/github/issues-pr/oskar3123/StaffChat)](https://github.com/oskar3123/StaffChat/pulls?q=is%3Aopen+is%3Apr)
[![Closed Pull requests](https://img.shields.io/github/issues-pr-closed/oskar3123/StaffChat)](https://github.com/oskar3123/StaffChat/pulls?q=is%3Apr+is%3Aclosed)
2018-01-29 21:31:10 +01:00
2017-07-02 22:54:53 +02:00
# [StaffChat](https://oskar3123.github.io/StaffChat)
2017-07-02 22:38:18 +02:00
Simple and highly configurable staffchat
2017-03-13 03:41:40 +01:00
2017-03-13 17:11:59 +01:00
## Download
2017-07-02 22:38:18 +02:00
You can download the plugin from the [Spigot resource page](https://www.spigotmc.org/resources/37804/) or via the [GitHub releases](https://github.com/oskar3123/StaffChat/releases)
2018-05-01 04:05:27 +02:00
## Event API (For developers)
2018-05-01 04:06:17 +02:00
### Bukkit/Spigot
2019-05-04 04:01:42 +02:00
Because the event API in 1.14+ is now strict between sync and async events you should check whether this was called synchronously or asynchronously by using `event.isAsynchronous()`
2018-05-01 04:05:27 +02:00
```java
public class StaffChatListener implements Listener
{
@EventHandler
public void onStaffChat(StaffChatEvent event)
{
// String format = event.getFormat();
// event.setFormat("&b{NAME} >> {MESSAGE}");
// String message = event.getMessage();
// Player player = event.getPlayer();
// event.setCancelled(true);
}
}
```
Register the listener with
```java
getServer().getPluginManager().registerEvents(new StaffChatListener(), this);
```
in your plugin onEnable.
2018-05-01 04:06:17 +02:00
### BungeeCord
2018-05-01 04:05:27 +02:00
```java
public class StaffChatListener implements Listener
{
@EventHandler
public void onStaffChat(BungeeStaffChatEvent event)
{
// String format = event.getFormat();
// event.setFormat("&b{NAME} >> {MESSAGE}");
// String message = event.getMessage();
// Player player = event.getPlayer();
// event.setCancelled(true);
}
}
```
Register the listener with
```java
getProxy().getPluginManager().registerListener(this, new StaffChatListener());
```
in your plugin onEnable.