mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 03:54:06 +09:00
tags on ingame blocks
This commit is contained in:
@@ -210,6 +210,9 @@ class BlockCodex {
|
||||
|
||||
prop.reflectance = record.floatVal("refl")
|
||||
|
||||
prop.tags = record.get("tags").split(',').map { it.trim() }.toHashSet()
|
||||
prop.material = record.get("mate")
|
||||
|
||||
blockProps[prop.id] = prop
|
||||
|
||||
printdbg(this, "Setting prop ${prop.id} ->>\t${prop.nameKey}\tsolid:${prop.isSolid}")
|
||||
@@ -221,12 +224,9 @@ fun CSVRecord.str16ToInt(s: String): Int {
|
||||
try {
|
||||
ret = this.get(s).toLong(16).toInt()
|
||||
}
|
||||
catch (e: NumberFormatException) {
|
||||
}
|
||||
catch (e1: IllegalStateException) {
|
||||
}
|
||||
catch (e2: NullPointerException) {
|
||||
}
|
||||
catch (e: NumberFormatException) { }
|
||||
catch (e1: IllegalStateException) { }
|
||||
catch (e2: NullPointerException) { }
|
||||
|
||||
return ret
|
||||
}
|
||||
@@ -236,12 +236,9 @@ fun CSVRecord.intVal(s: String): Int {
|
||||
try {
|
||||
ret = this.get(s).toInt()
|
||||
}
|
||||
catch (e: NumberFormatException) {
|
||||
}
|
||||
catch (e1: IllegalStateException) {
|
||||
}
|
||||
catch (e2: NullPointerException) {
|
||||
}
|
||||
catch (e: NumberFormatException) { }
|
||||
catch (e1: IllegalStateException) { }
|
||||
catch (e2: NullPointerException) { }
|
||||
|
||||
return ret
|
||||
}
|
||||
@@ -251,12 +248,9 @@ fun CSVRecord.floatVal(s: String): Float {
|
||||
try {
|
||||
ret = this.get(s).toFloat()
|
||||
}
|
||||
catch (e: NumberFormatException) {
|
||||
}
|
||||
catch (e1: IllegalStateException) {
|
||||
}
|
||||
catch (e2: NullPointerException) {
|
||||
}
|
||||
catch (e: NumberFormatException) { }
|
||||
catch (e1: IllegalStateException) { }
|
||||
catch (e2: NullPointerException) { }
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ class BlockProp {
|
||||
var strength: Int = 0
|
||||
var density: Int = 0
|
||||
var viscosity: Int = 0
|
||||
/** Fluid colour */
|
||||
var colour: Int = 0
|
||||
|
||||
/** isSolid is NOT SAME AS !isOpaqueis
|
||||
@@ -98,6 +99,8 @@ class BlockProp {
|
||||
@Transient var rngBase1 = Math.random().toFloat() // flicker P0, etc
|
||||
@Transient var rngBase2 = Math.random().toFloat() // flicker P1, etc
|
||||
|
||||
var tags = HashSet<String>()
|
||||
|
||||
/**
|
||||
* Mainly intended to be used by third-party modules
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user