• 0

    posted a message on Failed to load mod?
    Quote from NMstudios12

    Can you help me? I'm making a food and i cant seem to find whats making the error!

    This is my source-code:
    package net.minecraft.src;
    
    public abstract class mod_Bacon extends BaseMod {
      
      
    	public mod_Bacon(){
    		Bacon.iconIndex = ModLoader.addOverride("/gui/items.png", "/food/bacon.png");
    	  
    		ModLoader.addName(Bacon, "Bacon");
    	  
    		ModLoader.addRecipe(new ItemStack(Bacon, 3), new Object[]{
    			"P", "P", "G", Character.valueOf('P'), Item.porkCooked, Character.valueOf('G'), Item.appleGold
    		});
    	  
    	}
      
    	public void load()
    	{
    	  
    	}
      
    	public static final Item Bacon = new ItemFood(2266, 4, true).setItemName("Bacon");
      
    	public String Version(){
    		return "1.4.6";
    	}
    }


    And this is my error:
    27 achievements
    210 recipes
    Setting user: Player213, -
    Client asked for parameter: server
    LWJGL Version: 2.4.2
    ModLoader 1.4.7 Initializing...
    Failed to load mod from "mod_Bacon.class"

    PLEASE HELP!

    It cannot be an abstract class. Please use code tags when posting source.
    Posted in: Modification Development
  • 0

    posted a message on (Forge) Multitextured block's face in the same direction you are standing
    You have to set the metadata based on the rotation of the player. I use this:


    public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving)
    {
    int l = MathHelper.floor_double((double)((entityliving.rotationYaw * 4F) / 360F) + 0.5D) & 3;
    
    switch (l)
    {
    case 0:
    world.setBlockMetadataWithNotify(i, j, k, 2);
    break;
    
    case 1:
    world.setBlockMetadataWithNotify(i, j, k, 5);
    break;
    
    case 2:
    world.setBlockMetadataWithNotify(i, j, k, 3);
    break;
    
    case 3:
    world.setBlockMetadataWithNotify(i, j, k, 4);
    break;
    }
    }

    If your face side of the block isn't where you want it to be then just change the side it renders on in the getBlockTextureFromSideAndMetadata method.
    Posted in: Modification Development
  • 0

    posted a message on Advanced World Generating[SOLVED]
    Ores are called to generate in BiomeDecorator.
    Posted in: Modification Development
  • 1

    posted a message on Doctor82's Help desk
    Quote from RedFoxy3

    A thread for modding development INSIDE a modding development section?

    It is indeed pointless.
    Posted in: Modification Development
  • 0

    posted a message on Doctor82's Help desk
    The last one of these threads turned into hundreds of unanswered replies. Good luck...

    Quote from jonilo5_five

    How do I register a new Demension? (like The End and stuff)

    this wont work

    DimensionAPI.registerDeminsion(new WorldProviderGreeni());

    You are spelling Dimension wrong.
    registerDimension
    Posted in: Modification Development
  • 0

    posted a message on TechGuy's Modding Tutorials
    Quote from Wei123

    Alright, in the mod_class, in the line of the:
    public static final Item Butter = new ItemButter(5010, 10, false),
    when I add 1F as the food saturation, error happens. Do I need to add or not? Thanks again btw.

    Remeber to always post the error you receive and the code that relates to it. On this occasion, the ItemButter class is required as well as the declaration which you have already posted.
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on TechGuy's Modding Tutorials
    Quote from Wei123

    Sorry to ask again, I really don't get the idea in the food.

    Here:

    (Potion.blindness.id, 10 * 20, 6)

    1. 10 = 10 is what? I left it 10 because I really don't get the idea of that.

    (Potion.blindness.id, 10 * 20, 6)

    2. 20 = the seconds of the effect of the food? I wrote there 60 for 1 minute, is it right?

    (Potion.blindness.id, 10 * 20, 6)

    3. 6 = I wrote 0 there as what you've said because it's just an amplifier

    The 10 is the amount of ticks it lasts for. You use 20 as a multiplier which makes the first to equal to that amount of seconds. Don't change the 20, only change the 10. 1 second is equal to 20 ticks. Eg.
    (Potion.blindness.id, 10 * 20, 6)

    Would last for 10 seconds.

    (Potion.blindness.id, 5 * 20, 6)

    Would last for 5 seconds.

    (Potion.blindness.id, 14 * 20, 6)

    Would last for 14 seconds. So on and etc.


    I could never seem to get anything to change when I messed around with the amplifier.
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on TechGuy's Modding Tutorials
    public int idDropped(int i, Random random, int j)
    {
    return mod_bluegem.BlockOfBlueGem.blockID;
    }
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on TechGuy's Modding Tutorials
    Quote from Wei123

    I always get a syntax error on the [b]bolded text:[/b]

    package net.minecraft.src;
    public class mod_bluegem extends BaseMod
    {
    		 public static final Item Camera = new Item(3450).setItemName("Camera");
    		 public static final Item BlueGem = new ItemBlueGem(3450).setItemName("bluegem").setCreativeTab(CreativeTabs.tabMaterials);
    		 public static final Block BlockOfBlueGem = new BlockBlockOfBlueGem (140, 0).setBlockName("bluegemblock").setHardness(3F).setResistance(4F).setLightValue(1F).setCreativeTab(CreativeTabs.tabBlock).setStepSound(Block.soundStoneFootstep);
    	
    		 public void load()
    		 {
    						 BlueGem.iconIndex = ModLoader.addOverride("/gui/items.png", "/bluegem/bluegem.png");
    						 ModLoader.addName(BlueGem, "Blue Gem");
    						 ModLoader.addRecipe(new ItemStack(BlueGem, 64), new Object [] {"#", Character.valueOf('#'), Block.dirt});
    						
    						 BlockOfBlueGem.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/bluegem/bluegemblock.png");
    						 ModLoader.registerBlock(BlockOfBlueGem);
    						 ModLoader.addName(BlockOfBlueGem, "Block of Blue Gem");
    						 ModLoader.addRecipe(new ItemStack(BlockOfBlueGem, 64), new Object [] {"###", "###", "###", Character.valueOf('#'), Block.stone});
    						 }
    	
    		 public String getVersion()
    		 {
    						 return "1.4.7";
    		 }
    }

    BlockBlockOfBlueGem[/b]']
    package net.minecraft.src;
    import java.util.Random;
    public class BlockBlockOfBlueGem extends Block
    {
    public BlockBlockOfBlueGem(int i, int j)
    {
    super(i, j, Material.rock);
    }
    public int id3451(int i, Random random, int j)
    {
    return mod_bluegem.BlockOfBlueGem.[b]140[/b];
    }
    public int quantity1(Random random)
    {
    return 1;
    }
    }

    What should I put in the blockID?

    Block ID - 140?
    or
    Block ID - 3451?

    I also don't what's the data value. Should I put 140?

    Also, can you check if I got any mistakes.. Thanks!

    You don't put an actual id there. You use blockID.
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on Mod making
    That line isn't a problem. It doesn't cause any issues.
    Posted in: Modification Development
  • 0

    posted a message on TileEntity NBT Help
    Quote from Nouish

    As you know I am unfamiliar with the Minecraft code structure, but when approaching such problems the best solution is always to read into what you want to do.

    Notch's NBT format is quite interesting actually; really worth looking into ;)

    I've looked at all the vanilla blocks that do this. My code is the same but doesn't seem to work.
    Posted in: Modification Development
  • 0

    posted a message on TechGuy's Modding Tutorials
    Quote from Wei123

    What do I need to change to make the mod for 1.4.7?

    What error/s are you getting? I'll help you fix those but I won't update the tutorial.
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on TechGuy's Modding Tutorials
    Quote from Wei123

    Hey, can you update the tools and ore generation section to 1.4.7?

    Nope, sorry. Read the rant I just added to the top of the first OP.
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on Modding On A Mac
    Quote from Nouish

    Hello! Modding on a Macintosh does not differ alot from Windows. Where tutorials say run this and this .bat file, do that, but instead select the file with an .sh extension.

    In Terminal you set the current directory to the mcp folder like this

    cp path/to/mcp


    Note that you can actually drag the folder onto the Terminal ;)

    sh decompile.sh


    If you are new to Java or programming in general, take a look at these (official Oracle informative pages):

    http://docs.oracle.c...avase/tutorial/
    http://www.oracle.co...ions-150003.pdf

    Good luck! =)

    I'm fairly sure that
    cd path/to/mcp

    is used for changing directories?

    cp

    is used for copying files in Terminal.

    I could be wrong. I don't have a Mac to test stuff on ;)
    Posted in: Modification Development
  • 0

    posted a message on Alternate method for automatic enchanting?
    Rather than putting this in your constructor:

     ItemStack stack = new ItemStack(Item.swordDiamond, 1);
    stack.addEnchantment(Enchantment.fireAspect, 1);
    CraftingManagerEssInfuser.getInstance().getRecipeList().add(new ShapedOreRecipe(stack, true, new Object[]{
    " X ",
    " X ",
    " X ",
    Character.valueOf('X'), mod_mCrops.InfusedDiamond}));

    Put it in your mod class. I'd say it is crashing with a null pointer because you are trying to access the CraftingManagerEssInfuser object but it is still being created.
    Posted in: Modification Development
  • To post a comment, please .