### Adding Frame Dependency Gradle Groovy Source: https://github.com/infumia/frame/blob/master/README.md Configures the Gradle build file to include the 'frame' and 'frame-core' dependencies. It adds necessary repositories and specifies the dependencies using 'implementation' and 'runtimeOnly' configurations. Requires a Gradle project setup. ```Groovy repositories { mavenCentral() maven("https://central.sonatype.com/repository/maven-snapshots/") } dependencies { // Base modules implementation "net.infumia:frame:VERSION" runtimeOnly "net.infumia:frame-core:VERSION" } ``` -------------------------------- ### Initializing Frame and Defining ViewHandler Java Source: https://github.com/infumia/frame/blob/master/README.md Provides example Java code for a Spigot/Bukkit plugin integrating the 'frame' library. It includes the main Plugin class showing how to create and register a Frame instance and a ViewHandler implementation demonstrating how to configure inventory views, handle layouts, item rendering, and click events. Requires a Spigot/Bukkit plugin environment and the 'frame' library dependencies. ```Java public final class Plugin extends JavaPlugin { public static final TypedKey CONSOLE_KEY = TypedKey.of(CommandSender.class, "console"); private final Frame frame = Frame.create(this) .with(ViewExample.class); @Override public void onEnable() { /*this.frame.register();*/ this.frame.register(builder -> builder.add(Plugin.CONSOLE_KEY, Bukkit.getConsoleSender())); } } public final class ViewExample implements ViewHandler { @Override public void onInit(@NotNull final ContextInit ctx) { ctx.configBuilder().type(InvType.CHEST).cancelOnClick(); } @Override public void onOpen(@NotNull final ContextOpen ctx) { final Viewer viewer = ctx.viewer(); ctx .modifyConfig() .layout(new String[] { "xxxxxxxxx", "xxxxaxxxx", "xxxxxxxxx" }) .title("Player: " + viewer.player().getName()); } @Override public void onFirstRender(@NotNull final ContextRender ctx) { final CommandSender sender = ctx.instances().getOrThrow(Plugin.CONSOLE_KEY); ctx.layoutSlot('x', new ItemStack(Material.GRAY_STAINED_GLASS_PANE)); ctx .layoutSlot('a', new ItemStack(Material.DIAMOND)) .cancelOnClick() .onClick(context -> { context.closeForViewer(); sender.sendMessage("Player " + context.clicker().player() + " clicked to a diamond!"); }); } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.