Skip to content

Commit

Permalink
configurable shop info on sneak click
Browse files Browse the repository at this point in the history
  • Loading branch information
Brokkonaut committed Jul 14, 2022
1 parent bec0d7d commit 27e7a5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Expand Up @@ -35,6 +35,9 @@ public class Properties {
@ConfigurationComment("If true, when you left-click your own shop sign you won't open chest's inventory, but instead you will start destroying the sign.")
public static boolean ALLOW_LEFT_CLICK_DESTROYING = true;

@ConfigurationComment("Shop shop content when sneak clicking a shop sign?")
public static boolean ALLOW_SHOP_INFO_ON_SNEAK_CLICK = true;

@PrecededBySpace
@ConfigurationComment("If true, if the shop is empty, the sign is destroyed and put into the chest, so the shop isn't usable anymore.")
public static boolean REMOVE_EMPTY_SHOPS = false;
Expand Down
Expand Up @@ -86,7 +86,7 @@ public static void onInteract(PlayerInteractEvent event) {
return;
}

if (event.getPlayer().isSneaking()) {
if (event.getPlayer().isSneaking() && Properties.ALLOW_SHOP_INFO_ON_SNEAK_CLICK) {
if ((action == LEFT_CLICK_BLOCK || action == RIGHT_CLICK_BLOCK) && event.getHand() == EquipmentSlot.HAND) {
showShopInfo(player, sign);
}
Expand Down

0 comments on commit 27e7a5f

Please sign in to comment.