修复jei回来后,样板供应器的倍增按钮消失问题
This commit is contained in:
parent
94e069a2b6
commit
bbf78096a7
|
|
@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx1G
|
||||||
loom.platform = forge
|
loom.platform = forge
|
||||||
|
|
||||||
# Mod properties
|
# Mod properties
|
||||||
mod_version = 1.3.2-fix1
|
mod_version = 1.3.3
|
||||||
maven_group = com.extendedae_plus
|
maven_group = com.extendedae_plus
|
||||||
archives_name = extendedae_plus
|
archives_name = extendedae_plus
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,8 +66,8 @@ public abstract class PatternProviderScreenMixin<C extends PatternProviderMenu>
|
||||||
boolean enabled = eap$AdvancedBlockingEnabled;
|
boolean enabled = eap$AdvancedBlockingEnabled;
|
||||||
var title = net.minecraft.network.chat.Component.literal("智能阻挡");
|
var title = net.minecraft.network.chat.Component.literal("智能阻挡");
|
||||||
var line = enabled
|
var line = enabled
|
||||||
? net.minecraft.network.chat.Component.literal("已启用:YES")
|
? net.minecraft.network.chat.Component.literal("已启用:对于同一种配方将不再阻挡")
|
||||||
: net.minecraft.network.chat.Component.literal("已禁用:NO");
|
: net.minecraft.network.chat.Component.literal("已禁用:这么好的功能为什么不打开呢");
|
||||||
return java.util.List.of(title, line);
|
return java.util.List.of(title, line);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -273,6 +273,29 @@ public abstract class GuiExPatternProviderMixin extends PatternProviderScreen<Co
|
||||||
this.x5Button.setVisibility(true);
|
this.x5Button.setVisibility(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 若从 JEI 配方界面返回后,Screen 的 renderables/children 可能被清空,导致按钮丢失
|
||||||
|
// 这里在每帧保证这些按钮存在于渲染列表中(不存在则重新注册)
|
||||||
|
try {
|
||||||
|
if (this.divideBy2Button != null && !this.renderables.contains(this.divideBy2Button)) {
|
||||||
|
this.addRenderableWidget(this.divideBy2Button);
|
||||||
|
}
|
||||||
|
if (this.x2Button != null && !this.renderables.contains(this.x2Button)) {
|
||||||
|
this.addRenderableWidget(this.x2Button);
|
||||||
|
}
|
||||||
|
if (this.divideBy5Button != null && !this.renderables.contains(this.divideBy5Button)) {
|
||||||
|
this.addRenderableWidget(this.divideBy5Button);
|
||||||
|
}
|
||||||
|
if (this.x5Button != null && !this.renderables.contains(this.x5Button)) {
|
||||||
|
this.addRenderableWidget(this.x5Button);
|
||||||
|
}
|
||||||
|
if (this.divideBy10Button != null && !this.renderables.contains(this.divideBy10Button)) {
|
||||||
|
this.addRenderableWidget(this.divideBy10Button);
|
||||||
|
}
|
||||||
|
if (this.x10Button != null && !this.renderables.contains(this.x10Button)) {
|
||||||
|
this.addRenderableWidget(this.x10Button);
|
||||||
|
}
|
||||||
|
} catch (Throwable ignored) {}
|
||||||
|
|
||||||
// 如果屏幕尺寸发生变化(窗口/GUI缩放),重新注册右侧外列的自定义按钮,翻页按钮由左侧工具栏托管
|
// 如果屏幕尺寸发生变化(窗口/GUI缩放),重新注册右侧外列的自定义按钮,翻页按钮由左侧工具栏托管
|
||||||
if (this.width != eap$lastScreenWidth || this.height != eap$lastScreenHeight) {
|
if (this.width != eap$lastScreenWidth || this.height != eap$lastScreenHeight) {
|
||||||
eap$lastScreenWidth = this.width;
|
eap$lastScreenWidth = this.width;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user