Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pgmann/SpectatorPlus

This project contains the source of a plugin for Bukkit (v1.0-v2.0), and Spigot (v2.0+).
https://github.com/pgmann/SpectatorPlus

bukkit-plugin spigot-plugin

Last synced: 4 months ago
JSON representation

This project contains the source of a plugin for Bukkit (v1.0-v2.0), and Spigot (v2.0+).

Awesome Lists containing this project

README

        

# SpectatorPlus

#### Quick links · [BukkitDev](https://dev.bukkit.org/projects/spectator) · [Dev Builds](https://github.com/pgmann/SpectatorPlus/actions/workflows/maven-build-master.yml) · [JavaDoc](https://pgmann.cf/SpectatorPlus/javadoc/?com/pgcraft/spectatorplus/SpectateAPI.html) · [Maven Repo](https://repo.repsy.io/mvn/pgmann/public/) · [License](https://www.mozilla.org/MPL/2.0/)
---

SpectatorPlus is a plugin for Bukkit. For more information and guides on how to use it, [see the BukkitDev page ](http://dev.bukkit.org/bukkit-plugins/spectator/).

#### ~ License ~

This project is licensed under the [Mozilla Public License v2.0 (MPLv2)](https://www.mozilla.org/MPL/2.0/).
A summary of this licence is [available here](https://tldrlegal.com/license/mozilla-public-license-2.0-(mpl-2)#summary).

#### ~ Obtaining a Build ~

The source code of this repository is automatically built and [is always available here](https://github.com/pgmann/SpectatorPlus/actions/workflows/maven-build-master.yml).
Older, legacy development builds [can be obtained here](http://jenkins.carrade.eu/job/SpectatorPlus/) instead. In order to build this project yourself, it is recommended to use **Maven**. If you don't, you will need to import the various dependencies manually, such as [Apache Commons Lang](http://commons.apache.org/proper/commons-lang/), to be able to build the project.

#### ~ API Usage ~

If you want to integrate SpectatorPlus with your own project, you can either directly import a downloaded `.jar` into your IDE, or if you use Maven, you can reference [my Maven Repository](https://repo.repsy.io/mvn/pgmann/public/) in your `pom.xml` to have the correct version downloaded automatically during building. The advantage of this is that maven will automatically find new updates and download them from my repository.

```xml



mvn-pgmann
pgmann's repository
https://repo.repsy.io/mvn/pgmann/public/




com.pgcraft
SpectatorPlus
B3.0-SNAPSHOT

```
You can prefix the dependency version with either an `S` for Stable (Release) or a `B` for Beta (Development). Beta builds need to be postfixed with `-SNAPSHOT`. The Maven Repository stores builds from `B3.0-SNAPSHOT` and onwards.

Once SpectatorPlus is set up as a dependency of your project, you can start using the API.

```java
// Ensure SpectatorPlus is loaded
Plugin spTest = Bukkit.getServer().getPluginManager().getPlugin("SpectatorPlus");
if(spTest == null || !spTest.isEnabled()) return;

// Get a reference to the public API
SpectateAPI spApi = SpectateAPI.getAPI();

// Start using it!
if(spApi.isSpectator(player)) { // Check if 'player' is spectating
// ...
}
spApi.setSpectating(player, true); // Turn on/off spectate mode for 'player'
Toggles.TOOLS_TELEPORTER_ENABLED.set(true); // Edit the values of each item in toggles.yml

```
For detailed usage information on how to use the API, you can find [its JavaDoc here](https://pgmann.cf/SpectatorPlus/javadoc/?com/pgcraft/spectatorplus/SpectateAPI.html).