Let VB handle mapping cache enabling

Soon™️ to be fixed by Paper
This commit is contained in:
Nassim Jahnke 2023-02-20 17:34:32 +01:00
parent bf4e4d771f
commit 35263e36ff
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

@ -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) {