Skip to content

Commit

Permalink
Change version to 1.1.0, add property method with default
Browse files Browse the repository at this point in the history
  • Loading branch information
MinusKube committed Jun 27, 2017
1 parent 58ee0d0 commit 65f0528
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .idea/modules/smart-invs.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/modules/smart-invs_main.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/modules/smart-invs_test.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'fr.minuskube.inv'
version '1.0.1'
version '1.1.0'

apply plugin: 'java'
apply plugin: 'maven'
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/fr/minuskube/inv/content/InventoryContents.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ InventoryContents fillRect(int fromRow, int fromColumn,
int toRow, int toColumn, ClickableItem item);

<T> T property(String name);
<T> T property(String name, T def);

InventoryContents setProperty(String name, Object value);

class Impl implements InventoryContents {
Expand Down Expand Up @@ -152,6 +154,12 @@ public <T> T property(String name) {
return (T) properties.get(name);
}

@SuppressWarnings("unchecked")
@Override
public <T> T property(String name, T def) {
return properties.containsKey(name) ? (T) properties.get(name) : def;
}

@Override
public InventoryContents setProperty(String name, Object value) {
properties.put(name, value);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: SmartInvs
version: 1.0.1
version: 1.1.0
description: Inventory API for your Bukkit Plugins.
author: MinusKube
website: https://github.com/MinusKube/SmartInvs
Expand Down

0 comments on commit 65f0528

Please sign in to comment.