From 86c71b5abbb834effae750167773d02ead412712 Mon Sep 17 00:00:00 2001 From: Loki Date: Mon, 22 Jan 2018 01:37:22 -0600 Subject: [PATCH] Update javadoc, bump to v0.5.1 --- pom.xml | 2 +- .../com/codehusky/huskyui/ElementRegistry.java | 13 +++++++++++++ src/main/java/com/codehusky/huskyui/HuskyUI.java | 15 ++++++++++++++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 28fb3fe..bd8b8a7 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.codehusky HuskyUI - 0.5.0 + 0.5.1 diff --git a/src/main/java/com/codehusky/huskyui/ElementRegistry.java b/src/main/java/com/codehusky/huskyui/ElementRegistry.java index c46f76d..2905475 100644 --- a/src/main/java/com/codehusky/huskyui/ElementRegistry.java +++ b/src/main/java/com/codehusky/huskyui/ElementRegistry.java @@ -200,11 +200,24 @@ public boolean elementExists(int id){ return elements.containsKey(id); } + /** + * Check to see if an element at a given id is auto-inv + * + * @param id element id + * @return if element is auto-inv + */ public boolean isElementAuto(int id){ if(!elements.containsKey(id)) throw new RuntimeException("Cannot check if element is auto: Element id \"" + id + "\" is not registered."); return autoInvElements.contains(id); } + /** + * Check to see if an element is in a fixed position
+ * Accessing this with a non-auto-inv item will throw a runtime exception. + * + * @param id element id + * @return if element is fixed position + */ public boolean isElementFixedAuto(int id){ if(!isElementAuto(id)) throw new RuntimeException("Cannot check if element is fixed auto: Element \"" + id + "\"is not auto."); return autoInvLocations.values().contains(id); diff --git a/src/main/java/com/codehusky/huskyui/HuskyUI.java b/src/main/java/com/codehusky/huskyui/HuskyUI.java index bded617..3d7ad41 100644 --- a/src/main/java/com/codehusky/huskyui/HuskyUI.java +++ b/src/main/java/com/codehusky/huskyui/HuskyUI.java @@ -82,7 +82,7 @@ public class HuskyUI { /** * The Version of HuskyUI for Sponge. */ - public static final String PLUGIN_VERSION = "0.5.0"; + public static final String PLUGIN_VERSION = "0.5.1"; /** * The HuskyUI {@link Logger} used throughout the plugin. @@ -274,6 +274,11 @@ public void onElementInteract(InteractItemEvent event){ } } + + /** + * Handle item drops + * @param event dispense event + */ @Listener public void onItemDrop(DropItemEvent.Dispense event){ for(Entity e :event.getEntities()){ @@ -290,6 +295,10 @@ public void onItemDrop(DropItemEvent.Dispense event){ } } + /** + * Handle item usage + * @param event useitemstackevent.start + */ @Listener public void onItemUse(UseItemStackEvent.Start event){ Optional potentialID = registry.getElementIDFromItemStack(event.getItemStackInUse().createStack()); @@ -300,6 +309,10 @@ public void onItemUse(UseItemStackEvent.Start event){ } } + /** + * Handle inventory clicks + * @param event clickinvevent + */ @Listener(order = Order.PRE) public void onItemClick(ClickInventoryEvent event){