Jump to content

Kander16

Members
  • Posts

    403
  • Joined

  • Last visited

Everything posted by Kander16

  1. Thanks. Now it generates strawberry bushes, but I can't control how much bushes are generated. (minimal bushes to spawn, maximum bushes to spawn and the chance to spawn) No mather what I use as values, it seems to have no effect. Thanks. Code: http://pastebin.com/f0yKEK72 http://pastebin.com/d1buwQVv
  2. How do I do this then? Cause GameRegistry.registerWorldGenerator(new BushGeneration(), 0); Gives an error that I need to implements IWorldGenerator? Or iam just being stupid. Thanks.
  3. Hi, I have some trouble with generating my bush (strawberry bush) into the world and let it randomly spawn uppon the surface. I took the code of WorldGenPumpkin and changed it but that does not work. This is my code: package com.chef.mod.generate; import java.util.Random; import com.chef.mod.Chef; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; public class BushGeneration extends WorldGenerator { public int bugger; private static final String __OBFID = "CL_00000428"; public boolean generate(World world, Random random, int x, int y, int z) { for (int l = 0; l < 64; ++l) { int i1 = x + random.nextInt( - random.nextInt(; int j1 = y + random.nextInt(4) - random.nextInt(4); int k1 = z + random.nextInt( - random.nextInt(; if (world.isAirBlock(i1, j1, k1) && world.getBlock(i1, j1 - 1, k1) == Blocks.grass && Chef.bushStrawberryBush.canPlaceBlockAt(world, i1, j1, k1)) { world.setBlock(i1, j1, k1, Chef.bushStrawberryBush, random.nextInt(75), 10); } } return true; } } Thanks.
  4. Thanks, I am trying to work at the HarvestDropsEvent in my "IceDrops" class file. But I don't really now how to get the ice dropping my ice shards. Cause I don't know how to set the quantity and the harvestlevel and things like that. I hope I am working in the right direction. This is my code: package com.chef.mod.event; import java.util.Random; import net.minecraft.entity.passive.EntitySquid; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent; import com.chef.mod.Chef; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class IceDrops { public static double rand; public Random r = new Random(); @SubscribeEvent public void onBlockDestroyed(HarvestDropsEvent event) { if(event.block == Blocks.ice) { event.drops.add(new ItemStack (Chef.fuelIceShard)); } } }[/Code]
  5. Hi, I am making a new item for a vanilla block (Ice block). I have created Ice Shards, and you could get it when breaking Ice Blocks. I don't think it's hard, but sometimes you just don't know how to get this to work. Thanks for helping.
  6. Decoratebiome event, right? If you ask me, I think this is where it generates the pumpkins and things like that. @HasResult public static class Decorate extends DecorateBiomeEvent { /** Use CUSTOM to filter custom event types */ public static enum EventType { BIG_SHROOM, CACTUS, CLAY, DEAD_BUSH, LILYPAD, FLOWERS, GRASS, LAKE, PUMPKIN, REED, SAND, SAND_PASS2, SHROOM, TREE, CUSTOM } public final EventType type; public Decorate(World world, Random rand, int worldX, int worldZ, EventType type) { super(world, rand, worldX, worldZ); this.type = type; } } }[/Code] but how do I let him generate my own strawberrybush? Thanks.
  7. Hi, I was trying to update my mod to version 1.8, but I got a problem with the setTexture name. I have been looking for it in the Item.class file, Is it now with the setUnlocalizedName to? Thanks.
  8. Ok, I will try it out.
  9. Hi, Do i need to register it too before this actually works? I think of world.setBlock(i1, j1, k1, Chef.bushStrawberryBush, random.nextInt(75), 10); that the random.nextInt(75), 10) the chance to spawn is. Thanks.
  10. Hi, My question is that I wanted to create a plant (StrawberryBush) that grows on top of grass, how do I do this? I think its the easiest way with the events, but I don't know how to do this. Thanks.
  11. Ok, Thanks
  12. Yes, your right. Maybe I should look for tutorials. But can you give an example? Then I am gonna try to understand what it means. After that, I AM gonna look for some tutorials on google. Thanks for helping. ~Rob
  13. This is my full code: http://pastebin.com/deAZFijA Please, take a look at it.
  14. For the level to harvest it, Something like this? @Override public int getHarvestLevel(int metadata) { if (this == Chef.oreSaltOre) { this.getHarvestLevel(2); } else if (this == Chef.oreSaltOre2) { this.getHarvestLevel(1); } return getHarvestLevel(0); }
  15. How do I do this then?
  16. Ok, I have tried to work it out. But I can only mine the blocks with my pickaxe. Not the shovel This is my code: @Override public int getHarvestLevel(int metadata) { if (this == Chef.oreSaltOre) { this.setHarvestLevel("pickaxe", 2); } else if (this == Chef.oreSaltOre2) { this.setHarvestLevel("shovel", 1); } return metadata; }
  17. Hi, Iam wondering if i could make different harvest levels for different blocks in one class (MyBlockOre.class). If it can't, how did vanilla minecraft did? In what class? Thanks.
  18. Thank you. This actually works!
  19. This is what I got, http://pastebin.com/AAfqBgW5
  20. Ok, So i wanted to create a new crop that works like a sugar cane (corn). With a sugar cane plant, you collect the sugar cane, but you cannot eat them. I want to have a corn plant, that gives you the items of it. You can use it for planting another corn, or you could eat it as well. Now, the problem is that a sugar cane item extends Item, not Itemfood. And i can't get it to work. Cause when iam trying to plant the corn. It just crashes the whole game. This is my code: http://pastebin.com/V53FNAj1 Thanks.
  21. Yes, But ItemReed is an Item, not ItemFood I was trying to let it extends ItemFood, not Item anymore but then i am having trouble with the constructor.
  22. Hello, I was wondering how i could make a new food (corn) that allows you to place the block to (like ItemSeedFood) but then with a sort of reed. Thanks.
×
×
  • Create New...

Important Information

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