-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6b02efa
commit 66829c7
Showing
2 changed files
with
59 additions
and
0 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
53 changes: 53 additions & 0 deletions
53
src/main/java/de/dertoaster/crossbowverhaul/config/CrossbowverhaulConfigHolder.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,53 @@ | ||
package de.dertoaster.crossbowverhaul.config; | ||
|
||
import org.apache.commons.lang3.tuple.Pair; | ||
|
||
import net.minecraftforge.common.ForgeConfigSpec; | ||
import net.minecraftforge.common.ForgeConfigSpec.ConfigValue; | ||
|
||
public class CrossbowverhaulConfigHolder { | ||
|
||
public static class ItemConfig { | ||
private static final boolean allowEnchantmentsOnCrossbow = true; | ||
private static final boolean allowEnchantmentsOnNetheriteCrossbow = true; | ||
private static final boolean modifyMultiShotEnchantment = true; | ||
|
||
public final ConfigValue<Boolean> coEnchCrossbow; | ||
public final ConfigValue<Boolean> coEnchNetheriteCrossbow; | ||
public final ConfigValue<Boolean> coModMultishot; | ||
|
||
public ItemConfig(ForgeConfigSpec.Builder builder) { | ||
builder.push("co-item"); | ||
|
||
this.coEnchCrossbow = builder | ||
.comment("Enable enchantments on the crossbow") | ||
.defineInRange("Enable enchants on crossbow", allowEnchantmentsOnCrossbow, true, false, Boolean.class); | ||
|
||
this.coEnchNetheriteCrossbow = builder | ||
.comment("Enable enchantments on the netherite crossbow") | ||
.defineInRange("Enable enchants on netherite crossbow", allowEnchantmentsOnNetheriteCrossbow, true, false, Boolean.class); | ||
|
||
builder.pop(); | ||
|
||
builder.push("co-ench"); | ||
|
||
this.coModMultishot = builder | ||
.comment("Allows multishot to go up to five") | ||
.defineInRange("Modify multishot enchantment", modifyMultiShotEnchantment, true, false, Boolean.class); | ||
|
||
builder.pop(); | ||
} | ||
|
||
} | ||
|
||
public static final ItemConfig ITEM_CONFIG; | ||
public static final ForgeConfigSpec ITEM_CONFIG_SPEC; | ||
|
||
static { | ||
Pair<ItemConfig, ForgeConfigSpec> itemConfigSpecPair = new ForgeConfigSpec.Builder().configure(ItemConfig::new); | ||
|
||
ITEM_CONFIG = itemConfigSpecPair.getLeft(); | ||
ITEM_CONFIG_SPEC = itemConfigSpecPair.getRight(); | ||
} | ||
|
||
} |