Fix calls to getSize() on display link peripheral failing when the peripheral is newly loaded (#7059)

This commit is contained in:
Ginger 2025-01-13 09:41:57 -05:00 committed by GitHub
parent be026ece02
commit 0f9ba22aa2
Failed to generate hash of commit

View file

@ -36,6 +36,7 @@ public class DisplayLinkPeripheral extends SyncedPeripheral<DisplayLinkBlockEnti
@LuaFunction(mainThread = true)
public final Object[] getSize() {
blockEntity.updateGatheredData();
DisplayTargetStats stats = blockEntity.activeTarget.provideStats(new DisplayLinkContext(blockEntity.getLevel(), blockEntity));
return new Object[]{stats.maxRows(), stats.maxColumns()};
}