-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add optional conversion to MineClone2, along with a few related fixes. #21
base: master
Are you sure you want to change the base?
Add optional conversion to MineClone2, along with a few related fixes. #21
Conversation
|
||
Example of converted coordinates: | ||
Minecraft: 704, 4, -318 | ||
Minetest: 720, -60, 334 |
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.
should we maybe include a (lua) example function that converts the old coordinates?
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.
Possibly? I'm not sure how that'd work. I just know that converted maps don't keep the player's save location; so spawning into an imported map requires flying/teleportation to the converted area. And, it's quickest if users know the coordinates beforehand so they have a rough idea of where to look.
@@ -270,9 +270,6 @@ def isdoor(b): | |||
# rotate lily pads randomly | |||
elif blocks[i] == 111: | |||
param2[i] = random.randint(0,3) | |||
# melon/pumpkin blocks | |||
elif blocks[i] == 86 or blocks[i] == 103: | |||
param2[i] = random.randint(0,23) |
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.
Maybe I missed it, but, what was the reason this can be removed?
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.
Melons don't need to be randomly rotated since they don't have any face. Pumpkins do have a face in mcl2/minecraft, so the code interferes with conversion of facedirs.
content_mcl2.py
Outdated
blocks = [[(0, 0)]*16 for i in range(blocks_len)] | ||
for (id, data), value in bd.items(): | ||
blocks[id][data] = value | ||
return name_id_mapping, blocks |
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.
how much of this is different? any chance we can keep the same file instead?
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.
Sorry, I'm not much of a coder, so a lot of the python stuff is duplicated. This one just opens the "mcl2_map_content.txt" file. But, I can take another look.
976 12 doors:door_wood_a 0 | ||
976 13 doors:door_wood_a 1 | ||
976 14 doors:door_wood_a 2 | ||
976 15 doors:door_wood_a 3 |
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'm assuming the in-game ABM still converts this all ok? Did you test that?
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.
Like the currently converted wood/steel doors. I mapped only the bottom halves(from Minecraft) to the full MTG doors. Yes, I tested; they convert fine.
mcimport_mcl2.py
Outdated
|
||
print("Conversion finished!\n") | ||
print("Please enjoy your new MineClone2 world!") | ||
|
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.
same deal, most of this is just duplicated code, which will make it more difficult to maintain. Can we deduplicate?
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.
Yea, I can try and take another run at it; see if I can work something out.
//202 4 mcl_end:purpur_pillar 12 //East,West pointing vectors with a MC state for X | ||
//202 8 mcl_end:purpur_pillar 6 //North,South pointing vectors with a MC state for Z | ||
|
||
//===================================================================================== |
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 this should go into a documentation file, and then both content files can reference this.
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.
Alright, I'll move both sections into a separate documentation file.
mcl2_map_content.txt
Outdated
3 2 mcl_core:podzol | ||
4 mcl_core:cobble | ||
|
||
#ifdef MORETREES |
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.
for MCL this doesn't make sense, let's just drop MORETREES from this entirely
mcl2_map_content.txt
Outdated
43 3 mcl_core:cobble | ||
43 4 mcl_core:brick_block | ||
43 5 mcl_core:stonebrick | ||
#ifdef NETHER |
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 mcl2 has nether by default, and quartz, let's not make these ifdef
statements here, at all.
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.
Okay, I'll clear out all these ifdef statements, including the moretrees stuff you mentioned above.
in large this is ok, but I'd like to see some dedup work so we're not just blowing up our code base. |
Alrighty, did some research and figured out enough python to fix the dedup issues you requested. Then went ahead and moved the documentation to its own file. And lastly, cleared out the ifdef related stuff from the mcl2_map_content file as requested. I retested importing maps to both games, and everything appears to still work fine. |
So, I was testing in Minetest v5.0, and I noticed a large amount of warning message spam in "debug.txt". Example error: It seems to be due to this commit in Minetest that added warnings: minetest/minetest@741e3ef I tested commenting out the 'set_lighting' line in a new branch: And, it clears the error spam, while lighting seems to still be okay. |
d0f7bf7
to
579cdcf
Compare
2ee38ec
to
cf97738
Compare
…fix for 'vm:set_lighting' errors in Minetest v5.x.
cf97738
to
f842373
Compare
Alright, per the earlier discussion here's a pr that adds the option to choose between games, and closes #20
I also removed the random rotation of pumpkins/melons; and re-added the old door code. Both are unnecessary for MTG, but needed for MCL2.
Though I did add some extra conversions for the "new" door wood-types, and mapped them to wooden doors in MTG.
And finally, I added a few extra notes on how coordinates are roughly converted, and which minecraft world versions are currently compatible with mcimport.