-
Notifications
You must be signed in to change notification settings - Fork 26
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
Update registration functions for technic #230
Conversation
Any opinions on this? Acceptable for this case or do you think node name change should be reverted here? Changed solar array naming to follow commonly used naming technic:tier_machinename. All other machines seem to follow this convention, also textures are named like this (even for solar arrays). This makes it bit simpler which is good but also adds another alias and generally changing node name is not exactly nice thing to do. (commit message is bit misleading: tier is removed from automatically generated node name and moved one level up) |
I think the node name should be not altered at all (besides As for the name changes, I'm all for consistency, so 👍 (I've searched for "hv_solar" way too many times...) |
There's no other changes to actual node names so far, commits to remove tier is just to make caller responsible for adding tier if he wants it somewhere in name. Inside Technic those tier parts are just moved up one level up to allow free form node names. Simply put only change to node naming so far is: |
Basic automated registration tests done, however part of tests are currently disabled for base machine and battery box because all fields are not yet available through definition table. Test report contains notification about this:
|
Removed WIP label as I think merging this should be decided before continuing to work on actual API features. Changes are fairly big and some testing is needed, I've however tested this against extended-tests branch and there it passed every test case just fine. edit. yes, I did forgot to include tier for node names but fixed now. edit2. if interested here's full test report: luacov.report.txt (with tests from extended-tests branch) |
Merged master branch (extended-tests) and cleaned up commits a bit, will do another iteration later for commits that have mixed up code and tests. |
db907b7
to
81ce564
Compare
If there's no objections I think I'll be merging this one soon. I'll add few simple tests for overload and API to this branch before that, very soon. Also @BuckarooBanzay opinion about renaming solar array nodes to follow style of texture names and other machine names: technic:solar_array_mv becomes technic:mv_solar_array and similar for lv and hv other solar arrays. Started working on refactoring network and registration stuff on top of this change few days ago, mostly fixing TODO notes I've left when rewriting core network code on #96 |
Cleaned up debug prints and rebased... and I think I'll do that again to clean up first commits... |
Tested cable plates placement using machines a bit: Constructor and deployer works fine, replacer however seems to be broken. |
replacer has not worked for cable plates because they don't use param values. Replacer only stores item name, param and param2. |
Click for detailed source code test coverage reportTest coverage report for Technic CNC 79.01% in 10/14 files:
Test coverage report for technic chests 45.24% in 6/6 files:
Test coverage report for technic 65.26% in 111/111 files:
Raw test runner output for geeks:CNC:
Chests:
Technic:
|
Did some little play testing, jumpdrive and space cannons were fine so machine registration compatibility is tested. Screwdriver was not fine with cable plates because for some reason I had |
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.
Hard to check every line of code, but looking at the main changes, everything seems to be good 👍
I also loaded a world with the pandorabox_integration_test
enabled, it didn't complain about anything either :)
Closes #117
Changes excluding tests: master...ecea17e
API
Updates machine and cable registration API to follow signature of
minetest.register_node
function.Allows registering from different mod and setting any mod name for nodes.
Updates cable plate placement to use actual math instead of weird lookup tables.
Reduces hard coded data in core source files.
Reduces nested registration wrappers.
List of updated registration functions
function technic.register_base_machine(name, def)
function technic.register_base_machine(data)
function technic.register_solar_array(name, def)
function technic.register_solar_array(data)
function technic.register_battery_box(name, def)
function technic.register_battery_box(data)
function technic.register_cable(nodename, data)
function technic.register_cable(tier, size, description, prefix, override_cable, override_cable_plate)
function technic.register_cable_plate(nodename, data)
technic.register_cable
, added new function for this.Compatibility
minetest.register_node
interface:function technic.register_alloy_furnace(def)
function technic.register_centrifuge(def)
function technic.register_compressor(def)
function technic.register_extractor(def)
function technic.register_freezer(def)
function technic.register_grinder(def)
function technic.register_electric_furnace(def)
There's another branch to do similar with chests, usable starting point with working API interface but incomplete implementation.