mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2025-03-12 02:21:11 +01:00
Merge branch 'master' into master
This commit is contained in:
commit
5c6202a8ee
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -8,7 +8,7 @@ about: Report bugs of PlaceholderAPI with this template
|
|||||||
[Request change (PlaceholderAPI)]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues/new?template=change_request_placeholderapi.md
|
[Request change (PlaceholderAPI)]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues/new?template=change_request_placeholderapi.md
|
||||||
[Spigot]: https://www.spigotmc.org/resources/6245/
|
[Spigot]: https://www.spigotmc.org/resources/6245/
|
||||||
[Jenkins]: http://ci.extendedclip.com/job/PlaceholderAPI/
|
[Jenkins]: http://ci.extendedclip.com/job/PlaceholderAPI/
|
||||||
[issue]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues
|
[issues]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues
|
||||||
|
|
||||||
## Please read
|
## Please read
|
||||||
This template is only for reporting bugs of PlaceholderAPI!
|
This template is only for reporting bugs of PlaceholderAPI!
|
||||||
|
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
|||||||
<groupId>me.clip</groupId>
|
<groupId>me.clip</groupId>
|
||||||
<artifactId>placeholderapi</artifactId>
|
<artifactId>placeholderapi</artifactId>
|
||||||
|
|
||||||
<version>2.10.3-DEV-${BUILD_NUMBER}</version>
|
<version>2.10.5-DEV-${BUILD_NUMBER}</version>
|
||||||
<name>PlaceholderAPI</name>
|
<name>PlaceholderAPI</name>
|
||||||
<description>An awesome placeholder provider!</description>
|
<description>An awesome placeholder provider!</description>
|
||||||
<url>http://extendedclip.com</url>
|
<url>http://extendedclip.com</url>
|
||||||
|
@ -345,12 +345,13 @@ public class PlaceholderAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean registerExpansion(PlaceholderExpansion ex) {
|
public static boolean registerExpansion(PlaceholderExpansion ex) {
|
||||||
if (registerPlaceholderHook(ex.getIdentifier(), ex)) {
|
ExpansionRegisterEvent ev = new ExpansionRegisterEvent(ex);
|
||||||
Bukkit.getPluginManager().callEvent(new ExpansionRegisterEvent(ex));
|
Bukkit.getPluginManager().callEvent(ev);
|
||||||
return true;
|
if (ev.isCancelled()) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return registerPlaceholderHook(ex.getIdentifier(), ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean unregisterExpansion(PlaceholderExpansion ex) {
|
public static boolean unregisterExpansion(PlaceholderExpansion ex) {
|
||||||
|
@ -21,13 +21,16 @@
|
|||||||
package me.clip.placeholderapi.events;
|
package me.clip.placeholderapi.events;
|
||||||
|
|
||||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||||
|
import org.bukkit.event.Cancellable;
|
||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
public class ExpansionRegisterEvent extends Event {
|
public class ExpansionRegisterEvent extends Event implements Cancellable {
|
||||||
|
|
||||||
private static final HandlerList HANDLERS = new HandlerList();
|
private static final HandlerList HANDLERS = new HandlerList();
|
||||||
private final PlaceholderExpansion expansion;
|
private final PlaceholderExpansion expansion;
|
||||||
|
private boolean isCancelled;
|
||||||
|
|
||||||
|
|
||||||
public ExpansionRegisterEvent(PlaceholderExpansion expansion) {
|
public ExpansionRegisterEvent(PlaceholderExpansion expansion) {
|
||||||
this.expansion = expansion;
|
this.expansion = expansion;
|
||||||
@ -45,4 +48,14 @@ public class ExpansionRegisterEvent extends Event {
|
|||||||
public PlaceholderExpansion getExpansion() {
|
public PlaceholderExpansion getExpansion() {
|
||||||
return expansion;
|
return expansion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCancelled() {
|
||||||
|
return isCancelled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setCancelled(boolean b) {
|
||||||
|
this.isCancelled = b;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ public abstract class PlaceholderExpansion extends PlaceholderHook {
|
|||||||
*/
|
*/
|
||||||
public boolean isRegistered() {
|
public boolean isRegistered() {
|
||||||
Validate.notNull(getIdentifier(), "Placeholder identifier can not be null!");
|
Validate.notNull(getIdentifier(), "Placeholder identifier can not be null!");
|
||||||
return PlaceholderAPI.getRegisteredIdentifiers().contains(getIdentifier());
|
return PlaceholderAPI.isRegistered(getIdentifier());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
name: ${project.name}
|
name: ${project.name}
|
||||||
main: me.clip.placeholderapi.PlaceholderAPIPlugin
|
main: me.clip.placeholderapi.PlaceholderAPIPlugin
|
||||||
version: ${project.version}
|
version: ${project.version}
|
||||||
|
api-version: 1.13
|
||||||
authors: [extended_clip, Glare]
|
authors: [extended_clip, Glare]
|
||||||
description: ${project.description}
|
description: ${project.description}
|
||||||
permissions:
|
permissions:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user