Skip to content

Commit

Permalink
Optimize TintedGlassLightBlockingTest
Browse files Browse the repository at this point in the history
Now only needs 175 commands instead of 259.
  • Loading branch information
Alexander01998 committed Jan 27, 2025
1 parent cbfd52e commit c0a92a2
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ public static void testTintedGlassBlocksLightCorrectly()
String top = "~ ~1 ~4";
String front = "~ ~ ~3";

// Build test rig
runChatCommand("fill ~-1 ~ ~3 ~1 ~1 ~5 tinted_glass");
runChatCommand("setblock ~ ~ ~4 air");

// Slab on top - should always block light
testSlab(top, "bottom", 0);
testSlab(top, "top", 0);
testSlab(top, "double", 0);

// Slab in front - should only block light if type is double
// Slab in front - depends on type
testSlab(front, "bottom", 13);
testSlab(front, "top", 13);
testSlab(front, "double", 0);
Expand Down Expand Up @@ -138,11 +142,10 @@ private static void testStairs(String position, String facing, String half,
private static void testConfiguration(String position, String block,
int expectedLightLevel)
{
runChatCommand("fill ~-1 ~ ~3 ~1 ~1 ~5 tinted_glass");
runChatCommand("setblock ~ ~ ~4 air");
runChatCommand("setblock " + position + " mo_glass:" + block);
clearChat();
assertLightLevel(0, 0, 4, expectedLightLevel);
runChatCommand("setblock " + position + " tinted_glass");
}

private static void assertLightLevel(int x, int y, int z, int expected)
Expand Down

0 comments on commit c0a92a2

Please sign in to comment.