Skip to content

Commit 653c763

Browse files
committed
First commit!
0 parents  commit 653c763

10 files changed

Lines changed: 611 additions & 0 deletions

File tree

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This is a simple .gitignore for simple needs.
2+
3+
# To ignore files system-wide, use the global git setting core.excludesfile
4+
# For repo-specific ignoring, use .git/info/exclude
5+
# To ignore the opinions of others, cover your ears and scream "LA LA LA!"
6+
7+
# Maven makes this!
8+
/target

.travis.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
language: java
2+
jdk:
3+
- oraclejdk8
4+
cache:
5+
directories:
6+
- $HOME/.m2
7+
notifications:
8+
email: false
9+
deploy:
10+
provider: releases
11+
api_key:
12+
secure: nudUN1RxvCJCHkDliT7gzMIx83OipKEKsL3JwB+g0Jg2N2H61GquQbJKGIoHly7sx+srPTCy6w6nYQILWr/SEmLXDXVJr5LJbIBvzo/RqyICTfdSKr6uttA/kaaPZsGrNV5hnkwpztRhXrb/XWXSPZRIPsdcfZ2vt9JFQ62KusG2arrte3di8T+dIZwTB1JAIKIEufe1QByNAG7XbKxLXV4GMGPJPVZRSA4ZY9E2Sy2cIpRIOCfzqS+WH15aMIIlyX/UTAekmB8n2zaeDi2eTQEZhoaS6zlzgkFqVH+wWCWPFmFRmsgwcDtQf5x3r2FeiK8zI17l5d51sLvLcRNd2GaJWuawDozqE40QHprMwV4Gpf0ucu3mKqnQQPRG3Y+GgwnLMSU5K/bBcfils69SY4eiWHm6rqWIU0ibeELJVz5ZPizVrjihhfOX2CP1siAzJdAamMwXNHU5KEBBwA+vzLd7cuTGTwDI2hCXYTcxB3s8OBjrSSUILbCIjj5Dq83RRfTuH8rT6Oz6WMMPeiJZqLHboRJJBzeTdfcJP+1P2tac/znMFHEy7+Gib38xekxkwFcMS979xIpRMgTxY6A+FJ5KODkqE6nwkHYzYtcK1/Z2KdJEgmxp/RdUcSEP/NEIDK6eH7sKic7ug5EEdjBC61jxyUfLTKn/9l23v80GLaw=
13+
file: target/spectastic.jar
14+
skip-cleanup: true
15+
on:
16+
tags: true

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
* Copyright (C) 2016 Matt Baxter http://kitteh.org
2+
3+
Permission is hereby granted, free of charge, to any person
4+
obtaining a copy of this software and associated documentation
5+
files (the "Software"), to deal in the Software without
6+
restriction, including without limitation the rights to use, copy,
7+
modify, merge, publish, distribute, sublicense, and/or sell copies
8+
of the Software, and to permit persons to whom the Software is
9+
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
18+
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Spectastic
2+
3+
Spectastic is a plugin for [Sponge](https://spongepowered.org)-powered servers, to let folks toggle to spectate that you don't want having full access
4+
5+
[![Build Status](https://travis-ci.org/KittehOrg/Spectastic.svg?branch=master)](https://travis-ci.org/KittehOrg/Spectastic)
6+
![Powered by Kittens](https://img.shields.io/badge/powered%20by-kittens-blue.svg)

pom.xml

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>org.kitteh</groupId>
8+
<artifactId>spectastic</artifactId>
9+
10+
<name>Spectastic</name>
11+
<version>1.0.0-SNAPSHOT</version>
12+
13+
<url>http://kitteh.org/</url>
14+
<properties>
15+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16+
</properties>
17+
<packaging>jar</packaging>
18+
19+
<inceptionYear>2016</inceptionYear>
20+
21+
<licenses>
22+
<license>
23+
<name>MIT License (Expat)</name>
24+
<url>http://opensource.org/licenses/mit-license.php</url>
25+
<distribution>repo</distribution>
26+
</license>
27+
</licenses>
28+
29+
<organization>
30+
<name>Kitteh</name>
31+
<url>http://kitteh.org</url>
32+
</organization>
33+
34+
<developers>
35+
<developer>
36+
<id>mbaxter</id>
37+
<name>Matt Baxter</name>
38+
<email>matt@kitteh.org</email>
39+
<url>http://kitteh.org</url>
40+
<organization>Kitteh</organization>
41+
<organizationUrl>http://kitteh.org</organizationUrl>
42+
</developer>
43+
</developers>
44+
45+
<issueManagement>
46+
<system>Github</system>
47+
<url>https://github.com/KittehOrg/Spectastic/issues</url>
48+
</issueManagement>
49+
50+
<ciManagement>
51+
<system>TravisCI</system>
52+
<url>https://travis-ci.org/KittehOrg/Spectastic</url>
53+
</ciManagement>
54+
55+
<scm>
56+
<connection>scm:git:git@github.com:KittehOrg/Spectastic.git</connection>
57+
<developerConnection>scm:git:git@github.com:KittehOrg/Spectastic.git</developerConnection>
58+
<url>git@github.com:KittehOrg/Spectastic.git</url>
59+
</scm>
60+
61+
<repositories>
62+
<repository>
63+
<id>sponge-repo</id>
64+
<url>http://repo.spongepowered.org/maven</url>
65+
</repository>
66+
</repositories>
67+
68+
<dependencies>
69+
<dependency>
70+
<groupId>org.spongepowered</groupId>
71+
<artifactId>spongeapi</artifactId>
72+
<version>4.0.0</version>
73+
<type>jar</type>
74+
<optional>true</optional>
75+
<scope>provided</scope>
76+
</dependency>
77+
<dependency>
78+
<groupId>junit</groupId>
79+
<artifactId>junit</artifactId>
80+
<version>4.12</version>
81+
<scope>test</scope>
82+
</dependency>
83+
</dependencies>
84+
85+
<build>
86+
<finalName>spectastic</finalName>
87+
<defaultGoal>clean install</defaultGoal>
88+
<resources>
89+
<resource>
90+
<targetPath>.</targetPath>
91+
<directory>${basedir}/</directory>
92+
<includes>
93+
<include>LICENSE</include>
94+
</includes>
95+
</resource>
96+
</resources>
97+
<plugins>
98+
<plugin>
99+
<groupId>org.apache.maven.plugins</groupId>
100+
<artifactId>maven-clean-plugin</artifactId>
101+
<version>3.0.0</version>
102+
</plugin>
103+
<plugin>
104+
<groupId>org.apache.maven.plugins</groupId>
105+
<artifactId>maven-resources-plugin</artifactId>
106+
<version>2.7</version>
107+
</plugin>
108+
<plugin>
109+
<groupId>org.apache.maven.plugins</groupId>
110+
<artifactId>maven-jar-plugin</artifactId>
111+
<version>2.6</version>
112+
</plugin>
113+
<plugin>
114+
<groupId>org.apache.maven.plugins</groupId>
115+
<artifactId>maven-compiler-plugin</artifactId>
116+
<version>3.3</version>
117+
<configuration>
118+
<source>1.8</source>
119+
<target>1.8</target>
120+
</configuration>
121+
</plugin>
122+
<plugin>
123+
<groupId>org.apache.maven.plugins</groupId>
124+
<artifactId>maven-surefire-plugin</artifactId>
125+
<version>2.19</version>
126+
</plugin>
127+
<plugin>
128+
<groupId>com.mycila</groupId>
129+
<artifactId>license-maven-plugin</artifactId>
130+
<version>2.11</version>
131+
<executions>
132+
<execution>
133+
<phase>clean</phase>
134+
<goals>
135+
<goal>format</goal>
136+
</goals>
137+
</execution>
138+
</executions>
139+
<configuration>
140+
<quiet>true</quiet>
141+
<encoding>UTF-8</encoding>
142+
<strictCheck>true</strictCheck>
143+
<header>${basedir}/LICENSE</header>
144+
<mapping>
145+
<java>SLASHSTAR_STYLE</java>
146+
</mapping>
147+
<includes>
148+
<include>src/main/java/org/kitteh/**</include>
149+
</includes>
150+
</configuration>
151+
</plugin>
152+
</plugins>
153+
</build>
154+
</project>
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
* * Copyright (C) 2016 Matt Baxter http://kitteh.org
3+
*
4+
* Permission is hereby granted, free of charge, to any person
5+
* obtaining a copy of this software and associated documentation
6+
* files (the "Software"), to deal in the Software without
7+
* restriction, including without limitation the rights to use, copy,
8+
* modify, merge, publish, distribute, sublicense, and/or sell copies
9+
* of the Software, and to permit persons to whom the Software is
10+
* furnished to do so, subject to the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be
13+
* included in all copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19+
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20+
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
package org.kitteh.spectastic;
25+
26+
import com.google.common.base.Objects;
27+
import org.spongepowered.api.Sponge;
28+
import org.spongepowered.api.data.DataContainer;
29+
import org.spongepowered.api.data.MemoryDataContainer;
30+
import org.spongepowered.api.data.manipulator.immutable.common.AbstractImmutableData;
31+
import org.spongepowered.api.data.value.immutable.ImmutableValue;
32+
33+
import javax.annotation.Nonnull;
34+
35+
public class ImmutablePastGameModeData extends AbstractImmutableData<ImmutablePastGameModeData, PastGameModeData> {
36+
private final String pastGameMode;
37+
38+
public ImmutablePastGameModeData() {
39+
this(Spectastic.FALLBACK);
40+
}
41+
42+
public ImmutablePastGameModeData(String pastGameMode) {
43+
this.pastGameMode = pastGameMode;
44+
this.registerGetters();
45+
}
46+
47+
@Override
48+
protected void registerGetters() {
49+
this.registerFieldGetter(Spectastic.PAST_GAMEMODE, () -> this.pastGameMode);
50+
registerKeyValue(Spectastic.PAST_GAMEMODE, this::pastGameMode);
51+
}
52+
53+
@Nonnull
54+
public ImmutableValue<String> pastGameMode() {
55+
return Sponge.getRegistry().getValueFactory().createValue(Spectastic.PAST_GAMEMODE, Spectastic.FALLBACK, this.pastGameMode).asImmutable();
56+
}
57+
58+
@Nonnull
59+
@Override
60+
public PastGameModeData asMutable() {
61+
return new PastGameModeData(this.pastGameMode);
62+
}
63+
64+
@Override
65+
public int compareTo(@Nonnull ImmutablePastGameModeData o) {
66+
return this.pastGameMode.compareTo(o.pastGameMode);
67+
}
68+
69+
@Override
70+
public int getContentVersion() {
71+
return 1;
72+
}
73+
74+
@Nonnull
75+
@Override
76+
public DataContainer toContainer() {
77+
return new MemoryDataContainer().set(Spectastic.PAST_GAMEMODE, this.pastGameMode);
78+
}
79+
80+
@Nonnull
81+
@Override
82+
public String toString() {
83+
return Objects.toStringHelper(this).add("pastGameMode", this.pastGameMode).toString();
84+
}
85+
}

0 commit comments

Comments
 (0)