mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2026-02-05 11:57:14 +01:00
Merge branch 'hytale' into hytale-curseforge
This commit is contained in:
@@ -4,8 +4,8 @@ import at.helpch.placeholderapi.commands.PlaceholderCommandRouter;
|
||||
import at.helpch.placeholderapi.configuration.ConfigManager;
|
||||
import at.helpch.placeholderapi.expansion.manager.CloudExpansionManager;
|
||||
import at.helpch.placeholderapi.expansion.manager.LocalExpansionManager;
|
||||
import at.helpch.placeholderapi.listeners.ServerLoadEventListener;
|
||||
import com.hypixel.hytale.server.core.command.system.CommandSender;
|
||||
import com.hypixel.hytale.server.core.console.ConsoleSender;
|
||||
import com.hypixel.hytale.server.core.event.events.player.PlayerDisconnectEvent;
|
||||
import com.hypixel.hytale.server.core.plugin.JavaPlugin;
|
||||
import com.hypixel.hytale.server.core.plugin.JavaPluginInit;
|
||||
@@ -33,16 +33,16 @@ public class PlaceholderAPIPlugin extends JavaPlugin {
|
||||
configManager.setup();
|
||||
getEventRegistry().register(PlayerDisconnectEvent.class, localExpansionManager::onQuit);
|
||||
|
||||
new ServerLoadEventListener(this);
|
||||
if (configManager.config().cloudEnabled()) {
|
||||
cloudExpansionManager.load();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void start() {
|
||||
getCommandRegistry().registerCommand(new PlaceholderCommandRouter(this));
|
||||
|
||||
if (configManager.config().cloudEnabled()) {
|
||||
cloudExpansionManager.load();
|
||||
}
|
||||
localExpansionManager().load(ConsoleSender.INSTANCE);
|
||||
|
||||
super.start();
|
||||
}
|
||||
|
||||
@@ -386,7 +386,6 @@ public final class LocalExpansionManager /*implements Listener*/ {
|
||||
.filter(Objects::nonNull)
|
||||
.filter(CloudExpansion::shouldUpdate)
|
||||
.count();
|
||||
|
||||
Message message = Message.raw(registered.size() + "").color(registered.isEmpty() ? Color.YELLOW : Color.GREEN)
|
||||
.insert(" placeholder hook(s) registered!");
|
||||
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2026 PlaceholderAPI Team
|
||||
*
|
||||
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package at.helpch.placeholderapi.listeners;
|
||||
|
||||
import at.helpch.placeholderapi.PlaceholderAPIPlugin;
|
||||
import com.hypixel.hytale.server.core.console.ConsoleSender;
|
||||
import com.hypixel.hytale.server.core.event.events.PrepareUniverseEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public final class ServerLoadEventListener {
|
||||
|
||||
@NotNull
|
||||
private final PlaceholderAPIPlugin plugin;
|
||||
|
||||
public ServerLoadEventListener(@NotNull final PlaceholderAPIPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
|
||||
plugin.getEventRegistry().register(PrepareUniverseEvent.class, this::onServerLoad);
|
||||
// Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
}
|
||||
|
||||
public void onServerLoad(@NotNull final PrepareUniverseEvent event) {
|
||||
plugin.localExpansionManager().load(ConsoleSender.INSTANCE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -29,6 +29,7 @@ import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import at.helpch.placeholderapi.PlaceholderAPIPlugin;
|
||||
import com.hypixel.hytale.server.core.HytaleServer;
|
||||
import com.hypixel.hytale.server.core.universe.Universe;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -41,9 +42,7 @@ public final class Futures {
|
||||
@NotNull final CompletableFuture<T> future,
|
||||
@NotNull final BiConsumer<T, Throwable> consumer) {
|
||||
future.whenComplete((value, exception) -> {
|
||||
Universe.get().getDefaultWorld().execute(() -> consumer.accept(value, exception));
|
||||
// plugin.getTaskRegistry().registerTask(() -> consumer.accept(value, exception));
|
||||
// plugin.getScheduler().runTask(() -> consumer.accept(value, exception));
|
||||
HytaleServer.SCHEDULED_EXECUTOR.execute(() -> consumer.accept(value, exception));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user