Skip to content

Commit 7ee3fb2

Browse files
committed
I'm back sort of, cleanup commit
Small cleanup pieces. Added 'user' placeholder, as per #57 Added safeguard for server not being started, as per #60. I will try to push a build out sometime soon, since it's been so long and 4.4 doesn't support sponge 7.
1 parent 065a3e4 commit 7ee3fb2

22 files changed

+1253
-1333
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
}
44

55
group = 'me.rojo8399.placeholderapi'
6-
version = '4.5'
6+
version = '4.5.1'
77
description = 'An API for all of your placeholders.'
88

99
compileJava.options.encoding = 'UTF-8'
@@ -12,5 +12,5 @@ dependencies {
1212
compile 'org.slf4j:slf4j-api:1.7.21'
1313
compile 'org.reflections:reflections:0.9.10'
1414
compile 'ninja.leaping.configurate:configurate-hocon:3.2'
15-
compile 'org.spongepowered:spongeapi:7.0.0'
15+
compile 'org.spongepowered:spongeapi:7.1.0-SNAPSHOT'
1616
}

src/main/java/me/rojo8399/placeholderapi/Attach.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
/**
2424
* Whether the placeholder is relational.
2525
*/
26-
public boolean relational() default false;
26+
boolean relational() default false;
2727

2828
/**
2929
* The placeholder to attach to.
3030
*/
31-
public String value();
31+
String value();
3232

3333
}

src/main/java/me/rojo8399/placeholderapi/ExpansionBuilder.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public interface ExpansionBuilder<S, O, V, B extends ExpansionBuilder<S, O, V, B
5555
* The value return type.
5656
*/
5757
@FunctionalInterface
58-
public static interface ExpansionFunction<S, O, V> {
58+
interface ExpansionFunction<S, O, V> {
5959
/**
6060
* Parse the placeholder for the provided arguments.
6161
*
@@ -69,7 +69,7 @@ public static interface ExpansionFunction<S, O, V> {
6969
* @throws Exception
7070
* Thrown if anyting goes wrong.
7171
*/
72-
public V parse(S source, O observer, Optional<String> token) throws Exception;
72+
V parse(S source, O observer, Optional<String> token) throws Exception;
7373
}
7474

7575
/**
@@ -213,7 +213,7 @@ default B consumeToken(Consumer<Optional<String>> exec) {
213213
* The description of the expansion.
214214
* @return This builder.
215215
*/
216-
B description(String desc);
216+
B description(String description);
217217

218218
/**
219219
* Copy settings from the expansion provided in order to modify it.
@@ -240,7 +240,7 @@ default B consumeToken(Consumer<Optional<String>> exec) {
240240
* The provided id must exist on at least one method. Any repeated ids will be
241241
* ignored unless they are of different relational status.
242242
*
243-
* @param obj
243+
* @param handle
244244
* The object containing the placeholder method.
245245
* @param id
246246
* The id of the placeholder method.
@@ -269,7 +269,7 @@ default B consumeToken(Consumer<Optional<String>> exec) {
269269
* Execute a function for the parsing of this expansion. ExpansionFunction is a
270270
* functional interface, meaning the method code may use lambdas.
271271
*
272-
* @param exec
272+
* @param function
273273
* The function to execute.
274274
* @return This builder.
275275
*/

src/main/java/me/rojo8399/placeholderapi/IExpansion.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,54 +23,54 @@ public interface IExpansion<S, O, V> {
2323
* Throws this exception in order to protect itself from hard
2424
* failure.
2525
*/
26-
public V parse(S source, O observer, Optional<String> token) throws Exception;
26+
V parse(S source, O observer, Optional<String> token) throws Exception;
2727

2828
/**
2929
* @return Whether the expansion is relational.
3030
*/
31-
public boolean relational();
31+
boolean relational();
3232

3333
/**
3434
* @return The author of the expansion.
3535
*/
36-
public String author();
36+
String author();
3737

3838
/**
3939
* @return The description of the expansion.
4040
*/
41-
public String description();
41+
String description();
4242

4343
/**
4444
* Enable this expansion.
4545
*/
46-
public default void enable() {
46+
default void enable() {
4747
setEnabled(true);
4848
}
4949

5050
/**
5151
* Disable this expansion.
5252
*/
53-
public default void disable() {
53+
default void disable() {
5454
setEnabled(false);
5555
}
5656

5757
/**
5858
* @return Whether the expansion is enabled.
5959
*/
60-
public boolean isEnabled();
60+
boolean isEnabled();
6161

6262
/**
6363
* Set whether this expansion is enabled.
6464
*
6565
* @param enabled
6666
* The state to set the plugin to.
6767
*/
68-
public void setEnabled(boolean enabled);
68+
void setEnabled(boolean enabled);
6969

7070
/**
7171
* @return The plugin which owns this expansion.
7272
*/
73-
public Object getPlugin();
73+
Object getPlugin();
7474

7575
/**
7676
* Decide what the user may have meant when inputting a token.
@@ -79,21 +79,21 @@ public default void disable() {
7979
* The token which was inputted by the user.
8080
* @return A list of possible tokens which are approximate to the input.
8181
*/
82-
public List<String> getSuggestions(String token);
82+
List<String> getSuggestions(String token);
8383

8484
/**
8585
* @return The id of the expansion.
8686
*/
87-
public String id();
87+
String id();
8888

8989
/**
9090
* @return The website of the expansion.
9191
*/
92-
public URL url();
92+
URL url();
9393

9494
/**
9595
* @return The version of the expansion.
9696
*/
97-
public String version();
97+
String version();
9898

9999
}

src/main/java/me/rojo8399/placeholderapi/Listening.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,18 @@ of this software and associated documentation files (the "Software"), to deal
2323
*/
2424
package me.rojo8399.placeholderapi;
2525

26+
import java.lang.annotation.Documented;
27+
import java.lang.annotation.Retention;
28+
import java.lang.annotation.Target;
29+
30+
import static java.lang.annotation.ElementType.TYPE;
31+
import static java.lang.annotation.RetentionPolicy.RUNTIME;
32+
2633
/**
2734
* This annotation denotes whether the class should be registered for listeners.
2835
*/
36+
@Documented
37+
@Retention(RUNTIME)
38+
@Target(TYPE)
2939
public @interface Listening {
3040
}

src/main/java/me/rojo8399/placeholderapi/Placeholder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ of this software and associated documentation files (the "Software"), to deal
4242
/**
4343
* @return The id of the placeholder.
4444
*/
45-
public String id();
45+
String id();
4646

4747
}

0 commit comments

Comments
 (0)