mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-10-31 23:59:33 +01:00
Let VB handle mapping cache enabling
Soon™️ to be fixed by Paper
This commit is contained in:
parent
bf4e4d771f
commit
35263e36ff
@ -22,7 +22,6 @@ import com.viaversion.viaversion.api.Via;
|
|||||||
import com.viaversion.viaversion.api.ViaAPI;
|
import com.viaversion.viaversion.api.ViaAPI;
|
||||||
import com.viaversion.viaversion.api.command.ViaCommandSender;
|
import com.viaversion.viaversion.api.command.ViaCommandSender;
|
||||||
import com.viaversion.viaversion.api.configuration.ConfigurationProvider;
|
import com.viaversion.viaversion.api.configuration.ConfigurationProvider;
|
||||||
import com.viaversion.viaversion.api.data.MappingDataLoader;
|
|
||||||
import com.viaversion.viaversion.api.platform.PlatformTask;
|
import com.viaversion.viaversion.api.platform.PlatformTask;
|
||||||
import com.viaversion.viaversion.api.platform.UnsupportedSoftware;
|
import com.viaversion.viaversion.api.platform.UnsupportedSoftware;
|
||||||
import com.viaversion.viaversion.api.platform.ViaPlatform;
|
import com.viaversion.viaversion.api.platform.ViaPlatform;
|
||||||
@ -79,11 +78,6 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaPlatform<Player>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoad() {
|
public void onLoad() {
|
||||||
if (hasPaperPluginLoader()) {
|
|
||||||
// Paper's plugin loader constructs plugin only once they're actually loaded and there's no place for VB to enable caching before the protocols are initialized
|
|
||||||
MappingDataLoader.enableMappingsCache();
|
|
||||||
}
|
|
||||||
|
|
||||||
protocolSupport = Bukkit.getPluginManager().getPlugin("ProtocolSupport") != null;
|
protocolSupport = Bukkit.getPluginManager().getPlugin("ProtocolSupport") != null;
|
||||||
lateBind = !((BukkitViaInjector) Via.getManager().getInjector()).isBinded();
|
lateBind = !((BukkitViaInjector) Via.getManager().getInjector()).isBinded();
|
||||||
|
|
||||||
@ -95,15 +89,6 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaPlatform<Player>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasPaperPluginLoader() {
|
|
||||||
try {
|
|
||||||
Class.forName("io.papermc.paper.plugin.configuration.PluginMeta");
|
|
||||||
return true;
|
|
||||||
} catch (final ClassNotFoundException e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
if (lateBind) {
|
if (lateBind) {
|
||||||
|
Loading…
Reference in New Issue
Block a user