Jump to content

RetsuWolf

Members
  • Posts

    30
  • Joined

  • Last visited

Everything posted by RetsuWolf

  1. Thank you guys a lot for the help, I really appreciate it and I've applauded you all as I have managed to get this to work. For anyone curious I changed the code in the event class from this. @ForgeSubscribe public void bonemealUsed(BonemealEvent event) { if(event.world.getBlockId(event.X, event.Y, event.Z) == Main.blockTulipTreeSapling.blockID) { ((BlockTulipTreeSapling)Main.blockTulipTreeSapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand); event.setResult(Result.ALLOW); } } To this. @ForgeSubscribe public void bonemealUsed(BonemealEvent event) { if(event.world.getBlockId(event.X, event.Y, event.Z) == Main.blockTulipTreeSapling.blockID && event.world.isRemote == false) { ((BlockTulipTreeSapling)Main.blockTulipTreeSapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand); event.setResult(Result.ALLOW); } }
  2. Thank you for the reply, I've figured out part of it. For some reason it's going through the event code twice. When I print something out in the console where all the other code is, it comes up twice. I have no idea why this is and it's incredibly frustrating. Have any ideas? And of course, any help is greatly appreciated.
  3. Greetings! I've been trying to figure out why my bonemeal event for custom trees isn't working. I've got it to generate a tree but not in the manner I intended. Have a look. This is what happens when I initially bonemeal the sapling. When I re-log or right click on the top leaf blocks they disappear. The second image is what I want the outcome to be. I really don't understand why this isn't working could anyone help me out? It would be extremely appreciated as I have been trying to figure this out for quite some time and I'm getting frustrated. I assume what's happening is that when I bonemeal the sapling it tries to create a tree twice but only creates one but the blocks are still there until they're updated. I have no idea how to fix this. Again any help is really appreciated! Thank you! Custom Tree World Gen Class - http://pastebin.com/HgK6KFEe Custom Tree Sapling Class - http://pastebin.com/G59Btuga Bonemeal Event Class - http://pastebin.com/3kMRMKC2
  4. Any ideas? Sorry for the bump this is kind of urgent.
  5. Greetings! I've been working on a mod and I'm trying to generate random snow blocks on the surface of a custom biome. I've made it generate although not the way I intended. When I use the following code. public void decorate(World par1World, Random par2Random, int chunk_X, int chunk_Z) { super.decorate(par1World, par2Random, chunk_X, chunk_Z); WorldGenFlowers snow = new WorldGenFlowers(Block.blockSnow.blockID); boolean doGen = TerrainGen.decorate(par1World, par2Random, chunk_X, chunk_Z, FLOWERS); for (int j = 0; doGen && j < 10; ++j) { int k = chunk_X + par2Random.nextInt(16); int l = par2Random.nextInt(128); int i1 = chunk_Z + par2Random.nextInt(16); int i = par1World.getBlockId(k, l, i1); if( i == Main.blockSulfur.blockID) { par1World.setBlock(k, l, i1, i); } } } It just generates snow blocks in groups on top of the surface block. I'd like to make it so it will generate snow blocks randomly replacing random surface blocks. Anyone have any ideas or suggestions? Any help is greatly appreciated!
  6. Sorry I hadn't realized it was some of the code was changing the text in the post anyways perhaps you could take another look at it? Thank you for the reply by the way.
  7. Greetings! I'm trying to register a custom wood blocks sub blocks although it doesn't seem to want to work. Here is what I have. public String[] woodName = new String[] { "Red Wood", "Blah"}; @Mod.EventHandler public void load(FMLInitializationEvent event) { GameRegistry.registerBlock(blockTreeBlock, "BlockTreeBlock"); for (int i = 1; i < 2; i++){ LanguageRegistry.addName(new ItemStack(blockTreeBlock, i), woodName[i]); } } It gives both the blocks the "Thicket Wood" name. I don't understand why it's not giving them each different names. Does anyone know what's wrong here? Any help is really appreciated!
  8. I have just one small problem now. I am trying to give the entity the effect for one second an infinite amount of times as long as they're on the block. I've tried this. public void onEntityWalking(World par1World, int par2, int par3, int par4, Entity par5Entity) { for(int i = 0; i > 1; i++) { ((EntityLivingBase) par5Entity).addPotionEffect(new PotionEffect(Potion.blindness.id, par4)); i = 0; } } But it's not going through the loop at all and I don't understand why. If I get rid of the loop and do this. public void onEntityWalking(World par1World, int par2, int par3, int par4, Entity par5Entity) { ((EntityLivingBase) par5Entity).addPotionEffect(new PotionEffect(Potion.blindness.id, 2, 4)); } It adds the blindness effect for one second every time I step on the block which is what I want except I want it to happen infinitely as long as an entity is on the block. Any ideas? Perhaps there's a way to make it update every tick so that it goes through the code every tick? Any help is greatly appreciated!
  9. I can't tell you how thankful I am for your reply as I've been trying to work this problem out for quite some time. I applaud you and thanks again!
  10. Greetings! I'm trying to make a custom log block and I think I've gotten half of it done but I don't know how to actually name the block so that it will show up in Creative Tab. Could someone help me out? Here is the code. Log Block Class package fantasy_biomes.blocks; import java.util.List; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockLog; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import fantasy_biomes.Main; public class BlockTreeBlock extends BlockLog { public Icon[] icons; public String[] textureNames = new String[] { "redwood" }; public BlockTreeBlock(int id) { super(id); this.setHardness(1.5F); this.setResistance(5F); this.setStepSound(Block.soundWoodFootstep); setBurnProperties(this.blockID, 5, 20); } @Override @SideOnly(Side.CLIENT) public Icon getIcon (int side, int metadata) { int tex = (metadata % 4); int orientation = metadata / 4; switch (orientation) //Ends of logs { case 0: if (side == 0 || side == 1) return icons[tex + 4]; break; case 1: if (side == 4 || side == 5) return icons[tex + 4]; break; case 2: if (side == 2 || side == 3) return icons[tex + 4]; break; } return icons[tex]; } @Override @SideOnly(Side.CLIENT) public void registerIcons (IconRegister iconRegister) { this.icons = new Icon[textureNames.length]; for (int i = 0; i < this.icons.length; ++i) { this.icons[i] = iconRegister.registerIcon(Main.modid + ":" + textureNames[i]); } } public int idDropped (int par1, Random par2Random, int par3) { return this.blockID; } @Override public int damageDropped (int meta) { return meta % 4; } public int getFlammability (IBlockAccess world, int x, int y, int z, int metadata, ForgeDirection face) { return metadata % 4 != 2 ? blockFlammability[blockID] : 0; } public int getFireSpreadSpeed (World world, int x, int y, int z, int metadata, ForgeDirection face) { return metadata % 4 != 2 ? blockFireSpreadSpeed[blockID] : 0; } @SideOnly(Side.CLIENT) @Override public void getSubBlocks (int par1, CreativeTabs par2CreativeTabs, List par3List) { for (int i = 0; i < 1; i++) par3List.add(new ItemStack(par1, 1, i)); } } Basically I'm just wanting to know how to name sub blocks so that they'll show in Creative Tab. Any help is greatly appreciated! Thank you!
  11. Thank for the reply! I'm glad you're trying to help. Anyways I've added this method into the block's class. public void onEntityWalking(World par1World, int par2, int par3, int par4, Entity par5Entity) { par5Entity.addPotionEffect(new PotionEffect(Potion.blindness.id, 600, 4)); } Although it's wanting me to add a cast to par5Entity so it will look like this. public void onEntityWalking(World par1World, int par2, int par3, int par4, Entity par5Entity) { ((Object) par5Entity).addPotionEffect(new PotionEffect(Potion.blindness.id, 600, 4)); } When I do this it comes up with a quick fix that says "Change method receiver cast". So when I click on the quick fix it does nothing. Any other ideas as to why this isn't working? I've been trying to figure this out for at least 3 hours and help is greatly appreciated!
  12. Greetings! I've been trying to figure out how I could add potion effects when an entity is on a certain custom block. I've been messing around with a lot of stuff specifically using the following method. public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { } I know how to make it so when someone collides with the block it damages them but it would be EXTREMELY helpful if someone could tell me how to add potion effects on collision with the block? Any help is greatly appreciated!
  13. Greetings! I'm having problems with custom tree generation. I know how to make a custom tree but I'm not sure why it's generating this way. The spruce log generates but it doesn't go through the ice. What it looks like on the inside when it's is cut in half. What I want the tree to look like on the inside. Anyone know why this is happening or how to fix it? Any help is really appreciated! Custom Tree WorldGen Class http://pastebin.com/9BBehFEM
  14. Thank you this really helped out! For anyone who doesn't know how to fix this in the tree manager class for your custom tree I just added an if/else statement. This is what it looked like. package fantasy_biomes.trees.managers; import java.util.Random; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import cpw.mods.fml.common.IWorldGenerator; import fantasy_biomes.Main; import fantasy_biomes.trees.WorldGenYourTree; public class YourTreeManager 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(world, random, chunkX * 16, chunkZ * 16); case 0: generateSurface(world, random, chunkX * 16, chunkZ * 16); case 1: generateEnd(world, random, chunkX * 16, chunkZ * 16); } } private void generateEnd(World world, Random random, int x, int z) { } private void generateSurface(World world, Random random, int x, int z) { if(world.getBiomeGenForCoords(x, z) == Main.biomeYourBiome){ for (int i = 0; i < 20; i++){ int Xcoord1 = x + random.nextInt(16); //where in chuck it generates int Ycoord1 = random.nextInt(100); //how high it generates int Zcoord1 = z + random.nextInt(16); //where in chunk it generates new WorldGenYourTree(true).generate(world, random, Xcoord1, Ycoord1, Zcoord1); } } if(world.getBiomeGenForCoords(x, z) != Main.biomeYourBiome){ return; } } private void generateNether(World world, Random random, int x, int z) { } } Also I discovered that just by deleting the tree manager class and not registering the tree as a new world gen in the main class of the mod and simply call the world gen class in your custom biomes class than that will also fix the problem. Thanks again for the help!
  15. Greetings! I've been wondering how to make custom trees generate biome specifically? I have like 10 new trees but they all generate in every biome. The only way I could think of making them spawn in the biome I want is by changing that biomes top block to a custom block and making the tree only generate on that custom block. I feel like there's an easier way around this. Anyone have any ideas?
  16. Greetings! I'm trying to create a tree with custom log block but whenever I use my custom log block it crashes whenever the tree is being generated. Any ideas why? Any help is greatly appreciated! Crash Report - http://pastebin.com/GYuuGqJL Custom Tree WorldGen Class - http://pastebin.com/1rBgLWBk Custom Tree Manager Class - http://pastebin.com/jbb84bgY Custom Tree Log Block Class - http://pastebin.com/0D5p5J59 Custom Tree Leaves Class - http://pastebin.com/4XmC4CcW
  17. Greetings! I'm trying to add a custom flower to a mod I'm making but I can't get it to generate. I thought this might be similar to tree generation so I basically just copied over any that had to do with flowers in the proper classes but it still doesn't generate. Does anyone know of a tutorial or something that could help? Any help is really appreciated!
  18. Greetings! I can't quite figure out how to add more than one tree generator to my biome. Here is the biome's code. package fantasy_biomes.biomes; import java.util.Random; import fantasy_biomes.Main; import fantasy_biomes.trees.WorldGenTulipTree; import net.minecraft.block.Block; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.gen.feature.WorldGenerator; public class BiomeEnchantedGrove extends BiomeGenBase { public BiomeEnchantedGrove(int par1) { super(par1); this.minHeight = 0.1F; this.maxHeight = 0.6F; this.spawnableMonsterList.clear(); this.spawnableCreatureList.clear(); this.topBlock = ((byte)Main.blockEnchantedGrass.blockID); this.fillerBlock = ((byte)Block.dirt.blockID); this.theBiomeDecorator.treesPerChunk = 5; this.setBiomeName("Enchanted Grove"); this.theBiomeDecorator.waterlilyPerChunk = 5; } public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { return (WorldGenerator)new WorldGenTulipTree(true); } } Any help is greatly appreciated!
  19. Thank you for the reply and here is the missing textures error I get. 2014-05-12 05:53:01 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/blocks/BlockTulipTreeLeavesOpaque.png 2014-05-12 05:53:01 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/blocks/BlockTulipTreeLeaves.png 2014-05-12 05:53:01 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/blocks/MISSING_ICON_TILE_203_BlockTulipSapling_Tulip.png And I've named the textures to BlockTulipTreeLeaves along with BlockTulipTreeLeavesOpaque and I've also tried changing the texture named to "modname/BlockTulipTreeLeaves/" or Main.modid + ":" + "BlockTulipTreeLeaves" yet nothing seems to be working. The texture file is of course.
  20. Greetings! I've made a custom leaf block for a custom tree although I don't understand how to get the texture to show. I've looked at other people's custom leaf block source code but none of the functions have methods assigned in the class so they don't work. If someone could tell me what I'm doing wrong or direct me to custom leaf class code that has working textures that would be excellent. Any help is greatly appreciated! Custom Leaf Class - http://pastebin.com/xTsnqauG
  21. Greetings! I've been working on a mod recently and I want to create a sapling for my tree that will grow when bonemealed. Anyone know any good tutorials for this? I've been been looking around in source code for this though I haven't been able to find anything. Any help is greatly appreciated! Also if anyone knows how to make a certain tree generate on only certain blocks that would be excellent if you could inform me! Thank you!
  22. PLEASE NOTE - I don't intend on releasing edited Minecraft source code contained in the mod. Greetings! I've been working on a mod recently that focuses mainly on adding new biomes. I don't like having to search for my biome in a new world every time I make a new biome one or edit an existing one. The way to get around this is to change the allowed biomes in WorldChunkManager class to only my custom biome. For example to make my biome spawn as soon as a new world is created I would change: To However I cannot edit ANY classes that come with Minecraft. Again note that the class editing is only temporary as I just want to make it easier to see if a biome worked or not. Thank you! Any help is greatly appreciated!
  23. Greetings! I've been working on a mod recently and I've come across a problem. I know how to make a dimension and biomes and also add a biome to that dimension although I don't know how to add multiple biomes to one dimension. Anyone that could help me out? If you know of a tutorial please be sure to reference it below. Any help is greatly appreciated!
  24. Greetings! I've been trying to add a mob lately and have had no success. If ANYONE knows of any good tutorials for adding mobs in 1.6.4 it would be greatly appreciated if you could direct me to the tutorial. Anyways when I try to register the mob in my ClientProxy class it gives me an error. In Proxy Class: RenderingRegistry.registerEntityRenderingHandler(EntityGiantRat.class, new RenderGiantRat(new ModelGiantRat(), 0.5F)); It wants me to change .registerEntityRenderingHandler() to .registerBlockHandler() but when I do change it it wants me to change it back to .registerRenderingHandler() and so on. Does ANYONE know how to add custom mobs or why this isn't working? I've been trying to figure this out for hours and hours. Any help is greatly appreciated!
  25. Thank you! It has worked wonderfully. The tree now only spawns in my own biome.
×
×
  • Create New...

Important Information

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