[1.6.4] Metallurgy oregen in GC dimensions

shifuren

Member
Aug 14, 2014
5
0
1
34
Using Galacticraft 1.6.4-2.0.14.1094 and Metallurgy-1.6.4-3.4.0.29
Is there any way to generate Metallurgy 3 ores in the GC dimensions, it seems to be ignoring any worldgen besides its own? Or i need to recompile GC and include needed custom ore ids? If so, what arguments here are responsible for veins per chunk, and ores per vein?
Code:
    public GCCoreWorldGenMinableMeta(int par1, int par2, int par3, boolean par4, int id, int meta)
{
super(par1, par2);
this.minableBlockId = par1;
this.numberOfBlocks = par2;
this.metadata = par3;
this.usingMetadata = par4;
this.fillerID = id;
this.fillerMetadata = meta;
}
Code:
public GCMarsBiomeDecorator()
{
this.copperGen = new GCCoreWorldGenMinableMeta(GCMarsBlocks.marsBlock.blockID, 4, 0, true, GCMarsBlocks.marsBlock.blockID, 9);
this.tinGen = new GCCoreWorldGenMinableMeta(GCMarsBlocks.marsBlock.blockID, 4, 1, true, GCMarsBlocks.marsBlock.blockID, 9);
- this.deshGen = new GCCoreWorldGenMinableMeta(GCMarsBlocks.marsBlock.blockID, 4, 2, true, GCMarsBlocks.marsBlock.blockID, 9);
+ this.deshGen = new GCCoreWorldGenMinableMeta(GCMarsBlocks.marsBlock.blockID, 6, 2, true, GCMarsBlocks.marsBlock.blockID, 9);
this.ironGen = new GCCoreWorldGenMinableMeta(GCMarsBlocks.marsBlock.blockID, 8, 3, true, GCMarsBlocks.marsBlock.blockID, 9);
this.dirtGen = new GCCoreWorldGenMinableMeta(GCMarsBlocks.marsBlock.blockID, 32, 6, true, GCMarsBlocks.marsBlock.blockID, 9);
}

{
MinecraftForge.EVENT_BUS.post(new GCCoreEventPopulate.Pre(this.currentWorld, this.rand, this.chunkX, this.chunkZ));
this.generateOre(20, this.dirtGen, 0, 200);
- this.generateOre(15, this.deshGen, 0, 128);
+ this.generateOre(15, this.deshGen, 20, 64);
this.generateOre(26, this.copperGen, 0, 60);
this.generateOre(23, this.tinGen, 0, 60);
this.generateOre(20, this.ironGen, 0, 64);
https://github.com/micdoodle8/Galac...core/world/gen/GCCoreWorldGenMinableMeta.java
https://github.com/micdoodle8/Galacticraft/commit/95e4a69b8382daad9e6cf6a2bc8b4266045c17fa

Also, others posted that other mod like Harvestcraft generated its things regardless of option in GC config, for me there is no gen on Moon\Mars from any other of 200+ mods, maybe issue something totally different?
 
Last edited:

radfast

Member
Staff member
Apr 27, 2014
1,118
339
83
I don't know Metallurgy mod or how it does its oregen.

In 1.6.4, normally other mods will all generate their items in all the Galacticraft dimensions also - actually there is no way to switch this off in 1.6.4, so it causes some visual problems with flowers etc appearing on the Moon.

But ...
Sometimes the other mod will only generate ore in a place where it finds plain stone - it works like this, first Minecraft generates the world in a simple way with everything under the dirt and over the Bedrock being plain stone, then later (at the 'decoration' stage) the world generators replace some of that plain stone with ores. Metallurgy mod will not find plain stone on the Moon (only Moon stone). So maybe it will try to generate its ores but it will generate nothing because it finds no plain stone.

It's also possible that the other mod is set to generate its ores only on the Overworld.

In either of those situations, possible solutions would be:
(1) add the other mod's ores to Galacticraft worldgen, so Galacticraft will make these ores at the same time it makes its own
(2) modify the other mod's code so its ores can replace either plain stone on the Overworld or Moon stone on the Moon.

We are now looking at doing something like solution (1) in Galacticraft 3 for Minecraft 1.7.2 / 1.7.10.

I don't have time to fix this in 1.6.4 as well, but you are welcome to make your own patch or custom-version of Galacticraft for a modpack if you know how to do that. Take the source codes from the 1.6 branch on the Github, obviously. It's pretty easy to understand, you already found the code for Mars. generateOre() has parameters, first the number of attempts to place a 'clump' of ore in a chunk (some of the attempts might be in air or water or some place where there can't be ore - probably anywhere which is not stone - so no ore will be placed on those attempts), third and fourth are min and max height to try. If the max height is high in the air like 200, it basically makes the ore a lot more random, like some chunks will have a lot of ore, some chunks will have a little ore (a little because most of the attempts went into the air). GCCoreWorldGenMinableMeta() parameters are, second the maximum size of a 'clump', third the metadata of the ore, and fifth and sixth the block and metadata which it can replace (so here, Mars plain stone).
 
  • Like
Reactions: shifuren

shifuren

Member
Aug 14, 2014
5
0
1
34
I don't know Metallurgy mod or how it does its oregen.
In 1.6.4, normally other mods will all generate their items in all the Galacticraft dimensions also - actually there is no way to switch this off in 1.6.4, so it causes some visual problems with flowers etc appearing on the Moon.
I'm using this modlist for my modpack testing https://docs.google.com/spreadsheets/d/1JFaOcmdokK0ZOaazKKEMpoaG9C4MtoccgD06-j0RDJA/edit?usp=sharing
and none, not even one mod is generating anything on moon\mars, well thats good in all situations except this one, because i don't need flowers on the Moon, heh :)

As for
It's also possible that the other mod is set to generate its ores only on the Overworld.
Metallurgy gen options have dimensions line in config, and i saw it generating its ores in nether\end\dream world (BnB modpack), Twilight forest, and any other types of dimensions except GC
Code:
 world_gen {
        S:diminsions=-28
        I:dungeon_loot_amount=0
        I:dungeon_loot_chance=0
        I:max_height=30
        I:min_height=5
        I:vein_chance=100
        I:vein_density=100
        I:vein_size=4
        I:veins_per_chunk=1
    }

I've could tried generating ores with COFH worldgen, but it seems to follow your logic "generate only in stone", Metallurgy doesnt have an open source to modify though, and i don't think they will let me.
I guess best choice would be making a custom version of GC, and your advices are very helpful, because i don't have Java experience, just a bit of C++ and common sense to understand basic work of code.
So few more questions, how i must properly refer to other-mod ores in code, by ID:meta, or anything else? I can't find where cost of space station creation is mentioned, where to change it?
Thanks in advance
 
Last edited:

shifuren

Member
Aug 14, 2014
5
0
1
34
Ok, i've done this:
1. downloaded forge.965 src
2. used install.cmd in forge directory
3. downloaded Eclipse and set workspace to forge\mcp\eclipse
4. used decompile.bat in forge\mcp folder
5. copied GC dev deobfuscated to Forge/mcp/lib
6. minecraft project Properties->Java Build Path->Libraries->Add 4 External Jars (GC dev deobfuscated)
7. extracted the Galacticraft 1.6.4 Github code
8. copied all files from common folder to forge/mcp/src
9. modified worldgen as needed
10. saved and closed Eclipse
11. used recompile.bat in forge\mcp folder, got message that "server source is missing"
12. used deobfuscate.bat in forge\mcp folder, got message that "server md5 can't be found"
No other errors, but forge\mcp\deobf folder is still empty. What exactly i'm doing wrong and on what stage?


OK, moved 2 modified classes to basic minecraft package in eclipse, everything compiled and working! http://i.imgur.com/Gsl9WWf.png Victory :)
------
GC mob spawning seems to override spawning from Lycanite's mobs, it's spawning as set in configs in all 5 dimensions except GC. Is there way to fix that in code also? Also, i want to change fuel costs of rocket flying, but only found tank capacity configuration line in code. Where is fuel usage?:( and question with space station remains.
 
Last edited:

radfast

Member
Staff member
Apr 27, 2014
1,118
339
83
Congrats, seriously I'm impressed - if you don't have Java / Minecraft experience already it's a tough call to set up an actual working compile - took me more than 2 days the first time. But I guess if you know C++ very well, you will find Java quite intuitive.

GC sources are fairly well structured and designed so that other coders can find their way around. We're not big on comments but all the classes and methods are sensibly named. If you see boring variable names like var1, var3, var5 it's probably because that particular part of the code is modified from Forge/MCP decompiled vanilla Minecraft classes.

Fuel costs of a rocket flying are in each rocket entity's onUpdate() method (for example, galacticraft.core.entities.EntityTier1Rocket.onUpdate()), look for a line reading this.removeFuel(1); or similar.
To use less fuel, you would need to set that not to be called on every tick, for example using if (ticks % 2).
Or make the fuel tank capacity larger.

Space station creation cost is given by a "SpaceStationRecipe", search the code for that and you will find it.

I doubt that GC mob spawning "overrides" another mob's spawning, it's probably just that the other mob's spawning never gets called by the GC dimensions' worldgen at all. Galacticraft does not fire a Forge event at mob-spawning time, I guess Lycanite is waiting for an event to be fired. Look in ChunkProviderMoon.getPossibleCreatures() for the GC mob spawning code, and compare that with Minecraft vanilla chunk provider methods (you'll need to look at the Forge-modified versions to see the Forge event being fired).
 
  • Like
Reactions: shifuren

shifuren

Member
Aug 14, 2014
5
0
1
34
But I guess if you know C++ very well, you will find Java quite intuitive.
Well...not very well, 1 year of study in university, so basic knowledge and common sense as well as tons of googling) i can't understand what most of code does though, if it doesn't have obvious names. I've got in contact with Lycanite about mob spawning, he agreed to help.
About fuel: so if i want to set costs of flying overworld-moon to 500 buckets of fuel, i need to increase fuel tank capacity AND modify this.removeFuel(1) to higher number?
 

radfast

Member
Staff member
Apr 27, 2014
1,118
339
83
Fuel - yes, you would need to do that. The amounts are in mB so 500 buckets would be 500,000. You'll have to figure out how much that is per tick.

Lycanite, that sounds great. He's welcome to get in touch with us if a specific code change in Galacticraft is needed to allow his mobs to spawn (or just make a pull request).
 

shifuren

Member
Aug 14, 2014
5
0
1
34
Greetings again! Now we have problems with compatibility of Mobproperties mod (http://fathertoast.wikia.com/wiki/Mob_Properties) and GC spawning in 1.6.4.
I use code like that for all mobs depending on dimension:
Code:
{      "_comment": "change power based on dimension (MARS)",
          "function": "if_in_dimension_-29",
          "functions": [
            {
              "_comment": "set health",
              "function": "modifier",
              "attribute": "generic.maxHealth",
              "value": 140,
              "override": true
            },
            {
              "_comment": "heal health, 7 for undead, 6 else",
              "function": "potion",
              "id": 6,
              "amplifier": 20,
              "duration": 1,
              "override": true
            },
                        {
              "_comment": "modify damage",
              "function": "modifier",
              "attribute": "generic.attackDamage",
              "value": 1.5,
              "operator": 1
            }
]
},
but it seems again not to work only in GC dimensions, others fine.
http://i.imgur.com/QjC6nbN.png
So, it's using hp based on Infernal mobs base config*number of affixes, ignoring MobProperties code
As Mobproperties author is not responding, and atomicstryker is no longer supporting 1.6.4, i'm writing here, maybe someone knows how to fix that interaction of mods.
 

Share this page