Compiles again.

This commit is contained in:
Sebastian Hartte
2020-07-27 23:50:28 +02:00
parent 56ecda5173
commit 84e6aaa122
136 changed files with 1004 additions and 1108 deletions
@@ -23,6 +23,8 @@ import java.util.regex.Pattern;
import appeng.api.config.ActionItems;
import appeng.core.localization.ButtonToolTips;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
public class ActionButton extends IconButton implements ITooltip {
private static final Pattern PATTERN_NEW_LINE = Pattern.compile("\\n", Pattern.LITERAL);
@@ -76,9 +78,9 @@ public class ActionButton extends IconButton implements ITooltip {
return iconIndex;
}
private String buildMessage(ButtonToolTips displayName, ButtonToolTips displayValue) {
String name = displayName.getTranslationKey().getString();
String value = displayValue.getTranslationKey().getString();
private ITextComponent buildMessage(ButtonToolTips displayName, ButtonToolTips displayValue) {
String name = displayName.text().getString();
String value = displayValue.text().getString();
value = PATTERN_NEW_LINE.matcher(value).replaceAll("\n");
final StringBuilder sb = new StringBuilder(value);
@@ -91,7 +93,7 @@ public class ActionButton extends IconButton implements ITooltip {
sb.replace(i, i + 1, "\n");
}
return name + '\n' + sb;
return new StringTextComponent(name + '\n' + sb);
}
}
@@ -89,7 +89,7 @@ public class ProgressBar extends Widget implements ITooltip {
return result.deepCopy().func_240702_b_("\n").func_240702_b_(this.source.getCurrentProgress() + " ")
.func_230529_a_(
GuiText.Of.textComponent().deepCopy().func_240702_b_(" " + this.source.getMaxProgress()));
GuiText.Of.text().deepCopy().func_240702_b_(" " + this.source.getMaxProgress()));
}
@Override
@@ -48,6 +48,7 @@ import appeng.api.config.ViewItems;
import appeng.api.config.YesNo;
import appeng.core.localization.ButtonToolTips;
import appeng.util.EnumCycler;
import net.minecraft.util.text.StringTextComponent;
public class SettingToggleButton<T extends Enum<T>> extends IconButton {
private static final Pattern COMPILE = Pattern.compile("%s");
@@ -236,7 +237,7 @@ public class SettingToggleButton<T extends Enum<T>> extends IconButton {
private static void registerApp(final int iconIndex, final Settings setting, final Enum<?> val,
final ButtonToolTips title, final ITextComponent hint) {
final ButtonAppearance a = new ButtonAppearance();
a.displayName = title.getTranslationKey();
a.displayName = title.text();
a.displayValue = hint;
a.index = iconIndex;
appearances.put(new EnumPair(setting, val), a);
@@ -244,7 +245,7 @@ public class SettingToggleButton<T extends Enum<T>> extends IconButton {
private static void registerApp(final int iconIndex, final Settings setting, final Enum<?> val,
final ButtonToolTips title, final ButtonToolTips hint) {
registerApp(iconIndex, setting, val, title, hint.getTranslationKey());
registerApp(iconIndex, setting, val, title, hint.text());
}
@Override
@@ -278,7 +279,7 @@ public class SettingToggleButton<T extends Enum<T>> extends IconButton {
}
@Override
public String getMessage() {
public ITextComponent getMessage() {
ITextComponent displayName = null;
ITextComponent displayValue = null;
@@ -286,7 +287,7 @@ public class SettingToggleButton<T extends Enum<T>> extends IconButton {
final ButtonAppearance buttonAppearance = appearances
.get(new EnumPair(this.buttonSetting, this.currentValue));
if (buttonAppearance == null) {
return "No Such Message";
return new StringTextComponent("No Such Message");
}
displayName = buttonAppearance.displayName;
@@ -312,9 +313,9 @@ public class SettingToggleButton<T extends Enum<T>> extends IconButton {
sb.replace(i, i + 1, "\n");
}
return name + '\n' + sb;
return new StringTextComponent(name + '\n' + sb);
}
return "";
return StringTextComponent.EMPTY;
}
public String getFillVar() {