Небольшой тест подгрузки всех модов
This commit is contained in:
parent
2709f3d005
commit
6a437d3400
@ -23,6 +23,8 @@ private val LOGGER = LogManager.getLogger()
|
|||||||
fun main() {
|
fun main() {
|
||||||
LOGGER.info("Running LWJGL ${Version.getVersion()}")
|
LOGGER.info("Running LWJGL ${Version.getVersion()}")
|
||||||
|
|
||||||
|
//Thread.sleep(6_000L)
|
||||||
|
|
||||||
val db = BTreeDB(File("F:\\SteamLibrary\\steamapps\\common\\Starbound - Unstable\\storage\\universe\\389760395_938904237_-238610574_5.world"))
|
val db = BTreeDB(File("F:\\SteamLibrary\\steamapps\\common\\Starbound - Unstable\\storage\\universe\\389760395_938904237_-238610574_5.world"))
|
||||||
//val db = BTreeDB(File("world.world"))
|
//val db = BTreeDB(File("world.world"))
|
||||||
|
|
||||||
@ -30,6 +32,15 @@ fun main() {
|
|||||||
|
|
||||||
//Starbound.addFilePath(File("./unpacked_assets/"))
|
//Starbound.addFilePath(File("./unpacked_assets/"))
|
||||||
Starbound.addPakPath(File("J:\\Steam\\steamapps\\common\\Starbound\\assets\\packed.pak"))
|
Starbound.addPakPath(File("J:\\Steam\\steamapps\\common\\Starbound\\assets\\packed.pak"))
|
||||||
|
|
||||||
|
/*for (folder in File("J:\\Steam\\steamapps\\workshop\\content\\211820").list()!!) {
|
||||||
|
val f = File("J:\\Steam\\steamapps\\workshop\\content\\211820\\$folder\\contents.pak")
|
||||||
|
|
||||||
|
if (f.exists()) {
|
||||||
|
Starbound.addPakPath(f)
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
//Starbound.addPakPath(File("packed.pak"))
|
//Starbound.addPakPath(File("packed.pak"))
|
||||||
|
|
||||||
Starbound.initializeGame { finished, replaceStatus, status ->
|
Starbound.initializeGame { finished, replaceStatus, status ->
|
||||||
|
@ -322,7 +322,10 @@ object Starbound {
|
|||||||
it("Loading $listedFile")
|
it("Loading $listedFile")
|
||||||
val def = pathStack(listedFile.computeDirectory()) { GSON.fromJson(listedFile.reader(), clazz) }
|
val def = pathStack(listedFile.computeDirectory()) { GSON.fromJson(listedFile.reader(), clazz) }
|
||||||
val key = getKey.invoke(def)
|
val key = getKey.invoke(def)
|
||||||
check(put.invoke(key, def) == null) { "Already has $name with name $key loaded!" }
|
|
||||||
|
if (put.invoke(key, def) != null) {
|
||||||
|
LOGGER.warn("Already had $name with name $key loaded! Older prototype was overwritten (loading $listedFile)")
|
||||||
|
}
|
||||||
} catch (err: Throwable) {
|
} catch (err: Throwable) {
|
||||||
LOGGER.error("Loading $name definition file $listedFile", err)
|
LOGGER.error("Loading $name definition file $listedFile", err)
|
||||||
}
|
}
|
||||||
@ -351,8 +354,14 @@ object Starbound {
|
|||||||
val def = pathStack(listedFile.computeDirectory()) { GSON.fromJson(listedFile.reader(), clazz) }
|
val def = pathStack(listedFile.computeDirectory()) { GSON.fromJson(listedFile.reader(), clazz) }
|
||||||
val key0 = getKey0.invoke(def)
|
val key0 = getKey0.invoke(def)
|
||||||
val key1 = getKey1.invoke(def)
|
val key1 = getKey1.invoke(def)
|
||||||
check(put0.invoke(key0, def) == null) { "Already has $name with name $key0 loaded!" }
|
|
||||||
check(put1.invoke(key1, def) == null) { "Already has $name with ID $key1 loaded!" }
|
if (put0.invoke(key0, def) != null) {
|
||||||
|
LOGGER.warn("Already had $name with name $key0 loaded! Older prototype was overwritten (loading $listedFile)")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (put1.invoke(key1, def) != null) {
|
||||||
|
LOGGER.warn("Already had $name with ID $key1 loaded! Older prototype was overwritten (loading $listedFile)")
|
||||||
|
}
|
||||||
} catch (err: Throwable) {
|
} catch (err: Throwable) {
|
||||||
LOGGER.error("Loading $name definition file $listedFile", err)
|
LOGGER.error("Loading $name definition file $listedFile", err)
|
||||||
}
|
}
|
||||||
@ -371,10 +380,10 @@ object Starbound {
|
|||||||
callback(false, false, "Searching for pak archives...".also(LOGGER::info))
|
callback(false, false, "Searching for pak archives...".also(LOGGER::info))
|
||||||
|
|
||||||
for (path in archivePaths) {
|
for (path in archivePaths) {
|
||||||
callback(false, false, "Reading index of ${path.name}...".also(LOGGER::info))
|
callback(false, false, "Reading index of ${path}...".also(LOGGER::info))
|
||||||
|
|
||||||
addPak(StarboundPak(path) { _, status ->
|
addPak(StarboundPak(path) { _, status ->
|
||||||
callback(false, true, "${path.name}: $status")
|
callback(false, true, "${path.parent}/${path.name}: $status")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -433,7 +442,7 @@ object Starbound {
|
|||||||
callback(false, false, "Finished building file index in ${System.currentTimeMillis() - time}ms".also(LOGGER::info))
|
callback(false, false, "Finished building file index in ${System.currentTimeMillis() - time}ms".also(LOGGER::info))
|
||||||
|
|
||||||
loadStage(callback, this::loadFunctions, "functions")
|
loadStage(callback, this::loadFunctions, "functions")
|
||||||
loadStage(callback, this::loadProjectiles, "projectiles")
|
//loadStage(callback, this::loadProjectiles, "projectiles")
|
||||||
loadStage(callback, this::loadParallax, "parallax definitions")
|
loadStage(callback, this::loadParallax, "parallax definitions")
|
||||||
loadStage(callback, this::loadItemDefinitions, "item definitions")
|
loadStage(callback, this::loadItemDefinitions, "item definitions")
|
||||||
|
|
||||||
@ -565,7 +574,10 @@ object Starbound {
|
|||||||
try {
|
try {
|
||||||
callback("Loading $listedFile")
|
callback("Loading $listedFile")
|
||||||
val def: ItemPrototype = pathStack(listedFile.computeDirectory()) { GSON.fromJson(listedFile.reader(), files.entries.first { listedFile.name.endsWith(it.key) }.value) }
|
val def: ItemPrototype = pathStack(listedFile.computeDirectory()) { GSON.fromJson(listedFile.reader(), files.entries.first { listedFile.name.endsWith(it.key) }.value) }
|
||||||
check(items.put(def.itemName, def.assemble()) == null) { "Already has item with name ${def.itemName} loaded!" }
|
|
||||||
|
if (items.put(def.itemName, def.assemble()) != null) {
|
||||||
|
LOGGER.warn("Already has item with name ${def.itemName} loaded! Older prototype was overwritten (loading $listedFile)")
|
||||||
|
}
|
||||||
} catch (err: Throwable) {
|
} catch (err: Throwable) {
|
||||||
LOGGER.error("Loading item definition file $listedFile", err)
|
LOGGER.error("Loading item definition file $listedFile", err)
|
||||||
}
|
}
|
||||||
|
@ -85,8 +85,8 @@ data class ThingDescription(
|
|||||||
override fun read(`in`: JsonReader): ThingDescription {
|
override fun read(`in`: JsonReader): ThingDescription {
|
||||||
`in`.beginObject()
|
`in`.beginObject()
|
||||||
|
|
||||||
var shortdescription: String by NotNullVar()
|
var shortdescription = "..."
|
||||||
var description: String by NotNullVar()
|
var description = "..."
|
||||||
val racial = ImmutableMap.Builder<String, String>()
|
val racial = ImmutableMap.Builder<String, String>()
|
||||||
val racialShort = ImmutableMap.Builder<String, String>()
|
val racialShort = ImmutableMap.Builder<String, String>()
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ data class ArmorItemDefinition(
|
|||||||
override val pickupQuestTemplates: List<String>,
|
override val pickupQuestTemplates: List<String>,
|
||||||
override val scripts: List<DirectAssetReference>,
|
override val scripts: List<DirectAssetReference>,
|
||||||
override val scriptDelta: Int,
|
override val scriptDelta: Int,
|
||||||
override val tooltipKind: ItemTooltipKind,
|
override val tooltipKind: String,
|
||||||
override val twoHanded: Boolean,
|
override val twoHanded: Boolean,
|
||||||
override val radioMessagesOnPickup: List<String>,
|
override val radioMessagesOnPickup: List<String>,
|
||||||
override val fuelAmount: Long?,
|
override val fuelAmount: Long?,
|
||||||
|
@ -15,7 +15,7 @@ data class CurrencyItemDefinition(
|
|||||||
override val eventCategory: String?,
|
override val eventCategory: String?,
|
||||||
override val consumeOnPickup: Boolean,
|
override val consumeOnPickup: Boolean,
|
||||||
override val pickupQuestTemplates: List<String>,
|
override val pickupQuestTemplates: List<String>,
|
||||||
override val tooltipKind: ItemTooltipKind,
|
override val tooltipKind: String,
|
||||||
override val twoHanded: Boolean,
|
override val twoHanded: Boolean,
|
||||||
override val radioMessagesOnPickup: List<String>,
|
override val radioMessagesOnPickup: List<String>,
|
||||||
override val fuelAmount: Long?,
|
override val fuelAmount: Long?,
|
||||||
|
@ -18,7 +18,7 @@ data class FlashlightDefinition(
|
|||||||
override val eventCategory: String?,
|
override val eventCategory: String?,
|
||||||
override val consumeOnPickup: Boolean,
|
override val consumeOnPickup: Boolean,
|
||||||
override val pickupQuestTemplates: ImmutableList<String>,
|
override val pickupQuestTemplates: ImmutableList<String>,
|
||||||
override val tooltipKind: ItemTooltipKind,
|
override val tooltipKind: String,
|
||||||
override val twoHanded: Boolean,
|
override val twoHanded: Boolean,
|
||||||
override val radioMessagesOnPickup: ImmutableList<String>,
|
override val radioMessagesOnPickup: ImmutableList<String>,
|
||||||
override val fuelAmount: Long?,
|
override val fuelAmount: Long?,
|
||||||
|
@ -17,7 +17,7 @@ data class HarvestingToolDefinition(
|
|||||||
override val eventCategory: String?,
|
override val eventCategory: String?,
|
||||||
override val consumeOnPickup: Boolean,
|
override val consumeOnPickup: Boolean,
|
||||||
override val pickupQuestTemplates: ImmutableList<String>,
|
override val pickupQuestTemplates: ImmutableList<String>,
|
||||||
override val tooltipKind: ItemTooltipKind,
|
override val tooltipKind: String,
|
||||||
override val twoHanded: Boolean,
|
override val twoHanded: Boolean,
|
||||||
override val radioMessagesOnPickup: ImmutableList<String>,
|
override val radioMessagesOnPickup: ImmutableList<String>,
|
||||||
override val fuelAmount: Long?,
|
override val fuelAmount: Long?,
|
||||||
|
@ -115,9 +115,11 @@ interface IItemDefinition : IThingWithDescription {
|
|||||||
val pickupQuestTemplates: List<String>
|
val pickupQuestTemplates: List<String>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* это где либо ещё применяется кроме брони?
|
* тип tooltip'а
|
||||||
|
*
|
||||||
|
* ссылается на конфиг окон
|
||||||
*/
|
*/
|
||||||
val tooltipKind: ItemTooltipKind
|
val tooltipKind: String
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Занимает ли предмет обе руки
|
* Занимает ли предмет обе руки
|
||||||
|
@ -18,7 +18,7 @@ data class ItemDefinition(
|
|||||||
override val eventCategory: String?,
|
override val eventCategory: String?,
|
||||||
override val consumeOnPickup: Boolean,
|
override val consumeOnPickup: Boolean,
|
||||||
override val pickupQuestTemplates: ImmutableList<String>,
|
override val pickupQuestTemplates: ImmutableList<String>,
|
||||||
override val tooltipKind: ItemTooltipKind,
|
override val tooltipKind: String,
|
||||||
override val twoHanded: Boolean,
|
override val twoHanded: Boolean,
|
||||||
override val radioMessagesOnPickup: ImmutableList<String>,
|
override val radioMessagesOnPickup: ImmutableList<String>,
|
||||||
override val fuelAmount: Long?,
|
override val fuelAmount: Long?,
|
||||||
|
@ -28,7 +28,7 @@ open class ItemPrototype : IItemDefinition, INativeJsonHolder {
|
|||||||
final override var eventCategory: String? = null
|
final override var eventCategory: String? = null
|
||||||
final override var consumeOnPickup: Boolean = false
|
final override var consumeOnPickup: Boolean = false
|
||||||
final override var pickupQuestTemplates: ImmutableList<String> = ImmutableList.of()
|
final override var pickupQuestTemplates: ImmutableList<String> = ImmutableList.of()
|
||||||
final override var tooltipKind: ItemTooltipKind = ItemTooltipKind.NORMAL
|
final override var tooltipKind: String = "normal"
|
||||||
final override var twoHanded: Boolean = false
|
final override var twoHanded: Boolean = false
|
||||||
final override var radioMessagesOnPickup: ImmutableList<String> = ImmutableList.of()
|
final override var radioMessagesOnPickup: ImmutableList<String> = ImmutableList.of()
|
||||||
final override var fuelAmount: Long? = null
|
final override var fuelAmount: Long? = null
|
||||||
|
@ -1,48 +0,0 @@
|
|||||||
package ru.dbotthepony.kstarbound.defs.item
|
|
||||||
|
|
||||||
enum class ItemTooltipKind {
|
|
||||||
/**
|
|
||||||
* Обычные предметы
|
|
||||||
*/
|
|
||||||
NORMAL,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Инструмент (кирка, музыкальный инструмент, мотыга, т.п.)
|
|
||||||
*/
|
|
||||||
TOOL,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Улучшение для рюкзака
|
|
||||||
*/
|
|
||||||
BASE_AUGMENT,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Рюкзаки
|
|
||||||
*/
|
|
||||||
BACK,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Броня
|
|
||||||
*/
|
|
||||||
ARMOR,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* "Руки" меха
|
|
||||||
*/
|
|
||||||
MECH_ARM,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* "Ноги" меха
|
|
||||||
*/
|
|
||||||
MECH_LEGS,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Ускорители меха
|
|
||||||
*/
|
|
||||||
MECH_BOOSTER,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Тело меха
|
|
||||||
*/
|
|
||||||
MECH_BODY,
|
|
||||||
}
|
|
@ -16,7 +16,7 @@ data class LiquidItemDefinition(
|
|||||||
override val eventCategory: String?,
|
override val eventCategory: String?,
|
||||||
override val consumeOnPickup: Boolean,
|
override val consumeOnPickup: Boolean,
|
||||||
override val pickupQuestTemplates: List<String>,
|
override val pickupQuestTemplates: List<String>,
|
||||||
override val tooltipKind: ItemTooltipKind,
|
override val tooltipKind: String,
|
||||||
override val twoHanded: Boolean,
|
override val twoHanded: Boolean,
|
||||||
override val radioMessagesOnPickup: List<String>,
|
override val radioMessagesOnPickup: List<String>,
|
||||||
override val fuelAmount: Long?,
|
override val fuelAmount: Long?,
|
||||||
|
@ -16,7 +16,7 @@ data class MaterialItemDefinition(
|
|||||||
override val eventCategory: String?,
|
override val eventCategory: String?,
|
||||||
override val consumeOnPickup: Boolean,
|
override val consumeOnPickup: Boolean,
|
||||||
override val pickupQuestTemplates: List<String>,
|
override val pickupQuestTemplates: List<String>,
|
||||||
override val tooltipKind: ItemTooltipKind,
|
override val tooltipKind: String,
|
||||||
override val twoHanded: Boolean,
|
override val twoHanded: Boolean,
|
||||||
override val radioMessagesOnPickup: List<String>,
|
override val radioMessagesOnPickup: List<String>,
|
||||||
override val fuelAmount: Long?,
|
override val fuelAmount: Long?,
|
||||||
|
Loading…
Reference in New Issue
Block a user