Fix CustomizeGuiOverlayEvent.DebugText and CustomizeGuiOverlayEvent.Chat not being fired. (#9982)

This commit is contained in:
Mysticdrew authored and GitHub committed 2024-05-24 08:33:52 -07:00
1 parent fd8a0f9c8b
commit c2c7f9b656
5 files changed
+96 -13

No files matched your search

@@ -15,6 +15,7 @@ import net.minecraftforge.fml.LogicalSide;
import org.jetbrains.annotations.ApiStatus;
import java.util.ArrayList;
import java.util.List;
/**
* Fired when an overlay is about to be rendered to the screen to allow the user to modify it.
@@ -133,31 +134,46 @@ public abstract class CustomizeGuiOverlayEvent extends Event
*/
public static class DebugText extends CustomizeGuiOverlayEvent
{
private final ArrayList<String> left;
private final ArrayList<String> right;
private final List<String> text;
private final Side side;
@ApiStatus.Internal
public DebugText(Window window, GuiGraphics guiGraphics, float partialTick, ArrayList<String> left, ArrayList<String> right)
public DebugText(Window window, GuiGraphics guiGraphics, float partialTick, List<String> text, Side side)
{
super(window, guiGraphics, partialTick);
this.left = left;
this.right = right;
this.text = text;
this.side = side;
}
/**
* @return the modifiable list of text to render on the left side
* @return the modifiable list of text to render on the side
*/
public ArrayList<String> getLeft()
public List<String> getText()
{
return left;
return this.text;
}
@Deprecated(forRemoval = true, since = "1.20.6")
public List<String> getLeft() {
return Side.Left.equals(this.side) ? this.text : new ArrayList<>();
}
@Deprecated(forRemoval = true, since = "1.20.6")
public List<String> getRight() {
return Side.Right.equals(this.side) ? this.text : new ArrayList<>();
}
/**
* @return the modifiable list of text to render on the right side
* @return the side of the text getting rendered.
*/
public ArrayList<String> getRight()
{
return right;
public Side getSide() {
return this.side;
}
public enum Side {
Left,
Right
}
}