Skip to content

Instantly share code, notes, and snippets.

@JamiesWhiteShirt
Created May 17, 2017 22:28
Show Gist options
  • Save JamiesWhiteShirt/a297fa80bd21ba65fe0db8505078bd6d to your computer and use it in GitHub Desktop.
Save JamiesWhiteShirt/a297fa80bd21ba65fe0db8505078bd6d to your computer and use it in GitHub Desktop.
Annotation based configuration with Kotlin
package com.jamieswhiteshirt.responsiveinventory
import net.minecraftforge.common.config.Config
@Config(modid = ResponsiveInventory.MODID)
object Configuration {
@JvmField
@Config.Comment("It's a test")
var test = 0
@JvmField
val testCategory = ItemSounds()
class ItemSounds {
@Config.Comment("Play sounds for items in inventories")
@JvmField
var inventory = true
@Config.Comment("Play sounds for items in main hand")
@JvmField
var mainHand = true
@Config.Comment("Play sounds for items in off hand")
@JvmField
var offHand = true
}
}
# Configuration file
general {
# It's a test
I:test=0
instance {
}
testcategory {
# Play sounds for items in inventories
B:inventory=true
# Play sounds for items in main hand
B:mainHand=true
# Play sounds for items in off hand
B:offHand=true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment