use of io.github.thebusybiscuit.slimefun4.implementation.Slimefun in project Slimefun4 by Slimefun.
the class SlimefunSubCommands method getAllCommands.
@Nonnull
public static Collection<SubCommand> getAllCommands(@Nonnull SlimefunCommand cmd) {
Slimefun plugin = cmd.getPlugin();
List<SubCommand> commands = new LinkedList<>();
commands.add(new HelpCommand(plugin, cmd));
commands.add(new VersionsCommand(plugin, cmd));
commands.add(new CheatCommand(plugin, cmd));
commands.add(new GuideCommand(plugin, cmd));
commands.add(new GiveCommand(plugin, cmd));
commands.add(new ResearchCommand(plugin, cmd));
commands.add(new StatsCommand(plugin, cmd));
commands.add(new TimingsCommand(plugin, cmd));
commands.add(new TeleporterCommand(plugin, cmd));
commands.add(new OpenGuideCommand(plugin, cmd));
commands.add(new SearchCommand(plugin, cmd));
commands.add(new DebugFishCommand(plugin, cmd));
commands.add(new BackpackCommand(plugin, cmd));
commands.add(new ChargeCommand(plugin, cmd));
commands.add(new DebugCommand(plugin, cmd));
return commands;
}
use of io.github.thebusybiscuit.slimefun4.implementation.Slimefun in project Slimefun4 by Slimefun.
the class TestIronGolemListener method testWithSlimefunIron.
@Test
@DisplayName("Test Iron Golem Healing with Slimefun Items being cancelled")
void testWithSlimefunIron() {
SlimefunItem slimefunItem = TestUtilities.mockSlimefunItem(plugin, "SLIMEFUN_IRON", new CustomItemStack(Material.IRON_INGOT, "&cSlimefun Iron"));
slimefunItem.register(plugin);
// The Event should be cancelled, we do not wanna use Slimefun Items for this
PlayerInteractEntityEvent event = callIronGolemEvent(EquipmentSlot.HAND, slimefunItem.getItem());
Assertions.assertTrue(event.isCancelled());
PlayerInteractEntityEvent event2 = callIronGolemEvent(EquipmentSlot.OFF_HAND, slimefunItem.getItem());
Assertions.assertTrue(event2.isCancelled());
}
use of io.github.thebusybiscuit.slimefun4.implementation.Slimefun in project Slimefun4 by Slimefun.
the class TestTapeMeasure method registerSlimefunItem.
@Override
public TapeMeasure registerSlimefunItem(Slimefun plugin, String id) {
SlimefunItemStack item = new SlimefunItemStack(id, Material.PLAYER_HEAD, "&5Test Pick", id);
TapeMeasure tapeMeasure = new TapeMeasure(TestUtilities.getItemGroup(plugin, "tape_measure"), item, RecipeType.NULL, new ItemStack[9]);
tapeMeasure.register(plugin);
return tapeMeasure;
}
use of io.github.thebusybiscuit.slimefun4.implementation.Slimefun in project Slimefun4 by Slimefun.
the class TestCauldronListener method testCauldronWithSlimefunLeatherArmor.
@Test
@DisplayName("Test Cauldron being cancelled with slimefun leather armor")
void testCauldronWithSlimefunLeatherArmor() {
SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "CAULDRON_TEST_MOCK_LEATHER", new CustomItemStack(Material.LEATHER_BOOTS, "&6Mock Leather Armor"));
item.register(plugin);
PlayerInteractEvent event = mockCauldronEvent(item.getItem());
Assertions.assertEquals(Result.DENY, event.useItemInHand());
}
use of io.github.thebusybiscuit.slimefun4.implementation.Slimefun in project Slimefun4 by Slimefun.
the class TestSlimefunItem method testWikiPages.
@Test
@DisplayName("Test wiki pages getting assigned correctly")
void testWikiPages() {
SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "WIKI_ITEM", new CustomItemStack(Material.BOOK, "&cTest"));
item.register(plugin);
Assertions.assertFalse(item.getWikipage().isPresent());
// null should not be a valid argument
Assertions.assertThrows(IllegalArgumentException.class, () -> item.addOfficialWikipage(null));
item.addOfficialWikipage("Test");
Optional<String> wiki = item.getWikipage();
Assertions.assertTrue(wiki.isPresent());
Assertions.assertEquals("https://github.com/Slimefun/Slimefun4/wiki/Test", wiki.get());
}
Aggregations