Skip to content

Commit

Permalink
fix sign coloring
Browse files Browse the repository at this point in the history
  • Loading branch information
Brokkonaut committed Jul 28, 2022
1 parent 693989a commit 45f337c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
24 changes: 24 additions & 0 deletions src/main/java/com/Acrobot/Breeze/Utils/BlockUtil.java
Expand Up @@ -20,6 +20,7 @@ public class BlockUtil {
private static EnumSet<Material> SIGNS = EnumSet.noneOf(Material.class);
private static EnumSet<Material> SHULKER_BOXES = EnumSet.noneOf(Material.class);
private static EnumSet<Material> CONTAINERS = EnumSet.noneOf(Material.class);
private static EnumSet<Material> SIGN_EDIT_MATERIALS = EnumSet.noneOf(Material.class);
static {
SIGNS.add(Material.ACACIA_SIGN);
SIGNS.add(Material.ACACIA_WALL_SIGN);
Expand Down Expand Up @@ -62,6 +63,25 @@ public class BlockUtil {
CONTAINERS.add(Material.TRAPPED_CHEST);
CONTAINERS.add(Material.BARREL);
CONTAINERS.addAll(SHULKER_BOXES);

SIGN_EDIT_MATERIALS.add(Material.INK_SAC);
SIGN_EDIT_MATERIALS.add(Material.GLOW_INK_SAC);
SIGN_EDIT_MATERIALS.add(Material.BLACK_DYE);
SIGN_EDIT_MATERIALS.add(Material.BLUE_DYE);
SIGN_EDIT_MATERIALS.add(Material.BROWN_DYE);
SIGN_EDIT_MATERIALS.add(Material.CYAN_DYE);
SIGN_EDIT_MATERIALS.add(Material.GRAY_DYE);
SIGN_EDIT_MATERIALS.add(Material.GREEN_DYE);
SIGN_EDIT_MATERIALS.add(Material.LIGHT_BLUE_DYE);
SIGN_EDIT_MATERIALS.add(Material.LIGHT_GRAY_DYE);
SIGN_EDIT_MATERIALS.add(Material.LIME_DYE);
SIGN_EDIT_MATERIALS.add(Material.MAGENTA_DYE);
SIGN_EDIT_MATERIALS.add(Material.ORANGE_DYE);
SIGN_EDIT_MATERIALS.add(Material.PINK_DYE);
SIGN_EDIT_MATERIALS.add(Material.PURPLE_DYE);
SIGN_EDIT_MATERIALS.add(Material.RED_DYE);
SIGN_EDIT_MATERIALS.add(Material.WHITE_DYE);
SIGN_EDIT_MATERIALS.add(Material.YELLOW_DYE);
}

/**
Expand Down Expand Up @@ -149,4 +169,8 @@ public static boolean openBlockGUI(InventoryHolder holder, Player player) {

return true;
}

public static boolean isSignEditMaterial(Material m) {
return SIGN_EDIT_MATERIALS.contains(m);
}
}
Expand Up @@ -93,7 +93,11 @@ public static void onInteract(PlayerInteractEvent event) {
return;
}

if (ChestShopSign.canAccess(player, sign) && (!Properties.ALLOW_OWN_SHOP_TRANSACTIONS || player.isSneaking())) {
boolean ownShop = ChestShopSign.canAccess(player, sign);
if (ownShop && action == RIGHT_CLICK_BLOCK && event.getItem() != null && BlockUtil.isSignEditMaterial(event.getItem().getType())) {
return;
}
if (ownShop && (!Properties.ALLOW_OWN_SHOP_TRANSACTIONS || player.isSneaking())) {
if (!Properties.ALLOW_SIGN_CHEST_OPEN || player.isSneaking() || player.isInsideVehicle() || player.getGameMode() == GameMode.CREATIVE) {
return;
}
Expand Down

0 comments on commit 45f337c

Please sign in to comment.