From aeb14c9a63bbc3b8fe6cf9d39f6a1d1c96d4ae88 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Wed, 27 Jul 2022 19:12:29 +0700 Subject: [PATCH] more parallax tests which yield nothing lulmao --- .../kotlin/ru/dbotthepony/kstarbound/Main.kt | 1 + .../ru/dbotthepony/kstarbound/Starbound.kt | 8 +-- .../kstarbound/client/ClientWorld.kt | 18 +++---- .../kstarbound/client/StarboundClient.kt | 2 +- .../{Parallax.kt => ParallaxPrototype.kt} | 54 +++++++++---------- 5 files changed, 42 insertions(+), 41 deletions(-) rename src/main/kotlin/ru/dbotthepony/kstarbound/defs/{Parallax.kt => ParallaxPrototype.kt} (57%) diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/Main.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/Main.kt index ba0a1076..964c4882 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/Main.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/Main.kt @@ -52,6 +52,7 @@ fun main() { val ent = PlayerEntity(client.world!!) Starbound.onInitialize { + client.world!!.parallax = Starbound.parallaxAccess["barren"] chunkA = client.world!!.computeIfAbsent(ChunkPos(0, 0)).chunk val chunkB = client.world!!.computeIfAbsent(ChunkPos(-1, 0)).chunk val chunkC = client.world!!.computeIfAbsent(ChunkPos(-2, 0)).chunk diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/Starbound.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/Starbound.kt index a5839a76..07fac8cc 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/Starbound.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/Starbound.kt @@ -39,12 +39,12 @@ object Starbound : IVFS { private val tiles = HashMap() private val projectiles = HashMap() - private val parallax = HashMap() + private val parallax = HashMap() private val functions = HashMap() val tilesAccess: Map = Collections.unmodifiableMap(tiles) val projectilesAccess: Map = Collections.unmodifiableMap(projectiles) - val parallaxAccess: Map = Collections.unmodifiableMap(parallax) + val parallaxAccess: Map = Collections.unmodifiableMap(parallax) val functionsAccess: Map = Collections.unmodifiableMap(functions) val gson: Gson = GsonBuilder() @@ -66,7 +66,7 @@ object Starbound : IVFS { .also(ConfigurableProjectile::registerGson) .also(SkyParameters::registerGson) .also(DungeonWorldDef::registerGson) - .also(Parallax::registerGson) + .also(ParallaxPrototype::registerGson) .also(JsonFunction::registerGson) .registerTypeAdapter(DamageType::class.java, CustomEnumTypeAdapter(DamageType.values()).nullSafe()) @@ -284,7 +284,7 @@ object Starbound : IVFS { try { callback("Loading $listedFile") - val def = gson.fromJson(getReader(listedFile), Parallax::class.java) + val def = gson.fromJson(getReader(listedFile), ParallaxPrototype::class.java) parallax[getPathFilename(listedFile).substringBefore('.')] = def } catch(err: Throwable) { LOGGER.error("Loading parallax file $listedFile", err) diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/client/ClientWorld.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/client/ClientWorld.kt index 1a8c6141..5dec9b68 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/client/ClientWorld.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/client/ClientWorld.kt @@ -4,7 +4,7 @@ import org.lwjgl.opengl.GL46.* import ru.dbotthepony.kstarbound.PIXELS_IN_STARBOUND_UNITf import ru.dbotthepony.kstarbound.client.gl.VertexTransformers import ru.dbotthepony.kstarbound.client.render.renderLayeredList -import ru.dbotthepony.kstarbound.defs.Parallax +import ru.dbotthepony.kstarbound.defs.ParallaxPrototype import ru.dbotthepony.kstarbound.math.encasingChunkPosAABB import ru.dbotthepony.kstarbound.world.* import ru.dbotthepony.kstarbound.world.entities.Entity @@ -46,7 +46,7 @@ class ClientWorld(val client: StarboundClient, seed: Long = 0L) : World