[DEV] Fix Forge Mixins
This commit is contained in:
@@ -31,12 +31,12 @@ public class ConfigScreenHandlerMixin {
|
||||
*/
|
||||
@Inject(at = @At("RETURN"), method = "getGuiFactoryFor", cancellable = true, remap = false)
|
||||
private static void injectConfigScreen(IModInfo selectedMod, CallbackInfoReturnable<Optional<BiFunction<Minecraft, Screen, Screen>>> cir) {
|
||||
ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
ConfigController.getWatchedConfigs().forEach((conf, config) -> {
|
||||
if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
return;
|
||||
|
||||
if (config.getModId().equals(selectedMod.getModId())) {
|
||||
if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
if (config.getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
cir.setReturnValue(
|
||||
Optional.of((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))
|
||||
);
|
||||
|
@@ -31,12 +31,12 @@ public class ConfigScreenHandlerMixin {
|
||||
*/
|
||||
@Inject(at = @At("RETURN"), method = "getScreenFactoryFor", cancellable = true, remap = false)
|
||||
private static void injectConfigScreen(IModInfo selectedMod, CallbackInfoReturnable<Optional<BiFunction<Minecraft, Screen, Screen>>> cir) {
|
||||
ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
ConfigController.getWatchedConfigs().forEach((conf, config) -> {
|
||||
if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
return;
|
||||
|
||||
if (config.getModId().equals(selectedMod.getModId())) {
|
||||
if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
if (config.getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
cir.setReturnValue(
|
||||
Optional.of((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))
|
||||
);
|
||||
|
@@ -31,12 +31,12 @@ public class ConfigScreenHandlerMixin {
|
||||
*/
|
||||
@Inject(at = @At("RETURN"), method = "getScreenFactoryFor", cancellable = true, remap = false)
|
||||
private static void injectConfigScreen(IModInfo selectedMod, CallbackInfoReturnable<Optional<BiFunction<Minecraft, Screen, Screen>>> cir) {
|
||||
ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
ConfigController.getWatchedConfigs().forEach((conf, config) -> {
|
||||
if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
return;
|
||||
|
||||
if (config.getModId().equals(selectedMod.getModId())) {
|
||||
if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
if (config.getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
cir.setReturnValue(
|
||||
Optional.of((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))
|
||||
);
|
||||
|
@@ -31,12 +31,12 @@ public class ConfigScreenHandlerMixin {
|
||||
*/
|
||||
@Inject(at = @At("RETURN"), method = "getScreenFactoryFor", cancellable = true, remap = false)
|
||||
private static void injectConfigScreen(IModInfo selectedMod, CallbackInfoReturnable<Optional<BiFunction<Minecraft, Screen, Screen>>> cir) {
|
||||
ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
ConfigController.getWatchedConfigs().forEach((conf, config) -> {
|
||||
if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
return;
|
||||
|
||||
if (config.getModId().equals(selectedMod.getModId())) {
|
||||
if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
if (config.getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
cir.setReturnValue(
|
||||
Optional.of((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))
|
||||
);
|
||||
|
@@ -31,12 +31,12 @@ public class ConfigScreenHandlerMixin {
|
||||
*/
|
||||
@Inject(at = @At("RETURN"), method = "getScreenFactoryFor", cancellable = true, remap = false)
|
||||
private static void injectConfigScreen(IModInfo selectedMod, CallbackInfoReturnable<Optional<BiFunction<Minecraft, Screen, Screen>>> cir) {
|
||||
ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
ConfigController.getWatchedConfigs().forEach((conf, config) -> {
|
||||
if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
return;
|
||||
|
||||
if (config.getModId().equals(selectedMod.getModId())) {
|
||||
if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
if (config.getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
cir.setReturnValue(
|
||||
Optional.of((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))
|
||||
);
|
||||
|
@@ -31,12 +31,12 @@ public class ConfigScreenHandlerMixin {
|
||||
*/
|
||||
@Inject(at = @At("RETURN"), method = "getScreenFactoryFor", cancellable = true, remap = false)
|
||||
private static void injectConfigScreen(IModInfo selectedMod, CallbackInfoReturnable<Optional<BiFunction<Minecraft, Screen, Screen>>> cir) {
|
||||
ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
ConfigController.getWatchedConfigs().forEach((conf, config) -> {
|
||||
if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
return;
|
||||
|
||||
if (config.getModId().equals(selectedMod.getModId())) {
|
||||
if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
if (config.getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
cir.setReturnValue(
|
||||
Optional.of((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))
|
||||
);
|
||||
|
@@ -34,7 +34,7 @@
|
||||
+ @Inject(at = @At("RETURN"), method = "getGuiFactoryFor", cancellable = true, remap = false)
|
||||
private static void injectConfigScreen(IModInfo selectedMod, CallbackInfoReturnable<Optional<BiFunction<Minecraft, Screen, Screen>>> cir) {
|
||||
- ConfigController.getMonitoredConfigs().forEach((conf, config) -> {
|
||||
+ ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
+ ConfigController.getWatchedConfigs().forEach((conf, config) -> {
|
||||
if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
return;
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
- } else {
|
||||
- //ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
+ if (config.getModId().equals(selectedMod.getModId())) {
|
||||
+ if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
+ if (config.getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
+ cir.setReturnValue(
|
||||
+ Optional.of((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))
|
||||
+ );
|
||||
|
@@ -19,7 +19,7 @@
|
||||
@Inject(at = @At("RETURN"), method = "getScreenFactoryFor", cancellable = true, remap = false)
|
||||
private static void injectConfigScreen(IModInfo selectedMod, CallbackInfoReturnable<Optional<BiFunction<Minecraft, Screen, Screen>>> cir) {
|
||||
- ConfigController.getMonitoredConfigs().forEach((conf, config) -> {
|
||||
+ ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
+ ConfigController.getWatchedConfigs().forEach((conf, config) -> {
|
||||
if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
return;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
- } else {
|
||||
- //ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
+ if (config.getModId().equals(selectedMod.getModId())) {
|
||||
+ if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
+ if (config.getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
+ cir.setReturnValue(
|
||||
+ Optional.of((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))
|
||||
+ );
|
||||
|
@@ -19,7 +19,7 @@
|
||||
@Inject(at = @At("RETURN"), method = "getScreenFactoryFor", cancellable = true, remap = false)
|
||||
private static void injectConfigScreen(IModInfo selectedMod, CallbackInfoReturnable<Optional<BiFunction<Minecraft, Screen, Screen>>> cir) {
|
||||
- ConfigController.getMonitoredConfigs().forEach((conf, config) -> {
|
||||
+ ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
+ ConfigController.getWatchedConfigs().forEach((conf, config) -> {
|
||||
if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
return;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
- } else {
|
||||
- //ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
+ if (config.getModId().equals(selectedMod.getModId())) {
|
||||
+ if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
+ if (config.getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
+ cir.setReturnValue(
|
||||
+ Optional.of((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))
|
||||
+ );
|
||||
|
@@ -19,7 +19,7 @@
|
||||
@Inject(at = @At("RETURN"), method = "getScreenFactoryFor", cancellable = true, remap = false)
|
||||
private static void injectConfigScreen(IModInfo selectedMod, CallbackInfoReturnable<Optional<BiFunction<Minecraft, Screen, Screen>>> cir) {
|
||||
- ConfigController.getMonitoredConfigs().forEach((conf, config) -> {
|
||||
+ ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
+ ConfigController.getWatchedConfigs().forEach((conf, config) -> {
|
||||
if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
return;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
- } else {
|
||||
- //ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
+ if (config.getModId().equals(selectedMod.getModId())) {
|
||||
+ if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
+ if (config.getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
+ cir.setReturnValue(
|
||||
+ Optional.of((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))
|
||||
+ );
|
||||
|
@@ -19,7 +19,7 @@
|
||||
@Inject(at = @At("RETURN"), method = "getScreenFactoryFor", cancellable = true, remap = false)
|
||||
private static void injectConfigScreen(IModInfo selectedMod, CallbackInfoReturnable<Optional<BiFunction<Minecraft, Screen, Screen>>> cir) {
|
||||
- ConfigController.getMonitoredConfigs().forEach((conf, config) -> {
|
||||
+ ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
+ ConfigController.getWatchedConfigs().forEach((conf, config) -> {
|
||||
if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
return;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
- } else {
|
||||
- //ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
+ if (config.getModId().equals(selectedMod.getModId())) {
|
||||
+ if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
+ if (config.getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
+ cir.setReturnValue(
|
||||
+ Optional.of((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))
|
||||
+ );
|
||||
|
@@ -19,7 +19,7 @@
|
||||
@Inject(at = @At("RETURN"), method = "getScreenFactoryFor", cancellable = true, remap = false)
|
||||
private static void injectConfigScreen(IModInfo selectedMod, CallbackInfoReturnable<Optional<BiFunction<Minecraft, Screen, Screen>>> cir) {
|
||||
- ConfigController.getMonitoredConfigs().forEach((conf, config) -> {
|
||||
+ ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
+ ConfigController.getWatchedConfigs().forEach((conf, config) -> {
|
||||
if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
return;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
- } else {
|
||||
- //ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
+ if (config.getModId().equals(selectedMod.getModId())) {
|
||||
+ if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
+ if (config.getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
+ cir.setReturnValue(
|
||||
+ Optional.of((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))
|
||||
+ );
|
||||
|
Reference in New Issue
Block a user