Skip to content

Commit

Permalink
Merge pull request #86 from dima-dencep/1.20.x/dev
Browse files Browse the repository at this point in the history
4.1.0
  • Loading branch information
dima-dencep authored Jun 13, 2024
2 parents 2a94d0b + 35998d2 commit 376a9c1
Show file tree
Hide file tree
Showing 23 changed files with 51 additions and 76 deletions.
23 changes: 18 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,28 @@ allprojects {
group = rootProject.maven_group

repositories {
maven { url "https://maven.shedaniel.me" }
maven { url "https://maven.neoforged.net/releases" }
maven { url "https://maven.terraformersmc.com/releases" }
maven { url "https://maven.parchmentmc.org" }
maven {
name "NeoForged"
url "https://maven.neoforged.net/releases"
content {
excludeGroupByRegex "org.parchmentmc"
}
}
maven {
name "ParchmentMC"
url "https://maven.parchmentmc.org"
}
maven {
url "https://maven.shedaniel.me"
}
maven {
url "https://maven.terraformersmc.com/releases"
}
}

tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
options.release.set(21)
options.release.set 21
}

java {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ public static boolean rgbProgress() {
throw new AssertionError();
}

@ExpectPlatform
public static boolean forceClose() {
throw new AssertionError();
}

@ExpectPlatform
public static boolean blockOverlay() {
throw new AssertionError();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

package org.redlance.dima_dencep.mods.rrls.config;

public enum HideType { // TODO dehardcode
public enum HideType {
ALL,
LOADING,
RELOADING,
Expand All @@ -27,4 +27,8 @@ public boolean canHide(boolean reloading) {
return this == LOADING;
}
}

public boolean forceClose() {
return this == LOADING || this == ALL;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,17 @@ private static int replaceAlpha(int color, int alpha) {
return ConfigExpectPlatform.removeOverlayAtEnd();
}

@WrapWithCondition(
method = "render",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/gui/screens/Screen;init(Lnet/minecraft/client/Minecraft;II)V"
)
)
public boolean rrls$reinitScreen(Screen instance, Minecraft minecraft, int width, int height) {
return ConfigExpectPlatform.reInitScreen();
}

@WrapOperation(
method = "render",
at = @At(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public abstract class MinecraftClientMixin {
)
)
public void rrls$init(GameConfig gameConfig, CallbackInfo ci, @Local(ordinal = 0) Minecraft.GameLoadCookie gameLoadCookie) {
if (ConfigExpectPlatform.forceClose()) {
if (ConfigExpectPlatform.hideType().forceClose()) {
onResourceLoadFinished(gameLoadCookie);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class SimpleReloadInstanceMixin {
)
)
public <U, V> CompletableFuture<V> rrls$async(CompletableFuture<Unit> instance, CompletionStage<? extends U> other, BiFunction<?, ? super U, ? extends V> fn, Operation<CompletableFuture<V>> original) {
if (ConfigExpectPlatform.forceClose() && rrls$filterListener()) {
if (ConfigExpectPlatform.hideType().forceClose() && rrls$filterListener(val$listener)) {
Rrls.LOGGER.info("Skip wait for {}!", val$listener.getName());

return CompletableFuture.completedFuture(fn.apply(null, null));
Expand All @@ -55,20 +55,20 @@ public class SimpleReloadInstanceMixin {
}

@Unique
private boolean rrls$filterListener() {
if (this.val$listener instanceof FontManager fontManager) {
private static boolean rrls$filterListener(PreparableReloadListener listener) {
if (listener instanceof FontManager fontManager) {
return !fontManager.fontSets.containsKey(Minecraft.DEFAULT_FONT);
}

if (this.val$listener instanceof LanguageManager languageManager) {
if (listener instanceof LanguageManager languageManager) {
return languageManager.getLanguages().size() == 1;
}

if (this.val$listener instanceof SplashManager splashManager) {
if (listener instanceof SplashManager splashManager) {
return splashManager.splashes.isEmpty();
}

if (this.val$listener instanceof GuiSpriteManager spriteManager) {
if (listener instanceof GuiSpriteManager spriteManager) {
return spriteManager.textureAtlas.texturesByName.isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static State lookupState(Screen screen, boolean reloading) {
if (!ConfigExpectPlatform.hideType().canHide(reloading))
return State.DEFAULT;

if (reloading || ConfigExpectPlatform.forceClose())
if (reloading || ConfigExpectPlatform.hideType().forceClose())
return State.HIDE;

if (screen instanceof GenericMessageScreen) // Loading Minecraft
Expand Down
2 changes: 0 additions & 2 deletions common/src/main/resources/assets/rrls/lang/be_by.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"text.autoconfig.rrls.option.hideType": "Схаваць экраны перазагрузкі",
"text.autoconfig.rrls.option.rgbProgress": "Каляровы радок прагрэсу",
"text.autoconfig.rrls.option.rgbProgress.@Tooltip": "§cМОЖА ВЫКЛІКАЦЬ ЭПІЛЕПСІЮ",
"text.autoconfig.rrls.option.ignoreScreen": "Схаваць экраны загрузкі",
"text.autoconfig.rrls.option.ignoreScreen.@Tooltip": "МОГУЦЬ УЗНІКНУЦЬ ПРАБЛЕМЫ",
"text.autoconfig.rrls.option.miniRender": "Адлюстраванне прагрэссу перазагрузкі пакетаў рэсурсаў",
"text.autoconfig.rrls.option.resetResources": "Скідваць пакеты рэсурсаў, калі не атрымалася загрузіць",
"text.autoconfig.rrls.option.reInitScreen": "Рэініцыялізацыя бягучага экрана пасля перазагрузкі",
Expand Down
4 changes: 0 additions & 4 deletions common/src/main/resources/assets/rrls/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
"text.autoconfig.rrls.option.hideType": "Overlays that will be hidden",
"text.autoconfig.rrls.option.rgbProgress": "Colorful",
"text.autoconfig.rrls.option.rgbProgress.@Tooltip": "§cMAY CAUSE EPILEPSY",
"text.autoconfig.rrls.option.ignoreScreen": "Ignoring uninitialized screen on loading",
"text.autoconfig.rrls.option.ignoreScreen.@Tooltip": "MAY CAUSE PROBLEMS",
"text.autoconfig.rrls.option.miniRender": "Render a mini (aka hidden) version of the overlay",
"text.autoconfig.rrls.option.enableScissor": "Trim the rendering of the default overlay",
"text.autoconfig.rrls.option.enableScissor.@Tooltip": "Enable this if the window is flooded with color (mostly black)",
Expand All @@ -25,8 +23,6 @@
"text.autoconfig.rrls.option.animationSpeed": "Splash animation speed",
"text.autoconfig.rrls.option.animationSpeed.@Tooltip": "In milliseconds",
"text.autoconfig.rrls.option.doubleLoad": "Reload resources again if an error occurs",
"text.autoconfig.rrls.option.forceClose": "Hide the overlay, even if there is nothing behind it",
"text.autoconfig.rrls.option.forceClose.@Tooltip": "Actually now there is, I've been planning a workaround for a long time, but now there is one in minecraft :)",
"text.autoconfig.rrls.option.blockOverlay": "Complete blocking of overlay usage",
"text.autoconfig.rrls.option.blockOverlay.@Tooltip": "Use at your own risk!",
"text.autoconfig.rrls.option.skipForgeOverlay": "Replaces the (Neo)Forge loading overlay with vanilla"
Expand Down
4 changes: 0 additions & 4 deletions common/src/main/resources/assets/rrls/lang/es_mx.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
"text.autoconfig.rrls.option.hideType": "Superposiciones que se ocultarán",
"text.autoconfig.rrls.option.rgbProgress": "Colorido",
"text.autoconfig.rrls.option.rgbProgress.@Tooltip": "§cPUEDE CAUSAR EPILEPSIA",
"text.autoconfig.rrls.option.ignoreScreen": "Ignorar pantalla no inicializada al cargar",
"text.autoconfig.rrls.option.ignoreScreen.@Tooltip": "PUEDE CAUSAR PROBLEMAS",
"text.autoconfig.rrls.option.miniRender": "Mostrar una versión mini (oculta) de la superposición",
"text.autoconfig.rrls.option.type": "Lo que se mostrará al recargar",
"text.autoconfig.rrls.option.reloadText": "El texto que se mostrará si se selecciona TEXTO arriba",
Expand All @@ -23,8 +21,6 @@
"text.autoconfig.rrls.option.animationSpeed": "Velocidad de animación de la pantalla de inicio",
"text.autoconfig.rrls.option.animationSpeed.@Tooltip": "En milisegundos",
"text.autoconfig.rrls.option.doubleLoad": "Volver a cargar los recursos si ocurre un error",
"text.autoconfig.rrls.option.forceClose": "Ocultar la superposición, incluso si no hay nada detrás de ella",
"text.autoconfig.rrls.option.forceClose.@Tooltip": "En realidad, ahora sí hay, he estado planeando una solución alternativa durante mucho tiempo, pero ahora hay una en Minecraft :)",
"text.autoconfig.rrls.option.blockOverlay": "Bloqueo completo del uso de superposiciones",
"text.autoconfig.rrls.option.blockOverlay.@Tooltip": "¡Úsalo bajo tu propio riesgo!",
"text.autoconfig.rrls.option.skipForgeOverlay": "Reemplaza la superposición de carga de (Neo)Forge con la de vainilla"
Expand Down
2 changes: 0 additions & 2 deletions common/src/main/resources/assets/rrls/lang/it_it.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"text.autoconfig.rrls.option.hideType": "Nascondi la schermata di ri-caricamento",
"text.autoconfig.rrls.option.rgbProgress": "Barra di avanzamento colorata",
"text.autoconfig.rrls.option.rgbProgress.@Tooltip": "§cPOTREBBE CAUSARE EPILESSIA",
"text.autoconfig.rrls.option.ignoreScreen": "Nascondi la schermata di ri-caricamento",
"text.autoconfig.rrls.option.ignoreScreen.@Tooltip": "POTREBBE CAUSARE PROBLEMI",
"text.autoconfig.rrls.option.miniRender": "Visualizzazione del processo di ricaricamento dei pacchetti di risorse",
"text.autoconfig.rrls.option.resetResources": "Ripristina i pacchetti di risorse se il caricamento fallisce",
"text.autoconfig.rrls.option.reInitScreen": "Reinizza la schermata corrente dopo un ricaricamento",
Expand Down
2 changes: 0 additions & 2 deletions common/src/main/resources/assets/rrls/lang/pt_br.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"text.autoconfig.rrls.option.hideType": "Ocultar tela de recarga",
"text.autoconfig.rrls.option.rgbProgress": "Texto colorido ao recarregar",
"text.autoconfig.rrls.option.rgbProgress.@Tooltip": "PODE CAUSAR EPILEPSIA",
"text.autoconfig.rrls.option.ignoreScreen": "Ocultar tela de carregamento",
"text.autoconfig.rrls.option.ignoreScreen.@Tooltip": "PODE CAUSAR PROBLEMAS",
"text.autoconfig.rrls.option.miniRender": "Exibição do processo de recarga de recursos",
"text.autoconfig.rrls.option.resetResources": "Redefinir recursos quando falha no carregamento",
"text.autoconfig.rrls.option.reInitScreen": "Reiniciando a tela atual após uma recarga",
Expand Down
4 changes: 0 additions & 4 deletions common/src/main/resources/assets/rrls/lang/ru_ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
"text.autoconfig.rrls.option.hideType": "Оверлеи, которые будут скрыты",
"text.autoconfig.rrls.option.rgbProgress": "Разноцветность",
"text.autoconfig.rrls.option.rgbProgress.@Tooltip": "§cМОЖЕТ ВЫЗВАТЬ ЭПИЛЕПСИЮ",
"text.autoconfig.rrls.option.ignoreScreen": "Игнорирование неинициализированного экрана при загрузке",
"text.autoconfig.rrls.option.ignoreScreen.@Tooltip": "МОЖЕТ ВЫЗВАТЬ ПРОБЛЕМЫ",
"text.autoconfig.rrls.option.miniRender": "Отображение мини(скрытой)-версии оверлея",
"text.autoconfig.rrls.option.enableScissor": "Обрезать рендеринг стандартного оверлея",
"text.autoconfig.rrls.option.enableScissor.@Tooltip": "Включите эту опцию, если окно заливается цветом (в основном черным)",
Expand All @@ -24,8 +22,6 @@
"text.autoconfig.rrls.option.animationSpeed": "Скорость анимации сплеша",
"text.autoconfig.rrls.option.animationSpeed.@Tooltip": "В милисекундах",
"text.autoconfig.rrls.option.doubleLoad": "Повторная загрузка ресурсов при возникновении ошибки",
"text.autoconfig.rrls.option.forceClose": "Убирать оверлей, даже если за ним ничего нет",
"text.autoconfig.rrls.option.forceClose.@Tooltip": "На самом деле теперь есть, я давно планировал обходной путь, но теперь он есть в minecraft :)",
"text.autoconfig.rrls.option.blockOverlay": "Полная блокировка использований оверлеев",
"text.autoconfig.rrls.option.blockOverlay.@Tooltip": "Используйте на свой страх и риск!",
"text.autoconfig.rrls.option.skipForgeOverlay": "Заменяет оверлей загрузки (Neo)Forge на ванильный"
Expand Down
2 changes: 0 additions & 2 deletions common/src/main/resources/assets/rrls/lang/tt_ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
"text.autoconfig.rrls.option.hideType": "Яңадан йөкләү экранын яшерү",
"text.autoconfig.rrls.option.rgbProgress": "Төсле прогрессбар",
"text.autoconfig.rrls.option.rgbProgress.@Tooltip": "§cЭПИЛЕПСИЯНЕ ЧАКЫРА АЛА",
"text.autoconfig.rrls.option.ignoreScreen": "Йөкләү экранын яшерү",
"text.autoconfig.rrls.option.ignoreScreen.@Tooltip": "ПРОБЛЕМАЛАРНЫ ЧАКЫРА АЛА",
"text.autoconfig.rrls.option.miniRender": "Ресурслар яңадан йөкләү процессын күрсәтү",
"text.autoconfig.rrls.option.type": "Яңадан йөкләгәндә күрсәтелүче",
"text.autoconfig.rrls.option.reloadText": "Күрсәтеләчәҡ текст, әгәр TEXT өстә сайланса",
Expand Down
2 changes: 0 additions & 2 deletions common/src/main/resources/assets/rrls/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"text.autoconfig.rrls.option.hideType": "隐藏重新加载屏幕",
"text.autoconfig.rrls.option.rgbProgress": "彩色进度条",
"text.autoconfig.rrls.option.rgbProgress.@Tooltip": "§c可能引起癫痫",
"text.autoconfig.rrls.option.ignoreScreen": "隐藏加载屏幕",
"text.autoconfig.rrls.option.ignoreScreen.@Tooltip": "可能会引起问题",
"text.autoconfig.rrls.option.miniRender": "资源包重新加载过程显示",
"text.autoconfig.rrls.option.resetResources": "加载失败时重置资源包",
"text.autoconfig.rrls.option.reInitScreen": "重新加载后重新初始化当前屏幕",
Expand Down
4 changes: 0 additions & 4 deletions common/src/main/resources/assets/rrls/lang/zh_tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
"text.autoconfig.rrls.option.hideType": "將被隱藏的覆蓋層",
"text.autoconfig.rrls.option.rgbProgress": "彩色進度條",
"text.autoconfig.rrls.option.rgbProgress.@Tooltip": "§c可能會引起癲癇",
"text.autoconfig.rrls.option.ignoreScreen": "隱藏載入畫面",
"text.autoconfig.rrls.option.ignoreScreen.@Tooltip": "可能會引起問題",
"text.autoconfig.rrls.option.miniRender": "資源包(重新)載入進度顯示",
"text.autoconfig.rrls.option.enableScissor": "修剪默認疊加層的渲染效果",
"text.autoconfig.rrls.option.enableScissor.@Tooltip": "如果窗口被顏色淹沒(大部分為黑色),則啟用此功能",
Expand All @@ -25,8 +23,6 @@
"text.autoconfig.rrls.option.animationSpeed": "載入動畫速度",
"text.autoconfig.rrls.option.animationSpeed.@Tooltip": "以毫秒為單位",
"text.autoconfig.rrls.option.doubleLoad": "如果發生錯誤,請重新載入資源",
"text.autoconfig.rrls.option.forceClose": "隱藏載入覆蓋,即使背後沒有東西",
"text.autoconfig.rrls.option.forceClose.@Tooltip": "實際上現在是有的,我已經計畫了很長一段時間的解決方案,但現在在 Minecraft 中已經有一個 :)",
"text.autoconfig.rrls.option.blockOverlay": "完全阻斷覆蓋層的使用",
"text.autoconfig.rrls.option.blockOverlay.@Tooltip": "使用風險自負!",
"text.autoconfig.rrls.option.skipForgeOverlay": "用原版替代 (Neo)Forge 載入覆蓋"
Expand Down
2 changes: 1 addition & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:${rootProject.loader_version}"
// modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"

modApi "com.terraformersmc:modmenu:${rootProject.modmenu_version}"
modCompileOnlyApi "com.terraformersmc:modmenu:${rootProject.modmenu_version}"

modApi("me.shedaniel.cloth:cloth-config-fabric:${rootProject.cloth_config_version}") {
exclude(group: "net.fabricmc.fabric-api")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ public class ConfigExpectPlatformImpl implements ConfigData {
@ConfigEntry.Gui.Tooltip
public boolean rgbProgress = false;

@ConfigEntry.Category("global")
@ConfigEntry.Gui.Tooltip
public boolean forceClose = false;

@ConfigEntry.Category("global")
@ConfigEntry.Gui.Tooltip
public boolean blockOverlay = false;
Expand Down Expand Up @@ -82,10 +78,6 @@ public static boolean rgbProgress() {
return RrlsFabric.MOD_CONFIG.rgbProgress;
}

public static boolean forceClose() {
return RrlsFabric.MOD_CONFIG.forceClose;
}

public static boolean blockOverlay() {
return RrlsFabric.MOD_CONFIG.blockOverlay;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,26 @@

package org.redlance.dima_dencep.mods.rrls.neoforge;

import net.neoforged.fml.config.ConfigTracker;
import org.redlance.dima_dencep.mods.rrls.config.DoubleLoad;
import org.redlance.dima_dencep.mods.rrls.config.HideType;
import org.redlance.dima_dencep.mods.rrls.config.Type;
import org.redlance.dima_dencep.mods.rrls.Rrls;
import net.neoforged.fml.ModContainer;
import net.neoforged.fml.ModList;
import net.neoforged.fml.config.ConfigFileTypeHandler;
import net.neoforged.fml.config.ModConfig;
import net.neoforged.fml.loading.FMLPaths;
import net.neoforged.neoforge.common.ModConfigSpec;
import org.apache.commons.lang3.tuple.Pair;

import java.util.Optional;

@SuppressWarnings("unused")
@SuppressWarnings({"unused","UnstableApiUsage"})
public class ConfigExpectPlatformImpl { // TODO categorize
public static final Pair<ConfigExpectPlatformImpl, ModConfigSpec> CONFIG_SPEC_PAIR = new ModConfigSpec.Builder()
.configure(ConfigExpectPlatformImpl::new);
public final ModConfigSpec.EnumValue<HideType> hideType;
public final ModConfigSpec.BooleanValue rgbProgress;
public final ModConfigSpec.BooleanValue forceClose;
public final ModConfigSpec.BooleanValue blockOverlay;
public final ModConfigSpec.BooleanValue miniRender;
public final ModConfigSpec.BooleanValue enableScissor;
Expand All @@ -54,11 +53,6 @@ public ConfigExpectPlatformImpl(ModConfigSpec.Builder builder) {
.comment("text.autoconfig.rrls.option.rgbProgress.@Tooltip")
.define("rgbProgress", false);

forceClose = builder
.translation("text.autoconfig.rrls.option.forceClose")
.comment("text.autoconfig.rrls.option.forceClose.@Tooltip")
.define("forceClose", false);

blockOverlay = builder
.translation("text.autoconfig.rrls.option.blockOverlay")
.comment("text.autoconfig.rrls.option.blockOverlay.@Tooltip")
Expand Down Expand Up @@ -136,11 +130,7 @@ public String getModId() {

if (!configSpec.isLoaded()) { // Fallback
Rrls.LOGGER.warn("Config is not loaded?");

configSpec.acceptConfig(
ConfigFileTypeHandler.TOML.reader(FMLPaths.CONFIGDIR.get())
.apply(modConfig)
);
ConfigTracker.INSTANCE.openConfig(modConfig, FMLPaths.CONFIGDIR.get(), null);
}
}

Expand All @@ -152,10 +142,6 @@ public static boolean rgbProgress() {
return ConfigExpectPlatformImpl.CONFIG_SPEC_PAIR.getKey().rgbProgress.get();
}

public static boolean forceClose() {
return ConfigExpectPlatformImpl.CONFIG_SPEC_PAIR.getKey().forceClose.get();
}

public static boolean blockOverlay() {
return ConfigExpectPlatformImpl.CONFIG_SPEC_PAIR.getKey().blockOverlay.get();
}
Expand Down
2 changes: 1 addition & 1 deletion forge/src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ modId = "rrls"
version = "${project.version}"
displayURL = "https://curseforge.com/minecraft/mc-mods/rrls"
displayName = "Remove Reloading Screen"
# updateJSONURL = "https://api.modrinth.com/updates/rrls/forge_updates.json"
updateJSONURL = "https://api.modrinth.com/updates/rrls/forge_updates.json?neoforge=include"
authors = "dima_dencep"
credits = "ne4t0gg, nneewwtt, Madis0, notlin, oldveseliyschoolnik, GodGun968, TheBossMagnus, LostLuma, FITFC, Gazmanovich, TheLegendofSaram, thesh1xx, yichifauzi"
description = "Makes resource packs load in the background, allowing you to do other things while waiting!"
Expand Down
Loading

0 comments on commit 376a9c1

Please sign in to comment.