This commit is contained in:
SeanOMik 2022-02-01 22:57:02 -05:00
parent 834935ec9d
commit 098d1e26b2
3 changed files with 18 additions and 2 deletions

View File

@ -4,7 +4,7 @@
<groupId>net.seanomik</groupId>
<artifactId>energeticstorage</artifactId>
<name>EnergeticStorage</name>
<version>0.7.5-SNAPSHOT</version>
<version>0.7.6-SNAPSHOT</version>
<build>
<defaultGoal>clean package</defaultGoal>
<resources>

View File

@ -6,7 +6,7 @@
<groupId>net.seanomik</groupId>
<artifactId>energeticstorage</artifactId>
<version>0.7.5-SNAPSHOT</version>
<version>0.7.6-SNAPSHOT</version>
<packaging>jar</packaging>
<name>EnergeticStorage</name>

View File

@ -383,6 +383,22 @@ public class ESTerminalGUI implements InventoryHolder, Listener {
openSystem.setSortOrder(sortOrder);
initializeItems(player, openSystem);
} else {
// Check if the player is clicking the glass panes, if they are then cancel the event.
if (clickedItem != null && clickedItem.hasItemMeta()) {
ItemMeta meta = clickedItem.getItemMeta();
if (meta.hasDisplayName()) {
String display = meta.getDisplayName();
if ( (display.isEmpty() || display.startsWith("To insert items, put them ")) &&
(clickedItem.getType() == Material.BLACK_STAINED_GLASS_PANE || clickedItem.getType() == Material.LIME_STAINED_GLASS_PANE) ) {
event.setCancelled(true);
return;
}
}
}
switch (clickType) {
case SHIFT_IN:
if (Utils.isItemValid(clickedItem)) {