mirror of
https://github.com/songoda/UltimateStacker.git
synced 2024-12-25 01:47:37 +01:00
[Fixed] Duplication glitch fixed while breaking stacked blocks while sneaking.
This commit is contained in:
parent
37de2676a6
commit
8f1333945d
@ -16,7 +16,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.4.1</version>
|
||||
<version>3.5.3</version>
|
||||
|
||||
<executions>
|
||||
<execution>
|
||||
|
@ -108,8 +108,8 @@ public class BlockListeners implements Listener {
|
||||
//Remove all items from stack
|
||||
int amountToRemove = Math.min(Settings.MAX_REMOVEABLE.getInt(), stack.getAmount());
|
||||
ItemStack removed = stack.getMaterial().parseItem();
|
||||
removed.setAmount(amountToRemove);
|
||||
stack.take(amountToRemove);
|
||||
removed.setAmount(amountToRemove-1);
|
||||
stack.take(amountToRemove-1);
|
||||
if (Settings.ADD_TO_INVENTORY.getBoolean()) {
|
||||
player.getInventory().addItem(removed);
|
||||
} else {
|
||||
@ -124,7 +124,7 @@ public class BlockListeners implements Listener {
|
||||
player.getWorld().dropItemNaturally(block.getLocation(), stack.getMaterial().parseItem());
|
||||
}
|
||||
}
|
||||
if (stack.getAmount() == 1) {
|
||||
if (stack.getAmount() <= 1) {
|
||||
//Remove stack
|
||||
stack.destroy();
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user