mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-16 21:44:05 +09:00
new console command 'error' (stderr equivalent of console window)
Former-commit-id: ab54663fd64f9ae9c758f53b3f5800a5894f0db3 Former-commit-id: 7aba1585ffa45195622bb25e1c62cace474420c9
This commit is contained in:
@@ -19,9 +19,8 @@ object ItemPropCodex {
|
||||
*/
|
||||
private lateinit var itemCodex: Array<InventoryItem>
|
||||
|
||||
@JvmStatic val ITEM_UNIQUE_MAX = 32768
|
||||
const val ITEM_UNIQUE_MAX = 32768
|
||||
|
||||
@JvmStatic
|
||||
fun buildItemProp() {
|
||||
itemCodex = arrayOf<InventoryItem>()
|
||||
|
||||
@@ -29,14 +28,14 @@ object ItemPropCodex {
|
||||
|
||||
}
|
||||
|
||||
fun getItem(code: Int): InventoryItem {
|
||||
if (code < ITEM_UNIQUE_MAX)
|
||||
fun getProp(code: Int): InventoryItem {
|
||||
if (code < ITEM_UNIQUE_MAX) // generic item
|
||||
return itemCodex[code]
|
||||
else {
|
||||
val a = Terrarum.game.getActorByID(code)
|
||||
val a = Terrarum.game.getActorByID(code) // actor item
|
||||
if (a is CanBeAnItem) return a.itemData
|
||||
|
||||
throw NullPointerException()
|
||||
throw IllegalArgumentException("Attempted to get item data of actor that cannot be an item. ($a)")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user