• 0

    posted a message on Adding a Mana System

    thank you!

    Posted in: Modification Development
  • 0

    posted a message on Adding a Mana System

    Im making Dishonored mod and Im wondering how to create a mana system.

    Posted in: Modification Development
  • 0

    posted a message on [World Generation] My Ore Won't Gen?

    I figured out what I did wrong. I forgot to register the world with the "GameRegistry"

    Posted in: Modification Development
  • 0

    posted a message on [World Generation] My Ore Won't Gen?

    This is my Block Class


    package enderthegamer01.dishonoredmod.blocks;

    import java.util.Random;

    import net.minecraft.block.Block;
    import net.minecraft.block.material.Material;
    import net.minecraft.block.state.IBlockState;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.item.Item;

    public class TyvianOre extends Block{
    private Item drop;
    private int meta;
    private int least_quantity;
    private int most_quantity;
    protected TyvianOre(String unlocalizedName, Material material, Item drop, int meta, int least_quantity, int most_quantity){
    super(material);
    this.drop = drop;
    this.meta = meta;
    this.least_quantity = least_quantity;
    this.most_quantity = most_quantity;
    this.setUnlocalizedName("TyvianOre");
    this.setCreativeTab(enderthegamer01.dishonoredmod.DishonoredMod.tabDishonored);
    this.setHardness(2.0F);
    this.setResistance(11.0F);
    this.setHarvestLevel("pickaxe", 1);
    this.setStepSound(soundTypeStone);
    }
    protected TyvianOre(String unlocalizedName, Material mat, Item drop, int least_quantity, int most_quantity) {
    this(unlocalizedName, mat, drop, 0, least_quantity, most_quantity);
    }

    protected TyvianOre(String unlocalizedName, Material mat, Item drop) {
    this(unlocalizedName, mat, drop, 1, 1);
    }
    @Override
    public Item getItemDropped(IBlockState blockstate, Random random, int fortune) {
    return this.drop;
    }

    @Override
    public int damageDropped(IBlockState blockstate) {
    return this.meta;
    }

    @Override
    public int quantityDropped(IBlockState blockstate, int fortune, Random random) {
    if (this.least_quantity >= this.most_quantity)
    return this.least_quantity;
    return this.least_quantity + random.nextInt(this.most_quantity - this.least_quantity + fortune + 1);
    }
    }



    My World Gen Class

    package enderthegamer01.dishonoredmod.world;




    import java.util.Random;




    import net.minecraft.block.state.IBlockState;


    import net.minecraft.util.BlockPos;


    import net.minecraft.world.World;


    import net.minecraft.world.chunk.IChunkProvider;


    import net.minecraft.world.gen.feature.WorldGenMinable;


    import net.minecraft.world.gen.feature.WorldGenerator;


    import net.minecraftforge.fml.common.IWorldGenerator;


    import enderthegamer01.dishonoredmod.blocks.DishonoredBlocks;




    public class DishonoredWorldGen implements IWorldGenerator{


    @Override


    public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {


    switch (world.provider.getDimensionId()) {


    case 0: //Overworld


    this.runGenerator(this.gen_TyvianOre, world, random, chunkX, chunkZ, 20, 0, 89);




    break;


    case -1: //Nether




    break;


    case 1: //End




    break;}


    }


    private WorldGenerator gen_TyvianOre;


    public DishonoredWorldGen() {


    this.gen_TyvianOre = new WorldGenMinable(DishonoredBlocks.TyvianOre.getDefaultState(), 10);


    }


    private void runGenerator(WorldGenerator generator, World world, Random rand, int chunk_X, int chunk_Z, int chancesToSpawn, int minHeight, int maxHeight) {


    if (minHeight < 0 || maxHeight > 256 || minHeight > maxHeight)


    throw new IllegalArgumentException("Illegal Height Arguments for WorldGenerator");


    int heightDiff = maxHeight - minHeight + 1;


    for (int i = 0; i < chancesToSpawn; i ++) {


    int x = chunk_X * 16 + rand.nextInt(16);


    int y = minHeight + rand.nextInt(heightDiff);


    int z = chunk_Z * 16 + rand.nextInt(16);


    generator.generate(world, rand, new BlockPos(x, y, z));




    }


    }


    }





    Any idea why my ore wont spawn???

    Posted in: Modification Development
  • 0

    posted a message on [World Gen] My Custom Block Won't spawn in the World?
    [p]This is my Block Class[/p]

    [p]package enderthegamer01.dishonoredmod.blocks;[/p] [p]import java.util.Random;[/p] [p]import net.minecraft.block.Block;
    import net.minecraft.block.material.Material;
    import net.minecraft.block.state.IBlockState;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.item.Item;[/p] [p]public class TyvianOre extends Block{
    private Item drop;
    private int meta;
    private int least_quantity;
    private int most_quantity;
    protected TyvianOre(String unlocalizedName, Material material, Item drop, int meta, int least_quantity, int most_quantity){
    super(material);
    this.drop = drop;
    this.meta = meta;
    this.least_quantity = least_quantity;
    this.most_quantity = most_quantity;
    this.setUnlocalizedName("TyvianOre");
    this.setCreativeTab(enderthegamer01.dishonoredmod.DishonoredMod.tabDishonored);
    this.setHardness(2.0F);
    this.setResistance(11.0F);
    this.setHarvestLevel("pickaxe", 1);
    this.setStepSound(soundTypeStone);
    }
    protected TyvianOre(String unlocalizedName, Material mat, Item drop, int least_quantity, int most_quantity) {
    this(unlocalizedName, mat, drop, 0, least_quantity, most_quantity);
    }[/p] [p]protected TyvianOre(String unlocalizedName, Material mat, Item drop) {
    this(unlocalizedName, mat, drop, 1, 1);
    }
    @Override
    public Item getItemDropped(IBlockState blockstate, Random random, int fortune) {
    return this.drop;
    }[/p] [p]@Override
    public int damageDropped(IBlockState blockstate) {
    return this.meta;
    }[/p] [p]@Override
    public int quantityDropped(IBlockState blockstate, int fortune, Random random) {
    if (this.least_quantity >= this.most_quantity)
    return this.least_quantity;
    return this.least_quantity + random.nextInt(this.most_quantity - this.least_quantity + fortune + 1);
    }
    }
    [/p]

    [p] My World Gen Class[/p]

    package enderthegamer01.dishonoredmod.world;[/p]


    import java.util.Random;[/p]


    import net.minecraft.block.state.IBlockState;[/p]
    import net.minecraft.util.BlockPos;[/p]
    import net.minecraft.world.World;[/p]
    import net.minecraft.world.chunk.IChunkProvider;[/p]
    import net.minecraft.world.gen.feature.WorldGenMinable;[/p]
    import net.minecraft.world.gen.feature.WorldGenerator;[/p]
    import net.minecraftforge.fml.common.IWorldGenerator;[/p]
    import enderthegamer01.dishonoredmod.blocks.DishonoredBlocks;[/p]


    public class DishonoredWorldGen implements IWorldGenerator{[/p]
    @Override[/p]
    public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {[/p]
    switch (world.provider.getDimensionId()) {[/p]
    case 0: //Overworld[/p]
    this.runGenerator(this.gen_TyvianOre, world, random, chunkX, chunkZ, 20, 0, 89);[/p]
    [/p]
    break;[/p]
    case -1: //Nether[/p]


    break;[/p]
    case 1: //End[/p]


    break;}[/p]
    }[/p]
    private WorldGenerator gen_TyvianOre;[/p]
    public DishonoredWorldGen() {[/p]
    this.gen_TyvianOre = new WorldGenMinable(DishonoredBlocks.TyvianOre.getDefaultState(), 10);[/p]
    }[/p]
    private void runGenerator(WorldGenerator generator, World world, Random rand, int chunk_X, int chunk_Z, int chancesToSpawn, int minHeight, int maxHeight) {[/p]
    if (minHeight < 0 || maxHeight > 256 || minHeight > maxHeight)[/p]
    throw new IllegalArgumentException("Illegal Height Arguments for WorldGenerator");[/p]
    int heightDiff = maxHeight - minHeight + 1;[/p]
    for (int i = 0; i < chancesToSpawn; i ++) {[/p]
    int x = chunk_X * 16 + rand.nextInt(16);[/p]
    int y = minHeight + rand.nextInt(heightDiff);[/p]
    int z = chunk_Z * 16 + rand.nextInt(16);[/p]
    generator.generate(world, rand, new BlockPos(x, y, z));[/p]
    [/p]
    }[/p]
    }[/p]
    }[/p]





    [p]Any idea why my ore wont spawn???[/p]
    Posted in: WIP Mods
  • 0

    posted a message on Register Block

    Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item#getItemFromBlock(DishonoredBlocks.TyvianOre, 0, new ModelResourceLocation("dm:Tyvian_Ore", "inventory"));







    Like this?

    Posted in: Modification Development
  • 0

    posted a message on Register Block

    how so?

    Posted in: Modification Development
  • 0

    posted a message on Register Block
    [p]This is my blocks file[/p]
    package enderthegamer01.dishonoredmod.blocks;[/p]


    import net.minecraft.block.Block;[/p]
    import net.minecraft.item.Item;[/p]
    import net.minecraftforge.fml.common.registry.GameRegistry;[/p]


    public final class DishonoredBlocks {[/p]
    publicstatic Block TyvianOre;[/p]






    public static void createBlocks(){[/p]
    GameRegistry.registerBlock(TyvianOre = new TyvianOre("Tyvian_Ore"), "Tyvian_Ore");[/p]


    }[/p]
    }[/p]



    and this is my TyvianOre file[/p]

    package enderthegamer01.dishonoredmod.blocks;[/p]


    import net.minecraft.block.Block;[/p]
    import net.minecraft.block.material.Material;[/p]
    import net.minecraft.creativetab.CreativeTabs;[/p]


    public class TyvianOre extends Block{[/p]
    public TyvianOre(String unlocalizedName, Material material, float hardness, float resistance){[/p]
    super(material);[/p]
    this.setUnlocalizedName("Tyvian_Ore");[/p]
    this.setCreativeTab(CreativeTabs.tabBlock);[/p]
    this.setHardness(2.5F);[/p]
    this.setResistance(10.0F);[/p]
    this.setStepSound(soundTypeStone);[/p]
    this.setHarvestLevel("pickaxe", 2);[/p]
    }[/p]
    public TyvianOre(String unlocalizedName, float hardness, float resistance){[/p]
    this(unlocalizedName, Material.rock, hardness, resistance);[/p]
    }[/p]
    public TyvianOre(String unlocalizedName){[/p]
    this(unlocalizedName, 2.5F, 10.0F);[/p]
    }[/p]
    }[/p]
    Posted in: Modification Development
  • 0

    posted a message on Register Block
    [p]This is my BlockRenderRegister.java file[/p]
    package enderthegamer01.dishonoredmod.client.render.blocks;[/p]


    import net.minecraft.client.Minecraft;[/p] import net.minecraft.client.resources.model.ModelResourceLocation;[/p]
    public final class BlockRenderRegister {[/p]
    public static void registerBlockRenderer(){[/p]
    Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(enderthegamer01.dishonoredmod.blocks.DishonoredBlocks.TyvianOre, 0, new ModelResourceLocation("dm:Tyvian_Ore", "inventory"));[/p]


    }[/p] }[/p]
    For some reason .register(...) is giving me a error saying i need to turn TyvianOre into an item. Please help me fix this![/p]
    Posted in: Modification Development
  • 0

    posted a message on setBlockTextureName(string) is unidentified for the type block
    this is my new add block line in my main file





    public static Block PrisonWall = new PrisonWall(3000, Material.rock).setUnlocalizedName("PrisonWall").setBlockTextureName(Constants.Dishonored Mod:PrisonWall);



    it wants me to import the things underlined in red and in bold. What do i import?
    Posted in: Modification Development
  • 0

    posted a message on setBlockTextureName(string) is unidentified for the type block
    i want back to



    public PrisonWall(int i, Material materialIn) {

    super(materialIn);



    in my block class file and i fixed my main file error but i still have a setblocktexturename error
    Posted in: Modification Development
  • 0

    posted a message on setBlockTextureName(string) is unidentified for the type block
    Quote from TheXFactor17»
    Try putting this.setBlockTextureName above this.setCreativeTab. I've seen this to be an error for some people. Also make sure your texture is in the right location path wise.

    package dishonoredmod.block;

    import net.minecraft.block.Block;
    import net.minecraft.block.material.Material;
    import net.minecraft.creativetab.CreativeTabs;

    public class PrisonWall extends Block {

    public PrisonWall() {
    super(Material.rock);
    this.setBlockTextureName("dishonoredmod:prisonwall");
    this.setCreativeTab(CreativeTabs.tabBlock);
    this.setHardness(7F);
    this.setResistance(7.0F);

    }

    }













    still seems to have the same problem
    eclipse wants me to create a method. Should i?
    now i have an error in my main file





    "The constructor fancywall(int i, Material) is undefined"



    i didn't add the method
    Posted in: Modification Development
  • 0

    posted a message on setBlockTextureName(string) is unidentified for the type block
    this is my new block class file (i picked a new block)







    package dishonoredmod.block;





    import net.minecraft.block.Block;
    import net.minecraft.block.material.Material;
    import net.minecraft.creativetab.CreativeTabs;





    public class PrisonWall extends Block {



    public PrisonWall() {


    super(Material.rock);


    this.setCreativeTab(CreativeTabs.tabBlock);


    this.setHardness(7F);


    this.setResistance(7.0F);


    this.setBlockTextureName("dishonoredmod:prisonwall");


    }



    }
    Posted in: Modification Development
  • 0

    posted a message on setBlockTextureName(string) is unidentified for the type block
    Quote from TheXFactor17»

    Remove the parameters in the "public fancywall" method, and change "super(materialln)" to "super(Material.rock)" - you can change rock to other materials.

    where is the public fancy wall method exactly

    is it the public fancywall(int i, Material materialIn)?
    Posted in: Modification Development
  • 0

    posted a message on setBlockTextureName(string) is unidentified for the type block
    wait its saying it doesn't work
    this.setBlockTextureName() is undefined for type prisonwall
    Posted in: Modification Development
  • To post a comment, please or register a new account.