Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Neo2k

Members
  • Posts

    16
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Neo2k's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. Can someone tell me what is wrong?
  2. But can you please explain me what i must do in this case?!
  3. I hope you can explain me why I do this with a tutorial and the maker don't explain for what the numbers are...
  4. Hello together, i have a problem with my custom crop. Here is the code: package xooth.core.blocks; import java.util.Random; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.BlockCrops; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.network.packet.Packet3Chat; import net.minecraft.server.MinecraftServer; import net.minecraft.util.Icon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import xooth.core.CoreItems; import xooth.core.blocks.*; public class PlantTomato extends BlockCrops { @SideOnly(Side.CLIENT) private Icon[] iconArray; public PlantTomato(int par1) { super(par1); } @SideOnly(Side.CLIENT) public Icon getIcon(int par1, int par2) { if (par2 < 7) { if (par2 == 6) { par2 = 5; } return this.iconArray[par2 >> 1]; } else { return this.iconArray[4]; } } protected int getSeedItem() { return CoreItems.tomatoSeed.itemID; } protected int getCropItem() { return CoreItems.tomatoFood.itemID; } public int idDropped(int par1, Random par2Random, int par2) { return par1 == 7 ? this.getCropItem() : this.getSeedItem(); } public int quantityDropped(Random par1Random) { return 1; } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister reg) { this.iconArray = new Icon[5]; for (int i = 0; i < this.iconArray.length; i++) { this.iconArray[i] = reg.registerIcon("Core:tomatoCrop_" + i); } } } The Problem is: my tomato plant has 5 images but the fourth image is skipped. If i use Bonemeal on the plant I must use it one time longer that means if i see the correct last image from the tomato plant i must use one more bonemeal to complete the plant. Can someone help me with my problem? Sorry for not so good english
  5. Hey, it doesn't work... the same issue than before.. this is actually my onBlockDestroyedByPlayer Code: @Override public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) { if(par1World.isRemote) { Random chance = new Random(); int chance1 = chance.nextInt(10); if (chance1 == 2) { chance1 = chance.nextInt(3); if (chance1 == 0) { par1World.spawnEntityInWorld(new EntityItem(par1World, par2, par3, par4, new ItemStack(CoreItem.malachit.itemID, 1, 0))); } else if (chance1 == 1) { par1World.spawnEntityInWorld(new EntityItem(par1World, par2, par3, par4, new ItemStack(CoreItem.rubin.itemID, 1, 0))); } else if (chance1 == 2) { par1World.spawnEntityInWorld(new EntityItem(par1World, par2, par3, par4, new ItemStack(CoreItem.saphir.itemID, 1, 0))); } } } } EDIT: Oh i forgot to write the "!" for the code... my failure.. i have change if(par1World.isRemote) to if(!par1World.isRemote) and now it works fine. But can someone explain me what does the function "par1World.isRemote"? Thanks
  6. oh okay, can you try to solve the problem for/with me when you are at home? I test further in the meantime...
  7. I improve me... Its not fixed... Any Idea?
  8. yes, this is exactly this what i want to do. the code works, but a litte issue is there. Here is the function: public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) { par1World.spawnEntityInWorld(new EntityItem(par1World, par2, par3, par4, new ItemStack(CoreItem.rubin, 1, 0))); } But when i break the block ingame, there are 3 Items to pickup, the block self, the one item i let spawn and the item again, but i cant pick up.. Before Pick up: After Pick up: Have you an idea why are spawning 2 rubins in my case? Thanks already Edit: I dont know how, but now it works probably Thanks a lot
  9. yes of course. This is that what i mean
  10. i mean not different drops on a random number.. i want that when i break the block, that drops 2-3 different items/blocks with a different quantity. is that possible? edit: i found this piece of code on minecraft forum: public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { if (!par1World.isRemote) { int var8 = this.quantityDroppedWithBonus(par7, par1World.rand); for (int var9 = 0; var9 < var8; ++var9) { if (par1World.rand.nextFloat() <= par6) { int var10 = this.idDropped(par5, par1World.rand, par7); int var11 = 262; if(dropArrows) { this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(var10, 1, this.damageDropped(par5))); this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(var11, 64, this.damageDropped(par5))); dropArrows = false; } else { if (var10 > 0) { this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(var10, 1, this.damageDropped(par5))); } } } } } } but i dont know how to integrate this for my usage...
  11. You must register the names in your mod class. Example: public void load(FMLInitializationEvent event) { LanguageRegistry.addName(Mod_ParallelWorlds.NightStone, "Night Stone"); }
  12. Hey together, i have a problem. I want that one block drop multiple Items/Blocks with different quantity. Can anyone show me an example on how to do this? Thanks a lot
  13. Hey together, I search for a few days good tutorials about how to making a custom chest, but every Tutorial i found is different than the other one and every of these tutorials aren't work probably. Have anyone of you a good Tutorial about how to making a custom chest? Thanks
×
×
  • Create New...

Important Information

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