mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-16 13:11:40 +01:00
Stop the whole click process if the event is canceled
This commit is contained in:
parent
097dcf0f6c
commit
c03a2992ef
@ -293,6 +293,8 @@ public abstract class Chunk implements Viewable, DataContainer {
|
||||
|
||||
/**
|
||||
* Gets if this chunk will or had been loaded with a {@link ChunkGenerator}.
|
||||
* <p>
|
||||
* If false, the chunk will be entirely empty when loaded.
|
||||
*
|
||||
* @return true if this chunk is affected by a {@link ChunkGenerator}
|
||||
*/
|
||||
|
@ -66,7 +66,7 @@ public class MinestomBasicChunkLoader implements IChunkLoader {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean loadChunk(@NotNull Instance instance, int chunkX, int chunkZ, ChunkCallback callback) {
|
||||
public boolean loadChunk(@NotNull Instance instance, int chunkX, int chunkZ, @Nullable ChunkCallback callback) {
|
||||
final StorageLocation storageLocation = instanceContainer.getStorageLocation();
|
||||
final byte[] bytes = storageLocation == null ? null : storageLocation.get(getChunkKey(chunkX, chunkZ));
|
||||
|
||||
|
@ -199,7 +199,7 @@ public class InventoryClickProcessor {
|
||||
|
||||
clickResult = startCondition(clickResult, inventory, player, index, ClickType.SHIFT_CLICK, item, cursor);
|
||||
if (clickResult.isCancel())
|
||||
continue;
|
||||
break;
|
||||
|
||||
final int amount = itemRule.getAmount(item);
|
||||
if (!clickedRule.canApply(clicked, amount + 1))
|
||||
@ -230,7 +230,7 @@ public class InventoryClickProcessor {
|
||||
|
||||
clickResult = startCondition(clickResult, inventory, player, index, ClickType.SHIFT_CLICK, item, cursor);
|
||||
if (clickResult.isCancel())
|
||||
continue;
|
||||
break;
|
||||
|
||||
// Switch
|
||||
itemSetter.accept(index, resultClicked);
|
||||
@ -283,7 +283,7 @@ public class InventoryClickProcessor {
|
||||
|
||||
clickResult = startCondition(clickResult, inventory, player, s, ClickType.DRAGGING, slotItem, cursor);
|
||||
if (clickResult.isCancel())
|
||||
continue;
|
||||
break;
|
||||
|
||||
final int maxSize = stackingRule.getMaxSize();
|
||||
if (stackingRule.canBeStacked(draggedItem, slotItem)) {
|
||||
@ -323,7 +323,7 @@ public class InventoryClickProcessor {
|
||||
|
||||
clickResult = startCondition(clickResult, inventory, player, s, ClickType.DRAGGING, slotItem, cursor);
|
||||
if (clickResult.isCancel())
|
||||
continue;
|
||||
break;
|
||||
|
||||
if (stackingRule.canBeStacked(draggedItem, slotItem)) {
|
||||
final int amount = slotItem.getAmount() + 1;
|
||||
@ -399,7 +399,7 @@ public class InventoryClickProcessor {
|
||||
if (cursorRule.canBeStacked(cursor, item)) {
|
||||
clickResult = startCondition(clickResult, inventory, player, index, ClickType.DOUBLE_CLICK, item, cursor);
|
||||
if (clickResult.isCancel())
|
||||
continue;
|
||||
break;
|
||||
|
||||
final int totalAmount = amount + cursorRule.getAmount(item);
|
||||
if (!cursorRule.canApply(cursor, totalAmount)) {
|
||||
|
Loading…
Reference in New Issue
Block a user