mirror of
https://github.com/songoda/UltimateStacker.git
synced 2024-11-23 10:35:22 +01:00
Fix Block stacks giving one less block when destroyed
This commit is contained in:
parent
93aa9a7532
commit
a43230f3b1
@ -55,6 +55,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -109,9 +109,15 @@ public class BlockListeners implements Listener {
|
||||
}
|
||||
}
|
||||
stack.add(amountToRemove);
|
||||
if (stack.getAmount() < 2)
|
||||
if (stack.getAmount() < 2) {
|
||||
stack.destroy();
|
||||
else {
|
||||
ItemStack item = stack.getMaterial().getItem();
|
||||
if (Settings.ADD_TO_INVENTORY.getBoolean()) {
|
||||
player.getInventory().addItem(item);
|
||||
} else {
|
||||
block.getWorld().dropItemNaturally(block.getLocation().clone().add(.5, 1, .5), item);
|
||||
}
|
||||
} else {
|
||||
plugin.updateHologram(stack);
|
||||
plugin.getDataManager().updateBlock(stack);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user