-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sluuuurp #231
Sluuuurp #231
Conversation
…to CellBlockEntity (which is the more correct name for it). Also added some utility extensions for block entities.
… and started calling the new methods.
…e prefix "on". Also renamed some methods to more appropriate names.
… class for later use.
…he CellBlockEntity.getNeighbors method
…the existing entity or creating one, and placing the part on the face.
…d added a whole load of mathematics APIs (which were needed for the shape geometrical calculations), operator overloads and utilities for Minecraft's vectors and matrices
Added Flywheel dependency.
…tial chunk update
…rt is added to rendering
…st enqueue relights whenever they wanted. Now returning models to relight in the IPartRenderer.relightModels method
… and adds automatic subscriber cleanup to cells
…ainer syntax using CellBehaviorSource
… on ArcReparamCatenary2dRFUProjection3dDual)
Polishes core by implementing testing bed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I mean, I left a few comments but I'm straight up going to merge this after I comment. You basically rewrote the mod, and comments I made can be addressed in further pull requests that are actually digestible. (Nothing looks like it's a major concern, just some various lints here and there). I didn't playtest it and honestly I don't think I'll fail merge on that since this is such a large change and it just needs to be merged already.
/* fun loadConfig(configFile: File = CONFIG_FILE) { | ||
try { | ||
if (configFile.isFile) { | ||
LOGGER.info("[Electrical Age] Reading config from ${configFile.absoluteFile}") | ||
instance = Yaml.default.decodeFromStream(ElnConfig.serializer(), configFile.inputStream()) | ||
} else { | ||
instance = ElnConfig() | ||
saveConfig() | ||
} | ||
} catch (e: Exception) { | ||
LOGGER.error("Electrical Age had an issue with loading the configuration file, please check the file for errors.") | ||
LOGGER.error("Check that 1) You have valid YAML 2) the config directives are spelled correctly (see documentation)") | ||
} | ||
} | ||
|
||
private fun saveConfig(configFile: File = CONFIG_FILE) { | ||
try { | ||
LOGGER.info("[Electrical Age] Writing config to ${configFile.absoluteFile}") | ||
val configText = Yaml.default.encodeToString(ElnConfig.serializer(), instance) | ||
if (!configFile.exists()) { | ||
configFile.createNewFile() | ||
} | ||
configFile.writeText(configText) | ||
} catch (e: Exception) { | ||
LOGGER.error("Electrical Age was unable to write the config file, please check filesystem permissions: $e") | ||
} | ||
}*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit. Not sure why this is commented. Not really an issue but hey.
fun getResourceString(location: ResourceLocation): String = | ||
getResourceStream(location).readAllBytes().toString(Charset.defaultCharset()) | ||
|
||
val GAME = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's this used for? Probably could use a comment.
inline fun <reified T : Cell> Level.getCell(mb: MultiblockManager, cellPosId: BlockPos): T = | ||
getCellOrNull(mb, cellPosId) ?: error("Cell was not present") | ||
|
||
private const val LIBAGE_SET_EPS = 0.001 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a bunch of libage extensions here (below) that might make sense as part of libage? Might want to move them, in time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that, or move to libage.kt?
return this.translate(Vec3(0.5, 0.0, 0.5)) | ||
} | ||
|
||
private const val NBT_ELECTRICAL_RESISTIVITY = "electricalResistivity" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the below NBT stuff I think could warrant it's own file as NBTExtensions.kt or something?
@@ -0,0 +1,50 @@ | |||
package org.eln2.mc | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we had a linter, it would probably loose it's marbles on this file.
@@ -0,0 +1,2237 @@ | |||
@file:Suppress("LocalVariableName") | |||
|
|||
package org.eln2.mc.mathematics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a big file. consider splitting it up and make a package level for it.
@@ -14,7 +14,7 @@ displayURL="https://age-series.org/" | |||
# A file name (in the root of the mod JAR) containing a logo for display | |||
logoFile="" | |||
credits="The Age Series Team" | |||
authors="jrddunbr, Caeleron, Grissess, Baughn, empireu, DarthSidiousPalpatine, AlanFletes, bloxgate" | |||
authors="jrddunbr, Caeleron, Grissess, Baughn, DarthSidiousPalpatine, AlanFletes, bloxgate" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
writes code change. also removes self from authors list
Seriously, dude. You wrote more of the Eln2 mod than any of the people in this list except maybe Grissess.
@@ -1,11 +1,11 @@ | |||
modLoader="kotlinforforge" | |||
loaderVersion="[3,)" | |||
modLoader="javafml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we ditched kff?
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1' | ||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read the tests and I think that we could improve them if we added mockito
@@ -0,0 +1,1542 @@ | |||
package org.eln2.mc.common.cells.foundation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good candidate for it's own package and split into files
This should be merged sooner than later.