mirror of
https://github.com/songoda/UltimateStacker.git
synced 2024-12-27 19:07:41 +01:00
Fix block stack dupe/item liss
This commit is contained in:
parent
a43230f3b1
commit
f51cc19c44
@ -86,6 +86,7 @@ public class DataManager extends DataManagerAbstract {
|
||||
}
|
||||
|
||||
public void updateBlock(BlockStack blockStack) {
|
||||
if (blockStack.getAmount() == 0) return;
|
||||
this.runAsync(() -> {
|
||||
try (Connection connection = this.databaseConnector.getConnection()) {
|
||||
String updateBlock = "UPDATE " + this.getTablePrefix() + "blocks SET amount = ? WHERE id = ?";
|
||||
|
@ -74,7 +74,7 @@ public class BlockListeners implements Listener {
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||
if (!isStacked) plugin.getDataManager().createBlock(stack);
|
||||
if (stack.getMaterial() == CompatibleMaterial.getMaterial(inHand)) {
|
||||
int amountToAdd = player.isSneaking() || Settings.ALWAYS_ADD_ALL.getBoolean() ? inHand.getAmount() : 1;
|
||||
int amountToAdd = player.isSneaking() || Settings.ALWAYS_ADD_ALL.getBoolean() ? inHand.getAmount()-1 : 1;
|
||||
if (!isStacked) amountToAdd++;
|
||||
stack.add(amountToAdd);
|
||||
event.setCancelled(true);
|
||||
|
Loading…
Reference in New Issue
Block a user