3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-26 16:12:42 +01:00

Add BukkitViaLoader to the builder and limit the builder methods

Dieser Commit ist enthalten in:
Matsv 2016-09-25 21:42:22 +02:00
Ursprung e56bce2f31
Commit 08713947b7
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 97CEC2A2EA31350F
2 geänderte Dateien mit 10 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -15,10 +15,7 @@ import us.myles.ViaVersion.api.command.ViaCommandSender;
import us.myles.ViaVersion.api.configuration.ConfigurationProvider;
import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.platform.ViaPlatform;
import us.myles.ViaVersion.bukkit.BukkitCommandHandler;
import us.myles.ViaVersion.bukkit.BukkitCommandSender;
import us.myles.ViaVersion.bukkit.BukkitViaAPI;
import us.myles.ViaVersion.bukkit.BukkitViaInjector;
import us.myles.ViaVersion.bukkit.*;
import us.myles.ViaVersion.classgenerator.ClassGenerator;
import us.myles.ViaVersion.dump.PluginInfo;
import us.myles.ViaVersion.util.ReflectionUtil;
@ -52,6 +49,7 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaPlatform {
.platform(this)
.commandHandler(commandHandler)
.injector(new BukkitViaInjector())
.loader(new BukkitViaLoader(this))
.build());
// For compatibility
ViaVersion.setInstance(this);

Datei anzeigen

@ -19,7 +19,6 @@ import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
@Getter
@Builder
public class ViaManager {
private final Map<UUID, UserConnection> portedPlayers = new ConcurrentHashMap<>();
private ViaPlatform platform;
@ -31,6 +30,14 @@ public class ViaManager {
private ViaCommandHandler commandHandler;
private ViaPlatformLoader loader;
@Builder
public ViaManager(ViaPlatform platform, ViaInjector injector, ViaCommandHandler commandHandler, ViaPlatformLoader loader) {
this.platform = platform;
this.injector = injector;
this.commandHandler = commandHandler;
this.loader = loader;
}
public void init() {
if (System.getProperty("ViaVersion") != null) {
// Reload?