mirror of
https://github.com/songoda/UltimateStacker.git
synced 2024-12-25 18:07:43 +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>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>3.4.1</version>
|
<version>3.5.3</version>
|
||||||
|
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
@ -108,8 +108,8 @@ public class BlockListeners implements Listener {
|
|||||||
//Remove all items from stack
|
//Remove all items from stack
|
||||||
int amountToRemove = Math.min(Settings.MAX_REMOVEABLE.getInt(), stack.getAmount());
|
int amountToRemove = Math.min(Settings.MAX_REMOVEABLE.getInt(), stack.getAmount());
|
||||||
ItemStack removed = stack.getMaterial().parseItem();
|
ItemStack removed = stack.getMaterial().parseItem();
|
||||||
removed.setAmount(amountToRemove);
|
removed.setAmount(amountToRemove-1);
|
||||||
stack.take(amountToRemove);
|
stack.take(amountToRemove-1);
|
||||||
if (Settings.ADD_TO_INVENTORY.getBoolean()) {
|
if (Settings.ADD_TO_INVENTORY.getBoolean()) {
|
||||||
player.getInventory().addItem(removed);
|
player.getInventory().addItem(removed);
|
||||||
} else {
|
} else {
|
||||||
@ -124,7 +124,7 @@ public class BlockListeners implements Listener {
|
|||||||
player.getWorld().dropItemNaturally(block.getLocation(), stack.getMaterial().parseItem());
|
player.getWorld().dropItemNaturally(block.getLocation(), stack.getMaterial().parseItem());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (stack.getAmount() == 1) {
|
if (stack.getAmount() <= 1) {
|
||||||
//Remove stack
|
//Remove stack
|
||||||
stack.destroy();
|
stack.destroy();
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user