Java Code Examples for org.bukkit.Material#LAPIS_BLOCK

The following examples show how to use org.bukkit.Material#LAPIS_BLOCK . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InfiniteEnchantsListener.java    From UhcCore with GNU General Public License v3.0 6 votes vote down vote up
@EventHandler
public void onGameStarted(UhcStartedEvent e){
    ItemStack enchantingTables = UniversalMaterial.ENCHANTING_TABLE.getStack(64);
    ItemStack anvils = new ItemStack(Material.ANVIL, 64);
    ItemStack lapisBlocks = new ItemStack(Material.LAPIS_BLOCK, 64);

    for (UhcPlayer uhcPlayer : e.getPlayersManager().getOnlinePlayingPlayers()){
        try {
            Player player = uhcPlayer.getPlayer();
            player.getInventory().addItem(enchantingTables, anvils, lapisBlocks);
            player.setLevel(Integer.MAX_VALUE);
        }catch (UhcPlayerNotOnlineException ex){
            // No rod for offline players
        }
    }
}
 
Example 2
Source File: TestMultiblockListener.java    From Slimefun4 with GNU General Public License v3.0 5 votes vote down vote up
@BeforeAll
public static void load() {
    server = MockBukkit.mock();
    TestUtilities.registerDefaultTags(server);
    plugin = MockBukkit.load(SlimefunPlugin.class);
    listener = new MultiBlockListener(plugin);
    SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MULTIBLOCK_LISTENER_TEST", new CustomItem(Material.DIAMOND, "&9Some multiblock item"));
    multiblock = new MultiBlock(item, new Material[] { null, Material.EMERALD_BLOCK, null, null, Material.DIAMOND_BLOCK, null, null, Material.LAPIS_BLOCK, null }, BlockFace.SELF);
    SlimefunPlugin.getRegistry().getMultiBlocks().add(multiblock);
}