Skip to content

Commit

Permalink
Fix crashing when updating; comment out unused settings
Browse files Browse the repository at this point in the history
  • Loading branch information
NiChrosia committed Aug 19, 2021
1 parent d4798e2 commit 9ef43e7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
3 changes: 1 addition & 2 deletions src/main/kotlin/nichrosia/nobreak/content/NBSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import nichrosia.nobreak.util.DataStreams.str
import org.apache.logging.log4j.LogManager
import java.io.DataInputStream
import java.io.DataOutputStream
import java.io.EOFException
import java.io.File
import kotlin.io.path.pathString
import kotlin.properties.Delegates
Expand Down Expand Up @@ -109,7 +108,7 @@ object NBSettings {

customBlacklist.addItems(rawCustomBlacklist.split("|").map { Registry.ITEM.get(Identifier(it)) })
blacklists.addAll(PresetScreenDescription.BlacklistPreset.types.filter { rawBlacklists.split("|").contains(it.translationKey) })
} catch(e: EOFException) {
} catch(e: Exception) {
log.warn("Invalid config, setting values to default.")
}
}
Expand Down
22 changes: 11 additions & 11 deletions src/main/kotlin/nichrosia/nobreak/ext/NBClothConfigSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ object NBClothConfigSettings {
.setSaveConsumer { NBSettings.notifyUser = it }
.build())

general.addEntry(entryBuilder.startBooleanToggle(
TranslatableText("setting.nobreak.allow_attacking_own_pets"),
NBSettings.allowAttackingOwnPets)
.setSaveConsumer { NBSettings.allowAttackingOwnPets = it }
.build())

general.addEntry(entryBuilder.startBooleanToggle(
TranslatableText("setting.nobreak.allow_attacking_neutral_mobs"),
NBSettings.allowAttackingNeutralMobs)
.setSaveConsumer { NBSettings.allowAttackingNeutralMobs = it }
.build())
// general.addEntry(entryBuilder.startBooleanToggle(
// TranslatableText("setting.nobreak.allow_attacking_own_pets"),
// NBSettings.allowAttackingOwnPets)
// .setSaveConsumer { NBSettings.allowAttackingOwnPets = it }
// .build())
//
// general.addEntry(entryBuilder.startBooleanToggle(
// TranslatableText("setting.nobreak.allow_attacking_neutral_mobs"),
// NBSettings.allowAttackingNeutralMobs)
// .setSaveConsumer { NBSettings.allowAttackingNeutralMobs = it }
// .build())
}
}

0 comments on commit 9ef43e7

Please sign in to comment.