Register config only once on platform init

This commit is contained in:
RaphiMC 2023-10-08 10:43:07 +02:00
parent 0407b1e886
commit 1085ab3a35
No known key found for this signature in database
GPG Key ID: 0F6BB0657A03AC94
2 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,6 @@
*/
package net.raphimc.viaaprilfools;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.util.Config;
import java.io.File;
@ -30,7 +29,6 @@ public class ViaAprilFoolsConfig extends Config implements net.raphimc.viaaprilf
public ViaAprilFoolsConfig(final File configFile) {
super(configFile);
Via.getManager().getConfigurationProvider().register(this);
}
@Override

View File

@ -40,6 +40,8 @@ public interface ViaAprilFoolsPlatform {
config.reload();
ViaAprilFools.init(this, config);
Via.getManager().getSubPlatforms().add(ViaAprilFools.IMPL_VERSION);
Via.getManager().getConfigurationProvider().register(config);
final ProtocolManager protocolManager = Via.getManager().getProtocolManager();