Skip to content

Commit

Permalink
Check if source and target of upgrade are both enabled before registe…
Browse files Browse the repository at this point in the history
…ring (#20)
  • Loading branch information
Caedis authored Mar 14, 2024
1 parent 2243653 commit e91268c
Showing 1 changed file with 2 additions and 24 deletions.
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

0 comments on commit e91268c

Please sign in to comment.