mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-11 12:32:05 +01:00
Fix getUnformattedDeepText breaking with translation text components, which resulted in double tooltip text
This commit is contained in:
parent
d16f41ccfb
commit
20d1403ede
1 changed files with 4 additions and 10 deletions
|
@ -29,12 +29,7 @@ import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.TieredItem;
|
import net.minecraft.item.TieredItem;
|
||||||
import net.minecraft.util.IItemProvider;
|
import net.minecraft.util.IItemProvider;
|
||||||
import net.minecraft.util.text.IFormattableTextComponent;
|
import net.minecraft.util.text.*;
|
||||||
import net.minecraft.util.text.ITextComponent;
|
|
||||||
import net.minecraft.util.text.StringTextComponent;
|
|
||||||
import net.minecraft.util.text.Style;
|
|
||||||
import net.minecraft.util.text.TextFormatting;
|
|
||||||
import net.minecraft.util.text.TextProcessing;
|
|
||||||
|
|
||||||
public class TooltipHelper {
|
public class TooltipHelper {
|
||||||
|
|
||||||
|
@ -284,11 +279,10 @@ public class TooltipHelper {
|
||||||
|
|
||||||
public static String getUnformattedDeepText(ITextComponent component) {
|
public static String getUnformattedDeepText(ITextComponent component) {
|
||||||
StringBuilder b = new StringBuilder();
|
StringBuilder b = new StringBuilder();
|
||||||
b.append(component.getString());
|
if (!(component instanceof TranslationTextComponent))
|
||||||
|
b.append(component.getString());
|
||||||
component.getSiblings()
|
component.getSiblings()
|
||||||
.forEach(c -> {
|
.forEach(c -> b.append(getUnformattedDeepText(c)));
|
||||||
b.append(getUnformattedDeepText(c));
|
|
||||||
});
|
|
||||||
return b.toString();
|
return b.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue