-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize switching operations within Inventory.
- Loading branch information
1 parent
18c0dee
commit c9e7189
Showing
2 changed files
with
81 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/kotlin/me/huanmeng/opensource/bukkit/gui/event/InventorySwitchEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package me.huanmeng.opensource.bukkit.gui.event; | ||
|
||
import org.bukkit.event.inventory.ClickType; | ||
import org.bukkit.event.inventory.InventoryAction; | ||
import org.bukkit.event.inventory.InventoryClickEvent; | ||
import org.bukkit.event.inventory.InventoryType; | ||
import org.bukkit.inventory.InventoryView; | ||
|
||
/** | ||
* 2023/3/17<br> | ||
* Gui<br> | ||
* | ||
* @author huanmeng_qwq | ||
*/ | ||
public class InventorySwitchEvent extends InventoryClickEvent { | ||
private boolean disable; | ||
|
||
public InventorySwitchEvent(InventoryView view, InventoryType.SlotType type, int slot, ClickType click, InventoryAction action) { | ||
super(view, type, slot, click, action); | ||
} | ||
|
||
public InventorySwitchEvent(InventoryView view, InventoryType.SlotType type, int slot, ClickType click, InventoryAction action, int key) { | ||
super(view, type, slot, click, action, key); | ||
} | ||
|
||
public boolean disable() { | ||
return disable; | ||
} | ||
|
||
public InventorySwitchEvent disable(boolean disable) { | ||
this.disable = disable; | ||
return this; | ||
} | ||
} |