Skip to content

Commit 4ada1fb

Browse files
committed
fix
1 parent 2773d6d commit 4ada1fb

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

src/main/java/com/cleanroommc/modularui/factory/PlayerInventoryGuiFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public void openFromHand(EntityPlayer player, EnumHand hand) {
3030
}
3131

3232
public void openFromBaubles(EntityPlayer player, int index) {
33-
if (!ModularUI.isBaubleLoaded()) {
33+
if (!ModularUI.Mods.BAUBLES.isLoaded()) {
3434
throw new IllegalArgumentException("Can't open UI for baubles item when bauble is not loaded!");
3535
}
3636
GuiManager.open(
@@ -53,7 +53,7 @@ public void openFromHandClient(EnumHand hand) {
5353

5454
@SideOnly(Side.CLIENT)
5555
public void openFromBaublesClient(int index) {
56-
if (!ModularUI.isBaubleLoaded()) {
56+
if (!ModularUI.Mods.BAUBLES.isLoaded()) {
5757
throw new IllegalArgumentException("Can't open UI for baubles item when bauble is not loaded!");
5858
}
5959
GuiManager.openFromClient(

src/main/java/com/cleanroommc/modularui/screen/RichTooltip.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ private static void findIngredientArea(Area area, int x, int y) {
379379
}
380380
}
381381
}
382-
if (ModularUI.isJeiLoaded()) {
382+
if (ModularUI.Mods.JEI.isLoaded()) {
383383
IShowsRecipeFocuses overlay = (IShowsRecipeFocuses) ModularUIJeiPlugin.getRuntime().getIngredientListOverlay();
384384
IClickedIngredient<?> ingredient = overlay.getIngredientUnderMouse(x, y);
385385
if (ingredient == null || ingredient.getArea() == null) {

src/test/java/com/cleanroommc/modularui/SizerTest.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
import com.cleanroommc.modularui.widget.sizer.Area;
88
import com.cleanroommc.modularui.widgets.ButtonWidget;
99

10+
import org.junit.jupiter.api.AssertionFailureBuilder;
1011
import org.junit.jupiter.api.Test;
1112

1213
import static org.junit.jupiter.api.Assertions.assertEquals;
14+
import static org.junit.jupiter.api.Assertions.assertTrue;
1315

1416
public class SizerTest {
1517

@@ -33,7 +35,13 @@ ModularPanel panel() {
3335

3436
void assertArea(Area area, int x, int y, int w, int h) {
3537
Area.SHARED.set(x, y, w, h);
36-
assertEquals(Area.SHARED, area);
38+
if (!isAreaSame(Area.SHARED, area)) {
39+
AssertionFailureBuilder.assertionFailure()
40+
.message(null)
41+
.actual(area)
42+
.expected(Area.SHARED)
43+
.buildAndThrow();
44+
}
3745
}
3846

3947
ModularScreen testPanel(ModularPanel panel) {
@@ -44,4 +52,8 @@ ModularScreen testPanel(ModularPanel panel) {
4452
screen.onResize(W, H);
4553
return screen;
4654
}
55+
56+
boolean isAreaSame(Area a, Area b) {
57+
return a.x == b.x && a.y == b.y && a.width == b.width && a.height == b.height;
58+
}
4759
}

0 commit comments

Comments
 (0)