Skip to content

Commit

Permalink
fix new facade config list and update defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
Lothrazar committed Nov 9, 2024
1 parent ec839a4 commit ad1a91b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions examples/config/cyclic.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
traveler = true
#Radius per level. size around player to perform growth logic
#Range: 1 ~ 16
growthRadius = 2
growthRadius = 6
#Set false to disable enchantment
reach = true
#Set false to disable enchantment
Expand Down Expand Up @@ -154,8 +154,8 @@

[cyclic.blocks.facades]
#
# These blocks are not allowed to be used as Facades for blocks because they look weird (used by cables and Glowstone Facade and Soundproofing Facade and others)
itemsNotAllowed = ["minecraft:ladder", "minecraft:double_plant", "minecraft:waterlily", "minecraft:torch", "minecraft:*_torch", "minecraft:redstone", "minecraft:iron_bars", "minecraft:chest", "minecraft:ender_chest", "minecraft:sculk_vein", "minecraft:string", "minecraft:vine", "minecraft:rail", "minecraft:*_rail", "minecraft:brewing_stand", "minecraft:*_dripleaf", "minecraft:*_pane", "minecraft:*_sapling", "minecraft:*_sign", "minecraft:*_door", "minecraft:*_banner", "minecraft:*_shulker_box", "cyclic:*_pipe", "cyclic:*_bars", "storagenetwork:*"]
# These blocks are not allowed to be used as Facades for blocks because they look weird (used by cables and Glowstone Facade and Soundproofing Facade and others). If you want to ignore one entire mod use an entry like this : storagenetwork:*
itemsNotAllowed = ["minecraft:double_plant", "minecraft:waterlily", "minecraft:torch", "minecraft:*_torch", "minecraft:redstone", "minecraft:iron_bars", "minecraft:chest", "minecraft:ender_chest", "minecraft:sculk_vein", "minecraft:string", "minecraft:vine", "minecraft:brewing_stand", "minecraft:*_dripleaf", "minecraft:*_pane", "minecraft:*_sapling", "minecraft:*_sign", "minecraft:*_door", "minecraft:*_banner", "minecraft:*_shulker_box", "storagenetwork:*"]

[cyclic.blocks.facades.cables]
#
Expand Down
18 changes: 10 additions & 8 deletions src/main/java/com/lothrazar/cyclic/config/ConfigRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -414,21 +414,18 @@ private static void initConfig() {
CABLE_FACADES = CFG.comment("\r\n Allow cables to have blocks placed in them as facades (sneak-left-click to set; use empty hand to remove). Set to false to disable facades")
.define("cables.enabled", true);
//a few default
List<String> list = Arrays.asList("minecraft:ladder", "minecraft:double_plant", "minecraft:waterlily",
List<String> list = Arrays.asList("minecraft:double_plant", "minecraft:waterlily",
"minecraft:torch", "minecraft:*_torch", "minecraft:redstone", "minecraft:iron_bars",
"minecraft:chest", "minecraft:ender_chest", "minecraft:sculk_vein", "minecraft:string", "minecraft:vine",
"minecraft:rail",
"minecraft:*_rail",
"minecraft:brewing_stand",
"minecraft:*_dripleaf",
"minecraft:*_pane",
"minecraft:*_sapling", "minecraft:*_sign",
"minecraft:*_door",
"minecraft:*_banner", "minecraft:*_shulker_box",
"cyclic:*_pipe", "cyclic:*_bars",
"storagenetwork:*");
FACADE_IGNORELIST = CFG.comment("\r\n These blocks are not allowed to be used as Facades for blocks because they look weird (used by cables and Glowstone Facade and Soundproofing Facade and others)")
.define("itemsNotAllowed", list);
FACADE_IGNORELIST = CFG.comment("\r\n These blocks are not allowed to be used as Facades for blocks because they look weird (used by cables and Glowstone Facade and Soundproofing Facade and others). If you want to ignore one entire mod use an entry like this : storagenetwork:* ")
.defineList("itemsNotAllowed", list, it -> it instanceof String);
CFG.pop();
//
TRANSFER_NODES_DIMENSIONAL = CFG.comment(" Allows the dimensional Transfer Nodes to cross dimensions "
Expand Down Expand Up @@ -569,6 +566,11 @@ public static List<String> getGloomIgnoreList() {
return (List<String>) GLOOM_IGNORE_LIST.get();
}

@SuppressWarnings("unchecked")
public static List<String> getFacadeIgnoreList() {
return (List<String>) FACADE_IGNORELIST.get();
}

public static Map<String, String> getMappedBeheading() {
Map<String, String> mappedBeheading = new HashMap<String, String>();
for (String s : BEHEADING_SKINS.get()) {
Expand All @@ -586,11 +588,11 @@ public static Map<String, String> getMappedBeheading() {
}

public static BooleanValue CABLE_FACADES;
private static ConfigValue<List<String>> FACADE_IGNORELIST;
private static ConfigValue<List<? extends String>> FACADE_IGNORELIST;

public static boolean isFacadeAllowed(ItemStack item) {
ResourceLocation itemId = ForgeRegistries.ITEMS.getKey(item.getItem());
if (UtilString.isInList(FACADE_IGNORELIST.get(), itemId)) {
if (UtilString.isInList(getFacadeIgnoreList(), itemId)) {
return false;
}
return true;
Expand Down

0 comments on commit ad1a91b

Please sign in to comment.