import com.irtimaled.bbor.Versions;
import com.irtimaled.bbor.client.interop.ClientInterop;
-import net.minecraft.client.gui.IGuiEventListener;
+import net.minecraft.client.gui.Element;
import net.minecraft.client.gui.screen.Screen;
-import net.minecraft.client.resources.I18n;
-import net.minecraft.util.text.StringTextComponent;
+import net.minecraft.client.resource.language.I18n;
+import net.minecraft.text.LiteralText;
public abstract class ListScreen extends Screen {
private final Screen lastScreen;
private SearchField searchField;
ListScreen(Screen lastScreen) {
- super(new StringTextComponent("Bounding Box Outline Reloaded"));
+ super(new LiteralText("Bounding Box Outline Reloaded"));
this.lastScreen = lastScreen;
}
protected void init() {
this.controlList = this.buildList(48, this.height - 28);
this.searchField = new SearchField(this.font, this.width / 2 - 100, 22, 200, 20, this.controlList);
- this.doneButton = new AbstractButton(this.width / 2 - 100, this.height - 24, 200, I18n.format("gui.done")) {
+ this.doneButton = new AbstractButton(this.width / 2 - 100, this.height - 24, 200, I18n.translate("gui.done")) {
@Override
public void onPressed() {
onDoneClicked();
protected void render(int mouseX, int mouseY) {
this.controlList.render(mouseX, mouseY);
- this.drawCenteredString(this.font, this.title.getUnformattedComponentText(), this.width / 2, 8, 16777215);
+ this.drawCenteredString(this.font, this.title.asString(), this.width / 2, 8, 16777215);
this.searchField.render(mouseX, mouseY);
this.doneButton.render(mouseX, mouseY);
@Override
public boolean mouseClicked(double mouseX, double mouseY, int button) {
- for (IGuiEventListener control : this.children()) {
+ for (Element control : this.children()) {
if (control.mouseClicked(mouseX, mouseY, button)) {
- IGuiEventListener focused = getFocused();
+ Element focused = getFocused();
if (focused instanceof IFocusableControl && focused != control) {
((IFocusableControl) focused).clearFocus();
}