Skip to content

Commit

Permalink
Slightly refactor MoGlassTestClient
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Jan 24, 2025
1 parent 6b64d88 commit 2f297e1
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/main/java/net/wurstclient/glass/test/MoGlassTestClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ private void testItemNamesShowUpCorrectly()
assertItemName("Glass Slab", new ItemStack(MoGlassBlocks.GLASS_SLAB));
assertItemName("Glass Stairs",
new ItemStack(MoGlassBlocks.GLASS_STAIRS));

assertItemName("Tinted Glass Slab",
new ItemStack(MoGlassBlocks.TINTED_GLASS_SLAB));
assertItemName("Tinted Glass Stairs",
Expand All @@ -167,6 +168,13 @@ private void testItemNamesShowUpCorrectly()
}
}

private void assertItemName(String expected, ItemStack stack)
{
if(!expected.equals(I18n.translate(stack.getName().getString())))
throw new RuntimeException("Wrong item name: Expected <" + expected
+ "> but got <" + stack.getName() + ">");
}

private void testRecipesWork()
{
// normal glass
Expand Down Expand Up @@ -271,13 +279,6 @@ private void assertStonecuttingRecipe(ItemStack input,
results.stream().map(ItemStack::toString).toList()));
}

private void assertItemName(String expected, ItemStack stack)
{
if(!expected.equals(I18n.translate(stack.getName().getString())))
throw new RuntimeException("Wrong item name: Expected <" + expected
+ "> but got <" + stack.getName() + ">");
}

// As of 1.21.4, vanilla Minecraft doesn't seem to have a method like this.
private Block getStainedGlassBlock(DyeColor color)
{
Expand Down

0 comments on commit 2f297e1

Please sign in to comment.