Skip to content

Commit

Permalink
Changed the version to 1.0.1. Fixed an error when the plugin is
Browse files Browse the repository at this point in the history
disabled while a player has an inventory opened.
  • Loading branch information
MinusKube committed Jun 25, 2017
1 parent 82c1089 commit 048693f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
6 changes: 5 additions & 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.0'
version '1.0.1'

apply plugin: 'java'

Expand All @@ -22,4 +22,8 @@ repositories {

dependencies {
provided 'org.spigotmc:spigot-api:1.11.2-R0.1-SNAPSHOT'
}

jar {
archiveName = 'SmartInvs-' + project.version + '.jar'
}
5 changes: 4 additions & 1 deletion src/main/java/fr/minuskube/inv/InventoryManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ public Optional<SmartInventory> getInventory(Player p) {
}

protected void setInventory(Player p, SmartInventory inv) {
this.inventories.put(p, inv);
if(inv == null)
this.inventories.remove(p);
else
this.inventories.put(p, inv);
}

public Optional<InventoryContents> getContents(Player p) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/fr/minuskube/inv/SmartInventory.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ public void close(Player player) {
.forEach(listener -> ((InventoryListener<InventoryCloseEvent>) listener)
.accept(new InventoryCloseEvent(player.getOpenInventory())));

player.closeInventory();

manager.setInventory(player, null);
manager.setContents(player, null);

player.closeInventory();
}

public String getId() { return id; }
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.0
version: 1.0.1
description: Inventory API for your Bukkit Plugins.
author: MinusKube
website: https://github.com/MinusKube/SmartInvs
Expand Down

0 comments on commit 048693f

Please sign in to comment.