Skip to content

Instantly share code, notes, and snippets.

public static IntFunction<Inventory> Guide(List<Category> categories, Plugin plugin, int rows) {
final MiniWindow window = new MiniWindow(plugin);
final List<Supplier<Inventory>> pages = new ArrayList<>();
final List<List<Category>> partitions = partition(categories, rows * 9);
pages.addAll(mapWithIndex(partitions.stream(), (categoryList, index) ->
cache(() -> window.page(page -> {
//Title the page.
page.title("Page " + index);
//Add items for each category on the page.
public static IntFunction<Inventory> createGuide(List<Category> categories, Plugin plugin, int rows) {
final MiniWindow window = new MiniWindow(plugin);
final List<Supplier<Inventory>> pages = new ArrayList<>();
//Split our list up into pages.
final List<List<Category>> partitions = partition(categories, rows * 9);
//Loop over our category lists with an index.
for (int index = 0; index < partitions.size(); index++) {
package me.exerosis.testing.spigot.bungee;
import net.md_5.bungee.BungeeServerInfo;
import net.md_5.bungee.api.plugin.Plugin;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.file.Path;
import static java.nio.file.Paths.get;
package me.exerosis.testing.redis;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
public class Client {
public static void main(String[] args) throws InterruptedException {
RedissonClient redis = Redisson.create();
Main.Server server = redis.getRemoteService().get(Main.Server.class);
server.increment();
public Mutable<Map<String, Object>> loadConfig(Path config) throws IOException {
final Yaml yaml = new Yaml();
final List<Pair<Boolean, Mutable<String>>> segments = new ArrayList<>();
final StringBuilder segment = new StringBuilder();
boolean data = true;
for (String line : new String(Files.readAllBytes(config)).split("\n"))
if (!line.startsWith("#") && data)
segment.append(line).append("\n");
else {
package com.mynt.backend.discord;
import com.mynt.backend.discord.responses.Token;
import com.mynt.backend.discord.responses.User;
import io.reactivex.Maybe;
import retrofit2.http.*;
import static com.mynt.backend.discord.Strings.*;
public interface DiscordAPI {
package com.penzzly.engine.core.mini;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.world.WorldLoadEvent;
import org.bukkit.plugin.Plugin;
package com.penzzly.engine.core.mini.partial;
import com.comphenix.protocol.events.PacketContainer;
import com.penzzly.engine.architecture.base.Component;
import org.bukkit.block.Block;
import org.bukkit.util.Vector;
import static com.comphenix.protocol.PacketType.Play.Client.USE_ENTITY;
import static com.comphenix.protocol.wrappers.EnumWrappers.EntityUseAction;
import static com.penzzly.engine.core.utilites.bukkit.PacketUtil.intercept;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryOpenEvent;
import org.bukkit.inventory.Inventory;
package me.exerosis.example;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.List;