Remove deprecated CarpetExtension.customSettingsManager
All extensions I've found using a custom manager have migrated
This commit is contained in:
1 parent
aa276e6056
commit
0292c61c52
2 files changed
+1
-16
No files matched your search
@@ -84,13 +84,7 @@ public interface CarpetExtension
|
||||
*
|
||||
*/
|
||||
default SettingsManager extensionSettingsManager() {
|
||||
// Warn extensions overriding the other (deprecated) method, go ahead and override this if you want to provide a custom SettingsManager
|
||||
SettingsManager deprecatedManager = customSettingsManager();
|
||||
if (deprecatedManager != null) {
|
||||
// Extension is providing a manager via the old method (and also hasn't overriden this)
|
||||
CarpetServer.warnOutdatedManager(this);
|
||||
}
|
||||
return customSettingsManager();
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -226,14 +226,5 @@ public class CarpetServer // static for now - easier to handle all around the co
|
||||
scriptServer.reload(server);
|
||||
extensions.forEach(e -> e.onReload(server));
|
||||
}
|
||||
|
||||
private static final Set<CarpetExtension> warnedOutdatedManagerProviders = new HashSet<>();
|
||||
static void warnOutdatedManager(CarpetExtension ext)
|
||||
{
|
||||
if (warnedOutdatedManagerProviders.add(ext))
|
||||
CarpetSettings.LOG.warn("""
|
||||
%s is providing a SettingsManager from an outdated method in CarpetExtension!
|
||||
This behaviour will not work in later Carpet versions and the manager won't be registered!""".formatted(ext.getClass().getName()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user