• 0

    posted a message on NoSuchMethodException when trying to register slabs in 1.7.10?

    It is like infinitely harder to create a custom slab than a custom stair. I am trying to register a slab but no can do. What am I doing wrong?

    In init():

    bedrock_slab = new NewBlockSlab(null, Blocks.bedrock, 0);
    double_bedrock_slab = new NewBlockSlab(bedrock_slab, Blocks.bedrock, 0);
    GameRegistry.registerBlock(bedrock_slab, NewItemSlab.class, bedrock_slab.getUnlocalizedName(), bedrock_slab, double_bedrock_slab);


    Then I have this:

    private class NewItemSlab extends ItemSlab {
     public NewItemSlab(Block block, BlockSlab slab, BlockSlab doubleSlab) {
     super(block, slab, doubleSlab, block==doubleSlab);
     }
     }
     private class NewBlockSlab extends BlockSlab {
     private Item itemDropped;
     public NewBlockSlab(Block single, Block block, int metadata) {
     super(single!=null, block.getMaterial());
     this.useNeighborBrightness = true;
     this.blockHardness = block.getBlockHardness(null, 0, 0, 0);
     this.blockResistance = block.getExplosionResistance(null);
     this.setHarvestLevel(block.getHarvestTool(metadata), block.getHarvestLevel(metadata));
     itemDropped = Item.getItemFromBlock(this.field_150004_a? single : this);
     this.setBlockName((this.field_150004_a? "double_" : "")+block.getUnlocalizedName().substring(5)+"_slab").setCreativeTab(this.field_150004_a? null : TABMOREITEMSBLOCKS);
     }
     @Override public String func_150002_b(int metadata) {
     return this.getUnlocalizedName();
     }
     @Override public Item getItemDropped(int metadata, Random rand, int fortune) {
     return itemDropped;
     }
     @Override public Item getItem(World world, int x, int y, int z) {
     return itemDropped;
     }
     }

    Those classes don't have their own file. Their defined inside my main class. Anyways how do I make slabs work? I'm not worrying about textures for now, I just want them to be able to stack? What gives?

    Posted in: Modification Development
  • 0

    posted a message on How do I use a vanilla texture for a mod block

    1. That wasn't a question, it was a statement. 2. My apologies.

    Posted in: Modification Development
  • 0

    posted a message on How do I use a vanilla texture for a mod block

    Haha I figured it out but this site is so inactive I'm not even sure everyone here deserves to no if no one is online.

    Posted in: Modification Development
  • 0

    posted a message on getIcon() Returning Wrong Icon

    5 years, no replies?

    Posted in: Modification Development
  • 0

    posted a message on How do I use a vanilla texture for a mod block

    Here's what I have so far:


    smooth_stone = new SmoothBlock("smooth_stone", Blocks.double_stone_slab.getBlockTextureFromSide(1), 2.4F, 9);



    And here's the class I defined for SmoothBlock:


    private class SmoothBlock extends Block {
     private IIcon blockIcon;
     public SmoothBlock(String name, IIcon icon, float hardness, float resistance) {
     super(Material.rock);
     blockIcon = icon;
     GameRegistry.registerBlock(this.setBlockName(name).setCreativeTab(TABMOREITEMSBLOCKS).setHardness(hardness).setResistance(resistance), name);
     }
     @Override public IIcon getIcon(int side, int meta) {
     return blockIcon;
     }
    }



    I get a strange block whose texture resembles a texture atlas. What am I doing wrong and how do I fix it?


    ALSO THE MINECRAFT FORUM EDITOR COMPLETELY SUCKS!

    Posted in: Modification Development
  • 0

    posted a message on How do I use a vanilla texture for a mod block

    I tried that, but the texture of the block still just looks like a texture atlas, not the top or side or whatever texture of sandstone.

    Posted in: Modification Development
  • 0

    posted a message on Q: What do I need to import to use IIconRegister?

    A:

    import net.minecraft.client.renderer.texture.IIconRegister;
    Posted in: Modification Development
  • 0

    posted a message on How do I use a vanilla texture for a mod block

    I am explicitly trying to make mods for 1.7.10. There are no blockstate jsons in this version. I am not familiar with programming for the newer versions. Any version after 1.7.10 is new. This includes 1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16.1.

    Posted in: Modification Development
  • 0

    posted a message on What should I set the block harvestLevel to to make it breakable by hand?

    Yep. So no matter what I use, it won't drop. Using harvestLevel, not hardness.

    Posted in: Modification Development
  • 0

    posted a message on How do I use a vanilla texture for a mod block

    I tried this:

    private class SmoothBlock extends Block {
     private IIcon blockIcon;
     public SmoothBlock(String name, IIcon icon, float hardness, float resistance) {
      super(Material.rock);
      blockIcon = icon;
     GameRegistry.registerBlock(this.setBlockName(name).setCreativeTab(TABMOREITEMSBLOCKS).setHardness(hardness).setResistance(resistance), name);
     }
     @Override public IIcon getIcon(int side, int meta) {
      return blockIcon;
     }
    }


    And used it like this:

    smooth_stone = new SmoothBlock("smooth_stone", Blocks.double_stone_slab.getIcon(0, 0), 1.8F, 9);

    I ended up with something like this.

    How can I set the texture of a block to an existing vanilla texture, say minecraft:stone_slab_top? It seems setBlockTextureName() doesn't do anything at all.

    Just how do I set a mod's block's texture to use a vanilla texture?

    Posted in: Modification Development
  • 0

    posted a message on What should I set the block harvestLevel to to make it breakable by hand?

    Thanks. Bonus, how about to make it unharvestable at all?

    Posted in: Modification Development
  • 0

    posted a message on What should I set the block harvestLevel to to make it breakable by hand?

    Suppose I'm adding a new kind of dirt.

    mydirt = new NewBlock(Material.ground);
    mydirt.setHarvestLevel("spade", ???);


    I want it to be breakable by hand. What do I set it to?

    Posted in: Modification Development
  • 0

    posted a message on Problem with textures minecraft forge 1.7.10

    Well it didn't. Thank you for wasting my time. Absolutely fantastic.

    Quote from ombrepanda1»

    I think the problem you are having is that in setBlockTextureName and setTextureName you have everything joined together, example:


    setBlockTextureName(Main.MODID+":bestblockever")


    However, it shouldn't be like that it should be:


    setBlockTextureName(Main.MODID + ":bestblockever")


    Hope this helps!

    Posted in: Modification Development
  • To post a comment, please .