mirror of
https://github.com/GTNewHorizons/ThaumicTinkerer.git
synced 2026-10-26 14:33:48 +00:00
Fixed TT changes page text while loading ModTweaker scripts.
This commit is contained in:
1 parent
4c9d2a00ab
commit
dd943e80a9
2 files changed
+12
-3
No files matched your search
+1
-1
@@ -1,4 +1,4 @@
|
||||
version=2.5
|
||||
build_number=556-GTNH
|
||||
build_number=557-GTNH
|
||||
mc_version=1.7.10
|
||||
mod_name=ThaumicTinkerer
|
||||
@@ -30,7 +30,14 @@ import thaumic.tinkerer.common.lib.LibResearch;
|
||||
public class TTResearchItem extends ResearchItem implements IRegisterableResearch {
|
||||
|
||||
public int warp = 0;
|
||||
|
||||
/**
|
||||
* When ModTweaker scripts replace ThaumicTinkerer pages, it call {@link #setPages(ResearchPage...)}
|
||||
* and if one of provided pages is text page,
|
||||
* Thaumic Tinkerer will generate its own {@link ResearchPage#text} adding prefixes to the existing one that breaks localization.
|
||||
* <p>
|
||||
* So this variable will prevent Thaumic Tinkerer from changing page's text that came from MineTweaker scripts.
|
||||
*/
|
||||
private boolean firstLoad = true;
|
||||
|
||||
public TTResearchItem(String par1) {
|
||||
super(par1, LibResearch.CATEGORY_THAUMICTINKERER);
|
||||
@@ -68,8 +75,9 @@ public class TTResearchItem extends ResearchItem implements IRegisterableResearc
|
||||
@Override
|
||||
public ResearchItem setPages(ResearchPage... par) {
|
||||
for (ResearchPage page : par) {
|
||||
if (page.type == PageType.TEXT)
|
||||
if (page.type == PageType.TEXT && firstLoad) {
|
||||
page.text = "ttresearch.page." + key + "." + page.text;
|
||||
}
|
||||
|
||||
if (checkInfusion() && page.type == PageType.INFUSION_CRAFTING) {
|
||||
if (parentsHidden == null || parentsHidden.length == 0)
|
||||
@@ -85,6 +93,7 @@ public class TTResearchItem extends ResearchItem implements IRegisterableResearc
|
||||
}
|
||||
}
|
||||
|
||||
firstLoad = false;
|
||||
return super.setPages(par);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user