mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-28 05:35:37 +00:00
Fix some deprecations
This commit is contained in:
1 parent
4e4c72ee22
commit
088e8bcf61
6 files changed
+5
-6
No files matched your search
@@ -80,7 +80,7 @@ public class MixinConnectorManager {
|
||||
}
|
||||
|
||||
try {
|
||||
IMixinConnector connector = connectorClass.newInstance();
|
||||
IMixinConnector connector = connectorClass.getDeclaredConstructor().newInstance();
|
||||
this.connectors.add(connector);
|
||||
MixinConnectorManager.logger.info("Successfully loaded Mixin Connector [" + connectorClassName + "]");
|
||||
} catch (ReflectiveOperationException ex) {
|
||||
|
||||
@@ -70,7 +70,7 @@ public class MixinContainer {
|
||||
String simpleName = clazz.getSimpleName();
|
||||
|
||||
MixinContainer.logger.debug("Instancing new {} for {}", simpleName, this.handle);
|
||||
IMixinPlatformAgent agent = clazz.newInstance();
|
||||
IMixinPlatformAgent agent = clazz.getDeclaredConstructor().newInstance();
|
||||
|
||||
AcceptResult acceptAction = agent.accept(manager, this.handle);
|
||||
if (acceptAction == AcceptResult.ACCEPTED) {
|
||||
|
||||
@@ -297,7 +297,6 @@ public class MixinPlatformManager {
|
||||
*/
|
||||
final void addConnector(String connectorClass) {
|
||||
this.connectors.addConnector(connectorClass);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1070,7 +1070,7 @@ public final class MixinEnvironment implements ITokenProvider {
|
||||
@SuppressWarnings("unchecked")
|
||||
Class<? extends IEnvironmentTokenProvider> providerClass =
|
||||
(Class<? extends IEnvironmentTokenProvider>)this.service.getClassProvider().findClass(providerName, true);
|
||||
IEnvironmentTokenProvider provider = providerClass.newInstance();
|
||||
IEnvironmentTokenProvider provider = providerClass.getDeclaredConstructor().newInstance();
|
||||
this.registerTokenProvider(provider);
|
||||
} catch (Throwable th) {
|
||||
MixinEnvironment.logger.error("Error instantiating " + providerName, th);
|
||||
|
||||
@@ -94,7 +94,7 @@ class PluginHandle {
|
||||
if (!Strings.isNullOrEmpty(pluginClassName)) {
|
||||
try {
|
||||
Class<?> pluginClass = service.getClassProvider().findClass(pluginClassName, true);
|
||||
plugin = (IMixinConfigPlugin)pluginClass.newInstance();
|
||||
plugin = (IMixinConfigPlugin)pluginClass.getDeclaredConstructor().newInstance();
|
||||
} catch (Throwable th) {
|
||||
PluginHandle.logger.error("Error loading companion plugin class [{}] for mixin config [{}]. The plugin may be out of date: {}:{}",
|
||||
pluginClassName, parent, th.getClass().getSimpleName(), th.getMessage(), th);
|
||||
|
||||
@@ -230,7 +230,7 @@ public abstract class MixinServiceAbstract implements IMixinService {
|
||||
try {
|
||||
@SuppressWarnings("unchecked")
|
||||
Class<IMixinPlatformAgent> agentClass = (Class<IMixinPlatformAgent>)this.getClassProvider().findClass(agentClassName, false);
|
||||
IMixinPlatformAgent agent = agentClass.newInstance();
|
||||
IMixinPlatformAgent agent = agentClass.getDeclaredConstructor().newInstance();
|
||||
if (agent instanceof IMixinPlatformServiceAgent) {
|
||||
this.serviceAgents.add((IMixinPlatformServiceAgent)agent);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user