Skip to content

Commit

Permalink
Merge branch '1.20' into 1.20.2
Browse files Browse the repository at this point in the history
# Conflicts:
#	gradle.properties
#	src/main/java/io/wispforest/owo/mixin/text/stapi/SystemDelegatedLanguageFixin.java
  • Loading branch information
gliscowo committed Oct 2, 2023
2 parents a2c842d + deff18c commit fb02f3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/java/io/wispforest/owo/itemgroup/OwoItemGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ public void initialize() {
if (!this.tabs.get(tabIdx).primary()) continue;
this.activeTabs.add(tabIdx);
}

if (this.activeTabs.isEmpty()) this.activeTabs.add(0);
} else {
this.activeTabs.add(0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.wispforest.owo.text.TextLanguage;
import net.minecraft.text.Text;
import net.minecraft.util.Language;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
import org.spongepowered.asm.mixin.Shadow;
Expand All @@ -12,15 +13,17 @@
@Pseudo
@Mixin(SystemDelegatedLanguage.class)
public abstract class SystemDelegatedLanguageFixin implements TextLanguage {
@Final
@Shadow private Language vanilla;

@Shadow
protected abstract ServerLanguage getSystemLanguage();

@Override
public Text getText(String key) {
if (!(vanilla instanceof TextLanguage lang) || this.getSystemLanguage().serverTranslations().contains(key))
if (!(vanilla instanceof TextLanguage lang) || this.getSystemLanguage().serverTranslations().contains(key)) {
return null;
}

return lang.getText(key);
}
Expand Down

0 comments on commit fb02f3b

Please sign in to comment.