use of io.github.thebusybiscuit.slimefun4.api.items.groups.SeasonalItemGroup in project Slimefun4 by Slimefun.
the class TestItemGroups method ItemGroups.
@Test
@DisplayName("Test a seasonal ItemGroup")
void ItemGroups() {
// ItemGroup with current Month
Month month = LocalDate.now().getMonth();
SeasonalItemGroup group = new SeasonalItemGroup(new NamespacedKey(plugin, "seasonal"), month, 1, new CustomItemStack(Material.NETHER_STAR, "&cSeasonal Test"));
SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "SEASONAL_ITEM", new CustomItemStack(Material.NETHER_STAR, "&dSeasonal Test Star"));
item.setItemGroup(group);
item.register(plugin);
item.load();
Player player = server.addPlayer();
Assertions.assertEquals(month, group.getMonth());
Assertions.assertFalse(group.isHidden(player));
// ItemGroup with future Month
SeasonalItemGroup itemGroup2 = new SeasonalItemGroup(group.getKey(), month.plus(6), 1, new CustomItemStack(Material.MILK_BUCKET, "&dSeasonal Test"));
Assertions.assertTrue(itemGroup2.isHidden(player));
}
Aggregations