Skip to content

Commit

Permalink
v1.4.0
Browse files Browse the repository at this point in the history
Includes v1.3.14
  • Loading branch information
MrButtersDEV committed Dec 22, 2022
1 parent c1cdc90 commit b7c24ff
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 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>us.thezircon.play</groupId>
<artifactId>AutoPickup</artifactId>
<version>1.3.14-SNAPSHOT</version>
<version>1.4.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>AutoPickup</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public void run() {
}
}

e.setDropItems(false); // Cancel drops
//e.setDropItems(false); // Cancel drops

if (((Container) block.getState()).getInventory() instanceof DoubleChestInventory) {
Chest chest = (Chest) block.getState();
Expand Down Expand Up @@ -255,18 +255,18 @@ public void run() {
}
}

ItemStack drop = new ItemStack(e.getBlock().getType());
// if (player.getInventory().firstEmpty()!=-1) {
// player.getInventory().add---Item(drop);
// } else {
// player.getWorld().dropItemNaturally(loc, drop);
// }
HashMap<Integer, ItemStack> leftOver = player.getInventory().addItem(drop);
if (leftOver.keySet().size()>0) {
for (ItemStack item : leftOver.values()) {
player.getWorld().dropItemNaturally(loc, item);
}
}
// ItemStack drop = new ItemStack(e.getBlock().getType());
// HashMap<Integer, ItemStack> leftOver = player.getInventory().addItem(drop);
// if (leftOver.keySet().size()>0) {
// for (ItemStack item : leftOver.values()) {
// player.getWorld().dropItemNaturally(loc, item);
// }
// }

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ public void onDrop(BlockDropItemEvent e) {
return;
}

if (block.getState() instanceof Container) {
return; // Containers are handled in block break event
}
// if (block.getState() instanceof Container) {
// return; // Containers are handled in block break event
// }

if (PLUGIN.autopickup_list.contains(player)) { // Player has auto enabled
for (Entity en : e.getItems()) {
for (Item i : e.getItems()) {

if (en==null || en.isDead() || !en.isValid()) {
continue; // TEST
}
// if (i==null || i.isDead() || !i.isValid()) {
// System.out.println("RAR " + i.getItemStack().getType() + " " + (i==null) + " "+ (i.isDead()) + " " + (!i.isValid()));
// continue; // TEST
// }

Item i = (Item) en;
ItemStack drop = i.getItemStack();

if (player.getInventory().firstEmpty() == -1) { // Checks for inventory space
Expand Down
2 changes: 1 addition & 1 deletion target/classes/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: AutoPickup
version: 1.3.14-SNAPSHOT
version: 1.4.0-SNAPSHOT
main: us.thezircon.play.autopickup.AutoPickup
prefix: AutoPickup
authors: [BUTTERFIELD8]
Expand Down

0 comments on commit b7c24ff

Please sign in to comment.