Posting addons for GC3 (Galacticraft for minecraft 1.7.2+)

Twylite Fang

Member
Jul 29, 2014
27
0
6
30
Quite simply, any and all addons that have been cleared for posting by Micdoodle8 can be posted here, so people wanting to get extra planets while waiting for more that work in the official addon can just come directly here and get addons for GC3 (Cos then you can have a spinning space station over say... Jupiter :D
 

Twylite Fang

Member
Jul 29, 2014
27
0
6
30
I was thinking ahead lol... There's only discontinued addons for GC2 to date ._. Then again, GC3 is still only in beta, but realistically, it's slightly annoying how there's like what... 5 addons, if that, and they're just about all discontinued. I think only 4-Space isn't discontinued yet :p There should be a thread for all addons that are for 1.7 though. Maybe we can simply lock this thread for now, and once somebody comes up with an addon for GC3, unlock this thread and use it as a collection of all the addons :D
 

InsanityPie

Member
Jun 18, 2014
132
25
28
Im nowhere but also everywhere
Im trying to make an addon but since im a begginer at coding in general im currently stuck on mars moss spread... I have no idea how to access the galacticraft mars block metadata for the surface rock to be the block it spreads to. -_-
 

Twylite Fang

Member
Jul 29, 2014
27
0
6
30
I jsut looked into the mod files and apparently it's actually done in the form of a .class file. Maybe try google or youtube for tutorials on how to access metadata inside .class files?
 

InsanityPie

Member
Jun 18, 2014
132
25
28
Im nowhere but also everywhere
I jsut looked into the mod files and apparently it's actually done in the form of a .class file. Maybe try google or youtube for tutorials on how to access metadata inside .class files?
I just started programming somewhere around a week ago so making meta data files isn't in my range yet and I can't seem to figure out how to calls specific blocks from the galacticraft codes meta data... besides if some one didn't know what a class file is or how they work then why the heck are they trying to mod?! That's literally basic java step 1! xD
Im going to be messing around with my code to see if I can call Mars blocks similar to the the way I do for the Moons blocks. the one thing im currently stuck on is a special spreading block that can terraform Mars to look more "living" like a more slightly green/orange overworld, I think it will be a sweet and slightly realistic feature if moss can survive and spread on mars... I guarantee at least one species can do it in real life if we did need to warm the planet up since there's ice and co2, maybe I might be able to make a way for a specific area to be "livable" after a certain amount of moss has spread in a given area?

Wow that was a long post! I really need to cut down on the amount I type...
 

Twylite Fang

Member
Jul 29, 2014
27
0
6
30
Well actually there's no life on mars any more higher than like... Bacterial lol

And there's nothing wrong with large posts ;) I do them a lot XD
 

radyjko

Member
May 7, 2014
93
18
8
Glassteria
What i think is

What I think Is What I think I think I tHHHHink

Galacticraft 3 is still unstable and Galacticraft 2 (and rest of 1.6.4 mod) is dead. Also Galacticraft isn't that known like other mods like for example Thaumcraft. Modders that would make add-ons just don't know about GC or thry think it is overcomplicated or no one would use them.
 

radfast

Member
Staff member
Apr 27, 2014
1,118
339
83
Hey @InsanityPie. That's a nice idea, and programming an add on is a pretty good way to learn programming. All the Galacticraft Mars terrain blocks (dirt, sub-surface rock and rock) are all the same type of block, BlockBasicMars, with different metadata.

This is what the metadata means:
0-3 - Mars ores: copper, tin, desh, iron
4 - Mars cobblestone
5 - Mars dirt
6 - Mars sub-surface rock
7 - Mars dungeon brick
8 - decoration block (don't use)
9 - Mars rock
10 - hidden dungeon block (don't use)

You can check the metadata values if you use NEI to look at the item ID and metadata.
 

InsanityPie

Member
Jun 18, 2014
132
25
28
Im nowhere but also everywhere
Hey @InsanityPie. That's a nice idea, and programming an add on is a pretty good way to learn programming. All the Galacticraft Mars terrain blocks (dirt, sub-surface rock and rock) are all the same type of block, BlockBasicMars, with different metadata.

This is what the metadata means:
0-3 - Mars ores: copper, tin, desh, iron
4 - Mars cobblestone
5 - Mars dirt
6 - Mars sub-surface rock
7 - Mars dungeon brick
8 - decoration block (don't use)
9 - Mars rock
10 - hidden dungeon block (don't use)

You can check the metadata values if you use NEI to look at the item ID and metadata.
I already figured out the meta data values a couple of hours by looking through the galacticraft code before reading your post but since im still a beginner it's calling on the mars surface rock in my MarsMoss class that's confusing me... other then that, creating a custom solar system(Haven't been able to get the thing to show up ingame even though it's fully registered and has a star set), gettting my custom planet to show up(same issue as the solar system... the thing just won't show up ingame even if I use Sol as a temp system), and finishing up the moon that's already added while starting the other one.
I did get two mobs created based on their vanilla equvelents codes but with galacticraft AI to allow them to breath without oxygen while also getting rid of the swim AI in exchange for breathing in water... Ones a breedable custom model cow while the others a tamable wolf, I always wanted a mob you could make a farm with under water xD
I think ive got quite a bit done in the short amount of time ive been coding if I do say so myself!
Now back to trying to learn block sorting so I don't have over 20 class files for blocks alone...
 
  • Like
Reactions: Twylite Fang

Twylite Fang

Member
Jul 29, 2014
27
0
6
30
Lol why don't you submit the system you made to whoever is handling the creation of dimensions for Planets, and get them to add your system, which will actually save some time :D Oh and you'll also contribute to the mod :D Plus, once either Mitch or Radfast adds in the dungeon for Asteroids (which I think should be brown like the asteroids, or maybe blue like the chest) and the chest gets implemented, as well as a boss added (I'm thinking Giant Boss, so basically an evolved Giant XD) then there will be a schematic added, and a Tier 4 rocket, then your system can be implemented XD
 

IceClimber11

Member
Aug 30, 2013
195
9
28
28
The Matrix
www.IceClimber11.tk
I just started programming somewhere around a week ago so making meta data files isn't in my range yet and I can't seem to figure out how to calls specific blocks from the galacticraft codes meta data... besides if some one didn't know what a class file is or how they work then why the heck are they trying to mod?! That's literally basic java step 1! xD
Im going to be messing around with my code to see if I can call Mars blocks similar to the the way I do for the Moons blocks. the one thing im currently stuck on is a special spreading block that can terraform Mars to look more "living" like a more slightly green/orange overworld, I think it will be a sweet and slightly realistic feature if moss can survive and spread on mars... I guarantee at least one species can do it in real life if we did need to warm the planet up since there's ice and co2, maybe I might be able to make a way for a specific area to be "livable" after a certain amount of moss has spread in a given area?

Wow that was a long post! I really need to cut down on the amount I type...

Hello! I have done something slimier for this in my addon, and to call one of his blocks you need to pull a
Code:
import com.mcdoodle8.something.something;
then you can reference the items in that file.
To add the spreading impliment
Code:
@Override
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
    if (!par1World.isRemote)
    {
        if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && par1World.getBlockLightOpacity(par2, par3 + 1, par4) > 2)
        {
            par1World.setBlock(par2, par3, par4, PandoraMain.pandoradirt.blockID);
        }
        else if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9)
        {
            for (int l = 0; l < 4; ++l)
            {
                int i1 = par2 + par5Random.nextInt(3) - 1;
                int j1 = par3 + par5Random.nextInt(5) - 3;
                int k1 = par4 + par5Random.nextInt(3) - 1;
                int l1 = par1World.getBlockId(i1, j1 + 1, k1);

                if (par1World.getBlockId(i1, j1, k1) == PandoraMain.pandoradirt.blockID && par1World.getBlockLightValue(i1, j1 + 1, k1) >= 4 && par1World.getBlockLightOpacity(i1, j1 + 1, k1) <= 2)
                {
                    par1World.setBlock(i1, j1, k1, this.blockID);
                }
            }
        }
    }
}

}
The Grass is eating PandoraMain.pandoradirt. All you need to do is replace that with the block you want your item to eat( correctly referenced). Dont forget to add
Code:
 this.setTickRandomly(true);
under super(id, material);


Finished block:
Code:
package iceclimber11.pandora;

import java.util.List;
import java.util.Random;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.IPlantable;

public class pandoragrass extends Block
{

        public pandoragrass (int id,Material material)
        {
                super(id, material);
                this.setTickRandomly(true);
        }

public boolean canSustainPlant(World world, int x, int y, int z, ForgeDirection direction, IPlantable plant)
{
    return true;
}
       
public int idDropped(int metadata,Random random, int fortune){
            return PandoraMain.pandoradirt.blockID;}
           
@SideOnly(Side.CLIENT)
public static Icon topIcon;
@SideOnly(Side.CLIENT)
public static Icon bottomIcon;
@SideOnly(Side.CLIENT)
public static Icon sideIcon;

@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister icon){
    topIcon = icon.registerIcon("pandora:pandora.grass_top");
    sideIcon = icon.registerIcon("pandora:pandora.grass_side");
    bottomIcon = icon.registerIcon("pandora:pandora.dirt");
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIcon(int side, int metadata){
    if(side == 0){
        return bottomIcon;
    } else if (side == 1){
        return topIcon;
    } else {
        return sideIcon;
    }
   
}
@Override
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
    if (!par1World.isRemote)
    {
        if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && par1World.getBlockLightOpacity(par2, par3 + 1, par4) > 2)
        {
            par1World.setBlock(par2, par3, par4, PandoraMain.pandoradirt.blockID);
        }
        else if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9)
        {
            for (int l = 0; l < 4; ++l)
            {
                int i1 = par2 + par5Random.nextInt(3) - 1;
                int j1 = par3 + par5Random.nextInt(5) - 3;
                int k1 = par4 + par5Random.nextInt(3) - 1;
                int l1 = par1World.getBlockId(i1, j1 + 1, k1);

                if (par1World.getBlockId(i1, j1, k1) == PandoraMain.pandoradirt.blockID && par1World.getBlockLightValue(i1, j1 + 1, k1) >= 4 && par1World.getBlockLightOpacity(i1, j1 + 1, k1) <= 2)
                {
                    par1World.setBlock(i1, j1, k1, this.blockID);
                }
            }
        }
    }
}

}
 

InsanityPie

Member
Jun 18, 2014
132
25
28
Im nowhere but also everywhere
Hello! I have done something slimier for this in my addon, and to call one of his blocks you need to pull a
Code:
import com.mcdoodle8.something.something;
then you can reference the items in that file.
To add the spreading impliment
Code:
@Override
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
    if (!par1World.isRemote)
    {
        if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && par1World.getBlockLightOpacity(par2, par3 + 1, par4) > 2)
        {
            par1World.setBlock(par2, par3, par4, PandoraMain.pandoradirt.blockID);
        }
        else if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9)
        {
            for (int l = 0; l < 4; ++l)
            {
                int i1 = par2 + par5Random.nextInt(3) - 1;
                int j1 = par3 + par5Random.nextInt(5) - 3;
                int k1 = par4 + par5Random.nextInt(3) - 1;
                int l1 = par1World.getBlockId(i1, j1 + 1, k1);

                if (par1World.getBlockId(i1, j1, k1) == PandoraMain.pandoradirt.blockID && par1World.getBlockLightValue(i1, j1 + 1, k1) >= 4 && par1World.getBlockLightOpacity(i1, j1 + 1, k1) <= 2)
                {
                    par1World.setBlock(i1, j1, k1, this.blockID);
                }
            }
        }
    }
}

}
The Grass is eating PandoraMain.pandoradirt. All you need to do is replace that with the block you want your item to eat( correctly referenced). Dont forget to add
Code:
 this.setTickRandomly(true);
under super(id, material);


Finished block:
Code:
package iceclimber11.pandora;

import java.util.List;
import java.util.Random;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.IPlantable;

public class pandoragrass extends Block
{

        public pandoragrass (int id,Material material)
        {
                super(id, material);
                this.setTickRandomly(true);
        }

public boolean canSustainPlant(World world, int x, int y, int z, ForgeDirection direction, IPlantable plant)
{
    return true;
}
    
public int idDropped(int metadata,Random random, int fortune){
            return PandoraMain.pandoradirt.blockID;}
        
@SideOnly(Side.CLIENT)
public static Icon topIcon;
@SideOnly(Side.CLIENT)
public static Icon bottomIcon;
@SideOnly(Side.CLIENT)
public static Icon sideIcon;

@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister icon){
    topIcon = icon.registerIcon("pandora:pandora.grass_top");
    sideIcon = icon.registerIcon("pandora:pandora.grass_side");
    bottomIcon = icon.registerIcon("pandora:pandora.dirt");
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIcon(int side, int metadata){
    if(side == 0){
        return bottomIcon;
    } else if (side == 1){
        return topIcon;
    } else {
        return sideIcon;
    }

}
@Override
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
    if (!par1World.isRemote)
    {
        if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && par1World.getBlockLightOpacity(par2, par3 + 1, par4) > 2)
        {
            par1World.setBlock(par2, par3, par4, PandoraMain.pandoradirt.blockID);
        }
        else if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9)
        {
            for (int l = 0; l < 4; ++l)
            {
                int i1 = par2 + par5Random.nextInt(3) - 1;
                int j1 = par3 + par5Random.nextInt(5) - 3;
                int k1 = par4 + par5Random.nextInt(3) - 1;
                int l1 = par1World.getBlockId(i1, j1 + 1, k1);

                if (par1World.getBlockId(i1, j1, k1) == PandoraMain.pandoradirt.blockID && par1World.getBlockLightValue(i1, j1 + 1, k1) >= 4 && par1World.getBlockLightOpacity(i1, j1 + 1, k1) <= 2)
                {
                    par1World.setBlock(i1, j1, k1, this.blockID);
                }
            }
        }
    }
}

}

I already set all that up in the correct class files before I read your post and tested that it indeed works with spreading already... it's making my custom block spread to a specific meta id in the MarsBlocks.marsBlock class file. I will admit I'm probably missing something obvious here but I have no clue what. If it helps any here's my semi-done code for the block:


Code:
package com.insanitypie.jurnermod.block;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

import java.util.Random;

import com.insanitypie.jurnermod.main.MainClass;

import micdoodle8.mods.galacticraft.planets.mars.blocks.MarsBlocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import net.minecraft.world.ColorizerGrass;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.EnumPlantType;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.common.util.ForgeDirection;


public class MarsMoss extends Block {

    @SideOnly(Side.CLIENT)
    private IIcon iconGrassTop;
    @SideOnly(Side.CLIENT)
    private IIcon iconSnowSide;

    public MarsMoss(Material grass) {
        super(Material.grass);
        this.setTickRandomly(true);
        this.setBlockTextureName(MainClass.MODID + ":marsMoss");
        this.setBlockName("MarsMoss");
        this.setStepSound(soundTypeGrass);
        this.setHardness(0.7F);
    }

    @Override
    @SideOnly(Side.CLIENT)
    public IIcon getIcon(int side, int meta) {
        return side == 1 ? this.iconGrassTop : (side == 0 ? MarsBlocks.marsBlock.getBlockTextureFromSide(side) : this.blockIcon);
    }

    @Override
    public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
        if (!par1World.isRemote) {
            if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && par1World.getBlockLightOpacity(par2, par3 + 1, par4) > 2) {
                par1World.setBlock(par2, par3, par4, MarsBlocks.marsBlock);
            }
            else if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9)
            {
                for (int l = 0; l < 4; ++l)
                {
                    int i1 = par2 + par5Random.nextInt(3) - 1;
                    int j1 = par3 + par5Random.nextInt(5) - 3;
                    int k1 = par4 + par5Random.nextInt(3) - 1;
                    Block l1 = par1World.getBlock(i1, j1 + 1, k1);

                    if (par1World.getBlock(i1, j1, k1) == MarsBlocks.marsBlock && par1World.getBlockMetadata(i1, j1, k1) == 0 && par1World.getBlockLightValue(i1, j1 + 1, k1) >= 4 && par1World.getBlockLightOpacity(i1, j1 + 1, k1) <= 2)
                    {
                        par1World.setBlock(i1, j1, k1, MainClass.MarsMoss, 2, 1 & 2);
                    }
                }
            }
        }
    }

    @Override
    public Item getItemDropped(int par1, Random par2Random, int par3) {
        return MarsBlocks.marsBlock.getItemDropped(par1, par2Random, par3);
    }

    @SideOnly(Side.CLIENT)
    @Override
    public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
        if (side == 1)
            return this.iconGrassTop;
        else if (side == 0)
            return MarsBlocks.marsBlock.getIcon(side, side);
        else {
            Material material = blockAccess.getBlock(x, y + 1, z).getMaterial();
            return material != Material.snow && material != Material.craftedSnow ? this.blockIcon : this.iconSnowSide;
        }
    }

    public void registerBlockIcons(IIconRegister icon){
        iconGrassTop = icon.registerIcon(MainClass.MODID + ":marsMosstop");
        blockIcon = icon.registerIcon(MainClass.MODID + ":marsMossside");
        iconSnowSide = icon.registerIcon(MainClass.MODID + ":marsMosssnowside");
        }
  
    @Override
    public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plant) {
        Block plantID = plant.getPlant(world, x, y + 1, z);
        EnumPlantType plantType = plant.getPlantType(world, x, y + 1, z);

        switch (plantType)
        {
            case Plains: return true;
            case Beach:
                boolean hasWater = (world.getBlock(x - 1, y, z    ).getMaterial() == Material.water ||
                                    world.getBlock(x + 1, y, z    ).getMaterial() == Material.water ||
                                    world.getBlock(x,    y, z - 1).getMaterial() == Material.water ||
                                    world.getBlock(x,    y, z + 1).getMaterial() == Material.water);
                return hasWater;
            default: return false;
        }
    }

    @Override
    public void onPlantGrow(World world, int x, int y, int z, int sourceX, int sourceY, int sourceZ) {
        world.setBlock(x, y, z, MarsBlocks.marsBlock, 0, 2);
    }
  
    @Override
    protected boolean canSilkHarvest() {
        return true;
    }
}

It's probably butchered since I have been trying to call on the dang surface rock meta for a few days now and changing bits of code here and there. I need a break from this for a bit so im putting the addon in hiatus until I figure something out without all the extra stress... and to get it to stop thinking im calling the mars copper ore!
I hate meta data so much right now :/
 
  • Like
Reactions: Twylite Fang

Share this page