Convert to maven
This commit is contained in:
8
.gitignore
vendored
Normal file
8
.gitignore
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
### IntelliJ specific files
|
||||
|
||||
*.iml
|
||||
.idea/
|
||||
|
||||
### Maven
|
||||
|
||||
target/
|
||||
42
pom.xml
Normal file
42
pom.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.redstoner</groupId>
|
||||
<artifactId>ChestAPI</artifactId>
|
||||
<version>0.1</version>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<!--Spigot API-->
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.12.2-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!--Bukkit API-->
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.12.2-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -1,9 +1,5 @@
|
||||
package de.pepich.chestapi;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@@ -16,6 +12,8 @@ import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class ClickableInventory implements Listener
|
||||
{
|
||||
private int open = 0;
|
||||
@@ -32,7 +30,7 @@ public class ClickableInventory implements Listener
|
||||
/** Creates a new ClickableInventory with the given name.</br>
|
||||
* The ClickableInventory will be created with a DefaultSize as specified by {@link DefaultSize#DYNAMIC_AUTO(int, int) DYNAMIC_AUTO(9, 54)}.
|
||||
*
|
||||
* @param name The name to be displayed. */
|
||||
* @param title The name to be displayed. */
|
||||
public ClickableInventory(final String title)
|
||||
{
|
||||
this(title, DefaultSize.DYNAMIC_AUTO(9, 54));
|
||||
@@ -40,7 +38,7 @@ public class ClickableInventory implements Listener
|
||||
|
||||
/** Creates a new ClickableInventory with the given name and the specified DefaultSize.
|
||||
*
|
||||
* @param name The name to be displayed.
|
||||
* @param title The name to be displayed.
|
||||
* @param size The DefaultSize for the inventory to be used. */
|
||||
public ClickableInventory(final String title, final DefaultSize size)
|
||||
{
|
||||
@@ -135,7 +133,7 @@ public class ClickableInventory implements Listener
|
||||
* @param item An ItemStack that will be displayed. Set to null if you want to assign functionality to an empty slot.
|
||||
* @param handler A CallbackHandler which will be notified on click. When the handler is null then the handler will be removed, but the item will still be assigned.
|
||||
* @throws IllegalArgumentException when the location does not exist or when one of -1 or 0 are specified and the inventory is already full. */
|
||||
public void set(int slot, @Nullable final ItemStack item, @Nullable final CallbackHandler handler)
|
||||
public void set(int slot, final ItemStack item, final CallbackHandler handler)
|
||||
{
|
||||
if (slot > inventory.getSize())
|
||||
resize(slot);
|
||||
Reference in New Issue
Block a user