Get placeholders working

This commit is contained in:
Hannes Greule
2020-07-16 18:04:17 +02:00
parent e8c155763b
commit 2d9cf8b759
6 changed files with 46 additions and 9 deletions

View File

@ -270,6 +270,11 @@ public interface IPlotMain<P> extends ILogger {
*/
void registerWorldEvents();
/**
* Register events related to the server
*/
void registerServerEvents();
/**
* Usually HybridGen
*

View File

@ -262,6 +262,7 @@ public class PlotSquared {
this.IMP.registerPlayerEvents();
}
// Required
this.IMP.registerServerEvents();
this.IMP.registerWorldEvents();
if (Settings.Enabled_Components.CHUNK_PROCESSOR) {
this.IMP.registerChunkProcessor();

View File

@ -159,7 +159,7 @@ public final class PlaceholderRegistry {
final Placeholder previous = this.placeholders
.put(placeholder.getKey().toLowerCase(Locale.ENGLISH),
Preconditions.checkNotNull(placeholder, "Placeholder may not be null"));
if (previous != null) {
if (previous == null) {
this.eventDispatcher.callGenericEvent(new PlaceholderAddedEvent(placeholder));
}
}