Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if source and target of upgrade are both enabled before registering #20

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 2 additions & 24 deletions src/main/java/cpw/mods/ironchest/ChestChangerType.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,30 +90,8 @@ public void addRecipes() {

public static void buildItems(Configuration cfg) {
for (ChestChangerType type : values()) {
if (type.isAllowed()) {
switch (type) {
case STEELGOLD, COPPERSTEEL -> {
if (IronChestType.STEEL.isEnabled()) {
type.buildItem(cfg);
}
}
case SILVERGOLD, COPPERSILVER -> {
if (IronChestType.SILVER.isEnabled()) {
type.buildItem(cfg);
}
}
case DIAMONDDARKSTEEL, CRYSTALDARKSTEEL, OBSIDIANDARKSTEEL -> {
if (IronChestType.DARKSTEEL.isEnabled()) {
type.buildItem(cfg);
}
}
case OBSIDIANNETHERITE -> {
if (IronChestType.NETHERITE.isEnabled()) {
type.buildItem(cfg);
}
}
default -> type.buildItem(cfg);
}
if (type.isAllowed() && (type.source.isEnabled() && type.target.isEnabled())) {
type.buildItem(cfg);
}
}
}
Expand Down