use of io.github.thebusybiscuit.slimefun4.implementation.Slimefun in project Slimefun4 by Slimefun.
the class TestCauldronListener method testCauldronWithVanillaLeatherArmor.
@Test
@DisplayName("Test Cauldron working as normal with vanilla slimefun leather armor")
void testCauldronWithVanillaLeatherArmor() {
VanillaItem item = TestUtilities.mockVanillaItem(plugin, Material.LEATHER_CHESTPLATE, true);
item.register(plugin);
PlayerInteractEvent event = mockCauldronEvent(item.getItem());
Assertions.assertEquals(Result.DEFAULT, event.useItemInHand());
}
use of io.github.thebusybiscuit.slimefun4.implementation.Slimefun in project Slimefun4 by Slimefun.
the class TestCoolerListener method load.
@BeforeAll
public static void load() {
server = MockBukkit.mock();
Slimefun plugin = MockBukkit.load(Slimefun.class);
ItemGroup itemGroup = new ItemGroup(new NamespacedKey(plugin, "cooler_test"), new CustomItemStack(Material.SNOWBALL, "Mr. Freeze"));
SlimefunItemStack item = new SlimefunItemStack("TEST_COOLER", Material.SNOWBALL, "&6Test Cooler", "", "&7ID: <ID>");
cooler = new Cooler(18, itemGroup, item, RecipeType.NULL, new ItemStack[9]);
cooler.register(plugin);
SlimefunItemStack juiceItem = new SlimefunItemStack("TEST_JUICE", Color.RED, new PotionEffect(PotionEffectType.HEALTH_BOOST, 6, 0), "&4Test Juice");
juice = new Juice(itemGroup, juiceItem, RecipeType.NULL, new ItemStack[9]);
juice.register(plugin);
listener = new CoolerListener(plugin, cooler);
}
use of io.github.thebusybiscuit.slimefun4.implementation.Slimefun in project Slimefun4 by Slimefun.
the class TestArmorTask method testSlimefunArmor.
@Test
@DisplayName("Test Slimefun Armor Effects")
void testSlimefunArmor() throws InterruptedException {
Player player = server.addPlayer();
TestUtilities.awaitProfile(player);
// Setting the time to noon, to exclude the Solar Helmet check
player.getWorld().setTime(16000);
PotionEffect[] effects = { new PotionEffect(PotionEffectType.SPEED, 50, 3), new PotionEffect(PotionEffectType.SATURATION, 128, 12) };
SlimefunItemStack helmet = new SlimefunItemStack("HELMET_FLEX", Material.IRON_HELMET, "&bSuper cool Helmet");
SlimefunArmorPiece armor = new SlimefunArmorPiece(TestUtilities.getItemGroup(plugin, "armor_test"), helmet, RecipeType.NULL, new ItemStack[9], effects);
armor.register(plugin);
player.getInventory().setHelmet(helmet.clone());
player.getInventory().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
new ArmorTask(false).run();
// Check if all Potion Effects were applied
Assertions.assertTrue(player.getActivePotionEffects().containsAll(Arrays.asList(effects)));
}
use of io.github.thebusybiscuit.slimefun4.implementation.Slimefun in project Slimefun4 by Slimefun.
the class TestEnderBackpack method registerSlimefunItem.
@Override
public EnderBackpack registerSlimefunItem(Slimefun plugin, String id) {
SlimefunItemStack item = new SlimefunItemStack(id, Material.ENDER_CHEST, "&5Test Ender Backpack");
EnderBackpack backpack = new EnderBackpack(TestUtilities.getItemGroup(plugin, "ender_backpack"), item, RecipeType.NULL, new ItemStack[9]);
backpack.register(plugin);
return backpack;
}
use of io.github.thebusybiscuit.slimefun4.implementation.Slimefun in project Slimefun4 by Slimefun.
the class TestDietCookie method registerSlimefunItem.
@Override
public DietCookie registerSlimefunItem(Slimefun plugin, String id) {
SlimefunItemStack item = new SlimefunItemStack(id, Material.COOKIE, "&5Test Cookie");
DietCookie cookie = new DietCookie(TestUtilities.getItemGroup(plugin, "diet_cookie"), item, RecipeType.NULL, new ItemStack[9]);
cookie.register(plugin);
return cookie;
}
Aggregations