
RetsuWolf
Members-
Posts
30 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
RetsuWolf's Achievements

Tree Puncher (2/8)
0
Reputation
-
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); } }
-
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.
-
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
-
[1.6.4]Surface Block Generation Help Needed
RetsuWolf replied to RetsuWolf's topic in Modder Support
Any ideas? Sorry for the bump this is kind of urgent. -
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!
-
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.
-
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!
-
[1.6.4]Effects On Collision With Custom Block Help?
RetsuWolf replied to RetsuWolf's topic in Modder Support
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! -
[1.6.4]Effects On Collision With Custom Block Help?
RetsuWolf replied to RetsuWolf's topic in Modder Support
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! -
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!
-
[1.6.4]Effects On Collision With Custom Block Help?
RetsuWolf replied to RetsuWolf's topic in Modder Support
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! -
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!
-
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
-
[SOLVED][1.6.4]How To Make Trees Generate Biome Specific?
RetsuWolf replied to RetsuWolf's topic in Modder Support
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! -
[SOLVED][1.6.4]How To Make Trees Generate Biome Specific?
RetsuWolf posted a topic in Modder Support
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?