mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-25 19:45:21 +01:00
Add BukkitViaLoader to the builder and limit the builder methods
This commit is contained in:
parent
e56bce2f31
commit
08713947b7
@ -15,10 +15,7 @@ import us.myles.ViaVersion.api.command.ViaCommandSender;
|
|||||||
import us.myles.ViaVersion.api.configuration.ConfigurationProvider;
|
import us.myles.ViaVersion.api.configuration.ConfigurationProvider;
|
||||||
import us.myles.ViaVersion.api.data.UserConnection;
|
import us.myles.ViaVersion.api.data.UserConnection;
|
||||||
import us.myles.ViaVersion.api.platform.ViaPlatform;
|
import us.myles.ViaVersion.api.platform.ViaPlatform;
|
||||||
import us.myles.ViaVersion.bukkit.BukkitCommandHandler;
|
import us.myles.ViaVersion.bukkit.*;
|
||||||
import us.myles.ViaVersion.bukkit.BukkitCommandSender;
|
|
||||||
import us.myles.ViaVersion.bukkit.BukkitViaAPI;
|
|
||||||
import us.myles.ViaVersion.bukkit.BukkitViaInjector;
|
|
||||||
import us.myles.ViaVersion.classgenerator.ClassGenerator;
|
import us.myles.ViaVersion.classgenerator.ClassGenerator;
|
||||||
import us.myles.ViaVersion.dump.PluginInfo;
|
import us.myles.ViaVersion.dump.PluginInfo;
|
||||||
import us.myles.ViaVersion.util.ReflectionUtil;
|
import us.myles.ViaVersion.util.ReflectionUtil;
|
||||||
@ -52,6 +49,7 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaPlatform {
|
|||||||
.platform(this)
|
.platform(this)
|
||||||
.commandHandler(commandHandler)
|
.commandHandler(commandHandler)
|
||||||
.injector(new BukkitViaInjector())
|
.injector(new BukkitViaInjector())
|
||||||
|
.loader(new BukkitViaLoader(this))
|
||||||
.build());
|
.build());
|
||||||
// For compatibility
|
// For compatibility
|
||||||
ViaVersion.setInstance(this);
|
ViaVersion.setInstance(this);
|
||||||
|
@ -19,7 +19,6 @@ import java.util.UUID;
|
|||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Builder
|
|
||||||
public class ViaManager {
|
public class ViaManager {
|
||||||
private final Map<UUID, UserConnection> portedPlayers = new ConcurrentHashMap<>();
|
private final Map<UUID, UserConnection> portedPlayers = new ConcurrentHashMap<>();
|
||||||
private ViaPlatform platform;
|
private ViaPlatform platform;
|
||||||
@ -31,6 +30,14 @@ public class ViaManager {
|
|||||||
private ViaCommandHandler commandHandler;
|
private ViaCommandHandler commandHandler;
|
||||||
private ViaPlatformLoader loader;
|
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() {
|
public void init() {
|
||||||
if (System.getProperty("ViaVersion") != null) {
|
if (System.getProperty("ViaVersion") != null) {
|
||||||
// Reload?
|
// Reload?
|
||||||
|
Loading…
Reference in New Issue
Block a user