Mineways icon indicating copy to clipboard operation
Mineways copied to clipboard

Supporting mods: Mineways has a little support, but not a lot

Open erich666 opened this issue 5 years ago • 6 comments

I get this about once a season: "Could you please add support for the BlargMaster Super Deluxe Mod?"

As far as mods go, I won't be adding support for those - my time's soaked up by plenty of other things at this point.

Update: however, I've added a "Translate" feature you can use to help read in mods. See video here. MCPrep's meshswap feature can also help. More info.

Before you ask "why can't you just substitute all blocks with custom meshes?", here's my long-winded semi-whiny answer:

Mineways is a hobby (one I still carry on mostly out of enjoying helping people who use the program - I haven't played Minecraft for about 7 years now), so I do whatever I think sounds like a feature a lot of people would like or is just a fun puzzle to figure out. I don't add anything having to do with mods to the code (other than turning unknown block types into bedrock), as doing so feels too specialized and helps only a few. Mineways gets about 300 downloads a day at this point.

I do hope someone somewhere does make such a program that deals with "cubes in general" someday. Starting from scratch, Minecraft's new data description allows more flexibility and extensibility, and JSON block descriptions makes new blocks easier to add. The properties and built-in behaviors of each modded block will affect it and its neighbors' appearance have been trimmed down. However, I suspect there are a few left that affect rendering. For example, does the block affect water's height? That's not in the JSON, AFAIK. And does the modded block use non-standard properties that affect their appearance? Having the user specify that sounds No Fun. There are plenty of other little oddities, like does a block "chop" a redstone wire going from the side to the top of another block, if the blocks touch along the edge the redstone travels across?

Mineways is backwards compatible, working for worlds back to Minecraft 1.2, so there's a lot depending on block IDs and on neighbors, such as whether the object connects with redstone dust, fences, walls, etc. That legacy means Mineways is kind of stuck, short of a major hollowing out and leaving 1.12 and earlier versions behind.

Anyway, interesting to think about, but I'm hoping someone else writes it ;) I believe Minutor can read in modded blocks, and it has multithreading to read blocks much faster. So. to whoever's interested, re-branching from Minutor might be an option. Adding back all the texture reading and polygon and texture writing wouldn't be a lot of fun, though - quite a slog.

erich666 avatar Jun 17 '19 17:06 erich666

In case someone somewhere actually wants to take on the task, here's my task list for adding a single block to the code.

How to add new blocks to Mineways:

  • Make a copy of the directory TileMaker\TileMaker\blocks and rename it to whatever the previous version is, e.g. blocks_v403
  • Get latest beta and unzip C:\Users*\AppData\Roaming.minecraft\versions the version’s .jar to somewhere, say C:\temp
  • Get the newest tiles from C:\temp\1.15-pre3(or whatever)\assets\minecraft\textures\block or similar, copy these to TileMaker\TileMaker\blocks
  • Get any new ender, normal, and normal_double/left/right chests from \assets\minecraft\textures\entity\chest and copy to subdirectory \chest
  • Grab barrier.png from \assets\minecraft\textures\item, just to be sure it hasn’t changed
  • Do a diff of blocks and the previous blocks directories. Whatever tiles have been added should be put into tiles.h.
  • If you add a new row to tiles.h, update VERTICAL_TILES to whatever is needed.
  • In Tilemaker run in debug, or make_terrain.bat, to make a new terrainExt.png
  • Copy new terrainExt.png to terrainBase.png

You have now added the new image(s) for a block to terrainExt.png. Now the real work begins.

In Mineways itself:

  • See VERTICAL_TILES warning to change warning number 7 in gPopupInfo in Mineways.cpp - do that

  • Add name of block and properties to nbt.cpp, determining a new number for it

  • Add new blocks to the #defines at the bottom of blockInfo.h. Update NUM_BLOCKS

  • Find a similar block type in blockInfo.cpp and copy it to the correct position. Change its leftmost color, and what the location is in tiles.h of the TOP of the basic block (dataVal == 0). Pay attention to the mtl field (0xff) as this gives the dataVal bits used to sort by material.

  • Add types for Block Test World and add names and colors to MinewaysMap’s

  • Look for similar block in code in ObjFileManip.cpp; copy and modify.

  • Also run Mineways, making sure to read in the new terrainExt.png, and - READ CAREFULLY - in the debugger set outputPNG to true in ObjFileManip.cpp, export (anything) to terrainExtData.obj, to generate the terrainExtData.cpp/h files. Move these over to the Win directory and compile. You may hit a problem if there are old terrainExtData.* files in the directory you’re writing to - delete those old ones. Check the “diff” in Github to make sure these files have changed.

  • Make sure any new blocks are added to the Mineways test world code

  • Test all blocks in test world: Is orientation right for all faces? Are unneeded faces deleted?

erich666 avatar Feb 06 '20 15:02 erich666

New info from AvatarKage: If you use MC Edit you can replace the modded blocks with vanilla blocks then replace the texture. Unfortunately, this seems to work only for 1.12 and before.

erich666 avatar Dec 10 '21 17:12 erich666

Also, one option is to give jmc2obj a try - you never know, they might handle your non-vanilla world data.

erich666 avatar Apr 01 '22 15:04 erich666

Fun fact: CurseForge hosts over 100,000 mods for Minecraft: https://en.wikipedia.org/wiki/Minecraft_modding#Mod_content

erich666 avatar Apr 17 '22 23:04 erich666

New experimental feature (which will appear in 11.03): modded block translation. It's quite limited, but might help you if you really want to read in a modded world: https://www.realtimerendering.com/erich/minecraft/public/mineways/downloads/mineways1103_beta1.zip (removed if 11.03 is out) and see the scripting.html file in it for how to use it.

erich666 avatar Aug 31 '23 17:08 erich666

Version 11.03 of Mineways has a "Translate" script command that lets you change from a modded block to a standard block. See release notes.

erich666 avatar Sep 08 '23 16:09 erich666