Skip to content

Commit

Permalink
Fixed Copy Inv
Browse files Browse the repository at this point in the history
  • Loading branch information
notTamion committed Aug 9, 2023
1 parent 46c95c8 commit bc085c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 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>de</groupId>
<artifactId>KeepEnchant</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
<packaging>jar</packaging>

<name>KeepEnchant</name>
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/de/tamion/listeners/InventoryListeners.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
public class InventoryListeners implements Listener {
@EventHandler
public void onInventoryClick(InventoryClickEvent e) {
Player p = (Player) e.getWhoClicked();
FileConfiguration config = KeepEnchant.getPlugin().getConfig();
Player p = (Player) e.getWhoClicked();

if(!config.contains("player." + p.getName())) {
if(!config.getBoolean("default")) {
Expand Down Expand Up @@ -59,10 +59,10 @@ public void onInventoryClick(InventoryClickEvent e) {
}
return;
}
Inventory playinv = Bukkit.createInventory(null, InventoryType.PLAYER);
playinv.setContents(p.getInventory().getContents());
Inventory playinv = Bukkit.createInventory(null, 4*9);
playinv.setContents(p.getInventory().getStorageContents());
playinv.addItem(book);
if(playinv.firstEmpty() == -1) {
if(playinv.firstEmpty() == -1 && e.isShiftClick()) {
p.getWorld().dropItem(p.getLocation(), book);
return;
}
Expand Down

0 comments on commit bc085c4

Please sign in to comment.