Can you help me i was just writing two things
1. GameRegistry.addSmelting(Main.ruby.itemID, new ItemStack(Main.metaGem,1,2), 5);
2. if(fuel.itemID == Main.ruby.itemID){
and it doesn't work can you help thx
You have to be more specific what doesn't work. Does eclipse put out an error? If yes, then what is it? Does minecraft crash? Then put the error report in spoilers. It would also be helpful to have the whole class file in code and spoiler tags. Thanks!
Theirs no error,it just does not let me use eclipse.
So you downloaded the eclipse zip, extracted it, went in and launched eclipse.exe and eclipse did not load? Or are you having problems setting the workspace up.
Deverion i wouldn't mind writing a little section for you to copy paste into the main thread on how to format and post questions/bug reports/crashes/codequestions/etc.
Rollback Post to RevisionRollBack
"The signature should be a place of thought and power, with images and personalities, not an advertising banner"
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
Deverion i wouldn't mind writing a little section for you to copy paste into the main thread on how to format and post questions/bug reports/crashes/codequestions/etc.
You have to be more specific what doesn't work. Does eclipse put out an error? If yes, then what is it? Does minecraft crash? Then put the error report in spoilers. It would also be helpful to have the whole class file in code and spoiler tags. Thanks!
So you downloaded the eclipse zip, extracted it, went in and launched eclipse.exe and eclipse did not load? Or are you having problems setting the workspace up.
Deverion i wouldn't mind writing a little section for you to copy paste into the main thread on how to format and post questions/bug reports/crashes/codequestions/etc.
You have to be more specific what doesn't work. Does eclipse put out an error? If yes, then what is it? Does minecraft crash? Then put the error report in spoilers. It would also be helpful to have the whole class file in code and spoiler tags. Thanks!
If I'm not mistaken, you are supposed to put all language registry, game registry (blocks), crafting recipes and smelting recipes in CommonProxy, not metaGem.
might need some formatting to make prettier, and maybe some rewording to make it more straightforward, but here:
How to ask questions:
[spoiler]
Asking questions correctly and reporting errors are 2 of the most important skills to becoming a modder. It is almost guaranteed that if you try to mod minecraft, especially with no java experience, you will run into errors. This is a basic guide to asking questions and reporting errors.
Asking Questions:
You might have a suggestion, or a question whether any idea is possible. Here is the basic format for asking questions, in a reply:
>]Summary of question: ex Is it possible to make ponies?]
>Leave a space
>[More Info: I have just finished a mob entity tutorial on another site, and I was just wondering if it was possible to create custom 3d models to make ponies?]
Do not ask stupid questions/questions where you will not be able to understand the answer to. For example, "CAn haz make like P0ni?" would never be responded to. Also, if you ask how to make ponies, it is implied you have already the experience of a basic entity, not that you just started modding and haven't even created a block yet.
All questions should be as grammatically correct and spell-checked as you can. You will be excused if English is not your native language/ is your second language.
Reporting Errors:
This is generally more universal than asking questions. Follow a format like this:
[Basic error: ex. Eclipse will not display the src/My mod crashes after adding language registry]
[More Info: ex: When I open eclipse and in package explorer, the package for src has a lock on it/My mod crashes with an error report, I put it below]
[Code: If you have errors in your code, either put it in [spoiler] and [code] tags so it doesn't flood the whole post, or upload it to github/pastebin/corresponding site so we can view the code and help you. If you say "mah codez error pls help" and don't put the source, you will be shamed]
[Error Report: If you have problems with minecraft crashing, find the error report (if you run minecraft from within eclipse to test it, it will be in .../forge/mcp/jars/crash-reports)
As with questions, everything must be grammatically correct and spell-checked. You will be excused if English is not your native language/is your second language.
[/spoiler]
Rollback Post to RevisionRollBack
"The signature should be a place of thought and power, with images and personalities, not an advertising banner"
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
If I'm not mistaken, you are supposed to put all language registry, game registry (blocks), crafting recipes and smelting recipes in CommonProxy, not metaGem.
might need some formatting to make prettier, and maybe some rewording to make it more straightforward, but here:
How to ask questions:
[spoiler]
Asking questions correctly and reporting errors are 2 of the most important skills to becoming a modder. It is almost guaranteed that if you try to mod minecraft, especially with no java experience, you will run into errors. This is a basic guide to asking questions and reporting errors.
Asking Questions:
You might have a suggestion, or a question whether any idea is possible. Here is the basic format for asking questions, in a reply:
>]Summary of question: ex Is it possible to make ponies?]
>Leave a space
>[More Info: I have just finished a mob entity tutorial on another site, and I was just wondering if it was possible to create custom 3d models to make ponies?]
Do not ask stupid questions/questions where you will not be able to understand the answer to. For example, "CAn haz make like P0ni?" would never be responded to. Also, if you ask how to make ponies, it is implied you have already the experience of a basic entity, not that you just started modding and haven't even created a block yet.
All questions should be as grammatically correct and spell-checked as you can. You will be excused if English is not your native language/ is your second language.
Reporting Errors:
This is generally more universal than asking questions. Follow a format like this:
[Basic error: ex. Eclipse will not display the src/My mod crashes after adding language registry]
[More Info: ex: When I open eclipse and in package explorer, the package for src has a lock on it/My mod crashes with an error report, I put it below]
[Code: If you have errors in your code, either put it in [spoiler] and [code] tags so it doesn't flood the whole post, or upload it to github/pastebin/corresponding site so we can view the code and help you. If you say "mah codez error pls help" and don't put the source, you will be shamed]
[Error Report: If you have problems with minecraft crashing, find the error report (if you run minecraft from within eclipse to test it, it will be in .../forge/mcp/jars/crash-reports)
As with questions, everything must be grammatically correct and spell-checked. You will be excused if English is not your native language/is your second language.
[/spoiler]
Looks good, can you put it inside a code tag so I can copy it later?
Looks good, can you put it inside a code tag so I can copy it later?
I guess... but why? can't you just copy paste directly from spoiler?
[spoiler]
[code][color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]Asking questions correctly and reporting errors are 2 of the most important skills to becoming a modder. It is almost guaranteed that if you try to mod minecraft, especially with no java experience, you will run into errors. This is a basic guide to asking questions and reporting errors.[/background][/size][/font][/color]
[color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]Asking Questions:[/background][/size][/font][/color]
[color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]You might have a suggestion, or a question whether any idea is possible. Here is the basic format for asking questions, in a reply:[/background][/size][/font][/color]
[color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]>]Summary of question: ex Is it possible to make ponies?][/background][/size][/font][/color]
[color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]>Leave a space[/background][/size][/font][/color]
[color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]>[More Info: I have just finished a mob entity tutorial on another site, and I was just wondering if it was possible to create custom 3d models to make ponies?][/background][/size][/font][/color]
[color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]Do not ask stupid questions/questions where you will not be able to understand the answer to. For example, "CAn haz make like P0ni?" would never be responded to. Also, if you ask how to make ponies, it is implied you have already the experience of a basic entity, not that you just started modding and haven't even created a block yet.[/background][/size][/font][/color]
[color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]All questions should be as grammatically correct and spell-checked as you can. You will be excused if English is not your native language/ is your second language.[/background][/size][/font][/color]
[color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]Reporting Errors:[/background][/size][/font][/color]
[color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]This is generally more universal than asking questions. Follow a format like this:[/background][/size][/font][/color]
[color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)][Basic error: ex. Eclipse will not display the src/My mod crashes after adding language registry][/background][/size][/font][/color]
[color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)][Required Info: Whether using eclipse yes/no, forge version, mcp version, minecraft version][/background][/size][/font][/color]
[color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)][More Info: ex: When I open eclipse and in package explorer, the package for src has a lock on it/My mod crashes with an error report, I put it below][/background][/size][/font][/color]
[color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)][Code: If you have errors in your code, either put it in spoiler and code tags so it doesn't flood the whole post, or upload it to github/pastebin/corresponding site so we can view the code and help you. If you say "mah codez error pls help" and don't put the source, you will be shamed][/background][/size][/font][/color]
[color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)][Error Report: If you have problems with minecraft crashing, find the error report (if you run minecraft from within eclipse to test it, it will be in .../forge/mcp/jars/crash-reports)[/background][/size][/font][/color]
[color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]As with questions, everything must be grammatically correct and spell-checked. You will be excused if English is not your native language/is your second language.[/background][/size][/font][/color][/code]
[/spoiler]
[/code]
[/spoiler]
Edit: I have a question about adding configs.
I tried to add a config file based on Xetos's tutorials, and modified it for use with what I have set up based on your tutorial at the moment.
Everything loads, fine, including the config file, but this error spits out:
[spoiler][code]2013-02-09 17:18:29 [INFO] [STDOUT] CONFLICT @ 0 item slot already occupied by net.minecraft.item.ItemSpade@2df8e5e4 while adding bhavik.gypsycraft.client.core.items.ItemGypsumPick@2fbcf350
2013-02-09 17:18:29 [INFO] [ForgeModLoader] [ItemTracker] The mod GypsyCraft is overwriting existing item at 256 (net.minecraft.item.ItemSpade from Minecraft) with bhavik.gypsycraft.client.core.items.ItemGypsumPick[/code][/spoiler]
According to the config, I have the item GypsumPick set to id 15001, not 256. Corresponding code:
[spoiler]
Defining Gypsum Pick
[code]public static int GypsumPickid;[/code]
Entering Gypsum Pick into config
[code]Configuration cfg = new Configuration(evt.getSuggestedConfigurationFile());
try {
GypsumPickid = cfg.getItem("Gypsum Pick", 15001).getInt();
} catch (Exception e) {
FMLLog.log(Level.SEVERE, e, "Gypsy Craft has problems its loading configs!");
} finally {
cfg.save();
}
}[/code]
The Item Gypsum Pick
[code]public static Item GypsumPick = new ItemGypsumPick(GypsumPickid).setIconIndex(0);[/code]
[/spoiler]
Thanks!
Rollback Post to RevisionRollBack
"The signature should be a place of thought and power, with images and personalities, not an advertising banner"
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
If I'm not mistaken, you are supposed to put all language registry, game registry (blocks), crafting recipes and smelting recipes in CommonProxy, not metaGem.
might need some formatting to make prettier, and maybe some rewording to make it more straightforward, but here:
How to ask questions:
[spoiler]
Asking questions correctly and reporting errors are 2 of the most important skills to becoming a modder. It is almost guaranteed that if you try to mod minecraft, especially with no java experience, you will run into errors. This is a basic guide to asking questions and reporting errors.
Asking Questions:
You might have a suggestion, or a question whether any idea is possible. Here is the basic format for asking questions, in a reply:
>]Summary of question: ex Is it possible to make ponies?]
>Leave a space
>[More Info: I have just finished a mob entity tutorial on another site, and I was just wondering if it was possible to create custom 3d models to make ponies?]
Do not ask stupid questions/questions where you will not be able to understand the answer to. For example, "CAn haz make like P0ni?" would never be responded to. Also, if you ask how to make ponies, it is implied you have already the experience of a basic entity, not that you just started modding and haven't even created a block yet.
All questions should be as grammatically correct and spell-checked as you can. You will be excused if English is not your native language/ is your second language.
Reporting Errors:
This is generally more universal than asking questions. Follow a format like this:
[Basic error: ex. Eclipse will not display the src/My mod crashes after adding language registry]
[More Info: ex: When I open eclipse and in package explorer, the package for src has a lock on it/My mod crashes with an error report, I put it below]
[Code: If you have errors in your code, either put it in [spoiler] and [code] tags so it doesn't flood the whole post, or upload it to github/pastebin/corresponding site so we can view the code and help you. If you say "mah codez error pls help" and don't put the source, you will be shamed]
[Error Report: If you have problems with minecraft crashing, find the error report (if you run minecraft from within eclipse to test it, it will be in .../forge/mcp/jars/crash-reports)
As with questions, everything must be grammatically correct and spell-checked. You will be excused if English is not your native language/is your second language.
[/spoiler]
How to make a new custom crop like wheat
Hey I've noticed you don't have a tutorial for crops and food and they are really hard to find. I looked through a lot of code and ended up finding a way to do it by making a copy of the BlockCrops class (growing wheat block) in the common.blocks package.
[spoiler]
package lucidstar.slimedim.common.blocks;
/**
* Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of
* blockID passed in. Args: blockID
*/
protected boolean canThisPlantGrowOnThisBlockID(int par1)
{
return par1 == Block.tilledField.blockID;
}
/**
* Ticks the block if it's been scheduled
*/
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
super.updateTick(par1World, par2, par3, par4, par5Random);
if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9)
{
int var6 = par1World.getBlockMetadata(par2, par3, par4);
/**
* Apply bonemeal to the crops.
*/
public void fertilize(World par1World, int par2, int par3, int par4)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 7);
}
/**
* Gets the growth rate for the crop. Setup to encourage rows by halving growth rate if there is diagonals, crops on
* different sides that aren't opposing, and by adding growth for every crop next to this one (and for crop below
* this one). Args: x, y, z
*/
private float getGrowthRate(World par1World, int par2, int par3, int par4)
{
float var5 = 1.0F;
int var6 = par1World.getBlockId(par2, par3, par4 - 1);
int var7 = par1World.getBlockId(par2, par3, par4 + 1);
int var8 = par1World.getBlockId(par2 - 1, par3, par4);
int var9 = par1World.getBlockId(par2 + 1, par3, par4);
int var10 = par1World.getBlockId(par2 - 1, par3, par4 - 1);
int var11 = par1World.getBlockId(par2 + 1, par3, par4 - 1);
int var12 = par1World.getBlockId(par2 + 1, par3, par4 + 1);
int var13 = par1World.getBlockId(par2 - 1, par3, par4 + 1);
boolean var14 = var8 == this.blockID || var9 == this.blockID;
boolean var15 = var6 == this.blockID || var7 == this.blockID;
boolean var16 = var10 == this.blockID || var11 == this.blockID || var12 == this.blockID || var13 == this.blockID;
/**
* From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
*/
public int getBlockTextureFromSideAndMetadata(int par1, int par2)
{
if (par2 < 0)
{
par2 = 7;
}
return this.blockIndexInTexture + par2;
}
/**
* The type of render function that is called for this block
*/
public int getRenderType()
{
return 6;
}
/**
* Generate a seed ItemStack for this crop.
*/
protected int getSeedItem()
{
return lucidstarslimedim.seedBlueberry.itemID;
}
/**
* Generate a crop produce ItemStack for this crop.
*/
protected int getCropItem()
{
return lucidstarslimedim.foodBlueberry.itemID;
}
/**
* Drops the block items with a specified chance of dropping the specified items
*/
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
{
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0);
}
@Override
public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune)
{
ArrayList<ItemStack> ret = super.getBlockDropped(world, x, y, z, metadata, fortune);
if (metadata >= 7)
{
for (int n = 0; n < 3 + fortune; n++)
{
if (world.rand.nextInt(15) <= metadata)
{
ret.add(new ItemStack(this.getSeedItem(), 1, 0));
}
}
}
return ret;
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return par1 == 7 ? this.getCropItem() : this.getSeedItem();
}
/**
* Returns the quantity of items to drop on block destruction.
*/
public int quantityDropped(Random par1Random)
{
return 1;
}
@SideOnly(Side.CLIENT)
/**
* only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
*/
public int idPicked(World par1World, int par2, int par3, int par4)
{
return this.getSeedItem();
}
}
[/spoiler]
I only had to change the class and package references and the items for the seed and the food it drops. The seed and food don't need new classes since you can set all the info as you call it in the main mod class.
[spoiler]
public static Item foodBlueberry = new ItemFood(917, 5, 0.6F, false).setItemName("lsblueberry").setTextureFile("/LucidStarGFX/lsitems.png").setIconCoord(1, 0);
public static Block cropBlueberry = new BlockBlueberryBush(1003,32).setBlockName("lsblueberrybush").setTextureFile("/LucidStarGFX/lsterrain.png");
public static Item seedBlueberry = new ItemSeeds(916, lucidstarslimedim.cropBlueberry.blockID, Block.tilledField.blockID).setItemName("lsseedblueberry").setTextureFile("/LucidStarGFX/lsitems.png").setIconCoord(1, 1).setCreativeTab(lucidstarslimedim.tabSlime);
[/spoiler]
The foodBlueberry works just like bread and you must make sure that you call the seed last as you need the crop block called so it knows which block to plant.
Of course you still need to register the block and the items' names in the CommonProxy
LanguageRegistry.addName(lucidstarslimedim.seedBlueberry, "Blueberry Seeds");
LanguageRegistry.addName(lucidstarslimedim.foodBlueberry, "Blueberry");
[/spoiler]
And preload the texture files in ClientProxy
[spoiler]
MinecraftForgeClient.preloadTexture("/LucidStarGFX/lsitems.png");
MinecraftForgeClient.preloadTexture("/LucidStarGFX/lsterrain.png");
[/spoiler]
And finally to make bonemeal usable on it you should make a new class, I put it in the common package with my main mod but I'm sure it's not too important.
@ForgeSubscribe
public void onUseBonemeal(BonemealEvent event)
{
if (event.ID == lucidstarslimedim.cropBlueberry.blockID)
{
if (!event.world.isRemote)
{
((BlockBlueberryBush)lucidstarslimedim.cropBlueberry).fertilize(event.world, event.X, event.Y, event.Z);
}
}
}
}
[/spoiler]
Also add
MinecraftForge.EVENT_BUS.register(new lsBonemealEvent());
under the Init Method.
I believe that was all I had to do, please let me know if this works out for you in case i missed explaining a step.
I apologize if the spoilers don't work, it looked like they were functional before I posted.
i was wondering if i follow your tutorials for my own mod will the mod work in SMP or do I have to add extra code to make it work?
Thanks in advance and love your work Deverion.
It should work, the only thing I've had problems with before running in proper SMP is with packet sending, but I'm assuming that that shouldn't be a problem for you
Okay sorry about the spoilers, not really sure why they don't work. And do you know how to render in custom armor without directly editing the RenderPlayer class. I made a copy of it but I believe the RenderManager requires it and it can't be subbed out with the new class. I'd really appreciate if you could give some simple tips as I assume you have other tutorials before you reach armor.
Okay sorry about the spoilers, not really sure why they don't work. And do you know how to render in custom armor without directly editing the RenderPlayer class. I made a copy of it but I believe the RenderManager requires it and it can't be subbed out with the new class. I'd really appreciate if you could give some simple tips as I assume you have other tutorials before you reach armor.
I'm not sure about rendering armor, I'll look into it when I do the tutorial though
If you can't do spoilers, just delete all the spoiler tags and wrap the whole thing in spoilers. Or pm Deverion with it!
Rollback Post to RevisionRollBack
"The signature should be a place of thought and power, with images and personalities, not an advertising banner"
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
Theirs no error,it just does not let me use eclipse.
You have to be more specific what doesn't work. Does eclipse put out an error? If yes, then what is it? Does minecraft crash? Then put the error report in spoilers. It would also be helpful to have the whole class file in code and spoiler tags. Thanks!
So you downloaded the eclipse zip, extracted it, went in and launched eclipse.exe and eclipse did not load? Or are you having problems setting the workspace up.
Deverion i wouldn't mind writing a little section for you to copy paste into the main thread on how to format and post questions/bug reports/crashes/codequestions/etc.
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
Indeed
Not a bad plan
Eclipse is giving me an error
Thx for helping
I do stuff.
There are the errors
https://github.com/star90100/Errors
If I'm not mistaken, you are supposed to put all language registry, game registry (blocks), crafting recipes and smelting recipes in CommonProxy, not metaGem.
might need some formatting to make prettier, and maybe some rewording to make it more straightforward, but here:
How to ask questions:
[spoiler]
Asking questions correctly and reporting errors are 2 of the most important skills to becoming a modder. It is almost guaranteed that if you try to mod minecraft, especially with no java experience, you will run into errors. This is a basic guide to asking questions and reporting errors.
Asking Questions:
You might have a suggestion, or a question whether any idea is possible. Here is the basic format for asking questions, in a reply:
>]Summary of question: ex Is it possible to make ponies?]
>Leave a space
>[More Info: I have just finished a mob entity tutorial on another site, and I was just wondering if it was possible to create custom 3d models to make ponies?]
Do not ask stupid questions/questions where you will not be able to understand the answer to. For example, "CAn haz make like P0ni?" would never be responded to. Also, if you ask how to make ponies, it is implied you have already the experience of a basic entity, not that you just started modding and haven't even created a block yet.
All questions should be as grammatically correct and spell-checked as you can. You will be excused if English is not your native language/ is your second language.
Reporting Errors:
This is generally more universal than asking questions. Follow a format like this:
[Basic error: ex. Eclipse will not display the src/My mod crashes after adding language registry]
[Required Info: Whether using eclipse yes/no, forge version, mcp version, minecraft version]
[More Info: ex: When I open eclipse and in package explorer, the package for src has a lock on it/My mod crashes with an error report, I put it below]
[Code: If you have errors in your code, either put it in [spoiler] and [code] tags so it doesn't flood the whole post, or upload it to github/pastebin/corresponding site so we can view the code and help you. If you say "mah codez error pls help" and don't put the source, you will be shamed]
[Error Report: If you have problems with minecraft crashing, find the error report (if you run minecraft from within eclipse to test it, it will be in .../forge/mcp/jars/crash-reports)
As with questions, everything must be grammatically correct and spell-checked. You will be excused if English is not your native language/is your second language.
[/spoiler]
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
Looks good, can you put it inside a code tag so I can copy it later?
I guess... but why? can't you just copy paste directly from spoiler?
[spoiler]
[code][color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]Asking questions correctly and reporting errors are 2 of the most important skills to becoming a modder. It is almost guaranteed that if you try to mod minecraft, especially with no java experience, you will run into errors. This is a basic guide to asking questions and reporting errors.[/background][/size][/font][/color] [color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]Asking Questions:[/background][/size][/font][/color] [color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]You might have a suggestion, or a question whether any idea is possible. Here is the basic format for asking questions, in a reply:[/background][/size][/font][/color] [color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]>]Summary of question: ex Is it possible to make ponies?][/background][/size][/font][/color] [color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]>Leave a space[/background][/size][/font][/color] [color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]>[More Info: I have just finished a mob entity tutorial on another site, and I was just wondering if it was possible to create custom 3d models to make ponies?][/background][/size][/font][/color] [color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]Do not ask stupid questions/questions where you will not be able to understand the answer to. For example, "CAn haz make like P0ni?" would never be responded to. Also, if you ask how to make ponies, it is implied you have already the experience of a basic entity, not that you just started modding and haven't even created a block yet.[/background][/size][/font][/color] [color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]All questions should be as grammatically correct and spell-checked as you can. You will be excused if English is not your native language/ is your second language.[/background][/size][/font][/color] [color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]Reporting Errors:[/background][/size][/font][/color] [color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]This is generally more universal than asking questions. Follow a format like this:[/background][/size][/font][/color] [color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)][Basic error: ex. Eclipse will not display the src/My mod crashes after adding language registry][/background][/size][/font][/color] [color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)][Required Info: Whether using eclipse yes/no, forge version, mcp version, minecraft version][/background][/size][/font][/color] [color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)][More Info: ex: When I open eclipse and in package explorer, the package for src has a lock on it/My mod crashes with an error report, I put it below][/background][/size][/font][/color] [color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)][Code: If you have errors in your code, either put it in spoiler and code tags so it doesn't flood the whole post, or upload it to github/pastebin/corresponding site so we can view the code and help you. If you say "mah codez error pls help" and don't put the source, you will be shamed][/background][/size][/font][/color] [color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)][Error Report: If you have problems with minecraft crashing, find the error report (if you run minecraft from within eclipse to test it, it will be in .../forge/mcp/jars/crash-reports)[/background][/size][/font][/color] [color=#282828][font=Verdana, Geneva, Tahoma, sans-serif][size=small][background=rgb(232, 239, 244)]As with questions, everything must be grammatically correct and spell-checked. You will be excused if English is not your native language/is your second language.[/background][/size][/font][/color][/code]
[/spoiler]
[/code]
[/spoiler]
Edit: I have a question about adding configs.
I tried to add a config file based on Xetos's tutorials, and modified it for use with what I have set up based on your tutorial at the moment.
Everything loads, fine, including the config file, but this error spits out:
[spoiler][code]2013-02-09 17:18:29 [INFO] [STDOUT] CONFLICT @ 0 item slot already occupied by net.minecraft.item.ItemSpade@2df8e5e4 while adding bhavik.gypsycraft.client.core.items.ItemGypsumPick@2fbcf350 2013-02-09 17:18:29 [INFO] [ForgeModLoader] [ItemTracker] The mod GypsyCraft is overwriting existing item at 256 (net.minecraft.item.ItemSpade from Minecraft) with bhavik.gypsycraft.client.core.items.ItemGypsumPick[/code][/spoiler]
According to the config, I have the item GypsumPick set to id 15001, not 256. Corresponding code:
[spoiler]
Defining Gypsum Pick
[code]public static int GypsumPickid;[/code]
Entering Gypsum Pick into config
[code]Configuration cfg = new Configuration(evt.getSuggestedConfigurationFile()); try { GypsumPickid = cfg.getItem("Gypsum Pick", 15001).getInt(); } catch (Exception e) { FMLLog.log(Level.SEVERE, e, "Gypsy Craft has problems its loading configs!"); } finally { cfg.save(); } }[/code]
The Item Gypsum Pick
[code]public static Item GypsumPick = new ItemGypsumPick(GypsumPickid).setIconIndex(0);[/code]
[/spoiler]
Thanks!
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
Ok well thanks anyway
Hey I've noticed you don't have a tutorial for crops and food and they are really hard to find. I looked through a lot of code and ended up finding a way to do it by making a copy of the BlockCrops class (growing wheat block) in the common.blocks package.
[spoiler]
package lucidstar.slimedim.common.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.Random;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFlower;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import lucidstar.slimedim.common.lsslimemod;
public class BlockBlueberryBush extends BlockFlower
{
public BlockBlueberryBush(int par1, int par2)
{
super(par1, par2);
this.blockIndexInTexture = par2;
this.setTickRandomly(true);
float var3 = 0.5F;
this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, 0.25F, 0.5F + var3);
this.setCreativeTab((CreativeTabs)null);
this.setHardness(0.0F);
this.setStepSound(soundGrassFootstep);
this.disableStats();
this.setRequiresSelfNotify();
}
/**
* Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of
* blockID passed in. Args: blockID
*/
protected boolean canThisPlantGrowOnThisBlockID(int par1)
{
return par1 == Block.tilledField.blockID;
}
/**
* Ticks the block if it's been scheduled
*/
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
super.updateTick(par1World, par2, par3, par4, par5Random);
if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9)
{
int var6 = par1World.getBlockMetadata(par2, par3, par4);
if (var6 < 7)
{
float var7 = this.getGrowthRate(par1World, par2, par3, par4);
if (par5Random.nextInt((int)(25.0F / var7) + 1) == 0)
{
++var6;
par1World.setBlockMetadataWithNotify(par2, par3, par4, var6);
}
}
}
}
/**
* Apply bonemeal to the crops.
*/
public void fertilize(World par1World, int par2, int par3, int par4)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 7);
}
/**
* Gets the growth rate for the crop. Setup to encourage rows by halving growth rate if there is diagonals, crops on
* different sides that aren't opposing, and by adding growth for every crop next to this one (and for crop below
* this one). Args: x, y, z
*/
private float getGrowthRate(World par1World, int par2, int par3, int par4)
{
float var5 = 1.0F;
int var6 = par1World.getBlockId(par2, par3, par4 - 1);
int var7 = par1World.getBlockId(par2, par3, par4 + 1);
int var8 = par1World.getBlockId(par2 - 1, par3, par4);
int var9 = par1World.getBlockId(par2 + 1, par3, par4);
int var10 = par1World.getBlockId(par2 - 1, par3, par4 - 1);
int var11 = par1World.getBlockId(par2 + 1, par3, par4 - 1);
int var12 = par1World.getBlockId(par2 + 1, par3, par4 + 1);
int var13 = par1World.getBlockId(par2 - 1, par3, par4 + 1);
boolean var14 = var8 == this.blockID || var9 == this.blockID;
boolean var15 = var6 == this.blockID || var7 == this.blockID;
boolean var16 = var10 == this.blockID || var11 == this.blockID || var12 == this.blockID || var13 == this.blockID;
for (int var17 = par2 - 1; var17 <= par2 + 1; ++var17)
{
for (int var18 = par4 - 1; var18 <= par4 + 1; ++var18)
{
int var19 = par1World.getBlockId(var17, par3 - 1, var18);
float var20 = 0.0F;
if (blocksList[var19] != null && blocksList[var19].canSustainPlant(par1World, var17, par3 - 1, var18, ForgeDirection.UP, this))
{
var20 = 1.0F;
if (blocksList[var19].isFertile(par1World, var17, par3 - 1, var18))
{
var20 = 3.0F;
}
}
if (var17 != par2 || var18 != par4)
{
var20 /= 4.0F;
}
var5 += var20;
}
}
if (var16 || var14 && var15)
{
var5 /= 2.0F;
}
return var5;
}
/**
* From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
*/
public int getBlockTextureFromSideAndMetadata(int par1, int par2)
{
if (par2 < 0)
{
par2 = 7;
}
return this.blockIndexInTexture + par2;
}
/**
* The type of render function that is called for this block
*/
public int getRenderType()
{
return 6;
}
/**
* Generate a seed ItemStack for this crop.
*/
protected int getSeedItem()
{
return lucidstarslimedim.seedBlueberry.itemID;
}
/**
* Generate a crop produce ItemStack for this crop.
*/
protected int getCropItem()
{
return lucidstarslimedim.foodBlueberry.itemID;
}
/**
* Drops the block items with a specified chance of dropping the specified items
*/
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
{
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0);
}
@Override
public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune)
{
ArrayList<ItemStack> ret = super.getBlockDropped(world, x, y, z, metadata, fortune);
if (metadata >= 7)
{
for (int n = 0; n < 3 + fortune; n++)
{
if (world.rand.nextInt(15) <= metadata)
{
ret.add(new ItemStack(this.getSeedItem(), 1, 0));
}
}
}
return ret;
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return par1 == 7 ? this.getCropItem() : this.getSeedItem();
}
/**
* Returns the quantity of items to drop on block destruction.
*/
public int quantityDropped(Random par1Random)
{
return 1;
}
@SideOnly(Side.CLIENT)
/**
* only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
*/
public int idPicked(World par1World, int par2, int par3, int par4)
{
return this.getSeedItem();
}
}
[/spoiler]
I only had to change the class and package references and the items for the seed and the food it drops. The seed and food don't need new classes since you can set all the info as you call it in the main mod class.
[spoiler]
public static Item foodBlueberry = new ItemFood(917, 5, 0.6F, false).setItemName("lsblueberry").setTextureFile("/LucidStarGFX/lsitems.png").setIconCoord(1, 0);
public static Block cropBlueberry = new BlockBlueberryBush(1003,32).setBlockName("lsblueberrybush").setTextureFile("/LucidStarGFX/lsterrain.png");
public static Item seedBlueberry = new ItemSeeds(916, lucidstarslimedim.cropBlueberry.blockID, Block.tilledField.blockID).setItemName("lsseedblueberry").setTextureFile("/LucidStarGFX/lsitems.png").setIconCoord(1, 1).setCreativeTab(lucidstarslimedim.tabSlime);
[/spoiler]
The foodBlueberry works just like bread and you must make sure that you call the seed last as you need the crop block called so it knows which block to plant.
Of course you still need to register the block and the items' names in the CommonProxy
[spoiler]
GameRegistry.registerBlock(lucidstarslimedim.cropBlueberry, "lsblueberrybush");
LanguageRegistry.addName(lucidstarslimedim.seedBlueberry, "Blueberry Seeds");
LanguageRegistry.addName(lucidstarslimedim.foodBlueberry, "Blueberry");
[/spoiler]
And preload the texture files in ClientProxy
[spoiler]
MinecraftForgeClient.preloadTexture("/LucidStarGFX/lsitems.png");
MinecraftForgeClient.preloadTexture("/LucidStarGFX/lsterrain.png");
[/spoiler]
And finally to make bonemeal usable on it you should make a new class, I put it in the common package with my main mod but I'm sure it's not too important.
[spoiler]
package lucidstar.slimedim.common;
import lucidstar.slimedim.common.blocks.BlockBlueberryBush;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.player.BonemealEvent;
import net.minecraft.src.*;
public class lsBonemealEvent
{
@ForgeSubscribe
public void onUseBonemeal(BonemealEvent event)
{
if (event.ID == lucidstarslimedim.cropBlueberry.blockID)
{
if (!event.world.isRemote)
{
((BlockBlueberryBush)lucidstarslimedim.cropBlueberry).fertilize(event.world, event.X, event.Y, event.Z);
}
}
}
}
[/spoiler]
Also add
MinecraftForge.EVENT_BUS.register(new lsBonemealEvent());
under the Init Method.
I believe that was all I had to do, please let me know if this works out for you in case i missed explaining a step.
I apologize if the spoilers don't work, it looked like they were functional before I posted.
I do know how to make crops, I just haven't gotten to doing a tutorial Also, spoilers, please
EDIT: Restoring code now, so I'll be starting on tutorials soon
Coming next: Tool tutorial
It should work, the only thing I've had problems with before running in proper SMP is with packet sending, but I'm assuming that that shouldn't be a problem for you
Maybe, I'm probably doing configs though
I'm not sure about rendering armor, I'll look into it when I do the tutorial though
How about a tutorial for custom rendered projectiles? I have most of it done but it won't let me Init
It makes an explosion when I shoot like it's supposed to but it doesn't render the thing.
Yay! I've been waiting for this. Wait so the whole enum class I did for the sword is useless? Darn.
Also could you scroll back up to where I posted the "how to ask questions" guide and help me on my configs? Thanks.
One more thing, in your sword tut, you have this, but you have not stated to create a class named EnumToolTutorial!:
Edit: Actually, I deleted that import and it ran fine. So you have an extra import!
If you can't do spoilers, just delete all the spoiler tags and wrap the whole thing in spoilers. Or pm Deverion with it!
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
Hmm, I'll look into it at some point, it could be interesting
1) Yes, unfortunately, I found a more efficient way
2) Config tutorial next
3) I'll fix it now, thanks!