Greymerk / minecraft-roguelike

This is a mod for minecraft that adds randomly generated dungeon complexes.
GNU General Public License v3.0
130 stars 53 forks source link

Changing all vanilla construction blocks #43

Closed Drakkett closed 8 years ago

Drakkett commented 8 years ago

I'm working on overhauling RLD to be used in a Terrafirmacraft (TFC) modpack. So far I'm making some progress on swapping out the blocks in RLD to use TFC blocks instead of vanilla. Unfortunately, I seem to keep finding areas of dungeons or entire structures that still use the vanilla blocks. I worry that I am going about this in the wrong way. I'm using some of the example settings files that are in github and changing the blocks within the files (_themes, _tower)

Is there a recommended method for doing this type of project? I didn't know if I should just be listing all of the theme types in the _themes settings and choosing the blocks for each theme. Right now I'm just picking a theme to be used for each level (0-4) and assigning non-vanilla blocks for those levels.

Thanks,

Drakkett

Drakkett commented 8 years ago

I think I understand the setting overriding less than I thought. I can't figure out how to override a second tower type and even if I change the sample one to a different tower type, then the towers that were using that setting just disappear completely. I expected that the tower at that location would have changed to the new type or back to the default.

Drakkett commented 8 years ago

Thank you so much for your response.  I will work on that and see how it goes.  Will be my first attempt at modifying a project myself.   Do you have a similar structure for mob spawners?   I'd tried substituting mob spawners but those too seem to default to set ones in the custom areas within a structure.  For example, the enderman room has an ender spawner in it. For loot, I'm planning on working on modifying to base forge loot library as that would remove vanilla loot from all chests and not just deal with the chests within RLD. Thanks, Drakkett

Greymerk commented 8 years ago

I reconsidered what I said and deleted the post. I'm not sure this suits what you're trying to do.

TFC is really a total conversion, and my mod is very vanilla in nature, and therefore makes a lot of assumptions about existing within the vanilla game.

I'd probably need to better understand what you're trying to accomplish to even give a helpful response.

If you want to get rid of all vanilla blocks (as seems to be the way with TFC) then you cannot do that without modifying the mod itself. not in the current state of things anyway.

Drakkett commented 8 years ago

Oh, I wondered why I just had an e-mail but didn't see a post in Github.   Yeah, we are really wanting to use RLD but for it to have TFC blocks instead as vanilla blocks allow for some cheaty things to happen in the mudpack.   The dungeons and everything are really nice, I just don't know how practical it will be to try and modify the mod for this. I'd already noticed there are other files in the world gen folder that specify other Vanilla blocks.  If I go into the world gen area and modify all of the world gen vanilla to use TFC blocks instead, would that work?

Greymerk commented 8 years ago

Yes, the way it works is that all the vanilla block names are defined in that set of files, especially the BlockType file, where the majority of standard blocks are defined by name. Then in the built in themes I reference those to build everything else.

such as here: https://github.com/Greymerk/minecraft-roguelike/blob/master/src/main/java/greymerk/roguelike/theme/ThemeTower.java

It happens to be that in certain rooms I use direct references to the BlockTypes which bypass the theme. such as this: https://github.com/Greymerk/minecraft-roguelike/blob/master/src/main/java/greymerk/roguelike/dungeon/rooms/DungeonsCrypt.java#L349

That quartz block is the "tombstone" in the crypt room.

Drakkett commented 8 years ago

Yeah, so we'd almost have to review all the files to chase down everything.   Or decide the ones we really care about and chase those down.  Looking through your dungeon list it wouldn't be hard for me to find at least some of the custom rooms and modify them if there was one that had a lot of a certain block we were trying to keep out of the game.   I think some vanilla blocks don't matter as much as others.  

Greymerk commented 8 years ago

If you change what BlockType.QUARTZ is in the BlockType file then you don't need to change it in the crypt file. that's the whole point. As far as I can recall there are no direct references to vanilla blocks in the dungeon generation code. it's all done indirectly through that set of files in here:

https://github.com/Greymerk/minecraft-roguelike/tree/master/src/main/java/greymerk/roguelike/worldgen/blocks

Drakkett commented 8 years ago

Oh, ok, I thought you were saying you called the block directly sometimes instead of using the blocktype file.  So back to what I thought I'd need to do originally.  Just modify all the block files to use vanilla blocks. For the spawners, would I need to go into the rooms that utilize custom spawners?  For example, the enderman spawner in the ender room.

Greymerk commented 8 years ago

There's an intermediate class for the mob spawners as well.

https://github.com/Greymerk/minecraft-roguelike/blob/master/src/main/java/greymerk/roguelike/worldgen/Spawner.java

when mob spawners are created in the dungeon code I reference this class to fetch the spawner type.

https://github.com/Greymerk/minecraft-roguelike/blob/master/src/main/java/greymerk/roguelike/dungeon/rooms/DungeonsEnder.java#L68

Drakkett commented 8 years ago

Nice.   Thanks again for all your help!    Now I just need to get busy and make all these changes.  :)

Drakkett commented 8 years ago

I want to make sure I am doing this right so I don't have to do it all twice.   So in our setting file, we used {"name" : "terrafirmacraft:StoneMMSmooth", "meta" : 1} in your java code, I should use   case STONE_SMOOTH:    block = new MetaBlock(Blocks.terrafirmacraft:StoneMMSmooth);    block.withProperty(BlockStone.VARIANT, BlockStone.EnumType.SMOOTH_BASALT);    return block;

Or am I completely bonkers?    I'm not sure how I'm supposed to specify which StoneMMSmooth to use and I don't see any examples in your code where it determines by the meta number.

Thanks!!!

Drakkett

Drakkett commented 8 years ago

Also, I'd like to get your permission to modify RLD and use a TFC enabled version in a modpack or even share it with other TFC themed modpacks. Would you give permission for that? Would you rather host the modified jar yourself once it is done? I will need permission in order to use FTB launcher for our modpack. The modpack I am helping with right now is Terrafirmapunk.

Greymerk commented 8 years ago

Minecraft doesn't use metadata numbers internally anymore, that's why i don't use them in my code. If you want to convert from metadata numeric value to blockstate there's a method for it in minecraft itself. The only case where I call it, and that's for the json parsing.

https://github.com/Greymerk/minecraft-roguelike/blob/master/src/main/java/greymerk/roguelike/worldgen/MetaBlock.java#L43

And yes, you can do whatever you like with your fork of the mod, as long as it's done in such a way that people don't ask me for support about changes you make. That'd be my only concern.

Terrafirmacraft being a total conversion mod itself, i understand why you'd need to do conversion work on a mod like mine to make it fit. It's something i'd rather be hands off about.

Drakkett commented 8 years ago

Hey, I was trying to add journeymap to the development environment to make it easier to find spawned towers but it crashes if I put the jar in the mods folder. Is there a trick to adding a mod or is it just not recommended to do in the development environment?

Greymerk commented 8 years ago

I can't comment one way or the other. I haven't done any adding of mods to my dev environment so I don't know what's supposed to happen or how it's supposed to work.

Drakkett commented 8 years ago

I did have a further question on creating the fork for TFC.

Would you be ok with it being called Roguelike for TFC? Would you prefer I change the messages that show in error log and server console messages to say Drakkett instead of greymerk? Since you don't want folks to contact you, I didn't know if you'd want your name off these messages. I'm not even sure if some of these can be easily changed or not.

Whenever I post it, I will state it is a variation of your mod, thank you for your support getting this going and state that any problems should be directed to me only. If someone gives me errors that I don't think are from my changes, I can post them as issues in here. I also changed the version number to 1.0.0 so it will be obvious if someone sends you a note for help if they are using this version.

Anything else you'd want me to do before we start distributing the TFC version?

Thanks again for your help,

Drakkett

Greymerk commented 8 years ago

It's probably best to just add yourself to the author list of your derived version and state in the description that it's a derived work, with changes for TFC.

You probably want to do what makes the most sense as far as making sure it's clear that this is a derived work so people don't wonder if you "stole" the mod or something. For my part, I don't really care too much one way or the other. I'd say do whatever is the most convenient for you.

Drakkett commented 8 years ago

I've made changes to the fork have it in a working state. I still have a lot of work to do but it is at least functioning enough that we can use it in the modpack. Thanks again for giving me permission.

Drakkett

Drakkett commented 8 years ago

Thanks again for all the help on getting me started on this. I'm going to go ahead and close this issue as it doesn't really relate to vanilla RLD.