Jump to content

Dus998

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by Dus998

  1. I think he means how does he specify which of the subblocks drops what item. I think that because I want to know this too... It'd certainly save on ID's! If you wanna specify which metadata should be dropped, use the damageDropped method. Lets say for example, I wanted to make a custom wool set that dropped a custom dye. The wools are all subblocks (500:1, 500:2 etc) How would I specify that MyWoolRed drops red dye, whilst MyWoolBlue drops blue dye? (I assume this is what the OP meant. He's not replied since the post so just guessing; but it's something I want to know ) sorry for not responding quickly, but yea this is what i am trying to figure out, none of the item-dropping ores in vanilla mc are metadata blocks so i couldnt look at them to see how to make a metadata ((500:12) in my case) drop a specific item when harvested (5000) why don't you read the couple posts above you? All of those are on how to make a block drop a item with a Metadata, i want to have a Metadata block drop a item without editing the drops of the 15 other blocks on the metadata
  2. I think he means how does he specify which of the subblocks drops what item. I think that because I want to know this too... It'd certainly save on ID's! If you wanna specify which metadata should be dropped, use the damageDropped method. Lets say for example, I wanted to make a custom wool set that dropped a custom dye. The wools are all subblocks (500:1, 500:2 etc) How would I specify that MyWoolRed drops red dye, whilst MyWoolBlue drops blue dye? (I assume this is what the OP meant. He's not replied since the post so just guessing; but it's something I want to know ) sorry for not responding quickly, but yea this is what i am trying to figure out, none of the item-dropping ores in vanilla mc are metadata blocks so i couldnt look at them to see how to make a metadata ((500:12) in my case) drop a specific item when harvested (5000)
  3. I have a set of metadata ores and i want one of them to drop a certain item(nikolite in this case) heres the three files used Item ore Block package dus998.mods.oresgalore; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; public class ItemOreBlock extends ItemBlock { public ItemOreBlock(int par1) { super(par1); setHasSubtypes(true); } public String getUnlocalizedName(ItemStack itemstack) { String name = ""; switch(itemstack.getItemDamage()) { case 0: { name = "Ruby Ore"; break; } case 1: { name = "Sapphire Ore"; break; } case 2: { name = "Lead Ore"; break; } case 3: { name = "Tungsten Ore"; break; } case 4: { name = "Silver Ore"; break; } case 5: { name = "Tin Ore"; break; } case 6: { name = "Copper Ore"; break; } case 7: { name = "Cobalt Ore"; break; } case 8: { name = "Zinc Ore"; break; } case 9: { name = "Nickel Ore"; break; } case 10: { name = "Basalt"; break; } case 11: { name = "Marble"; break; } case 12: { name = "Nikolite"; break; } default: name = "broken"; } return getUnlocalizedName() + "." + name; } public int getMetadata(int par1) { return par1; } } Ore block package dus998.mods.oresgalore; import java.util.ArrayList; import java.util.List; import java.util.Random; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.world.World; public class OreBlock extends Block{ public OreBlock(int par1, Material par2Material) { super(par1, par2Material); this.setCreativeTab(CreativeTabs.tabBlock); } @SideOnly(Side.CLIENT) private Icon[] icons; @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { icons = new Icon[13]; for(int i = 0; i < icons.length; i++) { icons[i] = par1IconRegister.registerIcon(OresMain.modid + ":" + (this.getUnlocalizedName().substring(5)) + i); } } @SideOnly(Side.CLIENT) public Icon getIcon(int par1, int par2) { return icons[par2]; } @SideOnly(Side.CLIENT) public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { for (int var4 = 0; var4 < 13; ++var4) { par3List.add(new ItemStack(par1, 1, var4)); } } } Ores main class package dus998.mods.oresgalore; import java.io.File; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.Property; import cpw.mods.fml.common.IWorldGenerator; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.PreInit; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @Mod(modid = OresMain.modid, name = "Ores Galore", version = "1") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class OresMain { public static final String modid = "oresgalore"; public static Block OreBlock; public static Item ItemNikolite; EventManager eventmanager = new EventManager(); @PreInit public void PreInit(FMLPreInitializationEvent event) { dus998.mods.oresgalore.ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath() + " Ores Galore")); } @Init public void load(FMLInitializationEvent event) { ItemNikolite = new ItemNikolite(Variables.Niko).setUnlocalizedName("Nikolite"); GameRegistry.registerItem(ItemNikolite, "Nikolite"); LanguageRegistry.addName(new ItemStack(ItemNikolite, 1, 0), "Nikolite"); OreBlock = new OreBlock(Variables.oreID, Material.rock).setUnlocalizedName("OreBlock"); GameRegistry.registerBlock(OreBlock, ItemOreBlock.class, modid + (OreBlock.getUnlocalizedName().substring(5))); LanguageRegistry.addName(new ItemStack(OreBlock, 1, 0), "Ruby Ore"); LanguageRegistry.addName(new ItemStack(OreBlock, 1, 1), "Sapphire Ore"); LanguageRegistry.addName(new ItemStack(OreBlock, 1, 2), "Tungsten Ore"); LanguageRegistry.addName(new ItemStack(OreBlock, 1, 3), "Lead Ore"); LanguageRegistry.addName(new ItemStack(OreBlock, 1, 4), "Silver Ore"); LanguageRegistry.addName(new ItemStack(OreBlock, 1, 5), "Tin Ore"); LanguageRegistry.addName(new ItemStack(OreBlock, 1, 6), "Copper Ore"); LanguageRegistry.addName(new ItemStack(OreBlock, 1, 7), "Colbalt Ore"); LanguageRegistry.addName(new ItemStack(OreBlock, 1, , "Zinc Ore"); LanguageRegistry.addName(new ItemStack(OreBlock, 1, 9), "Nickel Ore"); LanguageRegistry.addName(new ItemStack(OreBlock, 1, 10), "Basalt"); LanguageRegistry.addName(new ItemStack(OreBlock, 1, 11), "Marble"); LanguageRegistry.addName(new ItemStack(OreBlock, 1, 12), "Nikolite"); GameRegistry.registerWorldGenerator(eventmanager); } }
  4. Thanks for tthe help, all i needed to do was the + 256 thing, also i had to keep the get next id in because it had to be (int, string) and not just (string)
  5. I figured this was a problem with forge due to the crash log not saying anything about my mod i have tested this with both 497 and 499 forge builds the eclipse output code here's my code for my creative tabs part in core file individual files note: eclipse is not detecting errors and the game doesnt crash until i attempt to go to tab 2 of the creative inventory
  6. FBalazs I made this a list and added your api to it Also to the person 2 posts above this, i'm afraid that this can't be done with my current level of expertise, in other words i havn't learned how to read from schematic files yet however i might do this after i learn that because i have been wanting to use something like that for some time now
  7. here are some world generation files that I wrote to generate blocks exactly where I wanted them I reformatted them to be as generic as they can be so, Enjoy and use as you wish! first one is called WorldGenMinableNearBlock to use do (new WorldGenMinableNearBlock( blockid to spawn, metadata for that block, the number of blocks, and the block it will spawn near) the next one is so that ores will spawn in the nether and this must be ran in the generateNether in a properly formatted world generation file to run do (new WorldGenMinableNether( Block Id, The metadata for that block, the number of blocks in vein) FBalazs's generation API http://www.minecraftforum.net/topic/1608655-fbalazss-modding-api/ If you want some generation code done for you I'll gladly do it! funny thing is that i have no idea how to make a tile entity but this is a breeze for me. lol. if you know of a good tile entity tutorial, video if possible, please point me toward it
  8. Thanks it helps quite a bit
  9. I am new to modding, i already have mcp and eclipse set up and i have a simple block so my question is how do i make / use a custom texture and how do i set custom things like hardness and drops? my code test.common package test.common; import cpw.mods.fml.common.Mod; import net.minecraft.src.Block; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid = "Dus998_TestMod" , name = "Test" , version ="0.1") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class Test { public static Block TestBlock; @Init public void load(FMLInitializationEvent event) { TestBlock = new blockTestBlock(250, 0).setBlockName("TestBlock"); GameRegistry.registerBlock(TestBlock); LanguageRegistry.addName(TestBlock, "Test Block"); } } the block package test.common; import net.minecraft.src.Block; import net.minecraft.src.CreativeTabs; import net.minecraft.src.Material; public class blockTestBlock extends Block { public blockTestBlock(int id, int texture) { super(id, texture, Material.cloth); this.setCreativeTab(CreativeTabs.tabBlock); } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.