Skip to content

Commit bf18e9d

Browse files
authored
Don't try to resize widget tree on server (#132)
1 parent 28dc73d commit bf18e9d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/com/cleanroommc/modularui/widget/WidgetTree.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.cleanroommc.modularui.api.widget.IGuiElement;
99
import com.cleanroommc.modularui.api.widget.ISynced;
1010
import com.cleanroommc.modularui.api.widget.IWidget;
11+
import com.cleanroommc.modularui.network.NetworkUtils;
1112
import com.cleanroommc.modularui.screen.ModularPanel;
1213
import com.cleanroommc.modularui.screen.viewport.ModularGuiContext;
1314
import com.cleanroommc.modularui.theme.WidgetTheme;
@@ -231,6 +232,7 @@ public static void onUpdate(IWidget parent) {
231232
}
232233

233234
public static void resize(IWidget parent) {
235+
if (!NetworkUtils.isClient()) return;
234236
// TODO check if widget has a parent which depends on its children
235237
// resize each widget and calculate their relative pos
236238
if (!resizeWidget(parent, true) && !resizeWidget(parent, false)) {

0 commit comments

Comments
 (0)