because it does not give me the textures in the game? in my terrain.png there are only 7 texuter 16x16 perfectly positioned, but why get me a white texture in game?
I did something wrong again, recipes don't work.
Crash report:
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; Failed to start game
This error has been saved to C:\Users\Syberia\Desktop\MCP\jars\.\crash-reports\crash-2012-09-22_13.34.48-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT 31ee62d8 --------
Generated 22.09.12 13:34
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_05, Oracle Corporation
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 912446896 bytes (870 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
- JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
- FML: FML v3.0.196.366 Minecraft Forge 4.1.1.251 3 mods loaded, 3 mods active
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
Hell Ores by DoubleSpiral [Hell Ores] (bin) Unloaded->Constructed->Pre-initialized->Errored
- LWJGL: 2.4.2
- OpenGL: Mobile Intel(R) 4 Series Express Chipset Family GL version 2.1.0 - Build 8.15.10.2302, Intel
- Is Modded: Definitely; 'forge,fml'
- Type: Client
- Texture Pack: Default
- Profiler Position: N/A (disabled)
cpw.mods.fml.common.LoaderException: java.lang.reflect.InvocationTargetException
at cpw.mods.fml.common.LoadController.transition(LoadController.java:102)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:641)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:177)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:450)
at net.minecraft.client.Minecraft.run(Minecraft.java:737)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:371)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
at com.google.common.eventbus.EventBus.post(EventBus.java:268)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:124)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
at com.google.common.eventbus.EventBus.post(EventBus.java:268)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:81)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:640)
... 4 more
Caused by: java.lang.NullPointerException
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:189)
at cpw.mods.fml.common.registry.GameRegistry.addRecipe(GameRegistry.java:198)
at HellOres.Common.mod_HellOres.load(mod_HellOres.java:56)
... 30 more
--- END ERROR REPORT 39406e13 ----------
Recipes:
GameRegistry.addRecipe(new ItemStack(mod_HellOres.MercuryBlock, 1), new Object[]{"###", "###", "###", Character.valueOf('#'), mod_HellOres.MercuryIngot.shiftedIndex});
GameRegistry.addRecipe(new ItemStack(mod_HellOres.OnyxBlock, 1), new Object[]{"@@@", "@@@", "@@@", Character.valueOf('@'), mod_HellOres.Onyx.shiftedIndex});
GameRegistry.addRecipe(new ItemStack(mod_HellOres.MercuryBar, 1), new Object[]{" ", " ! ", " ! ", Character.valueOf('!'), mod_HellOres.MercuryIngot.shiftedIndex});
GameRegistry.addShapelessRecipe(new ItemStack(mod_HellOres.MercuryRings, 4), MercuryBar, new ItemStack(mod_HellOres.MercuryBar));
GameRegistry.addSmelting(mod_HellOres.MercuryOre.blockID, new ItemStack(mod_HellOres.MercuryIngot), 0.9F);
For the regular recipes, you don't need the Object any more, that was the old ModLoader code
This isn't causing a crash, but for the shapeless recipe, the components don't have to be in itemstacks unless you need to use a metadata variety of it
i read the redstone tutorial but i cant figure out where the code is that signify weather or not it is powered
what i want to happen is it calls a method when powered by redstone
Hey i enjoy your posts. Ive made a new mod thanks to these tutorials, but i would really like to know how to add special armor effects when can i expect it to come out?
Hey i enjoy your posts. Ive made a new mod thanks to these tutorials, but i would really like to know how to add special armor effects when can i expect it to come out?
Sorry, I've been fooling around on WoW recently, and working on my own mod a little bit, and honestly it is pointless doing new tutorials with 1.4 coming out in 6 days :/
Shouldn't take too long now that I've decided that there is no easy way to smelt with metadata
After Much Google-ing I came up with nothing. After much smashing my head into my keyboard I had a thought.....
After a quick test, there IS an easy easy to use meta-data inputs and outputs.
in my mod i have created several new Ore Blocks, and Items. They are respectively Ores, and the ingots they smelt into. Now I am VERY new to Java, much less modding a full on game. (I have roughly 10 hours Java experence at the time of this post). So my solution may not be the best one.
my main mod class:
// Add our Ore Blocks
AltarisOreBlock = (new AltarisOreBlock(AltarisOreBlockID, 0)).setBlockName("AltarisOreBlock").setHardness(6F).setResistance(30F);
Item.itemsList[AltarisOreBlockID] = new AltarisItemBlockOre(AltarisOreBlockID-256, AltarisOreBlock).setItemName("AltarisOreBlockItem");
// Add New Ingots
Item AltarisIngots = (new AltarisIngots(AltarisIngotsID)).setItemName("Ingot").setIconIndex(17);
This adds my Ore, Ingots, and their respective meta (damage) values. But at this point I was at a loss for how to actually smelt block with Metadata. My Solution:
Create a new Package (For me this was Altaris.common). In that package I have a class "GameRegistry" - looks like this:
package Altaris.common;
import net.minecraft.src.FurnaceRecipes;
import net.minecraft.src.ItemStack;
public class GameRegistry extends cpw.mods.fml.common.registry.GameRegistry
{
public static void addSmelting(ItemStack input, ItemStack output, float xp)
{
FurnaceRecipes.smelting().addSmelting(input.itemID, input.getItemDamage(), output);
}
}
This lets you use a net.minecraft.src.ItemStack as both input and output by hooking directly to the net.minecraft.src.FurnaceRecipes.addSmelting method. Apparently Notch / Jeb, Someone was thinking ahead, because the metadata
input support was already there, just needed a hook. Unfortunately, this method does not support returning XP to the player (I'm working on that).
I did Test this, and it DOES work.
/* Recipes */
Altaris.common.GameRegistry.addSmelting(new ItemStack(AltarisOreBlock.blockID, 1, 0), new ItemStack(AltarisIngots, 1, 0), 3);
Altaris.common.GameRegistry.addSmelting(new ItemStack(AltarisOreBlock.blockID, 1, 1), new ItemStack(AltarisIngots, 1, 1), 3);
Altaris.common.GameRegistry.addSmelting(new ItemStack(AltarisOreBlock.blockID, 1, 2), new ItemStack(AltarisIngots, 1, 2), 3);
Altaris.common.GameRegistry.addSmelting(new ItemStack(AltarisOreBlock.blockID, 1, 3), new ItemStack(AltarisIngots, 1, 3), 3);
Altaris.common.GameRegistry.addSmelting(new ItemStack(AltarisOreBlock.blockID, 1, 4), new ItemStack(AltarisIngots, 1, 4), 3);
This chunk adds the furnace recipes via the new hook. I used the full namespace to prevent collisions with Forge, but since my class extends Forges GameRegistry Class, I should be able to just swap right over.
Once again, I really don't know if this method is "the perfect solution" - but it takes all of 20 seconds to implement, and it seems to work right on
I do hope this helps you as much as your tutorials have helped me over the last 5 hours I have been cracking at this. Thank you for your great contribution to the modding community, and I hope to see more tutorials come from you.
[EDIT]
in net.minecraft.src.FurnaceRecipes
public void addSmelting(int itemID, int metadata, ItemStack output, float xp)
{
metaSmeltingList.put(Arrays.asList(itemID, metadata), output);
this.experienceList.put(Integer.valueOf(output.itemID), Float.valueOf(xp));
}
I know that this is NOT the right way to do it as I modified a core Minecraft file - I was testing.. and it too works fine. I think, I'll just extend the class and add my method there. - But there you have it, xp works as well, with metadata input.
-- the Hashmaps are private, extending the class makes them unreachable, You'd have to at the very least edit their scope, - or rewrite a large chunk of the class. (I Opted to make them protected).
[/EDIT]
After Much Google-ing I came up with nothing. After much smashing my head into my keyboard I had a thought.....
After a quick test, there IS an easy easy to use meta-data inputs and outputs.
in my mod i have created several new Ore Blocks, and Items. They are respectively Ores, and the ingots they smelt into. Now I am VERY new to Java, much less modding a full on game. (I have roughly 10 hours Java experence at the time of this post). So my solution may not be the best one.
my main mod class:
// Add our Ore Blocks
AltarisOreBlock = (new AltarisOreBlock(AltarisOreBlockID, 0)).setBlockName("AltarisOreBlock").setHardness(6F).setResistance(30F);
Item.itemsList[AltarisOreBlockID] = new AltarisItemBlockOre(AltarisOreBlockID-256, AltarisOreBlock).setItemName("AltarisOreBlockItem");
// Add New Ingots
Item AltarisIngots = (new AltarisIngots(AltarisIngotsID)).setItemName("Ingot").setIconIndex(17);
This adds my Ore, Ingots, and their respective meta (damage) values. But at this point I was at a loss for how to actually smelt block with Metadata. My Solution:
Create a new Package (For me this was Altaris.common). In that package I have a class "GameRegistry" - looks like this:
package Altaris.common;
import net.minecraft.src.FurnaceRecipes;
import net.minecraft.src.ItemStack;
public class GameRegistry extends cpw.mods.fml.common.registry.GameRegistry
{
public static void addSmelting(ItemStack input, ItemStack output, float xp)
{
FurnaceRecipes.smelting().addSmelting(input.itemID, input.getItemDamage(), output);
}
}
This lets you use a net.minecraft.src.ItemStack as both input and output by hooking directly to the net.minecraft.src.FurnaceRecipes.addSmelting method. Apparently Notch / Jeb, Someone was thinking ahead, because the metadata
input support was already there, just needed a hook. Unfortunately, this method does not support returning XP to the player (I'm working on that).
I did Test this, and it DOES work.
/* Recipes */
Altaris.common.GameRegistry.addSmelting(new ItemStack(AltarisOreBlock.blockID, 1, 0), new ItemStack(AltarisIngots, 1, 0), 3);
Altaris.common.GameRegistry.addSmelting(new ItemStack(AltarisOreBlock.blockID, 1, 1), new ItemStack(AltarisIngots, 1, 1), 3);
Altaris.common.GameRegistry.addSmelting(new ItemStack(AltarisOreBlock.blockID, 1, 2), new ItemStack(AltarisIngots, 1, 2), 3);
Altaris.common.GameRegistry.addSmelting(new ItemStack(AltarisOreBlock.blockID, 1, 3), new ItemStack(AltarisIngots, 1, 3), 3);
Altaris.common.GameRegistry.addSmelting(new ItemStack(AltarisOreBlock.blockID, 1, 4), new ItemStack(AltarisIngots, 1, 4), 3);
This chunk adds the furnace recipes via the new hook. I used the full namespace to prevent collisions with Forge, but since my class extends Forges GameRegistry Class, I should be able to just swap right over.
Once again, I really don't know if this method is "the perfect solution" - but it takes all of 20 seconds to implement, and it seems to work right on
I do hope this helps you as much as your tutorials have helped me over the last 5 hours I have been cracking at this. Thank you for your great contribution to the modding community, and I hope to see more tutorials come from you.
[EDIT]
in net.minecraft.src.FurnaceRecipes
public void addSmelting(int itemID, int metadata, ItemStack output, float xp)
{
metaSmeltingList.put(Arrays.asList(itemID, metadata), output);
this.experienceList.put(Integer.valueOf(output.itemID), Float.valueOf(xp));
}
I know that this is NOT the right way to do it as I modified a core Minecraft file - I was testing.. and it too works fine. I think, I'll just extend the class and add my method there. - But there you have it, xp works as well, with metadata input.
-- the Hashmaps are private, extending the class makes them unreachable, You'd have to at the very least edit their scope, - or rewrite a large chunk of the class. (I Opted to make them protected).
[/EDIT]
Thanks, I hadn't though of anything like that xD When I start on the 1.4 tutorials, I'll tweak the first one a bit for xp, but apart from that, it's a good plan. thanks!
/**
* A metadata sensitive version of adding a furnace recipe.
*/
public void addSmelting(int itemID, int metadata, ItemStack itemstack, float experience)
{
metaSmeltingList.put(Arrays.asList(itemID, metadata), itemstack);
metaExperience.put(Arrays.asList(itemID, metadata), experience);
}
cpw.mods.fml.common.registry.GameRegistry - does not implement a method to hook to net.minecraft.src.FurnaceRecipes.addSmelting(int, int, ItemStack, float)
However, I suspect that now you can simply extend GameRegistry and implement the above method to hook it. Previously net.minecraft.src.FurnaceRecipes did not have this method (Current Forge Stable). And an attempt to add this method caused a crash bug where the method
public float net.minecraft.src.FurnaceRecipes.getExperence(ItemStack)
would not exist. (I have absolutely NO idea why...)
Anyway, It looks like the very hack I edited into MC Source is now actually there from decompile with the newest forge. - I've not yet tested it, But Looking forward to smelting all sorts f things
Cheers Modders.
---[EDIT]---
Testing in Eclipse, and under a proper modded Client (SSP Only) - shows that the above method DOES in fact work exactly as it should, smelting ItemStack Inputs, and rewarding XP Correctly. Using:
/**
* A metadata sensitive version of adding a furnace recipe.
*/
public void addSmelting(int itemID, int metadata, ItemStack itemstack, float experience)
{
metaSmeltingList.put(Arrays.asList(itemID, metadata), itemstack);
metaExperience.put(Arrays.asList(itemID, metadata), experience);
}
cpw.mods.fml.common.registry.GameRegistry - does not implement a method to hook to net.minecraft.src.FurnaceRecipes.addSmelting(int, int, ItemStack, float)
However, I suspect that now you can simply extend GameRegistry and implement the above method to hook it. Previously net.minecraft.src.FurnaceRecipes did not have this method (Current Forge Stable). And an attempt to add this method caused a crash bug where the method
public float net.minecraft.src.FurnaceRecipes.getExperence(ItemStack)
would not exist. (I have absolutely NO idea why...)
Anyway, It looks like the very hack I edited into MC Source is now actually there from decompile with the newest forge. - I've not yet tested it, But Looking forward to smelting all sorts f things
Cheers Modders.
---[EDIT]---
Testing in Eclipse, and under a proper modded Client (SSP Only) - shows that the above method DOES in fact work exactly as it should, smelting ItemStack Inputs, and rewarding XP Correctly. Using:
Cant wait for you forge liquid tutorial, but how about a custom tree with generation tutorial, there are non around for that, and could really use one at the moment.
k thanks also just another question i dont mind if u dont know but in the minecraft.jar file in there there is a class called uu.class and uf.class i cant figure out which classes these are when decompiled or when i am using JD-Gui to look at them just wondering if u know
k thanks also just another question i dont mind if u dont know but in the minecraft.jar file in there there is a class called uu.class and uf.class i cant figure out which classes these are when decompiled or when i am using JD-Gui to look at them just wondering if u know
uu - ItemBlock
uf - EnumRarity
For future reference you can find them in your mod/logs/client_deob
While you "prepare" to do 1.4 tutorials, I thought that I would share a bit more code here. The mod I have been working on is coming along fairy well, and I'm thrilled for the crash course in java. Recently I dove into getting some new ore blocks to spawn in the world. The implementation to do this without some sort of helper method is - well its a lot more typing then should be required.
package mod_xxx.world;
import java.util.Random;
import net.minecraft.src.Block;
import net.minecraft.src.IChunkProvider;
import net.minecraft.src.ItemStack;
import net.minecraft.src.World;
import net.minecraft.src.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;
public class OreGenerator implements IWorldGenerator {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world,
IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch(world.provider.dimensionId)
{
case -1:
generateNether();
break;
case 0:
generateSurface(world, random, chunkX*16, chunkZ*16);
break;
case 1:
generateEnd();
break;
}
}
private void generateSurface(World world, Random rand, int chunkX, int chunkZ) {
generateOre(world, rand, 30, chunkX, chunkZ, 30, 70, mod_xxx.blockOre, 0, 8);
generateOre(world, rand, 30, chunkX, chunkZ, 30, 70, mod_xxx.blockOre, 1, 8);
generateOre(world, rand, 15, chunkX, chunkZ, 30, 60, mod_xxx.blockOre, 2, 8);
generateOre(world, rand, 8, chunkX, chunkZ, 15, 40, mod_xxx.blockOre, 3, 6);
generateOre(world, rand, 4, chunkX, chunkZ, 5, 14, mod_xxx.blockOre, 4, 4);
generateOre(world, rand, 20, chunkX, chunkZ, 10, 35, mod_xxx.blockOre, 5, 6);
generateOre(world, rand, 30, chunkX, chunkZ, 10, 45, mod_xxx.blockOre, 6, 4);
}
private void generateEnd() {
// TODO Auto-generated method stub
}
private void generateNether() {
// TODO Auto-generated method stub
}
/**
* @param world The World to generate ore in
* @param rand Random Object
* @param numVeins number of veins per chunk
* @param chunkX X coordinate (*16)
* @param chunkZ Z Coordinate (*16)
* @param minY lowest Y position ore should spawn
* @param maxY highest Y position ore should spawn
* @param ore the Ore block Object
* @param meta meta level of the ore block
* @param size number of blocks in a vein
*/
private void generateOre(World world, Random rand, int numVeins, int chunkX, int chunkZ,
int minY, int maxY, Block ore, int meta, int size)
{
for(int i = 0; i < numVeins+1; i++)
{
int PosX = chunkX + rand.nextInt(16);
int PosZ = chunkZ + rand.nextInt(16);
int PosY = minY + rand.nextInt(maxY);
(new WorldGenMinable(ore.blockID, meta, size)).generate(world, rand, PosX, PosY, PosZ);
}
}
/**
* @param world The World to generate ore in
* @param rand Random Object
* @param numVeins number of veins per chunk
* @param chunkX X coordinate (*16)
* @param chunkZ Z Coordinate (*16)
* @param minY lowest Y position ore should spawn
* @param maxY highest Y position ore should spawn
* @param ore the Ore block Object
* @param size number of blocks in a vein
*/
private void generateOre(World world, Random rand, int numVeins, int chunkX, int chunkZ,
int minY, int maxY, Block ore, int size)
{
// Point back to the meta-sensitive version, but with a meta value of 0
generateOre(world, rand, numVeins, chunkX, chunkY, minY, maxY, ore, 0, size);
}
}
So the neat method here is "generateOre". it takes arguments of:
- World world - pretty obvious
- Random rand - also obvious
- int numVeins - the number of veins that spawn in a chunk.
- int chunkX - the X Position of the chunk being generated
- int chunkZ - the Z Position of the chunk being generated
- int minY - the lowest point (Y level) that this ore should generate
- int maxY - the Highest Point this ore should generate
- Block ore - the Block you want to spawn
- int meta - the meta level of said block
- int size - number of blocks in a vein (this should really never be over 8, except in situations like Red Power's Marble)
if you look at the generateSurface() method, you'll see I call the generateOre() method with needed arguments to build the chunks as I like. without writing what would have been 7 for loops. This is not a complicated nor advanced tactic, and I'm sure anyone with experence would have thought of this. However, this approach tough to new modders will definitely save a bit of time, a bit of typing, and get modders to be able to see the fruits of their labor sooner.
Hope this helps :-)
EDIT: cant set Minimum Y coordinate. Saw it on a Youtube Vid., I thought it was suspect, but tossed it in anyway. - doesn't work at all. The rest of the code is legit though.
Item Metadata, In this bit of code "names" is getting an error:
public String getItemNameIS(ItemStack i){
try{ //Just in case of NullPointerException
return names[i.getItemDamage()];
}catch(Exception e){
return "";
}
Rollback Post to RevisionRollBack
I take in all suggestions and comments on my mods, even if I don't reply I have logged it somewhere.
The index is found by counting out the 16x16 pixel blocks that you draw the items in
Can you PM me your item and ClientProxy code?
Can you PM me your ItemCornSeeds?
For the regular recipes, you don't need the Object any more, that was the old ModLoader code
This isn't causing a crash, but for the shapeless recipe, the components don't have to be in itemstacks unless you need to use a metadata variety of it
The crash is caused by the object in the regular recipes, you must only have the strings, valueOf's and Items
For shapeless recipes without itemstacks, you simply need to put the Item's object
what i want to happen is it calls a method when powered by redstone
Sorry, I've been fooling around on WoW recently, and working on my own mod a little bit, and honestly it is pointless doing new tutorials with 1.4 coming out in 6 days :/
After Much Google-ing I came up with nothing. After much smashing my head into my keyboard I had a thought.....
After a quick test, there IS an easy easy to use meta-data inputs and outputs.
in my mod i have created several new Ore Blocks, and Items. They are respectively Ores, and the ingots they smelt into. Now I am VERY new to Java, much less modding a full on game. (I have roughly 10 hours Java experence at the time of this post). So my solution may not be the best one.
my main mod class:
This adds my Ore, Ingots, and their respective meta (damage) values. But at this point I was at a loss for how to actually smelt block with Metadata. My Solution:
Create a new Package (For me this was Altaris.common). In that package I have a class "GameRegistry" - looks like this:
This lets you use a net.minecraft.src.ItemStack as both input and output by hooking directly to the net.minecraft.src.FurnaceRecipes.addSmelting method. Apparently Notch / Jeb, Someone was thinking ahead, because the metadata
input support was already there, just needed a hook. Unfortunately, this method does not support returning XP to the player (I'm working on that).
I did Test this, and it DOES work.
This chunk adds the furnace recipes via the new hook. I used the full namespace to prevent collisions with Forge, but since my class extends Forges GameRegistry Class, I should be able to just swap right over.
Once again, I really don't know if this method is "the perfect solution" - but it takes all of 20 seconds to implement, and it seems to work right on
I do hope this helps you as much as your tutorials have helped me over the last 5 hours I have been cracking at this. Thank you for your great contribution to the modding community, and I hope to see more tutorials come from you.
[EDIT]
in net.minecraft.src.FurnaceRecipes
I know that this is NOT the right way to do it as I modified a core Minecraft file - I was testing.. and it too works fine. I think, I'll just extend the class and add my method there. - But there you have it, xp works as well, with metadata input.
-- the Hashmaps are private, extending the class makes them unreachable, You'd have to at the very least edit their scope, - or rewrite a large chunk of the class. (I Opted to make them protected).
[/EDIT]
Thanks, I hadn't though of anything like that xD When I start on the 1.4 tutorials, I'll tweak the first one a bit for xp, but apart from that, it's a good plan. thanks!
net.minecraft.src.FurnaceRecipes
cpw.mods.fml.common.registry.GameRegistry - does not implement a method to hook to net.minecraft.src.FurnaceRecipes.addSmelting(int, int, ItemStack, float)
However, I suspect that now you can simply extend GameRegistry and implement the above method to hook it. Previously net.minecraft.src.FurnaceRecipes did not have this method (Current Forge Stable). And an attempt to add this method caused a crash bug where the method
would not exist. (I have absolutely NO idea why...)
Anyway, It looks like the very hack I edited into MC Source is now actually there from decompile with the newest forge. - I've not yet tested it, But Looking forward to smelting all sorts f things
Cheers Modders.
---[EDIT]---
Testing in Eclipse, and under a proper modded Client (SSP Only) - shows that the above method DOES in fact work exactly as it should, smelting ItemStack Inputs, and rewarding XP Correctly. Using:
The Java: main mod class:
Where OreBlock and Ingots are subclasses of Block, ItemBlock, and Item respecively.
If any one waznts it, I'll post the full code base.
Cool, thanks, Look like the 1.4.2 tutorials will be much better than these ones
Find out how I generate....coolAlias...world structure generation and rotation tool...
@SideOnly(Side.CLIENT)
public void getSubItems(int i, CreativeTabs tab, List list)
{
list.add(new ItemStack(i,1,0));
list.add(new ItemStack(i,1,1));
list.add(new ItemStack(i,1,2));
}
what does the i stand for or do?
i is for the item ID
BTW, I'll start on 1.4 tutorials soon, I'm just working on my own mod at the moment and waiting for MC 1.4.4
uu - ItemBlock
uf - EnumRarity
For future reference you can find them in your mod/logs/client_deob
So the neat method here is "generateOre". it takes arguments of:
- World world - pretty obvious
- Random rand - also obvious
- int numVeins - the number of veins that spawn in a chunk.
- int chunkX - the X Position of the chunk being generated
- int chunkZ - the Z Position of the chunk being generated
- int minY - the lowest point (Y level) that this ore should generate
- int maxY - the Highest Point this ore should generate
- Block ore - the Block you want to spawn
- int meta - the meta level of said block
- int size - number of blocks in a vein (this should really never be over 8, except in situations like Red Power's Marble)
if you look at the generateSurface() method, you'll see I call the generateOre() method with needed arguments to build the chunks as I like. without writing what would have been 7 for loops. This is not a complicated nor advanced tactic, and I'm sure anyone with experence would have thought of this. However, this approach tough to new modders will definitely save a bit of time, a bit of typing, and get modders to be able to see the fruits of their labor sooner.
Hope this helps :-)
EDIT: cant set Minimum Y coordinate. Saw it on a Youtube Vid., I thought it was suspect, but tossed it in anyway. - doesn't work at all. The rest of the code is legit though.
public String getItemNameIS(ItemStack i){
try{ //Just in case of NullPointerException
return names[i.getItemDamage()];
}catch(Exception e){
return "";
}