Skip to content

Commit 7c896cc

Browse files
committed
Prevent Shift + Click from placing items inside the menu
1 parent 4027f09 commit 7c896cc

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
allprojects {
22
group = 'com.focamacho'
3-
version = '1.0.6'
3+
version = '1.0.7'
44
}
55

66
subprojects {

sealmenus-bukkit/src/main/java/com/focamacho/sealmenus/bukkit/ChestMenu.java

+3
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,9 @@ public void onClick(InventoryClickEvent ce) {
332332
// Prevent inventory double clicks from stealing items from the menu
333333
if(ce.getClick() == ClickType.DOUBLE_CLICK) ce.setCancelled(true);
334334

335+
// Prevent Shift + Click from placing items inside the menu
336+
if(ce.getClick() == ClickType.SHIFT_LEFT || ce.getClick() == ClickType.SHIFT_RIGHT) ce.setCancelled(true);
337+
335338
int slot = ce.getSlot();
336339
if (slot < 9 * chestMenu.getRows()) {
337340
ce.setCancelled(true);

sealmenus-sponge/src/main/java/com/focamacho/sealmenus/sponge/ChestMenu.java

+3
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ public void update() {
201201
// Prevent dragging items from placing items inside the menu
202202
if(ce instanceof ClickInventoryEvent.Drag) ce.setCancelled(true);
203203

204+
// Prevent Shift + Click from placing items inside the menu
205+
if(ce instanceof ClickInventoryEvent.Shift) ce.setCancelled(true);
206+
204207
// Prevent weird things from happening when sponge do not send the slot in the event
205208
if(!ce.getSlot().isPresent()) {
206209
ce.setCancelled(true);

0 commit comments

Comments
 (0)