Skip to content

Commit

Permalink
Update javadoc, bump to v0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Loki committed Jan 22, 2018
1 parent 102ded4 commit 86c71b5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.codehusky</groupId>
<artifactId>HuskyUI</artifactId>
<version>0.5.0</version>
<version>0.5.1</version>

<repositories>
<repository>
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/com/codehusky/huskyui/ElementRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<br>
* 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);
Expand Down
15 changes: 14 additions & 1 deletion src/main/java/com/codehusky/huskyui/HuskyUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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()){
Expand All @@ -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<Integer> potentialID = registry.getElementIDFromItemStack(event.getItemStackInUse().createStack());
Expand All @@ -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){

Expand Down

0 comments on commit 86c71b5

Please sign in to comment.